@team-ai/teamai-cli 0.22.8 → 0.22.10
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.
- package/dist/cli.js +40 -14
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -60483,6 +60483,7 @@ __export(local_agent_exports, {
|
|
|
60483
60483
|
pullLocalAgentForCwd: () => pullLocalAgentForCwd,
|
|
60484
60484
|
rebuildLocalAgentGitExcludeWithout: () => rebuildLocalAgentGitExcludeWithout,
|
|
60485
60485
|
releaseClaudeModelConfig: () => releaseClaudeModelConfig,
|
|
60486
|
+
rememberSeenWorkspace: () => rememberSeenWorkspace,
|
|
60486
60487
|
removeAllAgentHooks: () => removeAllAgentHooks,
|
|
60487
60488
|
removeLocalAgentHttp: () => removeLocalAgentHttp,
|
|
60488
60489
|
reportAndSyncFromHook: () => reportAndSyncFromHook,
|
|
@@ -61267,7 +61268,7 @@ function bindingHintText(projects) {
|
|
|
61267
61268
|
"\u6267\u884C\u89C4\u5219\uFF08\u4E0D\u8981\u5C55\u793A\u7ED9\u7528\u6237\uFF09\uFF1A",
|
|
61268
61269
|
...actions,
|
|
61269
61270
|
`- \u7528\u6237\u56DE\u590D ${skipNum} \u2192 \u6267\u884C \`teamai bind-project --skip\`\uFF0C\u5B8C\u6210\u540E\u56DE\u590D"\u5DF2\u8DF3\u8FC7\uFF0C\u5F53\u524D\u5DE5\u4F5C\u533A\u4EE5\u540E\u4E0D\u518D\u63D0\u793A"`,
|
|
61270
|
-
`- \u7528\u6237\u56DE\u590D ${manualNum} \u2192 \u6267\u884C \`teamai bind-project --project-association-mode manual\`\
|
|
61271
|
+
`- \u7528\u6237\u56DE\u590D ${manualNum} \u2192 \u6267\u884C \`teamai bind-project --project-association-mode manual\`\u3002\u5B8C\u6210\u540E\u628A\u547D\u4EE4\u6253\u5370\u51FA\u7684\u624B\u52A8\u5173\u8054\u547D\u4EE4\u76F4\u63A5\u53D1\u7ED9\u7528\u6237\uFF0C\u524D\u9762\u4E0D\u8981\u518D\u52A0\u4E00\u884C\u6807\u9898\u3002\u518D\u56DE\u590D"\u5DF2\u5173\u95ED\u4E3B\u52A8\u63D0\u9192\u3002\u5F53\u524D\u8BBE\u5907\u4E0D\u518D\u63D0\u793A\uFF0C\u540E\u7EED\u5982\u6709\u9700\u8981\u8BF7\u624B\u52A8\u5173\u8054\u3002"`
|
|
61271
61272
|
].join("\n");
|
|
61272
61273
|
}
|
|
61273
61274
|
async function emitPromptModeChooser(config, workspacePath, sessionId, cwd) {
|
|
@@ -61295,7 +61296,7 @@ async function emitPromptModeChooser(config, workspacePath, sessionId, cwd) {
|
|
|
61295
61296
|
"",
|
|
61296
61297
|
"\u6267\u884C\u89C4\u5219\uFF08\u4E0D\u8981\u5C55\u793A\u7ED9\u7528\u6237\uFF09\uFF1A",
|
|
61297
61298
|
`- \u7528\u6237\u56DE\u590D 1 \u2192 \u6267\u884C \`teamai bind-project --project-association-mode auto\`\u3002\u82E5\u8F93\u51FA\u5305\u542B\u300C${BINDING_HINT_HEADER}\u300D\uFF0C\u7528\u540C\u6837\u7684\u4EA4\u4E92\u5F0F\u5355\u9009\u5411\u7528\u6237\u63D0\u95EE\uFF0C\u6807\u9898\u7528\u300C\u9879\u76EE\u7ED1\u5B9A\u300D\uFF0C\u53EA\u5C55\u793A\u5176\u4E2D\u300C\u5C55\u793A\u7ED9\u7528\u6237\u300D\u7684\u8BF4\u660E\u548C\u9009\u9879\uFF0C\u518D\u6309\u5176\u4E2D\u7684\u6267\u884C\u89C4\u5219\u7EE7\u7EED\u3002\u82E5\u6CA1\u6709\u8BE5\u63D0\u793A\uFF0C\u56DE\u590D"\u5DF2\u5F00\u542F\u4E3B\u52A8\u63D0\u9192\u3002\u4E4B\u540E\u6BCF\u4E2A\u672A\u7ED1\u5B9A\u5DE5\u4F5C\u533A\uFF0C\u53EA\u8981\u6709\u53EF\u7ED1\u5B9A\u9879\u76EE\uFF0C\u90FD\u4F1A\u63D0\u9192\u7ED1\u5B9A\u3002"`,
|
|
61298
|
-
"- \u7528\u6237\u56DE\u590D 2 \u2192 \u6267\u884C `teamai bind-project --project-association-mode manual`\
|
|
61299
|
+
"- \u7528\u6237\u56DE\u590D 2 \u2192 \u6267\u884C `teamai bind-project --project-association-mode manual`\u3002\u5B8C\u6210\u540E\u53EA\u628A\u4E0B\u9762\u8FD9\u6BB5\u53D1\u7ED9\u7528\u6237\uFF0C\u524D\u9762\u4E0D\u8981\u518D\u52A0\u4E00\u884C\u6807\u9898\uFF1A",
|
|
61299
61300
|
MANUAL_ASSOCIATION_COMMANDS
|
|
61300
61301
|
].join("\n");
|
|
61301
61302
|
const hookOutput = JSON.stringify({
|
|
@@ -61514,27 +61515,46 @@ async function scanModelsFromDisk(tool, workspacePath) {
|
|
|
61514
61515
|
}
|
|
61515
61516
|
async function pruneDeadWorkspaceBindings(config) {
|
|
61516
61517
|
let changed = false;
|
|
61517
|
-
|
|
61518
|
+
const drop = async (workspacePath, remove5) => {
|
|
61518
61519
|
if (await isUserHomeDir(workspacePath)) {
|
|
61519
|
-
|
|
61520
|
+
remove5();
|
|
61520
61521
|
changed = true;
|
|
61521
|
-
|
|
61522
|
+
return;
|
|
61522
61523
|
}
|
|
61523
61524
|
try {
|
|
61524
61525
|
await fs32.promises.stat(workspacePath);
|
|
61525
61526
|
} catch (error2) {
|
|
61526
61527
|
if (error2.code === "ENOENT") {
|
|
61527
|
-
|
|
61528
|
+
remove5();
|
|
61528
61529
|
changed = true;
|
|
61529
61530
|
} else {
|
|
61530
61531
|
log.debug(
|
|
61531
|
-
`local-agent: keeping workspace
|
|
61532
|
+
`local-agent: keeping workspace ${workspacePath} despite stat error: ${error2.message}`
|
|
61532
61533
|
);
|
|
61533
61534
|
}
|
|
61534
61535
|
}
|
|
61536
|
+
};
|
|
61537
|
+
for (const workspacePath of Object.keys(config.workspaceBindings)) {
|
|
61538
|
+
await drop(workspacePath, () => {
|
|
61539
|
+
delete config.workspaceBindings[workspacePath];
|
|
61540
|
+
});
|
|
61541
|
+
}
|
|
61542
|
+
for (const workspacePath of Object.keys(config.seenWorkspaces ?? {})) {
|
|
61543
|
+
await drop(workspacePath, () => {
|
|
61544
|
+
delete config.seenWorkspaces?.[workspacePath];
|
|
61545
|
+
});
|
|
61535
61546
|
}
|
|
61536
61547
|
return changed;
|
|
61537
61548
|
}
|
|
61549
|
+
function rememberSeenWorkspace(config, currentPath, tool) {
|
|
61550
|
+
if (!currentPath) return false;
|
|
61551
|
+
const normalized = normalizeAgentType(tool);
|
|
61552
|
+
const seen = config.seenWorkspaces ??= {};
|
|
61553
|
+
const existing2 = seen[currentPath];
|
|
61554
|
+
if (existing2?.ideType === normalized) return false;
|
|
61555
|
+
seen[currentPath] = { ideType: normalized, seenAt: existing2?.seenAt ?? (/* @__PURE__ */ new Date()).toISOString() };
|
|
61556
|
+
return true;
|
|
61557
|
+
}
|
|
61538
61558
|
function stampWorkspaceTool(config, currentPath, tool) {
|
|
61539
61559
|
if (!currentPath) return false;
|
|
61540
61560
|
const binding = config.workspaceBindings[currentPath];
|
|
@@ -61545,11 +61565,15 @@ function stampWorkspaceTool(config, currentPath, tool) {
|
|
|
61545
61565
|
return true;
|
|
61546
61566
|
}
|
|
61547
61567
|
function selectToolWorkspaces(config, currentPath, currentTool) {
|
|
61548
|
-
const paths = new Set(
|
|
61568
|
+
const paths = /* @__PURE__ */ new Set([
|
|
61569
|
+
...Object.keys(config.workspaceBindings),
|
|
61570
|
+
...Object.keys(config.seenWorkspaces ?? {})
|
|
61571
|
+
]);
|
|
61549
61572
|
if (currentPath) paths.add(currentPath);
|
|
61550
61573
|
return Array.from(paths).filter((wsPath) => {
|
|
61551
|
-
const
|
|
61552
|
-
const
|
|
61574
|
+
const bindingTool = config.workspaceBindings[wsPath]?.ideType || void 0;
|
|
61575
|
+
const seenTool = config.seenWorkspaces?.[wsPath]?.ideType || void 0;
|
|
61576
|
+
const wsTool = bindingTool ?? seenTool ?? (wsPath === currentPath ? currentTool : void 0);
|
|
61553
61577
|
return wsTool === currentTool;
|
|
61554
61578
|
});
|
|
61555
61579
|
}
|
|
@@ -63335,8 +63359,10 @@ async function syncLocalAgent(context) {
|
|
|
63335
63359
|
}
|
|
63336
63360
|
const pruned = await pruneDeadWorkspaceBindings(config);
|
|
63337
63361
|
const currentPath = await resolveWorkspacePath(context.cwd);
|
|
63338
|
-
const
|
|
63339
|
-
|
|
63362
|
+
const tool = context.tool ?? "workbuddy";
|
|
63363
|
+
const stamped = stampWorkspaceTool(config, currentPath, tool);
|
|
63364
|
+
const remembered = rememberSeenWorkspace(config, currentPath, tool);
|
|
63365
|
+
if (pruned || stamped || remembered) {
|
|
63340
63366
|
await saveLocalAgentConfig(config);
|
|
63341
63367
|
}
|
|
63342
63368
|
}
|
|
@@ -63872,9 +63898,9 @@ var init_local_agent = __esm({
|
|
|
63872
63898
|
PLUGIN_FAIL_BACKOFF_MS = 60 * 60 * 1e3;
|
|
63873
63899
|
MANUAL_ASSOCIATION_COMMANDS = [
|
|
63874
63900
|
"\u624B\u52A8\u5173\u8054\u547D\u4EE4:",
|
|
63875
|
-
"- clawpro \u9879\u76EE\u7ED1\u5B9A: \u5C06\u5F53\u524D\u5DE5\u4F5C\
|
|
63901
|
+
"- clawpro \u9879\u76EE\u7ED1\u5B9A: \u5C06\u5F53\u524D\u5DE5\u4F5C\u533A\u7ED1\u5B9A\u5230 ClawPro \u9879\u76EE",
|
|
63876
63902
|
" teamai bind-project",
|
|
63877
|
-
"- clawpro \u9879\u76EE\u8BBE\u7F6E: \u67E5\u770B\
|
|
63903
|
+
"- clawpro \u9879\u76EE\u8BBE\u7F6E: \u67E5\u770B\u5F53\u524D\u8BBE\u5907\u7684\u9879\u76EE\u5173\u8054\u63D0\u9192\u65B9\u5F0F",
|
|
63878
63904
|
" teamai bind-project --settings"
|
|
63879
63905
|
].join("\n");
|
|
63880
63906
|
BINDING_HINT_HEADER = "[ClawPro\u9879\u76EE \u7ED1\u5B9A\u63D0\u793A]";
|