@bastani/atomic 0.8.29-alpha.4 → 0.8.30-alpha.1
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 +27 -0
- package/dist/builtin/cursor/CHANGELOG.md +6 -0
- package/dist/builtin/cursor/package.json +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +7 -1
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/CHANGELOG.md +7 -1
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/subagents/CHANGELOG.md +11 -0
- package/dist/builtin/subagents/README.md +10 -30
- package/dist/builtin/subagents/package.json +4 -4
- package/dist/builtin/subagents/skills/subagent/SKILL.md +5 -11
- package/dist/builtin/subagents/src/agents/agent-management.ts +0 -5
- package/dist/builtin/subagents/src/agents/agent-serializer.ts +7 -3
- package/dist/builtin/subagents/src/agents/agents.ts +4 -29
- package/dist/builtin/subagents/src/agents/chain-serializer.ts +27 -25
- package/dist/builtin/subagents/src/extension/schemas.ts +0 -75
- package/dist/builtin/subagents/src/runs/background/async-execution.ts +0 -29
- package/dist/builtin/subagents/src/runs/background/run-status.ts +1 -2
- package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +134 -239
- package/dist/builtin/subagents/src/runs/foreground/chain-execution.ts +1 -52
- package/dist/builtin/subagents/src/runs/foreground/execution.ts +103 -94
- package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +0 -10
- package/dist/builtin/subagents/src/runs/shared/dynamic-fanout.ts +16 -8
- package/dist/builtin/subagents/src/runs/shared/model-fallback.ts +0 -1
- package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +0 -3
- package/dist/builtin/subagents/src/runs/shared/structured-output.ts +67 -2
- package/dist/builtin/subagents/src/runs/shared/subagent-control.ts +6 -20
- package/dist/builtin/subagents/src/runs/shared/subagent-prompt-runtime.ts +1 -1
- package/dist/builtin/subagents/src/runs/shared/workflow-graph.ts +2 -6
- package/dist/builtin/subagents/src/shared/settings.ts +1 -4
- package/dist/builtin/subagents/src/shared/types.ts +1 -156
- package/dist/builtin/subagents/src/tui/render.ts +0 -1
- package/dist/builtin/web-access/CHANGELOG.md +7 -1
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +13 -0
- package/dist/builtin/workflows/README.md +2 -2
- package/dist/builtin/workflows/package.json +2 -2
- package/dist/builtin/workflows/src/extension/index.ts +8 -1
- package/dist/builtin/workflows/src/extension/wiring.ts +66 -10
- package/dist/builtin/workflows/src/runs/foreground/executor.ts +70 -19
- package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +98 -14
- package/dist/builtin/workflows/src/runs/shared/model-fallback.ts +0 -1
- package/dist/builtin/workflows/src/shared/persistence-restore.ts +4 -0
- package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +4 -0
- package/dist/builtin/workflows/src/shared/store.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +18 -4
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +2 -2
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +21 -9
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +2 -2
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +6 -0
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +2 -0
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/context-compaction.d.ts +43 -16
- package/dist/core/compaction/context-compaction.d.ts.map +1 -1
- package/dist/core/compaction/context-compaction.js +518 -189
- package/dist/core/compaction/context-compaction.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +4 -2
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +11 -7
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/types.d.ts +14 -3
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +2 -1
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/package-manager.d.ts +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +52 -18
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/resource-loader.d.ts +20 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +89 -24
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/session-manager.d.ts +14 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +145 -3
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +9 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +16 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/thinking-blocks.d.ts +7 -0
- package/dist/core/thinking-blocks.d.ts.map +1 -0
- package/dist/core/thinking-blocks.js +16 -0
- package/dist/core/thinking-blocks.js.map +1 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +4 -0
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +30 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +87 -12
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +37 -18
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +24 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +58 -13
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/utils/child-process.d.ts +9 -4
- package/dist/utils/child-process.d.ts.map +1 -1
- package/dist/utils/child-process.js +42 -10
- package/dist/utils/child-process.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +4 -27
- package/dist/utils/version-check.js.map +1 -1
- package/docs/compaction.md +469 -51
- package/docs/containerization.md +37 -37
- package/docs/extensions.md +23 -14
- package/docs/models.md +6 -4
- package/docs/packages.md +2 -0
- package/docs/providers.md +1 -1
- package/docs/subagents.md +11 -4
- package/docs/workflows.md +4 -2
- package/examples/extensions/README.md +2 -2
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/question.ts +39 -18
- package/examples/extensions/questionnaire.ts +49 -28
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +7 -5
- package/dist/builtin/subagents/src/runs/shared/acceptance.ts +0 -612
- package/dist/builtin/subagents/src/runs/shared/completion-guard.ts +0 -147
|
@@ -24,6 +24,7 @@ import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
|
24
24
|
import { globSync } from "glob";
|
|
25
25
|
import ignore from "ignore";
|
|
26
26
|
import { minimatch } from "minimatch";
|
|
27
|
+
import { maxSatisfying, rcompare, satisfies, valid, validRange } from "semver";
|
|
27
28
|
import { APP_NAME, CONFIG_DIR_NAME, ENV_OFFLINE, getAgentDir, getAgentDirs, getEnvValue, getProjectConfigDirs } from "../config.js";
|
|
28
29
|
import { spawnProcess, spawnProcessSync } from "../utils/child-process.js";
|
|
29
30
|
import { createGitEnvironment } from "../utils/git-env.js";
|
|
@@ -39,6 +40,12 @@ function isOfflineModeEnabled() {
|
|
|
39
40
|
return false;
|
|
40
41
|
return value === "1" || value.toLowerCase() === "true" || value.toLowerCase() === "yes";
|
|
41
42
|
}
|
|
43
|
+
function isExactNpmVersion(version) {
|
|
44
|
+
return valid(version ?? "") !== null;
|
|
45
|
+
}
|
|
46
|
+
function getNpmVersionRange(version) {
|
|
47
|
+
return version ? (validRange(version) ?? undefined) : undefined;
|
|
48
|
+
}
|
|
42
49
|
function isGitCommand(command) {
|
|
43
50
|
const commandName = basename(command).toLowerCase();
|
|
44
51
|
return commandName === "git" || commandName === "git.exe";
|
|
@@ -941,8 +948,8 @@ export class DefaultPackageManager {
|
|
|
941
948
|
return true;
|
|
942
949
|
}
|
|
943
950
|
try {
|
|
944
|
-
const
|
|
945
|
-
return
|
|
951
|
+
const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range);
|
|
952
|
+
return targetVersion !== installedVersion;
|
|
946
953
|
}
|
|
947
954
|
catch {
|
|
948
955
|
// Preserve existing update behavior when version lookup fails.
|
|
@@ -955,7 +962,7 @@ export class DefaultPackageManager {
|
|
|
955
962
|
}
|
|
956
963
|
const sourceLabel = sources.length === 1 ? sources[0].source : `${scope} npm packages`;
|
|
957
964
|
const message = sources.length === 1 ? `Updating ${sources[0].source}...` : `Updating ${scope} npm packages...`;
|
|
958
|
-
const specs = sources.map((entry) => `${entry.parsed.name}@latest`);
|
|
965
|
+
const specs = sources.map((entry) => (entry.parsed.version ? entry.parsed.spec : `${entry.parsed.name}@latest`));
|
|
959
966
|
await this.withProgress("update", sourceLabel, message, async () => {
|
|
960
967
|
await this.installNpmBatch(specs, scope);
|
|
961
968
|
});
|
|
@@ -1053,14 +1060,15 @@ export class DefaultPackageManager {
|
|
|
1053
1060
|
};
|
|
1054
1061
|
if (parsed.type === "npm") {
|
|
1055
1062
|
let installedPath = this.getExistingNpmInstallPath(parsed, scope);
|
|
1056
|
-
const needsInstall = !installedPath ||
|
|
1057
|
-
(parsed.pinned && !(await this.installedNpmMatchesPinnedVersion(parsed, installedPath)));
|
|
1058
|
-
if (needsInstall)
|
|
1059
|
-
installedPath = this.getNpmInstallPath(parsed, scope);
|
|
1063
|
+
const needsInstall = !installedPath || !(await this.installedNpmMatchesConfiguredVersion(parsed, installedPath));
|
|
1060
1064
|
if (needsInstall) {
|
|
1061
1065
|
const installed = await installMissing();
|
|
1062
1066
|
if (!installed)
|
|
1063
1067
|
continue;
|
|
1068
|
+
installedPath = this.getExistingNpmInstallPath(parsed, scope);
|
|
1069
|
+
if (!installedPath || !(await this.installedNpmMatchesConfiguredVersion(parsed, installedPath))) {
|
|
1070
|
+
continue;
|
|
1071
|
+
}
|
|
1064
1072
|
}
|
|
1065
1073
|
if (!installedPath)
|
|
1066
1074
|
continue;
|
|
@@ -1197,7 +1205,9 @@ export class DefaultPackageManager {
|
|
|
1197
1205
|
type: "npm",
|
|
1198
1206
|
spec,
|
|
1199
1207
|
name,
|
|
1200
|
-
|
|
1208
|
+
version,
|
|
1209
|
+
range: getNpmVersionRange(version),
|
|
1210
|
+
pinned: isExactNpmVersion(version),
|
|
1201
1211
|
};
|
|
1202
1212
|
}
|
|
1203
1213
|
if (isLocalPath(source)) {
|
|
@@ -1210,16 +1220,30 @@ export class DefaultPackageManager {
|
|
|
1210
1220
|
}
|
|
1211
1221
|
return { type: "local", path: source };
|
|
1212
1222
|
}
|
|
1213
|
-
async
|
|
1223
|
+
async installedNpmMatchesConfiguredVersion(source, installedPath) {
|
|
1214
1224
|
const installedVersion = this.getInstalledNpmVersion(installedPath);
|
|
1215
1225
|
if (!installedVersion) {
|
|
1216
1226
|
return false;
|
|
1217
1227
|
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1228
|
+
if (source.range) {
|
|
1229
|
+
return satisfies(installedVersion, source.range);
|
|
1230
|
+
}
|
|
1231
|
+
if (source.version !== undefined) {
|
|
1232
|
+
if (isOfflineModeEnabled()) {
|
|
1233
|
+
// Non-semver selectors such as npm dist-tags are mutable, but offline mode cannot
|
|
1234
|
+
// resolve the current registry target. Keep an already-installed copy usable;
|
|
1235
|
+
// online resolution still verifies the exact tag target before accepting it.
|
|
1236
|
+
return true;
|
|
1237
|
+
}
|
|
1238
|
+
try {
|
|
1239
|
+
const targetVersion = await this.getLatestNpmVersion(source.spec);
|
|
1240
|
+
return installedVersion === targetVersion;
|
|
1241
|
+
}
|
|
1242
|
+
catch {
|
|
1243
|
+
return false;
|
|
1244
|
+
}
|
|
1221
1245
|
}
|
|
1222
|
-
return
|
|
1246
|
+
return true;
|
|
1223
1247
|
}
|
|
1224
1248
|
async npmHasAvailableUpdate(source, installedPath) {
|
|
1225
1249
|
if (isOfflineModeEnabled()) {
|
|
@@ -1230,8 +1254,8 @@ export class DefaultPackageManager {
|
|
|
1230
1254
|
return false;
|
|
1231
1255
|
}
|
|
1232
1256
|
try {
|
|
1233
|
-
const
|
|
1234
|
-
return
|
|
1257
|
+
const targetVersion = await this.getLatestNpmVersion(source.version ? source.spec : source.name, source.range);
|
|
1258
|
+
return targetVersion !== installedVersion;
|
|
1235
1259
|
}
|
|
1236
1260
|
catch {
|
|
1237
1261
|
return false;
|
|
@@ -1250,13 +1274,23 @@ export class DefaultPackageManager {
|
|
|
1250
1274
|
return undefined;
|
|
1251
1275
|
}
|
|
1252
1276
|
}
|
|
1253
|
-
async getLatestNpmVersion(
|
|
1277
|
+
async getLatestNpmVersion(packageSpec, range) {
|
|
1254
1278
|
const npmCommand = this.getNpmCommand();
|
|
1255
|
-
const stdout = await this.runCommandCapture(npmCommand.command, [...npmCommand.args, "view",
|
|
1279
|
+
const stdout = await this.runCommandCapture(npmCommand.command, [...npmCommand.args, "view", packageSpec, "version", "--json"], { cwd: this.cwd, timeoutMs: NETWORK_TIMEOUT_MS });
|
|
1256
1280
|
const raw = stdout.trim();
|
|
1257
1281
|
if (!raw)
|
|
1258
1282
|
throw new Error("Empty response from npm view");
|
|
1259
|
-
|
|
1283
|
+
const parsed = JSON.parse(raw);
|
|
1284
|
+
if (typeof parsed === "string") {
|
|
1285
|
+
return parsed;
|
|
1286
|
+
}
|
|
1287
|
+
if (Array.isArray(parsed)) {
|
|
1288
|
+
const versions = parsed.filter((value) => typeof value === "string" && value.length > 0);
|
|
1289
|
+
const latest = range ? maxSatisfying(versions, range) : [...versions].sort(rcompare)[0];
|
|
1290
|
+
if (latest)
|
|
1291
|
+
return latest;
|
|
1292
|
+
}
|
|
1293
|
+
throw new Error("Unexpected response from npm view");
|
|
1260
1294
|
}
|
|
1261
1295
|
async gitHasAvailableUpdate(installedPath) {
|
|
1262
1296
|
if (isOfflineModeEnabled()) {
|