Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

1.2 KB
Raw Blame
'use strict'

// Tarball prebuilt shares build/Release path and loads under Node/Electron even when JS exposes CreationTime that binary ignores.
// Require patched addon’s supportedProcessDataFlags export as binary proof, shared by Node/Electron probes.

/** `ProcessDataFlags::CREATIONTIME` in src/process.h. */
const CREATION_TIME_FLAG = 4

function assertWindowsProcessTreeCreationTime({ module, platform = process.platform }) {
  if (platform !== 'win32') {
    return
  }
  const supported = module?.supportedProcessDataFlags
  if (
    typeof supported === 'number' &&
    (supported & CREATION_TIME_FLAG) !== 0 &&
    typeof module?.getProcessCreationTime === 'function'
  ) {
    return
  }
  throw new Error(
    [
      '@vscode/windows-process-tree does not report CreationTime support with a synchronous identity getter',
      `(supportedProcessDataFlags=${String(supported)}).`,
      'This is an unpatched or older binary, so process identities or synchronous',
      'profile-owner recovery are unavailable.',
      'Rebuild it from source so config/patches/@[email protected] applies.'
    ].join(' ')
  )
}

module.exports = { assertWindowsProcessTreeCreationTime, CREATION_TIME_FLAG }