@bastani/atomic 0.10.19 → 0.10.20-alpha.2
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 +72 -0
- package/dist/_shared/adapter-open-DXXV6ATH.js +22 -0
- package/dist/_shared/adapter-open-DXXV6ATH.js.map +1 -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-JXBZ3H27.js +484 -229
- package/dist/_shared/mode-interactive-sdk-JXBZ3H27.js.map +1 -1
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +63 -16
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js.map +1 -1
- package/dist/_shared/mode-shared-2QJSCUM6.js +61 -16
- package/dist/_shared/mode-shared-2QJSCUM6.js.map +1 -1
- package/dist/_shared/p0-cli-BB45ZQY6.js +2 -2
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/p1b-elig-BY2G5BUE.js +6 -3
- package/dist/_shared/p1b-elig-BY2G5BUE.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +5 -5
- package/dist/_shared/{sdk-BHX35EPK.js → sdk-5ZFNDXUJ.js} +319 -86
- package/dist/_shared/sdk-5ZFNDXUJ.js.map +1 -0
- package/dist/_shared/session-data-AHTU7IS6.js +15 -7
- package/dist/_shared/session-data-AHTU7IS6.js.map +1 -1
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/settings-startup-HXQLSUWM.js +2 -2
- package/dist/_shared/settings-startup-HXQLSUWM.js.map +1 -1
- package/dist/_shared/{startup-0-0-4EDVBK5P.js → startup-0-0-OWBJIX35.js} +162 -44
- package/dist/_shared/startup-0-0-OWBJIX35.js.map +1 -0
- package/dist/_shared/{startup-0-1-H5IXVRXQ.js → startup-0-1-DZYE4E5Z.js} +462 -37
- package/dist/_shared/startup-0-1-DZYE4E5Z.js.map +1 -0
- package/dist/_shared/{startup-0-2-YZZOC22D.js → startup-0-2-WFLTE4SC.js} +147 -6
- package/dist/_shared/startup-0-2-WFLTE4SC.js.map +1 -0
- package/dist/_shared/startup-0-3-DE2NCS6A.js +59 -50
- package/dist/_shared/startup-0-3-DE2NCS6A.js.map +1 -1
- package/dist/_shared/{startup-0-4-ZMJV547D.js → startup-0-4-6XXL4JMZ.js} +115 -25
- package/dist/_shared/startup-0-4-6XXL4JMZ.js.map +1 -0
- package/dist/_shared/{startup-0-5-HZX3ZPTP.js → startup-0-5-DNS6FYS7.js} +229 -156
- package/dist/_shared/startup-0-5-DNS6FYS7.js.map +1 -0
- package/dist/_shared/{startup-10-0-TDQNBDDL.js → startup-10-0-O6DAT7U4.js} +131 -162
- package/dist/_shared/startup-10-0-O6DAT7U4.js.map +1 -0
- package/dist/_shared/startup-12-0-55AAXBJZ.js +3 -3
- package/dist/_shared/startup-14-0-MLX36RBG.js +9 -6
- package/dist/_shared/startup-14-0-MLX36RBG.js.map +1 -1
- package/dist/_shared/{startup-15-0-YUKGAC63.js → startup-15-0-E7RYG5YF.js} +9 -9
- package/dist/_shared/{startup-15-0-YUKGAC63.js.map → startup-15-0-E7RYG5YF.js.map} +1 -1
- package/dist/_shared/startup-15-1-WQZBOTMZ.js +340 -128
- package/dist/_shared/startup-15-1-WQZBOTMZ.js.map +1 -1
- package/dist/_shared/startup-8-0-34CBHPZH.js +279 -151
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/{startup-8-1-QZMXUGHI.js → startup-8-1-VXBL37AI.js} +352 -27
- package/dist/_shared/startup-8-1-VXBL37AI.js.map +1 -0
- package/dist/_shared/storage-command-7MGXLJGZ.js +15 -273
- package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
- package/dist/_shared/{storage-status-K7PX2RXA.js → storage-status-T6FUXRIM.js} +8 -24
- package/dist/_shared/{storage-status-K7PX2RXA.js.map → storage-status-T6FUXRIM.js.map} +1 -1
- package/dist/_shared/task-reference-stream-JWMUZSJX.js +1 -1
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/team-DOQKICG2.js +4 -3
- package/dist/_shared/team-DOQKICG2.js.map +1 -1
- package/dist/_shared/tree-outline-MUEPK5B7.js +9 -2
- package/dist/_shared/tree-outline-MUEPK5B7.js.map +1 -1
- package/dist/binary-self-update.js +3 -3
- package/dist/builtin/intercom/broker/broker.bundle.mjs +46 -8
- package/dist/builtin/intercom/broker/broker.ts +1 -0
- package/dist/builtin/intercom/broker/client.ts +5 -1
- package/dist/builtin/intercom/broker/departed-children.ts +12 -6
- package/dist/builtin/intercom/broker/ended-child-wakes.ts +2 -0
- package/dist/builtin/intercom/index.bundle.mjs +130 -264
- package/dist/builtin/intercom/message-display.ts +42 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/intercom/types.ts +1 -0
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +99 -20
- package/dist/builtin/web-access/index.bundle.mjs +15 -9
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +6 -6
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +4 -4
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +3 -3
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.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.code.js +2 -2
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +2 -2
- 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.code.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.code.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/agent-session-runtime.d.ts +16 -4
- package/dist/core/agent-session-types.d.ts +5 -1
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.code.js +74 -72
- package/dist/core/export-html/card-projection.code.js.map +1 -1
- 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 +52 -41
- package/dist/core/export-html/index.code.js.map +1 -1
- 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.code.js +1 -1
- 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/template.js +27 -39
- package/dist/core/export-html/tool-renderer.code.js +1 -1
- 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/context-types.d.ts +3 -0
- package/dist/core/extensions/context-types.js.map +1 -1
- 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.code.js +1 -1
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/extensions/loader-virtual-modules.js +2 -2
- package/dist/core/extensions/runner-context.d.ts +1 -0
- package/dist/core/extensions/runner-context.js +18 -2
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runtime-types.d.ts +1 -0
- package/dist/core/extensions/runtime-types.js.map +1 -1
- package/dist/core/intercom-broker-control-host.code.js +1 -1
- 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 +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/model-registry.js +2 -2
- package/dist/core/model-runtime-streaming.d.ts +3 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/package-manager-storage-adapters.code.js +1 -1
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/resume/failure.d.ts +1 -1
- package/dist/core/sdk.code.js +4 -4
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-claims.d.ts +13 -2
- package/dist/core/session-load-events.d.ts +42 -0
- package/dist/core/session-manager-core.d.ts +17 -2
- package/dist/core/session-manager-core.js +234 -93
- package/dist/core/session-manager-core.js.map +1 -1
- package/dist/core/session-manager-errors.d.ts +2 -2
- package/dist/core/session-manager-history.d.ts +1 -1
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.code.js +2 -2
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.code.js +1 -1
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/settings-manager.js +2 -2
- package/dist/core/storage/adapter-open.js +3 -0
- package/dist/core/storage/adapter-open.js.map +1 -0
- 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/prefix.js +1 -0
- package/dist/core/storage/prefix.js.map +1 -1
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/schema-catalog.d.ts +2 -1
- package/dist/core/storage/schema-catalog.js +25 -6
- package/dist/core/storage/schema-catalog.js.map +1 -1
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +17 -4
- package/dist/core/storage/session/branch-fork-source.code.js.map +1 -1
- 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 +7 -7
- package/dist/core/storage/session/child-reader.code.js.map +1 -1
- package/dist/core/storage/session/child-reader.d.ts +1 -0
- 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.code.js +1 -1
- 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 +3 -3
- 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.code.js +9 -5
- package/dist/core/storage/session/fork-staging.code.js.map +1 -1
- 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 +29 -13
- package/dist/core/storage/session/fork-window.code.js.map +1 -1
- 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.d.ts +8 -4
- 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.d.ts +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/parent-links.d.ts +122 -0
- package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
- 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.code.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 +5 -6
- package/dist/core/storage/session/snapshot-history.code.js.map +1 -1
- 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.code.js +1 -1
- package/dist/core/storage/session/sql-session-store.d.ts +7 -20
- 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.code.js +1 -1
- 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/session/types.d.ts +11 -3
- package/dist/core/storage/session/usage-observations.d.ts +27 -0
- package/dist/core/storage/session/usage-observations.js +3 -0
- package/dist/core/storage/session/usage-observations.js.map +1 -0
- package/dist/core/storage/storage-status.code.js +1 -1
- 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.code.js +1 -1
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/subscription-usage-identity.d.ts +9 -0
- package/dist/core/subscription-usage-observations.d.ts +15 -0
- package/dist/core/subscription-usage-storage.js +3 -0
- package/dist/core/subscription-usage-storage.js.map +1 -0
- package/dist/core/subscription-usage.d.ts +20 -3
- package/dist/core/tasks/task-completion-entry.code.js +1 -1
- 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 +3 -3
- 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 +5 -5
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.code.js +1 -1
- 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.code.js +1 -1
- 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.code.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.code.js +3 -3
- 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.code.js +2 -2
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.code.js +12 -7
- package/dist/extensions/codemode/renderer.code.js.map +1 -1
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.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.code.js +1 -1
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +10 -10
- package/dist/main-first-time-setup.code.js +2 -2
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/main.js +1 -1
- package/dist/modes/index.d.ts +1 -1
- package/dist/modes/interactive/components/intercom-wake-notice.d.ts +4 -0
- package/dist/modes/interactive/components/notice-line.d.ts +1 -1
- package/dist/modes/interactive/components/stored-tree-view.code.js +6 -5
- package/dist/modes/interactive/components/stored-tree-view.code.js.map +1 -1
- 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 +5 -1
- package/dist/modes/interactive/components/user-message-selector-archive.code.js +1 -1
- 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/modes/interactive-engine/isolated-runtime.d.ts +4 -3
- package/dist/modes/print-mode.js +1 -1
- package/dist/modes/rpc/rpc-client-api.d.ts +5 -0
- package/dist/modes/rpc/rpc-client.d.ts +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +26 -3
- package/dist/package-manager-cli.code.js +7 -7
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/rpc-entry.js +1 -1
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/10.js +1 -1
- package/dist/startup-stages/12.js +1 -1
- package/dist/startup-stages/13.js +2 -1
- package/dist/startup-stages/14.js +1 -0
- package/dist/startup-stages/4.js +1 -1
- package/dist/startup-stages/6.js +1 -1
- package/dist/startup-stages/7.js +1 -1
- package/dist/startup-stages/8.js +1 -1
- package/dist/startup-stages/stages.json +1 -1
- package/dist/utils/startup-database-spare.code.js +3 -3
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/.agents/context/DESIGN.md +30 -0
- package/docs/changelog.mdx +46 -0
- package/docs/docs.json +1 -1
- package/docs/extensions/api-reference.md +6 -0
- package/docs/guides/subscription-usage.md +28 -82
- package/docs/intercom.md +3 -1
- package/docs/json.md +3 -3
- package/docs/providers.md +2 -0
- package/docs/reference/cli.md +3 -1
- package/docs/rpc/protocol.md +31 -3
- package/docs/sdk/reference.md +26 -1
- package/docs/sdk.md +2 -0
- package/docs/sessions.md +38 -1
- package/docs/slash-commands.md +1 -1
- package/docs/subagents.md +2 -0
- package/docs/usage.md +1 -1
- package/package.json +8 -8
- package/dist/_shared/sdk-BHX35EPK.js.map +0 -1
- package/dist/_shared/startup-0-0-4EDVBK5P.js.map +0 -1
- package/dist/_shared/startup-0-1-H5IXVRXQ.js.map +0 -1
- package/dist/_shared/startup-0-2-YZZOC22D.js.map +0 -1
- package/dist/_shared/startup-0-4-ZMJV547D.js.map +0 -1
- package/dist/_shared/startup-0-5-HZX3ZPTP.js.map +0 -1
- package/dist/_shared/startup-10-0-TDQNBDDL.js.map +0 -1
- package/dist/_shared/startup-8-1-QZMXUGHI.js.map +0 -1
|
@@ -7,7 +7,7 @@ import * as __atomicHostImport1 from "@bastani/atomic-ai";
|
|
|
7
7
|
if (!(name in namespace)) missing.push(`The requested module '${specifier}' does not provide an export named '${name}'`);
|
|
8
8
|
if (missing.length > 0) {
|
|
9
9
|
const application = typeof __atomicHostImport0.APP_NAME === "string" ? __atomicHostImport0.APP_NAME : "atomic";
|
|
10
|
-
if (__atomicHostImport0.VERSION !== "0.10.
|
|
10
|
+
if (__atomicHostImport0.VERSION !== "0.10.20-alpha.2") missing.unshift(application + " was updated to 0.10.20-alpha.2 while this session was running; restart it to keep using the intercom extension.");
|
|
11
11
|
throw new Error(missing.join("\n"));
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1689,22 +1689,6 @@ function visibleWidth(str) {
|
|
|
1689
1689
|
widthCache.set(str, width);
|
|
1690
1690
|
return width;
|
|
1691
1691
|
}
|
|
1692
|
-
function stripTerminalSequences(str) {
|
|
1693
|
-
if (!str.includes("\x1B"))
|
|
1694
|
-
return str;
|
|
1695
|
-
let result = "";
|
|
1696
|
-
let i = 0;
|
|
1697
|
-
while (i < str.length) {
|
|
1698
|
-
const ansi = extractAnsiCode(str, i);
|
|
1699
|
-
if (ansi) {
|
|
1700
|
-
i += ansi.length;
|
|
1701
|
-
continue;
|
|
1702
|
-
}
|
|
1703
|
-
result += str[i];
|
|
1704
|
-
i++;
|
|
1705
|
-
}
|
|
1706
|
-
return result;
|
|
1707
|
-
}
|
|
1708
1692
|
function extractAnsiCodes(str) {
|
|
1709
1693
|
let result = "";
|
|
1710
1694
|
let i = str.indexOf("\x1B");
|
|
@@ -3785,6 +3769,7 @@ import {
|
|
|
3785
3769
|
ToolBlockMarkdown,
|
|
3786
3770
|
ToolBlockRecords
|
|
3787
3771
|
} from "@bastani/atomic";
|
|
3772
|
+
import * as atomicHost from "@bastani/atomic";
|
|
3788
3773
|
function isTextContentBlock(block) {
|
|
3789
3774
|
return block.type === "text";
|
|
3790
3775
|
}
|
|
@@ -3854,7 +3839,7 @@ function formatSupervisorArgs(args) {
|
|
|
3854
3839
|
return "interview";
|
|
3855
3840
|
return reason ? terminalSafeLabel(reason.replaceAll("_", " ")) : "contact";
|
|
3856
3841
|
}
|
|
3857
|
-
function createCollapsibleMarkdownComponent(heading, bodyText, expanded) {
|
|
3842
|
+
function createCollapsibleMarkdownComponent(heading, bodyText, expanded, hasMoreDetails = false) {
|
|
3858
3843
|
const markdown = new ToolBlockMarkdown(terminalSafeText(bodyText));
|
|
3859
3844
|
return {
|
|
3860
3845
|
invalidate() {
|
|
@@ -3862,8 +3847,22 @@ function createCollapsibleMarkdownComponent(heading, bodyText, expanded) {
|
|
|
3862
3847
|
},
|
|
3863
3848
|
render(width) {
|
|
3864
3849
|
const rendered = markdown.render(width);
|
|
3865
|
-
const
|
|
3866
|
-
|
|
3850
|
+
const truncated = !expanded && rendered.length > TOOL_BLOCK_LIMITS.inbound + 1;
|
|
3851
|
+
const bodyLines = truncated ? collapseToolBlockLines(rendered, TOOL_BLOCK_LIMITS.inbound, false, false, width) : rendered;
|
|
3852
|
+
const hint = !expanded && !truncated && hasMoreDetails ? atomicHost.toolBlockExpandHint?.() : undefined;
|
|
3853
|
+
const lines = heading ? [heading, ...bodyLines] : bodyLines;
|
|
3854
|
+
return hint ? [...lines, hint] : lines;
|
|
3855
|
+
}
|
|
3856
|
+
};
|
|
3857
|
+
}
|
|
3858
|
+
function previewRecord(text, hasDetails) {
|
|
3859
|
+
return {
|
|
3860
|
+
invalidate() {},
|
|
3861
|
+
render(width) {
|
|
3862
|
+
return [
|
|
3863
|
+
atomicHost.toolBlockPreviewLine?.(text, width, hasDetails) ?? truncateToWidth(text.split(`
|
|
3864
|
+
`, 1)[0] ?? "", width, "…")
|
|
3865
|
+
];
|
|
3867
3866
|
}
|
|
3868
3867
|
};
|
|
3869
3868
|
}
|
|
@@ -3916,12 +3915,11 @@ function formatListRecord(rawText, details, theme, expanded) {
|
|
|
3916
3915
|
const summary = `${theme.bold(String(count))} session${count === 1 ? "" : "s"}${groupName ? ` in ${terminalSafeLabel(groupName)}` : ""}`;
|
|
3917
3916
|
const peers = sessionEntries.filter((entry) => !entry.isSelf);
|
|
3918
3917
|
const rows = (peers.length > 0 ? peers : sessionEntries).map((entry) => `${entry.name} ${theme.fg("dim", `· ${entry.status}`)}`);
|
|
3918
|
+
if (!expanded)
|
|
3919
|
+
return previewRecord(summary, rows.length > 0);
|
|
3919
3920
|
return {
|
|
3920
3921
|
invalidate() {},
|
|
3921
|
-
render()
|
|
3922
|
-
const visibleRows = expanded || rows.length <= 1 ? rows : collapseToolBlockLines(rows, 1, false);
|
|
3923
|
-
return [summary, ...visibleRows];
|
|
3924
|
-
}
|
|
3922
|
+
render: () => [summary, ...rows]
|
|
3925
3923
|
};
|
|
3926
3924
|
}
|
|
3927
3925
|
|
|
@@ -4024,9 +4022,22 @@ var STARTED_AT_STATE_KEY = "intercomStartedAtMs", renderIntercomCall = (args, _t
|
|
|
4024
4022
|
if (attachmentMeta)
|
|
4025
4023
|
meta.push(attachmentMeta);
|
|
4026
4024
|
const records = [];
|
|
4025
|
+
const message = typeof input.message === "string" ? terminalSafeText(input.message) : "";
|
|
4026
|
+
const messagePreview = message.trim().replaceAll("\t", " ");
|
|
4027
|
+
const delivery = typeof input.delivery === "string" ? terminalSafeLabel(input.delivery).trim() : "";
|
|
4028
|
+
const messageId = typeof details?.messageId === "string" ? terminalSafeLabel(details.messageId).trim() : "";
|
|
4029
|
+
const askId = action === "ask" && typeof details?.askId === "string" ? terminalSafeLabel(details.askId).trim() : "";
|
|
4030
|
+
const visibleSessionCount = action === "status" ? /^Active visible sessions: (\d+)$/m.exec(rawText)?.[1] : undefined;
|
|
4031
|
+
const previewOutcome = (outcome, hasMore = false) => {
|
|
4032
|
+
const text = messagePreview ? `${outcome} · ${messagePreview}` : outcome;
|
|
4033
|
+
const styled = text.split(`
|
|
4034
|
+
`).map((line) => theme.fg(failed ? "error" : "toolOutput", line)).join(`
|
|
4035
|
+
`);
|
|
4036
|
+
return previewRecord(styled, hasMore || Boolean(delivery || messageId || askId));
|
|
4037
|
+
};
|
|
4027
4038
|
if (failed) {
|
|
4028
4039
|
const errorDetail = isRefusal ? `Refused · ${extractRefusalReason(rawText, details)}` : terminalSafeText(rawText.trim() || "Failed").replace(/^Failed:\s*/i, "");
|
|
4029
|
-
records.push(new Text(theme.fg("error", errorDetail), 0, 0));
|
|
4040
|
+
records.push(expanded ? new Text(theme.fg("error", errorDetail), 0, 0) : previewOutcome(errorDetail));
|
|
4030
4041
|
} else if (Array.isArray(details?.recipients) && details.recipients.length > 0) {
|
|
4031
4042
|
const summary = formatPatternRecipientsSummary(details.recipients);
|
|
4032
4043
|
if (expanded) {
|
|
@@ -4034,20 +4045,27 @@ var STARTED_AT_STATE_KEY = "intercomStartedAtMs", renderIntercomCall = (args, _t
|
|
|
4034
4045
|
records.push(new Text([summary, ...recipientRows].map((line) => theme.fg("toolOutput", line)).join(`
|
|
4035
4046
|
`), 0, 0));
|
|
4036
4047
|
} else {
|
|
4037
|
-
records.push(summary);
|
|
4048
|
+
records.push(previewOutcome(summary, true));
|
|
4038
4049
|
}
|
|
4039
4050
|
} else if (details?.pending === true) {
|
|
4040
|
-
|
|
4051
|
+
const summary = "Asked · reply will arrive as a message";
|
|
4052
|
+
records.push(expanded ? summary : previewOutcome(summary));
|
|
4041
4053
|
} else if (details?.queued === true) {
|
|
4042
|
-
const
|
|
4043
|
-
`
|
|
4044
|
-
|
|
4045
|
-
|
|
4054
|
+
const queuedText = terminalSafeText(rawText.trim()).replace(/^(?:Message|Reply) queued for /i, "Queued for ");
|
|
4055
|
+
const firstLine = queuedText.split(`
|
|
4056
|
+
`, 1)[0] || `Queued for ${inferredTarget ?? "recipient"}`;
|
|
4057
|
+
records.push(expanded ? queuedText || firstLine : previewOutcome(firstLine, queuedText.includes(`
|
|
4058
|
+
`)));
|
|
4046
4059
|
} else if (details?.replied === true || /^\*\*Reply from ([^\n*]+):\*\*\n/i.test(rawText)) {
|
|
4047
4060
|
const replyMatch = rawText.match(/^\*\*Reply from ([^\n*]+):\*\*\n([\s\S]*)$/i);
|
|
4048
4061
|
const peer = terminalSafeLabel(replyMatch?.[1]?.trim() || inferredTarget || "peer");
|
|
4049
4062
|
const replyBody = replyMatch?.[2] ?? rawText;
|
|
4050
|
-
|
|
4063
|
+
const summary = `Reply from ${peer}`;
|
|
4064
|
+
if (expanded || !messagePreview && !delivery && !messageId && !askId) {
|
|
4065
|
+
records.push(createCollapsibleMarkdownComponent(theme.fg("toolOutput", summary), replyBody, expanded));
|
|
4066
|
+
} else {
|
|
4067
|
+
records.push(previewOutcome(summary, Boolean(replyBody.trim())));
|
|
4068
|
+
}
|
|
4051
4069
|
} else if (action === "list" || Array.isArray(details?.groups) && rawText.includes("**Current session**")) {
|
|
4052
4070
|
const listComponent = formatListRecord(rawText, details, theme, expanded);
|
|
4053
4071
|
if (listComponent) {
|
|
@@ -4055,19 +4073,36 @@ var STARTED_AT_STATE_KEY = "intercomStartedAtMs", renderIntercomCall = (args, _t
|
|
|
4055
4073
|
} else if (rawText.trim()) {
|
|
4056
4074
|
records.push(createCollapsibleMarkdownComponent(undefined, rawText, expanded));
|
|
4057
4075
|
}
|
|
4076
|
+
} else if (visibleSessionCount !== undefined) {
|
|
4077
|
+
const sessions = Number(visibleSessionCount);
|
|
4078
|
+
const pending = Number(/^Your asks awaiting a reply: (\d+)$/m.exec(rawText)?.[1] ?? 0);
|
|
4079
|
+
const summary = `Connected · ${sessions} visible session${sessions === 1 ? "" : "s"} · ${pending} pending ask${pending === 1 ? "" : "s"}`;
|
|
4080
|
+
records.push(expanded ? createCollapsibleMarkdownComponent(undefined, rawText, true) : previewRecord(summary, true));
|
|
4081
|
+
} else if (action === "pending" && /^- /m.test(rawText)) {
|
|
4082
|
+
const count = Array.from(rawText.matchAll(/^- /gm)).length;
|
|
4083
|
+
const summary = `${count} pending ask${count === 1 ? "" : "s"}`;
|
|
4084
|
+
records.push(expanded ? createCollapsibleMarkdownComponent(undefined, rawText, true) : previewRecord(summary, true));
|
|
4058
4085
|
} else if (details?.delivered === true && (/^(?:Message|Reply) sent to /i.test(rawText.trim()) || rawText.trim() === "" || rawText.trim() === "sent")) {
|
|
4059
|
-
records.push("Delivered");
|
|
4086
|
+
records.push(expanded ? "Delivered" : previewOutcome("Delivered"));
|
|
4087
|
+
} else if (!expanded && (messagePreview || delivery || messageId || askId)) {
|
|
4088
|
+
const firstLine = terminalSafeText(rawText.trim()).split(`
|
|
4089
|
+
`, 1)[0] || "Message";
|
|
4090
|
+
records.push(previewOutcome(firstLine, rawText.trim().includes(`
|
|
4091
|
+
`)));
|
|
4060
4092
|
} else if (rawText.trim()) {
|
|
4061
4093
|
records.push(createCollapsibleMarkdownComponent(undefined, rawText, expanded));
|
|
4062
4094
|
} else if (details?.delivered === true) {
|
|
4063
|
-
records.push("Delivered");
|
|
4064
|
-
}
|
|
4065
|
-
if (expanded && typeof input.message === "string" && input.message.trim()) {
|
|
4066
|
-
records.push(createCollapsibleMarkdownComponent(theme.bold("Message"), input.message, true));
|
|
4095
|
+
records.push(expanded ? "Delivered" : previewOutcome("Delivered"));
|
|
4067
4096
|
}
|
|
4068
|
-
if (expanded &&
|
|
4069
|
-
records.push(
|
|
4097
|
+
if (expanded && messagePreview) {
|
|
4098
|
+
records.push(createCollapsibleMarkdownComponent(theme.bold("Message"), message, true));
|
|
4070
4099
|
}
|
|
4100
|
+
if (expanded && delivery)
|
|
4101
|
+
records.push(`Delivery mode: ${delivery}`);
|
|
4102
|
+
if (expanded && messageId)
|
|
4103
|
+
records.push(`Message id ${messageId}`);
|
|
4104
|
+
if (expanded && askId)
|
|
4105
|
+
records.push(`Ask id ${askId}`);
|
|
4071
4106
|
return new ToolBlock({
|
|
4072
4107
|
status: failed ? "failure" : "success",
|
|
4073
4108
|
title: "Intercom",
|
|
@@ -4101,27 +4136,31 @@ var STARTED_AT_STATE_KEY = "intercomStartedAtMs", renderIntercomCall = (args, _t
|
|
|
4101
4136
|
if (elapsed)
|
|
4102
4137
|
meta.push(elapsed);
|
|
4103
4138
|
const records = [];
|
|
4139
|
+
const message = typeof input.message === "string" ? terminalSafeText(input.message) : "";
|
|
4140
|
+
const hasMessage = message.trim().length > 0;
|
|
4141
|
+
const outcome = (text) => !expanded && hasMessage ? previewRecord(text, true) : text;
|
|
4104
4142
|
if (failed) {
|
|
4105
4143
|
const errorDetail = isRefusal ? `Refused · ${extractRefusalReason(rawText, details)}` : terminalSafeText(rawText.trim() || "Failed").replace(/^Failed:\s*/i, "");
|
|
4106
|
-
|
|
4144
|
+
const styled = theme.fg("error", errorDetail);
|
|
4145
|
+
records.push(!expanded && hasMessage ? previewRecord(styled, true) : new Text(styled, 0, 0));
|
|
4107
4146
|
} else if (details?.queued === true) {
|
|
4108
|
-
records.push("Queued for supervisor");
|
|
4147
|
+
records.push(outcome("Queued for supervisor"));
|
|
4109
4148
|
} else if (details?.yielded === true || details?.delivered === true && /^Progress update sent to supervisor/i.test(rawText.trim())) {
|
|
4110
|
-
records.push("Delivered");
|
|
4149
|
+
records.push(outcome("Delivered"));
|
|
4111
4150
|
} else if (/^\*\*Reply from supervisor:\*\*\n/i.test(rawText)) {
|
|
4112
4151
|
const replyBody = rawText.replace(/^\*\*Reply from supervisor:\*\*\n/i, "");
|
|
4113
|
-
records.push(createCollapsibleMarkdownComponent(theme.fg("toolOutput", "Reply from supervisor"), replyBody, expanded));
|
|
4152
|
+
records.push(createCollapsibleMarkdownComponent(theme.fg("toolOutput", "Reply from supervisor"), replyBody, expanded, hasMessage));
|
|
4114
4153
|
} else if (rawText.trim()) {
|
|
4115
|
-
records.push(createCollapsibleMarkdownComponent(theme.fg("toolOutput", "Reply from supervisor"), rawText, expanded));
|
|
4154
|
+
records.push(createCollapsibleMarkdownComponent(theme.fg("toolOutput", "Reply from supervisor"), rawText, expanded, hasMessage));
|
|
4116
4155
|
} else {
|
|
4117
|
-
records.push("Delivered");
|
|
4156
|
+
records.push(outcome("Delivered"));
|
|
4118
4157
|
}
|
|
4119
4158
|
const parseError = details?.structuredReplyParseError;
|
|
4120
4159
|
if (typeof parseError === "string" && parseError.trim()) {
|
|
4121
4160
|
records.push(new Text(theme.fg("warning", `! Structured reply could not be parsed · ${terminalSafeLabel(parseError.trim())}`), 0, 0));
|
|
4122
4161
|
}
|
|
4123
|
-
if (expanded &&
|
|
4124
|
-
records.push(createCollapsibleMarkdownComponent(theme.bold("Message"),
|
|
4162
|
+
if (expanded && hasMessage) {
|
|
4163
|
+
records.push(createCollapsibleMarkdownComponent(theme.bold("Message"), message, true));
|
|
4125
4164
|
}
|
|
4126
4165
|
return new ToolBlock({
|
|
4127
4166
|
status: failed ? "failure" : "success",
|
|
@@ -4195,6 +4234,37 @@ var init_group = __esm(() => {
|
|
|
4195
4234
|
RETURN_PATH_TOOL_NOTE = `except an answer to a sender outside your groups whose message reached you (up to ${RETURN_PATH_MESSAGE_LIMIT} messages within ${Math.round(RETURN_PATH_WINDOW_MS / 60000)} minutes of its latest one)`;
|
|
4196
4235
|
});
|
|
4197
4236
|
|
|
4237
|
+
// dist/builtin/intercom/message-display.ts
|
|
4238
|
+
function splitsUtf16SurrogatePair(text, index) {
|
|
4239
|
+
if (index <= 0 || index >= text.length)
|
|
4240
|
+
return false;
|
|
4241
|
+
const prev = text.charCodeAt(index - 1);
|
|
4242
|
+
const curr = text.charCodeAt(index);
|
|
4243
|
+
return prev >= 55296 && prev <= 56319 && curr >= 56320 && curr <= 57343;
|
|
4244
|
+
}
|
|
4245
|
+
function extractProjectedDisplayText(content) {
|
|
4246
|
+
const text = content.text;
|
|
4247
|
+
const ranges = content.displayRanges;
|
|
4248
|
+
if (!Array.isArray(ranges) || ranges.length === 0)
|
|
4249
|
+
return text;
|
|
4250
|
+
const parts = [];
|
|
4251
|
+
let lastEnd = 0;
|
|
4252
|
+
let totalProjectedLength = 0;
|
|
4253
|
+
for (const range of ranges) {
|
|
4254
|
+
if (typeof range !== "object" || range === null || Array.isArray(range) || typeof range.start !== "number" || typeof range.end !== "number" || !Number.isSafeInteger(range.start) || !Number.isSafeInteger(range.end) || range.start < lastEnd || range.end <= range.start || range.end > text.length || splitsUtf16SurrogatePair(text, range.start) || splitsUtf16SurrogatePair(text, range.end)) {
|
|
4255
|
+
return text;
|
|
4256
|
+
}
|
|
4257
|
+
const sliceLength = range.end - range.start;
|
|
4258
|
+
totalProjectedLength += sliceLength;
|
|
4259
|
+
if (totalProjectedLength > text.length)
|
|
4260
|
+
return text;
|
|
4261
|
+
parts.push(text.slice(range.start, range.end));
|
|
4262
|
+
lastEnd = range.end;
|
|
4263
|
+
}
|
|
4264
|
+
const projected = parts.join("");
|
|
4265
|
+
return projected.trim().length > 0 ? projected : text;
|
|
4266
|
+
}
|
|
4267
|
+
|
|
4198
4268
|
// dist/builtin/intercom/intercom-utils.ts
|
|
4199
4269
|
import { sliceHead } from "@bastani/atomic";
|
|
4200
4270
|
function mayStartTurn(entry) {
|
|
@@ -4433,36 +4503,6 @@ ${instructionsLines.join(`
|
|
|
4433
4503
|
displayRanges
|
|
4434
4504
|
};
|
|
4435
4505
|
}
|
|
4436
|
-
function splitsUtf16SurrogatePair(text, index) {
|
|
4437
|
-
if (index <= 0 || index >= text.length)
|
|
4438
|
-
return false;
|
|
4439
|
-
const prev = text.charCodeAt(index - 1);
|
|
4440
|
-
const curr = text.charCodeAt(index);
|
|
4441
|
-
return prev >= 55296 && prev <= 56319 && curr >= 56320 && curr <= 57343;
|
|
4442
|
-
}
|
|
4443
|
-
function extractProjectedDisplayText(content) {
|
|
4444
|
-
const text = content.text;
|
|
4445
|
-
const ranges = content.displayRanges;
|
|
4446
|
-
if (!Array.isArray(ranges) || ranges.length === 0)
|
|
4447
|
-
return text;
|
|
4448
|
-
const parts = [];
|
|
4449
|
-
let lastEnd = 0;
|
|
4450
|
-
let totalProjectedLength = 0;
|
|
4451
|
-
for (const range of ranges) {
|
|
4452
|
-
if (typeof range !== "object" || range === null || Array.isArray(range) || typeof range.start !== "number" || typeof range.end !== "number" || !Number.isSafeInteger(range.start) || !Number.isSafeInteger(range.end) || range.start < lastEnd || range.end <= range.start || range.end > text.length || splitsUtf16SurrogatePair(text, range.start) || splitsUtf16SurrogatePair(text, range.end)) {
|
|
4453
|
-
return text;
|
|
4454
|
-
}
|
|
4455
|
-
const sliceLength = range.end - range.start;
|
|
4456
|
-
totalProjectedLength += sliceLength;
|
|
4457
|
-
if (totalProjectedLength > text.length) {
|
|
4458
|
-
return text;
|
|
4459
|
-
}
|
|
4460
|
-
parts.push(text.slice(range.start, range.end));
|
|
4461
|
-
lastEnd = range.end;
|
|
4462
|
-
}
|
|
4463
|
-
const projected = parts.join("");
|
|
4464
|
-
return projected.trim().length > 0 ? projected : text;
|
|
4465
|
-
}
|
|
4466
4506
|
function validateSupervisorInterviewReply(value, interview) {
|
|
4467
4507
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
4468
4508
|
throw new Error("reply JSON must be an object with a responses array");
|
|
@@ -4749,7 +4789,7 @@ class InlineMessageComponent {
|
|
|
4749
4789
|
const rendered = this.markdown.render(bodyWidth);
|
|
4750
4790
|
if (this.expanded || rendered.length <= 4)
|
|
4751
4791
|
return rendered;
|
|
4752
|
-
return collapseToolBlockLines2(rendered, TOOL_BLOCK_LIMITS2.inbound, false);
|
|
4792
|
+
return collapseToolBlockLines2(rendered, TOOL_BLOCK_LIMITS2.inbound, false, false, bodyWidth);
|
|
4753
4793
|
}
|
|
4754
4794
|
};
|
|
4755
4795
|
const records = [];
|
|
@@ -4793,184 +4833,9 @@ var init_inline_message = __esm(() => {
|
|
|
4793
4833
|
});
|
|
4794
4834
|
|
|
4795
4835
|
// dist/builtin/intercom/ui/wake-notice.ts
|
|
4796
|
-
import
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
}
|
|
4800
|
-
function cleanMultiline(value) {
|
|
4801
|
-
return terminalDisplayText2(value).replace(/\r\n/g, `
|
|
4802
|
-
`).replace(/\r/g, `
|
|
4803
|
-
`).replace(/[\x00-\x08\x0b-\x1f\x7f-\x9f]/g, " ").trim();
|
|
4804
|
-
}
|
|
4805
|
-
function messageText(content) {
|
|
4806
|
-
if (typeof content === "string")
|
|
4807
|
-
return content;
|
|
4808
|
-
if (!Array.isArray(content))
|
|
4809
|
-
return "";
|
|
4810
|
-
return content.filter((part) => {
|
|
4811
|
-
if (!part || typeof part !== "object")
|
|
4812
|
-
return false;
|
|
4813
|
-
const block = part;
|
|
4814
|
-
return block.type === "text" && typeof block.text === "string";
|
|
4815
|
-
}).map((part) => part.text).join(`
|
|
4816
|
-
`);
|
|
4817
|
-
}
|
|
4818
|
-
function formatWakeParticipant(rawName, rawId) {
|
|
4819
|
-
const name = rawName ? cleanOneLine(rawName) : "";
|
|
4820
|
-
const id = rawId ? cleanOneLine(rawId) : "";
|
|
4821
|
-
const candidate = name || id;
|
|
4822
|
-
if (!candidate)
|
|
4823
|
-
return "unknown";
|
|
4824
|
-
const aliasMatch = UNNAMED_CHAT_ALIAS_RE.exec(candidate);
|
|
4825
|
-
if (aliasMatch)
|
|
4826
|
-
return `session ${aliasMatch[1].toLowerCase()}`;
|
|
4827
|
-
const subagentMatch = SUBAGENT_TARGET_RE.exec(candidate);
|
|
4828
|
-
if (subagentMatch)
|
|
4829
|
-
return `subagent-${subagentMatch[1]}-…-${subagentMatch[3]}`;
|
|
4830
|
-
const uuidMatch = UUID_RE.exec(candidate);
|
|
4831
|
-
if (uuidMatch)
|
|
4832
|
-
return uuidMatch[1].toLowerCase();
|
|
4833
|
-
return visibleWidth(candidate) > 36 ? truncateToWidth(candidate, 36, "…") : candidate;
|
|
4834
|
-
}
|
|
4835
|
-
function parseWakeNotice(content, details) {
|
|
4836
|
-
const record = details && typeof details === "object" ? details : undefined;
|
|
4837
|
-
const rawChildName = typeof record?.childName === "string" ? cleanOneLine(record.childName) : "";
|
|
4838
|
-
if (rawChildName) {
|
|
4839
|
-
const rawChildId = typeof record?.childId === "string" ? cleanOneLine(record.childId) : "";
|
|
4840
|
-
const fromRecord = record?.from && typeof record.from === "object" ? record.from : undefined;
|
|
4841
|
-
const rawFromName = typeof fromRecord?.name === "string" ? cleanOneLine(fromRecord.name) : "";
|
|
4842
|
-
const rawFromId = typeof fromRecord?.id === "string" ? cleanOneLine(fromRecord.id) : "";
|
|
4843
|
-
const rawDepth = typeof record?.depth === "number" && Number.isFinite(record.depth) ? Math.floor(record.depth) : undefined;
|
|
4844
|
-
return {
|
|
4845
|
-
childName: rawChildName,
|
|
4846
|
-
...rawChildId ? { childId: rawChildId } : {},
|
|
4847
|
-
...rawFromName ? { fromName: rawFromName } : {},
|
|
4848
|
-
...rawFromId ? { fromId: rawFromId } : {},
|
|
4849
|
-
...rawDepth !== undefined && rawDepth >= 1 ? { depth: rawDepth } : {}
|
|
4850
|
-
};
|
|
4851
|
-
}
|
|
4852
|
-
const text = cleanOneLine(messageText(content));
|
|
4853
|
-
const legacy = LEGACY_CONTENT_RE.exec(text);
|
|
4854
|
-
if (!legacy)
|
|
4855
|
-
return;
|
|
4856
|
-
const childName = cleanOneLine(legacy[1] ?? "");
|
|
4857
|
-
if (!childName)
|
|
4858
|
-
return;
|
|
4859
|
-
const childId = legacy[2] ? cleanOneLine(legacy[2]) : undefined;
|
|
4860
|
-
const sender = legacy[3] ? cleanOneLine(legacy[3]) : undefined;
|
|
4861
|
-
return {
|
|
4862
|
-
childName,
|
|
4863
|
-
...childId ? { childId } : {},
|
|
4864
|
-
...sender ? { fromName: sender } : {}
|
|
4865
|
-
};
|
|
4866
|
-
}
|
|
4867
|
-
|
|
4868
|
-
class WakeNoticeComponent {
|
|
4869
|
-
historyReplayable = true;
|
|
4870
|
-
parsed;
|
|
4871
|
-
fallbackText;
|
|
4872
|
-
fallbackMultiline;
|
|
4873
|
-
expanded;
|
|
4874
|
-
outputPad;
|
|
4875
|
-
theme;
|
|
4876
|
-
constructor(parsed, fallbackText, fallbackMultiline, expanded, outputPad, theme) {
|
|
4877
|
-
this.parsed = parsed;
|
|
4878
|
-
this.fallbackText = fallbackText;
|
|
4879
|
-
this.fallbackMultiline = fallbackMultiline;
|
|
4880
|
-
this.expanded = expanded;
|
|
4881
|
-
this.outputPad = outputPad;
|
|
4882
|
-
this.theme = theme;
|
|
4883
|
-
}
|
|
4884
|
-
invalidate() {}
|
|
4885
|
-
render(width) {
|
|
4886
|
-
if (width < 1)
|
|
4887
|
-
return [];
|
|
4888
|
-
const safeWidth = Math.floor(width);
|
|
4889
|
-
const pad = Math.max(0, Math.min(Math.floor(this.outputPad), safeWidth - 1));
|
|
4890
|
-
const contentWidth = Math.max(1, safeWidth - pad);
|
|
4891
|
-
const noColor = process.env.NO_COLOR !== undefined;
|
|
4892
|
-
const finish = (row) => {
|
|
4893
|
-
const padded = `${" ".repeat(pad)}${row}`;
|
|
4894
|
-
return noColor ? stripTerminalSequences(padded) : padded;
|
|
4895
|
-
};
|
|
4896
|
-
const glyph = this.theme.fg("accent", WAKE_GLYPH);
|
|
4897
|
-
if (contentWidth < 2) {
|
|
4898
|
-
return [finish(truncateToWidth(glyph, contentWidth, ""))];
|
|
4899
|
-
}
|
|
4900
|
-
const parsed = this.parsed;
|
|
4901
|
-
let header;
|
|
4902
|
-
if (parsed) {
|
|
4903
|
-
const shortChild = formatWakeParticipant(parsed.childName, undefined);
|
|
4904
|
-
const shortSender = formatWakeParticipant(parsed.fromName, parsed.fromId);
|
|
4905
|
-
const title = `${this.theme.fg("muted", "Woke")} ${this.theme.fg("toolTitle", this.theme.bold(shortChild))} ${this.theme.fg("muted", "for a message from")} ${this.theme.fg("text", shortSender)}`;
|
|
4906
|
-
const metaPlain = " · result arrives here";
|
|
4907
|
-
const titleWidth = visibleWidth(title);
|
|
4908
|
-
const metaWidth = visibleWidth(metaPlain);
|
|
4909
|
-
if (2 + titleWidth + metaWidth <= contentWidth) {
|
|
4910
|
-
header = `${glyph} ${title}${this.theme.fg("dim", metaPlain)}`;
|
|
4911
|
-
} else if (2 + titleWidth <= contentWidth) {
|
|
4912
|
-
header = `${glyph} ${title}`;
|
|
4913
|
-
} else {
|
|
4914
|
-
header = `${glyph} ${truncateToWidth(title, contentWidth - 2, "…")}`;
|
|
4915
|
-
}
|
|
4916
|
-
} else {
|
|
4917
|
-
const label = this.fallbackText || "Woke subagent for an Intercom message";
|
|
4918
|
-
header = `${glyph} ${truncateToWidth(this.theme.fg("text", label), contentWidth - 2, "…")}`;
|
|
4919
|
-
}
|
|
4920
|
-
if (!this.expanded) {
|
|
4921
|
-
return [finish(header)];
|
|
4922
|
-
}
|
|
4923
|
-
const details = [];
|
|
4924
|
-
if (parsed) {
|
|
4925
|
-
const childLine = parsed.childId ? `${parsed.childName} · ${parsed.childId}` : parsed.childName;
|
|
4926
|
-
details.push(`${this.theme.fg("dim", "Subagent ")}${this.theme.fg("muted", childLine)}`);
|
|
4927
|
-
const fromDisplay = parsed.fromName ?? parsed.fromId ?? "unknown";
|
|
4928
|
-
details.push(`${this.theme.fg("dim", "From ")}${this.theme.fg("muted", fromDisplay)}`);
|
|
4929
|
-
if (parsed.fromName && parsed.fromId && parsed.fromId !== parsed.fromName) {
|
|
4930
|
-
details.push(`${this.theme.fg("dim", "Sender ID ")}${this.theme.fg("dim", parsed.fromId)}`);
|
|
4931
|
-
}
|
|
4932
|
-
if (parsed.depth !== undefined && parsed.depth > 1) {
|
|
4933
|
-
details.push(`${this.theme.fg("dim", "Depth ")}${this.theme.fg("muted", String(parsed.depth))}`);
|
|
4934
|
-
}
|
|
4935
|
-
details.push(this.theme.fg("dim", "Result stays with this session and arrives here."));
|
|
4936
|
-
} else if (this.fallbackMultiline) {
|
|
4937
|
-
for (const line of this.fallbackMultiline.split(`
|
|
4938
|
-
`)) {
|
|
4939
|
-
details.push(this.theme.fg("muted", line));
|
|
4940
|
-
}
|
|
4941
|
-
}
|
|
4942
|
-
const detailWidth = contentWidth > DETAIL_PREFIX.length ? contentWidth - DETAIL_PREFIX.length : contentWidth;
|
|
4943
|
-
const rows = [header];
|
|
4944
|
-
let firstRow = true;
|
|
4945
|
-
for (const line of details) {
|
|
4946
|
-
const wrappedLines = wrapTextWithAnsi(line, Math.max(1, detailWidth));
|
|
4947
|
-
for (const wrapped of wrappedLines) {
|
|
4948
|
-
if (contentWidth > DETAIL_PREFIX.length) {
|
|
4949
|
-
const prefix = firstRow ? this.theme.fg("dim", DETAIL_FIRST_PREFIX) : DETAIL_PREFIX;
|
|
4950
|
-
rows.push(`${prefix}${wrapped}`);
|
|
4951
|
-
} else {
|
|
4952
|
-
rows.push(truncateToWidth(wrapped, contentWidth, "…"));
|
|
4953
|
-
}
|
|
4954
|
-
firstRow = false;
|
|
4955
|
-
}
|
|
4956
|
-
}
|
|
4957
|
-
return rows.map(finish);
|
|
4958
|
-
}
|
|
4959
|
-
}
|
|
4960
|
-
var ENDED_CHILD_WAKE_MESSAGE_TYPE = "intercom_subagent_wake", WAKE_GLYPH = "↻", DETAIL_FIRST_PREFIX = " ⎿ ", DETAIL_PREFIX = " ", SUBAGENT_TARGET_RE, UNNAMED_CHAT_ALIAS_RE, UUID_RE, LEGACY_CONTENT_RE, renderIntercomWakeMessage = (message, options, theme) => {
|
|
4961
|
-
const raw = messageText(message.content);
|
|
4962
|
-
const parsed = parseWakeNotice(message.content, message.details);
|
|
4963
|
-
const fallbackText = cleanOneLine(raw);
|
|
4964
|
-
const fallbackMultiline = cleanMultiline(raw);
|
|
4965
|
-
return new WakeNoticeComponent(parsed, fallbackText, fallbackMultiline, options.expanded, options.outputPad ?? 1, theme);
|
|
4966
|
-
};
|
|
4967
|
-
var init_wake_notice = __esm(() => {
|
|
4968
|
-
init_dist2();
|
|
4969
|
-
SUBAGENT_TARGET_RE = /^subagent-(.+)-([0-9a-f]{6,})-(\d+)$/i;
|
|
4970
|
-
UNNAMED_CHAT_ALIAS_RE = /^subagent-chat-([0-9a-f]{8})(?:-[0-9a-f-]+)?$/i;
|
|
4971
|
-
UUID_RE = /^([0-9a-f]{8})-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
4972
|
-
LEGACY_CONTENT_RE = /^Resuming subagent `([^`]+)`(?:\s+\(([^)]+)\))?\s+for an Intercom message from ([^.]+)\./;
|
|
4973
|
-
});
|
|
4836
|
+
import * as atomicHost2 from "@bastani/atomic";
|
|
4837
|
+
var renderIntercomWakeMessage2 = (...args) => atomicHost2.renderIntercomWakeMessage?.(...args), ENDED_CHILD_WAKE_MESSAGE_TYPE = "intercom_subagent_wake";
|
|
4838
|
+
var init_wake_notice = () => {};
|
|
4974
4839
|
|
|
4975
4840
|
// dist/builtin/intercom/detachable-calls.ts
|
|
4976
4841
|
import { isStaleExtensionContextError } from "@bastani/atomic";
|
|
@@ -8155,7 +8020,7 @@ import { spawn } from "node:child_process";
|
|
|
8155
8020
|
import { readFile as readFile2, stat as stat3 } from "node:fs/promises";
|
|
8156
8021
|
import { join as join3 } from "node:path";
|
|
8157
8022
|
import { setTimeout as delay2 } from "node:timers/promises";
|
|
8158
|
-
import * as
|
|
8023
|
+
import * as atomicHost3 from "@bastani/atomic";
|
|
8159
8024
|
async function readProcessStartToken(pid) {
|
|
8160
8025
|
return hostStarts.readProcessStartToken?.(pid);
|
|
8161
8026
|
}
|
|
@@ -8353,7 +8218,7 @@ var init_broker_process = __esm(() => {
|
|
|
8353
8218
|
init_host_command_environment();
|
|
8354
8219
|
init_start_announcement();
|
|
8355
8220
|
init_windows_cwd();
|
|
8356
|
-
hostStarts =
|
|
8221
|
+
hostStarts = atomicHost3;
|
|
8357
8222
|
});
|
|
8358
8223
|
|
|
8359
8224
|
// dist/builtin/intercom/broker/control-request.ts
|
|
@@ -9676,9 +9541,9 @@ var init_client = __esm(() => {
|
|
|
9676
9541
|
break;
|
|
9677
9542
|
}
|
|
9678
9543
|
case "ended_child_wake": {
|
|
9679
|
-
const { childName, childId, wakeId, from, depth } = brokerMessage;
|
|
9544
|
+
const { childName, childId, wakeId, from, depth, messageText } = brokerMessage;
|
|
9680
9545
|
const waker = from;
|
|
9681
|
-
if (typeof childName !== "string" || childId !== undefined && typeof childId !== "string" || typeof wakeId !== "string" || typeof waker !== "object" || waker === null || typeof waker.id !== "string" || waker.name !== undefined && typeof waker.name !== "string" || typeof depth !== "number") {
|
|
9546
|
+
if (typeof childName !== "string" || childId !== undefined && typeof childId !== "string" || typeof wakeId !== "string" || typeof waker !== "object" || waker === null || typeof waker.id !== "string" || waker.name !== undefined && typeof waker.name !== "string" || messageText !== undefined && typeof messageText !== "string" || typeof depth !== "number") {
|
|
9682
9547
|
throw new Error("Invalid ended_child_wake message");
|
|
9683
9548
|
}
|
|
9684
9549
|
const notice = {
|
|
@@ -9686,7 +9551,8 @@ var init_client = __esm(() => {
|
|
|
9686
9551
|
...childId === undefined ? {} : { childId },
|
|
9687
9552
|
wakeId,
|
|
9688
9553
|
from: { id: waker.id, ...typeof waker.name === "string" ? { name: waker.name } : {} },
|
|
9689
|
-
depth
|
|
9554
|
+
depth,
|
|
9555
|
+
...messageText === undefined ? {} : { messageText }
|
|
9690
9556
|
};
|
|
9691
9557
|
this.emit("ended_child_wake", notice);
|
|
9692
9558
|
break;
|
|
@@ -17552,7 +17418,7 @@ function piIntercomExtension(atomic, testOverrides = {}) {
|
|
|
17552
17418
|
customType: ENDED_CHILD_WAKE_MESSAGE_TYPE,
|
|
17553
17419
|
content: `Resuming subagent \`${notice.childName}\`${notice.childId === undefined ? "" : ` (${notice.childId})`} for an Intercom message from ${waker}. It stays this session's subagent: its result arrives here.`,
|
|
17554
17420
|
display: true,
|
|
17555
|
-
details: { childName: notice.childName, childId: notice.childId, from: notice.from, depth: notice.depth }
|
|
17421
|
+
details: { childName: notice.childName, childId: notice.childId, from: notice.from, depth: notice.depth, message: notice.messageText }
|
|
17556
17422
|
}, { triggerTurn: false })).catch(() => {});
|
|
17557
17423
|
};
|
|
17558
17424
|
const request = {
|
|
@@ -18072,7 +17938,7 @@ function piIntercomExtension(atomic, testOverrides = {}) {
|
|
|
18072
17938
|
}
|
|
18073
17939
|
}
|
|
18074
17940
|
});
|
|
18075
|
-
atomic.registerMessageRenderer(ENDED_CHILD_WAKE_MESSAGE_TYPE,
|
|
17941
|
+
atomic.registerMessageRenderer(ENDED_CHILD_WAKE_MESSAGE_TYPE, renderIntercomWakeMessage2);
|
|
18076
17942
|
atomic.registerMessageRenderer("intercom_message", renderIntercomCustomMessage);
|
|
18077
17943
|
const replyWaits = replyWaitGates(() => client);
|
|
18078
17944
|
async function retrySupervisorAuthorization() {
|
|
@@ -19257,7 +19123,7 @@ function intercom(atomic, options = {}) {
|
|
|
19257
19123
|
renderResult: (...args) => renderHeavyToolResult(loadedHeavy?.heavy ?? null, "intercom", args),
|
|
19258
19124
|
renderCall: renderIntercomCall
|
|
19259
19125
|
});
|
|
19260
|
-
atomic.registerMessageRenderer?.(ENDED_CHILD_WAKE_MESSAGE_TYPE,
|
|
19126
|
+
atomic.registerMessageRenderer?.(ENDED_CHILD_WAKE_MESSAGE_TYPE, renderIntercomWakeMessage2);
|
|
19261
19127
|
atomic.registerMessageRenderer?.("intercom_message", renderIntercomCustomMessage);
|
|
19262
19128
|
atomic.registerToolRenderer?.((toolName, next) => {
|
|
19263
19129
|
const registered = next();
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Message } from "./types.js";
|
|
2
|
+
|
|
3
|
+
function splitsUtf16SurrogatePair(text: string, index: number): boolean {
|
|
4
|
+
if (index <= 0 || index >= text.length) return false;
|
|
5
|
+
const prev = text.charCodeAt(index - 1);
|
|
6
|
+
const curr = text.charCodeAt(index);
|
|
7
|
+
return prev >= 0xd800 && prev <= 0xdbff && curr >= 0xdc00 && curr <= 0xdfff;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function extractProjectedDisplayText(content: Message["content"]): string {
|
|
11
|
+
const text = content.text;
|
|
12
|
+
const ranges = content.displayRanges;
|
|
13
|
+
if (!Array.isArray(ranges) || ranges.length === 0) return text;
|
|
14
|
+
const parts: string[] = [];
|
|
15
|
+
let lastEnd = 0;
|
|
16
|
+
let totalProjectedLength = 0;
|
|
17
|
+
for (const range of ranges) {
|
|
18
|
+
if (
|
|
19
|
+
typeof range !== "object" ||
|
|
20
|
+
range === null ||
|
|
21
|
+
Array.isArray(range) ||
|
|
22
|
+
typeof range.start !== "number" ||
|
|
23
|
+
typeof range.end !== "number" ||
|
|
24
|
+
!Number.isSafeInteger(range.start) ||
|
|
25
|
+
!Number.isSafeInteger(range.end) ||
|
|
26
|
+
range.start < lastEnd ||
|
|
27
|
+
range.end <= range.start ||
|
|
28
|
+
range.end > text.length ||
|
|
29
|
+
splitsUtf16SurrogatePair(text, range.start) ||
|
|
30
|
+
splitsUtf16SurrogatePair(text, range.end)
|
|
31
|
+
) {
|
|
32
|
+
return text;
|
|
33
|
+
}
|
|
34
|
+
const sliceLength = range.end - range.start;
|
|
35
|
+
totalProjectedLength += sliceLength;
|
|
36
|
+
if (totalProjectedLength > text.length) return text;
|
|
37
|
+
parts.push(text.slice(range.start, range.end));
|
|
38
|
+
lastEnd = range.end;
|
|
39
|
+
}
|
|
40
|
+
const projected = parts.join("");
|
|
41
|
+
return projected.trim().length > 0 ? projected : text;
|
|
42
|
+
}
|
|
@@ -467,6 +467,7 @@ export type BrokerMessage =
|
|
|
467
467
|
wakeId: string;
|
|
468
468
|
from: { id: string; name?: string };
|
|
469
469
|
depth: number;
|
|
470
|
+
messageText?: string;
|
|
470
471
|
}
|
|
471
472
|
/** #4326: `handoffId` identifies this handoff, so the owner's acknowledgement cannot confirm another reply that reuses the message id. */
|
|
472
473
|
| { type: "released_child_reply"; childName: string; handoffId: string; replyTo: string; from: SessionInfo; message: Message }
|
|
@@ -6,7 +6,7 @@ import * as __atomicHostImport0 from "@bastani/atomic";
|
|
|
6
6
|
if (!(name in namespace)) missing.push(`The requested module '${specifier}' does not provide an export named '${name}'`);
|
|
7
7
|
if (missing.length > 0) {
|
|
8
8
|
const application = typeof __atomicHostImport0.APP_NAME === "string" ? __atomicHostImport0.APP_NAME : "atomic";
|
|
9
|
-
if (__atomicHostImport0.VERSION !== "0.10.
|
|
9
|
+
if (__atomicHostImport0.VERSION !== "0.10.20-alpha.2") missing.unshift(application + " was updated to 0.10.20-alpha.2 while this session was running; restart it to keep using the mcp extension.");
|
|
10
10
|
throw new Error(missing.join("\n"));
|
|
11
11
|
}
|
|
12
12
|
}
|