@team-ai/teamai-cli 0.22.10 → 0.22.11
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 +17 -40
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -60483,7 +60483,6 @@ __export(local_agent_exports, {
|
|
|
60483
60483
|
pullLocalAgentForCwd: () => pullLocalAgentForCwd,
|
|
60484
60484
|
rebuildLocalAgentGitExcludeWithout: () => rebuildLocalAgentGitExcludeWithout,
|
|
60485
60485
|
releaseClaudeModelConfig: () => releaseClaudeModelConfig,
|
|
60486
|
-
rememberSeenWorkspace: () => rememberSeenWorkspace,
|
|
60487
60486
|
removeAllAgentHooks: () => removeAllAgentHooks,
|
|
60488
60487
|
removeLocalAgentHttp: () => removeLocalAgentHttp,
|
|
60489
60488
|
reportAndSyncFromHook: () => reportAndSyncFromHook,
|
|
@@ -61515,46 +61514,27 @@ async function scanModelsFromDisk(tool, workspacePath) {
|
|
|
61515
61514
|
}
|
|
61516
61515
|
async function pruneDeadWorkspaceBindings(config) {
|
|
61517
61516
|
let changed = false;
|
|
61518
|
-
const
|
|
61517
|
+
for (const workspacePath of Object.keys(config.workspaceBindings)) {
|
|
61519
61518
|
if (await isUserHomeDir(workspacePath)) {
|
|
61520
|
-
|
|
61519
|
+
delete config.workspaceBindings[workspacePath];
|
|
61521
61520
|
changed = true;
|
|
61522
|
-
|
|
61521
|
+
continue;
|
|
61523
61522
|
}
|
|
61524
61523
|
try {
|
|
61525
61524
|
await fs32.promises.stat(workspacePath);
|
|
61526
61525
|
} catch (error2) {
|
|
61527
61526
|
if (error2.code === "ENOENT") {
|
|
61528
|
-
|
|
61527
|
+
delete config.workspaceBindings[workspacePath];
|
|
61529
61528
|
changed = true;
|
|
61530
61529
|
} else {
|
|
61531
61530
|
log.debug(
|
|
61532
|
-
`local-agent: keeping workspace ${workspacePath} despite stat error: ${error2.message}`
|
|
61531
|
+
`local-agent: keeping workspace binding ${workspacePath} despite stat error: ${error2.message}`
|
|
61533
61532
|
);
|
|
61534
61533
|
}
|
|
61535
61534
|
}
|
|
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
|
-
});
|
|
61546
61535
|
}
|
|
61547
61536
|
return changed;
|
|
61548
61537
|
}
|
|
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
|
-
}
|
|
61558
61538
|
function stampWorkspaceTool(config, currentPath, tool) {
|
|
61559
61539
|
if (!currentPath) return false;
|
|
61560
61540
|
const binding = config.workspaceBindings[currentPath];
|
|
@@ -61565,15 +61545,11 @@ function stampWorkspaceTool(config, currentPath, tool) {
|
|
|
61565
61545
|
return true;
|
|
61566
61546
|
}
|
|
61567
61547
|
function selectToolWorkspaces(config, currentPath, currentTool) {
|
|
61568
|
-
const paths =
|
|
61569
|
-
...Object.keys(config.workspaceBindings),
|
|
61570
|
-
...Object.keys(config.seenWorkspaces ?? {})
|
|
61571
|
-
]);
|
|
61548
|
+
const paths = new Set(Object.keys(config.workspaceBindings));
|
|
61572
61549
|
if (currentPath) paths.add(currentPath);
|
|
61573
61550
|
return Array.from(paths).filter((wsPath) => {
|
|
61574
|
-
const
|
|
61575
|
-
const
|
|
61576
|
-
const wsTool = bindingTool ?? seenTool ?? (wsPath === currentPath ? currentTool : void 0);
|
|
61551
|
+
const b2 = config.workspaceBindings[wsPath];
|
|
61552
|
+
const wsTool = (b2?.ideType || void 0) ?? (wsPath === currentPath ? currentTool : void 0);
|
|
61577
61553
|
return wsTool === currentTool;
|
|
61578
61554
|
});
|
|
61579
61555
|
}
|
|
@@ -63359,10 +63335,11 @@ async function syncLocalAgent(context) {
|
|
|
63359
63335
|
}
|
|
63360
63336
|
const pruned = await pruneDeadWorkspaceBindings(config);
|
|
63361
63337
|
const currentPath = await resolveWorkspacePath(context.cwd);
|
|
63362
|
-
|
|
63363
|
-
|
|
63364
|
-
|
|
63365
|
-
|
|
63338
|
+
if (resolveProjectAssociationMode(config) === "manual" && currentPath && !config.workspaceBindings[currentPath]) {
|
|
63339
|
+
await persistWorkspaceBinding(config, context.cwd, currentPath, 0, "__skipped__");
|
|
63340
|
+
}
|
|
63341
|
+
const stamped = stampWorkspaceTool(config, currentPath, context.tool ?? "workbuddy");
|
|
63342
|
+
if (pruned || stamped) {
|
|
63366
63343
|
await saveLocalAgentConfig(config);
|
|
63367
63344
|
}
|
|
63368
63345
|
}
|
|
@@ -63542,11 +63519,11 @@ async function initLocalAgentHttp(options2) {
|
|
|
63542
63519
|
createdAt: existing2?.createdAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
63543
63520
|
workspaceBindings: existing2?.workspaceBindings ?? {},
|
|
63544
63521
|
userGroupId: existing2?.userGroupId,
|
|
63545
|
-
userGroupName: existing2?.userGroupName
|
|
63546
|
-
// A re-init keeps auto/manual. A first install, and an older config that
|
|
63547
|
-
// never recorded a choice, both ask once.
|
|
63548
|
-
projectAssociationMode: existing2?.projectAssociationMode === "auto" || existing2?.projectAssociationMode === "manual" ? existing2.projectAssociationMode : "unset"
|
|
63522
|
+
userGroupName: existing2?.userGroupName
|
|
63549
63523
|
};
|
|
63524
|
+
if (existing2?.projectAssociationMode === "auto" || existing2?.projectAssociationMode === "manual") {
|
|
63525
|
+
config.projectAssociationMode = existing2.projectAssociationMode;
|
|
63526
|
+
}
|
|
63550
63527
|
await ensureDir(getLocalAgentHome());
|
|
63551
63528
|
await saveLocalAgentConfig(config);
|
|
63552
63529
|
if (options2.token) {
|