@shawaze/agentspace 0.3.1 → 0.3.2

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.
Files changed (2) hide show
  1. package/dist/cli.js +12 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli.ts
4
+ import { realpathSync } from "fs";
4
5
  import { pathToFileURL } from "url";
5
6
 
6
7
  // src/shape.ts
@@ -1030,7 +1031,7 @@ async function doctorCommand(workspaceDir, today, opts = {}) {
1030
1031
  }
1031
1032
 
1032
1033
  // src/version.ts
1033
- var VERSION = "0.3.1";
1034
+ var VERSION = "0.3.2";
1034
1035
 
1035
1036
  // src/cli.ts
1036
1037
  function parseArgs(argv) {
@@ -1070,14 +1071,22 @@ async function main(argv) {
1070
1071
  return 0;
1071
1072
  }
1072
1073
  }
1073
- var invokedDirectly = process.argv[1] !== void 0 && import.meta.url === pathToFileURL(process.argv[1]).href;
1074
- if (invokedDirectly) {
1074
+ function isDirectInvocation(moduleUrl, argvPath) {
1075
+ if (!argvPath) return false;
1076
+ try {
1077
+ return moduleUrl === pathToFileURL(realpathSync(argvPath)).href;
1078
+ } catch {
1079
+ return false;
1080
+ }
1081
+ }
1082
+ if (isDirectInvocation(import.meta.url, process.argv[1])) {
1075
1083
  main(process.argv.slice(2)).then((code) => process.exit(code)).catch((err) => {
1076
1084
  console.error(err instanceof Error ? err.message : String(err));
1077
1085
  process.exit(1);
1078
1086
  });
1079
1087
  }
1080
1088
  export {
1089
+ isDirectInvocation,
1081
1090
  main,
1082
1091
  parseArgs
1083
1092
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shawaze/agentspace",
3
3
  "publishConfig": { "access": "public" },
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "description": "Scaffold an agent-native multi-repo workspace — keep sibling repos coherent for AI coding agents",
6
6
  "type": "module",
7
7
  "bin": { "agentspace": "dist/cli.js" },