@selesai/code 0.5.27 → 0.5.29
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/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +9 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/credential-print.d.ts +23 -0
- package/dist/cli/credential-print.d.ts.map +1 -0
- package/dist/cli/credential-print.js +117 -0
- package/dist/cli/credential-print.js.map +1 -0
- package/dist/cli/startup-ui.d.ts.map +1 -1
- package/dist/cli/startup-ui.js +1 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +12 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +20 -14
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +11 -3
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +11 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +14 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +10 -0
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/llama/provider.d.ts.map +1 -1
- package/dist/core/llama/provider.js +8 -3
- package/dist/core/llama/provider.js.map +1 -1
- package/dist/core/model-config.d.ts +30 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +6 -0
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +2 -2
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +20 -3
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +5 -4
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +13 -6
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +24 -11
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +15 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +66 -9
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +1 -1
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +2 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +34 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js +3 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/extensions/pi-intercom/CHANGELOG.md +249 -0
- package/dist/extensions/pi-intercom/README.md +102 -39
- package/dist/extensions/pi-intercom/broker/broker.ts +1233 -36
- package/dist/extensions/pi-intercom/broker/client.test.ts +83 -0
- package/dist/extensions/pi-intercom/broker/client.ts +315 -12
- package/dist/extensions/pi-intercom/broker/extension-state.ts +186 -0
- package/dist/extensions/pi-intercom/broker/extension.test.ts +387 -0
- package/dist/extensions/pi-intercom/broker/framing.test.ts +114 -0
- package/dist/extensions/pi-intercom/broker/framing.ts +82 -24
- package/dist/extensions/pi-intercom/broker/paths.test.ts +153 -0
- package/dist/extensions/pi-intercom/broker/paths.ts +117 -8
- package/dist/extensions/pi-intercom/broker/runtime-claim.test.ts +34 -0
- package/dist/extensions/pi-intercom/broker/runtime-claim.ts +21 -0
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +160 -23
- package/dist/extensions/pi-intercom/broker/spawn.ts +113 -27
- package/dist/extensions/pi-intercom/config.test.ts +93 -0
- package/dist/extensions/pi-intercom/config.ts +55 -6
- package/dist/extensions/pi-intercom/cwd.test.ts +40 -0
- package/dist/extensions/pi-intercom/cwd.ts +31 -0
- package/dist/extensions/pi-intercom/extension-api.ts +44 -0
- package/dist/extensions/pi-intercom/format-context.test.ts +31 -0
- package/dist/extensions/pi-intercom/format-context.ts +32 -0
- package/dist/extensions/pi-intercom/index.ts +742 -145
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +2646 -0
- package/dist/extensions/pi-intercom/package.json +15 -5
- package/dist/extensions/pi-intercom/reply-tracker.test.ts +134 -0
- package/dist/extensions/pi-intercom/reply-tracker.ts +31 -13
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +13 -11
- package/dist/extensions/pi-intercom/test/inline-message.test.ts +184 -0
- package/dist/extensions/pi-intercom/test/overlay-width.test.ts +66 -0
- package/dist/extensions/pi-intercom/types.ts +94 -4
- package/dist/extensions/pi-intercom/ui/compose.ts +8 -4
- package/dist/extensions/pi-intercom/ui/inline-message.ts +61 -25
- package/dist/extensions/pi-intercom/ui/session-list.ts +7 -3
- package/dist/extensions/pi-subagents/CHANGELOG.md +85 -0
- package/dist/extensions/pi-subagents/LICENSE +21 -0
- package/dist/extensions/pi-subagents/README.md +146 -52
- package/dist/extensions/pi-subagents/agents/architect.md +1 -0
- package/dist/extensions/pi-subagents/agents/builder.md +1 -0
- package/dist/extensions/pi-subagents/package-lock.json +2 -2
- package/dist/extensions/pi-subagents/package.json +3 -3
- package/dist/extensions/pi-subagents/prompts/review-loop.md +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +21 -989
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +256 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +430 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +144 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +282 -0
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +71 -30
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +4 -0
- package/dist/extensions/pi-subagents/src/agents/agents.ts +118 -9
- package/dist/extensions/pi-subagents/src/agents/skills.ts +14 -12
- package/dist/extensions/pi-subagents/src/api/delegation.ts +3 -0
- package/dist/extensions/pi-subagents/src/api/preflight.ts +16 -12
- package/dist/extensions/pi-subagents/src/extension/chain-validation.ts +17 -1
- package/dist/extensions/pi-subagents/src/extension/index.ts +17 -7
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +248 -6
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +31 -6
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +8 -7
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +9 -4
- package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +33 -4
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +63 -16
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +24 -13
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +7 -5
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +18 -2
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +48 -5
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +68 -1
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +29 -4
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +29 -6
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +29 -3
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +372 -28
- package/dist/extensions/pi-subagents/src/runs/foreground/async-stop-action.ts +65 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-clarify.ts +3 -3
- package/dist/extensions/pi-subagents/src/runs/foreground/chain-execution.ts +143 -43
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +527 -247
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-control.ts +42 -0
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +426 -123
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +15 -7
- package/dist/extensions/pi-subagents/src/runs/shared/capability-ceiling.ts +51 -19
- package/dist/extensions/pi-subagents/src/runs/shared/chain-outputs.ts +3 -1
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +44 -11
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +8 -0
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +97 -20
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +43 -12
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +52 -4
- package/dist/extensions/pi-subagents/src/runs/shared/process-signal.ts +19 -0
- package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +45 -9
- package/dist/extensions/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.ts +71 -0
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +31 -1
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +101 -0
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +1 -1
- package/dist/extensions/pi-subagents/src/runs/shared/usage-budget.ts +65 -0
- package/dist/extensions/pi-subagents/src/runs/shared/workflow-graph.ts +26 -1
- package/dist/extensions/pi-subagents/src/shared/settings.ts +17 -1
- package/dist/extensions/pi-subagents/src/shared/types.ts +155 -10
- package/dist/extensions/pi-subagents/src/shared/utils.ts +73 -4
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +5 -0
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +46 -4
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +5 -3
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +87 -24
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +182 -9
- package/dist/extensions/pi-subagents/src/tui/render.ts +27 -28
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +14 -7
- package/dist/extensions/pi-subagents/src/watchdog/review.ts +5 -4
- package/dist/extensions/pi-subagents/src/watchdog/runtime.ts +170 -17
- package/dist/extensions/pi-subagents/src/watchdog/scope.ts +62 -0
- package/dist/extensions/pi-subagents/src/watchdog/settings.ts +41 -1
- package/dist/extensions/pi-subagents/src/watchdog/types.ts +10 -0
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +348 -7
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +84 -0
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +4 -2
- package/dist/extensions/pi-subagents/test/integration/chain-clarify.test.ts +51 -2
- package/dist/extensions/pi-subagents/test/integration/chain-execution.test.ts +26 -1
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +48 -0
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +3 -3
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +213 -13
- package/dist/extensions/pi-subagents/test/integration/parallel-execution.test.ts +34 -0
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +44 -0
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +118 -12
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +850 -7
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +112 -23
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +17 -5
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +2 -0
- package/dist/extensions/pi-subagents/test/support/register-loader.mjs +3 -3
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +3 -1
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +128 -0
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +47 -2
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +60 -0
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +8 -0
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +102 -0
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +6 -0
- package/dist/extensions/pi-subagents/test/unit/chain-validation.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +48 -48
- package/dist/extensions/pi-subagents/test/unit/config-dir-runtime.test.ts +23 -0
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +27 -0
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +4 -2
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +176 -8
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +164 -5
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +41 -1
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +11 -11
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +18 -2
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +20 -1
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +30 -2
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +10 -2
- package/dist/extensions/pi-subagents/test/unit/parallel-utils.test.ts +22 -0
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +103 -0
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +18 -0
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +46 -0
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +13 -1
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +29 -4
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +223 -4
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +30 -0
- package/dist/extensions/pi-subagents/test/unit/runtime-acknowledged-extensions.test.ts +52 -0
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +34 -2
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/streamed-progress-bounds.test.ts +78 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +41 -0
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +77 -0
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +3 -0
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +1 -1
- package/dist/extensions/pi-subagents/test/unit/total-cost.test.ts +1 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-runtime.test.ts +210 -1
- package/dist/extensions/pi-subagents/test/unit/watchdog-scope.test.ts +33 -0
- package/dist/extensions/pi-subagents/test/unit/watchdog-settings.test.ts +32 -0
- package/dist/extensions/pi-subagents/test/unit/writer-budget-guidance.test.ts +1 -1
- package/dist/extensions/question/index.ts +14 -1
- package/dist/extensions/question/tests/wizard.test.ts +11 -8
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +43 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +3 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +10 -2
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +1 -2
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +16 -46
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +4 -1
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +22 -13
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts +12 -0
- package/dist/modes/interactive/external-editor.d.ts.map +1 -0
- package/dist/modes/interactive/external-editor.js +37 -0
- package/dist/modes/interactive/external-editor.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +72 -64
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +14 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/skills/batch-grill-me/SKILL.md +3 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +19 -8
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/docs/compaction.md +1 -1
- package/docs/custom-provider.md +14 -5
- package/docs/environment-variables.md +86 -0
- package/docs/extensions.md +15 -5
- package/docs/index.md +1 -0
- package/docs/models.md +9 -2
- package/docs/providers.md +21 -2
- package/docs/rpc.md +23 -6
- package/docs/session-format.md +2 -0
- package/docs/settings.md +1 -1
- package/docs/usage.md +0 -13
- package/examples/extensions/custom-compaction.ts +5 -2
- package/examples/extensions/custom-provider-anthropic/index.ts +9 -3
- 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/handoff.ts +11 -3
- package/examples/extensions/message-renderer.ts +3 -3
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/summarize.ts +5 -2
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/12-full-control.ts +3 -1
- package/package.json +15 -6
- package/dist/extensions/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `pi-intercom` extension will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.9.2] - 2026-08-03
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- Avoid relaunching standalone Pi executables as the Node runtime when starting the default broker process. Thanks to ZacharyQin for PR #82 and to jeffutter and awaae001 for confirming the impact.
|
|
11
|
+
|
|
12
|
+
## [0.9.1] - 2026-07-30
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- Scoped name-based queued-mail redelivery to sessions that also match the target's directory. A disconnected session's queued messages, including replies addressed to its exact session ID, could previously be delivered to an unrelated same-named session in a different project folder. Directories compare through the same normalization used by `list-cwd`, so a relaunch reporting the same directory via a trailing slash or symlink still receives its mail.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Rewrote the broker frame reader as a bounded state machine and made frame writes a single allocation, removing quadratic `Buffer.concat` accumulation on fragmented socket reads (up to ~28x faster on heavily fragmented frames).
|
|
19
|
+
- Cached the collapsed preview and width-keyed wrapped body lines in the inline message renderer, cutting repeated rerender cost of long messages by ~2-3x while keeping live theme changes applied per render.
|
|
20
|
+
|
|
21
|
+
## [0.9.0] - 2026-07-29
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- Added a bounded in-memory broker mailbox so replies to recently disconnected named CLI senders are queued and delivered when a process reconnects with the same name. Thanks to Luke (`valkyriweb`) for issue #63.
|
|
25
|
+
- Added protocol-visible delivery metadata, receiver lifecycle receipts, receiver-side inbound message dedupe, explicit cancel/supersede controls, and clearer ask-timeout receipts for ordered delivery diagnostics. Thanks to Donnie Thomas (`donnielrt`) for issue #65.
|
|
26
|
+
|
|
27
|
+
## [0.8.0] - 2026-07-29
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- Added opt-in restart-stable intercom session IDs via `PI_INTERCOM_STABLE_ID` or `stableId` in `config.json`. Thanks to iRonin for issue #39.
|
|
31
|
+
- Added `/intercom-id` to insert a stable handoff snippet for the current session into the editor. Thanks to dataforxyz for PR #60.
|
|
32
|
+
- Added `intercom({ action: "list-cwd" })` to list peers scoped to the same working directory. Thanks to iRonin for PR #58.
|
|
33
|
+
- Added live context-window usage to session presence and list output. Thanks to iRonin for PR #59.
|
|
34
|
+
- Added a silent namespaced extension bus for non-conversational extension coordination. Thanks to Kieran Bond for PR #69.
|
|
35
|
+
|
|
36
|
+
## [0.7.0] - 2026-07-29
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- Documented `PI_INTERCOM_ASK_TIMEOUT_MS` for configurable ask/supervisor timeouts. Thanks to wiansapu for issue #14.
|
|
40
|
+
- Clarified session addressing copy so the short IDs shown by `list` are documented as usable prefixes. Thanks to Grant Hutchins for PR #66.
|
|
41
|
+
- Updated Pi runtime peer metadata and tool schemas for the `@earendil-works` package scope and Pi-bundled `typebox`/`pi-ai` packages.
|
|
42
|
+
- Centralized pi-intercom runtime and config paths under `PI_CODING_AGENT_DIR` when set, defaulting to `~/.pi/agent`.
|
|
43
|
+
- Hardened default broker auto-spawn to launch the resolved bundled `tsx` CLI through the current Node executable instead of resolving `npx` through `PATH`; custom `brokerCommand`/`brokerArgs` remain available as advanced trusted config.
|
|
44
|
+
- Added an `inboundTrigger` policy (`always`, `replies`, or `never`) so users can reduce inbound auto-trigger risk while preserving existing behavior by default.
|
|
45
|
+
- Made inline intercom messages collapse and expand with Pi's `Ctrl+O` custom-message toggle while keeping sender, preview, reply, and attachment cues visible. Thanks to RyanKim17920 for PR #32.
|
|
46
|
+
- Improved inline message theme hierarchy with separate semantic styling for borders, headers, body text, and metadata. Thanks to Sreenath for PR #68.
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
- Added broker-owned local trust metadata, clearer stable-ID trust boundaries for duplicate names, per-connection rate limiting, and no-op presence coalescing for local IPC abuse hardening.
|
|
50
|
+
- Added an inbound broker frame size cap to reject oversized local IPC messages before buffering their payloads.
|
|
51
|
+
- Restricted Unix intercom runtime directory, socket, PID, and spawn-lock permissions.
|
|
52
|
+
- Rechecked single-flight ask state after session target resolution so concurrent regular asks fail safely instead of crashing on an unhandled rejected reply waiter.
|
|
53
|
+
- Refused broker-level mutual asks that would deadlock two sessions, and cleared outstanding ask edges when asks are replied to, cancelled, or disconnected.
|
|
54
|
+
- Stabilized intercom session addressing across reconnects, idle `/name` changes, replaced Pi sessions, supervisor routing, pending replies, and short-ID targeting.
|
|
55
|
+
- Aligned intercom overlay widths with their rendered modal boxes. Thanks to Cat for PR #43.
|
|
56
|
+
- Marked failed `intercom` and `contact_supervisor` tool results through Pi's `tool_result` error flag path while preserving structured renderer details.
|
|
57
|
+
- Limited the intercom overlay to TUI mode and unsubscribed subagent relay event handlers during session shutdown.
|
|
58
|
+
- Added an opt-in Windows localhost TCP transport using a dynamic port, broker protocol health checks, and a local endpoint secret instead of a fixed-port default.
|
|
59
|
+
- Stabilized reply/supervisor routing by respecting explicit reply targets, suppressing legacy supervisor tools when native supervisor channels are present, and clearing replied idle-queued asks. Thanks to ThanhNT29Jacky for PR #64.
|
|
60
|
+
|
|
61
|
+
## [0.6.0] - 2026-05-03
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
- Added `brokerCommand` and `brokerArgs` config options for choosing the broker runtime command. Thanks to William Fligor for PR #12.
|
|
65
|
+
|
|
66
|
+
## [0.5.0] - 2026-05-03
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
- Busy interactive sessions now queue inbound intercom messages until the receiver is idle instead of aborting the active turn.
|
|
70
|
+
- Sessions now publish automatic lifecycle status (`idle`, `thinking`, or `tool:<name>`) through intercom presence updates.
|
|
71
|
+
- Deferred startup connection, delayed inbound flushes, overlay work, reconnect attempts, and relay callbacks now guard against stale session contexts after shutdown or reload.
|
|
72
|
+
- `intercom` and `contact_supervisor` tool calls/results now use compact custom transcript renderers.
|
|
73
|
+
|
|
74
|
+
## [0.4.1] - 2026-05-02
|
|
75
|
+
|
|
76
|
+
### Added
|
|
77
|
+
- Added `contact_supervisor` `reason: "interview_request"` for child subagents to send structured supervisor interviews, wait for a reply, and receive parsed JSON replies in tool result details when available.
|
|
78
|
+
|
|
79
|
+
### Fixed
|
|
80
|
+
- Busy non-interactive sessions now auto-reply to top-level intercom messages instead of aborting and losing the message.
|
|
81
|
+
|
|
82
|
+
## [0.4.0] - 2026-05-02
|
|
83
|
+
|
|
84
|
+
### Added
|
|
85
|
+
- Added a `contact_supervisor` tool for `pi-subagents` child sessions so delegated agents can request supervisor decisions or send meaningful progress updates with run metadata.
|
|
86
|
+
- Documented subagent-to-supervisor escalation in the README and bundled `pi-intercom` skill.
|
|
87
|
+
|
|
88
|
+
### Fixed
|
|
89
|
+
- Made inline intercom message cards use the available terminal width instead of a narrow fixed width.
|
|
90
|
+
- Cleared supervisor ask waiters correctly after cancellation or delivery failure so subagents can ask again.
|
|
91
|
+
|
|
92
|
+
### Changed
|
|
93
|
+
- Stopped tracking `package-lock.json` and ignored local `progress.md` memory files.
|
|
94
|
+
|
|
95
|
+
## [0.3.0] - 2026-04-27
|
|
96
|
+
|
|
97
|
+
### Added
|
|
98
|
+
- Added `pi-subagents` grouped result relay support over `pi-intercom`, including delivery acknowledgments so parent runs can return compact receipts only after the orchestrator receives the result message.
|
|
99
|
+
|
|
100
|
+
## [0.2.1] - 2026-04-26
|
|
101
|
+
|
|
102
|
+
### Fixed
|
|
103
|
+
- Delivered `pi-subagents` needs-attention control events to the orchestrator over intercom.
|
|
104
|
+
|
|
105
|
+
## [0.2.0] - 2026-04-22
|
|
106
|
+
|
|
107
|
+
### Added
|
|
108
|
+
- Added receiver-side `reply` ergonomics for inbound asks. Agents can now use `intercom({ action: "reply", message })` in the triggered turn or later against a single pending ask, plus `intercom({ action: "pending" })` to inspect unresolved inbound asks.
|
|
109
|
+
|
|
110
|
+
### Fixed
|
|
111
|
+
- Migrated extension tool schemas from `@sinclair/typebox` to `typebox` 1.x so packaged installs follow Pi's current extension runtime contract.
|
|
112
|
+
- Included `reply-tracker.ts` in the published package so installed extensions can load the new reply-tracking helper at runtime.
|
|
113
|
+
- Updated the integration test harness to set `USERPROFILE` alongside `HOME`, keeping temp-home isolation reliable on Windows.
|
|
114
|
+
|
|
115
|
+
### Changed
|
|
116
|
+
- Moved TypeBox from `peerDependencies` to a real `dependencies` entry so `pi install` production installs keep the schema package available at runtime.
|
|
117
|
+
- Incoming ask reply hints now prefer `intercom({ action: "reply", ... })` instead of exposing raw `to` and `replyTo` identifiers.
|
|
118
|
+
- Updated the bundled `pi-intercom` skill and README examples to prefer `reply`/`pending` over manual reply threading.
|
|
119
|
+
|
|
120
|
+
## [0.1.11] - 2026-04-20
|
|
121
|
+
|
|
122
|
+
### Added
|
|
123
|
+
- Bundled `pi-intercom` skill with coordination patterns, error handling, constraints, and optional cmux/tmux peer-session spawning for visible multi-session workflows.
|
|
124
|
+
- `pi.skills` manifest in `package.json` so `pi install` loads the skill automatically.
|
|
125
|
+
- AGENTS.md snippet in README recommending a project-level coordination hint for agents.
|
|
126
|
+
- Attachments example to Quick Start section in README.
|
|
127
|
+
|
|
128
|
+
### Changed
|
|
129
|
+
- Incoming message reply hints now say "To reply, use the intercom tool:" instead of "— reply:" so agents are more likely to use the intercom tool instead of replying inline.
|
|
130
|
+
- `ask` action now documents the one-at-a-time constraint in the Tool Reference.
|
|
131
|
+
- `status` action now clarifies that the session count includes the current session.
|
|
132
|
+
- Broker startup no longer uses a non-null assertion for sender session lookup in the `send` handler — missing sessions now produce a `delivery_failed` response instead of a crash.
|
|
133
|
+
- Broker spawn lock error handling tightened to check `instanceof Error` before accessing `.code`.
|
|
134
|
+
- Broker PID parsing now guards against `NaN` from corrupt PID files.
|
|
135
|
+
- `isConnected()` readability cleanup in `IntercomClient`.
|
|
136
|
+
- README file structure updated to include `broker/paths.ts`, test files, and `skills/` directory.
|
|
137
|
+
- README runtime files section now clarifies that `broker.sock` is macOS/Linux only; Windows uses a named pipe.
|
|
138
|
+
- README mermaid diagram changed "Unix Socket" to "Local Socket/Pipe" for cross-platform accuracy.
|
|
139
|
+
- README broker limitation rephrased from "must be running" to "auto-spawns on first use and exits when idle."
|
|
140
|
+
- README Install section now mentions that the bundled skill is registered on startup.
|
|
141
|
+
|
|
142
|
+
## [0.1.10] - 2026-04-17
|
|
143
|
+
|
|
144
|
+
### Fixed
|
|
145
|
+
- Broker startup now works on Windows by launching the local `tsx` CLI through a hidden `wscript.exe` helper without treating the helper's expected early exit as a broker failure.
|
|
146
|
+
|
|
147
|
+
### Changed
|
|
148
|
+
- The broker now uses a Windows named pipe instead of a Unix socket on Windows, while keeping the existing Unix socket transport on macOS and Linux.
|
|
149
|
+
|
|
150
|
+
## [0.1.9] - 2026-04-17
|
|
151
|
+
|
|
152
|
+
### Fixed
|
|
153
|
+
- Declared the extension entry in `package.json` via `pi.extensions` so `pi install npm:pi-intercom` can discover and load the extension from the npm package.
|
|
154
|
+
|
|
155
|
+
### Changed
|
|
156
|
+
- Added `pi-package` package metadata plus peer dependency declarations for every Pi runtime package the extension imports, including `@mariozechner/pi-tui`.
|
|
157
|
+
|
|
158
|
+
## [0.1.8] - 2026-04-14
|
|
159
|
+
|
|
160
|
+
### Changed
|
|
161
|
+
- Intercom sessions now reconnect automatically after broker disconnects or sleep/wake interruptions instead of staying offline until reload or restart.
|
|
162
|
+
- Replaced raw runtime `console.error` intercom disconnect logging with silent recovery so transient broker churn no longer splashes stray text into the Pi TUI.
|
|
163
|
+
|
|
164
|
+
## [0.1.7] - 2026-04-13
|
|
165
|
+
|
|
166
|
+
### Changed
|
|
167
|
+
- Unnamed sessions now register a runtime-only `subagent-chat-<id>` intercom alias instead of persisting a generic session title into Pi session history, so `pi --resume` can keep showing transcript snippets while unnamed sessions remain reachable over intercom.
|
|
168
|
+
- Intercom presence updates now refresh the advertised session name during later turn/intercom activity, so renaming a session does not leave subagents and peers targeting a stale startup alias.
|
|
169
|
+
|
|
170
|
+
## [0.1.6] - 2026-04-13
|
|
171
|
+
|
|
172
|
+
### Changed
|
|
173
|
+
- Busy incoming intercom messages now try a graceful detach handshake with `pi-subagents` before falling back to interrupting the active turn.
|
|
174
|
+
- Reply follow-ups are deferred and re-delivered as follow-up wakeups so final confirmation messages stop causing unnecessary `Operation aborted` interruptions.
|
|
175
|
+
- Unnamed sessions now auto-register a stable `session-<id>` display name so orchestrators and delegated children can target each other reliably without a manual `/name`.
|
|
176
|
+
|
|
177
|
+
## [0.1.5] - 2026-04-13
|
|
178
|
+
|
|
179
|
+
### Changed
|
|
180
|
+
- Switched intercom send confirmation to opt-in. `send` now delivers immediately by default, and interactive confirmation only appears when `confirmSend: true` is set in `~/.pi/agent/intercom/config.json`.
|
|
181
|
+
- Replaced the old inverted `autoSend` config with `confirmSend` to make the behavior easier to understand.
|
|
182
|
+
|
|
183
|
+
## [0.1.4] - 2026-04-13
|
|
184
|
+
|
|
185
|
+
### Added
|
|
186
|
+
- Added an MIT `LICENSE` file and set `package.json` `license` to `MIT`.
|
|
187
|
+
|
|
188
|
+
### Changed
|
|
189
|
+
- Updated `README.md` to mention the `pi-subagents` integration and link to https://github.com/nicobailon/pi-subagents.
|
|
190
|
+
|
|
191
|
+
## [0.1.3] - 2026-04-10
|
|
192
|
+
|
|
193
|
+
### Changed
|
|
194
|
+
- **Clearer self vs peer identity** — `intercom({ action: "list" })` now shows `Current session` and `Other sessions`, includes short session IDs, and marks same-folder peers with `[same cwd]` so agents are less likely to mistake another session in the same repo for themselves.
|
|
195
|
+
- **Picker self anchor** — The session picker now shows the current session as a disabled `[self]` row at the top while keeping only peer sessions selectable.
|
|
196
|
+
|
|
197
|
+
## [0.1.2] - 2026-04-04
|
|
198
|
+
|
|
199
|
+
### Changed
|
|
200
|
+
- **Reply flows skip approval** — `send` calls that include `replyTo` now bypass the confirmation dialog so reply-hint conversations can continue without an extra approval step.
|
|
201
|
+
- **Overlay readability** — The session picker now shows session name/model on the first line and the cwd on a second line with middle truncation, making long paths much easier to distinguish.
|
|
202
|
+
- **Documentation clarity** — The README now explains which sessions appear in the picker, how sessions become intercom-connected, and the difference between user-facing `/intercom` usage and agent tool calls.
|
|
203
|
+
|
|
204
|
+
### Fixed
|
|
205
|
+
- **Compose overlay crash** — Replaced the invalid `tui.scheduleRender()` calls with `tui.requestRender()`, fixing the compose overlay crash while typing or sending.
|
|
206
|
+
- **Overlay panel chrome** — Restored bordered modal rendering for the session picker and compose overlay so they display as proper overlays instead of floating unboxed content.
|
|
207
|
+
|
|
208
|
+
## [0.1.1] - 2026-04-04
|
|
209
|
+
|
|
210
|
+
### Changed
|
|
211
|
+
- Added a `promptSnippet` for the `intercom` tool so Pi 0.59+ includes it in the default tool prompt section and improves session-to-session coordination discoverability.
|
|
212
|
+
|
|
213
|
+
### Changed
|
|
214
|
+
- **Pi compatibility refresh** — Updated the extension to match current Pi lifecycle and custom UI APIs, including `session_start` / `session_shutdown` and injected `ctx.ui.custom()` keybindings.
|
|
215
|
+
- **Overlay keybindings** — The session picker and compose overlay now use injected, namespaced Pi keybindings instead of reading editor-global bindings directly.
|
|
216
|
+
- **Session list correlation** — `list` / `sessions` now carry a `requestId`, so a delayed broker reply cannot be mistaken for a newer session-list request.
|
|
217
|
+
- **Reply sends skip approval** — `send` calls that include `replyTo` now bypass the confirmation dialog so reply-hint flows work without an extra approval step.
|
|
218
|
+
- **Documentation accuracy** — The README now matches the current implementation, including request correlation, persistence behavior, broker disconnect behavior, and the file layout.
|
|
219
|
+
|
|
220
|
+
### Fixed
|
|
221
|
+
- **Protocol state handling** — Broker and client now reject malformed, unknown, duplicate, and out-of-order protocol messages instead of silently accepting them.
|
|
222
|
+
- **Duplicate-name routing** — Sends to a duplicated session name now fail with an explicit error instead of routing to the first match.
|
|
223
|
+
- **Delivery failure visibility** — `delivery_failed.reason` now flows through the client, tool results, and compose overlay error UI.
|
|
224
|
+
- **Disconnect and startup errors** — Broker spawn failures, early broker exits, protocol failures, and disconnects now preserve the real error instead of collapsing to generic messages.
|
|
225
|
+
- **Disconnect-time writes** — Client operations now fail cleanly during disconnect instead of writing to a closing socket and triggering `write after end` errors.
|
|
226
|
+
- **Late-response handling** — Timed-out send/list requests no longer disconnect the client, and delayed list responses can no longer contaminate a later request with stale data.
|
|
227
|
+
- **Config validation** — Invalid intercom config values are now reported and ignored instead of silently producing a broken runtime config.
|
|
228
|
+
|
|
229
|
+
## [0.1.0] - 2026-03-12
|
|
230
|
+
|
|
231
|
+
### Added
|
|
232
|
+
- **`ask` action** — `intercom({ action: "ask", to, message })` now sends a message and blocks until the recipient replies, returning the reply as the tool result. Includes a 10-minute timeout, abort handling, disconnect handling, and shutdown cleanup.
|
|
233
|
+
- **Exact reply hints** — Incoming messages can now include a ready-to-run reply command that uses the sender's exact session ID as `to` and the original message ID as `replyTo`, making synchronous `ask`/reply flows reliable.
|
|
234
|
+
- **Attachment body rendering for incoming messages** — Incoming attachment contents are now appended to the agent-visible message body so recipients can read attached file/snippet/context content directly.
|
|
235
|
+
- **Planner/worker workflow documentation** — README now documents the intended planner-worker loop, including `send` vs `ask`, clarification patterns, and reply-hint behavior.
|
|
236
|
+
|
|
237
|
+
### Changed
|
|
238
|
+
- **Session target resolution** — `send` and `ask` now resolve a unique case-insensitive session name to its exact session ID before sending. Ambiguous names are rejected instead of guessed.
|
|
239
|
+
- **Duplicate-name presentation** — Session labels are now disambiguated consistently across `list`, the session picker, the compose overlay, and send notifications by appending a short session ID when names collide.
|
|
240
|
+
- **Send confirmation dialog** — Confirmation text now includes attachment content previews and `replyTo` metadata so outgoing messages are reviewed accurately before sending.
|
|
241
|
+
- **Inline message rendering** — The custom inline renderer now shows the fully rendered message body, optional reply command, attachment summaries, and reply metadata consistently with what the agent receives.
|
|
242
|
+
|
|
243
|
+
### Fixed
|
|
244
|
+
- **False `ask` completions from unrelated messages** — Reply matching now requires an exact `replyTo` match and the expected sender, preventing unrelated incoming messages from unblocking a waiting `ask`.
|
|
245
|
+
- **Self-targeted messages** — `send` and `ask` now reject attempts to message the current session instead of allowing loops or self-waits.
|
|
246
|
+
- **Undelivered `ask` cleanup** — If an `ask` message is not delivered, the waiting state is torn down cleanly instead of lingering.
|
|
247
|
+
- **Inline renderer/body mismatch** — The custom message renderer now matches the actual delivered message body for messages with attachments instead of showing a reduced view.
|
|
248
|
+
- **Duplicate-name ambiguity when self shares a name** — Duplicate-name detection now considers all connected sessions, so another session is still disambiguated when it shares a name with the current session.
|
|
249
|
+
- **`broker/client.ts` `sessions` switch scoping** — Braced the `sessions` case to avoid block-scoping hazards in the message handler.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
<img src="banner.png" alt="pi-intercom" width="1100">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# Selesai Intercom
|
|
6
6
|
|
|
7
|
-
Direct 1:1 messaging between
|
|
7
|
+
Direct 1:1 messaging between Selesai sessions on the same machine. Send context, findings, or requests from one session to another — whether you're driving the conversation or letting agents coordinate.
|
|
8
8
|
|
|
9
9
|
```text
|
|
10
10
|
User flow: press Alt+M or run /intercom to pick a session and send a message
|
|
@@ -12,33 +12,33 @@ User flow: press Alt+M or run /intercom to pick a session and send a message
|
|
|
12
12
|
|
|
13
13
|
## Why
|
|
14
14
|
|
|
15
|
-
Sometimes you're running multiple
|
|
15
|
+
Sometimes you're running multiple Selesai sessions — one researching, one executing, one reviewing. pi-intercom lets you:
|
|
16
16
|
|
|
17
17
|
- **User-driven orchestration** — Send context or findings from your research session to your execution session
|
|
18
18
|
- **Agent collaboration** — An agent can reach out to another session when it needs help or wants to share results
|
|
19
|
-
- **Session awareness** — See what other
|
|
19
|
+
- **Session awareness** — See what other Selesai sessions are running and their current status
|
|
20
20
|
|
|
21
21
|
Unlike pi-messenger (a shared chat room for multi-agent swarms), pi-intercom is for targeted 1:1 communication where you pick the recipient.
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
pi-intercom also integrates well with [pi-subagents](https://github.com/nicobailon/pi-subagents): delegated child agents get a child-only `contact_supervisor` tool when `pi-subagents` supplies bridge metadata. Use `reason: "need_decision"` for blocking clarification, `reason: "interview_request"` for multiple structured supervisor answers, and `reason: "progress_update"` for meaningful plan-changing updates. Normal sessions only see the regular `intercom` tool.
|
|
24
24
|
|
|
25
25
|
## In One Minute
|
|
26
26
|
|
|
27
|
-
Each
|
|
27
|
+
Each Selesai session that has `pi-intercom` loaded and enabled connects to a tiny local broker over a local IPC transport. The broker keeps track of connected sessions and routes direct messages to the one you target by name or session ID. The extension gives you both a tool (`intercom`) and a small overlay UI (`/intercom` or `Alt+M`). Incoming messages are rendered inline inside the recipient session, can trigger a turn immediately by default, and are also stored in Selesai session history as extension entries. If you want a stricter local trust posture, `inboundTrigger` can reduce or disable auto-triggering.
|
|
28
28
|
|
|
29
29
|
## Install
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
-
|
|
32
|
+
selesai install npm:pi-intercom
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Then restart
|
|
35
|
+
Then restart Selesai. The extension auto-connects to the broker on startup and registers the bundled `pi-intercom` skill for common coordination patterns.
|
|
36
36
|
|
|
37
37
|
**Recommended:** Add this snippet to your project's `AGENTS.md` to help agents understand when to coordinate across sessions:
|
|
38
38
|
|
|
39
39
|
```xml
|
|
40
40
|
<pi-intercom>
|
|
41
|
-
Coordinate with other local
|
|
41
|
+
Coordinate with other local Selesai sessions on related codebases. Use `/skill:pi-intercom` for patterns.
|
|
42
42
|
|
|
43
43
|
**When:** Same codebase (parallel work), reference codebase (consulting patterns), related repos (shared libraries).
|
|
44
44
|
|
|
@@ -50,13 +50,13 @@ Coordinate with other local pi sessions on related codebases. Use `/skill:pi-int
|
|
|
50
50
|
|
|
51
51
|
A session becomes intercom-connected when all of these are true:
|
|
52
52
|
- the `pi-intercom` extension is installed and loaded in that session
|
|
53
|
-
- `enabled` is not set to `false` in `~/.
|
|
53
|
+
- `enabled` is not set to `false` in the intercom config file, which defaults to `~/.selesai/agent/intercom/config.json`
|
|
54
54
|
- the session has started or reloaded after the extension was installed
|
|
55
55
|
- the local broker is running or can be auto-started
|
|
56
56
|
|
|
57
|
-
The session list only shows intercom-connected sessions, not every open
|
|
57
|
+
The session list only shows intercom-connected sessions, not every open Selesai process on the machine.
|
|
58
58
|
|
|
59
|
-
If a session is unnamed, pi-intercom now exposes a runtime-only fallback alias like `subagent-chat-1a2b3c4d` so other sessions can still target it. That alias is not persisted as the
|
|
59
|
+
If a session is unnamed, pi-intercom now exposes a runtime-only fallback alias like `subagent-chat-1a2b3c4d` so other sessions can still target it. That alias is not persisted as the Selesai session title, so `selesai --resume` can keep showing the transcript snippet instead of a generic `session-...` name.
|
|
60
60
|
|
|
61
61
|
## Quick Start
|
|
62
62
|
|
|
@@ -70,16 +70,19 @@ Press **Alt+M** or type `/intercom` to open the session list overlay:
|
|
|
70
70
|
|
|
71
71
|
### From the Agent
|
|
72
72
|
|
|
73
|
-
The agent can list sessions and send messages using the `intercom` tool. Tool calls and results render as compact transcript rows so send/ask/reply flows are easy to scan. For common patterns like planner-worker delegation, the bundled `pi-intercom` skill provides copy-paste ready examples:
|
|
73
|
+
The agent can list sessions and send messages using the `intercom` tool. Tool calls and results render as compact transcript rows so send/ask/reply flows are easy to scan. Use `/intercom-id` to insert a handoff snippet for the current session's stable intercom target into the editor. For common patterns like planner-worker delegation, the bundled `pi-intercom` skill provides copy-paste ready examples:
|
|
74
74
|
|
|
75
75
|
```typescript
|
|
76
76
|
// List active sessions
|
|
77
77
|
intercom({ action: "list" })
|
|
78
78
|
// → **Current session:**
|
|
79
|
-
// → • executor (20d43841) — ~/projects/api (claude-sonnet-4) [self, idle]
|
|
79
|
+
// → • executor (20d43841) — ~/projects/api (claude-sonnet-4 · 42% ctx) [self, idle]
|
|
80
80
|
// → **Other sessions:**
|
|
81
81
|
// → • research (6332faab) — ~/projects/api (claude-sonnet-4) [same cwd, thinking]
|
|
82
82
|
|
|
83
|
+
// List only peers in the same working directory
|
|
84
|
+
intercom({ action: "list-cwd" })
|
|
85
|
+
|
|
83
86
|
// Send a message
|
|
84
87
|
intercom({ action: "send", to: "research", message: "Check if UserService.validate() handles null" })
|
|
85
88
|
// → Message sent to research
|
|
@@ -115,7 +118,7 @@ Found the issue — UserService.validate() doesn't check for null input.
|
|
|
115
118
|
See auth.ts:142-156.
|
|
116
119
|
```
|
|
117
120
|
|
|
118
|
-
The reply hint (enabled by default) points to `intercom({ action: "reply", ... })`, so recipients do not need raw sender or `replyTo` IDs. Idle recipients get a new turn immediately; busy interactive recipients receive the message once they go idle. Attachment content is included in the agent-visible body, and messages are rendered inline and stored in
|
|
121
|
+
The reply hint (enabled by default) points to `intercom({ action: "reply", ... })`, so recipients do not need raw sender or `replyTo` IDs. Idle recipients get a new turn immediately; busy interactive recipients receive the message once they go idle. Attachment content is included in the agent-visible body, and messages are rendered inline and stored in Selesai session history.
|
|
119
122
|
|
|
120
123
|
## Workflow: Planner-Worker Coordination
|
|
121
124
|
|
|
@@ -208,10 +211,16 @@ This matters because the agent receiving the message doesn't need to reconstruct
|
|
|
208
211
|
|
|
209
212
|
`send` is fire-and-forget — the tool returns immediately after delivery. By default, it sends immediately even in interactive sessions. If you want an approval dialog before non-reply sends, set `confirmSend: true` in config. Replies that include `replyTo` still skip confirmation so reply-hint flows can continue without an extra approval step.
|
|
210
213
|
|
|
211
|
-
`ask` sends the message and blocks until the recipient responds (10-minute timeout). The reply comes back as the tool result, so the agent continues in the same turn with full context. No confirmation dialog — if you're asking and waiting, the intent is clear.
|
|
214
|
+
`ask` sends the message and blocks until the recipient responds (10-minute timeout by default; set `PI_INTERCOM_ASK_TIMEOUT_MS` to a positive millisecond value to change it). The reply comes back as the tool result, so the agent continues in the same turn with full context. No confirmation dialog — if you're asking and waiting, the intent is clear.
|
|
212
215
|
|
|
213
216
|
`reply` is receiver-side sugar for replying to an inbound ask. In the turn triggered by an incoming intercom ask, `intercom({ action: "reply", message: "..." })` targets that exact sender and message automatically. If you reply later, it falls back to the single unresolved inbound ask. If multiple asks are pending, use `intercom({ action: "pending" })` to inspect them and then call `reply` with `to` to disambiguate.
|
|
214
217
|
|
|
218
|
+
The broker keeps a bounded in-memory mailbox for recently disconnected named sessions. If a lightweight CLI sender asks a long-running session something and exits before the answer, the later `reply` is accepted into that mailbox instead of failing with `Session not found`; a process that reconnects with the same name receives the queued reply. This is per-broker runtime state, not durable storage across broker restarts.
|
|
219
|
+
|
|
220
|
+
Incoming messages now carry diagnostic metadata end to end: stable message ID, sender sequence, sender timestamp, broker receive/delivery timestamps, receiver receive timestamp, and injection timestamp. Receivers emit lifecycle receipts for `receiver_received`, `acknowledged`, `queued`, `injected`, `expired`, `cancelled`, `superseded`, and `cancellation_requested`; duplicate message IDs are acknowledged but injected at most once per receiving session. If an `ask` times out, the timeout names the message ID and last known delivery state. Timeout is not cancellation: the recipient may still have the message queued or actionable unless an explicit cancellation path says otherwise.
|
|
221
|
+
|
|
222
|
+
Cancellation is explicit: call `intercom({ action: "cancel", messageId })` to request cancellation of a message you originally sent. If the receiver has not injected it yet, it is removed from the queue and reported as `cancelled`; if it is already injected or processed, the receiver reports `cancellation_requested` instead of hiding it. Supersede is also explicit: pass `supersedes: "old-message-id"` on a new `send` or `ask`. The broker only allows same sender → same receiver supersedes, marks the old message `superseded`, and sends the replacement with a new message ID. Retries are never automatic; a retry should be a new authored message, optionally linked with `retryOf`.
|
|
223
|
+
|
|
215
224
|
The planner typically uses `send`. If you prefer manual approval for outgoing non-reply messages, turn on `confirmSend: true`. The worker uses `ask` for everything (no confirmation needed, gets answers inline), so it can operate autonomously either way.
|
|
216
225
|
|
|
217
226
|
## Workflow: Subagent-to-Supervisor Escalation
|
|
@@ -222,10 +231,10 @@ This workflow requires [`pi-subagents`](https://github.com/nicobailon/pi-subagen
|
|
|
222
231
|
|
|
223
232
|
`contact_supervisor` only registers when `pi-subagents` sets all of these environment variables:
|
|
224
233
|
|
|
225
|
-
- `
|
|
226
|
-
- `
|
|
227
|
-
- `
|
|
228
|
-
- `
|
|
234
|
+
- `SELESAI_SUBAGENT_ORCHESTRATOR_TARGET` — the supervisor session name or ID
|
|
235
|
+
- `SELESAI_SUBAGENT_RUN_ID` — the run identifier
|
|
236
|
+
- `SELESAI_SUBAGENT_CHILD_AGENT` — the agent type
|
|
237
|
+
- `SELESAI_SUBAGENT_CHILD_INDEX` — the child index within the run
|
|
229
238
|
|
|
230
239
|
If any are missing, the session falls back to the regular `intercom` tool.
|
|
231
240
|
|
|
@@ -233,7 +242,7 @@ If any are missing, the session falls back to the regular `intercom` tool.
|
|
|
233
242
|
|
|
234
243
|
| Reason | Behavior | Use When |
|
|
235
244
|
|--------|----------|----------|
|
|
236
|
-
| `need_decision` | Sends an ask and blocks until the supervisor replies (10-minute timeout) | The subagent is blocked, uncertain, needs approval, or faces a product/API/scope decision |
|
|
245
|
+
| `need_decision` | Sends an ask and blocks until the supervisor replies (10-minute timeout by default; configurable with `PI_INTERCOM_ASK_TIMEOUT_MS`) | The subagent is blocked, uncertain, needs approval, or faces a product/API/scope decision |
|
|
237
246
|
| `interview_request` | Sends structured questions and blocks until the supervisor replies | The subagent needs multiple machine-readable answers from the supervisor in one exchange |
|
|
238
247
|
| `progress_update` | Fire-and-forget update to the supervisor | Meaningful progress or unexpected discoveries that change the plan |
|
|
239
248
|
|
|
@@ -312,11 +321,14 @@ The supervisor can reply with plain JSON or a fenced `json` block. If the reply
|
|
|
312
321
|
|
|
313
322
|
| Parameter | Type | Description |
|
|
314
323
|
|-----------|------|-------------|
|
|
315
|
-
| `action` | string | `"list"`, `"send"`, `"ask"`, `"reply"`, `"pending"`, or `"
|
|
324
|
+
| `action` | string | `"list"`, `"list-cwd"`, `"send"`, `"ask"`, `"reply"`, `"pending"`, `"status"`, or `"cancel"` |
|
|
316
325
|
| `to` | string | Target session name or ID (for send/ask, or to disambiguate reply) |
|
|
317
326
|
| `message` | string | Message text (for send/ask/reply) |
|
|
318
327
|
| `attachments` | array | Optional `file`, `snippet`, or `context` attachments |
|
|
319
328
|
| `replyTo` | string | Optional message ID for threading or replying to an `ask` |
|
|
329
|
+
| `messageId` | string | Optional explicit message ID for send/ask, or required message ID for `cancel` |
|
|
330
|
+
| `supersedes` | string | Optional previous message ID that this send/ask explicitly replaces |
|
|
331
|
+
| `retryOf` | string | Optional previous message ID that this send/ask explicitly retries |
|
|
320
332
|
|
|
321
333
|
### contact_supervisor
|
|
322
334
|
|
|
@@ -328,7 +340,7 @@ Only registered in sessions where `pi-subagents` supplied the required child bri
|
|
|
328
340
|
| `message` | string | The decision request, optional interview note, or progress update |
|
|
329
341
|
| `interview` | object | Required for `interview_request`: `{ title?, description?, questions: [...] }` |
|
|
330
342
|
|
|
331
|
-
**`need_decision`** — Sends a formatted ask to the supervisor and blocks until it replies (10-minute timeout). The reply comes back as the tool result. Includes run metadata in the message so the supervisor knows which subagent is asking.
|
|
343
|
+
**`need_decision`** — Sends a formatted ask to the supervisor and blocks until it replies (10-minute timeout by default; configurable with `PI_INTERCOM_ASK_TIMEOUT_MS`). The reply comes back as the tool result. Includes run metadata in the message so the supervisor knows which subagent is asking.
|
|
332
344
|
|
|
333
345
|
**`interview_request`** — Sends a formatted, agent-readable interview to the supervisor and blocks until it replies. Questions use a local pi-interview-like shape: `{ id, type, question, options?, context? }` where `type` is `single`, `multi`, `text`, `image`, or `info`. `info` questions are context-only and do not need responses. The supervisor reply should be JSON with `{ "responses": [{ "id": "...", "value": ... }] }`. Parsed JSON replies are returned in `details.structuredReply`.
|
|
334
346
|
|
|
@@ -336,16 +348,18 @@ Only registered in sessions where `pi-subagents` supplied the required child bri
|
|
|
336
348
|
|
|
337
349
|
### intercom actions
|
|
338
350
|
|
|
339
|
-
**`list`** — Returns the current session plus other active intercom-connected sessions with name, short ID, working directory, model, and live status. Status is derived automatically from
|
|
351
|
+
**`list`** — Returns the current session plus other active intercom-connected sessions with name, short ID, working directory, model, and live status. Status is derived automatically from Selesai lifecycle events: `idle`, `thinking`, or `tool:<name>`.
|
|
340
352
|
|
|
341
353
|
**`send`** — Sends a message to the specified session. By default it sends immediately, including in interactive sessions. Set `confirmSend: true` in config if you want a confirmation dialog for non-reply sends. Replies that include `replyTo` skip confirmation. Returns delivery confirmation.
|
|
342
354
|
|
|
343
|
-
**`ask`** — Sends a message and waits for the recipient to reply (10-minute timeout). The reply is returned as the tool result. No confirmation dialog. Only one pending `ask` is allowed per session at a time. Use this when the agent needs the answer to continue working.
|
|
355
|
+
**`ask`** — Sends a message and waits for the recipient to reply (10-minute timeout by default; configurable with `PI_INTERCOM_ASK_TIMEOUT_MS`). The reply is returned as the tool result. No confirmation dialog. Only one pending `ask` is allowed per session at a time. Use this when the agent needs the answer to continue working.
|
|
344
356
|
|
|
345
357
|
**`reply`** — Replies to the current intercom-triggered message if there is one. Otherwise it falls back to the single unresolved inbound ask. If multiple asks are pending, pass `to` or inspect them with `pending` first. Under the hood this is still a normal `send` with the exact `replyTo` value.
|
|
346
358
|
|
|
347
359
|
**`pending`** — Lists unresolved inbound asks with sender, message ID, elapsed time, and a short preview. Useful when replying after the original triggered turn.
|
|
348
360
|
|
|
361
|
+
**`cancel`** — Requests cancellation of a message previously sent by the current session. Queued messages are removed before injection; already-injected messages receive a visible cancellation request.
|
|
362
|
+
|
|
349
363
|
**`status`** — Shows connection status, session ID, and total count of active sessions (including the current session).
|
|
350
364
|
|
|
351
365
|
## Keyboard Shortcuts
|
|
@@ -359,13 +373,14 @@ Only registered in sessions where `pi-subagents` supplied the required child bri
|
|
|
359
373
|
|
|
360
374
|
## Config
|
|
361
375
|
|
|
362
|
-
Create `~/.
|
|
376
|
+
Create `~/.selesai/agent/intercom/config.json`:
|
|
363
377
|
|
|
364
378
|
```json
|
|
365
379
|
{
|
|
366
380
|
"brokerCommand": "npx",
|
|
367
381
|
"brokerArgs": ["--no-install", "tsx"],
|
|
368
382
|
"confirmSend": false,
|
|
383
|
+
"inboundTrigger": "always",
|
|
369
384
|
"enabled": true,
|
|
370
385
|
"replyHint": true,
|
|
371
386
|
"status": "researching"
|
|
@@ -374,14 +389,17 @@ Create `~/.pi/agent/intercom/config.json`:
|
|
|
374
389
|
|
|
375
390
|
| Setting | Default | Description |
|
|
376
391
|
|---------|---------|-------------|
|
|
377
|
-
| `brokerCommand` | `"npx"` |
|
|
378
|
-
| `brokerArgs` | `["--no-install", "tsx"]` |
|
|
392
|
+
| `brokerCommand` | `"npx"` | Advanced trusted override for the broker executable. The default value is hardened internally to launch the resolved bundled `tsx` CLI through the current Node executable instead of resolving `npx` through `PATH`. |
|
|
393
|
+
| `brokerArgs` | `["--no-install", "tsx"]` | Advanced trusted arguments passed to custom `brokerCommand` before the broker script path |
|
|
379
394
|
| `confirmSend` | false | Show a confirmation dialog before non-reply sends from an interactive session with UI |
|
|
395
|
+
| `inboundTrigger` | `"always"` | Auto-trigger policy for inbound broker messages: `"always"`, `"replies"`, or `"never"`. Local in-process subagent relay events still trigger the addressed session. |
|
|
380
396
|
| `enabled` | true | Enable/disable intercom entirely |
|
|
381
397
|
| `replyHint` | true | Include reply instruction in incoming messages |
|
|
382
398
|
| `status` | — | Optional custom status suffix shown after the automatic lifecycle status, for example `thinking · researching` |
|
|
383
399
|
|
|
384
|
-
|
|
400
|
+
If `config.json` cannot be parsed or contains an invalid value, pi-intercom logs the error and fails closed for inbound broker auto-triggering by using `inboundTrigger: "never"` until the config is fixed.
|
|
401
|
+
|
|
402
|
+
Custom broker commands are trusted local configuration: anyone who can edit this config can choose the executable used for future broker auto-spawns. For example, if you have Bun installed and want it to start the broker directly, use:
|
|
385
403
|
|
|
386
404
|
```json
|
|
387
405
|
{
|
|
@@ -390,13 +408,52 @@ For example, if you have Bun installed and want it to start the broker directly,
|
|
|
390
408
|
}
|
|
391
409
|
```
|
|
392
410
|
|
|
393
|
-
|
|
411
|
+
pi-intercom publishes live session status automatically. Sessions register as `idle`, switch to `thinking` while the agent is running, show `tool:<name>` during tool execution, and return to `idle` on agent completion. If `status` is set in config, it is appended as context instead of replacing the lifecycle status.
|
|
412
|
+
|
|
413
|
+
By default, runtime state and config live under `~/.selesai/agent/intercom`. If Selesai is launched with `SELESAI_CODING_AGENT_DIR`, pi-intercom uses `$SELESAI_CODING_AGENT_DIR/intercom` instead, including `config.json`, broker PID/lock files, sockets, and launcher state.
|
|
414
|
+
|
|
415
|
+
## Extension channels
|
|
416
|
+
|
|
417
|
+
Other Selesai extensions can use intercom's broker for bounded, non-conversational coordination. Extension-channel traffic never calls `pi.sendMessage()`, never enters a session transcript, and never starts an agent turn.
|
|
418
|
+
|
|
419
|
+
Register during `session_start` so intercom includes the capability in its deferred broker registration:
|
|
420
|
+
|
|
421
|
+
```typescript
|
|
422
|
+
import type { ExtensionAPI } from "@selesai/code";
|
|
423
|
+
import {
|
|
424
|
+
INTERCOM_EXTENSION_REGISTER_EVENT,
|
|
425
|
+
type IntercomExtensionChannel,
|
|
426
|
+
} from "pi-intercom/extension-api.ts";
|
|
427
|
+
|
|
428
|
+
export default function (pi: ExtensionAPI) {
|
|
429
|
+
let channel: IntercomExtensionChannel | undefined;
|
|
430
|
+
|
|
431
|
+
pi.on("session_start", () => {
|
|
432
|
+
pi.events.emit(INTERCOM_EXTENSION_REGISTER_EVENT, {
|
|
433
|
+
namespace: "example/v1",
|
|
434
|
+
ownerEligible: true,
|
|
435
|
+
onReady: (value: IntercomExtensionChannel) => { channel = value; },
|
|
436
|
+
onEvent: (event: unknown) => { /* owner, state, peer, or payload event */ },
|
|
437
|
+
});
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
The broker:
|
|
443
|
+
|
|
444
|
+
- advertises `extension-bus-v1` through feature negotiation
|
|
445
|
+
- routes payloads only to sessions advertising the same namespace
|
|
446
|
+
- elects one owner per namespace and changes its epoch after socket replacement
|
|
447
|
+
- rejects stale owner-only writes
|
|
448
|
+
- stores at most 64 KiB of opaque, revisioned state per namespace
|
|
449
|
+
|
|
450
|
+
`channel.publish()` accepts payloads up to 16 KiB. A `capable` broadcast includes the sender, so consumers must not blindly republish messages they receive. `channel.commitState()` uses compare-and-swap against the last observed revision. Capabilities registered after the broker connection is established are synchronized without reconnecting. Clients connected to an older broker see the channel as unsupported and do not send extension operations.
|
|
394
451
|
|
|
395
452
|
## How It Works
|
|
396
453
|
|
|
397
454
|
```mermaid
|
|
398
455
|
graph TB
|
|
399
|
-
subgraph A["
|
|
456
|
+
subgraph A["Selesai Session A"]
|
|
400
457
|
A1[Intercom Client]
|
|
401
458
|
A2[intercom tool]
|
|
402
459
|
A3[UI overlays]
|
|
@@ -407,7 +464,7 @@ graph TB
|
|
|
407
464
|
B2[Message Router]
|
|
408
465
|
end
|
|
409
466
|
|
|
410
|
-
subgraph B["
|
|
467
|
+
subgraph B["Selesai Session B"]
|
|
411
468
|
B3[Intercom Client]
|
|
412
469
|
B4[intercom tool]
|
|
413
470
|
B5[UI overlays]
|
|
@@ -420,19 +477,25 @@ graph TB
|
|
|
420
477
|
|
|
421
478
|
The broker is a standalone TypeScript process that manages session registration and message routing. It auto-spawns when the first intercom-enabled session needs it and exits after 5 seconds when the last connected session disconnects. Clients now reconnect automatically if the broker disappears and later comes back.
|
|
422
479
|
|
|
423
|
-
Messages use length-prefixed JSON over a local socket/pipe transport (4-byte length + JSON payload) to handle fragmentation properly. The protocol includes request correlation for session listing, explicit delivery failures,
|
|
480
|
+
Messages use length-prefixed JSON over a local socket/pipe transport (4-byte length + JSON payload) to handle fragmentation properly. The protocol includes request correlation for session listing, explicit delivery failures, validation for malformed or out-of-order messages, a frame-size cap, per-connection local rate limiting, and no-op presence coalescing.
|
|
481
|
+
|
|
482
|
+
Session IDs are the trusted addressing key. Duplicate names remain allowed for same-user workflows, but sends to ambiguous names fail and users should target the stable session ID shown by `list`/`status` in trust-sensitive flows. Mail queued for a disconnected session is redelivered to a session that reconnects under the same session ID, or to a session that matches both its name and its directory, so a same-named session in a different project never inherits another project's queued messages. Set `PI_INTERCOM_STABLE_ID` or `stableId` in `config.json` to pin a session's intercom ID across full process relaunches; `config.json` is machine-global, so a fixed `stableId` there applies to every session on the machine and the newest registration takes over that identity. The broker owns local trust metadata such as `trustedLocal`; `peerUid` is reserved for runtimes that can expose real peer credentials and is left unset otherwise. Client-supplied cwd/model/pid/status are display metadata, not authentication.
|
|
424
483
|
|
|
425
484
|
Async extension work (startup, inbound flushes, reconnects, overlays, and relays) no-ops if the session shuts down or reloads before it settles.
|
|
426
485
|
|
|
427
|
-
Runtime files live at `~/.
|
|
486
|
+
Runtime files live at `~/.selesai/agent/intercom/` by default, or `$SELESAI_CODING_AGENT_DIR/intercom/` when `SELESAI_CODING_AGENT_DIR` is set:
|
|
428
487
|
- `broker.sock` — Unix domain socket for communication (macOS/Linux only; Windows uses a named pipe instead)
|
|
429
488
|
- `broker-launch.vbs` — Windows helper script used to launch the broker without a console window
|
|
430
489
|
- `broker.pid` — Broker process ID
|
|
490
|
+
- `broker.spawn.lock` — Auto-spawn lock file
|
|
491
|
+
- `broker.port.json` — Dynamic localhost TCP endpoint, only when Windows TCP transport is explicitly enabled
|
|
431
492
|
- `config.json` — User configuration
|
|
432
493
|
|
|
494
|
+
Supported `config.json` keys include `stableId` for restart-stable addressing, `status` for a custom status suffix, `inboundTrigger` (`always`, `replies`, or `never`), `replyHint`, `confirmSend`, and advanced broker launch overrides.
|
|
495
|
+
|
|
433
496
|
## Design Decisions
|
|
434
497
|
|
|
435
|
-
**Local IPC instead of TCP.** Same-machine only by design. `pi-intercom` uses Unix sockets on macOS/Linux and a named pipe on Windows, which keeps setup simple and avoids port management.
|
|
498
|
+
**Local IPC instead of TCP.** Same-machine only by design. `pi-intercom` uses Unix sockets on macOS/Linux and a named pipe on Windows, which keeps setup simple and avoids port management. Windows TCP is available only as an explicit escape hatch with `PI_INTERCOM_TRANSPORT=tcp` (or `PI_INTERCOM_TCP=1`) for environments where named pipes are blocked. In that mode the broker binds a dynamic `127.0.0.1` port, records the endpoint plus a local secret under the intercom state dir, and requires that secret before health or registration succeeds. Health replies do not echo the secret, so a random localhost process cannot discover it through the broker protocol.
|
|
436
499
|
|
|
437
500
|
**Auto-spawn with file lock.** The broker starts on first connection and exits after 5 seconds idle. There is no daemon to manage. A spawn lock file, keyed by PID and timestamp, prevents duplicate brokers when multiple sessions start at once.
|
|
438
501
|
|
|
@@ -446,14 +509,14 @@ Runtime files live at `~/.pi/agent/intercom/`:
|
|
|
446
509
|
| **Primary use** | User orchestrating sessions | Autonomous agent coordination |
|
|
447
510
|
| **Discovery** | Broker-based (real-time) | File-based registry |
|
|
448
511
|
| **Messages** | Private, session-to-session | Broadcast to all agents |
|
|
449
|
-
| **Persistence** | In
|
|
512
|
+
| **Persistence** | In Selesai session history | Shared coordination files |
|
|
450
513
|
|
|
451
514
|
Use pi-messenger for multi-agent swarms working on a shared task. Use pi-intercom when you want to manually coordinate your own sessions or have one agent reach out to another specific session.
|
|
452
515
|
|
|
453
516
|
## File Structure
|
|
454
517
|
|
|
455
518
|
```
|
|
456
|
-
~/.
|
|
519
|
+
~/.selesai/agent/extensions/pi-intercom/
|
|
457
520
|
├── package.json
|
|
458
521
|
├── index.ts # Extension entry point
|
|
459
522
|
├── types.ts # SessionInfo, Message, protocol types
|
|
@@ -478,7 +541,7 @@ Use pi-messenger for multi-agent swarms working on a shared task. Use pi-interco
|
|
|
478
541
|
## Limitations
|
|
479
542
|
|
|
480
543
|
- **Same machine only** — Uses local sockets/pipes, no network support
|
|
481
|
-
- **No dedicated intercom log** — Messages are kept in
|
|
544
|
+
- **No dedicated intercom log** — Messages are kept in Selesai session history, but there is no separate intercom transcript or inbox
|
|
482
545
|
- **No attachments UI** — `file`, `snippet`, and `context` attachments are supported in the protocol, but not in the compose overlay
|
|
483
|
-
- **Only connected sessions appear** — The list shows
|
|
546
|
+
- **Only connected sessions appear** — The list shows Selesai sessions that have loaded `pi-intercom` and successfully registered with the broker, not every open Selesai process on the machine
|
|
484
547
|
- **Broker lifecycle** — The broker auto-spawns on first use and exits when idle; sessions reconnect automatically if the broker restarts
|