@supaku/agentfactory-cli 0.7.0 → 0.7.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.
@@ -1 +1 @@
1
- {"version":3,"file":"cleanup-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/cleanup-runner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC/C;AAuBD,wBAAgB,UAAU,IAAI,MAAM,CASnC;AAuND,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,aAAa,CAUtE"}
1
+ {"version":3,"file":"cleanup-runner.d.ts","sourceRoot":"","sources":["../../../src/lib/cleanup-runner.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,MAAM,WAAW,mBAAmB;IAClC,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,qEAAqE;IACrE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,iEAAiE;IACjE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC/C;AAuBD,wBAAgB,UAAU,IAAI,MAAM,CASnC;AAwOD,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,aAAa,CAUtE"}
@@ -107,9 +107,26 @@ function scanWorktrees(options) {
107
107
  return result;
108
108
  }
109
109
  /**
110
- * Remove a single worktree
110
+ * Remove a single worktree with safety checks.
111
+ *
112
+ * SAFETY: Refuses to remove paths where .git is a directory (main working tree)
113
+ * to prevent catastrophic data loss.
111
114
  */
112
115
  function removeWorktree(worktreePath) {
116
+ // Safety check: never remove the main working tree
117
+ try {
118
+ const gitPath = resolve(worktreePath, '.git');
119
+ if (existsSync(gitPath) && statSync(gitPath).isDirectory()) {
120
+ return {
121
+ success: false,
122
+ error: `SAFETY: ${worktreePath} is the main working tree (.git is a directory). Refusing to remove.`,
123
+ };
124
+ }
125
+ }
126
+ catch {
127
+ // If we can't check, err on the side of caution
128
+ return { success: false, error: `SAFETY: Could not verify ${worktreePath} is not the main working tree.` };
129
+ }
113
130
  try {
114
131
  execSync(`git worktree remove "${worktreePath}" --force`, {
115
132
  encoding: 'utf-8',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supaku/agentfactory-cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "description": "CLI tools for AgentFactory — local orchestrator, remote worker, queue admin",
6
6
  "author": "Supaku (https://supaku.com)",
@@ -82,9 +82,9 @@
82
82
  ],
83
83
  "dependencies": {
84
84
  "dotenv": "^17.2.3",
85
- "@supaku/agentfactory-linear": "0.7.0",
86
- "@supaku/agentfactory": "0.7.0",
87
- "@supaku/agentfactory-server": "0.7.0"
85
+ "@supaku/agentfactory": "0.7.2",
86
+ "@supaku/agentfactory-linear": "0.7.2",
87
+ "@supaku/agentfactory-server": "0.7.2"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@types/node": "^22.5.4",