@bastani/atomic 0.10.6 → 0.10.7
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/CHANGELOG.md +42 -0
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +2 -2
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +26 -4
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/mode-shared-2QJSCUM6.js +3 -2
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
- package/dist/_shared/p1a-prewarm-UQY3X2UK.js +3 -3
- package/dist/_shared/sdk-WQIOHVKO.js +2 -2
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/sql-session-store-5FD3WBMZ.js +2 -2
- package/dist/_shared/startup-0-0-TYUFUOJZ.js +2 -2
- package/dist/_shared/startup-0-1-W2G2UY7R.js +2 -2
- package/dist/_shared/startup-0-2-SZGQIWHI.js +2 -2
- package/dist/_shared/startup-0-3-T4DVFYWX.js +2 -2
- package/dist/_shared/startup-0-4-HN5EB4K7.js +72 -11
- package/dist/_shared/startup-0-4-HN5EB4K7.js.map +1 -1
- package/dist/_shared/startup-0-5-OHJNE6JH.js +2 -2
- package/dist/_shared/startup-10-0-TDQNBDDL.js +2 -2
- package/dist/_shared/startup-15-1-4S7FLMNG.js +34 -28
- package/dist/_shared/startup-15-1-4S7FLMNG.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +2 -2
- package/dist/_shared/startup-8-1-SJW2GMAM.js +2 -2
- package/dist/_shared/storage-command-7MGXLJGZ.js +2 -2
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/index.bundle.mjs +1 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +22 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/agent-browser/SKILL.md +3 -3
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +316 -33
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +2 -2
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +2 -2
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +2 -2
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +2 -2
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-thread.js +2 -2
- package/dist/core/storage/node-sqlite.js +2 -2
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +2 -2
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +2 -2
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-window.code.js +2 -2
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +2 -2
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +2 -2
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +2 -2
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +2 -2
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.js +2 -2
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/tool-block.d.ts +2 -0
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/package-manager-cli.code.js +2 -2
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/startup-files.json +1 -1
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/subagents/reference.md +1 -0
- package/docs/subagents.md +1 -0
- package/package.json +8 -8
|
@@ -10,7 +10,7 @@ import * as __atomicHostImport4 from "@bastani/atomic-ai";
|
|
|
10
10
|
if (!(name in namespace)) missing.push(`The requested module '${specifier}' does not provide an export named '${name}'`);
|
|
11
11
|
if (missing.length > 0) {
|
|
12
12
|
const application = typeof __atomicHostImport0.APP_NAME === "string" ? __atomicHostImport0.APP_NAME : "atomic";
|
|
13
|
-
if (__atomicHostImport0.VERSION !== "0.10.
|
|
13
|
+
if (__atomicHostImport0.VERSION !== "0.10.7") missing.unshift(application + " was updated to 0.10.7 while this session was running; restart it to keep using the subagents extension.");
|
|
14
14
|
throw new Error(missing.join("\n"));
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -17879,10 +17879,11 @@ function subagentChildTranscriptDetails(card, record) {
|
|
|
17879
17879
|
if (!live || entry.cancel.signal.aborted || (transcriptGenerations.get(live) ?? 0) !== gen || transcripts.get(live)?.get(record.childId) !== entry)
|
|
17880
17880
|
return;
|
|
17881
17881
|
const changed = !sameDetails(entry.details, details);
|
|
17882
|
-
|
|
17883
|
-
|
|
17884
|
-
|
|
17882
|
+
if (changed) {
|
|
17883
|
+
entry.lines = details.lines;
|
|
17884
|
+
entry.details = details;
|
|
17885
17885
|
notify(record.childId);
|
|
17886
|
+
}
|
|
17886
17887
|
if (running)
|
|
17887
17888
|
setTimeout(() => {
|
|
17888
17889
|
if (!entry.cancel.signal.aborted && weak.deref())
|
|
@@ -21117,6 +21118,156 @@ function finishElapsedSpan(span, hooks, progress) {
|
|
|
21117
21118
|
} catch {}
|
|
21118
21119
|
}
|
|
21119
21120
|
|
|
21121
|
+
// dist/builtin/subagents/src/runs/shared/model-scope.ts
|
|
21122
|
+
function modelKey(provider, id) {
|
|
21123
|
+
return `${provider}/${id}`.toLowerCase();
|
|
21124
|
+
}
|
|
21125
|
+
function buildScope(scopedModels) {
|
|
21126
|
+
const seen = new Set;
|
|
21127
|
+
const allowedFullIds = [];
|
|
21128
|
+
for (const entry of scopedModels) {
|
|
21129
|
+
const fullId = `${entry.model.provider}/${entry.model.id}`;
|
|
21130
|
+
const key = fullId.toLowerCase();
|
|
21131
|
+
if (seen.has(key))
|
|
21132
|
+
continue;
|
|
21133
|
+
seen.add(key);
|
|
21134
|
+
allowedFullIds.push(fullId);
|
|
21135
|
+
}
|
|
21136
|
+
return { scopedModels, allowedFullIds };
|
|
21137
|
+
}
|
|
21138
|
+
function hasGlobCharacters(pattern) {
|
|
21139
|
+
return pattern.includes("*") || pattern.includes("?") || pattern.includes("[");
|
|
21140
|
+
}
|
|
21141
|
+
function globMatches(text, pattern) {
|
|
21142
|
+
const t = text.toLowerCase();
|
|
21143
|
+
const p = pattern.toLowerCase();
|
|
21144
|
+
let ti = 0;
|
|
21145
|
+
let pi = 0;
|
|
21146
|
+
let starIdx = -1;
|
|
21147
|
+
let matchIdx = 0;
|
|
21148
|
+
while (ti < t.length) {
|
|
21149
|
+
if (pi < p.length && (p[pi] === "?" || p[pi] === t[ti])) {
|
|
21150
|
+
ti++;
|
|
21151
|
+
pi++;
|
|
21152
|
+
} else if (pi < p.length && p[pi] === "*") {
|
|
21153
|
+
starIdx = pi;
|
|
21154
|
+
matchIdx = ti;
|
|
21155
|
+
pi++;
|
|
21156
|
+
} else if (starIdx !== -1) {
|
|
21157
|
+
pi = starIdx + 1;
|
|
21158
|
+
matchIdx++;
|
|
21159
|
+
ti = matchIdx;
|
|
21160
|
+
} else {
|
|
21161
|
+
return false;
|
|
21162
|
+
}
|
|
21163
|
+
}
|
|
21164
|
+
while (pi < p.length && p[pi] === "*")
|
|
21165
|
+
pi++;
|
|
21166
|
+
return pi === p.length;
|
|
21167
|
+
}
|
|
21168
|
+
function matchExactModel(text, models) {
|
|
21169
|
+
const normalized = text.trim().toLowerCase();
|
|
21170
|
+
if (!normalized)
|
|
21171
|
+
return [];
|
|
21172
|
+
if (normalized.includes("/")) {
|
|
21173
|
+
return models.filter((model) => modelKey(model.provider, model.id) === normalized);
|
|
21174
|
+
}
|
|
21175
|
+
return models.filter((model) => model.id.toLowerCase() === normalized);
|
|
21176
|
+
}
|
|
21177
|
+
function resolveEnabledModelPatterns(patterns, models) {
|
|
21178
|
+
const scopedModels = [];
|
|
21179
|
+
const seen = new Set;
|
|
21180
|
+
const add = (model, thinkingLevel) => {
|
|
21181
|
+
const key = modelKey(model.provider, model.id);
|
|
21182
|
+
if (seen.has(key))
|
|
21183
|
+
return;
|
|
21184
|
+
seen.add(key);
|
|
21185
|
+
scopedModels.push({ model, thinkingLevel });
|
|
21186
|
+
};
|
|
21187
|
+
for (const rawPattern of patterns) {
|
|
21188
|
+
const trimmed = rawPattern.trim();
|
|
21189
|
+
if (!trimmed)
|
|
21190
|
+
continue;
|
|
21191
|
+
const exactNoSuffix = matchExactModel(trimmed, models);
|
|
21192
|
+
if (exactNoSuffix.length > 0) {
|
|
21193
|
+
for (const model of exactNoSuffix)
|
|
21194
|
+
add(model, undefined);
|
|
21195
|
+
continue;
|
|
21196
|
+
}
|
|
21197
|
+
const { baseModel, thinkingSuffix } = splitKnownThinkingSuffix(trimmed);
|
|
21198
|
+
const thinkingLevel = thinkingSuffix ? thinkingSuffix.slice(1) : undefined;
|
|
21199
|
+
const exactWithSuffix = matchExactModel(baseModel, models);
|
|
21200
|
+
if (exactWithSuffix.length > 0) {
|
|
21201
|
+
for (const model of exactWithSuffix)
|
|
21202
|
+
add(model, thinkingLevel);
|
|
21203
|
+
continue;
|
|
21204
|
+
}
|
|
21205
|
+
if (hasGlobCharacters(baseModel)) {
|
|
21206
|
+
for (const model of models) {
|
|
21207
|
+
if (globMatches(`${model.provider}/${model.id}`, baseModel) || globMatches(model.id, baseModel)) {
|
|
21208
|
+
add(model, thinkingLevel);
|
|
21209
|
+
}
|
|
21210
|
+
}
|
|
21211
|
+
continue;
|
|
21212
|
+
}
|
|
21213
|
+
const needle = baseModel.toLowerCase();
|
|
21214
|
+
for (const model of models) {
|
|
21215
|
+
if (modelKey(model.provider, model.id).includes(needle) || model.id.toLowerCase().includes(needle)) {
|
|
21216
|
+
add(model, thinkingLevel);
|
|
21217
|
+
}
|
|
21218
|
+
}
|
|
21219
|
+
}
|
|
21220
|
+
return scopedModels;
|
|
21221
|
+
}
|
|
21222
|
+
function resolveSessionModelScope(ctx, settings) {
|
|
21223
|
+
if (ctx.scopedModels && ctx.scopedModels.length > 0) {
|
|
21224
|
+
return buildScope(ctx.scopedModels);
|
|
21225
|
+
}
|
|
21226
|
+
const patterns = settings?.enabledModels;
|
|
21227
|
+
if (!patterns || patterns.length === 0)
|
|
21228
|
+
return;
|
|
21229
|
+
const available = ctx.modelRegistry?.getAvailable() ?? [];
|
|
21230
|
+
return buildScope(resolveEnabledModelPatterns(patterns, available));
|
|
21231
|
+
}
|
|
21232
|
+
function filterModelsByScope(models, scope) {
|
|
21233
|
+
if (scope === undefined)
|
|
21234
|
+
return [...models];
|
|
21235
|
+
const allowed = new Set(scope.allowedFullIds.map((entry) => entry.toLowerCase()));
|
|
21236
|
+
return models.filter((model) => allowed.has(modelKey(model.provider, model.id)));
|
|
21237
|
+
}
|
|
21238
|
+
function matchesAllowedSets(baseModel, allowedFullSet, allowedIdSet) {
|
|
21239
|
+
const normalized = baseModel.toLowerCase();
|
|
21240
|
+
if (normalized.includes("/"))
|
|
21241
|
+
return allowedFullSet.has(normalized);
|
|
21242
|
+
return allowedIdSet.has(normalized);
|
|
21243
|
+
}
|
|
21244
|
+
function isModelCandidateAllowed(candidate, allowedFullIds) {
|
|
21245
|
+
const trimmed = candidate.trim();
|
|
21246
|
+
if (!trimmed)
|
|
21247
|
+
return false;
|
|
21248
|
+
const allowedFullSet = new Set(allowedFullIds.map((entry) => entry.toLowerCase()));
|
|
21249
|
+
const allowedIdSet = new Set(allowedFullIds.map((entry) => {
|
|
21250
|
+
const slash = entry.indexOf("/");
|
|
21251
|
+
return (slash > 0 ? entry.slice(slash + 1) : entry).toLowerCase();
|
|
21252
|
+
}));
|
|
21253
|
+
const { baseModel } = splitKnownThinkingSuffix(trimmed);
|
|
21254
|
+
if (matchesAllowedSets(baseModel, allowedFullSet, allowedIdSet))
|
|
21255
|
+
return true;
|
|
21256
|
+
const unknown = splitUnknownThinkingSuffix(baseModel);
|
|
21257
|
+
return unknown !== undefined && matchesAllowedSets(unknown.baseModel, allowedFullSet, allowedIdSet);
|
|
21258
|
+
}
|
|
21259
|
+
function resolveScopedModelCandidate(model, availableModels, scope, preferredProvider) {
|
|
21260
|
+
if (!model)
|
|
21261
|
+
return;
|
|
21262
|
+
if (scope !== undefined && !model.includes("/") && availableModels && availableModels.length > 0) {
|
|
21263
|
+
const scopedAvailable = filterModelsByScope(availableModels, scope);
|
|
21264
|
+
const scopedResolved = resolveModelCandidate(model, scopedAvailable, preferredProvider);
|
|
21265
|
+
if (scopedResolved?.includes("/"))
|
|
21266
|
+
return scopedResolved;
|
|
21267
|
+
}
|
|
21268
|
+
return resolveModelCandidate(model, availableModels, preferredProvider);
|
|
21269
|
+
}
|
|
21270
|
+
|
|
21120
21271
|
// dist/builtin/subagents/src/runs/inprocess/child-policy.ts
|
|
21121
21272
|
function resolveChildModePolicy(spec) {
|
|
21122
21273
|
const tools = spec.tools ?? spec.agent.tools;
|
|
@@ -22699,6 +22850,22 @@ function assertStartModelAllowed(input) {
|
|
|
22699
22850
|
return;
|
|
22700
22851
|
throw new Error(`Model ${model.provider}/${model.id}${effort ? ` at ${effort} effort` : ""} would run${spec.namedModel ? ` in place of ${spec.namedModel}` : ""}, but the session's fallback policy does not allow it. No other model was used.`);
|
|
22701
22852
|
}
|
|
22853
|
+
function assertStartModelInScope(input) {
|
|
22854
|
+
const { model, allowedModels, scopedModels } = input;
|
|
22855
|
+
if (!model)
|
|
22856
|
+
return;
|
|
22857
|
+
const fullId = `${model.provider}/${model.id}`;
|
|
22858
|
+
if (allowedModels !== undefined) {
|
|
22859
|
+
if (isModelCandidateAllowed(fullId, allowedModels))
|
|
22860
|
+
return;
|
|
22861
|
+
throw new Error(`Model ${fullId} is outside the session's enabledModels scope. No other model was used.`);
|
|
22862
|
+
}
|
|
22863
|
+
if (scopedModels && scopedModels.length > 0) {
|
|
22864
|
+
if (scopedModels.some((entry) => entry.model.provider === model.provider && entry.model.id === model.id))
|
|
22865
|
+
return;
|
|
22866
|
+
throw new Error(`Model ${fullId} is outside the session's enabledModels scope. No other model was used.`);
|
|
22867
|
+
}
|
|
22868
|
+
}
|
|
22702
22869
|
async function cancelledEnvelope(session, spec, stats, ownTurns) {
|
|
22703
22870
|
const sessionFile = session?.sessionFile ?? spec.sessionManager?.getSessionFile();
|
|
22704
22871
|
const sessionUrl = sessionFile === undefined ? childSessionLocator({
|
|
@@ -23211,13 +23378,18 @@ class SubagentControlRuntime {
|
|
|
23211
23378
|
const openOptions = typeof SessionManager3.prototype.getEntrySeq === "function" ? { history: "tail" } : undefined;
|
|
23212
23379
|
const opening = admitted.sessionManager ? canReopenFromStore ? SessionManager3.open(admitted.sessionManager.getSessionStore(), admitted.sessionManager.getSessionId(), admitted.policy.cwd, openOptions) : Promise.resolve(admitted.sessionManager) : admitted.spec.sessionStore ? SessionManager3.create(admitted.spec.sessionStore, admitted.policy.cwd, { internal: true }) : mkdir6(admitted.sessionDir, { recursive: true }).then(() => SessionManager3.create(admitted.policy.cwd, admitted.sessionDir));
|
|
23213
23380
|
let startGate;
|
|
23381
|
+
let startScopedModels;
|
|
23214
23382
|
const prepareChildSession = async () => {
|
|
23383
|
+
const specAllowedModels = admitted.spec.allowedModels;
|
|
23384
|
+
const specScopeGate = specAllowedModels === undefined ? undefined : (model) => isModelCandidateAllowed(`${model.provider}/${model.id}`, specAllowedModels);
|
|
23385
|
+
const specGate = admitted.spec.isFallbackModelAllowed;
|
|
23386
|
+
const composedSpecGate = specGate && specScopeGate ? (model, effort) => specGate(model, effort) && specScopeGate(model, effort) : specGate ?? specScopeGate;
|
|
23215
23387
|
const childOptions = {
|
|
23216
23388
|
cwd: admitted.policy.cwd,
|
|
23217
23389
|
...candidate.model ?? admitted.policy.model ? { model: candidate.model ?? admitted.policy.model } : {},
|
|
23218
23390
|
...candidate.thinkingLevel ?? admitted.policy.thinkingLevel ? { thinkingLevel: candidate.thinkingLevel ?? admitted.policy.thinkingLevel } : {},
|
|
23219
23391
|
...admitted.spec.fallbackModels !== undefined ? { fallbackModels: [...admitted.spec.fallbackModels] } : {},
|
|
23220
|
-
isFallbackModelAllowed:
|
|
23392
|
+
isFallbackModelAllowed: composedSpecGate,
|
|
23221
23393
|
tools: admitted.policy.tools ? [...admitted.policy.tools] : undefined,
|
|
23222
23394
|
excludedTools: admitted.policy.excludedTools ? [...admitted.policy.excludedTools] : undefined
|
|
23223
23395
|
};
|
|
@@ -23243,6 +23415,12 @@ class SubagentControlRuntime {
|
|
|
23243
23415
|
...explicit || pinnedFallbacks.some((entry, index) => entry !== fallbackEntries[index]) ? { fallbackModels: pinnedFallbacks } : {}
|
|
23244
23416
|
};
|
|
23245
23417
|
startGate = inherited.isFallbackModelAllowed;
|
|
23418
|
+
startScopedModels = inherited.scopedModels;
|
|
23419
|
+
assertStartModelInScope({
|
|
23420
|
+
model: inherited.model,
|
|
23421
|
+
allowedModels: admitted.spec.allowedModels,
|
|
23422
|
+
scopedModels: inherited.scopedModels
|
|
23423
|
+
});
|
|
23246
23424
|
assertStartModelAllowed({
|
|
23247
23425
|
spec: admitted.spec,
|
|
23248
23426
|
ownModel: candidate.model ?? admitted.policy.model,
|
|
@@ -23379,6 +23557,11 @@ class SubagentControlRuntime {
|
|
|
23379
23557
|
const ownModel = candidate.model ?? admitted.policy.model;
|
|
23380
23558
|
if (admitted.spec.namedModel !== undefined && !ownModel)
|
|
23381
23559
|
assertStartedOnNamedModel(admitted.spec.namedModel, session.model);
|
|
23560
|
+
assertStartModelInScope({
|
|
23561
|
+
model: session.model,
|
|
23562
|
+
allowedModels: admitted.spec.allowedModels,
|
|
23563
|
+
scopedModels: startScopedModels
|
|
23564
|
+
});
|
|
23382
23565
|
assertStartModelAllowed({
|
|
23383
23566
|
spec: admitted.spec,
|
|
23384
23567
|
ownModel,
|
|
@@ -26797,6 +26980,7 @@ async function runForegroundParallelTasks(input) {
|
|
|
26797
26980
|
...input.autoModels?.[index] ? { runsNamedModel: false } : {},
|
|
26798
26981
|
availableModels: input.availableModels,
|
|
26799
26982
|
knownModelProviders: input.knownModelProviders,
|
|
26983
|
+
...input.allowedModels === undefined ? {} : { allowedModels: input.allowedModels },
|
|
26800
26984
|
resolveCandidateModel: input.resolveCandidateModel,
|
|
26801
26985
|
preferredModelProvider: input.ctx.model?.provider,
|
|
26802
26986
|
currentModel: currentModelFullId(input.ctx.model),
|
|
@@ -27303,10 +27487,15 @@ function filterSpawnableModelCandidates(params) {
|
|
|
27303
27487
|
const providersWithAvailableAuth = new Set((params.availableModels ?? []).map((model) => model.provider));
|
|
27304
27488
|
const knownProviders = new Set(params.knownModelProviders ?? []);
|
|
27305
27489
|
const currentModel = params.currentModel;
|
|
27490
|
+
const allowedModels = params.allowedModels;
|
|
27306
27491
|
const filtered = [];
|
|
27307
27492
|
const skippedAttempts = [];
|
|
27308
27493
|
const skippedModels = [];
|
|
27309
27494
|
for (const candidate of params.candidates) {
|
|
27495
|
+
if (allowedModels !== undefined && !isModelCandidateAllowed(candidate, allowedModels)) {
|
|
27496
|
+
skippedAttempts.push(skippedModelAttempt(candidate, `Skipped ${candidate}: model is outside the session's enabledModels scope.`));
|
|
27497
|
+
continue;
|
|
27498
|
+
}
|
|
27310
27499
|
if (currentModel && candidate === currentModel) {
|
|
27311
27500
|
filtered.push(candidate);
|
|
27312
27501
|
continue;
|
|
@@ -27576,8 +27765,16 @@ function refusedResult(agent, task, reason, options) {
|
|
|
27576
27765
|
usage: emptyUsage()
|
|
27577
27766
|
};
|
|
27578
27767
|
}
|
|
27579
|
-
function noSpawnableCandidatesMessage(skippedModels) {
|
|
27580
|
-
|
|
27768
|
+
function noSpawnableCandidatesMessage(skippedModels, skippedAttempts) {
|
|
27769
|
+
const parts = ["No spawnable subagent model candidates after pre-spawn filtering."];
|
|
27770
|
+
if (skippedModels.length > 0) {
|
|
27771
|
+
parts.push(formatNoUsableModelMessage(skippedModels));
|
|
27772
|
+
}
|
|
27773
|
+
const extraReasons = skippedAttempts.map((attempt) => attempt.error).filter((reason) => reason !== undefined && (skippedModels.length === 0 || !reason.includes("no configured API key/auth")));
|
|
27774
|
+
if (extraReasons.length > 0) {
|
|
27775
|
+
parts.push(extraReasons.join(" "));
|
|
27776
|
+
}
|
|
27777
|
+
return parts.join(" ").trim();
|
|
27581
27778
|
}
|
|
27582
27779
|
function namedModelUnavailableMessage(namedModel, skipped) {
|
|
27583
27780
|
const reasons = skipped.map((attempt) => attempt.error).filter((reason) => reason !== undefined);
|
|
@@ -27642,7 +27839,8 @@ async function launchSingleInProcess(runtimeCwd, agent, task, options, turn) {
|
|
|
27642
27839
|
candidates: rawCandidates,
|
|
27643
27840
|
availableModels: options.availableModels,
|
|
27644
27841
|
knownModelProviders: options.knownModelProviders,
|
|
27645
|
-
currentModel: options.currentModel
|
|
27842
|
+
currentModel: options.currentModel,
|
|
27843
|
+
allowedModels: options.allowedModels
|
|
27646
27844
|
});
|
|
27647
27845
|
const resolveCandidate = options.resolveCandidateModel;
|
|
27648
27846
|
if (namesModel && resolveCandidate) {
|
|
@@ -27663,7 +27861,7 @@ async function launchSingleInProcess(runtimeCwd, agent, task, options, turn) {
|
|
|
27663
27861
|
return refuse(namedModelUnavailableMessage(namedModel ?? launchModel, filteredCandidates.skippedAttempts), filteredCandidates.skippedAttempts);
|
|
27664
27862
|
}
|
|
27665
27863
|
if (rawCandidates.length > 0 && filteredCandidates.candidates.length === 0)
|
|
27666
|
-
return refuse(noSpawnableCandidatesMessage(filteredCandidates.skippedModels), filteredCandidates.skippedAttempts);
|
|
27864
|
+
return refuse(noSpawnableCandidatesMessage(filteredCandidates.skippedModels, filteredCandidates.skippedAttempts), filteredCandidates.skippedAttempts);
|
|
27667
27865
|
const listedCandidate = filteredCandidates.candidates[0];
|
|
27668
27866
|
const fallbackCandidates = filteredCandidates.candidates.slice(1);
|
|
27669
27867
|
const inheritsDispatchConfig = agentModel === undefined && (agent.fallbackModels === undefined || agent.fallbackModels.length === 0) && options.modelOverride === undefined;
|
|
@@ -27762,6 +27960,10 @@ ${task}`);
|
|
|
27762
27960
|
} : undefined,
|
|
27763
27961
|
artifactJsonlPath: options.artifactConfig?.includeJsonl === true ? artifactPaths?.jsonlPath : undefined,
|
|
27764
27962
|
...fallbackCandidates.length || namesModel ? { fallbackModels: fallbackCandidates } : {},
|
|
27963
|
+
...options.allowedModels === undefined ? {} : {
|
|
27964
|
+
allowedModels: options.allowedModels,
|
|
27965
|
+
isFallbackModelAllowed: (model) => isModelCandidateAllowed(`${model.provider}/${model.id}`, options.allowedModels)
|
|
27966
|
+
},
|
|
27765
27967
|
...namedModel === undefined ? {} : { namedModel },
|
|
27766
27968
|
...requestedModel ? { requestedModel } : {},
|
|
27767
27969
|
onProgress: options.onUpdate ? (progress) => {
|
|
@@ -29159,6 +29361,7 @@ async function relaunchChild(deps, ctx, record, hold, release, onReopened, resum
|
|
|
29159
29361
|
}
|
|
29160
29362
|
const taskFallback = redispatch && wakeFallback;
|
|
29161
29363
|
const sessionStore = fresh?.ownerStore && !sessionManager ? childSessionStore(ctx.sessionManager) : undefined;
|
|
29364
|
+
const modelScope = resolveSessionModelScope(ctx, deps.pi.getSettings?.());
|
|
29162
29365
|
const options = {
|
|
29163
29366
|
runningCapacity: deps.config.parallel?.runningCapacity,
|
|
29164
29367
|
sessionStartTimeoutMs: deps.config.sessionStartTimeoutMs,
|
|
@@ -29205,6 +29408,7 @@ async function relaunchChild(deps, ctx, record, hold, release, onReopened, resum
|
|
|
29205
29408
|
...intercomGroup ? { intercomGroup } : {},
|
|
29206
29409
|
availableModels: ctx.modelRegistry.getAvailable().map(toModelInfo),
|
|
29207
29410
|
knownModelProviders: collectKnownModelProviders(ctx.modelRegistry),
|
|
29411
|
+
...modelScope === undefined ? {} : { allowedModels: modelScope.allowedFullIds },
|
|
29208
29412
|
resolveCandidateModel,
|
|
29209
29413
|
...inherited.modelProvider ? { preferredModelProvider: inherited.modelProvider } : {},
|
|
29210
29414
|
...ownModel ?? record.namedModel ? { modelOverride: ownModel ?? record.namedModel } : {},
|
|
@@ -32504,12 +32708,14 @@ import { join as join24 } from "node:path";
|
|
|
32504
32708
|
|
|
32505
32709
|
// dist/builtin/subagents/src/runs/shared/auto-model.ts
|
|
32506
32710
|
import { resolveAutoModel } from "@bastani/atomic";
|
|
32507
|
-
function resolveSubagentAutoModel(ctx, settings, agent) {
|
|
32711
|
+
function resolveSubagentAutoModel(ctx, settings, agent, scope) {
|
|
32508
32712
|
const effort = THINKING_LEVELS.find((level) => level === agent.thinking);
|
|
32713
|
+
const availableModels = filterModelsByScope(ctx.modelRegistry.getAvailable(), scope);
|
|
32714
|
+
const sessionModel = ctx.model !== undefined && (scope === undefined || isModelCandidateAllowed(`${ctx.model.provider}/${ctx.model.id}`, scope.allowedFullIds)) ? ctx.model : undefined;
|
|
32509
32715
|
const selected = resolveAutoModel({
|
|
32510
32716
|
settings,
|
|
32511
|
-
availableModels
|
|
32512
|
-
sessionModel
|
|
32717
|
+
availableModels,
|
|
32718
|
+
sessionModel,
|
|
32513
32719
|
sessionThinkingLevel: ctx.thinkingLevel,
|
|
32514
32720
|
...effort === undefined ? {} : { thinkingLevel: effort }
|
|
32515
32721
|
});
|
|
@@ -32634,8 +32840,9 @@ async function runParallelPath(data, deps) {
|
|
|
32634
32840
|
const taskTexts = tasks.map((t) => t.task);
|
|
32635
32841
|
const behaviorOverrides = parallelTaskBehaviorOverrides(tasks, agentConfigs);
|
|
32636
32842
|
const autoModels = tasks.map((task, index) => (task.model ?? agentConfigs[index]?.model) === "auto");
|
|
32637
|
-
const settings =
|
|
32638
|
-
const
|
|
32843
|
+
const settings = deps.pi.getSettings?.();
|
|
32844
|
+
const modelScope = resolveSessionModelScope(ctx, settings);
|
|
32845
|
+
const modelOverrides = tasks.map((_, index) => autoModels[index] ? resolveSubagentAutoModel(ctx, settings, agentConfigs[index], modelScope) : resolveScopedModelCandidate(behaviorOverrides[index]?.model ?? agentConfigs[index]?.model, availableModels, modelScope, currentProvider));
|
|
32639
32846
|
const behaviors = agentConfigs.map((config, index) => suppressProgressForReadOnlyTask(resolveStepBehavior(config, behaviorOverrides[index]), taskTexts[index]));
|
|
32640
32847
|
const firstProgressIndex = behaviors.findIndex((behavior) => behavior.progress);
|
|
32641
32848
|
const liveResults = new Array(tasks.length).fill(undefined);
|
|
@@ -32702,6 +32909,7 @@ async function runParallelPath(data, deps) {
|
|
|
32702
32909
|
paramsCwd: effectiveCwd,
|
|
32703
32910
|
availableModels,
|
|
32704
32911
|
knownModelProviders,
|
|
32912
|
+
...modelScope === undefined ? {} : { allowedModels: modelScope.allowedFullIds },
|
|
32705
32913
|
resolveCandidateModel: createCandidateModelResolver(ctx.modelRegistry, currentProvider),
|
|
32706
32914
|
modelOverrides,
|
|
32707
32915
|
autoModels,
|
|
@@ -32912,11 +33120,13 @@ async function runSinglePath(data, deps) {
|
|
|
32912
33120
|
const currentProvider = ctx.model?.provider;
|
|
32913
33121
|
const availableModels = ctx.modelRegistry.getAvailable().map(toModelInfo);
|
|
32914
33122
|
const knownModelProviders = collectKnownModelProviders(ctx.modelRegistry);
|
|
33123
|
+
const settings = deps.pi.getSettings?.();
|
|
33124
|
+
const modelScope = resolveSessionModelScope(ctx, settings);
|
|
32915
33125
|
const handoffTaskContext = params.task ?? "";
|
|
32916
33126
|
let task = handoffTaskContext;
|
|
32917
33127
|
const effectiveModel = params.model ?? agentConfig.model;
|
|
32918
33128
|
const runsAutoModel = effectiveModel === "auto";
|
|
32919
|
-
const modelOverride = runsAutoModel ? resolveSubagentAutoModel(ctx,
|
|
33129
|
+
const modelOverride = runsAutoModel ? resolveSubagentAutoModel(ctx, settings, agentConfig, modelScope) : resolveScopedModelCandidate(effectiveModel, availableModels, modelScope, currentProvider);
|
|
32920
33130
|
const skillOverride = normalizeSkillInput(params.skill);
|
|
32921
33131
|
const rawOutput = params.output !== undefined ? params.output : agentConfig.output;
|
|
32922
33132
|
const effectiveOutput = normalizeSingleOutputOverride(rawOutput, agentConfig.output);
|
|
@@ -33019,6 +33229,7 @@ async function runSinglePath(data, deps) {
|
|
|
33019
33229
|
...runsAutoModel ? { runsNamedModel: false } : {},
|
|
33020
33230
|
availableModels,
|
|
33021
33231
|
knownModelProviders,
|
|
33232
|
+
...modelScope === undefined ? {} : { allowedModels: modelScope.allowedFullIds },
|
|
33022
33233
|
resolveCandidateModel: createCandidateModelResolver(ctx.modelRegistry, currentProvider),
|
|
33023
33234
|
preferredModelProvider: currentProvider,
|
|
33024
33235
|
currentModel: currentModelFullId(ctx.model),
|
|
@@ -33279,7 +33490,8 @@ async function handleManagementRequest(input) {
|
|
|
33279
33490
|
}
|
|
33280
33491
|
if (action === "models") {
|
|
33281
33492
|
const current = ctx.model;
|
|
33282
|
-
const
|
|
33493
|
+
const modelScope = resolveSessionModelScope(ctx, deps.pi.getSettings?.());
|
|
33494
|
+
const models = filterModelsByScope(ctx.modelRegistry?.getAvailable() ?? [], modelScope).map((model) => ({
|
|
33283
33495
|
provider: model.provider,
|
|
33284
33496
|
id: model.id,
|
|
33285
33497
|
fullId: `${model.provider}/${model.id}`,
|
|
@@ -35660,6 +35872,54 @@ var TOOL_DISPLAY_NAMES = {
|
|
|
35660
35872
|
};
|
|
35661
35873
|
var renderRequests = new WeakMap;
|
|
35662
35874
|
var GLOBAL_THEME_KEY = Symbol.for("@bastani/atomic:theme");
|
|
35875
|
+
function currentThemeInstance() {
|
|
35876
|
+
return globalThis[GLOBAL_THEME_KEY];
|
|
35877
|
+
}
|
|
35878
|
+
function noColorEnabled() {
|
|
35879
|
+
return process.env.NO_COLOR !== undefined;
|
|
35880
|
+
}
|
|
35881
|
+
function isWorkingComponent(component) {
|
|
35882
|
+
return "isWorking" in component && typeof component.isWorking === "function" && component.isWorking() === true;
|
|
35883
|
+
}
|
|
35884
|
+
|
|
35885
|
+
class MemoizedComponent {
|
|
35886
|
+
inner;
|
|
35887
|
+
cachedWidth;
|
|
35888
|
+
cachedNoColor;
|
|
35889
|
+
cachedTheme;
|
|
35890
|
+
cachedLines;
|
|
35891
|
+
constructor(inner) {
|
|
35892
|
+
this.inner = inner;
|
|
35893
|
+
}
|
|
35894
|
+
isWorking() {
|
|
35895
|
+
return isWorkingComponent(this.inner);
|
|
35896
|
+
}
|
|
35897
|
+
invalidate() {
|
|
35898
|
+
this.cachedLines = undefined;
|
|
35899
|
+
this.cachedWidth = undefined;
|
|
35900
|
+
this.inner.invalidate();
|
|
35901
|
+
}
|
|
35902
|
+
render(width) {
|
|
35903
|
+
if (this.isWorking()) {
|
|
35904
|
+
this.cachedLines = undefined;
|
|
35905
|
+
return this.inner.render(width);
|
|
35906
|
+
}
|
|
35907
|
+
const currentNoColor = noColorEnabled();
|
|
35908
|
+
const currentTheme = currentThemeInstance();
|
|
35909
|
+
if (this.cachedLines !== undefined && this.cachedWidth === width && this.cachedNoColor === currentNoColor && this.cachedTheme === currentTheme) {
|
|
35910
|
+
return this.cachedLines;
|
|
35911
|
+
}
|
|
35912
|
+
const lines = this.inner.render(width);
|
|
35913
|
+
this.cachedWidth = width;
|
|
35914
|
+
this.cachedNoColor = currentNoColor;
|
|
35915
|
+
this.cachedTheme = currentTheme;
|
|
35916
|
+
this.cachedLines = lines;
|
|
35917
|
+
return lines;
|
|
35918
|
+
}
|
|
35919
|
+
}
|
|
35920
|
+
function completedToolCallSignature(entry) {
|
|
35921
|
+
return `${entry.name}\x00${entry.isError ? "1" : "0"}\x00${entry.durationMs ?? ""}\x00${entry.resultText ?? ""}`;
|
|
35922
|
+
}
|
|
35663
35923
|
var taskElapsedBaselines = new WeakMap;
|
|
35664
35924
|
var expandedSectionCaches = new WeakMap;
|
|
35665
35925
|
function discardExpandedSections(card) {
|
|
@@ -35849,6 +36109,9 @@ class ComponentList {
|
|
|
35849
36109
|
constructor(items) {
|
|
35850
36110
|
this.items = items;
|
|
35851
36111
|
}
|
|
36112
|
+
isWorking() {
|
|
36113
|
+
return this.items.some((item) => isWorkingComponent(item));
|
|
36114
|
+
}
|
|
35852
36115
|
invalidate() {
|
|
35853
36116
|
for (const item of this.items)
|
|
35854
36117
|
item.invalidate();
|
|
@@ -36096,6 +36359,9 @@ class SectionRecord {
|
|
|
36096
36359
|
this.heading = heading;
|
|
36097
36360
|
this.content = content;
|
|
36098
36361
|
}
|
|
36362
|
+
isWorking() {
|
|
36363
|
+
return isWorkingComponent(this.content);
|
|
36364
|
+
}
|
|
36099
36365
|
invalidate() {
|
|
36100
36366
|
this.content.invalidate();
|
|
36101
36367
|
}
|
|
@@ -36142,6 +36408,11 @@ function buildExpandedDetails(input) {
|
|
|
36142
36408
|
const cleanPrompt = unwrapSubagentPrompt(promptText);
|
|
36143
36409
|
const runningKey = running ? "1" : "0";
|
|
36144
36410
|
const key = `${runningKey}\x00${cleanPrompt}\x00${toolCallsUnavailable ?? ""}\x00${resultText ?? ""}\x00${failureText ?? ""}`;
|
|
36411
|
+
const makeSections = (toolBlocks) => [
|
|
36412
|
+
new MemoizedComponent(new SectionRecord(theme.bold("Prompt"), cleanPrompt ? new ToolBlockMarkdown(cleanPrompt) : new Text(theme.fg("dim", "(none)"), 0, 0))),
|
|
36413
|
+
new MemoizedComponent(new SectionRecord(theme.bold("Tool calls"), toolBlocks.length > 0 ? new ComponentList(toolBlocks) : new Text(theme.fg("dim", toolCallsUnavailable || "(none)"), 0, 0))),
|
|
36414
|
+
new MemoizedComponent(new SectionRecord(theme.bold("Result"), resultText ? new ToolBlockMarkdown(resultText) : failureText ? new Text(theme.fg("error", displayText2(failureText)), 0, 0) : new Text(theme.fg("dim", running ? "Running…" : "(no output)"), 0, 0)))
|
|
36415
|
+
];
|
|
36145
36416
|
if (state && cacheId) {
|
|
36146
36417
|
let cache = expandedSectionCaches.get(state);
|
|
36147
36418
|
if (!cache) {
|
|
@@ -36150,24 +36421,19 @@ function buildExpandedDetails(input) {
|
|
|
36150
36421
|
}
|
|
36151
36422
|
const existing = cache.get(cacheId);
|
|
36152
36423
|
if (existing && existing.key === key && existing.hydratedRef === hydratedRef) {
|
|
36153
|
-
|
|
36424
|
+
existing.statusLineHolder.current = statusLine;
|
|
36425
|
+
return existing.records;
|
|
36154
36426
|
}
|
|
36155
|
-
const
|
|
36156
|
-
const
|
|
36157
|
-
|
|
36158
|
-
|
|
36159
|
-
|
|
36160
|
-
|
|
36161
|
-
|
|
36162
|
-
return new ToolBlockRecords([new OneLine(statusLine), ...sections]);
|
|
36427
|
+
const nextCompleted = new Map;
|
|
36428
|
+
const toolBlocks = buildToolBlocks(existing?.completedToolBlocks, nextCompleted);
|
|
36429
|
+
const statusLineHolder = { current: statusLine };
|
|
36430
|
+
const statusComponent = new OneLine(() => typeof statusLineHolder.current === "function" ? statusLineHolder.current() : statusLineHolder.current);
|
|
36431
|
+
const records = new ToolBlockRecords([statusComponent, ...makeSections(toolBlocks)]);
|
|
36432
|
+
cache.set(cacheId, { key, hydratedRef, statusLineHolder, records, completedToolBlocks: nextCompleted });
|
|
36433
|
+
return records;
|
|
36163
36434
|
}
|
|
36164
36435
|
const toolBlocks = buildToolBlocks();
|
|
36165
|
-
return new ToolBlockRecords([
|
|
36166
|
-
new OneLine(statusLine),
|
|
36167
|
-
new SectionRecord(theme.bold("Prompt"), cleanPrompt ? new ToolBlockMarkdown(cleanPrompt) : new Text(theme.fg("dim", "(none)"), 0, 0)),
|
|
36168
|
-
new SectionRecord(theme.bold("Tool calls"), toolBlocks.length > 0 ? new ComponentList(toolBlocks) : new Text(theme.fg("dim", toolCallsUnavailable || "(none)"), 0, 0)),
|
|
36169
|
-
new SectionRecord(theme.bold("Result"), resultText ? new ToolBlockMarkdown(resultText) : failureText ? new Text(theme.fg("error", displayText2(failureText)), 0, 0) : new Text(theme.fg("dim", running ? "Running…" : "(no output)"), 0, 0))
|
|
36170
|
-
]);
|
|
36436
|
+
return new ToolBlockRecords([new OneLine(statusLine), ...makeSections(toolBlocks)]);
|
|
36171
36437
|
}
|
|
36172
36438
|
function waitingText(tools) {
|
|
36173
36439
|
return `Waiting on ${displayText2(tools ?? "a tool call")}`;
|
|
@@ -36400,7 +36666,21 @@ function buildOutcomeToolBlock(input) {
|
|
|
36400
36666
|
statusLine,
|
|
36401
36667
|
running: working,
|
|
36402
36668
|
promptText,
|
|
36403
|
-
buildToolBlocks: () => (hydrated?.toolCalls ?? []).map((entry) =>
|
|
36669
|
+
buildToolBlocks: (previousCompleted, nextCompleted) => (hydrated?.toolCalls ?? []).map((entry) => {
|
|
36670
|
+
if (entry.completed && entry.id) {
|
|
36671
|
+
const signature = completedToolCallSignature(entry);
|
|
36672
|
+
const cached = previousCompleted?.get(entry.id);
|
|
36673
|
+
if (cached && cached.signature === signature) {
|
|
36674
|
+
nextCompleted?.set(entry.id, cached);
|
|
36675
|
+
return cached.component;
|
|
36676
|
+
}
|
|
36677
|
+
const component = new MemoizedComponent(innerToolBlockFromEntry(entry, working, theme, context));
|
|
36678
|
+
nextCompleted?.set(entry.id, { signature, component });
|
|
36679
|
+
return component;
|
|
36680
|
+
}
|
|
36681
|
+
const block = innerToolBlockFromEntry(entry, working, theme, context);
|
|
36682
|
+
return entry.completed ? new MemoizedComponent(block) : block;
|
|
36683
|
+
}),
|
|
36404
36684
|
toolCallsUnavailable,
|
|
36405
36685
|
resultText,
|
|
36406
36686
|
failureText: failure,
|
|
@@ -36488,7 +36768,10 @@ function buildForegroundChildToolBlock(input) {
|
|
|
36488
36768
|
});
|
|
36489
36769
|
}
|
|
36490
36770
|
const messageEntries = toolEntriesFromMessages(child?.messages);
|
|
36491
|
-
const toolBlocks = messageEntries.length > 0 ? messageEntries.map((entry) =>
|
|
36771
|
+
const toolBlocks = messageEntries.length > 0 ? messageEntries.map((entry) => {
|
|
36772
|
+
const block = innerToolBlockFromEntry(entry, live, theme, context);
|
|
36773
|
+
return entry.completed ? new MemoizedComponent(block) : block;
|
|
36774
|
+
}) : toolBlocksFromSummaries(child?.toolCalls, activeProgress).map((block) => block.isWorking() ? block : new MemoizedComponent(block));
|
|
36492
36775
|
return new ToolBlock({
|
|
36493
36776
|
status,
|
|
36494
36777
|
title: "Agent",
|
|
@@ -8,7 +8,7 @@ import * as __atomicHostImport2 from "@bastani/atomic-ai/compat";
|
|
|
8
8
|
if (!(name in namespace)) missing.push(`The requested module '${specifier}' does not provide an export named '${name}'`);
|
|
9
9
|
if (missing.length > 0) {
|
|
10
10
|
const application = typeof __atomicHostImport0.APP_NAME === "string" ? __atomicHostImport0.APP_NAME : "atomic";
|
|
11
|
-
if (__atomicHostImport0.VERSION !== "0.10.
|
|
11
|
+
if (__atomicHostImport0.VERSION !== "0.10.7") missing.unshift(application + " was updated to 0.10.7 while this session was running; restart it to keep using the web-access extension.");
|
|
12
12
|
throw new Error(missing.join("\n"));
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -6,7 +6,7 @@ try {
|
|
|
6
6
|
} catch (error) {
|
|
7
7
|
const root = new URL("../", import.meta.url);
|
|
8
8
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
-
const key = `${root.href}#0.10.
|
|
9
|
+
const key = `${root.href}#0.10.7`;
|
|
10
10
|
let release = releases.get(key);
|
|
11
11
|
if (release === undefined) {
|
|
12
12
|
const current = (async () => {
|
|
@@ -27,8 +27,8 @@ try {
|
|
|
27
27
|
release = current;
|
|
28
28
|
}
|
|
29
29
|
const running = await release;
|
|
30
|
-
if (running === undefined || running.version === "0.10.
|
|
31
|
-
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.
|
|
30
|
+
if (running === undefined || running.version === "0.10.7") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.7 while this session was running; restart it to keep using this feature.", {
|
|
32
32
|
cause: error,
|
|
33
33
|
});
|
|
34
34
|
}
|
package/dist/cli/auth-cli.js
CHANGED
|
@@ -6,7 +6,7 @@ try {
|
|
|
6
6
|
} catch (error) {
|
|
7
7
|
const root = new URL("../", import.meta.url);
|
|
8
8
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
-
const key = `${root.href}#0.10.
|
|
9
|
+
const key = `${root.href}#0.10.7`;
|
|
10
10
|
let release = releases.get(key);
|
|
11
11
|
if (release === undefined) {
|
|
12
12
|
const current = (async () => {
|
|
@@ -27,8 +27,8 @@ try {
|
|
|
27
27
|
release = current;
|
|
28
28
|
}
|
|
29
29
|
const running = await release;
|
|
30
|
-
if (running === undefined || running.version === "0.10.
|
|
31
|
-
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.
|
|
30
|
+
if (running === undefined || running.version === "0.10.7") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.7 while this session was running; restart it to keep using this feature.", {
|
|
32
32
|
cause: error,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -6,7 +6,7 @@ try {
|
|
|
6
6
|
} catch (error) {
|
|
7
7
|
const root = new URL("../", import.meta.url);
|
|
8
8
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
-
const key = `${root.href}#0.10.
|
|
9
|
+
const key = `${root.href}#0.10.7`;
|
|
10
10
|
let release = releases.get(key);
|
|
11
11
|
if (release === undefined) {
|
|
12
12
|
const current = (async () => {
|
|
@@ -27,8 +27,8 @@ try {
|
|
|
27
27
|
release = current;
|
|
28
28
|
}
|
|
29
29
|
const running = await release;
|
|
30
|
-
if (running === undefined || running.version === "0.10.
|
|
31
|
-
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.
|
|
30
|
+
if (running === undefined || running.version === "0.10.7") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.7 while this session was running; restart it to keep using this feature.", {
|
|
32
32
|
cause: error,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -6,7 +6,7 @@ try {
|
|
|
6
6
|
} catch (error) {
|
|
7
7
|
const root = new URL("../", import.meta.url);
|
|
8
8
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
-
const key = `${root.href}#0.10.
|
|
9
|
+
const key = `${root.href}#0.10.7`;
|
|
10
10
|
let release = releases.get(key);
|
|
11
11
|
if (release === undefined) {
|
|
12
12
|
const current = (async () => {
|
|
@@ -27,8 +27,8 @@ try {
|
|
|
27
27
|
release = current;
|
|
28
28
|
}
|
|
29
29
|
const running = await release;
|
|
30
|
-
if (running === undefined || running.version === "0.10.
|
|
31
|
-
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.
|
|
30
|
+
if (running === undefined || running.version === "0.10.7") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.7 while this session was running; restart it to keep using this feature.", {
|
|
32
32
|
cause: error,
|
|
33
33
|
});
|
|
34
34
|
}
|