@bastani/atomic 0.8.26-alpha.7 → 0.8.26-alpha.8

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.
Files changed (67) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +5 -8
  3. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  4. package/dist/builtin/intercom/package.json +1 -1
  5. package/dist/builtin/mcp/CHANGELOG.md +6 -0
  6. package/dist/builtin/mcp/package.json +1 -1
  7. package/dist/builtin/subagents/CHANGELOG.md +6 -0
  8. package/dist/builtin/subagents/package.json +1 -1
  9. package/dist/builtin/web-access/CHANGELOG.md +6 -0
  10. package/dist/builtin/web-access/package.json +1 -1
  11. package/dist/builtin/workflows/CHANGELOG.md +6 -0
  12. package/dist/builtin/workflows/package.json +1 -1
  13. package/dist/builtin/workflows/src/extension/wiring.ts +13 -1
  14. package/dist/builtin/workflows/src/runs/foreground/executor.ts +12 -6
  15. package/dist/builtin/workflows/src/runs/foreground/stage-runner.ts +2 -2
  16. package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +2 -2
  17. package/dist/builtin/workflows/src/shared/types.ts +3 -3
  18. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +1 -9
  19. package/dist/core/agent-session.d.ts +5 -5
  20. package/dist/core/agent-session.d.ts.map +1 -1
  21. package/dist/core/agent-session.js +64 -173
  22. package/dist/core/agent-session.js.map +1 -1
  23. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  24. package/dist/core/atomic-guide-command.js +1 -1
  25. package/dist/core/atomic-guide-command.js.map +1 -1
  26. package/dist/core/extensions/types.d.ts +3 -2
  27. package/dist/core/extensions/types.d.ts.map +1 -1
  28. package/dist/core/extensions/types.js.map +1 -1
  29. package/dist/core/session-manager.d.ts.map +1 -1
  30. package/dist/core/session-manager.js +1 -1
  31. package/dist/core/session-manager.js.map +1 -1
  32. package/dist/core/slash-commands.d.ts.map +1 -1
  33. package/dist/core/slash-commands.js +1 -2
  34. package/dist/core/slash-commands.js.map +1 -1
  35. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  36. package/dist/modes/interactive/components/chat-session-host.js +1 -1
  37. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  38. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts +17 -0
  39. package/dist/modes/interactive/components/context-compaction-summary-message.d.ts.map +1 -0
  40. package/dist/modes/interactive/components/context-compaction-summary-message.js +83 -0
  41. package/dist/modes/interactive/components/context-compaction-summary-message.js.map +1 -0
  42. package/dist/modes/interactive/components/index.d.ts +1 -0
  43. package/dist/modes/interactive/components/index.d.ts.map +1 -1
  44. package/dist/modes/interactive/components/index.js +1 -0
  45. package/dist/modes/interactive/components/index.js.map +1 -1
  46. package/dist/modes/interactive/interactive-mode.d.ts +1 -1
  47. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  48. package/dist/modes/interactive/interactive-mode.js +28 -38
  49. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  50. package/dist/modes/rpc/rpc-client.d.ts +3 -3
  51. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  52. package/dist/modes/rpc/rpc-client.js +1 -1
  53. package/dist/modes/rpc/rpc-client.js.map +1 -1
  54. package/dist/modes/rpc/rpc-types.d.ts +2 -2
  55. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  56. package/dist/modes/rpc/rpc-types.js.map +1 -1
  57. package/docs/compaction.md +71 -38
  58. package/docs/extensions.md +9 -5
  59. package/docs/index.md +1 -1
  60. package/docs/json.md +2 -2
  61. package/docs/rpc.md +19 -40
  62. package/docs/sdk.md +2 -2
  63. package/docs/session-format.md +3 -3
  64. package/docs/sessions.md +2 -3
  65. package/docs/settings.md +2 -2
  66. package/docs/usage.md +2 -4
  67. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.8.26-alpha.8] - 2026-06-07
6
+
7
+ ### Changed
8
+
9
+ - Changed manual `/compact` and auto-compaction to use deletion-only context compaction by default, preserving retained transcript content verbatim.
10
+ - Restyled completed context compaction results with the same expandable summary-card treatment as summary compaction.
11
+
12
+ ### Removed
13
+
14
+ - Removed the `/context-compact` interactive and workflow-stage slash command; use `/compact` instead.
15
+
5
16
  ## [0.8.26-alpha.7] - 2026-06-07
