@shawaze/agentspace 0.3.1 → 0.3.3

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 +23 -10
  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
@@ -728,20 +729,24 @@ var DEFAULT_ENFORCEMENT = {
728
729
  };
729
730
 
730
731
  // src/wizard/assemble.ts
732
+ var str = (v) => (v ?? "").trim();
731
733
  function assembleConfig(answers) {
732
734
  const pillars = ["manifest"];
733
735
  if (answers.enableWiki) pillars.push("wiki");
734
736
  if (answers.enableEnforcement) pillars.push("enforcement");
735
737
  if (answers.enableContracts) pillars.push("contracts");
736
738
  return {
737
- workspaceName: answers.workspaceName.trim(),
739
+ workspaceName: str(answers.workspaceName),
738
740
  shape: answers.shape,
739
- repos: answers.repos.map((r) => ({
740
- name: r.name.trim(),
741
- remote: r.remote.trim() === "" ? null : r.remote.trim(),
742
- stack: r.stack,
743
- role: r.role.trim()
744
- })),
741
+ repos: answers.repos.map((r) => {
742
+ const remote = str(r.remote);
743
+ return {
744
+ name: str(r.name),
745
+ remote: remote === "" ? null : remote,
746
+ stack: str(r.stack) || "generic",
747
+ role: str(r.role)
748
+ };
749
+ }),
745
750
  dependencyOrder: shapeHasDependencyOrder(answers.shape) ? answers.dependencyOrder : null,
746
751
  pillars,
747
752
  enforcement: answers.enableEnforcement ? { ...DEFAULT_ENFORCEMENT } : null
@@ -1030,7 +1035,7 @@ async function doctorCommand(workspaceDir, today, opts = {}) {
1030
1035
  }
1031
1036
 
1032
1037
  // src/version.ts
1033
- var VERSION = "0.3.1";
1038
+ var VERSION = "0.3.3";
1034
1039
 
1035
1040
  // src/cli.ts
1036
1041
  function parseArgs(argv) {
@@ -1070,14 +1075,22 @@ async function main(argv) {
1070
1075
  return 0;
1071
1076
  }
1072
1077
  }
1073
- var invokedDirectly = process.argv[1] !== void 0 && import.meta.url === pathToFileURL(process.argv[1]).href;
1074
- if (invokedDirectly) {
1078
+ function isDirectInvocation(moduleUrl, argvPath) {
1079
+ if (!argvPath) return false;
1080
+ try {
1081
+ return moduleUrl === pathToFileURL(realpathSync(argvPath)).href;
1082
+ } catch {
1083
+ return false;
1084
+ }
1085
+ }
1086
+ if (isDirectInvocation(import.meta.url, process.argv[1])) {
1075
1087
  main(process.argv.slice(2)).then((code) => process.exit(code)).catch((err) => {
1076
1088
  console.error(err instanceof Error ? err.message : String(err));
1077
1089
  process.exit(1);
1078
1090
  });
1079
1091
  }
1080
1092
  export {
1093
+ isDirectInvocation,
1081
1094
  main,
1082
1095
  parseArgs
1083
1096
  };
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.3",
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" },