@selesai/code 0.8.12 → 0.9.0
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 +14 -0
- package/dist/core/agent-session.js +41 -29
- package/dist/core/resource-loader.d.ts +1 -1
- package/dist/core/resource-loader.js +2 -2
- package/dist/defaults/models.json +15 -3
- package/dist/defaults/settings.json +10 -8
- package/dist/extensions/model-prompt-injector/config.json +6 -0
- package/dist/extensions/package.json +2 -1
- package/dist/extensions/pi-subagents/README.md +4 -4
- package/dist/extensions/pi-subagents/docs/configuration.md +3 -54
- package/dist/extensions/pi-subagents/docs/extension-api.md +4 -15
- package/dist/extensions/pi-subagents/docs/missions.md +2 -39
- package/dist/extensions/pi-subagents/docs/observability.md +2 -42
- package/dist/extensions/pi-subagents/docs/tool-reference.md +1 -2
- package/dist/extensions/pi-subagents/docs/watchdog.md +0 -57
- package/dist/extensions/pi-subagents/docs/workflows.md +2 -0
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +4 -49
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +1 -1
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +1 -2
- package/dist/extensions/pi-subagents/src/extension/config.ts +3 -15
- package/dist/extensions/pi-subagents/src/extension/index.ts +1 -53
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +4 -10
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +1 -2
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +1 -12
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +1 -2
- package/dist/extensions/pi-subagents/src/policy/authority.ts +0 -2
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +33 -102
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +0 -2
- package/dist/extensions/pi-subagents/src/shared/types.ts +1 -1
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +4 -58
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +2 -8
- package/dist/extensions/pi-subagents/src/watchdog/tool-actions.ts +1 -2
- package/dist/extensions/pi-subagents/src/workflows/workflow-auto-relaunch.ts +16 -3
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +0 -95
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +0 -15
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +0 -59
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +0 -59
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +0 -47
- package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +0 -1
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +5 -5
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +0 -8
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +2 -2
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +4 -4
- package/dist/extensions/pi-subagents/test/unit/workflow-auto-relaunch.test.ts +21 -1
- package/dist/modes/interactive/components/model-selector.d.ts +10 -1
- package/dist/modes/interactive/components/model-selector.js +10 -6
- package/dist/modes/interactive/components/settings-selector.d.ts +2 -0
- package/dist/modes/interactive/components/settings-selector.js +3 -0
- package/dist/modes/interactive/interactive-mode.js +7 -0
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +1 -1
- package/dist/skills/pi-subagents/references/execution-controls.md +2 -32
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +1 -1
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +3 -3
- package/docs/custom-provider.md +1 -0
- package/package.json +3 -3
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +0 -803
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +0 -691
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +0 -1314
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/cli.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/register-bedrock.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/bun/restore-sandbox-env.d.ts +0 -17
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/args.d.ts +0 -57
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/config-selector.d.ts +0 -16
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/file-processor.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/initial-message.d.ts +0 -18
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/list-models.d.ts +0 -9
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/project-trust.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/session-picker.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli/startup-ui.d.ts +0 -20
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/cli.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/config.d.ts +0 -96
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-runtime.d.ts +0 -119
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session-services.d.ts +0 -85
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/agent-session.d.ts +0 -620
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-guidance.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/auth-storage.d.ts +0 -56
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/bash-executor.d.ts +0 -32
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/cache-stats.d.ts +0 -49
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/branch-summarization.d.ts +0 -93
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/compaction.d.ts +0 -128
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/index.d.ts +0 -7
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/compaction/utils.d.ts +0 -38
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/defaults.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/diagnostics.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/event-bus.d.ts +0 -9
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/exec.d.ts +0 -29
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/experimental.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/ansi-to-html.d.ts +0 -22
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/index.d.ts +0 -37
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/export-html/tool-renderer.d.ts +0 -34
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/index.d.ts +0 -12
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/loader.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/runner.d.ts +0 -171
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/types.d.ts +0 -1263
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/extensions/wrapper.d.ts +0 -20
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/footer-data-provider.d.ts +0 -54
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/http-dispatcher.d.ts +0 -22
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/index.d.ts +0 -13
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/keybindings.d.ts +0 -358
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/messages.d.ts +0 -77
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-config.d.ts +0 -512
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-registry.d.ts +0 -43
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-resolver.d.ts +0 -121
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/model-runtime.d.ts +0 -82
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/models-store.d.ts +0 -17
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/output-guard.d.ts +0 -7
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/package-manager.d.ts +0 -210
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/project-trust.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/prompt-templates.d.ts +0 -54
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-attribution.d.ts +0 -4
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/provider-composer.d.ts +0 -55
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/radius.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/remote-catalog-provider.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resolve-config-value.d.ts +0 -30
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/resource-loader.d.ts +0 -206
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/runtime-credentials.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/sdk.d.ts +0 -106
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-cwd.d.ts +0 -19
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/session-manager.d.ts +0 -356
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/settings-manager.d.ts +0 -297
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/skills.d.ts +0 -60
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/slash-commands.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/source-info.d.ts +0 -18
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/system-prompt.d.ts +0 -28
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/telemetry.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/timings.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/bash.d.ts +0 -68
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit-diff.d.ts +0 -106
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/edit.d.ts +0 -51
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/file-mutation-queue.d.ts +0 -6
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/find.d.ts +0 -35
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/grep.d.ts +0 -37
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/index.d.ts +0 -40
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/ls.d.ts +0 -37
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/output-accumulator.d.ts +0 -52
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/path-utils.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/read.d.ts +0 -35
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/render-utils.d.ts +0 -24
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/tool-definition-wrapper.d.ts +0 -14
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/truncate.d.ts +0 -70
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/tools/write.d.ts +0 -26
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/trust-manager.d.ts +0 -36
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/core/usage-totals.d.ts +0 -19
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/index.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/client.d.ts +0 -61
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/huggingface.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/index.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/provider.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/extensions/llama/ui.d.ts +0 -42
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/index.d.ts +0 -35
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/main.d.ts +0 -12
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/migrations.d.ts +0 -33
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/index.d.ts +0 -9
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/armin.d.ts +0 -34
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/assistant-message.d.ts +0 -22
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bash-execution.d.ts +0 -34
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/bordered-loader.d.ts +0 -16
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/branch-summary-message.d.ts +0 -16
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -16
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/config-selector.d.ts +0 -102
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/countdown-timer.d.ts +0 -14
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-editor.d.ts +0 -21
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-entry.d.ts +0 -19
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/custom-message.d.ts +0 -20
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/daxnuts.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/diff.d.ts +0 -12
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/dynamic-border.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/earendil-announcement.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-editor.d.ts +0 -22
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-input.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/extension-selector.d.ts +0 -26
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/first-time-setup.d.ts +0 -25
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/footer.d.ts +0 -32
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/index.d.ts +0 -34
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/keybinding-hints.d.ts +0 -13
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/login-dialog.d.ts +0 -52
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/model-selector.d.ts +0 -54
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/oauth-selector.d.ts +0 -33
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -42
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector-search.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/session-selector.d.ts +0 -95
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/settings-selector.d.ts +0 -77
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/show-images-selector.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -17
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/status-indicator.d.ts +0 -28
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/theme-selector.d.ts +0 -11
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/thinking-selector.d.ts +0 -11
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tool-execution.d.ts +0 -63
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/tree-selector.d.ts +0 -94
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/trust-selector.d.ts +0 -23
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message-selector.d.ts +0 -30
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/user-message.d.ts +0 -14
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/components/visual-truncate.d.ts +0 -24
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/interactive-mode.d.ts +0 -394
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/model-search.d.ts +0 -12
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme-controller.d.ts +0 -29
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/interactive/theme/theme.d.ts +0 -120
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/print-mode.d.ts +0 -28
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/jsonl.d.ts +0 -17
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-client.d.ts +0 -246
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-mode.d.ts +0 -20
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/modes/rpc/rpc-types.d.ts +0 -457
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/package-manager-cli.d.ts +0 -8
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/rpc-entry.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/ansi.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/changelog.d.ts +0 -22
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/child-process.d.ts +0 -18
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-image.d.ts +0 -11
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard-native.d.ts +0 -11
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/clipboard.d.ts +0 -4
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/deprecation.d.ts +0 -4
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/exif-orientation.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/frontmatter.d.ts +0 -8
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/fs-watch.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/git.d.ts +0 -26
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/html.d.ts +0 -7
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-convert.d.ts +0 -10
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-process.d.ts +0 -18
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-core.d.ts +0 -30
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize-worker.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/image-resize.d.ts +0 -16
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/json.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/mime.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/open-browser.d.ts +0 -9
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/paths.d.ts +0 -31
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/photon.d.ts +0 -21
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/pi-user-agent.d.ts +0 -2
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/shell.d.ts +0 -31
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/sleep.d.ts +0 -5
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/syntax-highlight.d.ts +0 -12
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/tools-manager.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/version-check.d.ts +0 -15
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/dist/utils/windows-self-update.d.ts +0 -3
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +0 -1004
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +0 -1511
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +0 -634
- package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +0 -67
|
@@ -186,9 +186,7 @@ const run = subagent({
|
|
|
186
186
|
// Continue local inspection, then later call status with the returned id.
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
Inspect async runs with `subagent({ action: "status", id: "..." })` or `subagent({ action: "status" })` for active runs. Use `subagent({ action: "status", view: "fleet" })` when supervising several active foreground/background runs and `subagent({ action: "status", id: "...", view: "transcript", index: 0 })` when you need the latest child output without digging through artifacts. If a delegated fanout child launches nested runs, the parent status view shows them as a tree and you can target a nested run directly with its nested id.
|
|
189
|
+
Inspect async runs with `subagent({ action: "status", id: "..." })` or `subagent({ action: "status" })` for active runs. Use `subagent({ action: "status", id: "...", view: "transcript", index: 0 })` when you need the latest child output without digging through artifacts. Use `steer` to send guidance to a running child and `stop` to terminate a current-session top-level async run. If a delegated fanout child launches nested runs, the parent status view shows them as a tree and you can target a nested run directly with its nested id.
|
|
192
190
|
|
|
193
191
|
Stop a current-session top-level async run with `stop` (or `/subagents-stop`). Stopped runs finish as `stopped`/cancelled and are not resumable. For an active foreground single-subagent run, `/subagents-detach [run-id]` leaves the child running without terminating it and returns the eventual result through status/wait. Append one more step to the tail of a still-running durable chain with `append-step` (`step` must contain exactly one step object). Use checkpoint steps for planned human gates; they pause without launching a child and are approved or rejected through current-session control actions:
|
|
194
192
|
|
|
@@ -236,31 +234,6 @@ Use native `subagent` runs for unattended implementation, review, and gate work
|
|
|
236
234
|
|
|
237
235
|
A cooperating terminal runtime can register read-only external records through `pi-subagents/external-runs`. Records include the source, session, state, optional report path, and completion reason. They are observations only: pi-subagents does not start, stop, steer, or otherwise own the foreign process. Run unattended raw terminal agents in an explicit isolated cwd or worktree; do not use a live project checkout as disposable review space.
|
|
238
236
|
|
|
239
|
-
### Scheduled subagent runs
|
|
240
|
-
|
|
241
|
-
Schedules are durable project records under `.pi-subagents/schedules/`. They are enabled by default; set `{ "scheduledRuns": { "enabled": false } }` in `~/.selesai/agent/extensions/subagent/config.json` to disable them. Only schedule explicit work the user asked for.
|
|
242
|
-
|
|
243
|
-
```typescript
|
|
244
|
-
// One-shot reviewer
|
|
245
|
-
subagent({ action: "schedule.create", id: "evening-review", name: "Evening review", at: "+30m", workflowScript: "return runs.run('main', { agent: 'reviewer', task: 'Review the diff.' })" })
|
|
246
|
-
|
|
247
|
-
// Fixed recurring workflow
|
|
248
|
-
subagent({ action: "schedule.create", id: "backlog", every: "6h", catchUp: "latest", workflowScript: "..." })
|
|
249
|
-
|
|
250
|
-
subagent({ action: "schedule.list" })
|
|
251
|
-
subagent({ action: "schedule.show", id: "backlog" })
|
|
252
|
-
subagent({ action: "schedule.history", id: "backlog" })
|
|
253
|
-
subagent({ action: "schedule.pause", id: "backlog" })
|
|
254
|
-
subagent({ action: "schedule.resume", id: "backlog" })
|
|
255
|
-
subagent({ action: "schedule.run", id: "backlog" })
|
|
256
|
-
subagent({ action: "schedule.run-due" })
|
|
257
|
-
subagent({ action: "schedule.delete", id: "backlog" })
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
`schedule.create` accepts exactly one target, `workflowScript`, and exactly one trigger (`at`, or a fixed `every` interval using `m`, `h`, `d`, or `w`). Runs always launch async with fresh context and no automatic mission; mission attachment is deferred from this first slice. `overlap` is currently `skip`; `catchUp` supports `latest` and `none`. `schedule.run-due` is the headless external-launcher seam. Calendar recurrence, cron, and the schedule inspector are deferred from this first safe slice. Definitions, bounded history, append-only events, and per-run receipts remain project-scoped across Selesai sessions.
|
|
261
|
-
|
|
262
|
-
Humans can use `/subagents-doctor` for the same read-only report. It checks runtime paths, discovery counts, async support, current session context, and intercom bridge state.
|
|
263
|
-
|
|
264
237
|
### Subagent control
|
|
265
238
|
|
|
266
239
|
Subagent control is the runtime visibility and intervention layer for delegated runs. It is separate from lifecycle status. Lifecycle status says whether a child is `queued`, `running`, `paused`, `complete`, `stopped`, `failed`, or `rejected`. Activity reporting is factual: it tracks the last observed activity time and the current tool when known. It does not pretend to know that a child is truly stuck. Manual top-level async cancellation uses `stop` / `/subagents-stop`; a live async chain can gain one more tail step via `append-step`, and a paused async chain checkpoint can be decided with `approve-checkpoint` or `reject-checkpoint`.
|
|
@@ -325,27 +298,9 @@ and can optionally run non-blocking Scopey-style cadence reviews every N tool re
|
|
|
325
298
|
are always transcript-visible; choose the watchdog model that matches the desired
|
|
326
299
|
cheap-monitor vs strong-reviewer policy.
|
|
327
300
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
```text
|
|
332
|
-
/subagents-watchdog recommend-model
|
|
333
|
-
/subagents-watchdog session model recommended
|
|
334
|
-
/subagents-watchdog on
|
|
335
|
-
/subagents-watchdog status
|
|
336
|
-
/subagents-watchdog check
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
```typescript
|
|
340
|
-
subagent({ action: "watchdog.status" })
|
|
341
|
-
subagent({ action: "watchdog.recommend-model" })
|
|
342
|
-
subagent({ action: "watchdog.configure", model: "recommended", scope: "session" })
|
|
343
|
-
subagent({ action: "watchdog.check" })
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
`session` scope is temporary. Persistent `user`/`project` scopes write settings only
|
|
347
|
-
when the user asked. Use ordinary fresh-context `reviewer` fanout for planned review
|
|
348
|
-
waves; enable the watchdog when you want an automatic second pass on real edits.
|
|
301
|
+
Enable the watchdog with `/subagents-watchdog on`; inspect it with `status` or `check`.
|
|
302
|
+
Use ordinary fresh-context `reviewer` fanout for planned review waves; enable the
|
|
303
|
+
watchdog when you want an automatic second pass on real edits.
|
|
349
304
|
|
|
350
305
|
## Clarify TUI
|
|
351
306
|
|
package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md
CHANGED
|
@@ -161,4 +161,4 @@ Native chain and parallel steps are also launchable directly from the command li
|
|
|
161
161
|
|
|
162
162
|
Other Selesai extensions can call `pi-subagents` through the in-process event bus. The RPC channels are `subagents:rpc:v1:ready`, `subagents:rpc:v1:request`, and per-request replies at `subagents:rpc:v1:reply:<requestId>`. Envelopes use `{ version: 1, requestId, method, params }`, and replies use `{ version: 1, requestId, success, data | error }`. `ping` advertises the exact process-local async completion event as `events.asyncComplete` for RPC-spawn consumers.
|
|
163
163
|
|
|
164
|
-
Methods: `ping`, `status`, `spawn`, `steer`, `interrupt`, `resume`, and `stop`. `ping` capability metadata advertises optional projections: `capabilities.
|
|
164
|
+
Methods: `ping`, `status`, `spawn`, `steer`, `interrupt`, `resume`, and `stop`. `ping` capability metadata advertises optional projections: `capabilities.launchResolvedExtensions` advertises parent-resolved opaque launch-extension identifiers in status details; `capabilities.runtimeAcknowledgedExtensions` advertises the best-effort child-runtime acknowledgement projection fed by cooperating extensions emitting `subagent:acknowledge-extension`. Foreground `details.results[]` rows carry a stable numeric `index`; correlate children by `(runId, index)` rather than row position. Consumers should read status/result artifacts and RPC projections instead of scraping terminal output and must ignore unknown fields. `spawn` requires `workflowScript`, is async-only, and rejects management actions, `async: false`, or `clarify: true`; it reuses the normal executor, so discovery, validation, session attribution, configured spawn caps, child-safety depth, artifacts, and async status are shared with the `subagent` tool. `status`, acknowledged async `steer`, and `interrupt` map to the normal control actions. RPC steer disables pause-and-revive recovery and advertises `capabilities.nonRecoveringSteer`, preserving the caller's authority over the exact spawned child. `resume` requires a target plus non-empty message and delegates to the package-owned revival path; it may set a caller-owned `file-only` output path but cannot override the persisted child model, tools, budgets, session ownership, or exclusive session lease. For retained-child workflows, list children first and resume only rows reported `resumable`; otherwise start a same-role fallback challenge and label it as fallback. `stop` targets running async runs through the existing timeout control channel. `pi.events` is process-local, so separate Selesai processes and child subagents need lifecycle artifact files or `pi-intercom` instead.
|
|
@@ -31,8 +31,7 @@ Agents use the `subagent(...)` tool directly for execution, management, status,
|
|
|
31
31
|
- `/subagents-stop [run-id]` — stop a current-session top-level async run; opens a selector when no id is given
|
|
32
32
|
- `/subagents-detach [run-id]` — detach an active foreground single-subagent run without terminating its child
|
|
33
33
|
- `/subagent-cost` — show parent plus child token usage and cost for the session
|
|
34
|
-
- `/subagents-
|
|
35
|
-
- `/subagents-watchdog` — inspect or configure the opt-in adversarial change watchdog (model, on/off, recommend-model, check)
|
|
34
|
+
- `/subagents-watchdog` — inspect or configure the opt-in adversarial change watchdog (on/off, model, check)
|
|
36
35
|
- `/subagents-doctor` — diagnose setup, discovery, async paths, and intercom bridge state
|
|
37
36
|
- `/subagents-models [agent]` — show the live runtime-loaded builtin model mapping
|
|
38
37
|
- `/subagents-profiles`, `/subagents-load-profile`, `/subagents-refresh-provider-models`, `/subagents-generate-profiles`, `/subagents-check-profile` — manage model profiles and provider catalogs
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
|
-
import * as os from "node:os";
|
|
3
2
|
import * as path from "node:path";
|
|
4
3
|
import { Key } from "@earendil-works/pi-tui";
|
|
5
4
|
import { FLEET_KEYBINDING_ACTIONS, type ArtifactDirPreference, type ExtensionConfig } from "../shared/types.ts";
|
|
@@ -26,19 +25,8 @@ function isValidKeyId(value: string): boolean {
|
|
|
26
25
|
&& parts.every((modifier) => KEY_MODIFIERS.has(modifier));
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (!path.isAbsolute(expanded)) throw new Error(`config.scheduledRuns.storeRoot must be an absolute path or "~/...", got ${JSON.stringify(value)}`);
|
|
32
|
-
return path.normalize(expanded);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function validateScheduledRunsConfig(value: unknown): void {
|
|
36
|
-
if (value === undefined) return;
|
|
37
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("config.scheduledRuns must be a JSON object");
|
|
38
|
-
const storeRoot = (value as Record<string, unknown>).storeRoot;
|
|
39
|
-
if (storeRoot === undefined) return;
|
|
40
|
-
if (typeof storeRoot !== "string" || !storeRoot.trim()) throw new Error("config.scheduledRuns.storeRoot must be a non-empty string");
|
|
41
|
-
resolveScheduledStoreRoot(storeRoot);
|
|
28
|
+
function validateRemovedScheduledRunsConfig(value: unknown): void {
|
|
29
|
+
if (value !== undefined) throw new Error("config.scheduledRuns is no longer supported");
|
|
42
30
|
}
|
|
43
31
|
|
|
44
32
|
function validateFleetKeybindingsConfig(value: unknown): void {
|
|
@@ -119,7 +107,7 @@ function validateConfig(config: Record<string, unknown>): void {
|
|
|
119
107
|
validateMissionStoreConfig(config.missions);
|
|
120
108
|
validateAuthorityPolicy(config.authorityPolicy);
|
|
121
109
|
validatePermissionConfig(config.permissions);
|
|
122
|
-
|
|
110
|
+
validateRemovedScheduledRunsConfig(config.scheduledRuns);
|
|
123
111
|
validateFleetKeybindingsConfig(config.fleetKeybindings);
|
|
124
112
|
validateArtifactConfig(config.artifactConfig);
|
|
125
113
|
validateMainWindowRendererConfig(config.mainWindowRenderer);
|
|
@@ -27,8 +27,6 @@ import { resolveCurrentSessionId } from "../shared/session-identity.ts";
|
|
|
27
27
|
import { resolveSessionLineage } from "../shared/session-lineage.ts";
|
|
28
28
|
import { cleanupOldChainDirs } from "../shared/settings.ts";
|
|
29
29
|
import { clearLegacyResultAnimationTimer, renderSubagentResult, renderSubagentSummary } from "../tui/render.ts";
|
|
30
|
-
import { openSubagentFleet } from "../tui/fleet.ts";
|
|
31
|
-
import { SubagentFleetStatus, resolveFleetViewPlacement } from "../tui/fleet-status.ts";
|
|
32
30
|
import { createSubagentParamsSchema } from "./schemas.ts";
|
|
33
31
|
import { validateChainInput } from "./chain-validation.ts";
|
|
34
32
|
import { createSubagentExecutor, type SubagentParamsLike } from "../runs/foreground/subagent-executor.ts";
|
|
@@ -36,10 +34,8 @@ import { createAsyncJobTracker } from "../runs/background/async-job-tracker.ts";
|
|
|
36
34
|
import { getActiveAsyncCapacitySnapshot, resolveMaxActiveAsyncRunsPerSession } from "../runs/background/active-async-capacity.ts";
|
|
37
35
|
import { cleanupResultIndexes } from "../runs/background/result-files.ts";
|
|
38
36
|
import { createResultWatcher } from "../runs/background/result-watcher.ts";
|
|
39
|
-
import { createScheduledRunManager } from "../runs/background/scheduled-runs.ts";
|
|
40
37
|
import { registerSlashCommands } from "../slash/slash-commands.ts";
|
|
41
38
|
import { registerPromptTemplateDelegationBridge } from "../slash/prompt-template-bridge.ts";
|
|
42
|
-
import { registerMainWatchdog } from "../watchdog/register-main.ts";
|
|
43
39
|
import { registerSlashSubagentBridge } from "../slash/slash-bridge.ts";
|
|
44
40
|
import { createNativeSupervisorChannel } from "../intercom/native-supervisor-channel.ts";
|
|
45
41
|
import { registerHerdrStatusBridge, type HerdrStatusRun } from "../integrations/herdr-status.ts";
|
|
@@ -55,7 +51,7 @@ import { formatSteeringNotice, handleSubagentSteeringNotice, SUBAGENT_STEERING_M
|
|
|
55
51
|
import { SUBAGENT_CHILD_ENV, SUBAGENT_PARENT_SESSION_ENV } from "../runs/shared/pi-args.ts";
|
|
56
52
|
import { resolveCurrentSubagentCapabilityCeiling } from "../runs/shared/capability-ceiling.ts";
|
|
57
53
|
import { formatDuration, shortenPath } from "../shared/formatters.ts";
|
|
58
|
-
import { loadConfig, resolveAsyncByDefault
|
|
54
|
+
import { loadConfig, resolveAsyncByDefault } from "./config.ts";
|
|
59
55
|
import { buildSubagentToolDescription } from "./tool-description.ts";
|
|
60
56
|
import { collectGoalContinuationNotices } from "../missions/goal-driver.ts";
|
|
61
57
|
import { restoreForegroundRunHistory } from "../runs/foreground/foreground-history.ts";
|
|
@@ -383,8 +379,6 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
383
379
|
const config = loadConfig();
|
|
384
380
|
const waitToolConfig = resolveWaitToolConfig(config.waitTool);
|
|
385
381
|
const asyncByDefault = resolveAsyncByDefault(config);
|
|
386
|
-
const fleetViewEnabled = config.fleetView !== false;
|
|
387
|
-
const fleetViewPlacement = resolveFleetViewPlacement(config.fleetViewPlacement);
|
|
388
382
|
const asyncWidgetEnabled = config.asyncWidget !== false;
|
|
389
383
|
const summaryInlineToolDisplay = config.inlineToolDisplay === "summary";
|
|
390
384
|
const tempArtifactsDir = getArtifactsDir(null);
|
|
@@ -442,33 +436,8 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
442
436
|
|
|
443
437
|
const supervisorChannel = createNativeSupervisorChannel(pi, state);
|
|
444
438
|
const waitSubscriptionManager = createWaitSubscriptionManager(pi, state);
|
|
445
|
-
const mainWatchdog = registerMainWatchdog(pi);
|
|
446
439
|
const completionNotifier = registerSubagentNotify(pi, state, { batchConfig: config.completionBatch });
|
|
447
|
-
const fleetStatus = fleetViewEnabled
|
|
448
|
-
? new SubagentFleetStatus(state, async (itemKey) => {
|
|
449
|
-
const ctx = state.lastUiContext;
|
|
450
|
-
if (!ctx?.hasUI) return;
|
|
451
|
-
await openSubagentFleet(ctx, state, { initialKey: itemKey, asyncDirRoot: DIRS.async, resultsDir: DIRS.results, fleetKeybindings: config.fleetKeybindings });
|
|
452
|
-
}, { placement: fleetViewPlacement })
|
|
453
|
-
: undefined;
|
|
454
|
-
let executorScheduled: ((id: string, params: SubagentParamsLike, signal: AbortSignal, ctx: ExtensionContext) => Promise<AgentToolResult<Details>>) | undefined;
|
|
455
440
|
let goalTurnId = 0;
|
|
456
|
-
const scheduledStoreRoot = config.scheduledRuns?.storeRoot === undefined ? undefined : resolveScheduledStoreRoot(config.scheduledRuns.storeRoot);
|
|
457
|
-
const scheduledRunManager = createScheduledRunManager({
|
|
458
|
-
config,
|
|
459
|
-
storeRoot: scheduledStoreRoot,
|
|
460
|
-
launch: (params, ctx, signal) => {
|
|
461
|
-
if (!executorScheduled) {
|
|
462
|
-
return Promise.resolve({
|
|
463
|
-
content: [{ type: "text", text: "Scheduled subagent launch is unavailable (executor not ready)." }],
|
|
464
|
-
isError: true,
|
|
465
|
-
details: { mode: "management" as const, results: [] },
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
return executorScheduled(randomUUID(), params, signal, ctx);
|
|
469
|
-
},
|
|
470
|
-
resolveCapabilityCeiling: (sessionId) => resolveCurrentSubagentCapabilityCeiling(sessionId),
|
|
471
|
-
});
|
|
472
441
|
const { ensurePoller, refreshWidget, handleStarted, handleComplete, resetJobs, restoreActiveJobs, dispose: disposeAsyncJobTracker } = createAsyncJobTracker(pi, state, DIRS.async, {
|
|
473
442
|
widgetEnabled: asyncWidgetEnabled,
|
|
474
443
|
});
|
|
@@ -479,8 +448,6 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
479
448
|
10 * 60 * 1000,
|
|
480
449
|
{
|
|
481
450
|
notifier: completionNotifier,
|
|
482
|
-
observeCompletion: (result) => scheduledRunManager.handleAsyncCompletion(result),
|
|
483
|
-
observedCompletionRunIds: () => scheduledRunManager.observedCompletionRunIds(),
|
|
484
451
|
deliverIntercomResults: config.intercomBridge?.resultDelivery === true,
|
|
485
452
|
},
|
|
486
453
|
);
|
|
@@ -490,11 +457,8 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
490
457
|
stopResultWatcher();
|
|
491
458
|
state.currentSessionId = null;
|
|
492
459
|
completionNotifier.dispose();
|
|
493
|
-
mainWatchdog.dispose();
|
|
494
|
-
scheduledRunManager.stop();
|
|
495
460
|
supervisorChannel.dispose();
|
|
496
461
|
waitSubscriptionManager.dispose();
|
|
497
|
-
fleetStatus?.dispose();
|
|
498
462
|
disposeAsyncJobTracker();
|
|
499
463
|
};
|
|
500
464
|
globalStore[runtimeCleanupStoreKey] = runtimeCleanup;
|
|
@@ -505,14 +469,11 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
505
469
|
config,
|
|
506
470
|
asyncByDefault,
|
|
507
471
|
waitToolEnabled: waitToolConfig.enabled,
|
|
508
|
-
handleScheduledRunAction: (params, ctx) => scheduledRunManager.handleToolCall(params, ctx),
|
|
509
|
-
watchdog: mainWatchdog,
|
|
510
472
|
tempArtifactsDir,
|
|
511
473
|
getSubagentSessionRoot,
|
|
512
474
|
expandTilde,
|
|
513
475
|
discoverAgents,
|
|
514
476
|
});
|
|
515
|
-
executorScheduled = executor.executeScheduled;
|
|
516
477
|
|
|
517
478
|
pi.registerMessageRenderer<SlashMessageDetails>(SLASH_RESULT_TYPE, (message, options, theme) => {
|
|
518
479
|
const details = resolveSlashMessageDetails(message.details);
|
|
@@ -737,20 +698,16 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
737
698
|
};
|
|
738
699
|
const asyncStartedHandler = (payload: unknown) => {
|
|
739
700
|
handleStarted(payload);
|
|
740
|
-
fleetStatus?.refresh();
|
|
741
701
|
};
|
|
742
702
|
const asyncCompleteHandler = (payload: unknown) => {
|
|
743
703
|
handleComplete(payload);
|
|
744
704
|
refreshActiveAsyncCapacity();
|
|
745
|
-
scheduledRunManager.handleAsyncCompletion(payload);
|
|
746
|
-
fleetStatus?.refresh();
|
|
747
705
|
};
|
|
748
706
|
const eventUnsubscribes = [
|
|
749
707
|
pi.events.on(SUBAGENT_ASYNC_STARTED_EVENT, asyncStartedHandler),
|
|
750
708
|
pi.events.on(SUBAGENT_ASYNC_COMPLETE_EVENT, asyncCompleteHandler),
|
|
751
709
|
pi.events.on(SUBAGENT_PROCESS_TERMINAL_EVENT, () => {
|
|
752
710
|
refreshActiveAsyncCapacity();
|
|
753
|
-
fleetStatus?.refresh();
|
|
754
711
|
}),
|
|
755
712
|
pi.events.on(SUBAGENT_CONTROL_EVENT, controlEventHandler),
|
|
756
713
|
pi.events.on(SUBAGENT_STEERING_NOTICE_EVENT, steeringNoticeHandler),
|
|
@@ -764,8 +721,6 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
764
721
|
if (!ctx.hasUI) return;
|
|
765
722
|
state.lastUiContext = ctx;
|
|
766
723
|
restoreActiveJobs(ctx);
|
|
767
|
-
fleetStatus?.setContext(ctx);
|
|
768
|
-
fleetStatus?.refresh();
|
|
769
724
|
if (state.asyncJobs.size > 0) {
|
|
770
725
|
refreshWidget(ctx);
|
|
771
726
|
ensurePoller();
|
|
@@ -787,14 +742,12 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
787
742
|
if (state.widgetsSuspended) return;
|
|
788
743
|
state.widgetsSuspended = true;
|
|
789
744
|
if (state.lastUiContext?.hasUI) state.lastUiContext.ui.setWidget(WIDGET_KEY, undefined);
|
|
790
|
-
fleetStatus?.refresh();
|
|
791
745
|
};
|
|
792
746
|
const resumeWidgetsAfterCompaction = () => {
|
|
793
747
|
if (!state.widgetsSuspended) return;
|
|
794
748
|
state.widgetsSuspended = false;
|
|
795
749
|
const ctx = state.lastUiContext;
|
|
796
750
|
if (ctx?.hasUI) refreshWidget(ctx);
|
|
797
|
-
fleetStatus?.refresh();
|
|
798
751
|
};
|
|
799
752
|
|
|
800
753
|
const refreshActiveAsyncCapacity = () => {
|
|
@@ -890,8 +843,6 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
890
843
|
logSlowPhase("active-job-restore", phaseStartedAt);
|
|
891
844
|
state.handoffResumePending = adoptedJobs > 0 && state.lastUiContext?.hasUI === true;
|
|
892
845
|
phaseStartedAt = Date.now();
|
|
893
|
-
scheduledRunManager.bindSession(ctx);
|
|
894
|
-
logSlowPhase("scheduled-runs", phaseStartedAt);
|
|
895
846
|
phaseStartedAt = Date.now();
|
|
896
847
|
restoreSlashFinalSnapshots(ctx.sessionManager.getEntries());
|
|
897
848
|
logSlowPhase("slash-snapshots", phaseStartedAt);
|
|
@@ -904,7 +855,6 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
904
855
|
phaseStartedAt = Date.now();
|
|
905
856
|
primeExistingResults({ triggerTurn: !recovering });
|
|
906
857
|
logSlowPhase("result-prime", phaseStartedAt);
|
|
907
|
-
fleetStatus?.setContext(ctx);
|
|
908
858
|
};
|
|
909
859
|
|
|
910
860
|
pi.on("agent_start", () => {
|
|
@@ -977,7 +927,6 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
977
927
|
if (globalStore[eventUnsubscribeStoreKey] === eventUnsubscribes) {
|
|
978
928
|
delete globalStore[eventUnsubscribeStoreKey];
|
|
979
929
|
}
|
|
980
|
-
scheduledRunManager.stop();
|
|
981
930
|
disposeAsyncJobTracker();
|
|
982
931
|
for (const timer of state.cleanupTimers.values()) {
|
|
983
932
|
clearTimeout(timer);
|
|
@@ -990,7 +939,6 @@ export default function registerSubagentExtension(pi: ExtensionAPI): void {
|
|
|
990
939
|
promptTemplateBridge.cancelAll();
|
|
991
940
|
promptTemplateBridge.dispose();
|
|
992
941
|
supervisorChannel.dispose();
|
|
993
|
-
fleetStatus?.dispose();
|
|
994
942
|
if (globalStore[runtimeCleanupStoreKey] === runtimeCleanup) {
|
|
995
943
|
delete globalStore[runtimeCleanupStoreKey];
|
|
996
944
|
}
|
|
@@ -37,6 +37,9 @@ export function normalizePublicSubagentExecution<T extends PublicSubagentExecuti
|
|
|
37
37
|
return { ok: false, error: "action must be a non-empty management/control action, or omit action and use workflowScript.", mode: "management" };
|
|
38
38
|
}
|
|
39
39
|
const normalizedAction = typeof action === "string" ? action.trim() : undefined;
|
|
40
|
+
if (normalizedAction?.toLowerCase().startsWith("schedule.") || normalizedAction === "watchdog.configure" || normalizedAction === "watchdog.recommend-model") {
|
|
41
|
+
return { ok: false, error: `Removed action '${normalizedAction}' is no longer supported.`, mode: "management" };
|
|
42
|
+
}
|
|
40
43
|
if (params.clarify === true && params.workflowScript !== undefined) {
|
|
41
44
|
return { ok: false, error: "Public workflowScript execution does not support clarify UI.", mode: "workflow" };
|
|
42
45
|
}
|
|
@@ -48,17 +51,8 @@ export function normalizePublicSubagentExecution<T extends PublicSubagentExecuti
|
|
|
48
51
|
if (legacyAction === "single" || legacyAction === "parallel" || legacyAction === "tasks" || legacyAction === "chain") {
|
|
49
52
|
return { ok: false, error: `action '${normalizedAction}' is not a management action; use the direct execution fields ({ agent, task }, { chain: [...] }, { tasks: [...] }).`, mode: "workflow" };
|
|
50
53
|
}
|
|
51
|
-
if (normalizedAction === "schedule.create") {
|
|
52
|
-
if (typeof params.workflowScript === "string" && params.workflowScript.trim()) {
|
|
53
|
-
return { ok: true, params: { ...params, action: normalizedAction } };
|
|
54
|
-
}
|
|
55
|
-
if (params.agent === undefined && params.task === undefined && params.step === undefined && params.tasks === undefined && params.chain === undefined) {
|
|
56
|
-
return { ok: false, error: "schedule.create requires a non-empty workflowScript or direct execution fields (agent, task, tasks, or chain).", mode: "management" };
|
|
57
|
-
}
|
|
58
|
-
return { ok: true, params: { ...params, action: normalizedAction } };
|
|
59
|
-
}
|
|
60
54
|
if (params.workflowScript !== undefined) {
|
|
61
|
-
return { ok: false, error: "workflowScript execution must omit action;
|
|
55
|
+
return { ok: false, error: "workflowScript execution must omit action; use management actions without workflowScript.", mode: "management" };
|
|
62
56
|
}
|
|
63
57
|
if (params.task !== undefined) {
|
|
64
58
|
return { ok: false, error: "Structured single-child task cannot be combined with a management/control action.", mode: "management" };
|
|
@@ -284,7 +284,7 @@ interface RegisterSubagentRpcBridgeOptions {
|
|
|
284
284
|
resultsDir?: string;
|
|
285
285
|
kill?: (pid: number, signal?: NodeJS.Signals | 0) => boolean;
|
|
286
286
|
now?: () => number;
|
|
287
|
-
/** Native live state
|
|
287
|
+
/** Native live state for status consumers. */
|
|
288
288
|
state?: SubagentState;
|
|
289
289
|
}
|
|
290
290
|
|
|
@@ -381,7 +381,6 @@ function pingData(ctx: ExtensionContext | null) {
|
|
|
381
381
|
methods: [...SUBAGENT_RPC_METHODS],
|
|
382
382
|
capabilities: {
|
|
383
383
|
status: true,
|
|
384
|
-
fleetStatus: { version: 1 },
|
|
385
384
|
asyncStatusSnapshot: { kind: ASYNC_STATUS_SNAPSHOT_KIND, version: ASYNC_STATUS_SNAPSHOT_VERSION },
|
|
386
385
|
asyncSpawn: true,
|
|
387
386
|
steer: true,
|
|
@@ -262,7 +262,6 @@ const SubagentParamProperties = {
|
|
|
262
262
|
action: Type.Optional(Type.String({ minLength: 1,
|
|
263
263
|
description: "Optional management/control action. Omit this field for structured single-child or workflowScript execution; use it only for management/control actions."
|
|
264
264
|
})),
|
|
265
|
-
name: Type.Optional(Type.String({ description: "Human-readable name for action='schedule.create'." })),
|
|
266
265
|
id: Type.Optional(Type.String({
|
|
267
266
|
description: "Run id/prefix for status/debug.run, interrupt, steer, append-step, approve-checkpoint, reject-checkpoint, or mission."
|
|
268
267
|
})),
|
|
@@ -284,18 +283,8 @@ const SubagentParamProperties = {
|
|
|
284
283
|
mode: Type.Optional(Type.String({ enum: ["steer", "follow_up", "auto"], description: "Delivery mode for action='steer': steer interrupts at the next safe point (default), follow_up waits for the next turn boundary, auto follows up mid-turn." })),
|
|
285
284
|
steeringRecovery: Type.Optional(Type.Boolean({ description: "For action='steer', allow pause-and-revive recovery after a missed acknowledgment. Defaults true for direct tool calls; false for extension RPC steering." })),
|
|
286
285
|
additional: Type.Optional(Type.Integer({ minimum: 1, description: "Positive launches to add with action='grant-spawn-budget'. Root interactive parent with native user confirmation only." })),
|
|
287
|
-
scope: Type.Optional(Type.String({ enum: ["session", "user", "project"], description: "Scope for action='watchdog.configure'. Defaults to session." })),
|
|
288
|
-
target: Type.Optional(Type.String({ enum: ["main", "children", "child"], description: "Target for watchdog actions." })),
|
|
289
286
|
focus: Type.Optional(Type.Boolean({ description: "Focus the new Herdr pane for inspector.open or project.open." })),
|
|
290
|
-
thinking: Type.Optional(Type.Unsafe({ anyOf: [{ type: "string" }, { type: "boolean", enum: [false] }], description: "Thinking level
|
|
291
|
-
schedule: Type.Optional(Type.String({ deprecated: true, description: "Deprecated. Use action='schedule.create' with at." })),
|
|
292
|
-
scheduleName: Type.Optional(Type.String({ deprecated: true, description: "Deprecated. Use name." })),
|
|
293
|
-
at: Type.Optional(Type.String({ description: "One-shot trigger for action='schedule.create': a relative delay such as '+10m' or an ISO timestamp with timezone." })),
|
|
294
|
-
every: Type.Optional(Type.String({ description: "Fixed recurring interval for action='schedule.create', such as '30m', '6h', '2d', or '2w'." })),
|
|
295
|
-
on: Type.Optional(Type.Unsafe({ anyOf: [{ type: "string" }, { type: "integer" }], description: "Reserved for a later calendar schedule slice." })),
|
|
296
|
-
timezone: Type.Optional(Type.String({ description: "Reserved for a later calendar schedule slice." })),
|
|
297
|
-
overlap: Type.Optional(Type.String({ enum: ["skip"], description: "Overlap policy. This slice supports skip only." })),
|
|
298
|
-
catchUp: Type.Optional(Type.String({ enum: ["none", "latest"], description: "Missed occurrence policy for recurring schedules. Defaults to latest." })),
|
|
287
|
+
thinking: Type.Optional(Type.Unsafe({ anyOf: [{ type: "string" }, { type: "boolean", enum: [false] }], description: "Thinking level override." })),
|
|
299
288
|
missionId: Type.Optional(Type.String({ description: "Mission id." })),
|
|
300
289
|
mission: Type.Optional(Type.Unsafe({ ...MissionLaunchOverride, description: "Mission object, or false for no mission. Requires exactly one non-empty title or summary; goal may only be true and then requires budget.tokens." })),
|
|
301
290
|
missionUpdate: Type.Optional(Type.Unsafe({ ...MissionUpdateOverride, description: "Mission update: objective, goal false or {paused:boolean}, budget, summary, labels, decisions, artifacts, or delivery receipts." })),
|
|
@@ -33,7 +33,6 @@ MANAGEMENT / CONTROL (use action; omit execution fields):
|
|
|
33
33
|
• status, interrupt, stop, resume, and steer manage live or persisted runs. Use status view:"fleet" for an overview or view:"transcript" with id and optional index to tail output.
|
|
34
34
|
• { action: "append-step", id: "...", step: {agent:"agent-c", task:"Use {previous}"} } appends one step to an already-running durable chain. step is control-only, not an execution mode; use { chain: [...] } for new chains.
|
|
35
35
|
• approve-checkpoint and reject-checkpoint decide a paused chain checkpoint.
|
|
36
|
-
• Create durable project schedules with { action:"schedule.create", id?, name?, at:"+10m" | ISO, workflowScript:"return runs.run('main', {agent:'worker', task:'...'})" } or { every:"6h", workflowScript:"..." }. Manage them with schedule.list/show/history/pause/resume/run/run-due/delete. This first slice supports fixed intervals; calendar schedules and schedule mission attachment are deferred.
|
|
37
36
|
|
|
38
37
|
${SUBAGENT_SAFETY_GUIDANCE}`;
|
|
39
38
|
|
|
@@ -47,7 +46,7 @@ EXECUTE:
|
|
|
47
46
|
• context can be fresh or fork. timeoutMs/maxRuntimeMs apply to foreground and async runs; foreground defaults to 30 minutes absent call/agent. Omit acceptance for read-only calls.
|
|
48
47
|
|
|
49
48
|
MANAGE / CONTROL:
|
|
50
|
-
• Use action without execution fields for list/get/models/guide/authoring, refine/refine.show/refine.rollback, mission, watchdog, status, interrupt, stop, resume, steer,
|
|
49
|
+
• Use action without execution fields for list/get/models/guide/authoring, refine/refine.show/refine.rollback, mission, watchdog, status, interrupt, stop, resume, steer, diagnostics, and other management actions. guide reads shipped current-version docs by topic.
|
|
51
50
|
• append-step uses step:{...} only for an already-running durable chain; step is not an execution mode.
|
|
52
51
|
• A mission object needs exactly one non-empty title or summary; objective and labels are optional. goal may only be true and requires budget:{tokens}.
|
|
53
52
|
|
|
@@ -2,7 +2,6 @@ export const AUTHORITY_ACTIONS = [
|
|
|
2
2
|
"discardWorktree",
|
|
3
3
|
"destructiveCleanup",
|
|
4
4
|
"spawnBudgetGrant",
|
|
5
|
-
"scheduleCreate",
|
|
6
5
|
"stopRun",
|
|
7
6
|
"steerRun",
|
|
8
7
|
] as const;
|
|
@@ -15,7 +14,6 @@ const DEFAULT_AUTHORITY_POLICY: Record<AuthorityAction, AuthorityDecision> = {
|
|
|
15
14
|
discardWorktree: "confirm",
|
|
16
15
|
destructiveCleanup: "confirm",
|
|
17
16
|
spawnBudgetGrant: "confirm",
|
|
18
|
-
scheduleCreate: "auto",
|
|
19
17
|
stopRun: "auto",
|
|
20
18
|
steerRun: "auto",
|
|
21
19
|
};
|