6
17
 
7
18
  ### Added
package/README.md CHANGED
@@ -179,8 +179,7 @@ Type `/` in the editor to trigger commands. [Extensions](#extensions) can regist
179
179
  | `/tree` | Jump to any point in the session and continue from there |
180
180
  | `/fork` | Create a new session from a previous user message |
181
181
  | `/clone` | Duplicate the current active branch into a new session |
182
- | `/compact [prompt]` | Manually compact context, optional custom instructions |
183
- | `/context-compact` | Delete safe older transcript objects verbatim; no arguments |
182
+ | `/compact` | Delete safe older transcript objects verbatim |
184
183
  | `/copy` | Copy last assistant message to clipboard |
185
184
  | `/export [file]` | Export session to HTML file |
186
185
  | `/share` | Upload as private GitHub gist with shareable HTML link |
@@ -259,15 +258,13 @@ Use `/session` in interactive mode to see the current session ID before reusing
259
258
 
260
259
  ### Compaction
261
260
 
262
- Long sessions can exhaust context windows. Summary compaction summarizes older messages while keeping recent ones.
261
+ Long sessions can exhaust context windows. Compaction now uses deletion-only context compaction by default: the selected model proposes safe deletion targets, Atomic validates them locally, and retained transcript content stays verbatim.
263
262
 
264
- **Manual summary:** `/compact` or `/compact <custom instructions>`
263
+ **Manual:** `/compact` has no prompt arguments.
265
264
 
266
- **Manual verbatim deletion:** `/context-compact` asks the selected model for deletion targets using a fixed internal prompt, validates the plan locally, and applies logical deletions only. It has no prompt arguments; `/context-compact anything` is invalid/ignored rather than treated as instructions.
265
+ **Automatic:** Enabled by default. Triggers on context overflow (recovers and retries) or when approaching the limit (proactive). Configure via `/settings` or `settings.json`. Automatic compaction uses the same verbatim deletion path.
267
266
 
268
- **Automatic:** Enabled by default. Triggers on context overflow (recovers and retries) or when approaching the limit (proactive). Configure via `/settings` or `settings.json`. Automatic compaction remains summary-based.
269
-
270
- Summary compaction is lossy. `/context-compact` preserves retained transcript content verbatim, but the full history still remains in the JSONL file; use `/tree` to revisit. Customize summary compaction behavior via [extensions](#extensions). See [docs/compaction.md](docs/compaction.md) for internals.
267
+ The full history still remains in the JSONL file; use `/tree` to revisit. See [docs/compaction.md](docs/compaction.md) for internals.
271
268
 
272
269
  ---
273
270
 
@@ -4,6 +4,12 @@ All notable changes to the `pi-intercom` extension will be documented in this fi
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.26-alpha.8] - 2026-06-07
8
+
9
+ ### Changed
10
+
11
+ - Bumped package version for the Atomic 0.8.26-alpha.8 prerelease.
12
+
7
13
  ## [0.8.26-alpha.7] - 2026-06-07
8
14
 
9
15
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.8.26-alpha.7",
3
+ "version": "0.8.26-alpha.8",
4
4
  "private": true,
5
5
  "description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
6
6
  "contributors": [
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.8.26-alpha.8] - 2026-06-07
11
+
12
+ ### Changed
13
+
14
+ - Bumped package version for the Atomic 0.8.26-alpha.8 prerelease.
15
+
10
16
  ## [0.8.26-alpha.7] - 2026-06-07
11
17
 
12
18
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.8.26-alpha.7",
3
+ "version": "0.8.26-alpha.8",
4
4
  "private": true,
5
5
  "description": "Atomic extension that adapts MCP (Model Context Protocol) servers into the coding agent. Fork of: https://github.com/nicobailon/pi-mcp-adapter",
6
6
  "contributors": [
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.8.26-alpha.8] - 2026-06-07
6
+
7
+ ### Changed
8
+
9
+ - Bumped package version for the Atomic 0.8.26-alpha.8 prerelease.
10
+
5
11
  ## [0.8.26-alpha.7] - 2026-06-07
6
12
 
7
13
  ### Added
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.8.26-alpha.7",
3
+ "version": "0.8.26-alpha.8",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with chains, parallel execution, and TUI clarification. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.8.26-alpha.8] - 2026-06-07
8
+
9
+ ### Changed
10
+
11
+ - Bumped package version for the Atomic 0.8.26-alpha.8 prerelease.
12
+
7
13
  ## [0.8.26-alpha.7] - 2026-06-07
