@bastani/atomic 0.8.29 → 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 +25 -0
- package/dist/builtin/cursor/CHANGELOG.md +4 -0
- package/dist/builtin/cursor/package.json +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +4 -0
- package/dist/builtin/intercom/package.json +2 -2
- package/dist/builtin/mcp/CHANGELOG.md +4 -0
- package/dist/builtin/mcp/package.json +3 -3
- package/dist/builtin/subagents/CHANGELOG.md +9 -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 +4 -0
- package/dist/builtin/web-access/package.json +2 -2
- package/dist/builtin/workflows/CHANGELOG.md +11 -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
|
@@ -1538,13 +1538,18 @@ export class AgentSession {
|
|
|
1538
1538
|
// Capture the narrowed model now (control-flow narrowing holds immediately after the
|
|
1539
1539
|
// guard) so the lazy planner-fallback closure below can use a non-undefined model.
|
|
1540
1540
|
const model = this.model;
|
|
1541
|
+
const compactionThinkingLevel = this.thinkingLevel;
|
|
1541
1542
|
const pathEntries = this.sessionManager.getBranch();
|
|
1542
1543
|
const settings = this.settingsManager.getCompactionSettings();
|
|
1543
|
-
const
|
|
1544
|
-
|
|
1544
|
+
const preparation = prepareContextCompaction(pathEntries, settings, {
|
|
1545
|
+
...(options.compression_ratio === undefined ? {} : { compression_ratio: options.compression_ratio }),
|
|
1546
|
+
...(options.preserve_recent === undefined ? {} : { preserve_recent: options.preserve_recent }),
|
|
1547
|
+
...(options.query === undefined ? {} : { query: options.query }),
|
|
1548
|
+
});
|
|
1545
1549
|
if (!preparation) {
|
|
1546
1550
|
return undefined;
|
|
1547
1551
|
}
|
|
1552
|
+
const parameters = preparation.parameters;
|
|
1548
1553
|
// Planner fallback used when no extension supplies a deletionRequest. Auth is resolved
|
|
1549
1554
|
// lazily here so extension-provided deletion requests keep working offline. Returns
|
|
1550
1555
|
// undefined when auth is unavailable (auto-mode resolvers), signaling a no-op compaction.
|
|
@@ -1552,7 +1557,7 @@ export class AgentSession {
|
|
|
1552
1557
|
const auth = await options.resolvePlannerAuth();
|
|
1553
1558
|
if (!auth)
|
|
1554
1559
|
return undefined;
|
|
1555
|
-
return runContextCompact(preparation, model, auth.apiKey, auth.headers, options.abortController.signal,
|
|
1560
|
+
return runContextCompact(preparation, model, auth.apiKey, auth.headers, options.abortController.signal, compactionThinkingLevel);
|
|
1556
1561
|
};
|
|
1557
1562
|
// Emit session_before_compact to allow extensions to cancel or provide a deletion request.
|
|
1558
1563
|
// This happens BEFORE any auth resolution so local extension deletion requests work
|
|
@@ -1579,7 +1584,7 @@ export class AgentSession {
|
|
|
1579
1584
|
const hookResult = (await this._extensionRunner.emit({
|
|
1580
1585
|
type: "session_before_compact",
|
|
1581
1586
|
reason: options.reason,
|
|
1582
|
-
|
|
1587
|
+
parameters,
|
|
1583
1588
|
preparation: extensionPreparation,
|
|
1584
1589
|
branchEntries: pathEntries,
|
|
1585
1590
|
signal: options.abortController.signal,
|
|
@@ -1595,7 +1600,7 @@ export class AgentSession {
|
|
|
1595
1600
|
}
|
|
1596
1601
|
// Validate against the internal transcript snapshot, not the extension-facing clone.
|
|
1597
1602
|
// Auth is NOT resolved here — local extension deletion requests work offline.
|
|
1598
|
-
validated = validateContextDeletionRequest(extensionDeletionRequest, preparation.transcript
|
|
1603
|
+
validated = validateContextDeletionRequest(extensionDeletionRequest, preparation.transcript);
|
|
1599
1604
|
// Reject if reconciliation reduced deletions to zero.
|
|
1600
1605
|
if (validated.deletedTargets.length === 0) {
|
|
1601
1606
|
throw new Error("No safe context deletions proposed by extension");
|
|
@@ -1623,6 +1628,7 @@ export class AgentSession {
|
|
|
1623
1628
|
const result = {
|
|
1624
1629
|
...validated,
|
|
1625
1630
|
promptVersion: 1,
|
|
1631
|
+
parameters,
|
|
1626
1632
|
...(backupPath ? { backupPath } : {}),
|
|
1627
1633
|
};
|
|
1628
1634
|
// Emit session_compact so extensions can observe the validated result. This is a pure
|
|
@@ -1636,7 +1642,7 @@ export class AgentSession {
|
|
|
1636
1642
|
await this._extensionRunner.emit({
|
|
1637
1643
|
type: "session_compact",
|
|
1638
1644
|
reason: options.reason,
|
|
1639
|
-
|
|
1645
|
+
parameters,
|
|
1640
1646
|
result,
|
|
1641
1647
|
contextCompactionEntry,
|
|
1642
1648
|
fromExtension,
|
|
@@ -1656,7 +1662,7 @@ export class AgentSession {
|
|
|
1656
1662
|
* Manually compact the session context using deletion-only verbatim context compaction.
|
|
1657
1663
|
* Aborts current agent operation first.
|
|
1658
1664
|
*/
|
|
1659
|
-
async compact() {
|
|
1665
|
+
async compact(options = {}) {
|
|
1660
1666
|
this._disconnectFromAgent();
|
|
1661
1667
|
await this.abort();
|
|
1662
1668
|
this._compactionAbortController = new AbortController();
|
|
@@ -1673,6 +1679,9 @@ export class AgentSession {
|
|
|
1673
1679
|
abortController: this._compactionAbortController,
|
|
1674
1680
|
backupLabel: "compact",
|
|
1675
1681
|
reason: "manual",
|
|
1682
|
+
...(options.compression_ratio === undefined ? {} : { compression_ratio: options.compression_ratio }),
|
|
1683
|
+
...(options.preserve_recent === undefined ? {} : { preserve_recent: options.preserve_recent }),
|
|
1684
|
+
...(options.query === undefined ? {} : { query: options.query }),
|
|
1676
1685
|
});
|
|
1677
1686
|
if (!result) {
|
|
1678
1687
|
throw new Error("Nothing to compact (session too small)");
|
|
@@ -1919,7 +1928,6 @@ export class AgentSession {
|
|
|
1919
1928
|
},
|
|
1920
1929
|
abortController: this._autoCompactionAbortController,
|
|
1921
1930
|
backupLabel: reason === "overflow" ? "overflow-auto-compact" : "auto-compact",
|
|
1922
|
-
mode: reason === "overflow" ? "critical_overflow" : "standard",
|
|
1923
1931
|
reason,
|
|
1924
1932
|
});
|
|
1925
1933
|
if (!result) {
|
|
@@ -2128,7 +2136,11 @@ export class AgentSession {
|
|
|
2128
2136
|
compact: (options) => {
|
|
2129
2137
|
void (async () => {
|
|
2130
2138
|
try {
|
|
2131
|
-
const result = await this.compact(
|
|
2139
|
+
const result = await this.compact({
|
|
2140
|
+
...(options?.compression_ratio === undefined ? {} : { compression_ratio: options.compression_ratio }),
|
|
2141
|
+
...(options?.preserve_recent === undefined ? {} : { preserve_recent: options.preserve_recent }),
|
|
2142
|
+
...(options?.query === undefined ? {} : { query: options.query }),
|
|
2143
|
+
});
|
|
2132
2144
|
options?.onComplete?.(result);
|
|
2133
2145
|
}
|
|
2134
2146
|
catch (error) {
|