@selesai/code 0.8.12 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -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 +14 -18
- 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
|
@@ -7,7 +7,6 @@ import type { ExtensionContext } from "@selesai/code";
|
|
|
7
7
|
import { buildCompletionKey } from "../../src/runs/background/completion-dedupe.ts";
|
|
8
8
|
import { createResultWatcher as createRawResultWatcher } from "../../src/runs/background/result-watcher.ts";
|
|
9
9
|
import { writeAsyncResultFile, writePendingAsyncResultFile } from "../../src/runs/background/result-files.ts";
|
|
10
|
-
import { createScheduledRunManager, scheduledRunStorePath } from "../../src/runs/background/scheduled-runs.ts";
|
|
11
10
|
import { prepareMissionLaunch, writeMissionAsyncBinding } from "../../src/missions/lifecycle.ts";
|
|
12
11
|
import { readMission, updateMission } from "../../src/missions/store.ts";
|
|
13
12
|
import { createNestedRoute, writeNestedEvent } from "../../src/runs/shared/nested-events.ts";
|
|
@@ -400,64 +399,6 @@ describe("result watcher", () => {
|
|
|
400
399
|
}
|
|
401
400
|
});
|
|
402
401
|
|
|
403
|
-
it("observes retained-project completions without changing active-session delivery", async () => {
|
|
404
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-result-watcher-scheduled-"));
|
|
405
|
-
const resultsDir = path.join(root, "results");
|
|
406
|
-
const project = path.join(root, "project-a");
|
|
407
|
-
fs.mkdirSync(resultsDir);
|
|
408
|
-
fs.mkdirSync(project);
|
|
409
|
-
const ctx = {
|
|
410
|
-
cwd: project,
|
|
411
|
-
sessionManager: {
|
|
412
|
-
getSessionId: () => "session-a",
|
|
413
|
-
getSessionFile: () => path.join(project, "session-a.jsonl"),
|
|
414
|
-
},
|
|
415
|
-
} as unknown as ExtensionContext;
|
|
416
|
-
const manager = createScheduledRunManager({
|
|
417
|
-
config: { scheduledRuns: { enabled: true } },
|
|
418
|
-
storeRoot: path.join(root, "stores"),
|
|
419
|
-
launch: async () => ({ content: [{ type: "text", text: "Async" }], details: { mode: "single", results: [], asyncId: "scheduled-a" } }),
|
|
420
|
-
});
|
|
421
|
-
try {
|
|
422
|
-
manager.bindSession(ctx);
|
|
423
|
-
await manager.handleToolCall({ action: "schedule.create", id: "retained", every: "1h", workflowScript: "return runs.run('main', { agent: 'worker' })" }, ctx);
|
|
424
|
-
await manager.handleToolCall({ action: "schedule.run", id: "retained" }, ctx);
|
|
425
|
-
const scheduleDir = path.join(scheduledRunStorePath(project, undefined, path.join(root, "stores")), "retained");
|
|
426
|
-
assert.equal(fs.existsSync(path.join(scheduleDir, "active.lock")), true);
|
|
427
|
-
|
|
428
|
-
const emitted: Array<{ event: string; data: unknown }> = [];
|
|
429
|
-
const state = createState();
|
|
430
|
-
state.currentSessionId = "session-b";
|
|
431
|
-
const resultPath = path.join(resultsDir, "scheduled-a.json");
|
|
432
|
-
writeIndexedResult(resultPath, { id: "scheduled-a", sessionId: "session-a", success: true, summary: "done" });
|
|
433
|
-
const watcher = createResultWatcher({
|
|
434
|
-
events: {
|
|
435
|
-
on: () => () => {},
|
|
436
|
-
emit(event: string, data: unknown) { emitted.push({ event, data }); },
|
|
437
|
-
},
|
|
438
|
-
}, state, resultsDir, 60_000, {
|
|
439
|
-
observeCompletion: (result) => manager.handleAsyncCompletion(result),
|
|
440
|
-
observedCompletionRunIds: () => manager.observedCompletionRunIds(),
|
|
441
|
-
notifier: { deliver: async () => assert.fail("inactive-session completion must not reach the live notifier") },
|
|
442
|
-
});
|
|
443
|
-
try {
|
|
444
|
-
watcher.startResultWatcher();
|
|
445
|
-
watcher.primeExistingResults();
|
|
446
|
-
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
447
|
-
} finally {
|
|
448
|
-
watcher.stopResultWatcher();
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
assert.equal(state.currentSessionId, "session-b");
|
|
452
|
-
assert.equal(emitted.length, 0);
|
|
453
|
-
assert.equal(fs.existsSync(path.join(scheduleDir, "active.lock")), false);
|
|
454
|
-
assert.match(fs.readFileSync(path.join(scheduleDir, "history.json"), "utf-8"), /"state": "completed"/);
|
|
455
|
-
assert.equal(fs.existsSync(resultPath), true, "the owning session keeps delivery ownership of its result file");
|
|
456
|
-
} finally {
|
|
457
|
-
manager.stop();
|
|
458
|
-
fs.rmSync(root, { recursive: true, force: true });
|
|
459
|
-
}
|
|
460
|
-
});
|
|
461
402
|
|
|
462
403
|
it("delivers indexed pending results during reload when public promotion is blocked", async () => {
|
|
463
404
|
const resultsDir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-result-watcher-pending-index-"));
|
|
@@ -413,26 +413,6 @@ describe("single sync execution", { skip: !available ? "pi packages not availabl
|
|
|
413
413
|
assert.equal(mockPi.callCount(), 0);
|
|
414
414
|
});
|
|
415
415
|
|
|
416
|
-
it("allows schedule.create to carry the required workflowScript target", { skip: !createSubagentExecutor ? "executor not importable" : undefined }, async () => {
|
|
417
|
-
let forwarded;
|
|
418
|
-
const executor = makeExecutor([makeAgent("echo")], {}, false, undefined, true, new Map(), undefined, async (params) => {
|
|
419
|
-
forwarded = params;
|
|
420
|
-
return { content: [{ type: "text", text: "created" }], details: { mode: "management", results: [] } };
|
|
421
|
-
});
|
|
422
|
-
|
|
423
|
-
const result = await executor.execute(
|
|
424
|
-
"schedule-create",
|
|
425
|
-
{ action: "schedule.create", id: "nightly", every: "1h", workflowScript: "return runs.run('main', { agent: 'echo' })" },
|
|
426
|
-
new AbortController().signal,
|
|
427
|
-
undefined,
|
|
428
|
-
makeMinimalCtx(tempDir),
|
|
429
|
-
);
|
|
430
|
-
|
|
431
|
-
assert.equal(result.isError, undefined);
|
|
432
|
-
assert.equal(result.content[0]?.text, "created");
|
|
433
|
-
assert.equal(forwarded?.workflowScript, "return runs.run('main', { agent: 'echo' })");
|
|
434
|
-
});
|
|
435
|
-
|
|
436
416
|
it("starts workflow scripts asynchronously with a portable internal run id", { skip: !createSubagentExecutor ? "executor not importable" : undefined }, async () => {
|
|
437
417
|
mockPi.onCall({ echoEnv: [SUBAGENT_STEER_INBOX_ENV, SUBAGENT_STEER_CAPABILITY_ENV, SUBAGENT_STEER_ACK_DIR_ENV] });
|
|
438
418
|
const asyncJobs: SubagentState["asyncJobs"] = new Map();
|
|
@@ -1683,45 +1663,6 @@ describe("single sync execution", { skip: !available ? "pi packages not availabl
|
|
|
1683
1663
|
assert.match(result.content[0]?.text ?? "", /Valid:/);
|
|
1684
1664
|
});
|
|
1685
1665
|
|
|
1686
|
-
it("routes watchdog.configure through the management action path", { skip: !createSubagentExecutor ? "executor not importable" : undefined }, async () => {
|
|
1687
|
-
const gpt = { provider: "openai-codex", id: "gpt-5.5", reasoning: true };
|
|
1688
|
-
const opus = { provider: "anthropic", id: "claude-opus-4-8", reasoning: true };
|
|
1689
|
-
const models = [gpt, opus];
|
|
1690
|
-
const watchdog = new MainWatchdogRuntime({ cwd: tempDir });
|
|
1691
|
-
const executor = createSubagentExecutor!({
|
|
1692
|
-
pi: { events: createEventBus(), getSessionName: () => undefined },
|
|
1693
|
-
state: { baseCwd: tempDir, currentSessionId: null, asyncJobs: new Map(), foregroundControls: new Map(), lastForegroundControlId: null },
|
|
1694
|
-
config: {},
|
|
1695
|
-
asyncByDefault: false,
|
|
1696
|
-
watchdog,
|
|
1697
|
-
tempArtifactsDir: tempDir,
|
|
1698
|
-
getSubagentSessionRoot: () => tempDir,
|
|
1699
|
-
expandTilde: (value: string) => value,
|
|
1700
|
-
discoverAgents: () => ({ agents: [makeAgent("echo")] }),
|
|
1701
|
-
});
|
|
1702
|
-
const ctx = {
|
|
1703
|
-
...makeMinimalCtx(tempDir),
|
|
1704
|
-
model: gpt,
|
|
1705
|
-
modelRegistry: {
|
|
1706
|
-
getAvailable: () => models,
|
|
1707
|
-
find: (provider: string, id: string) => models.find((model) => model.provider === provider && model.id === id),
|
|
1708
|
-
hasConfiguredAuth: (model: unknown) => Boolean(model),
|
|
1709
|
-
},
|
|
1710
|
-
};
|
|
1711
|
-
|
|
1712
|
-
const result = await executor.execute(
|
|
1713
|
-
"watchdog-configure",
|
|
1714
|
-
{ action: "watchdog.configure", model: "recommended" },
|
|
1715
|
-
new AbortController().signal,
|
|
1716
|
-
undefined,
|
|
1717
|
-
ctx,
|
|
1718
|
-
);
|
|
1719
|
-
|
|
1720
|
-
assert.equal(result.isError, undefined);
|
|
1721
|
-
assert.match(result.content[0]?.text ?? "", /session model configured: anthropic\/claude-opus-4-8:high/);
|
|
1722
|
-
assert.equal(watchdog.getSnapshot(tempDir).config.main.model, "anthropic/claude-opus-4-8");
|
|
1723
|
-
});
|
|
1724
|
-
|
|
1725
1666
|
it("rejects duplicate concurrent subagent execution calls", async () => {
|
|
1726
1667
|
mockPi.onCall({ output: "first call completed", delay: 100 });
|
|
1727
1668
|
const executor = makeExecutor([makeAgent("echo")]);
|
|
@@ -5,7 +5,6 @@ import * as path from "node:path";
|
|
|
5
5
|
import { beforeEach, describe, it } from "node:test";
|
|
6
6
|
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
7
7
|
|
|
8
|
-
import { scheduledRunStorePath } from "../../src/runs/background/scheduled-runs.ts";
|
|
9
8
|
import { SUBAGENT_FANOUT_CHILD_ENV } from "../../src/runs/shared/pi-args.ts";
|
|
10
9
|
import { ASYNC_DIR } from "../../src/shared/types.ts";
|
|
11
10
|
import type { WatchdogReviewFunction } from "../../src/watchdog/runtime.ts";
|
|
@@ -280,35 +279,6 @@ describe("subagents watchdog slash command", { skip: !available ? "watchdog comm
|
|
|
280
279
|
});
|
|
281
280
|
});
|
|
282
281
|
|
|
283
|
-
it("recommends and saves a strong complementary watchdog model", async () => {
|
|
284
|
-
await withIsolatedHome(async () => {
|
|
285
|
-
await withTempProject("pi-watchdog-model-", async (root) => {
|
|
286
|
-
const gpt = { provider: "openai-codex", id: "gpt-5.5", reasoning: true };
|
|
287
|
-
const opus = { provider: "anthropic", id: "claude-opus-4-8", reasoning: true };
|
|
288
|
-
const models = [gpt, opus];
|
|
289
|
-
const modelRegistry = {
|
|
290
|
-
getAvailable: () => models,
|
|
291
|
-
find: (provider: string, id: string) => models.find((entry) => entry.provider === provider && entry.id === id),
|
|
292
|
-
hasConfiguredAuth: (model: unknown) => Boolean(model),
|
|
293
|
-
};
|
|
294
|
-
const ctx = createCommandContext({ cwd: root, model: gpt, modelRegistry });
|
|
295
|
-
const { commands, sent } = createWatchdogHarness();
|
|
296
|
-
|
|
297
|
-
await commands.get("subagents-watchdog")!.handler("recommend-model", ctx);
|
|
298
|
-
await commands.get("subagents-watchdog")!.handler("model recommended", ctx);
|
|
299
|
-
|
|
300
|
-
const recommendation = String((sent[0] as { content?: unknown }).content ?? "");
|
|
301
|
-
assert.match(recommendation, /Recommended: anthropic\/claude-opus-4-8:high/);
|
|
302
|
-
const settingsPath = path.join(process.env.HOME!, ".selesai", "agent", "settings.json");
|
|
303
|
-
const settings = JSON.parse(fs.readFileSync(settingsPath, "utf-8"));
|
|
304
|
-
assert.equal(settings.subagents.watchdog.main.model, "anthropic/claude-opus-4-8");
|
|
305
|
-
assert.equal(settings.subagents.watchdog.main.thinking, "high");
|
|
306
|
-
assert.equal(settings.subagents.watchdog.enabled, undefined);
|
|
307
|
-
assert.match(String((sent[1] as { content?: unknown }).content ?? ""), /Run \/subagents-watchdog on if the watchdog is still off/);
|
|
308
|
-
});
|
|
309
|
-
});
|
|
310
|
-
});
|
|
311
|
-
|
|
312
282
|
it("supports session-scoped recommended watchdog models without writing settings", async () => {
|
|
313
283
|
await withIsolatedHome(async () => {
|
|
314
284
|
await withTempProject("pi-watchdog-session-model-", async (root) => {
|
|
@@ -529,23 +499,6 @@ describe("slash command custom message delivery", { skip: !available ? "slash-co
|
|
|
529
499
|
|
|
530
500
|
it("/subagents-stop keeps the selector within its allocated width", async () => {
|
|
531
501
|
await withTempProject("pi-stop-selector-width-", async (root) => {
|
|
532
|
-
const id = "scheduled-width-check";
|
|
533
|
-
const nextRunAt = "2099-01-01T00:00:00.000Z";
|
|
534
|
-
const scheduleDir = path.join(scheduledRunStorePath(root), id);
|
|
535
|
-
fs.mkdirSync(scheduleDir, { recursive: true });
|
|
536
|
-
fs.writeFileSync(path.join(scheduleDir, "schedule.json"), JSON.stringify({
|
|
537
|
-
schemaVersion: 1,
|
|
538
|
-
id,
|
|
539
|
-
name: "A very long scheduled run name with wide characters 中文🙂",
|
|
540
|
-
cwd: root,
|
|
541
|
-
trigger: { kind: "once", at: nextRunAt, nextRunAt },
|
|
542
|
-
target: { agent: "scout", task: "Inspect" },
|
|
543
|
-
overlap: "skip",
|
|
544
|
-
catchUp: "latest",
|
|
545
|
-
paused: false,
|
|
546
|
-
createdAt: "2026-08-06T00:00:00.000Z",
|
|
547
|
-
updatedAt: "2026-08-06T00:00:00.000Z",
|
|
548
|
-
}), "utf-8");
|
|
549
502
|
|
|
550
503
|
const commands = new Map<string, RegisteredSlashCommand>();
|
|
551
504
|
const pi = {
|
|
@@ -7,7 +7,6 @@ describe("authority policy", () => {
|
|
|
7
7
|
assert.equal(resolveAuthorityDecision({ action: "discardWorktree" }), "confirm");
|
|
8
8
|
assert.equal(resolveAuthorityDecision({ action: "destructiveCleanup" }), "confirm");
|
|
9
9
|
assert.equal(resolveAuthorityDecision({ action: "spawnBudgetGrant" }), "confirm");
|
|
10
|
-
assert.equal(resolveAuthorityDecision({ action: "scheduleCreate" }), "auto");
|
|
11
10
|
assert.equal(resolveAuthorityDecision({ action: "stopRun" }), "auto");
|
|
12
11
|
assert.equal(resolveAuthorityDecision({ action: "steerRun" }), "auto");
|
|
13
12
|
});
|
|
@@ -32,7 +32,7 @@ describe("async compaction resume", () => {
|
|
|
32
32
|
renders = 0;
|
|
33
33
|
handlers.get("session_before_compact")({ reason: "threshold", signal: new AbortController().signal });
|
|
34
34
|
const cleared = widgets.filter(([key, value]) => value === undefined).map(([key]) => key).sort();
|
|
35
|
-
if (JSON.stringify(cleared) !== JSON.stringify(["subagent-async"
|
|
35
|
+
if (JSON.stringify(cleared) !== JSON.stringify(["subagent-async"])) throw new Error(JSON.stringify(widgets));
|
|
36
36
|
widgets.length = 0;
|
|
37
37
|
events.emit("subagent:async-complete", { id: "running", sessionId: "compact-session", agent: "worker", success: true, summary: "done" });
|
|
38
38
|
events.emit("subagent:async-started", { id: "running-2", pid: 2, sessionId: "compact-session", mode: "single", agent: "worker", asyncDir: path.join(os.tmpdir(), "pi-compaction-test-running-2") });
|
|
@@ -41,7 +41,7 @@ describe("async compaction resume", () => {
|
|
|
41
41
|
if (widgets.length !== 0) throw new Error("widgets restored inside compaction hook");
|
|
42
42
|
handlers.get("agent_start")();
|
|
43
43
|
const restored = widgets.filter(([_, value]) => value !== undefined).map(([key]) => key).sort();
|
|
44
|
-
if (JSON.stringify(restored) !== JSON.stringify(["subagent-async"
|
|
44
|
+
if (JSON.stringify(restored) !== JSON.stringify(["subagent-async"])) throw new Error(JSON.stringify(widgets));
|
|
45
45
|
if (sent.length !== 1 || sent[0].options?.triggerTurn !== true || sent[0].message?.customType !== "subagent-compaction-resume") throw new Error(JSON.stringify(sent));
|
|
46
46
|
|
|
47
47
|
sent.length = 0;
|
|
@@ -612,8 +612,8 @@ describe("subagent extension child mode", () => {
|
|
|
612
612
|
}), "utf-8");
|
|
613
613
|
updateActiveRunIndex(asyncDir, "running");
|
|
614
614
|
handlers.get("tool_result")({ toolName: "subagent" }, ctx);
|
|
615
|
-
const
|
|
616
|
-
if (!
|
|
615
|
+
const asyncWidgets = widgets.filter((entry) => entry.key === "subagent-async");
|
|
616
|
+
if (!asyncWidgets.some((entry) => typeof entry.value === "function" || typeof entry.value === "string")) throw new Error("management result did not restore active async status: " + JSON.stringify(asyncWidgets));
|
|
617
617
|
handlers.get("session_shutdown")();
|
|
618
618
|
fs.rmSync(asyncDir, { recursive: true, force: true });
|
|
619
619
|
`;
|
|
@@ -787,7 +787,7 @@ describe("subagent extension child mode", () => {
|
|
|
787
787
|
}
|
|
788
788
|
});
|
|
789
789
|
|
|
790
|
-
it("
|
|
790
|
+
it("does not register the main watchdog command or renderer in parent mode", () => {
|
|
791
791
|
const script = String.raw`
|
|
792
792
|
import registerSubagentExtension from "./index.ts";
|
|
793
793
|
const events = { on() { return () => {}; }, emit() {} };
|
|
@@ -808,8 +808,8 @@ describe("subagent extension child mode", () => {
|
|
|
808
808
|
},
|
|
809
809
|
});
|
|
810
810
|
registerSubagentExtension(fakePi);
|
|
811
|
-
if (
|
|
812
|
-
if (
|
|
811
|
+
if (commands.includes("subagents-watchdog")) throw new Error("watchdog command still registered: " + commands.join(", "));
|
|
812
|
+
if (renderers.includes("subagent_watchdog_warning")) throw new Error("watchdog renderer still registered: " + renderers.join(", "));
|
|
813
813
|
`;
|
|
814
814
|
|
|
815
815
|
execFileSync(
|
|
@@ -14,14 +14,6 @@ describe("public subagent execution normalization", () => {
|
|
|
14
14
|
assert.deepEqual(normalizePublicSubagentExecution({ tasks: [{ agent: "worker" }] }), { ok: true, params: { tasks: [{ agent: "worker" }] } });
|
|
15
15
|
assert.deepEqual(normalizePublicSubagentExecution({ chain: [{ agent: "worker" }] }), { ok: true, params: { chain: [{ agent: "worker" }] } });
|
|
16
16
|
assert.deepEqual(normalizePublicSubagentExecution({ action: " list " }), { ok: true, params: { action: "list" } });
|
|
17
|
-
assert.deepEqual(
|
|
18
|
-
normalizePublicSubagentExecution({ action: " schedule.create ", every: "1h", workflowScript: "return 1" }),
|
|
19
|
-
{ ok: true, params: { action: "schedule.create", every: "1h", workflowScript: "return 1" } },
|
|
20
|
-
);
|
|
21
|
-
assert.deepEqual(
|
|
22
|
-
normalizePublicSubagentExecution({ action: "schedule.create", agent: "worker", task: "work" }),
|
|
23
|
-
{ ok: true, params: { action: "schedule.create", agent: "worker", task: "work" } },
|
|
24
|
-
);
|
|
25
17
|
});
|
|
26
18
|
|
|
27
19
|
it("rejects private run fan-out fields at the public boundary", () => {
|
|
@@ -95,9 +95,9 @@ describe("subagent extension RPC bridge", () => {
|
|
|
95
95
|
(reply as { data: { capabilities?: { resume?: boolean } } }).data.capabilities?.resume,
|
|
96
96
|
true,
|
|
97
97
|
);
|
|
98
|
-
assert.
|
|
98
|
+
assert.equal(
|
|
99
99
|
(reply as { data: { capabilities?: { fleetStatus?: unknown } } }).data.capabilities?.fleetStatus,
|
|
100
|
-
|
|
100
|
+
undefined,
|
|
101
101
|
);
|
|
102
102
|
|
|
103
103
|
bridge.dispose();
|
|
@@ -70,10 +70,10 @@ describe("subagent action recovery", () => {
|
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
it("routes invalid schedule actions through common recovery", async () => {
|
|
73
|
-
const result = await createExecutor().execute("invalid-
|
|
73
|
+
const result = await createExecutor().execute("invalid-removed-action", { action: "removed.lsit" }, new AbortController().signal, undefined, ctx());
|
|
74
74
|
assert.equal(result.isError, true);
|
|
75
75
|
assert.equal(result.content[0]?.type, "text");
|
|
76
|
-
assert.equal(result.content[0]?.text, unknownSubagentActionMessage("
|
|
76
|
+
assert.equal(result.content[0]?.text, unknownSubagentActionMessage("removed.lsit"));
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
it("lists and suggests mission decision resolution", () => {
|
|
@@ -593,7 +593,7 @@ describe("subagent prompt runtime", () => {
|
|
|
593
593
|
}
|
|
594
594
|
});
|
|
595
595
|
|
|
596
|
-
it("
|
|
596
|
+
it("does not register child watchdog lifecycle handlers when env is set", () => {
|
|
597
597
|
delete process.env[CHILD_WATCHDOG_CONFIG_ENV];
|
|
598
598
|
// Clear the ack capture and steer env vars explicitly: when this test suite itself
|
|
599
599
|
// runs inside a pi-subagents child, the runner sets them and extra agent_end
|
|
@@ -634,9 +634,9 @@ describe("subagent prompt runtime", () => {
|
|
|
634
634
|
sendMessage() {},
|
|
635
635
|
} as { on(event: string, handler: unknown): void; getThinkingLevel(): string; sendMessage(): void });
|
|
636
636
|
|
|
637
|
-
assert.
|
|
638
|
-
assert.
|
|
639
|
-
assert.
|
|
637
|
+
assert.equal(handlersWith.get("agent_end")?.length ?? 0, 1, "child watchdog lifecycle handlers are not registered");
|
|
638
|
+
assert.equal(handlersWith.get("before_agent_start")?.length ?? 0, handlersWithout.get("before_agent_start")?.length ?? 0);
|
|
639
|
+
assert.equal(handlersWith.get("turn_end")?.length ?? 0, handlersWithout.get("turn_end")?.length ?? 0);
|
|
640
640
|
});
|
|
641
641
|
|
|
642
642
|
it("registered structured_output tool accepts valid schema output and writes the capture file", async () => {
|
|
@@ -29,11 +29,31 @@ describe("workflow auto-relaunch policy", () => {
|
|
|
29
29
|
assert.deepEqual(decision, { relaunch: false, capped: true });
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
it("relaunches indefinitely when the cap is unlimited", () => {
|
|
32
|
+
it("relaunches indefinitely when the cap is unlimited and progress is omitted", () => {
|
|
33
33
|
const decision = resolveAutoRelaunchDecision({ result: "budget" }, 50, undefined);
|
|
34
34
|
assert.deepEqual(decision, { relaunch: true, capped: false });
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
+
it("stops when usage budget blocks the whole round", () => {
|
|
38
|
+
const decision = resolveAutoRelaunchDecision({ result: "budget" }, 0, undefined, { launched: 0, fanoutRejected: 0, usageBudgetBlocked: 1, stateWrites: 0 });
|
|
39
|
+
assert.deepEqual(decision, { relaunch: false, capped: false, stallReason: "usage-budget" });
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("stops when fanout rejects every launch", () => {
|
|
43
|
+
const decision = resolveAutoRelaunchDecision({ result: "budget" }, 1, undefined, { launched: 0, fanoutRejected: 3, usageBudgetBlocked: 0, stateWrites: 0 });
|
|
44
|
+
assert.deepEqual(decision, { relaunch: false, capped: false, stallReason: "fanout-limited" });
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("stops when a budget round makes no progress", () => {
|
|
48
|
+
const decision = resolveAutoRelaunchDecision({ result: "budget" }, 0, 12, { launched: 0, fanoutRejected: 0, usageBudgetBlocked: 0, stateWrites: 0 });
|
|
49
|
+
assert.deepEqual(decision, { relaunch: false, capped: false, stallReason: "no-progress" });
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("allows a retry when children actually launch", () => {
|
|
53
|
+
const decision = resolveAutoRelaunchDecision({ result: "budget" }, 1, 12, { launched: 3, fanoutRejected: 0, usageBudgetBlocked: 0, stateWrites: 0 });
|
|
54
|
+
assert.deepEqual(decision, { relaunch: true, capped: false });
|
|
55
|
+
});
|
|
56
|
+
|
|
37
57
|
it("resolves the configured cap with a safe default and 0 as unlimited", () => {
|
|
38
58
|
assert.equal(resolveMaxWorkflowAutoRelaunches(undefined), DEFAULT_MAX_WORKFLOW_AUTO_RELAUNCHES);
|
|
39
59
|
assert.equal(resolveMaxWorkflowAutoRelaunches(5), 5);
|
|
@@ -2,6 +2,14 @@ import { type Model } from "@earendil-works/pi-ai";
|
|
|
2
2
|
import { Container, type Focusable, Input, type TUI } from "@earendil-works/pi-tui";
|
|
3
3
|
import type { ModelRuntime } from "../../../core/model-runtime.ts";
|
|
4
4
|
import type { SettingsManager } from "../../../core/settings-manager.ts";
|
|
5
|
+
export interface ModelSelectorOptions {
|
|
6
|
+
/** Restrict the list (for example, to vision-capable models). */
|
|
7
|
+
modelFilter?: (model: Model<any>) => boolean;
|
|
8
|
+
/** Add an "off" choice without changing the active/default model. */
|
|
9
|
+
allowOff?: boolean;
|
|
10
|
+
/** Do not persist this selection as the main/default model. */
|
|
11
|
+
persistSelection?: boolean;
|
|
12
|
+
}
|
|
5
13
|
interface ScopedModelItem {
|
|
6
14
|
model: Model<any>;
|
|
7
15
|
thinkingLevel?: string;
|
|
@@ -25,6 +33,7 @@ export declare class ModelSelectorComponent extends Container implements Focusab
|
|
|
25
33
|
private modelRuntime;
|
|
26
34
|
private onSelectCallback;
|
|
27
35
|
private onCancelCallback;
|
|
36
|
+
private readonly options;
|
|
28
37
|
private errorMessage?;
|
|
29
38
|
private refreshStatusMessage;
|
|
30
39
|
private refreshStatusSuccess;
|
|
@@ -36,7 +45,7 @@ export declare class ModelSelectorComponent extends Container implements Focusab
|
|
|
36
45
|
private readonly refreshAbortController;
|
|
37
46
|
private refreshTimeout?;
|
|
38
47
|
private closed;
|
|
39
|
-
constructor(tui: TUI, currentModel: Model<any> | undefined, settingsManager: SettingsManager, modelRuntime: ModelRuntime, scopedModels: ReadonlyArray<ScopedModelItem>, onSelect: (model: Model<any>) => void, onCancel: () => void, initialSearchInput?: string);
|
|
48
|
+
constructor(tui: TUI, currentModel: Model<any> | undefined, settingsManager: SettingsManager, modelRuntime: ModelRuntime, scopedModels: ReadonlyArray<ScopedModelItem>, onSelect: (model: Model<any> | undefined) => void, onCancel: () => void, initialSearchInput?: string, options?: ModelSelectorOptions);
|
|
40
49
|
private loadModelsFromSnapshot;
|
|
41
50
|
private refreshModels;
|
|
42
51
|
private close;
|
|
@@ -30,6 +30,7 @@ export class ModelSelectorComponent extends Container {
|
|
|
30
30
|
modelRuntime;
|
|
31
31
|
onSelectCallback;
|
|
32
32
|
onCancelCallback;
|
|
33
|
+
options;
|
|
33
34
|
errorMessage;
|
|
34
35
|
refreshStatusMessage = "Refreshing model catalogs…";
|
|
35
36
|
refreshStatusSuccess = false;
|
|
@@ -41,7 +42,7 @@ export class ModelSelectorComponent extends Container {
|
|
|
41
42
|
refreshAbortController = new AbortController();
|
|
42
43
|
refreshTimeout;
|
|
43
44
|
closed = false;
|
|
44
|
-
constructor(tui, currentModel, settingsManager, modelRuntime, scopedModels, onSelect, onCancel, initialSearchInput) {
|
|
45
|
+
constructor(tui, currentModel, settingsManager, modelRuntime, scopedModels, onSelect, onCancel, initialSearchInput, options = {}) {
|
|
45
46
|
super();
|
|
46
47
|
this.tui = tui;
|
|
47
48
|
this.currentModel = currentModel;
|
|
@@ -51,6 +52,7 @@ export class ModelSelectorComponent extends Container {
|
|
|
51
52
|
this.scope = scopedModels.length > 0 ? "scoped" : "all";
|
|
52
53
|
this.onSelectCallback = onSelect;
|
|
53
54
|
this.onCancelCallback = onCancel;
|
|
55
|
+
this.options = options;
|
|
54
56
|
// Add top border
|
|
55
57
|
this.addChild(new DynamicBorder());
|
|
56
58
|
this.addChild(new Spacer(1));
|
|
@@ -100,17 +102,19 @@ export class ModelSelectorComponent extends Container {
|
|
|
100
102
|
id: model.id,
|
|
101
103
|
model,
|
|
102
104
|
}));
|
|
103
|
-
this.allModels = this.sortModels(models);
|
|
105
|
+
this.allModels = this.sortModels(models).filter((item) => !this.options.modelFilter || this.options.modelFilter(item.model));
|
|
104
106
|
this.scopedModels = this.scopedModels.map((scoped) => {
|
|
105
107
|
const refreshed = this.modelRuntime.getModel(scoped.model.provider, scoped.model.id);
|
|
106
108
|
return refreshed ? { ...scoped, model: refreshed } : scoped;
|
|
107
109
|
});
|
|
108
|
-
this.scopedModelItems = this.scopedModels.map((scoped) => ({
|
|
110
|
+
this.scopedModelItems = this.scopedModels.filter((scoped) => !this.options.modelFilter || this.options.modelFilter(scoped.model)).map((scoped) => ({
|
|
109
111
|
provider: scoped.model.provider,
|
|
110
112
|
id: scoped.model.id,
|
|
111
113
|
model: scoped.model,
|
|
112
114
|
}));
|
|
113
115
|
this.activeModels = this.scope === "scoped" ? this.scopedModelItems : this.allModels;
|
|
116
|
+
if (this.options.allowOff)
|
|
117
|
+
this.activeModels = [{ provider: "", id: "off", model: { provider: "", id: "off", name: "Disabled", input: ["text"] } }, ...this.activeModels];
|
|
114
118
|
this.filteredModels = this.activeModels;
|
|
115
119
|
const currentIndex = this.filteredModels.findIndex((item) => modelsAreEqual(this.currentModel, item.model));
|
|
116
120
|
this.selectedIndex =
|
|
@@ -303,9 +307,9 @@ export class ModelSelectorComponent extends Container {
|
|
|
303
307
|
}
|
|
304
308
|
handleSelect(model) {
|
|
305
309
|
this.close();
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
this.onSelectCallback(model);
|
|
310
|
+
if (model.id !== "off" && this.options.persistSelection !== false)
|
|
311
|
+
this.settingsManager.setDefaultModelAndProvider(model.provider, model.id);
|
|
312
|
+
this.onSelectCallback(model.id === "off" ? undefined : model);
|
|
309
313
|
}
|
|
310
314
|
getSearchInput() {
|
|
311
315
|
return this.searchInput;
|
|
@@ -3,6 +3,7 @@ import type { Transport } from "@earendil-works/pi-ai";
|
|
|
3
3
|
import { Container, type ScrollViewScrollbar, SettingsList } from "@earendil-works/pi-tui";
|
|
4
4
|
import type { DefaultProjectTrust, FullscreenExitOutput, TuiMode, WarningSettings } from "../../../core/settings-manager.ts";
|
|
5
5
|
import { type TerminalTheme } from "../theme/theme.ts";
|
|
6
|
+
import type { ModelSelectorComponent } from "./model-selector.ts";
|
|
6
7
|
export interface SkillToggleItem {
|
|
7
8
|
name: string;
|
|
8
9
|
enabled: boolean;
|
|
@@ -21,6 +22,7 @@ export interface SettingsConfig {
|
|
|
21
22
|
imageCaptionModel: string | undefined;
|
|
22
23
|
imageCaptionContextTokens: number;
|
|
23
24
|
visionModels: string[];
|
|
25
|
+
visionModelSelector?: (currentValue: string, done: () => void) => ModelSelectorComponent;
|
|
24
26
|
steeringMode: "all" | "one-at-a-time";
|
|
25
27
|
followUpMode: "all" | "one-at-a-time";
|
|
26
28
|
transport: Transport;
|
|
@@ -528,6 +528,9 @@ export class SettingsSelectorComponent extends Container {
|
|
|
528
528
|
description: "Model used to describe images when the main model can't see them (off disables)",
|
|
529
529
|
currentValue: currentCaptionModel,
|
|
530
530
|
values: visionModelValues,
|
|
531
|
+
submenu: config.visionModelSelector
|
|
532
|
+
? (currentValue, done) => config.visionModelSelector(currentValue, done)
|
|
533
|
+
: undefined,
|
|
531
534
|
});
|
|
532
535
|
// Vision caption context-token budget
|
|
533
536
|
const captionModelIndex = items.findIndex((item) => item.id === "image-caption-model");
|
|
@@ -3682,6 +3682,11 @@ export class InteractiveMode {
|
|
|
3682
3682
|
imageCaptionModel: this.settingsManager.getImageCaptionModel(),
|
|
3683
3683
|
imageCaptionContextTokens: this.settingsManager.getImageCaptionContextTokens(),
|
|
3684
3684
|
visionModels: this.getVisionModels(),
|
|
3685
|
+
visionModelSelector: (currentValue, selectorDone) => new ModelSelectorComponent(this.ui, undefined, this.settingsManager, this.session.modelRuntime, this.session.scopedModels, (model) => {
|
|
3686
|
+
this.settingsManager.setImageCaptionModel(model ? `${model.provider}/${model.id}` : undefined);
|
|
3687
|
+
selectorDone();
|
|
3688
|
+
this.showStatus(model ? `Vision caption model: ${model.provider}/${model.id}` : "Vision captioning disabled");
|
|
3689
|
+
}, selectorDone, currentValue === "off" ? undefined : currentValue, { modelFilter: (model) => model.input.includes("image"), allowOff: true, persistSelection: false }),
|
|
3685
3690
|
steeringMode: this.session.steeringMode,
|
|
3686
3691
|
followUpMode: this.session.followUpMode,
|
|
3687
3692
|
transport: this.settingsManager.getTransport(),
|
|
@@ -4081,6 +4086,8 @@ export class InteractiveMode {
|
|
|
4081
4086
|
showModelSelector(initialSearchInput) {
|
|
4082
4087
|
this.showSelector((done) => {
|
|
4083
4088
|
const selector = new ModelSelectorComponent(this.ui, this.session.model, this.settingsManager, this.session.modelRuntime, this.session.scopedModels, async (model) => {
|
|
4089
|
+
if (!model)
|
|
4090
|
+
return;
|
|
4084
4091
|
try {
|
|
4085
4092
|
await this.session.setModel(model);
|
|
4086
4093
|
this.footer.invalidate();
|
|
@@ -19,7 +19,7 @@ This file is a detailed reference loaded from `skills/pi-subagents/SKILL.md`.
|
|
|
19
19
|
become second decision-makers.
|
|
20
20
|
- **Respect the fixed authority policy.** `authorityPolicy` is a small `auto` / `confirm` / `forbid` map for supported operational actions. Worktree discard, destructive cleanup, and spawn-budget grants default to confirmation; stop, steer, and schedule creation remain automatic. Use `worktree.discard` with the durable `handoffPath`; confirm-required actions refuse safely without an interactive UI and retained paths include manual Git recovery commands.
|
|
21
21
|
|
|
22
|
-
Runtime config can change orchestration behavior. `intercomBridge.resultDelivery: false` disables only external acknowledged grouped-result delivery when native parent notifications own completion; supervisor asks/progress stay active, and enabled transport failures are still reported. `asyncByDefault` and `forceTopLevelAsync` affect whether launches detach; `waitTool` can make direct `subagent_wait()` calls return immediately while headless auto-drain remains active, and its effective value is propagated to child runtimes; `globalConcurrencyLimit` bounds concurrent fanout, while a positive `maxSubagentSpawnsPerSession` optionally caps cumulative launches (`0` or unset is unlimited). Status and doctor report the budget; static work preflights declared capacity; only the settled root interactive parent can use `grant-spawn-budget` after native confirmation, with total grants bounded by the original cap. Compaction does not reset usage or grants; `singleRunOutputBaseDir` and `worktreeBaseDir` route outputs and worktrees; `completionBatch` groups async notifications. `artifactDir` is `project` (default), `session`, or `temp` and chooses where subagent artifacts are stored. Set `asyncWidget: false` to hide the above-editor background-run widget when a companion footer or dashboard owns that space (
|
|
22
|
+
Runtime config can change orchestration behavior. `intercomBridge.resultDelivery: false` disables only external acknowledged grouped-result delivery when native parent notifications own completion; supervisor asks/progress stay active, and enabled transport failures are still reported. `asyncByDefault` and `forceTopLevelAsync` affect whether launches detach; `waitTool` can make direct `subagent_wait()` calls return immediately while headless auto-drain remains active, and its effective value is propagated to child runtimes; `globalConcurrencyLimit` bounds concurrent fanout, while a positive `maxSubagentSpawnsPerSession` optionally caps cumulative launches (`0` or unset is unlimited). Status and doctor report the budget; static work preflights declared capacity; only the settled root interactive parent can use `grant-spawn-budget` after native confirmation, with total grants bounded by the original cap. Compaction does not reset usage or grants; `singleRunOutputBaseDir` and `worktreeBaseDir` route outputs and worktrees; `completionBatch` groups async notifications. `artifactDir` is `project` (default), `session`, or `temp` and chooses where subagent artifacts are stored. Set `asyncWidget: false` to hide the above-editor background-run widget when a companion footer or dashboard owns that space (run status view remains available). Per-run `artifacts: false` disables artifact capture for that launch. Async status and result artifacts include `lifecycleArtifactVersion` and fields such as `workflowGraph`, `steps`, `results`, `totalTokens`, `totalCost`, `turnCount`, `toolCount`, and nested `children`. Child protocol failures expose a structured `protocolError`; `protocol_output_limit` means a child emitted a JSONL line above the 16 MiB live-parser cap. Prefer these artifacts and `status` views over scraping terminal output.
|
|
23
23
|
|
|
24
24
|
## Best Practices
|
|
25
25
|
|
|
@@ -186,7 +186,7 @@ const run = subagent({
|
|
|
186
186
|
// Continue local inspection, then later call status with the returned id.
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
While children run, the persistent
|
|
189
|
+
While children run, the persistent run status and the collapsed foreground tool-result card show live per-child detail: resolved model and thinking level, `[fresh]`/`[fork]` context, tool/token/elapsed counters, and current activity. The collapsed running card also prints the configured expand-key hint ("Press … for live detail"); expanding it shows nested children, recent tools, and recent output. Model badges appear once the child's model resolves at first attempt start. `subagent({ action: "status" })` opens the live run status view, which also has per-child controls (`s` steer, `D` stop with confirmation). When optional Herdr 0.7.5+ is available, `H` opens a raw inspector dashboard for the selected active async child; this mirrors artifacts rather than attaching to the headless child. Use it for confusing or long-running active async work when the human wants a dedicated visual pane or run status is insufficient, not for routine headless runs.
|
|
190
190
|
|
|
191
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.
|
|
192
192
|
|
|
@@ -236,31 +236,6 @@ Use native `subagent` runs for unattended implementation, review, and gate work
|
|
|
236
236
|
|
|
237
237
|
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
238
|
|
|
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
239
|
### Subagent control
|
|
265
240
|
|
|
266
241
|
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`.
|
|
@@ -326,10 +301,7 @@ are always transcript-visible; choose the watchdog model that matches the desire
|
|
|
326
301
|
cheap-monitor vs strong-reviewer policy.
|
|
327
302
|
|
|
328
303
|
Prefer a strong complementary model (for example Opus 4.8 high paired against a
|
|
329
|
-
GPT 5.5 main session, or the reverse).
|
|
330
|
-
|
|
331
|
-
```text
|
|
332
|
-
/subagents-watchdog recommend-model
|
|
304
|
+
GPT 5.5 main session, or the reverse). ```text
|
|
333
305
|
/subagents-watchdog session model recommended
|
|
334
306
|
/subagents-watchdog on
|
|
335
307
|
/subagents-watchdog status
|
|
@@ -338,8 +310,6 @@ GPT 5.5 main session, or the reverse). Recommendation and configuration:
|
|
|
338
310
|
|
|
339
311
|
```typescript
|
|
340
312
|
subagent({ action: "watchdog.status" })
|
|
341
|
-
subagent({ action: "watchdog.recommend-model" })
|
|
342
|
-
subagent({ action: "watchdog.configure", model: "recommended", scope: "session" })
|
|
343
313
|
subagent({ action: "watchdog.check" })
|
|
344
314
|
```
|
|
345
315
|
|
|
@@ -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.
|