8
14
 
9
15
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.8.26-alpha.7",
3
+ "version": "0.8.26-alpha.8",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.8.26-alpha.8] - 2026-06-07
10
+
11
+ ### Changed
12
+
13
+ - Updated workflow-stage chat so `/compact` is the no-argument compaction command and `/context-compact` is no longer handled locally.
14
+
9
15
  ## [0.8.26-alpha.7] - 2026-06-07
10
16
 
11
17
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/workflows",
3
- "version": "0.8.26-alpha.7",
3
+ "version": "0.8.26-alpha.8",
4
4
  "private": true,
5
5
  "description": "Atomic extension for multi-stage workflow authoring and execution.",
6
6
  "contributors": [
@@ -226,7 +226,19 @@ async function createTestAgentSession(_options?: CreateAgentSessionOptions): Pro
226
226
  return { cancelled: true };
227
227
  },
228
228
  async compact(): ReturnType<StageSessionRuntime["compact"]> {
229
- return { summary: "", firstKeptEntryId: "", tokensBefore: 0 };
229
+ return {
230
+ promptVersion: 1,
231
+ deletedTargets: [],
232
+ protectedEntryIds: [],
233
+ stats: {
234
+ objectsBefore: 0,
235
+ objectsAfter: 0,
236
+ objectsDeleted: 0,
237
+ tokensBefore: 0,
238
+ tokensAfter: 0,
239
+ percentReduction: 0,
240
+ },
241
+ };
230
242
  },
231
243
  abortCompaction(): void {},
232
244
  async abort(): Promise<void> {},
@@ -3462,9 +3462,15 @@ export async function run<TInputs extends WorkflowInputValues>(
3462
3462
 
3463
3463
  const compactionMeta = (result: unknown): string | undefined => {
3464
3464
  if (result === undefined || result === null || typeof result !== "object") return undefined;
3465
- const compaction = result as { tokensBefore?: unknown; tokensAfter?: unknown; tokensKept?: unknown };
3466
- const before = typeof compaction.tokensBefore === "number" ? compaction.tokensBefore : undefined;
3467
- const keptRaw = compaction.tokensKept ?? compaction.tokensAfter;
3465
+ const compaction = result as {
3466
+ stats?: { tokensBefore?: unknown; tokensAfter?: unknown };
3467
+ tokensBefore?: unknown;
3468
+ tokensAfter?: unknown;
3469
+ tokensKept?: unknown;
3470
+ };
3471
+ const beforeRaw = compaction.stats?.tokensBefore ?? compaction.tokensBefore;
3472
+ const keptRaw = compaction.stats?.tokensAfter ?? compaction.tokensKept ?? compaction.tokensAfter;
3473
+ const before = typeof beforeRaw === "number" ? beforeRaw : undefined;
3468
3474
  const kept = typeof keptRaw === "number" ? keptRaw : undefined;
3469
3475
  if (before === undefined || kept === undefined) return undefined;
3470
3476
  return `${(before / 1000).toFixed(1)}k → ${(kept / 1000).toFixed(1)}k`;
@@ -3509,9 +3515,9 @@ export async function run<TInputs extends WorkflowInputValues>(
3509
3515
  recordStageNotice({ kind: "tree", to: targetId });
3510
3516
  return innerCtx.navigateTree(targetId, treeOptions);
3511
3517
  },
3512
- compact: async (customInstructions) => {
3513
- const result = await innerCtx.compact(customInstructions);
3514
- recordStageNotice({ kind: "compaction", to: "summarized", meta: compactionMeta(result) });
3518
+ compact: async () => {
3519
+ const result = await innerCtx.compact();
3520
+ recordStageNotice({ kind: "compaction", to: "compacted", meta: compactionMeta(result) });
3515
3521
  return result;
3516
3522
  },
3517
3523
  abortCompaction: () => innerCtx.abortCompaction(),
@@ -992,8 +992,8 @@ export function createStageContext(opts: StageRunnerOpts): InternalStageContext
992
992
  return (await ensureSession()).navigateTree(targetId, options);
993
993
  },
994
994
 
995
- async compact(customInstructions) {
996
- return (await ensureSession()).compact(customInstructions);
995
+ async compact() {
996
+ return (await ensureSession()).compact();
997
997
  },
998
998
 
999
999
  abortCompaction() {
@@ -188,7 +188,7 @@ export interface StageSessionRuntime {
188
188
  readonly editorText?: string;
189
189
  readonly cancelled: boolean;
190
190
  }>;
191
- compact(customInstructions?: string): Promise<object>;
191
+ compact(): Promise<object>;
192
192
  abortCompaction(): void;
193
193
  abort(): Promise<void>;
194
194
  dispose(): void | Promise<void>;
@@ -248,7 +248,7 @@ export interface StageContext {
248
248
  readonly editorText?: string;
249
249
  readonly cancelled: boolean;
250
250
  }>;
251
- compact(customInstructions?: string): Promise<object>;
251
+ compact(): Promise<object>;
252
252
  abortCompaction(): void;
253
253
  abort(): Promise<void>;
254
254
  }
@@ -6,7 +6,7 @@
6
6
  import type {
7
7
  AgentSession,
8
8
  AgentSessionEvent,
9
- CompactionResult,
9
+ ContextCompactionResult,
10
10
  CreateAgentSessionOptions,
11
11
  ModelCycleResult,
12
12
  PromptOptions,
@@ -19,7 +19,7 @@ import type * as AuthoringContract from "./authoring-contract.js";
19
19
 
20
20
  export type { TSchema };
21
21
 
22
- export type { AgentSessionEvent, CompactionResult, ModelCycleResult, PromptOptions };
22
+ export type { AgentSessionEvent, ContextCompactionResult, ModelCycleResult, PromptOptions };
23
23
 
24
24
  export type WorkflowModelValue = NonNullable<CreateAgentSessionOptions["model"]> | string;
25
25
  export type WorkflowModelUsage = AuthoringContract.WorkflowModelUsage;
@@ -308,7 +308,7 @@ export interface StageContext {
308
308
  ): Promise<{ editorText?: string; cancelled: boolean }>;
309
309
 
310
310
  /** Compaction. */
311
- compact(customInstructions?: string): Promise<CompactionResult>;
311
+ compact(): Promise<ContextCompactionResult>;
312
312
  abortCompaction(): void;
313
313
 
314
314
  /** Abort current operation. */
@@ -665,20 +665,12 @@ export class StageChatView implements Component, Focusable {
665
665
  const [command, ...rest] = text.trim().split(/\s+/);
666
666
  switch (command) {
667
667
  case "/compact": {
668
- const handle = this._liveHandle();
669
- if (!handle) return false;
670
- await handle.ensureAttached();
671
- if (!handle.agentSession) return false;
672
- await handle.agentSession.compact(rest.join(" ") || undefined);
673
- return true;
674
- }
675
- case "/context-compact": {
676
668
  if (rest.length > 0) return true;
677
669
  const handle = this._liveHandle();
678
670
  if (!handle) return false;
679
671
  await handle.ensureAttached();
680
672
  if (!handle.agentSession) return false;
681
- await handle.agentSession.contextCompact();
673
+ await handle.agentSession.compact();
682
674
  return true;
683
675
  }
684
676
  case "/quit":
@@ -61,7 +61,7 @@ export type AgentSessionEvent = AgentEvent | {
61
61
  } | {
62
62
  type: "compaction_end";
63
63
  reason: "manual" | "threshold" | "overflow";
64
- result: CompactionResult | undefined;
64
+ result: CompactionResult | ContextCompactionResult | undefined;
65
65
  aborted: boolean;
66
66
  willRetry: boolean;
67
67
  errorMessage?: string;
@@ -483,12 +483,12 @@ export declare class AgentSession {
483
483
  * Saves to settings.
484
484
  */
485
485
  setFollowUpMode(mode: "all" | "one-at-a-time"): void;
486
+ private _applyContextVerbatimCompaction;
486
487
  /**
487
- * Manually compact the session context.
488
- * Aborts current agent operation first.
489
- * @param customInstructions Optional instructions for the compaction summary
488
+ * Manually compact the session context using deletion-only verbatim context compaction.
489
+ * Aborts current agent operation first. Custom summary instructions are not accepted.
490
490
  */
491
- compact(customInstructions?: string): Promise<CompactionResult>;
491
+ compact(customInstructions?: string): Promise<ContextCompactionResult>;
492
492
  /**
493
493
  * Manually compact the session context by applying validated logical deletions.
494
494
  * Retained transcript entries/content blocks stay verbatim; no user prompt text is accepted.