@atolis-hq/wake 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -108,4 +108,4 @@ export function resolveWakeVersion(options = {}) {
108
108
  return `g${headHash.slice(0, 7)}`;
109
109
  return '0.1.0-dev';
110
110
  }
111
- export const wakeVersion = "g9556ab3";
111
+ export const wakeVersion = "g48e47f0";
@@ -12,3 +12,4 @@ export interface SandboxRuntimeRouter {
12
12
  exec(wakeRoot: string, arguments_: readonly string[]): Promise<void>;
13
13
  }
14
14
  export declare function main(argv?: readonly string[], dependencies?: TargetMainDependencies): Promise<void>;
15
+ export declare function isMainEntrypoint(moduleUrl: string, invokedPath: string | undefined): boolean;
package/dist/src/main.js CHANGED
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawn } from 'node:child_process';
3
+ import { realpathSync } from 'node:fs';
3
4
  import { access } from 'node:fs/promises';
4
5
  import { join } from 'node:path';
5
- import { pathToFileURL } from 'node:url';
6
+ import { fileURLToPath, pathToFileURL } from 'node:url';
6
7
  import { initialiseWakeRoot } from './bootstrap/initialise.js';
7
8
  import { wakeVersion } from './bootstrap/version.js';
8
9
  import { parseWakeCommand, runWakeCommand, sandboxUsage, usage, } from './surfaces/index.js';
@@ -173,7 +174,12 @@ function runDocker(arguments_) {
173
174
  : reject(new Error('docker ' + arguments_.join(' ') + ' exited with code ' + String(code))));
174
175
  });
175
176
  }
176
- if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
177
+ export function isMainEntrypoint(moduleUrl, invokedPath) {
178
+ return (invokedPath !== undefined &&
179
+ pathToFileURL(realpathSync(fileURLToPath(moduleUrl))).href ===
180
+ pathToFileURL(realpathSync(invokedPath)).href);
181
+ }
182
+ if (isMainEntrypoint(import.meta.url, process.argv[1])) {
177
183
  try {
178
184
  await main();
179
185
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atolis-hq/wake",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Local autonomous agent control plane for software development",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {