@selesai/code 0.13.12 → 0.13.13
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 +9 -0
- package/package.json +1 -1
- package/dist/bun/cli.d.ts +0 -2
- package/dist/bun/cli.js +0 -10
- package/dist/bun/register-bedrock.d.ts +0 -1
- package/dist/bun/register-bedrock.js +0 -3
- package/dist/bun/restore-sandbox-env.d.ts +0 -16
- package/dist/bun/restore-sandbox-env.js +0 -35
- package/dist/cli/args.d.ts +0 -59
- package/dist/cli/args.js +0 -428
- package/dist/cli/args.test.d.ts +0 -1
- package/dist/cli/args.test.js +0 -32
- package/dist/cli/config-selector.d.ts +0 -15
- package/dist/cli/config-selector.js +0 -30
- package/dist/cli/credential-print.d.ts +0 -22
- package/dist/cli/credential-print.js +0 -116
- package/dist/cli/file-processor.d.ts +0 -14
- package/dist/cli/file-processor.js +0 -69
- package/dist/cli/initial-message.d.ts +0 -17
- package/dist/cli/initial-message.js +0 -21
- package/dist/cli/list-models.d.ts +0 -8
- package/dist/cli/list-models.js +0 -97
- package/dist/cli/project-trust.d.ts +0 -9
- package/dist/cli/project-trust.js +0 -47
- package/dist/cli/session-picker.d.ts +0 -9
- package/dist/cli/session-picker.js +0 -35
- package/dist/cli/startup-ui.d.ts +0 -22
- package/dist/cli/startup-ui.js +0 -172
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -17
- package/dist/config.d.ts +0 -181
- package/dist/config.js +0 -788
- package/dist/core/agent-session-auto-handoff.test.d.ts +0 -1
- package/dist/core/agent-session-auto-handoff.test.js +0 -183
- package/dist/core/agent-session-length-continuation.test.d.ts +0 -1
- package/dist/core/agent-session-length-continuation.test.js +0 -107
- package/dist/core/agent-session-runtime.d.ts +0 -118
- package/dist/core/agent-session-runtime.js +0 -305
- package/dist/core/agent-session-services.d.ts +0 -84
- package/dist/core/agent-session-services.js +0 -132
- package/dist/core/agent-session-skill-block.test.d.ts +0 -1
- package/dist/core/agent-session-skill-block.test.js +0 -19
- package/dist/core/agent-session.d.ts +0 -713
- package/dist/core/agent-session.js +0 -3054
- package/dist/core/agents.d.ts +0 -52
- package/dist/core/agents.js +0 -237
- package/dist/core/auth-guidance.d.ts +0 -4
- package/dist/core/auth-guidance.js +0 -20
- package/dist/core/auth-storage.d.ts +0 -61
- package/dist/core/auth-storage.js +0 -249
- package/dist/core/bash-executor.d.ts +0 -31
- package/dist/core/bash-executor.js +0 -110
- package/dist/core/built-in-extensions.d.ts +0 -2
- package/dist/core/built-in-extensions.js +0 -2
- package/dist/core/cache-stats.d.ts +0 -48
- package/dist/core/cache-stats.js +0 -100
- package/dist/core/compaction/branch-summarization.d.ts +0 -97
- package/dist/core/compaction/branch-summarization.js +0 -246
- package/dist/core/compaction/compaction.d.ts +0 -141
- package/dist/core/compaction/compaction.js +0 -659
- package/dist/core/compaction/index.d.ts +0 -6
- package/dist/core/compaction/index.js +0 -6
- package/dist/core/compaction/utils.d.ts +0 -37
- package/dist/core/compaction/utils.js +0 -141
- package/dist/core/defaults.d.ts +0 -3
- package/dist/core/defaults.js +0 -10
- package/dist/core/diagnostics.d.ts +0 -15
- package/dist/core/diagnostics.js +0 -1
- package/dist/core/event-bus.d.ts +0 -8
- package/dist/core/event-bus.js +0 -24
- package/dist/core/exec.d.ts +0 -28
- package/dist/core/exec.js +0 -74
- package/dist/core/experimental.d.ts +0 -5
- package/dist/core/experimental.js +0 -7
- package/dist/core/export-html/ansi-to-html.d.ts +0 -21
- package/dist/core/export-html/ansi-to-html.js +0 -248
- package/dist/core/export-html/index.d.ts +0 -36
- package/dist/core/export-html/index.js +0 -225
- package/dist/core/export-html/template.css +0 -1066
- package/dist/core/export-html/template.html +0 -55
- package/dist/core/export-html/template.js +0 -1864
- package/dist/core/export-html/tool-renderer.d.ts +0 -33
- package/dist/core/export-html/tool-renderer.js +0 -107
- package/dist/core/export-html/vendor/highlight.min.js +0 -1213
- package/dist/core/export-html/vendor/marked.min.js +0 -78
- package/dist/core/extensions/index.d.ts +0 -11
- package/dist/core/extensions/index.js +0 -8
- package/dist/core/extensions/loader.d.ts +0 -22
- package/dist/core/extensions/loader.js +0 -632
- package/dist/core/extensions/loader.test.d.ts +0 -1
- package/dist/core/extensions/loader.test.js +0 -21
- package/dist/core/extensions/runner.d.ts +0 -176
- package/dist/core/extensions/runner.js +0 -1016
- package/dist/core/extensions/types.d.ts +0 -1313
- package/dist/core/extensions/types.js +0 -44
- package/dist/core/extensions/wrapper.d.ts +0 -19
- package/dist/core/extensions/wrapper.js +0 -40
- package/dist/core/footer-data-provider.d.ts +0 -63
- package/dist/core/footer-data-provider.js +0 -337
- package/dist/core/git-command.d.ts +0 -8
- package/dist/core/git-command.js +0 -48
- package/dist/core/handoff.d.ts +0 -11
- package/dist/core/handoff.js +0 -49
- package/dist/core/http-dispatcher.d.ts +0 -21
- package/dist/core/http-dispatcher.js +0 -90
- package/dist/core/index.d.ts +0 -12
- package/dist/core/index.js +0 -12
- package/dist/core/keybindings.d.ts +0 -421
- package/dist/core/keybindings.js +0 -295
- package/dist/core/llama/client.d.ts +0 -66
- package/dist/core/llama/client.js +0 -308
- package/dist/core/llama/huggingface.d.ts +0 -22
- package/dist/core/llama/huggingface.js +0 -140
- package/dist/core/llama/index.d.ts +0 -2
- package/dist/core/llama/index.js +0 -207
- package/dist/core/llama/provider.d.ts +0 -11
- package/dist/core/llama/provider.js +0 -143
- package/dist/core/llama/ui.d.ts +0 -41
- package/dist/core/llama/ui.js +0 -415
- package/dist/core/messages.d.ts +0 -76
- package/dist/core/messages.js +0 -122
- package/dist/core/model-config.d.ts +0 -547
- package/dist/core/model-config.js +0 -278
- package/dist/core/model-registry.d.ts +0 -45
- package/dist/core/model-registry.js +0 -107
- package/dist/core/model-resolver.d.ts +0 -122
- package/dist/core/model-resolver.js +0 -558
- package/dist/core/model-runtime.d.ts +0 -86
- package/dist/core/model-runtime.js +0 -472
- package/dist/core/models-store.d.ts +0 -16
- package/dist/core/models-store.js +0 -44
- package/dist/core/output-guard.d.ts +0 -6
- package/dist/core/output-guard.js +0 -88
- package/dist/core/package-manager.d.ts +0 -221
- package/dist/core/package-manager.js +0 -2232
- package/dist/core/package-manager.test.d.ts +0 -1
- package/dist/core/package-manager.test.js +0 -58
- package/dist/core/project-trust.d.ts +0 -14
- package/dist/core/project-trust.js +0 -58
- package/dist/core/prompt-templates.d.ts +0 -53
- package/dist/core/prompt-templates.js +0 -235
- package/dist/core/provider-attribution.d.ts +0 -3
- package/dist/core/provider-attribution.js +0 -71
- package/dist/core/provider-composer.d.ts +0 -54
- package/dist/core/provider-composer.js +0 -387
- package/dist/core/radius.d.ts +0 -1
- package/dist/core/radius.js +0 -1
- package/dist/core/remote-catalog-provider.d.ts +0 -4
- package/dist/core/remote-catalog-provider.js +0 -119
- package/dist/core/resolve-config-value.d.ts +0 -29
- package/dist/core/resolve-config-value.js +0 -246
- package/dist/core/resource-loader.d.ts +0 -256
- package/dist/core/resource-loader.js +0 -974
- package/dist/core/runtime-credentials.d.ts +0 -16
- package/dist/core/runtime-credentials.js +0 -41
- package/dist/core/sdk.d.ts +0 -107
- package/dist/core/sdk.js +0 -279
- package/dist/core/session-cwd.d.ts +0 -18
- package/dist/core/session-cwd.js +0 -37
- package/dist/core/session-manager.d.ts +0 -355
- package/dist/core/session-manager.js +0 -1339
- package/dist/core/settings-manager-auto-handoff.test.d.ts +0 -1
- package/dist/core/settings-manager-auto-handoff.test.js +0 -42
- package/dist/core/settings-manager.d.ts +0 -350
- package/dist/core/settings-manager.js +0 -1076
- package/dist/core/skills.d.ts +0 -70
- package/dist/core/skills.js +0 -401
- package/dist/core/slash-commands.d.ts +0 -14
- package/dist/core/slash-commands.js +0 -27
- package/dist/core/source-info.d.ts +0 -17
- package/dist/core/source-info.js +0 -18
- package/dist/core/system-prompt.d.ts +0 -30
- package/dist/core/system-prompt.js +0 -129
- package/dist/core/system-prompt.test.d.ts +0 -1
- package/dist/core/system-prompt.test.js +0 -94
- package/dist/core/telemetry.d.ts +0 -2
- package/dist/core/telemetry.js +0 -8
- package/dist/core/timings.d.ts +0 -9
- package/dist/core/timings.js +0 -40
- package/dist/core/tools/bash.d.ts +0 -86
- package/dist/core/tools/bash.js +0 -409
- package/dist/core/tools/edit-diff.d.ts +0 -105
- package/dist/core/tools/edit-diff.js +0 -423
- package/dist/core/tools/edit.d.ts +0 -50
- package/dist/core/tools/edit.js +0 -285
- package/dist/core/tools/file-mutation-queue.d.ts +0 -5
- package/dist/core/tools/file-mutation-queue.js +0 -51
- package/dist/core/tools/find.d.ts +0 -34
- package/dist/core/tools/find.js +0 -304
- package/dist/core/tools/grep.d.ts +0 -36
- package/dist/core/tools/grep.js +0 -303
- package/dist/core/tools/index.d.ts +0 -42
- package/dist/core/tools/index.js +0 -119
- package/dist/core/tools/ls.d.ts +0 -36
- package/dist/core/tools/ls.js +0 -166
- package/dist/core/tools/output-accumulator.d.ts +0 -51
- package/dist/core/tools/output-accumulator.js +0 -183
- package/dist/core/tools/path-utils.d.ts +0 -9
- package/dist/core/tools/path-utils.js +0 -98
- package/dist/core/tools/powershell.d.ts +0 -15
- package/dist/core/tools/powershell.js +0 -38
- package/dist/core/tools/powershell.test.d.ts +0 -1
- package/dist/core/tools/powershell.test.js +0 -20
- package/dist/core/tools/read-vision.test.d.ts +0 -1
- package/dist/core/tools/read-vision.test.js +0 -122
- package/dist/core/tools/read.d.ts +0 -46
- package/dist/core/tools/read.js +0 -327
- package/dist/core/tools/render-utils.d.ts +0 -23
- package/dist/core/tools/render-utils.js +0 -64
- package/dist/core/tools/tool-definition-wrapper.d.ts +0 -13
- package/dist/core/tools/tool-definition-wrapper.js +0 -35
- package/dist/core/tools/truncate.d.ts +0 -69
- package/dist/core/tools/truncate.js +0 -214
- package/dist/core/tools/write.d.ts +0 -25
- package/dist/core/tools/write.js +0 -198
- package/dist/core/trust-manager.d.ts +0 -35
- package/dist/core/trust-manager.js +0 -201
- package/dist/core/usage-totals.d.ts +0 -20
- package/dist/core/usage-totals.js +0 -61
- package/dist/core/vision-caption.d.ts +0 -30
- package/dist/core/vision-caption.js +0 -62
- package/dist/defaults/models.json +0 -335
- package/dist/defaults/settings.json +0 -61
- package/dist/extensions/agent-browser.test.ts +0 -371
- package/dist/extensions/agent-browser.ts +0 -160
- package/dist/extensions/auto-session-name.test.ts +0 -169
- package/dist/extensions/auto-session-name.ts +0 -100
- package/dist/extensions/context-compaction-reminder.test.ts +0 -82
- package/dist/extensions/context-compaction-reminder.ts +0 -28
- package/dist/extensions/copy-turn.test.ts +0 -383
- package/dist/extensions/copy-turn.ts +0 -146
- package/dist/extensions/cost-reconcile.test.ts +0 -272
- package/dist/extensions/cost-reconcile.ts +0 -264
- package/dist/extensions/grep-app/index.test.ts +0 -406
- package/dist/extensions/grep-app/index.ts +0 -216
- package/dist/extensions/handoff-new.test.ts +0 -434
- package/dist/extensions/handoff-new.ts +0 -129
- package/dist/extensions/herdr-agent-state.ts +0 -310
- package/dist/extensions/inline-skills.test.ts +0 -204
- package/dist/extensions/inline-skills.ts +0 -102
- package/dist/extensions/package.json +0 -32
- package/dist/extensions/pi-hermes-memory/CHANGELOG.md +0 -371
- package/dist/extensions/pi-hermes-memory/LICENSE +0 -21
- package/dist/extensions/pi-hermes-memory/README.md +0 -643
- package/dist/extensions/pi-hermes-memory/docs/0.1/TASKS.md +0 -197
- package/dist/extensions/pi-hermes-memory/docs/0.2/PLAN.md +0 -290
- package/dist/extensions/pi-hermes-memory/docs/0.2/TASKS.md +0 -134
- package/dist/extensions/pi-hermes-memory/docs/0.2/TEST-PLAN.md +0 -216
- package/dist/extensions/pi-hermes-memory/docs/0.3/PLAN.md +0 -330
- package/dist/extensions/pi-hermes-memory/docs/0.3/TASKS.md +0 -125
- package/dist/extensions/pi-hermes-memory/docs/0.4/PLAN.md +0 -160
- package/dist/extensions/pi-hermes-memory/docs/0.4/TASKS.md +0 -113
- package/dist/extensions/pi-hermes-memory/docs/0.6/CHANGELOG.md +0 -57
- package/dist/extensions/pi-hermes-memory/docs/0.6/PLAN.md +0 -202
- package/dist/extensions/pi-hermes-memory/docs/0.6/TASKS.md +0 -144
- package/dist/extensions/pi-hermes-memory/docs/0.7/PLAN.md +0 -349
- package/dist/extensions/pi-hermes-memory/docs/0.7/TASKS.md +0 -110
- package/dist/extensions/pi-hermes-memory/docs/PUBLISHING.md +0 -149
- package/dist/extensions/pi-hermes-memory/docs/ROADMAP.md +0 -468
- package/dist/extensions/pi-hermes-memory/docs/images/memory-architecture.svg +0 -1
- package/dist/extensions/pi-hermes-memory/docs/images/pi-logo.svg +0 -22
- package/dist/extensions/pi-hermes-memory/docs/images/pi_memory.png +0 -0
- package/dist/extensions/pi-hermes-memory/docs/images/pi_memory.svg +0 -19
- package/dist/extensions/pi-hermes-memory/docs/images/security-flow.svg +0 -1
- package/dist/extensions/pi-hermes-memory/docs/images/session-lifecycle.svg +0 -1
- package/dist/extensions/pi-hermes-memory/docs/images/source-architecture.svg +0 -1
- package/dist/extensions/pi-hermes-memory/docs/mermaid/memory-architecture.mmd +0 -49
- package/dist/extensions/pi-hermes-memory/docs/mermaid/security-flow.mmd +0 -40
- package/dist/extensions/pi-hermes-memory/docs/mermaid/session-lifecycle.mmd +0 -56
- package/dist/extensions/pi-hermes-memory/docs/mermaid/source-architecture.mmd +0 -54
- package/dist/extensions/pi-hermes-memory/package-lock.json +0 -3799
- package/dist/extensions/pi-hermes-memory/package.json +0 -66
- package/dist/extensions/pi-hermes-memory/scripts/check-min-sdk.mjs +0 -99
- package/dist/extensions/pi-hermes-memory/scripts/ensure-dev.mjs +0 -57
- package/dist/extensions/pi-hermes-memory/src/auto-consolidation-warning.ts +0 -6
- package/dist/extensions/pi-hermes-memory/src/config.ts +0 -178
- package/dist/extensions/pi-hermes-memory/src/constants.ts +0 -424
- package/dist/extensions/pi-hermes-memory/src/extension-root-migration.ts +0 -639
- package/dist/extensions/pi-hermes-memory/src/handlers/auto-consolidate.ts +0 -401
- package/dist/extensions/pi-hermes-memory/src/handlers/background-review.ts +0 -297
- package/dist/extensions/pi-hermes-memory/src/handlers/child-process-watchdog.mjs +0 -90
- package/dist/extensions/pi-hermes-memory/src/handlers/correction-detector.ts +0 -300
- package/dist/extensions/pi-hermes-memory/src/handlers/index-sessions.ts +0 -86
- package/dist/extensions/pi-hermes-memory/src/handlers/insights.ts +0 -78
- package/dist/extensions/pi-hermes-memory/src/handlers/interview.ts +0 -37
- package/dist/extensions/pi-hermes-memory/src/handlers/learn-memory.ts +0 -186
- package/dist/extensions/pi-hermes-memory/src/handlers/message-parts.ts +0 -27
- package/dist/extensions/pi-hermes-memory/src/handlers/pi-child-process.ts +0 -485
- package/dist/extensions/pi-hermes-memory/src/handlers/preview-context.ts +0 -105
- package/dist/extensions/pi-hermes-memory/src/handlers/review-memory-ops.ts +0 -506
- package/dist/extensions/pi-hermes-memory/src/handlers/session-backfill.ts +0 -145
- package/dist/extensions/pi-hermes-memory/src/handlers/session-flush.ts +0 -151
- package/dist/extensions/pi-hermes-memory/src/handlers/session-live-index.ts +0 -94
- package/dist/extensions/pi-hermes-memory/src/handlers/skills-command.ts +0 -1334
- package/dist/extensions/pi-hermes-memory/src/handlers/standing-pin.ts +0 -111
- package/dist/extensions/pi-hermes-memory/src/handlers/switch-project.ts +0 -75
- package/dist/extensions/pi-hermes-memory/src/handlers/sync-markdown-memories.ts +0 -266
- package/dist/extensions/pi-hermes-memory/src/index.ts +0 -384
- package/dist/extensions/pi-hermes-memory/src/lifecycle-timing.ts +0 -54
- package/dist/extensions/pi-hermes-memory/src/paths.ts +0 -61
- package/dist/extensions/pi-hermes-memory/src/project-context.ts +0 -13
- package/dist/extensions/pi-hermes-memory/src/project-memory-migration.ts +0 -93
- package/dist/extensions/pi-hermes-memory/src/project.ts +0 -157
- package/dist/extensions/pi-hermes-memory/src/prompt-context.ts +0 -55
- package/dist/extensions/pi-hermes-memory/src/store/atomic-lock-coordinator.ts +0 -375
- package/dist/extensions/pi-hermes-memory/src/store/canonical-storage-path.ts +0 -54
- package/dist/extensions/pi-hermes-memory/src/store/content-scanner.ts +0 -101
- package/dist/extensions/pi-hermes-memory/src/store/db.ts +0 -1180
- package/dist/extensions/pi-hermes-memory/src/store/fts-query.ts +0 -101
- package/dist/extensions/pi-hermes-memory/src/store/markdown-mutation-lock.ts +0 -38
- package/dist/extensions/pi-hermes-memory/src/store/memory-lookup.ts +0 -24
- package/dist/extensions/pi-hermes-memory/src/store/memory-store.ts +0 -1191
- package/dist/extensions/pi-hermes-memory/src/store/recovery-maintenance.ts +0 -66
- package/dist/extensions/pi-hermes-memory/src/store/schema.ts +0 -118
- package/dist/extensions/pi-hermes-memory/src/store/session-anchor-search.ts +0 -472
- package/dist/extensions/pi-hermes-memory/src/store/session-indexer.ts +0 -511
- package/dist/extensions/pi-hermes-memory/src/store/session-parser.ts +0 -213
- package/dist/extensions/pi-hermes-memory/src/store/session-search.ts +0 -234
- package/dist/extensions/pi-hermes-memory/src/store/skill-store.ts +0 -950
- package/dist/extensions/pi-hermes-memory/src/store/skill-utils.ts +0 -133
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-memory-store.ts +0 -1002
- package/dist/extensions/pi-hermes-memory/src/store/sqlite-native.ts +0 -241
- package/dist/extensions/pi-hermes-memory/src/store/standing-instructions.ts +0 -247
- package/dist/extensions/pi-hermes-memory/src/tools/memory-search-tool.ts +0 -95
- package/dist/extensions/pi-hermes-memory/src/tools/memory-tool.ts +0 -469
- package/dist/extensions/pi-hermes-memory/src/tools/session-search-tool.ts +0 -246
- package/dist/extensions/pi-hermes-memory/src/tools/shared-output-view.ts +0 -170
- package/dist/extensions/pi-hermes-memory/src/tools/skill-tool.ts +0 -333
- package/dist/extensions/pi-hermes-memory/src/tools/tool-result-views.ts +0 -105
- package/dist/extensions/pi-hermes-memory/src/types.ts +0 -214
- package/dist/extensions/pi-hermes-memory/tests/config.test.ts +0 -434
- package/dist/extensions/pi-hermes-memory/tests/extension-root-migration.test.ts +0 -368
- package/dist/extensions/pi-hermes-memory/tests/handlers/auto-consolidate.test.ts +0 -984
- package/dist/extensions/pi-hermes-memory/tests/handlers/background-review.test.ts +0 -950
- package/dist/extensions/pi-hermes-memory/tests/handlers/correction-detector.test.ts +0 -671
- package/dist/extensions/pi-hermes-memory/tests/handlers/insights.test.ts +0 -157
- package/dist/extensions/pi-hermes-memory/tests/handlers/interview.test.ts +0 -127
- package/dist/extensions/pi-hermes-memory/tests/handlers/pi-child-process.test.ts +0 -905
- package/dist/extensions/pi-hermes-memory/tests/handlers/preview-context.test.ts +0 -152
- package/dist/extensions/pi-hermes-memory/tests/handlers/prompt-context.test.ts +0 -166
- package/dist/extensions/pi-hermes-memory/tests/handlers/resources-discover.test.ts +0 -71
- package/dist/extensions/pi-hermes-memory/tests/handlers/review-memory-ops.test.ts +0 -614
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-backfill.test.ts +0 -192
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-flush.test.ts +0 -677
- package/dist/extensions/pi-hermes-memory/tests/handlers/session-live-index.test.ts +0 -225
- package/dist/extensions/pi-hermes-memory/tests/handlers/skills-command.test.ts +0 -827
- package/dist/extensions/pi-hermes-memory/tests/handlers/standing-pin.test.ts +0 -134
- package/dist/extensions/pi-hermes-memory/tests/handlers/sync-markdown-memories.test.ts +0 -491
- package/dist/extensions/pi-hermes-memory/tests/handlers/system-prompt.test.ts +0 -199
- package/dist/extensions/pi-hermes-memory/tests/handlers/thinking-max.test.ts +0 -64
- package/dist/extensions/pi-hermes-memory/tests/index.test.ts +0 -30
- package/dist/extensions/pi-hermes-memory/tests/integration/flow.test.ts +0 -126
- package/dist/extensions/pi-hermes-memory/tests/lifecycle-timing.test.ts +0 -76
- package/dist/extensions/pi-hermes-memory/tests/paths.test.ts +0 -23
- package/dist/extensions/pi-hermes-memory/tests/project-memory-migration.test.ts +0 -80
- package/dist/extensions/pi-hermes-memory/tests/project-rebinding.test.ts +0 -115
- package/dist/extensions/pi-hermes-memory/tests/project.test.ts +0 -120
- package/dist/extensions/pi-hermes-memory/tests/run-all-timeout.test.ts +0 -107
- package/dist/extensions/pi-hermes-memory/tests/run-all.sh +0 -45
- package/dist/extensions/pi-hermes-memory/tests/store/atomic-lock-coordinator.test.ts +0 -381
- package/dist/extensions/pi-hermes-memory/tests/store/content-scanner.test.ts +0 -388
- package/dist/extensions/pi-hermes-memory/tests/store/db.test.ts +0 -1046
- package/dist/extensions/pi-hermes-memory/tests/store/markdown-mutation-lock.test.ts +0 -34
- package/dist/extensions/pi-hermes-memory/tests/store/memory-store.test.ts +0 -2150
- package/dist/extensions/pi-hermes-memory/tests/store/recovery-maintenance.test.ts +0 -170
- package/dist/extensions/pi-hermes-memory/tests/store/session-anchor-search.test.ts +0 -210
- package/dist/extensions/pi-hermes-memory/tests/store/session-indexer.test.ts +0 -643
- package/dist/extensions/pi-hermes-memory/tests/store/session-parser.test.ts +0 -282
- package/dist/extensions/pi-hermes-memory/tests/store/session-search.test.ts +0 -287
- package/dist/extensions/pi-hermes-memory/tests/store/skill-store.test.ts +0 -678
- package/dist/extensions/pi-hermes-memory/tests/store/skill-utils.test.ts +0 -21
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-lazy-load.test.ts +0 -78
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-memory-store.test.ts +0 -543
- package/dist/extensions/pi-hermes-memory/tests/store/sqlite-native.test.ts +0 -164
- package/dist/extensions/pi-hermes-memory/tests/store/standing-instructions.test.ts +0 -171
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-search-tool.test.ts +0 -84
- package/dist/extensions/pi-hermes-memory/tests/tools/memory-tool.test.ts +0 -709
- package/dist/extensions/pi-hermes-memory/tests/tools/session-search-tool.test.ts +0 -345
- package/dist/extensions/pi-hermes-memory/tests/tools/shared-output-view.test.ts +0 -362
- package/dist/extensions/pi-hermes-memory/tests/tools/skill-tool.test.ts +0 -478
- package/dist/extensions/pi-hermes-memory/tests/tools/tool-result-renderer-wiring.test.ts +0 -40
- package/dist/extensions/pi-hermes-memory/tsconfig.json +0 -19
- package/dist/extensions/pi-intercom/CHANGELOG.md +0 -321
- package/dist/extensions/pi-intercom/LICENSE +0 -21
- package/dist/extensions/pi-intercom/README.md +0 -598
- package/dist/extensions/pi-intercom/banner.png +0 -0
- package/dist/extensions/pi-intercom/broker/broker.ts +0 -1721
- package/dist/extensions/pi-intercom/broker/client-liveness.test.ts +0 -173
- package/dist/extensions/pi-intercom/broker/client.test.ts +0 -83
- package/dist/extensions/pi-intercom/broker/client.ts +0 -793
- package/dist/extensions/pi-intercom/broker/extension-state.ts +0 -197
- package/dist/extensions/pi-intercom/broker/extension.test.ts +0 -486
- package/dist/extensions/pi-intercom/broker/framing.test.ts +0 -114
- package/dist/extensions/pi-intercom/broker/framing.ts +0 -115
- package/dist/extensions/pi-intercom/broker/paths.test.ts +0 -153
- package/dist/extensions/pi-intercom/broker/paths.ts +0 -134
- package/dist/extensions/pi-intercom/broker/protocol.ts +0 -208
- package/dist/extensions/pi-intercom/broker/runtime-claim.test.ts +0 -34
- package/dist/extensions/pi-intercom/broker/runtime-claim.ts +0 -21
- package/dist/extensions/pi-intercom/broker/spawn.test.ts +0 -252
- package/dist/extensions/pi-intercom/broker/spawn.ts +0 -420
- package/dist/extensions/pi-intercom/config.test.ts +0 -104
- package/dist/extensions/pi-intercom/config.ts +0 -163
- package/dist/extensions/pi-intercom/cwd.test.ts +0 -40
- package/dist/extensions/pi-intercom/cwd.ts +0 -31
- package/dist/extensions/pi-intercom/extension-api.ts +0 -84
- package/dist/extensions/pi-intercom/format-context.test.ts +0 -31
- package/dist/extensions/pi-intercom/format-context.ts +0 -32
- package/dist/extensions/pi-intercom/index.ts +0 -2821
- package/dist/extensions/pi-intercom/intercom.integration.test.ts +0 -4232
- package/dist/extensions/pi-intercom/package.json +0 -49
- package/dist/extensions/pi-intercom/project-agent.test.ts +0 -145
- package/dist/extensions/pi-intercom/project-agent.ts +0 -324
- package/dist/extensions/pi-intercom/reply-tracker.test.ts +0 -239
- package/dist/extensions/pi-intercom/reply-tracker.ts +0 -160
- package/dist/extensions/pi-intercom/skills/pi-intercom/SKILL.md +0 -452
- package/dist/extensions/pi-intercom/test/inline-message.test.ts +0 -184
- package/dist/extensions/pi-intercom/test/overlay-width.test.ts +0 -66
- package/dist/extensions/pi-intercom/types.ts +0 -165
- package/dist/extensions/pi-intercom/ui/compose.ts +0 -143
- package/dist/extensions/pi-intercom/ui/inline-message.ts +0 -118
- package/dist/extensions/pi-intercom/ui/session-list.ts +0 -166
- package/dist/extensions/pi-rewind-hook/README.md +0 -248
- package/dist/extensions/pi-rewind-hook/index.ts +0 -1575
- package/dist/extensions/pi-rewind-hook/package.json +0 -31
- package/dist/extensions/pi-subagents/.github/assets/subagent-fleet-inspector.png +0 -0
- package/dist/extensions/pi-subagents/.github/workflows/release.yml +0 -28
- package/dist/extensions/pi-subagents/.github/workflows/test.yml +0 -51
- package/dist/extensions/pi-subagents/.greptile/config.json +0 -33
- package/dist/extensions/pi-subagents/.greptile/files.json +0 -8
- package/dist/extensions/pi-subagents/.greptile/rules.md +0 -16
- package/dist/extensions/pi-subagents/.oxlintrc.json +0 -43
- package/dist/extensions/pi-subagents/AGENTS.md +0 -5
- package/dist/extensions/pi-subagents/CHANGELOG.md +0 -2249
- package/dist/extensions/pi-subagents/LICENSE +0 -21
- package/dist/extensions/pi-subagents/README.md +0 -126
- package/dist/extensions/pi-subagents/VISION.md +0 -81
- package/dist/extensions/pi-subagents/agents/delegate.md +0 -14
- package/dist/extensions/pi-subagents/agents/oracle.md +0 -78
- package/dist/extensions/pi-subagents/agents/researcher.md +0 -52
- package/dist/extensions/pi-subagents/agents/reviewer.md +0 -89
- package/dist/extensions/pi-subagents/agents/scout.md +0 -50
- package/dist/extensions/pi-subagents/agents/worker.md +0 -60
- package/dist/extensions/pi-subagents/async-retention-discovery-worker.mjs +0 -180
- package/dist/extensions/pi-subagents/docs/agents.md +0 -375
- package/dist/extensions/pi-subagents/docs/configuration.md +0 -508
- package/dist/extensions/pi-subagents/docs/extension-api.md +0 -443
- package/dist/extensions/pi-subagents/docs/missions.md +0 -121
- package/dist/extensions/pi-subagents/docs/models.md +0 -258
- package/dist/extensions/pi-subagents/docs/observability.md +0 -262
- package/dist/extensions/pi-subagents/docs/tool-reference.md +0 -482
- package/dist/extensions/pi-subagents/docs/watchdog.md +0 -176
- package/dist/extensions/pi-subagents/docs/workflows.md +0 -475
- package/dist/extensions/pi-subagents/index.ts +0 -10
- package/dist/extensions/pi-subagents/inspector-runner.mjs +0 -11
- package/dist/extensions/pi-subagents/install.mjs +0 -94
- package/dist/extensions/pi-subagents/package-lock.json +0 -1872
- package/dist/extensions/pi-subagents/package.json +0 -109
- package/dist/extensions/pi-subagents/prompts/council.md +0 -60
- package/dist/extensions/pi-subagents/prompts/gather-context-and-clarify.md +0 -13
- package/dist/extensions/pi-subagents/prompts/parallel-cleanup.md +0 -59
- package/dist/extensions/pi-subagents/prompts/parallel-research.md +0 -50
- package/dist/extensions/pi-subagents/prompts/parallel-review.md +0 -58
- package/dist/extensions/pi-subagents/prompts/review-loop.md +0 -47
- package/dist/extensions/pi-subagents/skills/council-mode/SKILL.md +0 -59
- package/dist/extensions/pi-subagents/skills/council-mode/references/pass-contracts.md +0 -150
- package/dist/extensions/pi-subagents/skills/pi-subagents/SKILL.md +0 -103
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/constraints-and-recipes.md +0 -70
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/execution-controls.md +0 -539
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/management-authoring-rpc.md +0 -161
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/multi-lane-orchestration.md +0 -51
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/prompting-and-roles.md +0 -295
- package/dist/extensions/pi-subagents/skills/pi-subagents/references/review-and-validation.md +0 -73
- package/dist/extensions/pi-subagents/src/agents/agent-management.ts +0 -1336
- package/dist/extensions/pi-subagents/src/agents/agent-memory.ts +0 -254
- package/dist/extensions/pi-subagents/src/agents/agent-refinements.ts +0 -624
- package/dist/extensions/pi-subagents/src/agents/agent-scope.ts +0 -6
- package/dist/extensions/pi-subagents/src/agents/agent-selection.ts +0 -25
- package/dist/extensions/pi-subagents/src/agents/agent-serializer.ts +0 -176
- package/dist/extensions/pi-subagents/src/agents/agents.ts +0 -2794
- package/dist/extensions/pi-subagents/src/agents/builtin-names.ts +0 -9
- package/dist/extensions/pi-subagents/src/agents/chain-serializer.ts +0 -280
- package/dist/extensions/pi-subagents/src/agents/frontmatter.ts +0 -153
- package/dist/extensions/pi-subagents/src/agents/identity.ts +0 -30
- package/dist/extensions/pi-subagents/src/agents/proactive-skills.ts +0 -194
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-events.ts +0 -70
- package/dist/extensions/pi-subagents/src/agents/runtime-agent-registry.ts +0 -425
- package/dist/extensions/pi-subagents/src/agents/skills.ts +0 -754
- package/dist/extensions/pi-subagents/src/api/agents.ts +0 -12
- package/dist/extensions/pi-subagents/src/api/background-work.ts +0 -206
- package/dist/extensions/pi-subagents/src/api/capability-ceiling.ts +0 -17
- package/dist/extensions/pi-subagents/src/api/control-channel.ts +0 -4
- package/dist/extensions/pi-subagents/src/api/delegation.ts +0 -112
- package/dist/extensions/pi-subagents/src/api/external-job-provider.ts +0 -195
- package/dist/extensions/pi-subagents/src/api/external-runs.ts +0 -282
- package/dist/extensions/pi-subagents/src/api/intercom-bridge.ts +0 -3
- package/dist/extensions/pi-subagents/src/api/pi-args.ts +0 -5
- package/dist/extensions/pi-subagents/src/api/preflight.ts +0 -497
- package/dist/extensions/pi-subagents/src/api/project-panes.ts +0 -32
- package/dist/extensions/pi-subagents/src/api/shared-types.ts +0 -24
- package/dist/extensions/pi-subagents/src/extension/config.ts +0 -235
- package/dist/extensions/pi-subagents/src/extension/control-notices.ts +0 -58
- package/dist/extensions/pi-subagents/src/extension/doctor.ts +0 -278
- package/dist/extensions/pi-subagents/src/extension/fanout-child.ts +0 -205
- package/dist/extensions/pi-subagents/src/extension/index.ts +0 -1093
- package/dist/extensions/pi-subagents/src/extension/public-execution.ts +0 -209
- package/dist/extensions/pi-subagents/src/extension/rpc.ts +0 -860
- package/dist/extensions/pi-subagents/src/extension/schemas.ts +0 -415
- package/dist/extensions/pi-subagents/src/extension/steering-notices.ts +0 -35
- package/dist/extensions/pi-subagents/src/extension/subagent-guide.ts +0 -39
- package/dist/extensions/pi-subagents/src/extension/tool-description.ts +0 -204
- package/dist/extensions/pi-subagents/src/extension/tool-result.ts +0 -19
- package/dist/extensions/pi-subagents/src/inspectors/herdr/actions.ts +0 -235
- package/dist/extensions/pi-subagents/src/inspectors/herdr/client.ts +0 -130
- package/dist/extensions/pi-subagents/src/inspectors/herdr/focus.ts +0 -55
- package/dist/extensions/pi-subagents/src/inspectors/herdr/inspector-runner.ts +0 -147
- package/dist/extensions/pi-subagents/src/inspectors/herdr/project-panes.ts +0 -730
- package/dist/extensions/pi-subagents/src/inspectors/herdr/session-roots-codec.ts +0 -42
- package/dist/extensions/pi-subagents/src/inspectors/herdr/shell-command.ts +0 -16
- package/dist/extensions/pi-subagents/src/integrations/herdr-status.ts +0 -396
- package/dist/extensions/pi-subagents/src/intercom/intercom-bridge.ts +0 -191
- package/dist/extensions/pi-subagents/src/intercom/native-supervisor-channel.ts +0 -812
- package/dist/extensions/pi-subagents/src/intercom/result-intercom.ts +0 -423
- package/dist/extensions/pi-subagents/src/missions/actions.ts +0 -433
- package/dist/extensions/pi-subagents/src/missions/goal-driver.ts +0 -164
- package/dist/extensions/pi-subagents/src/missions/lifecycle.ts +0 -367
- package/dist/extensions/pi-subagents/src/missions/store.ts +0 -584
- package/dist/extensions/pi-subagents/src/missions/types.ts +0 -190
- package/dist/extensions/pi-subagents/src/missions/workflow-state.ts +0 -260
- package/dist/extensions/pi-subagents/src/policy/authority.ts +0 -46
- package/dist/extensions/pi-subagents/src/profiles/profiles.ts +0 -662
- package/dist/extensions/pi-subagents/src/runs/background/active-async-capacity.ts +0 -498
- package/dist/extensions/pi-subagents/src/runs/background/active-run-index.ts +0 -139
- package/dist/extensions/pi-subagents/src/runs/background/async-execution.ts +0 -2000
- package/dist/extensions/pi-subagents/src/runs/background/async-job-tracker.ts +0 -781
- package/dist/extensions/pi-subagents/src/runs/background/async-resume.ts +0 -627
- package/dist/extensions/pi-subagents/src/runs/background/async-retention.ts +0 -903
- package/dist/extensions/pi-subagents/src/runs/background/async-status-snapshot.ts +0 -48
- package/dist/extensions/pi-subagents/src/runs/background/async-status.ts +0 -745
- package/dist/extensions/pi-subagents/src/runs/background/auto-drain.ts +0 -68
- package/dist/extensions/pi-subagents/src/runs/background/chain-append.ts +0 -321
- package/dist/extensions/pi-subagents/src/runs/background/chain-root-attachment.ts +0 -270
- package/dist/extensions/pi-subagents/src/runs/background/completion-batcher.ts +0 -168
- package/dist/extensions/pi-subagents/src/runs/background/completion-dedupe.ts +0 -58
- package/dist/extensions/pi-subagents/src/runs/background/completion-replay.ts +0 -287
- package/dist/extensions/pi-subagents/src/runs/background/control-channel.ts +0 -768
- package/dist/extensions/pi-subagents/src/runs/background/fleet-view.ts +0 -620
- package/dist/extensions/pi-subagents/src/runs/background/index-segment.ts +0 -59
- package/dist/extensions/pi-subagents/src/runs/background/inspect-rpc.ts +0 -443
- package/dist/extensions/pi-subagents/src/runs/background/notify.ts +0 -594
- package/dist/extensions/pi-subagents/src/runs/background/owned-process-tree.ts +0 -104
- package/dist/extensions/pi-subagents/src/runs/background/parallel-groups.ts +0 -45
- package/dist/extensions/pi-subagents/src/runs/background/process-terminal.ts +0 -294
- package/dist/extensions/pi-subagents/src/runs/background/result-delivery-ownership.ts +0 -45
- package/dist/extensions/pi-subagents/src/runs/background/result-files.ts +0 -519
- package/dist/extensions/pi-subagents/src/runs/background/result-watcher.ts +0 -792
- package/dist/extensions/pi-subagents/src/runs/background/resume-guidance.ts +0 -56
- package/dist/extensions/pi-subagents/src/runs/background/retained-children.ts +0 -135
- package/dist/extensions/pi-subagents/src/runs/background/run-id-query.ts +0 -7
- package/dist/extensions/pi-subagents/src/runs/background/run-id-resolver.ts +0 -175
- package/dist/extensions/pi-subagents/src/runs/background/run-status.ts +0 -694
- package/dist/extensions/pi-subagents/src/runs/background/scheduled-runs.ts +0 -908
- package/dist/extensions/pi-subagents/src/runs/background/stale-run-reconciler.ts +0 -410
- package/dist/extensions/pi-subagents/src/runs/background/steering.ts +0 -239
- package/dist/extensions/pi-subagents/src/runs/background/subagent-runner.ts +0 -5626
- package/dist/extensions/pi-subagents/src/runs/background/subagent-wait.ts +0 -725
- package/dist/extensions/pi-subagents/src/runs/background/terminal-run-index.ts +0 -138
- package/dist/extensions/pi-subagents/src/runs/background/top-level-async.ts +0 -14
- package/dist/extensions/pi-subagents/src/runs/background/wait-completions.ts +0 -196
- package/dist/extensions/pi-subagents/src/runs/background/wait-config.ts +0 -50
- package/dist/extensions/pi-subagents/src/runs/background/wait-subscriptions.ts +0 -348
- package/dist/extensions/pi-subagents/src/runs/background/wait-tool.ts +0 -49
- package/dist/extensions/pi-subagents/src/runs/foreground/async-dismiss-action.ts +0 -86
- package/dist/extensions/pi-subagents/src/runs/foreground/async-steering-action.ts +0 -262
- package/dist/extensions/pi-subagents/src/runs/foreground/async-stop-action.ts +0 -86
- package/dist/extensions/pi-subagents/src/runs/foreground/execution.ts +0 -2430
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-control.ts +0 -153
- package/dist/extensions/pi-subagents/src/runs/foreground/foreground-history.ts +0 -160
- package/dist/extensions/pi-subagents/src/runs/foreground/prompt-audit.ts +0 -172
- package/dist/extensions/pi-subagents/src/runs/foreground/subagent-executor.ts +0 -6918
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-detach-reconcile.ts +0 -299
- package/dist/extensions/pi-subagents/src/runs/foreground/workflow-foreground-steering.ts +0 -188
- package/dist/extensions/pi-subagents/src/runs/shared/abort-recovery.ts +0 -119
- package/dist/extensions/pi-subagents/src/runs/shared/acceptance.ts +0 -1448
- package/dist/extensions/pi-subagents/src/runs/shared/agent-contract.ts +0 -38
- package/dist/extensions/pi-subagents/src/runs/shared/async-status-projection.ts +0 -597
- package/dist/extensions/pi-subagents/src/runs/shared/background-process-options.ts +0 -9
- package/dist/extensions/pi-subagents/src/runs/shared/capability-ceiling.ts +0 -209
- package/dist/extensions/pi-subagents/src/runs/shared/chain-outputs.ts +0 -116
- package/dist/extensions/pi-subagents/src/runs/shared/child-identity.ts +0 -51
- package/dist/extensions/pi-subagents/src/runs/shared/child-launch-plan.ts +0 -151
- package/dist/extensions/pi-subagents/src/runs/shared/child-protocol.ts +0 -415
- package/dist/extensions/pi-subagents/src/runs/shared/completion-evidence.ts +0 -89
- package/dist/extensions/pi-subagents/src/runs/shared/completion-guard.ts +0 -252
- package/dist/extensions/pi-subagents/src/runs/shared/context-mode.ts +0 -44
- package/dist/extensions/pi-subagents/src/runs/shared/dynamic-fanout.ts +0 -297
- package/dist/extensions/pi-subagents/src/runs/shared/extension-bindings.ts +0 -78
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-contract.ts +0 -138
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-preflight.ts +0 -122
- package/dist/extensions/pi-subagents/src/runs/shared/external-cli-runner.ts +0 -429
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-bridge.ts +0 -460
- package/dist/extensions/pi-subagents/src/runs/shared/external-job-runner.ts +0 -389
- package/dist/extensions/pi-subagents/src/runs/shared/fast-mode-extension.ts +0 -10
- package/dist/extensions/pi-subagents/src/runs/shared/host-step-status.ts +0 -231
- package/dist/extensions/pi-subagents/src/runs/shared/lane-metadata.ts +0 -105
- package/dist/extensions/pi-subagents/src/runs/shared/launch-cwd.ts +0 -16
- package/dist/extensions/pi-subagents/src/runs/shared/llm-intent-arbiter.ts +0 -302
- package/dist/extensions/pi-subagents/src/runs/shared/long-running-guard.ts +0 -221
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-config-sources.ts +0 -422
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-allowlist.ts +0 -483
- package/dist/extensions/pi-subagents/src/runs/shared/mcp-direct-tool-grant.ts +0 -194
- package/dist/extensions/pi-subagents/src/runs/shared/model-exclusions.ts +0 -305
- package/dist/extensions/pi-subagents/src/runs/shared/model-fallback.ts +0 -578
- package/dist/extensions/pi-subagents/src/runs/shared/model-scope.ts +0 -205
- package/dist/extensions/pi-subagents/src/runs/shared/mutation-evidence.ts +0 -199
- package/dist/extensions/pi-subagents/src/runs/shared/nested-events.ts +0 -1086
- package/dist/extensions/pi-subagents/src/runs/shared/nested-path.ts +0 -52
- package/dist/extensions/pi-subagents/src/runs/shared/nested-render.ts +0 -127
- package/dist/extensions/pi-subagents/src/runs/shared/orca-progress-tabs.ts +0 -499
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-handoff.ts +0 -692
- package/dist/extensions/pi-subagents/src/runs/shared/parallel-utils.ts +0 -279
- package/dist/extensions/pi-subagents/src/runs/shared/permissions.ts +0 -99
- package/dist/extensions/pi-subagents/src/runs/shared/pi-args.ts +0 -1044
- package/dist/extensions/pi-subagents/src/runs/shared/pi-spawn.ts +0 -163
- package/dist/extensions/pi-subagents/src/runs/shared/process-signal.ts +0 -32
- package/dist/extensions/pi-subagents/src/runs/shared/run-fanout-budget.ts +0 -280
- package/dist/extensions/pi-subagents/src/runs/shared/run-history.ts +0 -201
- package/dist/extensions/pi-subagents/src/runs/shared/runtime-acknowledged-extensions.ts +0 -71
- package/dist/extensions/pi-subagents/src/runs/shared/session-lease.ts +0 -293
- package/dist/extensions/pi-subagents/src/runs/shared/single-output.ts +0 -304
- package/dist/extensions/pi-subagents/src/runs/shared/spawn-budget.ts +0 -128
- package/dist/extensions/pi-subagents/src/runs/shared/structured-output.ts +0 -196
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-control.ts +0 -290
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-prompt-runtime.ts +0 -808
- package/dist/extensions/pi-subagents/src/runs/shared/subagent-startup-retry.ts +0 -116
- package/dist/extensions/pi-subagents/src/runs/shared/task-intent.ts +0 -197
- package/dist/extensions/pi-subagents/src/runs/shared/tool-availability.ts +0 -81
- package/dist/extensions/pi-subagents/src/runs/shared/tool-budget.ts +0 -80
- package/dist/extensions/pi-subagents/src/runs/shared/tool-timeout.ts +0 -93
- package/dist/extensions/pi-subagents/src/runs/shared/usage-budget.ts +0 -65
- package/dist/extensions/pi-subagents/src/runs/shared/workflow-graph.ts +0 -225
- package/dist/extensions/pi-subagents/src/runs/shared/worktree-cleanup-plan.ts +0 -847
- package/dist/extensions/pi-subagents/src/runs/shared/worktree.ts +0 -802
- package/dist/extensions/pi-subagents/src/shared/accessible-dir.ts +0 -47
- package/dist/extensions/pi-subagents/src/shared/agent-stream-options.ts +0 -5
- package/dist/extensions/pi-subagents/src/shared/artifacts.ts +0 -281
- package/dist/extensions/pi-subagents/src/shared/atomic-json.ts +0 -81
- package/dist/extensions/pi-subagents/src/shared/capacity-resilient-json.ts +0 -102
- package/dist/extensions/pi-subagents/src/shared/child-session-name.ts +0 -46
- package/dist/extensions/pi-subagents/src/shared/child-transcript.ts +0 -264
- package/dist/extensions/pi-subagents/src/shared/completion-owner.ts +0 -14
- package/dist/extensions/pi-subagents/src/shared/display-text.ts +0 -150
- package/dist/extensions/pi-subagents/src/shared/extension-context.ts +0 -24
- package/dist/extensions/pi-subagents/src/shared/file-coalescer.ts +0 -49
- package/dist/extensions/pi-subagents/src/shared/file-system-retry.ts +0 -95
- package/dist/extensions/pi-subagents/src/shared/fork-context.ts +0 -305
- package/dist/extensions/pi-subagents/src/shared/formatters.ts +0 -146
- package/dist/extensions/pi-subagents/src/shared/jsonl-writer.ts +0 -81
- package/dist/extensions/pi-subagents/src/shared/launch-contract.ts +0 -135
- package/dist/extensions/pi-subagents/src/shared/model-info.ts +0 -101
- package/dist/extensions/pi-subagents/src/shared/node-executable.ts +0 -21
- package/dist/extensions/pi-subagents/src/shared/post-exit-stdio-guard.ts +0 -85
- package/dist/extensions/pi-subagents/src/shared/prompt-resources.ts +0 -11
- package/dist/extensions/pi-subagents/src/shared/pruned-fork.ts +0 -450
- package/dist/extensions/pi-subagents/src/shared/session-file-trust.ts +0 -19
- package/dist/extensions/pi-subagents/src/shared/session-identity.ts +0 -10
- package/dist/extensions/pi-subagents/src/shared/session-tokens.ts +0 -55
- package/dist/extensions/pi-subagents/src/shared/settings.ts +0 -409
- package/dist/extensions/pi-subagents/src/shared/shortcuts.ts +0 -17
- package/dist/extensions/pi-subagents/src/shared/status-format.ts +0 -55
- package/dist/extensions/pi-subagents/src/shared/thinking-ceiling.ts +0 -52
- package/dist/extensions/pi-subagents/src/shared/types.ts +0 -2834
- package/dist/extensions/pi-subagents/src/shared/utf8.ts +0 -11
- package/dist/extensions/pi-subagents/src/shared/utils.ts +0 -590
- package/dist/extensions/pi-subagents/src/shared/watch-strategy.ts +0 -10
- package/dist/extensions/pi-subagents/src/shared/workflow-child-permit.ts +0 -207
- package/dist/extensions/pi-subagents/src/slash/delegation-adapters.ts +0 -426
- package/dist/extensions/pi-subagents/src/slash/delegation-json.ts +0 -108
- package/dist/extensions/pi-subagents/src/slash/delegation-request.ts +0 -162
- package/dist/extensions/pi-subagents/src/slash/prompt-template-bridge.ts +0 -419
- package/dist/extensions/pi-subagents/src/slash/prompt-workflows.ts +0 -287
- package/dist/extensions/pi-subagents/src/slash/selector.ts +0 -147
- package/dist/extensions/pi-subagents/src/slash/slash-bridge.ts +0 -192
- package/dist/extensions/pi-subagents/src/slash/slash-commands.ts +0 -1345
- package/dist/extensions/pi-subagents/src/slash/slash-live-state.ts +0 -310
- package/dist/extensions/pi-subagents/src/slash/subagents-admin.ts +0 -435
- package/dist/extensions/pi-subagents/src/tui/fleet-status.ts +0 -905
- package/dist/extensions/pi-subagents/src/tui/fleet-transcript.ts +0 -536
- package/dist/extensions/pi-subagents/src/tui/fleet.ts +0 -1436
- package/dist/extensions/pi-subagents/src/tui/render-helpers.ts +0 -111
- package/dist/extensions/pi-subagents/src/tui/render.ts +0 -3146
- package/dist/extensions/pi-subagents/src/types/pi-runtime-compat.d.ts +0 -8
- package/dist/extensions/pi-subagents/src/watchdog/change-signature.ts +0 -260
- package/dist/extensions/pi-subagents/src/watchdog/child-status.ts +0 -205
- package/dist/extensions/pi-subagents/src/watchdog/emission-guard.ts +0 -123
- package/dist/extensions/pi-subagents/src/watchdog/lsp-diagnostics.ts +0 -538
- package/dist/extensions/pi-subagents/src/watchdog/model-selection.ts +0 -167
- package/dist/extensions/pi-subagents/src/watchdog/permission-arbiter.ts +0 -154
- package/dist/extensions/pi-subagents/src/watchdog/register-child.ts +0 -117
- package/dist/extensions/pi-subagents/src/watchdog/register-main.ts +0 -440
- package/dist/extensions/pi-subagents/src/watchdog/render.ts +0 -54
- package/dist/extensions/pi-subagents/src/watchdog/review.ts +0 -303
- package/dist/extensions/pi-subagents/src/watchdog/runtime.ts +0 -868
- package/dist/extensions/pi-subagents/src/watchdog/scope.ts +0 -62
- package/dist/extensions/pi-subagents/src/watchdog/settings.ts +0 -568
- package/dist/extensions/pi-subagents/src/watchdog/tool-actions.ts +0 -155
- package/dist/extensions/pi-subagents/src/watchdog/turn-delta.ts +0 -161
- package/dist/extensions/pi-subagents/src/watchdog/types.ts +0 -198
- package/dist/extensions/pi-subagents/src/watchdog/warning-format.ts +0 -73
- package/dist/extensions/pi-subagents/src/workflows/chat-progress.ts +0 -151
- package/dist/extensions/pi-subagents/src/workflows/host-command.ts +0 -235
- package/dist/extensions/pi-subagents/src/workflows/scripted-workflow.ts +0 -2183
- package/dist/extensions/pi-subagents/src/workflows/workflow-child-summary.ts +0 -121
- package/dist/extensions/pi-subagents/src/workflows/workflow-preflight.ts +0 -270
- package/dist/extensions/pi-subagents/src/workflows/workflow-receipt.ts +0 -330
- package/dist/extensions/pi-subagents/src/workflows/workflow-resources.ts +0 -150
- package/dist/extensions/pi-subagents/src/workflows/workflow-settlement.ts +0 -246
- package/dist/extensions/pi-subagents/test/e2e/real-session-subagent.test.ts +0 -224
- 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 -1261
- 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/fixtures/pi-coding-agent-shim/index.mjs +0 -84
- package/dist/extensions/pi-subagents/test/fixtures/pi-coding-agent-shim/package.json +0 -14
- package/dist/extensions/pi-subagents/test/integration/acceptance-file-report.test.ts +0 -472
- package/dist/extensions/pi-subagents/test/integration/async-execution.test.ts +0 -6672
- package/dist/extensions/pi-subagents/test/integration/async-job-tracker.test.ts +0 -1997
- package/dist/extensions/pi-subagents/test/integration/async-status.test.ts +0 -1300
- package/dist/extensions/pi-subagents/test/integration/detect-error.test.ts +0 -249
- package/dist/extensions/pi-subagents/test/integration/doctor-executor.test.ts +0 -128
- package/dist/extensions/pi-subagents/test/integration/error-handling.test.ts +0 -281
- package/dist/extensions/pi-subagents/test/integration/external-cli-runner.test.ts +0 -167
- package/dist/extensions/pi-subagents/test/integration/foreground-result-size.test.ts +0 -188
- package/dist/extensions/pi-subagents/test/integration/fork-context-execution.test.ts +0 -1352
- package/dist/extensions/pi-subagents/test/integration/intercom-result-delivery.test.ts +0 -1947
- package/dist/extensions/pi-subagents/test/integration/orca-progress-tabs.test.ts +0 -214
- package/dist/extensions/pi-subagents/test/integration/render-fork-badge.test.ts +0 -1408
- package/dist/extensions/pi-subagents/test/integration/render-widget.test.ts +0 -2091
- package/dist/extensions/pi-subagents/test/integration/result-watcher.test.ts +0 -2442
- package/dist/extensions/pi-subagents/test/integration/session-tokens.test.ts +0 -62
- package/dist/extensions/pi-subagents/test/integration/single-execution.test.ts +0 -9007
- package/dist/extensions/pi-subagents/test/integration/slash-commands.test.ts +0 -1516
- package/dist/extensions/pi-subagents/test/integration/slash-live-state.test.ts +0 -166
- package/dist/extensions/pi-subagents/test/integration/template-resolution.test.ts +0 -344
- package/dist/extensions/pi-subagents/test/integration/top-level-async.test.ts +0 -43
- package/dist/extensions/pi-subagents/test/support/cursor-smoke-inputs.ts +0 -51
- package/dist/extensions/pi-subagents/test/support/helpers.ts +0 -225
- package/dist/extensions/pi-subagents/test/support/isolated-temp-root.mjs +0 -9
- package/dist/extensions/pi-subagents/test/support/mock-pi-script.mjs +0 -432
- package/dist/extensions/pi-subagents/test/support/mock-pi.ts +0 -159
- package/dist/extensions/pi-subagents/test/support/node-command.ts +0 -15
- package/dist/extensions/pi-subagents/test/support/real-session-child-cli.mjs +0 -185
- package/dist/extensions/pi-subagents/test/support/real-session-runner.ts +0 -311
- package/dist/extensions/pi-subagents/test/support/register-loader.mjs +0 -16
- package/dist/extensions/pi-subagents/test/support/session-lease-child.mjs +0 -42
- package/dist/extensions/pi-subagents/test/support/ts-loader.mjs +0 -100
- package/dist/extensions/pi-subagents/test/unit/abort-recovery.test.ts +0 -152
- package/dist/extensions/pi-subagents/test/unit/acceptance.test.ts +0 -1475
- package/dist/extensions/pi-subagents/test/unit/accessible-dir.test.ts +0 -82
- package/dist/extensions/pi-subagents/test/unit/active-async-capacity.test.ts +0 -415
- package/dist/extensions/pi-subagents/test/unit/agent-contract.test.ts +0 -14
- package/dist/extensions/pi-subagents/test/unit/agent-disabled.test.ts +0 -213
- package/dist/extensions/pi-subagents/test/unit/agent-discovery-cache.test.ts +0 -232
- package/dist/extensions/pi-subagents/test/unit/agent-eject-disable.test.ts +0 -343
- package/dist/extensions/pi-subagents/test/unit/agent-frontmatter.test.ts +0 -2304
- package/dist/extensions/pi-subagents/test/unit/agent-management.test.ts +0 -1195
- package/dist/extensions/pi-subagents/test/unit/agent-memory.test.ts +0 -420
- package/dist/extensions/pi-subagents/test/unit/agent-overrides.test.ts +0 -1153
- package/dist/extensions/pi-subagents/test/unit/agent-refinements.test.ts +0 -178
- package/dist/extensions/pi-subagents/test/unit/agent-scope.test.ts +0 -20
- package/dist/extensions/pi-subagents/test/unit/agent-selection.test.ts +0 -88
- package/dist/extensions/pi-subagents/test/unit/agent-stream-options.test.ts +0 -14
- package/dist/extensions/pi-subagents/test/unit/anti-slop-oxlint.test.ts +0 -98
- package/dist/extensions/pi-subagents/test/unit/artifacts.test.ts +0 -78
- package/dist/extensions/pi-subagents/test/unit/async-execution.test.ts +0 -254
- package/dist/extensions/pi-subagents/test/unit/async-interrupt-action.test.ts +0 -1022
- package/dist/extensions/pi-subagents/test/unit/async-permission-session.test.ts +0 -100
- package/dist/extensions/pi-subagents/test/unit/async-recovery-descriptor.test.ts +0 -188
- package/dist/extensions/pi-subagents/test/unit/async-resume.test.ts +0 -976
- package/dist/extensions/pi-subagents/test/unit/async-retention.test.ts +0 -632
- package/dist/extensions/pi-subagents/test/unit/async-status-projection.test.ts +0 -246
- package/dist/extensions/pi-subagents/test/unit/async-status-snapshot.test.ts +0 -204
- package/dist/extensions/pi-subagents/test/unit/atomic-json.test.ts +0 -176
- package/dist/extensions/pi-subagents/test/unit/authority-policy.test.ts +0 -22
- package/dist/extensions/pi-subagents/test/unit/auto-drain.test.ts +0 -83
- package/dist/extensions/pi-subagents/test/unit/background-process-options.test.ts +0 -17
- package/dist/extensions/pi-subagents/test/unit/background-work.test.ts +0 -365
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-agent-allowlist.test.ts +0 -102
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling-pi-args.test.ts +0 -84
- package/dist/extensions/pi-subagents/test/unit/capability-ceiling.test.ts +0 -68
- package/dist/extensions/pi-subagents/test/unit/capacity-resilient-json.test.ts +0 -155
- package/dist/extensions/pi-subagents/test/unit/chain-append.test.ts +0 -283
- package/dist/extensions/pi-subagents/test/unit/chain-root-attachment.test.ts +0 -236
- package/dist/extensions/pi-subagents/test/unit/chain-serializer.test.ts +0 -229
- package/dist/extensions/pi-subagents/test/unit/child-launch-plan.test.ts +0 -94
- package/dist/extensions/pi-subagents/test/unit/child-protocol.test.ts +0 -202
- package/dist/extensions/pi-subagents/test/unit/child-session-name.test.ts +0 -50
- package/dist/extensions/pi-subagents/test/unit/child-transcript.test.ts +0 -267
- package/dist/extensions/pi-subagents/test/unit/close-grace-timer.test.ts +0 -101
- package/dist/extensions/pi-subagents/test/unit/compaction-resume.test.ts +0 -98
- package/dist/extensions/pi-subagents/test/unit/completion-batcher.test.ts +0 -230
- package/dist/extensions/pi-subagents/test/unit/completion-dedupe.test.ts +0 -35
- package/dist/extensions/pi-subagents/test/unit/completion-evidence.test.ts +0 -150
- package/dist/extensions/pi-subagents/test/unit/completion-guard.test.ts +0 -715
- package/dist/extensions/pi-subagents/test/unit/completion-replay.test.ts +0 -305
- package/dist/extensions/pi-subagents/test/unit/config-dir-runtime.test.ts +0 -107
- package/dist/extensions/pi-subagents/test/unit/control-channel.test.ts +0 -630
- package/dist/extensions/pi-subagents/test/unit/control-notices.test.ts +0 -110
- package/dist/extensions/pi-subagents/test/unit/cursor-smoke-inputs.test.ts +0 -77
- package/dist/extensions/pi-subagents/test/unit/default-extensions.test.ts +0 -219
- package/dist/extensions/pi-subagents/test/unit/delegation-api.test.ts +0 -588
- package/dist/extensions/pi-subagents/test/unit/doctor.test.ts +0 -201
- package/dist/extensions/pi-subagents/test/unit/dynamic-fanout.test.ts +0 -219
- package/dist/extensions/pi-subagents/test/unit/ensure-accessible-dir.test.ts +0 -125
- package/dist/extensions/pi-subagents/test/unit/extension-bindings.test.ts +0 -79
- package/dist/extensions/pi-subagents/test/unit/extension-context.test.ts +0 -27
- package/dist/extensions/pi-subagents/test/unit/external-cli-runner.test.ts +0 -339
- package/dist/extensions/pi-subagents/test/unit/external-job-runner.test.ts +0 -961
- package/dist/extensions/pi-subagents/test/unit/external-runs.test.ts +0 -261
- package/dist/extensions/pi-subagents/test/unit/extra-agent-dirs.test.ts +0 -88
- package/dist/extensions/pi-subagents/test/unit/fast-mode-extension.test.ts +0 -27
- package/dist/extensions/pi-subagents/test/unit/file-coalescer.test.ts +0 -83
- package/dist/extensions/pi-subagents/test/unit/file-system-retry.test.ts +0 -64
- package/dist/extensions/pi-subagents/test/unit/fleet-status.test.ts +0 -1356
- package/dist/extensions/pi-subagents/test/unit/fleet-transcript.test.ts +0 -435
- package/dist/extensions/pi-subagents/test/unit/fleet.test.ts +0 -1773
- package/dist/extensions/pi-subagents/test/unit/foreground-control.test.ts +0 -125
- package/dist/extensions/pi-subagents/test/unit/foreground-tool-call-compaction.test.ts +0 -115
- package/dist/extensions/pi-subagents/test/unit/fork-cache-key.test.ts +0 -91
- package/dist/extensions/pi-subagents/test/unit/fork-context.test.ts +0 -588
- package/dist/extensions/pi-subagents/test/unit/formatters.test.ts +0 -14
- package/dist/extensions/pi-subagents/test/unit/get-final-output.test.ts +0 -149
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector-bootstrap.test.ts +0 -101
- package/dist/extensions/pi-subagents/test/unit/herdr-inspector.test.ts +0 -458
- package/dist/extensions/pi-subagents/test/unit/herdr-session-roots-codec.test.ts +0 -63
- package/dist/extensions/pi-subagents/test/unit/herdr-shell-command.test.ts +0 -59
- package/dist/extensions/pi-subagents/test/unit/herdr-status-bridge.test.ts +0 -716
- package/dist/extensions/pi-subagents/test/unit/host-command.test.ts +0 -157
- package/dist/extensions/pi-subagents/test/unit/host-peer-runtime-imports.test.ts +0 -157
- package/dist/extensions/pi-subagents/test/unit/host-step-status.test.ts +0 -98
- package/dist/extensions/pi-subagents/test/unit/index-child-registration.test.ts +0 -1311
- package/dist/extensions/pi-subagents/test/unit/index-segment.test.ts +0 -96
- package/dist/extensions/pi-subagents/test/unit/inspect-rpc.test.ts +0 -617
- package/dist/extensions/pi-subagents/test/unit/intercom-bridge.test.ts +0 -220
- package/dist/extensions/pi-subagents/test/unit/jsonl-writer.test.ts +0 -119
- package/dist/extensions/pi-subagents/test/unit/llm-intent-arbiter.test.ts +0 -226
- package/dist/extensions/pi-subagents/test/unit/mcp-direct-tool-grant.test.ts +0 -155
- package/dist/extensions/pi-subagents/test/unit/mission-goal-driver.test.ts +0 -180
- package/dist/extensions/pi-subagents/test/unit/mission-lifecycle.test.ts +0 -300
- package/dist/extensions/pi-subagents/test/unit/mission-store.test.ts +0 -470
- package/dist/extensions/pi-subagents/test/unit/mock-pi.test.ts +0 -22
- package/dist/extensions/pi-subagents/test/unit/model-exclusions.test.ts +0 -258
- package/dist/extensions/pi-subagents/test/unit/model-fallback.test.ts +0 -903
- package/dist/extensions/pi-subagents/test/unit/model-info.test.ts +0 -162
- package/dist/extensions/pi-subagents/test/unit/model-scope-settings.test.ts +0 -101
- package/dist/extensions/pi-subagents/test/unit/model-scope.test.ts +0 -198
- package/dist/extensions/pi-subagents/test/unit/mutation-evidence.test.ts +0 -177
- package/dist/extensions/pi-subagents/test/unit/native-supervisor-channel.test.ts +0 -796
- package/dist/extensions/pi-subagents/test/unit/nested-control.test.ts +0 -655
- package/dist/extensions/pi-subagents/test/unit/nested-events.test.ts +0 -492
- package/dist/extensions/pi-subagents/test/unit/node-executable.test.ts +0 -26
- package/dist/extensions/pi-subagents/test/unit/notify.test.ts +0 -751
- package/dist/extensions/pi-subagents/test/unit/orca-progress-tabs.test.ts +0 -545
- package/dist/extensions/pi-subagents/test/unit/owned-process-tree.test.ts +0 -69
- package/dist/extensions/pi-subagents/test/unit/package-manifest.test.ts +0 -241
- package/dist/extensions/pi-subagents/test/unit/parallel-handoff.test.ts +0 -563
- package/dist/extensions/pi-subagents/test/unit/parallel-utils.test.ts +0 -269
- package/dist/extensions/pi-subagents/test/unit/path-handling.test.ts +0 -108
- package/dist/extensions/pi-subagents/test/unit/path-resolution.test.ts +0 -103
- package/dist/extensions/pi-subagents/test/unit/permissions.test.ts +0 -46
- package/dist/extensions/pi-subagents/test/unit/pi-args-permission-system.test.ts +0 -437
- package/dist/extensions/pi-subagents/test/unit/pi-args.test.ts +0 -2241
- package/dist/extensions/pi-subagents/test/unit/pi-coding-agent-dir.test.ts +0 -461
- package/dist/extensions/pi-subagents/test/unit/pi-spawn.test.ts +0 -375
- package/dist/extensions/pi-subagents/test/unit/preflight.test.ts +0 -958
- package/dist/extensions/pi-subagents/test/unit/proactive-skills.test.ts +0 -118
- package/dist/extensions/pi-subagents/test/unit/process-terminal.test.ts +0 -257
- package/dist/extensions/pi-subagents/test/unit/profiles.test.ts +0 -372
- package/dist/extensions/pi-subagents/test/unit/project-panes-public-api.test.ts +0 -285
- package/dist/extensions/pi-subagents/test/unit/prompt-template-bridge.test.ts +0 -244
- package/dist/extensions/pi-subagents/test/unit/prompt-workflows.test.ts +0 -167
- package/dist/extensions/pi-subagents/test/unit/pruned-fork.test.ts +0 -214
- package/dist/extensions/pi-subagents/test/unit/public-execution.test.ts +0 -182
- package/dist/extensions/pi-subagents/test/unit/reads-resolution.test.ts +0 -66
- package/dist/extensions/pi-subagents/test/unit/recursion-guard.test.ts +0 -265
- package/dist/extensions/pi-subagents/test/unit/render-helpers.test.ts +0 -560
- package/dist/extensions/pi-subagents/test/unit/result-delivery-ownership.test.ts +0 -34
- package/dist/extensions/pi-subagents/test/unit/result-files.test.ts +0 -501
- package/dist/extensions/pi-subagents/test/unit/result-intercom.test.ts +0 -258
- package/dist/extensions/pi-subagents/test/unit/retained-children.test.ts +0 -191
- package/dist/extensions/pi-subagents/test/unit/rpc.test.ts +0 -1124
- package/dist/extensions/pi-subagents/test/unit/run-fanout-budget.test.ts +0 -191
- package/dist/extensions/pi-subagents/test/unit/run-id-resolver.test.ts +0 -247
- package/dist/extensions/pi-subagents/test/unit/run-status.test.ts +0 -1477
- package/dist/extensions/pi-subagents/test/unit/runtime-acknowledged-extensions.test.ts +0 -52
- package/dist/extensions/pi-subagents/test/unit/runtime-agent-registration.test.ts +0 -332
- package/dist/extensions/pi-subagents/test/unit/scheduled-runs.test.ts +0 -816
- package/dist/extensions/pi-subagents/test/unit/scheduled-store-root.test.ts +0 -67
- package/dist/extensions/pi-subagents/test/unit/schemas.test.ts +0 -655
- package/dist/extensions/pi-subagents/test/unit/scripted-workflow.test.ts +0 -2501
- package/dist/extensions/pi-subagents/test/unit/selector.test.ts +0 -57
- package/dist/extensions/pi-subagents/test/unit/session-lease.test.ts +0 -339
- package/dist/extensions/pi-subagents/test/unit/single-output.test.ts +0 -361
- package/dist/extensions/pi-subagents/test/unit/skills-fallback.test.ts +0 -709
- package/dist/extensions/pi-subagents/test/unit/slash-bridge.test.ts +0 -115
- package/dist/extensions/pi-subagents/test/unit/spawn-budget.test.ts +0 -124
- package/dist/extensions/pi-subagents/test/unit/stale-run-reconciler.test.ts +0 -440
- package/dist/extensions/pi-subagents/test/unit/status-format.test.ts +0 -26
- package/dist/extensions/pi-subagents/test/unit/steering-action.test.ts +0 -435
- package/dist/extensions/pi-subagents/test/unit/steering-notices.test.ts +0 -58
- package/dist/extensions/pi-subagents/test/unit/steering.test.ts +0 -211
- package/dist/extensions/pi-subagents/test/unit/streamed-progress-bounds.test.ts +0 -78
- package/dist/extensions/pi-subagents/test/unit/subagent-action-recovery.test.ts +0 -85
- package/dist/extensions/pi-subagents/test/unit/subagent-control.test.ts +0 -329
- package/dist/extensions/pi-subagents/test/unit/subagent-guide.test.ts +0 -37
- package/dist/extensions/pi-subagents/test/unit/subagent-prompt-runtime.test.ts +0 -1510
- package/dist/extensions/pi-subagents/test/unit/subagent-startup-retry.test.ts +0 -104
- package/dist/extensions/pi-subagents/test/unit/subagent-wait.test.ts +0 -1367
- package/dist/extensions/pi-subagents/test/unit/task-intent.test.ts +0 -126
- package/dist/extensions/pi-subagents/test/unit/temp-paths.test.ts +0 -97
- package/dist/extensions/pi-subagents/test/unit/thinking-ceiling.test.ts +0 -73
- package/dist/extensions/pi-subagents/test/unit/timeout-defaults.test.ts +0 -138
- package/dist/extensions/pi-subagents/test/unit/tool-budget.test.ts +0 -67
- package/dist/extensions/pi-subagents/test/unit/tool-description.test.ts +0 -309
- package/dist/extensions/pi-subagents/test/unit/tool-timeout.test.ts +0 -108
- package/dist/extensions/pi-subagents/test/unit/total-cost.test.ts +0 -61
- package/dist/extensions/pi-subagents/test/unit/ts-loader.test.ts +0 -33
- package/dist/extensions/pi-subagents/test/unit/types-fork-preamble.test.ts +0 -23
- package/dist/extensions/pi-subagents/test/unit/wait-completions.test.ts +0 -76
- package/dist/extensions/pi-subagents/test/unit/wait-subscriptions.test.ts +0 -664
- package/dist/extensions/pi-subagents/test/unit/watch-strategy.test.ts +0 -24
- package/dist/extensions/pi-subagents/test/unit/watchdog-change-signature.test.ts +0 -434
- package/dist/extensions/pi-subagents/test/unit/watchdog-child-status.test.ts +0 -110
- package/dist/extensions/pi-subagents/test/unit/watchdog-emission-guard.test.ts +0 -62
- package/dist/extensions/pi-subagents/test/unit/watchdog-lsp-diagnostics.test.ts +0 -144
- package/dist/extensions/pi-subagents/test/unit/watchdog-model-selection.test.ts +0 -121
- package/dist/extensions/pi-subagents/test/unit/watchdog-permission-arbiter.test.ts +0 -115
- package/dist/extensions/pi-subagents/test/unit/watchdog-render.test.ts +0 -76
- package/dist/extensions/pi-subagents/test/unit/watchdog-review.test.ts +0 -327
- package/dist/extensions/pi-subagents/test/unit/watchdog-runtime.test.ts +0 -1072
- package/dist/extensions/pi-subagents/test/unit/watchdog-scope.test.ts +0 -33
- package/dist/extensions/pi-subagents/test/unit/watchdog-settings.test.ts +0 -322
- package/dist/extensions/pi-subagents/test/unit/watchdog-tool-actions.test.ts +0 -91
- package/dist/extensions/pi-subagents/test/unit/watchdog-turn-delta.test.ts +0 -130
- package/dist/extensions/pi-subagents/test/unit/widget-nested-render.test.ts +0 -171
- package/dist/extensions/pi-subagents/test/unit/windows-hide-spawn.test.ts +0 -49
- package/dist/extensions/pi-subagents/test/unit/workflow-chat-progress.test.ts +0 -551
- package/dist/extensions/pi-subagents/test/unit/workflow-detach-reconcile.test.ts +0 -777
- package/dist/extensions/pi-subagents/test/unit/workflow-graph.test.ts +0 -134
- package/dist/extensions/pi-subagents/test/unit/workflow-launch-params.test.ts +0 -358
- package/dist/extensions/pi-subagents/test/unit/workflow-preflight.test.ts +0 -155
- package/dist/extensions/pi-subagents/test/unit/workflow-receipt.test.ts +0 -461
- package/dist/extensions/pi-subagents/test/unit/workflow-resources.test.ts +0 -98
- package/dist/extensions/pi-subagents/test/unit/workflow-resume-hint.test.ts +0 -365
- package/dist/extensions/pi-subagents/test/unit/worktree-cleanup-plan.test.ts +0 -349
- package/dist/extensions/pi-subagents/test/unit/worktree.test.ts +0 -695
- package/dist/extensions/pi-subagents/test/unit/writer-budget-guidance.test.ts +0 -25
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/effect/index.ts +0 -13
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/effect/rules/no-service-constructor-imports.ts +0 -52
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/index.ts +0 -41
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-chained-type-assertions.ts +0 -77
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-conditional-empty-object-spread.ts +0 -49
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-known-value-widening.ts +0 -247
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-module-mocking.ts +0 -91
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-object-parameters.ts +0 -126
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-reflect-apply.ts +0 -28
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-reflect-get.ts +0 -28
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-runtime-typeof.ts +0 -67
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-shape-in-symbol-names.ts +0 -39
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-parameters.ts +0 -83
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-returns.ts +0 -115
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unknown-type-aliases.ts +0 -72
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-unsafe-dictionary-type.ts +0 -134
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/no-widen-then-assert.ts +0 -366
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/rules/require-safety-comment-for-type-assertion.ts +0 -62
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/dictionary-types.ts +0 -502
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/lexical-type-parameters.ts +0 -60
- package/dist/extensions/pi-subagents/tools/oxlint/anti-slop/shared/reflect-method.ts +0 -35
- package/dist/extensions/pi-subagents/tsconfig.json +0 -15
- package/dist/extensions/pi-tool-display/CHANGELOG.md +0 -329
- package/dist/extensions/pi-tool-display/LICENSE +0 -21
- package/dist/extensions/pi-tool-display/README.md +0 -417
- package/dist/extensions/pi-tool-display/config/config.example.json +0 -40
- package/dist/extensions/pi-tool-display/index.ts +0 -3
- package/dist/extensions/pi-tool-display/package-lock.json +0 -2555
- package/dist/extensions/pi-tool-display/package.json +0 -86
- package/dist/extensions/pi-tool-display/src/agent-dir.ts +0 -35
- package/dist/extensions/pi-tool-display/src/ansi-utils.ts +0 -116
- package/dist/extensions/pi-tool-display/src/bash-display.ts +0 -213
- package/dist/extensions/pi-tool-display/src/capabilities.ts +0 -88
- package/dist/extensions/pi-tool-display/src/config-modal.ts +0 -541
- package/dist/extensions/pi-tool-display/src/config-store.ts +0 -304
- package/dist/extensions/pi-tool-display/src/debug-logger.ts +0 -150
- package/dist/extensions/pi-tool-display/src/diff-presentation.ts +0 -72
- package/dist/extensions/pi-tool-display/src/diff-renderer.ts +0 -2517
- package/dist/extensions/pi-tool-display/src/disposable.ts +0 -34
- package/dist/extensions/pi-tool-display/src/extension-lifecycle.ts +0 -14
- package/dist/extensions/pi-tool-display/src/index.ts +0 -109
- package/dist/extensions/pi-tool-display/src/line-width-safety.ts +0 -93
- package/dist/extensions/pi-tool-display/src/modal-icons.ts +0 -57
- package/dist/extensions/pi-tool-display/src/pending-diff-preview.ts +0 -370
- package/dist/extensions/pi-tool-display/src/presets.ts +0 -117
- package/dist/extensions/pi-tool-display/src/render-utils.ts +0 -186
- package/dist/extensions/pi-tool-display/src/settings-inspector-modal.ts +0 -475
- package/dist/extensions/pi-tool-display/src/thinking-label.ts +0 -343
- package/dist/extensions/pi-tool-display/src/tool-call-box.ts +0 -181
- package/dist/extensions/pi-tool-display/src/tool-metadata.ts +0 -139
- package/dist/extensions/pi-tool-display/src/tool-overrides.ts +0 -2168
- package/dist/extensions/pi-tool-display/src/types.ts +0 -109
- package/dist/extensions/pi-tool-display/src/user-message-box-markdown.ts +0 -64
- package/dist/extensions/pi-tool-display/src/user-message-box-native.ts +0 -66
- package/dist/extensions/pi-tool-display/src/user-message-box-patch.ts +0 -72
- package/dist/extensions/pi-tool-display/src/user-message-box-renderer.ts +0 -419
- package/dist/extensions/pi-tool-display/src/user-message-box-utils.ts +0 -106
- package/dist/extensions/pi-tool-display/src/write-display-utils.ts +0 -31
- package/dist/extensions/pi-tool-display/src/zellij-modal.ts +0 -1027
- package/dist/extensions/pi-tool-display/tests/active-backlog-red.test.ts +0 -65
- package/dist/extensions/pi-tool-display/tests/ansi-utils.test.ts +0 -345
- package/dist/extensions/pi-tool-display/tests/bash-display.test.ts +0 -442
- package/dist/extensions/pi-tool-display/tests/capabilities-edge.test.ts +0 -360
- package/dist/extensions/pi-tool-display/tests/capabilities.test.ts +0 -54
- package/dist/extensions/pi-tool-display/tests/config-modal.test.ts +0 -360
- package/dist/extensions/pi-tool-display/tests/config-store.test.ts +0 -87
- package/dist/extensions/pi-tool-display/tests/custom-tool-overrides.test.ts +0 -415
- package/dist/extensions/pi-tool-display/tests/debug-logger-edge.test.ts +0 -630
- package/dist/extensions/pi-tool-display/tests/debug-logger.test.ts +0 -62
- package/dist/extensions/pi-tool-display/tests/diff-renderer-ansi.test.ts +0 -55
- package/dist/extensions/pi-tool-display/tests/diff-renderer-edge.test.ts +0 -886
- package/dist/extensions/pi-tool-display/tests/diff-renderer-numbering.test.ts +0 -135
- package/dist/extensions/pi-tool-display/tests/diff-renderer-width.test.ts +0 -454
- package/dist/extensions/pi-tool-display/tests/diff-renderer-wrap.test.ts +0 -169
- package/dist/extensions/pi-tool-display/tests/index-integration.test.ts +0 -354
- package/dist/extensions/pi-tool-display/tests/pending-diff-preview.test.ts +0 -79
- package/dist/extensions/pi-tool-display/tests/presets-edge.test.ts +0 -229
- package/dist/extensions/pi-tool-display/tests/presets.test.ts +0 -26
- package/dist/extensions/pi-tool-display/tests/reload-behavior.test.ts +0 -1241
- package/dist/extensions/pi-tool-display/tests/render-utils.test.ts +0 -710
- package/dist/extensions/pi-tool-display/tests/settings-inspector.test.ts +0 -450
- package/dist/extensions/pi-tool-display/tests/thinking-label-edge.test.ts +0 -904
- package/dist/extensions/pi-tool-display/tests/thinking-label.test.ts +0 -72
- package/dist/extensions/pi-tool-display/tests/tool-call-box.test.ts +0 -105
- package/dist/extensions/pi-tool-display/tests/tool-overrides-config.test.ts +0 -613
- package/dist/extensions/pi-tool-display/tests/tool-overrides-mcp.test.ts +0 -499
- package/dist/extensions/pi-tool-display/tests/tool-overrides-registration.test.ts +0 -315
- package/dist/extensions/pi-tool-display/tests/tool-overrides-write-meta.test.ts +0 -68
- package/dist/extensions/pi-tool-display/tests/tool-ui-utils.test.ts +0 -413
- package/dist/extensions/pi-tool-display/tests/user-message-box-performance-red.test.ts +0 -176
- package/dist/extensions/pi-tool-display/tests/user-message-box.test.ts +0 -908
- package/dist/extensions/pi-tool-display/tests/zellij-modal.test.ts +0 -848
- package/dist/extensions/pi-tool-display/tool-display-api-consumer.d.ts +0 -30
- package/dist/extensions/pi-tool-display/tool-display-api-consumer.js +0 -40
- package/dist/extensions/pi-web-agent/CHANGELOG.md +0 -410
- package/dist/extensions/pi-web-agent/README.md +0 -131
- package/dist/extensions/pi-web-agent/package.json +0 -33
- package/dist/extensions/pi-web-agent/src/backends/config.ts +0 -264
- package/dist/extensions/pi-web-agent/src/backends/doctor.ts +0 -272
- package/dist/extensions/pi-web-agent/src/backends/factory.ts +0 -253
- package/dist/extensions/pi-web-agent/src/backends/settings-reader.ts +0 -46
- package/dist/extensions/pi-web-agent/src/cache/ttl-cache.ts +0 -28
- package/dist/extensions/pi-web-agent/src/changelog-notice.ts +0 -136
- package/dist/extensions/pi-web-agent/src/commands/web-agent-config.ts +0 -1082
- package/dist/extensions/pi-web-agent/src/extension.ts +0 -163
- package/dist/extensions/pi-web-agent/src/extract/readability.ts +0 -126
- package/dist/extensions/pi-web-agent/src/fetch/browser-resolution.ts +0 -199
- package/dist/extensions/pi-web-agent/src/fetch/firecrawl-fetch.ts +0 -100
- package/dist/extensions/pi-web-agent/src/fetch/headless-fetch.ts +0 -117
- package/dist/extensions/pi-web-agent/src/fetch/http-fetch.ts +0 -67
- package/dist/extensions/pi-web-agent/src/orchestration/answer-synthesizer.ts +0 -60
- package/dist/extensions/pi-web-agent/src/orchestration/candidate-selector.ts +0 -51
- package/dist/extensions/pi-web-agent/src/orchestration/direct-url.ts +0 -29
- package/dist/extensions/pi-web-agent/src/orchestration/evidence-quality.ts +0 -108
- package/dist/extensions/pi-web-agent/src/orchestration/evidence-ranker.ts +0 -47
- package/dist/extensions/pi-web-agent/src/orchestration/index.ts +0 -28
- package/dist/extensions/pi-web-agent/src/orchestration/query-planner.ts +0 -47
- package/dist/extensions/pi-web-agent/src/orchestration/research-orchestrator.ts +0 -441
- package/dist/extensions/pi-web-agent/src/orchestration/research-types.ts +0 -71
- package/dist/extensions/pi-web-agent/src/orchestration/research-worker.ts +0 -206
- package/dist/extensions/pi-web-agent/src/orchestration/source-profile.ts +0 -105
- package/dist/extensions/pi-web-agent/src/orchestration/stop-decider.ts +0 -81
- package/dist/extensions/pi-web-agent/src/orchestration/url.ts +0 -35
- package/dist/extensions/pi-web-agent/src/presentation/config-store.ts +0 -210
- package/dist/extensions/pi-web-agent/src/presentation/config.ts +0 -75
- package/dist/extensions/pi-web-agent/src/presentation/explore-presentation.ts +0 -73
- package/dist/extensions/pi-web-agent/src/presentation/fetch-presentation.ts +0 -54
- package/dist/extensions/pi-web-agent/src/presentation/search-presentation.ts +0 -53
- package/dist/extensions/pi-web-agent/src/presentation/select-view.ts +0 -20
- package/dist/extensions/pi-web-agent/src/presentation/types.ts +0 -63
- package/dist/extensions/pi-web-agent/src/readers/github-reader.ts +0 -150
- package/dist/extensions/pi-web-agent/src/readers/limits.ts +0 -3
- package/dist/extensions/pi-web-agent/src/readers/pdf-reader.ts +0 -87
- package/dist/extensions/pi-web-agent/src/readers/resolver.ts +0 -25
- package/dist/extensions/pi-web-agent/src/readers/types.ts +0 -11
- package/dist/extensions/pi-web-agent/src/readers/youtube-reader.ts +0 -79
- package/dist/extensions/pi-web-agent/src/search/brave.ts +0 -114
- package/dist/extensions/pi-web-agent/src/search/duckduckgo.ts +0 -99
- package/dist/extensions/pi-web-agent/src/search/exa.ts +0 -109
- package/dist/extensions/pi-web-agent/src/search/fanout.ts +0 -154
- package/dist/extensions/pi-web-agent/src/search/searxng.ts +0 -96
- package/dist/extensions/pi-web-agent/src/search/tavily.ts +0 -113
- package/dist/extensions/pi-web-agent/src/search/tokenin.ts +0 -130
- package/dist/extensions/pi-web-agent/src/search/youcom.ts +0 -109
- package/dist/extensions/pi-web-agent/src/tools/web-explore.ts +0 -71
- package/dist/extensions/pi-web-agent/src/tools/web-fetch-headless.ts +0 -31
- package/dist/extensions/pi-web-agent/src/tools/web-fetch.ts +0 -31
- package/dist/extensions/pi-web-agent/src/tools/web-search.ts +0 -170
- package/dist/extensions/pi-web-agent/src/types.ts +0 -103
- package/dist/extensions/pi-zentui/.editorconfig +0 -12
- package/dist/extensions/pi-zentui/.github/CODEOWNERS +0 -1
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/bug_report.yml +0 -110
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/config.yml +0 -8
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/config_question.yml +0 -56
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/feature_request.yml +0 -63
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/rendering_issue.yml +0 -106
- package/dist/extensions/pi-zentui/.github/ISSUE_TEMPLATE/runtime_detection.yml +0 -103
- package/dist/extensions/pi-zentui/.github/dependabot.yml +0 -47
- package/dist/extensions/pi-zentui/.github/pull_request_template.md +0 -34
- package/dist/extensions/pi-zentui/.github/release.yml +0 -18
- package/dist/extensions/pi-zentui/.github/workflows/ci.yml +0 -79
- package/dist/extensions/pi-zentui/.github/workflows/publish.yml +0 -63
- package/dist/extensions/pi-zentui/AGENTS.md +0 -107
- package/dist/extensions/pi-zentui/CONTRIBUTING.md +0 -68
- package/dist/extensions/pi-zentui/LICENSE +0 -21
- package/dist/extensions/pi-zentui/README.md +0 -188
- package/dist/extensions/pi-zentui/SECURITY.md +0 -18
- package/dist/extensions/pi-zentui/assets/main-cover.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-accent-rail.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-minimalist.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-opencode-copy-friendly.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/editor-opencode.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-compact.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-framed-copy-friendly.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-framed.png +0 -0
- package/dist/extensions/pi-zentui/assets/screenshots/user-message-labeled.png +0 -0
- package/dist/extensions/pi-zentui/assets/zentui.png +0 -0
- package/dist/extensions/pi-zentui/biome.json +0 -31
- package/dist/extensions/pi-zentui/docs/configuration.md +0 -509
- package/dist/extensions/pi-zentui/docs/footer-format.md +0 -162
- package/dist/extensions/pi-zentui/extensions/zentui/accent-rail-editor.ts +0 -99
- package/dist/extensions/pi-zentui/extensions/zentui/accent-rail-layout-patch.ts +0 -457
- package/dist/extensions/pi-zentui/extensions/zentui/completion-menu.ts +0 -157
- package/dist/extensions/pi-zentui/extensions/zentui/config.ts +0 -2100
- package/dist/extensions/pi-zentui/extensions/zentui/editor-metadata-format.ts +0 -321
- package/dist/extensions/pi-zentui/extensions/zentui/editor-transfer.ts +0 -73
- package/dist/extensions/pi-zentui/extensions/zentui/extension-status.ts +0 -89
- package/dist/extensions/pi-zentui/extensions/zentui/footer-format.ts +0 -364
- package/dist/extensions/pi-zentui/extensions/zentui/footer-layout.ts +0 -122
- package/dist/extensions/pi-zentui/extensions/zentui/footer.ts +0 -812
- package/dist/extensions/pi-zentui/extensions/zentui/format.ts +0 -620
- package/dist/extensions/pi-zentui/extensions/zentui/git.ts +0 -384
- package/dist/extensions/pi-zentui/extensions/zentui/icons.ts +0 -252
- package/dist/extensions/pi-zentui/extensions/zentui/index.ts +0 -1416
- package/dist/extensions/pi-zentui/extensions/zentui/interaction-summary.ts +0 -1049
- package/dist/extensions/pi-zentui/extensions/zentui/live-context.ts +0 -75
- package/dist/extensions/pi-zentui/extensions/zentui/minimalist-editor.ts +0 -463
- package/dist/extensions/pi-zentui/extensions/zentui/package-version.ts +0 -651
- package/dist/extensions/pi-zentui/extensions/zentui/project-refresh.ts +0 -120
- package/dist/extensions/pi-zentui/extensions/zentui/project-state.ts +0 -59
- package/dist/extensions/pi-zentui/extensions/zentui/prototype-patch-registry.ts +0 -166
- package/dist/extensions/pi-zentui/extensions/zentui/repository-root.ts +0 -98
- package/dist/extensions/pi-zentui/extensions/zentui/runtime.ts +0 -841
- package/dist/extensions/pi-zentui/extensions/zentui/selector-border.ts +0 -93
- package/dist/extensions/pi-zentui/extensions/zentui/session-lifecycle.ts +0 -60
- package/dist/extensions/pi-zentui/extensions/zentui/settings-command.ts +0 -1796
- package/dist/extensions/pi-zentui/extensions/zentui/settings-previews.ts +0 -128
- package/dist/extensions/pi-zentui/extensions/zentui/state.ts +0 -94
- package/dist/extensions/pi-zentui/extensions/zentui/style.ts +0 -424
- package/dist/extensions/pi-zentui/extensions/zentui/telemetry.ts +0 -82
- package/dist/extensions/pi-zentui/extensions/zentui/ui.ts +0 -1290
- package/dist/extensions/pi-zentui/extensions/zentui/user-message-osc.ts +0 -248
- package/dist/extensions/pi-zentui/extensions/zentui/user-message-styles.ts +0 -215
- package/dist/extensions/pi-zentui/extensions/zentui/user-message.ts +0 -206
- package/dist/extensions/pi-zentui/extensions/zentui/working-line-messages.ts +0 -24
- package/dist/extensions/pi-zentui/extensions/zentui/working-line-spinners.ts +0 -54
- package/dist/extensions/pi-zentui/extensions/zentui/working-line.ts +0 -1433
- package/dist/extensions/pi-zentui/package-lock.json +0 -5311
- package/dist/extensions/pi-zentui/package.json +0 -60
- package/dist/extensions/pi-zentui/test/accent-rail-editor.test.ts +0 -232
- package/dist/extensions/pi-zentui/test/accent-rail-layout-patch.test.ts +0 -669
- package/dist/extensions/pi-zentui/test/completion-menu.test.ts +0 -265
- package/dist/extensions/pi-zentui/test/config.test.ts +0 -3119
- package/dist/extensions/pi-zentui/test/editor-metadata-format.test.ts +0 -405
- package/dist/extensions/pi-zentui/test/editor-transfer.test.ts +0 -260
- package/dist/extensions/pi-zentui/test/editor-viewport-indicators.test.ts +0 -1286
- package/dist/extensions/pi-zentui/test/extension-compliance.test.ts +0 -7196
- package/dist/extensions/pi-zentui/test/extension-status.test.ts +0 -182
- package/dist/extensions/pi-zentui/test/fixtures/starship-nerd-font-symbols.toml +0 -172
- package/dist/extensions/pi-zentui/test/footer-format.test.ts +0 -431
- package/dist/extensions/pi-zentui/test/footer-layout.test.ts +0 -113
- package/dist/extensions/pi-zentui/test/footer-repository-path.test.ts +0 -123
- package/dist/extensions/pi-zentui/test/format.test.ts +0 -927
- package/dist/extensions/pi-zentui/test/git.test.ts +0 -212
- package/dist/extensions/pi-zentui/test/icons.test.ts +0 -69
- package/dist/extensions/pi-zentui/test/interaction-summary.test.ts +0 -1402
- package/dist/extensions/pi-zentui/test/live-context-integration.test.ts +0 -378
- package/dist/extensions/pi-zentui/test/live-context.test.ts +0 -139
- package/dist/extensions/pi-zentui/test/minimalist-editor.test.ts +0 -811
- package/dist/extensions/pi-zentui/test/package-version.test.ts +0 -321
- package/dist/extensions/pi-zentui/test/project-refresh.test.ts +0 -250
- package/dist/extensions/pi-zentui/test/project-state.test.ts +0 -159
- package/dist/extensions/pi-zentui/test/repository-root.test.ts +0 -108
- package/dist/extensions/pi-zentui/test/responsive-dependencies.test.ts +0 -825
- package/dist/extensions/pi-zentui/test/runtime.test.ts +0 -183
- package/dist/extensions/pi-zentui/test/session-lifecycle.test.ts +0 -40
- package/dist/extensions/pi-zentui/test/settings-command.test.ts +0 -1381
- package/dist/extensions/pi-zentui/test/settings-previews.test.ts +0 -347
- package/dist/extensions/pi-zentui/test/state.test.ts +0 -84
- package/dist/extensions/pi-zentui/test/telemetry-lifecycle-integration.test.ts +0 -276
- package/dist/extensions/pi-zentui/test/telemetry.test.ts +0 -105
- package/dist/extensions/pi-zentui/test/turn-summary-lifecycle.integration.test.ts +0 -327
- package/dist/extensions/pi-zentui/test/user-message-osc.test.ts +0 -164
- package/dist/extensions/pi-zentui/test/user-message-styles.test.ts +0 -292
- package/dist/extensions/pi-zentui/test/working-line-lifecycle.integration.test.ts +0 -730
- package/dist/extensions/pi-zentui/test/working-line-messages.test.ts +0 -34
- package/dist/extensions/pi-zentui/test/working-line.test.ts +0 -1990
- package/dist/extensions/pi-zentui/tsconfig.json +0 -16
- package/dist/extensions/ponytail/index.js +0 -176
- package/dist/extensions/ponytail/package.json +0 -8
- package/dist/extensions/ponytail/ponytail-config.cjs +0 -151
- package/dist/extensions/ponytail/ponytail-instructions.cjs +0 -112
- package/dist/extensions/ponytail/test/extension.test.js +0 -299
- package/dist/extensions/ponytail/test/helpers.test.js +0 -312
- package/dist/extensions/question/batch.ts +0 -103
- package/dist/extensions/question/constants.ts +0 -31
- package/dist/extensions/question/helpers.ts +0 -58
- package/dist/extensions/question/index.ts +0 -688
- package/dist/extensions/question/navigation.ts +0 -14
- package/dist/extensions/question/package.json +0 -19
- package/dist/extensions/question/question-list.ts +0 -533
- package/dist/extensions/question/row-layout.ts +0 -165
- package/dist/extensions/question/schemas.ts +0 -43
- package/dist/extensions/question/selection-mode.ts +0 -47
- package/dist/extensions/question/shortcuts.ts +0 -44
- package/dist/extensions/question/tests/batch.test.ts +0 -113
- package/dist/extensions/question/tests/exp.test.ts +0 -70
- package/dist/extensions/question/tests/exp2.test.ts +0 -59
- package/dist/extensions/question/tests/exp3.test.ts +0 -47
- package/dist/extensions/question/tests/helpers.test.ts +0 -93
- package/dist/extensions/question/tests/question-list.test.ts +0 -694
- package/dist/extensions/question/tests/row-layout.test.ts +0 -215
- package/dist/extensions/question/tests/schemas.test.ts +0 -53
- package/dist/extensions/question/tests/selection-mode.test.ts +0 -54
- package/dist/extensions/question/tests/shortcuts.test.ts +0 -107
- package/dist/extensions/question/tests/wizard.test.ts +0 -839
- package/dist/extensions/question/tests/zz-ig3.test.ts +0 -20
- package/dist/extensions/question/tests/zz-probe.test.ts +0 -29
- package/dist/extensions/question/types.ts +0 -132
- package/dist/extensions/rtk.test.ts +0 -320
- package/dist/extensions/rtk.ts +0 -123
- package/dist/extensions/test-resolve-hook-impl.mjs +0 -7
- package/dist/extensions/test-resolve-hook.mjs +0 -7
- package/dist/extensions/tokenin-onboarding.ts +0 -883
- package/dist/extensions/tps.test.ts +0 -38
- package/dist/extensions/tps.ts +0 -349
- package/dist/extensions/undo.test.ts +0 -720
- package/dist/extensions/undo.ts +0 -298
- package/dist/extensions/web-agent-onboarding.test.ts +0 -415
- package/dist/extensions/web-agent-onboarding.ts +0 -222
- package/dist/index.d.ts +0 -36
- package/dist/index.js +0 -48
- package/dist/main.d.ts +0 -11
- package/dist/main.js +0 -768
- package/dist/migrations.d.ts +0 -32
- package/dist/migrations.js +0 -280
- package/dist/modes/index.d.ts +0 -8
- package/dist/modes/index.js +0 -7
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/components/armin.d.ts +0 -33
- package/dist/modes/interactive/components/armin.js +0 -332
- package/dist/modes/interactive/components/assistant-message.d.ts +0 -21
- package/dist/modes/interactive/components/assistant-message.js +0 -142
- package/dist/modes/interactive/components/bash-execution.d.ts +0 -33
- package/dist/modes/interactive/components/bash-execution.js +0 -174
- package/dist/modes/interactive/components/bordered-loader.d.ts +0 -15
- package/dist/modes/interactive/components/bordered-loader.js +0 -53
- package/dist/modes/interactive/components/branch-summary-message.d.ts +0 -15
- package/dist/modes/interactive/components/branch-summary-message.js +0 -43
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +0 -15
- package/dist/modes/interactive/components/compaction-summary-message.js +0 -44
- package/dist/modes/interactive/components/config-selector.d.ts +0 -101
- package/dist/modes/interactive/components/config-selector.js +0 -760
- package/dist/modes/interactive/components/countdown-timer.d.ts +0 -13
- package/dist/modes/interactive/components/countdown-timer.js +0 -32
- package/dist/modes/interactive/components/custom-editor.d.ts +0 -20
- package/dist/modes/interactive/components/custom-editor.js +0 -69
- package/dist/modes/interactive/components/custom-entry.d.ts +0 -18
- package/dist/modes/interactive/components/custom-entry.js +0 -51
- package/dist/modes/interactive/components/custom-message.d.ts +0 -21
- package/dist/modes/interactive/components/custom-message.js +0 -86
- package/dist/modes/interactive/components/daxnuts.d.ts +0 -22
- package/dist/modes/interactive/components/daxnuts.js +0 -139
- package/dist/modes/interactive/components/diff.d.ts +0 -11
- package/dist/modes/interactive/components/diff.js +0 -132
- package/dist/modes/interactive/components/dynamic-border.d.ts +0 -14
- package/dist/modes/interactive/components/dynamic-border.js +0 -20
- package/dist/modes/interactive/components/earendil-announcement.d.ts +0 -4
- package/dist/modes/interactive/components/earendil-announcement.js +0 -39
- package/dist/modes/interactive/components/extension-editor.d.ts +0 -20
- package/dist/modes/interactive/components/extension-editor.js +0 -97
- package/dist/modes/interactive/components/extension-input.d.ts +0 -22
- package/dist/modes/interactive/components/extension-input.js +0 -60
- package/dist/modes/interactive/components/extension-selector.d.ts +0 -25
- package/dist/modes/interactive/components/extension-selector.js +0 -82
- package/dist/modes/interactive/components/first-time-setup.d.ts +0 -24
- package/dist/modes/interactive/components/first-time-setup.js +0 -116
- package/dist/modes/interactive/components/footer.d.ts +0 -31
- package/dist/modes/interactive/components/footer.js +0 -221
- package/dist/modes/interactive/components/index.d.ts +0 -33
- package/dist/modes/interactive/components/index.js +0 -34
- package/dist/modes/interactive/components/keybinding-hints.d.ts +0 -12
- package/dist/modes/interactive/components/keybinding-hints.js +0 -35
- package/dist/modes/interactive/components/login-dialog.d.ts +0 -51
- package/dist/modes/interactive/components/login-dialog.js +0 -187
- package/dist/modes/interactive/components/model-selector.d.ts +0 -63
- package/dist/modes/interactive/components/model-selector.js +0 -321
- package/dist/modes/interactive/components/oauth-selector.d.ts +0 -32
- package/dist/modes/interactive/components/oauth-selector.js +0 -162
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +0 -41
- package/dist/modes/interactive/components/scoped-models-selector.js +0 -301
- package/dist/modes/interactive/components/session-selector-search.d.ts +0 -22
- package/dist/modes/interactive/components/session-selector-search.js +0 -154
- package/dist/modes/interactive/components/session-selector.d.ts +0 -94
- package/dist/modes/interactive/components/session-selector.js +0 -866
- package/dist/modes/interactive/components/settings-selector.d.ts +0 -103
- package/dist/modes/interactive/components/settings-selector.js +0 -726
- package/dist/modes/interactive/components/show-images-selector.d.ts +0 -9
- package/dist/modes/interactive/components/show-images-selector.js +0 -38
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +0 -16
- package/dist/modes/interactive/components/skill-invocation-message.js +0 -46
- package/dist/modes/interactive/components/startup-box.d.ts +0 -38
- package/dist/modes/interactive/components/startup-box.js +0 -90
- package/dist/modes/interactive/components/status-indicator.d.ts +0 -30
- package/dist/modes/interactive/components/status-indicator.js +0 -64
- package/dist/modes/interactive/components/theme-selector.d.ts +0 -10
- package/dist/modes/interactive/components/theme-selector.js +0 -49
- package/dist/modes/interactive/components/thinking-selector.d.ts +0 -10
- package/dist/modes/interactive/components/thinking-selector.js +0 -51
- package/dist/modes/interactive/components/tool-execution.d.ts +0 -62
- package/dist/modes/interactive/components/tool-execution.js +0 -325
- package/dist/modes/interactive/components/tree-selector.d.ts +0 -93
- package/dist/modes/interactive/components/tree-selector.js +0 -1244
- package/dist/modes/interactive/components/trust-selector.d.ts +0 -22
- package/dist/modes/interactive/components/trust-selector.js +0 -90
- package/dist/modes/interactive/components/user-message-selector.d.ts +0 -29
- package/dist/modes/interactive/components/user-message-selector.js +0 -113
- package/dist/modes/interactive/components/user-message.d.ts +0 -13
- package/dist/modes/interactive/components/user-message.js +0 -41
- package/dist/modes/interactive/components/visual-truncate.d.ts +0 -23
- package/dist/modes/interactive/components/visual-truncate.js +0 -32
- package/dist/modes/interactive/external-editor.d.ts +0 -11
- package/dist/modes/interactive/external-editor.js +0 -36
- package/dist/modes/interactive/interactive-mode.d.ts +0 -447
- package/dist/modes/interactive/interactive-mode.js +0 -5489
- package/dist/modes/interactive/model-catalog-refresh.d.ts +0 -6
- package/dist/modes/interactive/model-catalog-refresh.js +0 -33
- package/dist/modes/interactive/model-search.d.ts +0 -11
- package/dist/modes/interactive/model-search.js +0 -14
- package/dist/modes/interactive/theme/dark.json +0 -90
- package/dist/modes/interactive/theme/light.json +0 -89
- package/dist/modes/interactive/theme/theme-controller.d.ts +0 -39
- package/dist/modes/interactive/theme/theme-controller.js +0 -124
- package/dist/modes/interactive/theme/theme-schema.json +0 -348
- package/dist/modes/interactive/theme/theme.d.ts +0 -121
- package/dist/modes/interactive/theme/theme.js +0 -1090
- package/dist/modes/print-mode.d.ts +0 -27
- package/dist/modes/print-mode.js +0 -141
- package/dist/modes/rpc/jsonl.d.ts +0 -16
- package/dist/modes/rpc/jsonl.js +0 -48
- package/dist/modes/rpc/rpc-client.d.ts +0 -438
- package/dist/modes/rpc/rpc-client.js +0 -712
- package/dist/modes/rpc/rpc-mode.d.ts +0 -19
- package/dist/modes/rpc/rpc-mode.js +0 -1459
- package/dist/modes/rpc/rpc-types.d.ts +0 -902
- package/dist/modes/rpc/rpc-types.js +0 -7
- package/dist/package-manager-cli.d.ts +0 -7
- package/dist/package-manager-cli.js +0 -789
- package/dist/rpc-entry.d.ts +0 -2
- package/dist/rpc-entry.js +0 -9
- package/dist/skills/agent-browser/SKILL.md +0 -53
- package/dist/skills/batch-grill-me/SKILL.md +0 -20
- package/dist/skills/brandkit/SKILL.md +0 -800
- package/dist/skills/design-references/SKILL.md +0 -32
- package/dist/skills/design-references/references/clickhouse/DESIGN.md +0 -544
- package/dist/skills/design-taste-frontend/SKILL.md +0 -1208
- package/dist/skills/design-taste-frontend-v1/SKILL.md +0 -228
- package/dist/skills/full-output-enforcement/SKILL.md +0 -51
- package/dist/skills/gpt-taste/SKILL.md +0 -76
- package/dist/skills/grill-me/SKILL.md +0 -11
- package/dist/skills/handoff/SKILL.md +0 -17
- package/dist/skills/handoff-text/SKILL.md +0 -15
- package/dist/skills/high-end-visual-design/SKILL.md +0 -100
- package/dist/skills/image-to-code/SKILL.md +0 -1230
- package/dist/skills/imagegen-frontend-mobile/SKILL.md +0 -1467
- package/dist/skills/imagegen-frontend-web/SKILL.md +0 -989
- package/dist/skills/implanger/SKILL.md +0 -70
- package/dist/skills/improve-codebase/REFERENCE.md +0 -78
- package/dist/skills/improve-codebase/SKILL.md +0 -180
- package/dist/skills/industrial-brutalist-ui/SKILL.md +0 -94
- package/dist/skills/minimalist-ui/SKILL.md +0 -87
- package/dist/skills/pi-subagents/SKILL.md +0 -50
- package/dist/skills/pi-subagents/references/constraints-and-recipes.md +0 -274
- package/dist/skills/pi-subagents/references/execution-controls.md +0 -463
- package/dist/skills/pi-subagents/references/management-authoring-rpc.md +0 -161
- package/dist/skills/pi-subagents/references/multi-lane-orchestration.md +0 -39
- package/dist/skills/pi-subagents/references/prompting-and-roles.md +0 -267
- package/dist/skills/planger/SKILL.md +0 -167
- package/dist/skills/ponytail/SKILL.md +0 -121
- package/dist/skills/ponytail-audit/SKILL.md +0 -42
- package/dist/skills/ponytail-debt/SKILL.md +0 -45
- package/dist/skills/ponytail-gain/SKILL.md +0 -51
- package/dist/skills/ponytail-help/SKILL.md +0 -72
- package/dist/skills/ponytail-review/SKILL.md +0 -58
- package/dist/skills/redesign-existing-projects/SKILL.md +0 -180
- package/dist/skills/selesai-handoff/SKILL.md +0 -21
- package/dist/skills/stitch-design-taste/SKILL.md +0 -186
- package/dist/skills/unlazy/CHANGELOG.md +0 -109
- package/dist/skills/unlazy/CONTRIBUTING.md +0 -63
- package/dist/skills/unlazy/LICENSE +0 -21
- package/dist/skills/unlazy/README.md +0 -228
- package/dist/skills/unlazy/SECURITY.md +0 -60
- package/dist/skills/unlazy/SKILL.md +0 -93
- package/dist/skills/unlazy/package.json +0 -13
- package/dist/skills/unlazy/references/dispatch.md +0 -79
- package/dist/skills/unlazy/references/gates.md +0 -132
- package/dist/skills/unlazy/references/method.md +0 -49
- package/dist/skills/unlazy/references/orchestration.md +0 -98
- package/dist/skills/unlazy/references/parallel.md +0 -111
- package/dist/skills/unlazy/references/token-economy.md +0 -39
- package/dist/skills/unlazy/research/validation-protocol.md +0 -81
- package/dist/skills/unlazy/scripts/dispatch-check.mjs +0 -108
- package/dist/skills/unlazy/scripts/gate-check.mjs +0 -879
- package/dist/skills/unlazy/scripts/gate-lint.mjs +0 -178
- package/dist/skills/unlazy/scripts/lib/check-supervisor.mjs +0 -46
- package/dist/skills/unlazy/scripts/lib/dispatch.mjs +0 -283
- package/dist/skills/unlazy/scripts/lib/gates.mjs +0 -625
- package/dist/skills/unlazy/scripts/lib/process-tree.mjs +0 -161
- package/dist/skills/unlazy/scripts/lib/regex-worker.mjs +0 -9
- package/dist/skills/unlazy/templates/PLAN.md +0 -65
- package/dist/skills/unlazy/templates/gates-leaf.md +0 -51
- package/dist/skills/unlazy/templates/gates-node.md +0 -50
- package/dist/skills/unlazy/tests/contract-tests.mjs +0 -127
- package/dist/skills/unlazy/tests/dispatch-tests.mjs +0 -296
- package/dist/skills/unlazy/tests/hardening-tests.mjs +0 -900
- package/dist/skills/unlazy/tests/lint-tests.mjs +0 -242
- package/dist/skills/unlazy/tests/run-tests.mjs +0 -360
- package/dist/skills/unlazy/tests/self-check.mjs +0 -152
- package/dist/skills/unlazy/tests/stress-tests.mjs +0 -165
- package/dist/skills/web-design-guidelines/SKILL.md +0 -41
- package/dist/skills/workflow/SKILL.md +0 -95
- package/dist/themes/adventure.json +0 -84
- package/dist/themes/adwaita-dark.json +0 -84
- package/dist/themes/arcoiris.json +0 -84
- package/dist/themes/arthur.json +0 -84
- package/dist/themes/atom.json +0 -84
- package/dist/themes/aura.json +0 -84
- package/dist/themes/black-metal-bathory.json +0 -84
- package/dist/themes/black-metal-burzum.json +0 -84
- package/dist/themes/black-metal-khold.json +0 -84
- package/dist/themes/box.json +0 -84
- package/dist/themes/brogrammer.json +0 -84
- package/dist/themes/carbonfox.json +0 -84
- package/dist/themes/catppuccin-mocha.json +0 -84
- package/dist/themes/citruszest.json +0 -84
- package/dist/themes/cursor-dark.json +0 -84
- package/dist/themes/cutie-pro.json +0 -84
- package/dist/themes/dark-modern.json +0 -84
- package/dist/themes/dark-pastel.json +0 -84
- package/dist/themes/dimmed-monokai.json +0 -84
- package/dist/themes/doom-peacock.json +0 -84
- package/dist/themes/dracula-plus.json +0 -84
- package/dist/themes/dracula.json +0 -80
- package/dist/themes/earthsong.json +0 -84
- package/dist/themes/everforest-dark-hard.json +0 -84
- package/dist/themes/everforest-dark.json +0 -80
- package/dist/themes/fahrenheit.json +0 -84
- package/dist/themes/flatland.json +0 -84
- package/dist/themes/flexoki-dark.json +0 -84
- package/dist/themes/front-end-delight.json +0 -84
- package/dist/themes/fun-forrest.json +0 -84
- package/dist/themes/galizur.json +0 -84
- package/dist/themes/github-dark-colorblind.json +0 -84
- package/dist/themes/github-dark-high-contrast.json +0 -84
- package/dist/themes/glacier.json +0 -84
- package/dist/themes/gruber-darker.json +0 -84
- package/dist/themes/gruvbox-dark-hard.json +0 -84
- package/dist/themes/gruvbox-dark.json +0 -84
- package/dist/themes/gruvbox-material.json +0 -84
- package/dist/themes/guezwhoz.json +0 -84
- package/dist/themes/hacktober.json +0 -84
- package/dist/themes/hardcore.json +0 -84
- package/dist/themes/havn-skumring.json +0 -84
- package/dist/themes/ic-orange-ppl.json +0 -84
- package/dist/themes/iterm2-smoooooth.json +0 -84
- package/dist/themes/iterm2-tango-dark.json +0 -84
- package/dist/themes/japanesque.json +0 -84
- package/dist/themes/jellybeans.json +0 -84
- package/dist/themes/kanagawa-wave.json +0 -84
- package/dist/themes/kurokula.json +0 -84
- package/dist/themes/later-this-evening.json +0 -84
- package/dist/themes/lovelace.json +0 -84
- package/dist/themes/material-darker.json +0 -84
- package/dist/themes/matte-black.json +0 -84
- package/dist/themes/mellow.json +0 -84
- package/dist/themes/miasma.json +0 -84
- package/dist/themes/nord.json +0 -80
- package/dist/themes/nvim-dark.json +0 -84
- package/dist/themes/one-dark.json +0 -80
- package/dist/themes/popping-and-locking.json +0 -84
- package/dist/themes/rose-pine.json +0 -80
- package/dist/themes/sea-shells.json +0 -84
- package/dist/themes/sleepy-hollow.json +0 -84
- package/dist/themes/smyck.json +0 -84
- package/dist/themes/solarized-dark.json +0 -80
- package/dist/themes/tokyo-night.json +0 -80
- package/dist/themes/tomorrow-night-bright.json +0 -84
- package/dist/themes/tomorrow-night-burns.json +0 -84
- package/dist/themes/tomorrow-night.json +0 -84
- package/dist/themes/twilight.json +0 -84
- package/dist/themes/vague.json +0 -84
- package/dist/themes/vesper.json +0 -84
- package/dist/themes/xcode-dark-hc.json +0 -84
- package/dist/utils/abort.d.ts +0 -4
- package/dist/utils/abort.js +0 -47
- package/dist/utils/ansi.d.ts +0 -1
- package/dist/utils/ansi.js +0 -51
- package/dist/utils/changelog.d.ts +0 -21
- package/dist/utils/changelog.js +0 -164
- package/dist/utils/child-process.d.ts +0 -17
- package/dist/utils/child-process.js +0 -105
- package/dist/utils/clipboard-image.d.ts +0 -10
- package/dist/utils/clipboard-image.js +0 -250
- package/dist/utils/clipboard-native.d.ts +0 -10
- package/dist/utils/clipboard-native.js +0 -19
- package/dist/utils/clipboard.d.ts +0 -3
- package/dist/utils/clipboard.js +0 -140
- package/dist/utils/deprecation.d.ts +0 -3
- package/dist/utils/deprecation.js +0 -12
- package/dist/utils/exif-orientation.d.ts +0 -4
- package/dist/utils/exif-orientation.js +0 -157
- package/dist/utils/frontmatter.d.ts +0 -7
- package/dist/utils/frontmatter.js +0 -25
- package/dist/utils/fs-watch.d.ts +0 -4
- package/dist/utils/fs-watch.js +0 -24
- package/dist/utils/git.d.ts +0 -25
- package/dist/utils/git.js +0 -194
- package/dist/utils/html.d.ts +0 -6
- package/dist/utils/html.js +0 -39
- package/dist/utils/image-convert.d.ts +0 -9
- package/dist/utils/image-convert.js +0 -44
- package/dist/utils/image-process.d.ts +0 -17
- package/dist/utils/image-process.js +0 -82
- package/dist/utils/image-resize-core.d.ts +0 -29
- package/dist/utils/image-resize-core.js +0 -123
- package/dist/utils/image-resize-worker.d.ts +0 -1
- package/dist/utils/image-resize-worker.js +0 -30
- package/dist/utils/image-resize.d.ts +0 -15
- package/dist/utils/image-resize.js +0 -96
- package/dist/utils/json.d.ts +0 -2
- package/dist/utils/json.js +0 -6
- package/dist/utils/mime.d.ts +0 -2
- package/dist/utils/mime.js +0 -132
- package/dist/utils/open-browser.d.ts +0 -8
- package/dist/utils/open-browser.js +0 -21
- package/dist/utils/paths.d.ts +0 -30
- package/dist/utils/paths.js +0 -91
- package/dist/utils/photon.d.ts +0 -20
- package/dist/utils/photon.js +0 -120
- package/dist/utils/pi-user-agent.d.ts +0 -1
- package/dist/utils/pi-user-agent.js +0 -4
- package/dist/utils/shell.d.ts +0 -33
- package/dist/utils/shell.js +0 -215
- package/dist/utils/sleep.d.ts +0 -4
- package/dist/utils/sleep.js +0 -16
- package/dist/utils/syntax-highlight.d.ts +0 -11
- package/dist/utils/syntax-highlight.js +0 -117
- package/dist/utils/thinking-tags.d.ts +0 -6
- package/dist/utils/thinking-tags.js +0 -62
- package/dist/utils/tools-manager.d.ts +0 -7
- package/dist/utils/tools-manager.js +0 -402
- package/dist/utils/version-check.d.ts +0 -19
- package/dist/utils/version-check.js +0 -72
- package/dist/utils/windows-self-update.d.ts +0 -2
- package/dist/utils/windows-self-update.js +0 -76
|
@@ -1,2304 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { execFileSync } from "node:child_process";
|
|
3
|
-
import * as fs from "node:fs";
|
|
4
|
-
import * as os from "node:os";
|
|
5
|
-
import * as path from "node:path";
|
|
6
|
-
import { afterEach, describe, it } from "node:test";
|
|
7
|
-
import { handleManagementAction } from "../../src/agents/agent-management.ts";
|
|
8
|
-
import { serializeAgent } from "../../src/agents/agent-serializer.ts";
|
|
9
|
-
import { parseChain, serializeChain } from "../../src/agents/chain-serializer.ts";
|
|
10
|
-
import { discoverAgents, discoverAgentsAll, inspectAgentDefinitionDirectory, type AgentConfig } from "../../src/agents/agents.ts";
|
|
11
|
-
import { parseFrontmatter } from "../../src/agents/frontmatter.ts";
|
|
12
|
-
import { buildPiArgs } from "../../src/runs/shared/pi-args.ts";
|
|
13
|
-
import { THINKING_LEVELS } from "../../src/shared/model-info.ts";
|
|
14
|
-
|
|
15
|
-
const tempDirs: string[] = [];
|
|
16
|
-
|
|
17
|
-
function writeJson(filePath: string, value: unknown): void {
|
|
18
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
19
|
-
fs.writeFileSync(filePath, JSON.stringify(value, null, 2), "utf-8");
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function writeAgent(filePath: string, body: string): void {
|
|
23
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
24
|
-
fs.writeFileSync(filePath, body, "utf-8");
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function createNestedLinkedWorktree(): { repo: string; worktree: string } {
|
|
28
|
-
const repo = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-linked-worktree-"));
|
|
29
|
-
tempDirs.push(repo);
|
|
30
|
-
execFileSync("git", ["init"], { cwd: repo, stdio: "ignore" });
|
|
31
|
-
execFileSync("git", ["config", "user.email", "test@example.com"], { cwd: repo });
|
|
32
|
-
execFileSync("git", ["config", "user.name", "Test User"], { cwd: repo });
|
|
33
|
-
fs.writeFileSync(path.join(repo, "base.txt"), "base\n", "utf-8");
|
|
34
|
-
execFileSync("git", ["add", "base.txt"], { cwd: repo });
|
|
35
|
-
execFileSync("git", ["commit", "-m", "base"], { cwd: repo, stdio: "ignore" });
|
|
36
|
-
|
|
37
|
-
const worktree = path.join(repo, ".worktrees", "linked");
|
|
38
|
-
execFileSync("git", ["worktree", "add", "-b", "linked", worktree], { cwd: repo, stdio: "ignore" });
|
|
39
|
-
return { repo, worktree };
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function writeLinkedWorktreePackage(repo: string): { packageAgentName: string; packageAgentPath: string; settingsPath: string } {
|
|
43
|
-
const packageAgentName = "issue950-workflow.reviewer";
|
|
44
|
-
const packageRoot = path.join(repo, ".selesai", "vendor", "workflow");
|
|
45
|
-
const packageAgentPath = path.join(packageRoot, "agents", "reviewer.md");
|
|
46
|
-
const settingsPath = path.join(repo, ".selesai", "settings.json");
|
|
47
|
-
writeJson(settingsPath, {
|
|
48
|
-
packages: [{ source: "file:./vendor/workflow" }],
|
|
49
|
-
subagents: {
|
|
50
|
-
projectRootResolution: "git-root",
|
|
51
|
-
agentOverrides: {
|
|
52
|
-
reviewer: { model: "issue950/outer-model" },
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
writeJson(path.join(packageRoot, "package.json"), {
|
|
57
|
-
name: "issue950-workflow",
|
|
58
|
-
"pi-subagents": { agents: ["./agents"] },
|
|
59
|
-
});
|
|
60
|
-
writeAgent(packageAgentPath, `---
|
|
61
|
-
name: reviewer
|
|
62
|
-
package: issue950-workflow
|
|
63
|
-
description: Review from the primary checkout.
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
Review the linked worktree.
|
|
67
|
-
`);
|
|
68
|
-
return { packageAgentName, packageAgentPath, settingsPath };
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function withTempHome<T>(fn: (home: string) => T): T {
|
|
72
|
-
const home = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-package-home-"));
|
|
73
|
-
tempDirs.push(home);
|
|
74
|
-
const oldHome = process.env.HOME;
|
|
75
|
-
const oldUserProfile = process.env.USERPROFILE;
|
|
76
|
-
const oldPiCodingAgentDir = process.env.SELESAI_CODING_AGENT_DIR;
|
|
77
|
-
const oldExtraAgentDirs = process.env.SELESAI_SUBAGENT_EXTRA_AGENT_DIRS;
|
|
78
|
-
process.env.HOME = home;
|
|
79
|
-
process.env.USERPROFILE = home;
|
|
80
|
-
delete process.env.SELESAI_CODING_AGENT_DIR;
|
|
81
|
-
delete process.env.SELESAI_SUBAGENT_EXTRA_AGENT_DIRS;
|
|
82
|
-
try {
|
|
83
|
-
return fn(home);
|
|
84
|
-
} finally {
|
|
85
|
-
if (oldHome === undefined) delete process.env.HOME;
|
|
86
|
-
else process.env.HOME = oldHome;
|
|
87
|
-
if (oldUserProfile === undefined) delete process.env.USERPROFILE;
|
|
88
|
-
else process.env.USERPROFILE = oldUserProfile;
|
|
89
|
-
if (oldPiCodingAgentDir === undefined) delete process.env.SELESAI_CODING_AGENT_DIR;
|
|
90
|
-
else process.env.SELESAI_CODING_AGENT_DIR = oldPiCodingAgentDir;
|
|
91
|
-
if (oldExtraAgentDirs === undefined) delete process.env.SELESAI_SUBAGENT_EXTRA_AGENT_DIRS;
|
|
92
|
-
else process.env.SELESAI_SUBAGENT_EXTRA_AGENT_DIRS = oldExtraAgentDirs;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
afterEach(() => {
|
|
97
|
-
while (tempDirs.length > 0) {
|
|
98
|
-
const dir = tempDirs.pop();
|
|
99
|
-
if (!dir) continue;
|
|
100
|
-
fs.rmSync(dir, { recursive: true, force: true });
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
describe("agent definition directory inspection", () => {
|
|
105
|
-
it("distinguishes absent, empty, candidates, unreadable, and non-directory paths", () => {
|
|
106
|
-
const root = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-inspection-"));
|
|
107
|
-
tempDirs.push(root);
|
|
108
|
-
const empty = path.join(root, "empty");
|
|
109
|
-
const candidates = path.join(root, "candidates");
|
|
110
|
-
const file = path.join(root, "not-directory");
|
|
111
|
-
fs.mkdirSync(empty);
|
|
112
|
-
fs.mkdirSync(candidates);
|
|
113
|
-
fs.writeFileSync(path.join(candidates, "worker.md"), "---\nname: worker\ndescription: Worker\n---\n", "utf-8");
|
|
114
|
-
fs.writeFileSync(file, "not a directory", "utf-8");
|
|
115
|
-
assert.equal(inspectAgentDefinitionDirectory(path.join(root, "absent")).state, "absent");
|
|
116
|
-
assert.equal(inspectAgentDefinitionDirectory(empty).state, "empty");
|
|
117
|
-
assert.deepEqual(inspectAgentDefinitionDirectory(candidates), { state: "candidates", files: [path.join(candidates, "worker.md")] });
|
|
118
|
-
assert.equal(inspectAgentDefinitionDirectory(file).state, "not-directory");
|
|
119
|
-
assert.equal(inspectAgentDefinitionDirectory(path.join(root, "blocked"), {
|
|
120
|
-
existsSync: () => true,
|
|
121
|
-
statSync: () => ({ isDirectory: () => true }),
|
|
122
|
-
readdirSync: () => { throw new Error("permission denied"); },
|
|
123
|
-
}).state, "unreadable");
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it("reports cached builtin and configured project definition paths without synthesizing a root", () => withTempHome(() => {
|
|
127
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-report-"));
|
|
128
|
-
tempDirs.push(project);
|
|
129
|
-
writeJson(path.join(project, ".selesai", "settings.json"), { subagents: { projectRootResolution: "nearest" } });
|
|
130
|
-
const discovered = discoverAgents(project, "project");
|
|
131
|
-
assert.ok(discovered.directories.some((entry) => entry.source === "builtin"));
|
|
132
|
-
assert.deepEqual(discovered.directories.filter((entry) => entry.source === "project").map((entry) => entry.path), [path.join(project, ".agents"), path.join(project, ".selesai", "agents")]);
|
|
133
|
-
}));
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
describe("folded frontmatter blocks", () => {
|
|
137
|
-
it("folds ordinary lines and paragraph breaks for > and >-", () => {
|
|
138
|
-
const expected = "first line second line\nthird line";
|
|
139
|
-
const folded = parseFrontmatter(`---
|
|
140
|
-
name: worker
|
|
141
|
-
description: >
|
|
142
|
-
first line
|
|
143
|
-
second line
|
|
144
|
-
|
|
145
|
-
third line
|
|
146
|
-
---
|
|
147
|
-
body`);
|
|
148
|
-
const stripped = parseFrontmatter(`---
|
|
149
|
-
name: worker
|
|
150
|
-
description: >-
|
|
151
|
-
first line
|
|
152
|
-
second line
|
|
153
|
-
|
|
154
|
-
third line
|
|
155
|
-
---
|
|
156
|
-
body`);
|
|
157
|
-
|
|
158
|
-
assert.equal(folded.frontmatter.description, expected);
|
|
159
|
-
assert.equal(stripped.frontmatter.description, expected);
|
|
160
|
-
assert.equal(folded.frontmatter.name, "worker");
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it("keeps quoted indicators as literal values", () => {
|
|
164
|
-
const parsed = parseFrontmatter(`---
|
|
165
|
-
description: ">"
|
|
166
|
-
other: '>-'
|
|
167
|
-
---
|
|
168
|
-
body`);
|
|
169
|
-
|
|
170
|
-
assert.equal(parsed.frontmatter.description, ">");
|
|
171
|
-
assert.equal(parsed.frontmatter.other, ">-");
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
it("preserves lines for | and |-", () => {
|
|
175
|
-
for (const indicator of ["|", "|-"]) {
|
|
176
|
-
const parsed = parseFrontmatter(`---
|
|
177
|
-
description: ${indicator}
|
|
178
|
-
first line
|
|
179
|
-
second line
|
|
180
|
-
---
|
|
181
|
-
body`);
|
|
182
|
-
assert.equal(parsed.frontmatter.description, "first line\nsecond line");
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
it("preserves more-indented lines and repeated whitespace-only separators", () => {
|
|
187
|
-
const parsed = parseFrontmatter(`---
|
|
188
|
-
description: >
|
|
189
|
-
normal
|
|
190
|
-
code
|
|
191
|
-
next
|
|
192
|
-
|
|
193
|
-
first
|
|
194
|
-
|
|
195
|
-
${" ".repeat(3)}
|
|
196
|
-
second
|
|
197
|
-
name: worker
|
|
198
|
-
---
|
|
199
|
-
body`);
|
|
200
|
-
|
|
201
|
-
assert.equal(parsed.frontmatter.description, "normal\n code\nnext\nfirst\n\nsecond");
|
|
202
|
-
assert.equal(parsed.frontmatter.name, "worker");
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
it("keeps paragraph breaks adjacent to more-indented lines", () => {
|
|
206
|
-
const afterIndented = parseFrontmatter(`---
|
|
207
|
-
description: >
|
|
208
|
-
normal
|
|
209
|
-
code
|
|
210
|
-
|
|
211
|
-
next
|
|
212
|
-
---
|
|
213
|
-
body`);
|
|
214
|
-
const beforeIndented = parseFrontmatter(`---
|
|
215
|
-
description: >
|
|
216
|
-
normal
|
|
217
|
-
|
|
218
|
-
code
|
|
219
|
-
next
|
|
220
|
-
---
|
|
221
|
-
body`);
|
|
222
|
-
|
|
223
|
-
assert.equal(afterIndented.frontmatter.description, "normal\n code\n\nnext");
|
|
224
|
-
assert.equal(beforeIndented.frontmatter.description, "normal\n\n code\nnext");
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
describe("agent runner frontmatter", () => {
|
|
229
|
-
it("parses and serializes an external-cli runner", () => withTempHome(() => {
|
|
230
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-runner-agent-"));
|
|
231
|
-
tempDirs.push(project);
|
|
232
|
-
writeAgent(path.join(project, ".selesai", "agents", "external.md"), `---
|
|
233
|
-
name: external
|
|
234
|
-
description: External runner
|
|
235
|
-
runner:
|
|
236
|
-
type: external-cli
|
|
237
|
-
command: ${JSON.stringify(process.execPath)}
|
|
238
|
-
args: ["-e", "process.stdin.pipe(process.stdout)"]
|
|
239
|
-
promptDelivery: stdin
|
|
240
|
-
async: true
|
|
241
|
-
---
|
|
242
|
-
Review carefully.`.replace(" description:", "description:"));
|
|
243
|
-
|
|
244
|
-
const external = discoverAgents(project, "project").agents.find((agent) => agent.name === "external")!;
|
|
245
|
-
assert.deepEqual(external.runner, { type: "external-cli", command: process.execPath, args: ["-e", "process.stdin.pipe(process.stdout)"], promptDelivery: "stdin" });
|
|
246
|
-
assert.match(serializeAgent(external), /runner:\n type: external-cli\n command:/);
|
|
247
|
-
assert.deepEqual(discoverAgents(project, "project").agents.find((agent) => agent.name === "external")?.runner, external.runner);
|
|
248
|
-
}));
|
|
249
|
-
|
|
250
|
-
it("keeps external-cli stop code-owned while refusing capability widening", () => withTempHome(() => {
|
|
251
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-runner-capabilities-"));
|
|
252
|
-
tempDirs.push(project);
|
|
253
|
-
const agentPath = path.join(project, ".selesai", "agents", "external.md");
|
|
254
|
-
writeAgent(agentPath, `---\nname: external\ndescription: External runner\nrunner:\n type: external-cli\n command: node\n capabilities:\n steer: false\n---\nReview.`);
|
|
255
|
-
assert.deepEqual(discoverAgents(project, "project").agents.find((agent) => agent.name === "external")?.runner, {
|
|
256
|
-
type: "external-cli",
|
|
257
|
-
command: "node",
|
|
258
|
-
capabilities: { steer: false },
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
writeAgent(agentPath, `---\nname: external\ndescription: External runner\nrunner:\n type: external-cli\n command: node\n capabilities:\n stop: false\n---\nReview.`);
|
|
262
|
-
const narrowedStop = discoverAgents(project, "project");
|
|
263
|
-
assert.equal(narrowedStop.agents.some((agent) => agent.name === "external"), false);
|
|
264
|
-
assert.match(narrowedStop.agentDiagnostics?.[0]?.error ?? "", /capabilities has unsupported fields: stop/);
|
|
265
|
-
|
|
266
|
-
writeAgent(agentPath, `---\nname: external\ndescription: External runner\nrunner:\n type: external-cli\n command: node\n capabilities:\n steer: true\n---\nReview.`);
|
|
267
|
-
const widened = discoverAgents(project, "project");
|
|
268
|
-
assert.equal(widened.agents.some((agent) => agent.name === "external"), false);
|
|
269
|
-
assert.match(widened.agentDiagnostics?.[0]?.error ?? "", /steer may only be false; user config cannot widen code-owned external adapter capabilities/);
|
|
270
|
-
}));
|
|
271
|
-
|
|
272
|
-
it("parses and serializes an external-job runner", () => withTempHome(() => {
|
|
273
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-external-job-agent-"));
|
|
274
|
-
tempDirs.push(project);
|
|
275
|
-
writeAgent(path.join(project, ".selesai", "agents", "gpt-pro.md"), `---
|
|
276
|
-
name: gpt-pro
|
|
277
|
-
description: Surf GPT Pro advisor
|
|
278
|
-
runner:
|
|
279
|
-
type: external-job
|
|
280
|
-
provider: surf-oracle
|
|
281
|
-
options:
|
|
282
|
-
tier: pro
|
|
283
|
-
async: true
|
|
284
|
-
---
|
|
285
|
-
Review carefully.`);
|
|
286
|
-
|
|
287
|
-
const gptPro = discoverAgents(project, "project").agents.find((agent) => agent.name === "gpt-pro")!;
|
|
288
|
-
assert.deepEqual(gptPro.runner, { type: "external-job", provider: "surf-oracle", options: { tier: "pro" } });
|
|
289
|
-
assert.match(serializeAgent(gptPro), /runner:\n type: external-job\n provider: surf-oracle/);
|
|
290
|
-
}));
|
|
291
|
-
|
|
292
|
-
it("rejects invalid and Pi-only external runner fields", () => withTempHome(() => {
|
|
293
|
-
const invalidCases = [
|
|
294
|
-
"type: unknown\n command: node",
|
|
295
|
-
"type: external-cli\n command: ''",
|
|
296
|
-
"type: external-cli\n command: node\n args: nope",
|
|
297
|
-
"type: external-cli\n command: node\n args: [ok, 1]",
|
|
298
|
-
"type: external-cli\n command: node\n promptDelivery: argv",
|
|
299
|
-
"type: external-job\n provider: ''",
|
|
300
|
-
"type: external-job\n provider: surf-oracle\n options: []",
|
|
301
|
-
];
|
|
302
|
-
for (const [index, runner] of invalidCases.entries()) {
|
|
303
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), `pi-subagents-invalid-runner-${index}-`));
|
|
304
|
-
tempDirs.push(project);
|
|
305
|
-
writeAgent(path.join(project, ".selesai", "agents", "external.md"), `---\nname: external\ndescription: External\nrunner:\n ${runner}\n---\nBody`);
|
|
306
|
-
const discovered = discoverAgents(project, "project");
|
|
307
|
-
assert.equal(discovered.agents.some((agent) => agent.name === "external"), false);
|
|
308
|
-
assert.match(discovered.agentDiagnostics?.[0]?.error ?? "", /invalid runner\.type|non-empty command|args must be an array of strings|promptDelivery must be 'stdin'|provider string|options must be a JSON-serializable object/);
|
|
309
|
-
}
|
|
310
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-runner-pi-only-"));
|
|
311
|
-
tempDirs.push(project);
|
|
312
|
-
writeAgent(path.join(project, ".selesai", "agents", "external.md"), `---\nname: external\ndescription: External\nrunner:\n type: external-cli\n command: node\nmodel: provider/model\n---\nBody`);
|
|
313
|
-
assert.match(discoverAgents(project, "project").agentDiagnostics?.[0]?.error ?? "", /unsupported Pi-only fields: model/);
|
|
314
|
-
}));
|
|
315
|
-
|
|
316
|
-
it("keeps valid agents executable when another agent is malformed", () => withTempHome(() => {
|
|
317
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-invalid-agent-isolation-"));
|
|
318
|
-
tempDirs.push(project);
|
|
319
|
-
writeAgent(path.join(project, ".selesai", "agents", "broken.md"), "---\nname: broken\ndescription: Broken\nrunner:\n type: unknown\n---\nBody");
|
|
320
|
-
writeAgent(path.join(project, ".selesai", "agents", "working.md"), "---\nname: working\ndescription: Working\n---\nBody");
|
|
321
|
-
|
|
322
|
-
const discovered = discoverAgents(project, "project");
|
|
323
|
-
assert.ok(discovered.agents.some((agent) => agent.name === "working"));
|
|
324
|
-
assert.equal(discovered.agentDiagnostics?.[0]?.name, "broken");
|
|
325
|
-
}));
|
|
326
|
-
|
|
327
|
-
it("follows symlinked agent directories once without hiding diagnostics", () => withTempHome(() => {
|
|
328
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-symlinked-agent-dir-"));
|
|
329
|
-
tempDirs.push(project);
|
|
330
|
-
const legacyAgentsRoot = path.join(project, ".agents");
|
|
331
|
-
const sharedAgents = path.join(project, "shared-agents");
|
|
332
|
-
const linkedAgents = path.join(legacyAgentsRoot, "agents");
|
|
333
|
-
fs.mkdirSync(legacyAgentsRoot, { recursive: true });
|
|
334
|
-
fs.mkdirSync(sharedAgents, { recursive: true });
|
|
335
|
-
writeAgent(path.join(sharedAgents, "linked.md"), "---\nname: linked\ndescription: Linked agent\n---\nBody");
|
|
336
|
-
writeAgent(path.join(sharedAgents, "broken.md"), "---\nname: broken\ndescription: Broken\nrunner:\n type: unknown\n---\nBody");
|
|
337
|
-
fs.symlinkSync(sharedAgents, linkedAgents, process.platform === "win32" ? "junction" : "dir");
|
|
338
|
-
fs.symlinkSync(path.join(sharedAgents, "missing"), path.join(sharedAgents, "dangling"), process.platform === "win32" ? "junction" : "dir");
|
|
339
|
-
if (process.platform !== "win32") fs.symlinkSync(sharedAgents, path.join(sharedAgents, "loop"), "dir");
|
|
340
|
-
|
|
341
|
-
const discovered = discoverAgents(project, "project");
|
|
342
|
-
assert.equal(discovered.agents.find((agent) => agent.name === "linked")?.filePath, path.join(linkedAgents, "linked.md"));
|
|
343
|
-
assert.equal(discovered.agentDiagnostics?.find((diagnostic) => diagnostic.name === "broken")?.filePath, path.join(linkedAgents, "broken.md"));
|
|
344
|
-
}));
|
|
345
|
-
|
|
346
|
-
it("keeps a lower-priority agent available when a project override is malformed", () => withTempHome(() => {
|
|
347
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-invalid-agent-shadow-"));
|
|
348
|
-
tempDirs.push(project);
|
|
349
|
-
writeAgent(path.join(project, ".selesai", "agents", "reviewer.md"), "---\nname: reviewer\ndescription: Broken reviewer\nrunner:\n type: unknown\n---\nBody");
|
|
350
|
-
|
|
351
|
-
const discovered = discoverAgents(project, "both");
|
|
352
|
-
assert.equal(discovered.agents.find((agent) => agent.name === "reviewer")?.source, "builtin");
|
|
353
|
-
assert.equal(discovered.agentDiagnostics?.find((diagnostic) => diagnostic.name === "reviewer")?.source, "project");
|
|
354
|
-
}));
|
|
355
|
-
|
|
356
|
-
it("records the runtime name for malformed packaged agents", () => withTempHome(() => {
|
|
357
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-invalid-packaged-agent-"));
|
|
358
|
-
tempDirs.push(project);
|
|
359
|
-
writeAgent(path.join(project, ".selesai", "agents", "code-analysis.zeta-worker.md"), "---\nname: zeta-worker\npackage: code-analysis\ndescription: Broken packaged worker\nrunner:\n type: unknown\n---\nBody");
|
|
360
|
-
|
|
361
|
-
const discovered = discoverAgents(project, "project");
|
|
362
|
-
assert.equal(discovered.agents.some((agent) => agent.name === "code-analysis.zeta-worker"), false);
|
|
363
|
-
assert.deepEqual(discovered.agentDiagnostics?.[0] && { name: discovered.agentDiagnostics[0].name, runtimeName: discovered.agentDiagnostics[0].runtimeName }, {
|
|
364
|
-
name: "zeta-worker",
|
|
365
|
-
runtimeName: "code-analysis.zeta-worker",
|
|
366
|
-
});
|
|
367
|
-
}));
|
|
368
|
-
});
|
|
369
|
-
|
|
370
|
-
describe("agent skillPath frontmatter", () => {
|
|
371
|
-
it("parses and serializes comma-separated paths", () => withTempHome(() => {
|
|
372
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-skill-path-agent-"));
|
|
373
|
-
tempDirs.push(project);
|
|
374
|
-
writeAgent(path.join(project, ".selesai", "agents", "worker.md"), `---
|
|
375
|
-
name: worker
|
|
376
|
-
description: Worker
|
|
377
|
-
skillPath: ./skills, ../shared-skills
|
|
378
|
-
---
|
|
379
|
-
body`);
|
|
380
|
-
|
|
381
|
-
const worker = discoverAgents(project, "both").agents.find((agent) => agent.name === "worker")!;
|
|
382
|
-
assert.deepEqual(worker.skillPath, ["./skills", "../shared-skills"]);
|
|
383
|
-
assert.match(serializeAgent(worker), /^skillPath: \.\/skills, \.\.\/shared-skills$/m);
|
|
384
|
-
}));
|
|
385
|
-
});
|
|
386
|
-
|
|
387
|
-
describe("agent aliases", () => {
|
|
388
|
-
it("parses and serializes agent aliases", () => withTempHome(() => {
|
|
389
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-alias-agent-"));
|
|
390
|
-
tempDirs.push(project);
|
|
391
|
-
writeAgent(path.join(project, ".selesai", "agents", "worker.md"), `---
|
|
392
|
-
name: worker
|
|
393
|
-
description: Worker
|
|
394
|
-
aliases: developer, coder, worker
|
|
395
|
-
---
|
|
396
|
-
body`);
|
|
397
|
-
|
|
398
|
-
const worker = discoverAgents(project, "both").agents.find((agent) => agent.name === "worker")!;
|
|
399
|
-
assert.deepEqual(worker.aliases, ["developer", "coder"]);
|
|
400
|
-
assert.match(serializeAgent(worker), /^aliases: developer, coder$/m);
|
|
401
|
-
|
|
402
|
-
const ctx = { cwd: project, modelRegistry: { getAvailable: () => [] } };
|
|
403
|
-
assert.match(handleManagementAction("list", {}, ctx).content[0]?.text ?? "", /aliases: developer, coder/);
|
|
404
|
-
assert.match(handleManagementAction("get", { agent: "developer" }, ctx).content[0]?.text ?? "", /Agent: worker/);
|
|
405
|
-
}));
|
|
406
|
-
|
|
407
|
-
it("reports management alias collisions as ambiguous", () => withTempHome(() => {
|
|
408
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-alias-collision-"));
|
|
409
|
-
tempDirs.push(project);
|
|
410
|
-
writeAgent(path.join(project, ".selesai", "agents", "review-agent.md"), `---
|
|
411
|
-
name: review-agent
|
|
412
|
-
description: Custom reviewer
|
|
413
|
-
aliases: developer
|
|
414
|
-
---
|
|
415
|
-
body`);
|
|
416
|
-
|
|
417
|
-
const ctx = { cwd: project, modelRegistry: { getAvailable: () => [] } };
|
|
418
|
-
const getResult = handleManagementAction("get", { agent: "developer" }, ctx);
|
|
419
|
-
assert.equal(getResult.isError, true);
|
|
420
|
-
assert.match(getResult.content[0]?.text ?? "", /Ambiguous agent alias or name 'developer': review-agent, worker/);
|
|
421
|
-
|
|
422
|
-
const disableResult = handleManagementAction("disable", { agent: "developer" }, ctx);
|
|
423
|
-
assert.equal(disableResult.isError, true);
|
|
424
|
-
assert.match(disableResult.content[0]?.text ?? "", /Ambiguous agent alias 'developer': worker, review-agent|Ambiguous agent alias 'developer': review-agent, worker/);
|
|
425
|
-
}));
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
describe("agent simple-scalar list frontmatter", () => {
|
|
429
|
-
it("discovers newline block lists for all list fields and routes MCP tools", () => {
|
|
430
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-block-list-frontmatter-"));
|
|
431
|
-
tempDirs.push(dir);
|
|
432
|
-
writeAgent(path.join(dir, ".selesai", "agents", "worker.md"), `---
|
|
433
|
-
name: worker
|
|
434
|
-
description: Worker
|
|
435
|
-
tools:
|
|
436
|
-
- read-only
|
|
437
|
-
- mcp:github/search_repositories
|
|
438
|
-
defaultReads:
|
|
439
|
-
- input-one.md
|
|
440
|
-
- input-two.md
|
|
441
|
-
skill:
|
|
442
|
-
- review-checklist
|
|
443
|
-
- safe-bash
|
|
444
|
-
skillPath:
|
|
445
|
-
- ./private-skills
|
|
446
|
-
- ../shared-skills
|
|
447
|
-
fallbackModels:
|
|
448
|
-
- openai/gpt-5-mini
|
|
449
|
-
- anthropic/claude-sonnet-4
|
|
450
|
-
extensions:
|
|
451
|
-
- ./extension-one.ts
|
|
452
|
-
- ./extension-two.ts
|
|
453
|
-
subagentOnlyExtensions:
|
|
454
|
-
- ./child-only.ts
|
|
455
|
-
- ./child-helper.ts
|
|
456
|
-
---
|
|
457
|
-
|
|
458
|
-
Do work
|
|
459
|
-
`);
|
|
460
|
-
|
|
461
|
-
const worker = discoverAgents(dir, "project").agents.find((agent) => agent.name === "worker");
|
|
462
|
-
assert.deepEqual(worker?.tools, ["read-only"]);
|
|
463
|
-
assert.deepEqual(worker?.mcpDirectTools, ["github/search_repositories"]);
|
|
464
|
-
assert.deepEqual(worker?.defaultReads, ["input-one.md", "input-two.md"]);
|
|
465
|
-
assert.deepEqual(worker?.skills, ["review-checklist", "safe-bash"]);
|
|
466
|
-
assert.deepEqual(worker?.skillPath, ["./private-skills", "../shared-skills"]);
|
|
467
|
-
assert.deepEqual(worker?.fallbackModels, ["openai/gpt-5-mini", "anthropic/claude-sonnet-4"]);
|
|
468
|
-
assert.deepEqual(worker?.extensions, [path.join(dir, ".selesai", "agents", "extension-one.ts"), path.join(dir, ".selesai", "agents", "extension-two.ts")]);
|
|
469
|
-
assert.deepEqual(worker?.subagentOnlyExtensions, [path.join(dir, ".selesai", "agents", "child-only.ts"), path.join(dir, ".selesai", "agents", "child-helper.ts")]);
|
|
470
|
-
});
|
|
471
|
-
|
|
472
|
-
it("preserves MCP-only tools as an explicit empty builtin allowlist", () => {
|
|
473
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-mcp-only-frontmatter-"));
|
|
474
|
-
tempDirs.push(dir);
|
|
475
|
-
writeAgent(path.join(dir, ".selesai", "agents", "mcp-only.md"), `---
|
|
476
|
-
name: mcp-only
|
|
477
|
-
description: MCP only
|
|
478
|
-
tools: mcp:github/search_repositories
|
|
479
|
-
---
|
|
480
|
-
|
|
481
|
-
Do MCP work
|
|
482
|
-
`);
|
|
483
|
-
|
|
484
|
-
const agent = discoverAgents(dir, "project").agents.find((candidate) => candidate.name === "mcp-only");
|
|
485
|
-
assert.deepEqual(agent?.tools, []);
|
|
486
|
-
assert.deepEqual(agent?.mcpDirectTools, ["github/search_repositories"]);
|
|
487
|
-
assert.match(serializeAgent(agent!), /^tools: mcp:github\/search_repositories$/m);
|
|
488
|
-
});
|
|
489
|
-
|
|
490
|
-
it("preserves comma-separated syntax across all list fields", () => {
|
|
491
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-comma-list-frontmatter-"));
|
|
492
|
-
tempDirs.push(dir);
|
|
493
|
-
writeAgent(path.join(dir, ".selesai", "agents", "worker.md"), `---
|
|
494
|
-
name: worker
|
|
495
|
-
description: Worker
|
|
496
|
-
tools: read-only, mcp:github/search_repositories
|
|
497
|
-
defaultReads: input-one.md, input-two.md
|
|
498
|
-
skills: review-checklist, safe-bash
|
|
499
|
-
skillPath: ./private-skills, ../shared-skills
|
|
500
|
-
fallbackModels: openai/gpt-5-mini, anthropic/claude-sonnet-4
|
|
501
|
-
extensions: ./extension-one.ts, ./extension-two.ts
|
|
502
|
-
subagentOnlyExtensions: ./child-only.ts, ./child-helper.ts
|
|
503
|
-
---
|
|
504
|
-
|
|
505
|
-
Do work
|
|
506
|
-
`);
|
|
507
|
-
|
|
508
|
-
const worker = discoverAgents(dir, "project").agents.find((agent) => agent.name === "worker");
|
|
509
|
-
assert.deepEqual(worker?.tools, ["read-only"]);
|
|
510
|
-
assert.deepEqual(worker?.mcpDirectTools, ["github/search_repositories"]);
|
|
511
|
-
assert.deepEqual(worker?.defaultReads, ["input-one.md", "input-two.md"]);
|
|
512
|
-
assert.deepEqual(worker?.skills, ["review-checklist", "safe-bash"]);
|
|
513
|
-
assert.deepEqual(worker?.skillPath, ["./private-skills", "../shared-skills"]);
|
|
514
|
-
assert.deepEqual(worker?.fallbackModels, ["openai/gpt-5-mini", "anthropic/claude-sonnet-4"]);
|
|
515
|
-
assert.deepEqual(worker?.extensions, [path.join(dir, ".selesai", "agents", "extension-one.ts"), path.join(dir, ".selesai", "agents", "extension-two.ts")]);
|
|
516
|
-
assert.deepEqual(worker?.subagentOnlyExtensions, [path.join(dir, ".selesai", "agents", "child-only.ts"), path.join(dir, ".selesai", "agents", "child-helper.ts")]);
|
|
517
|
-
});
|
|
518
|
-
});
|
|
519
|
-
|
|
520
|
-
describe("agent permission frontmatter", () => {
|
|
521
|
-
it("parses and preserves explicit non-bash permission rules", () => {
|
|
522
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-permission-frontmatter-"));
|
|
523
|
-
tempDirs.push(dir);
|
|
524
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
525
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
526
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---
|
|
527
|
-
name: worker
|
|
528
|
-
description: Worker
|
|
529
|
-
tools: bash,read,write
|
|
530
|
-
permission:
|
|
531
|
-
read: allow
|
|
532
|
-
write: ask
|
|
533
|
-
edit: deny
|
|
534
|
-
---
|
|
535
|
-
|
|
536
|
-
Do work
|
|
537
|
-
`, "utf-8");
|
|
538
|
-
|
|
539
|
-
const worker = discoverAgents(dir, "project").agents.find((agent) => agent.name === "worker");
|
|
540
|
-
assert.deepEqual(worker?.permissions, { read: "allow", write: "ask", edit: "deny" });
|
|
541
|
-
assert.equal(worker?.extraFields?.permission, undefined);
|
|
542
|
-
assert.match(serializeAgent(worker!), /^permissions:\n read: allow\n write: ask\n edit: deny$/m);
|
|
543
|
-
});
|
|
544
|
-
|
|
545
|
-
it("rejects bash permission rules and conflicting aliases", () => {
|
|
546
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-permission-invalid-"));
|
|
547
|
-
tempDirs.push(dir);
|
|
548
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
549
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
550
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---\nname: worker\ndescription: Worker\npermission:\n bash: deny\n---\n`, "utf-8");
|
|
551
|
-
assert.match(discoverAgents(dir, "project").agentDiagnostics?.[0]?.error ?? "", /pi-guard/);
|
|
552
|
-
|
|
553
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---\nname: worker\ndescription: Worker\npermission:\n write: ask\npermissions:\n edit: deny\n---\n`, "utf-8");
|
|
554
|
-
assert.match(discoverAgents(dir, "project").agentDiagnostics?.[0]?.error ?? "", /cannot declare both permission and permissions/);
|
|
555
|
-
});
|
|
556
|
-
});
|
|
557
|
-
|
|
558
|
-
describe("agent frontmatter defaultContext", () => {
|
|
559
|
-
it("serializes defaultContext into agent frontmatter", () => {
|
|
560
|
-
const agent: AgentConfig = {
|
|
561
|
-
name: "worker",
|
|
562
|
-
description: "Worker",
|
|
563
|
-
systemPrompt: "Do work",
|
|
564
|
-
systemPromptMode: "replace",
|
|
565
|
-
inheritProjectContext: true,
|
|
566
|
-
inheritSkills: false,
|
|
567
|
-
source: "project",
|
|
568
|
-
filePath: "/tmp/worker.md",
|
|
569
|
-
defaultContext: "fork",
|
|
570
|
-
};
|
|
571
|
-
|
|
572
|
-
const serialized = serializeAgent(agent);
|
|
573
|
-
assert.match(serialized, /defaultContext: fork/);
|
|
574
|
-
});
|
|
575
|
-
|
|
576
|
-
it("parses defaultContext from discovered agent frontmatter", () => {
|
|
577
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-default-context-"));
|
|
578
|
-
tempDirs.push(dir);
|
|
579
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
580
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
581
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---
|
|
582
|
-
name: worker
|
|
583
|
-
description: Worker
|
|
584
|
-
defaultContext: fork
|
|
585
|
-
---
|
|
586
|
-
|
|
587
|
-
Do work
|
|
588
|
-
`, "utf-8");
|
|
589
|
-
|
|
590
|
-
const result = discoverAgents(dir, "project");
|
|
591
|
-
const worker = result.agents.find((agent) => agent.name === "worker");
|
|
592
|
-
assert.equal(worker?.defaultContext, "fork");
|
|
593
|
-
});
|
|
594
|
-
|
|
595
|
-
it("loads packaged worker and oracle with fork defaultContext and advisor alias", () => {
|
|
596
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-builtin-default-context-"));
|
|
597
|
-
tempDirs.push(dir);
|
|
598
|
-
const agents = discoverAgentsAll(dir).builtin;
|
|
599
|
-
|
|
600
|
-
for (const name of ["worker", "oracle"]) {
|
|
601
|
-
const agent = agents.find((candidate) => candidate.name === name);
|
|
602
|
-
assert.equal(agent?.defaultContext, "fork", `${name} should default to fork context`);
|
|
603
|
-
}
|
|
604
|
-
const oracle = agents.find((candidate) => candidate.name === "oracle");
|
|
605
|
-
assert.deepEqual(oracle?.aliases, ["advisor"]);
|
|
606
|
-
assert.doesNotMatch(oracle?.tools?.join(",") ?? "", /contact_supervisor/);
|
|
607
|
-
for (const name of ["scout", "researcher", "oracle", "reviewer"]) {
|
|
608
|
-
assert.equal(agents.find((candidate) => candidate.name === name)?.tools?.includes("intercom"), false, `${name} should not require generic intercom`);
|
|
609
|
-
}
|
|
610
|
-
assert.match(oracle?.systemPrompt ?? "", /asking or consulting the oracle/);
|
|
611
|
-
assert.match(oracle?.systemPrompt ?? "", /When runtime bridge instructions provide `contact_supervisor`/);
|
|
612
|
-
assert.match(oracle?.systemPrompt ?? "", /If no supervisor channel is available/);
|
|
613
|
-
assert.equal(agents.some((candidate) => candidate.name === "planner"), false);
|
|
614
|
-
assert.equal(agents.some((candidate) => candidate.name === "context-builder"), false);
|
|
615
|
-
assert.equal(agents.some((candidate) => candidate.name === "gpt-pro"), false);
|
|
616
|
-
});
|
|
617
|
-
|
|
618
|
-
it("keeps bundled agent definitions from module load during package file updates", () => {
|
|
619
|
-
const fixture = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-builtin-hot-update-"));
|
|
620
|
-
tempDirs.push(fixture);
|
|
621
|
-
fs.cpSync(path.join(process.cwd(), "src"), path.join(fixture, "src"), { recursive: true });
|
|
622
|
-
fs.cpSync(path.join(process.cwd(), "agents"), path.join(fixture, "agents"), { recursive: true });
|
|
623
|
-
fs.symlinkSync(path.join(process.cwd(), "node_modules"), path.join(fixture, "node_modules"), process.platform === "win32" ? "junction" : "dir");
|
|
624
|
-
writeJson(path.join(fixture, "package.json"), { type: "module" });
|
|
625
|
-
writeAgent(path.join(fixture, "challenge.mjs"), `
|
|
626
|
-
import assert from "node:assert/strict";
|
|
627
|
-
import * as fs from "node:fs";
|
|
628
|
-
import * as path from "node:path";
|
|
629
|
-
import { discoverAgentsAll } from "./src/agents/agents.ts";
|
|
630
|
-
|
|
631
|
-
const scoutPath = path.join(process.cwd(), "agents", "scout.md");
|
|
632
|
-
fs.writeFileSync(scoutPath, \`---
|
|
633
|
-
name: scout
|
|
634
|
-
description: Future scout
|
|
635
|
-
runner:
|
|
636
|
-
type: future-runner
|
|
637
|
-
---
|
|
638
|
-
|
|
639
|
-
Review with the future runner.
|
|
640
|
-
\`, "utf-8");
|
|
641
|
-
|
|
642
|
-
const discovered = discoverAgentsAll(process.cwd());
|
|
643
|
-
const scout = discovered.builtin.find((candidate) => candidate.name === "scout");
|
|
644
|
-
|
|
645
|
-
assert.equal(scout?.runner, undefined);
|
|
646
|
-
assert.equal(discovered.agentDiagnostics?.some((diagnostic) => diagnostic.filePath === scoutPath), false);
|
|
647
|
-
`);
|
|
648
|
-
|
|
649
|
-
execFileSync(process.execPath, ["--experimental-strip-types", "challenge.mjs"], { cwd: fixture, stdio: "pipe" });
|
|
650
|
-
});
|
|
651
|
-
});
|
|
652
|
-
|
|
653
|
-
describe("agent frontmatter launch defaults", () => {
|
|
654
|
-
it("parses, serializes, and validates outputMode defaults", () => {
|
|
655
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-output-mode-"));
|
|
656
|
-
tempDirs.push(dir);
|
|
657
|
-
const filePath = path.join(dir, ".selesai", "agents", "worker.md");
|
|
658
|
-
writeAgent(filePath, `---
|
|
659
|
-
name: worker
|
|
660
|
-
description: Worker
|
|
661
|
-
outputMode: file-only
|
|
662
|
-
---
|
|
663
|
-
|
|
664
|
-
Do work
|
|
665
|
-
`);
|
|
666
|
-
|
|
667
|
-
const worker = discoverAgents(dir, "project").agents.find((agent) => agent.name === "worker");
|
|
668
|
-
assert.equal(worker?.outputMode, "file-only");
|
|
669
|
-
assert.match(serializeAgent(worker!), /^outputMode: file-only$/m);
|
|
670
|
-
|
|
671
|
-
writeAgent(filePath, `---
|
|
672
|
-
name: worker
|
|
673
|
-
description: Worker
|
|
674
|
-
outputMode: artifact-only
|
|
675
|
-
---
|
|
676
|
-
|
|
677
|
-
Do work
|
|
678
|
-
`);
|
|
679
|
-
assert.match(discoverAgents(dir, "project").agentDiagnostics?.[0]?.error ?? "", /Agent 'worker' has invalid outputMode frontmatter; expected 'inline' or 'file-only'/);
|
|
680
|
-
});
|
|
681
|
-
|
|
682
|
-
it("serializes and discovers single-agent launch defaults", () => {
|
|
683
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-launch-defaults-"));
|
|
684
|
-
tempDirs.push(dir);
|
|
685
|
-
const filePath = path.join(dir, ".selesai", "agents", "worker.md");
|
|
686
|
-
const agent: AgentConfig = {
|
|
687
|
-
name: "worker",
|
|
688
|
-
description: "Worker",
|
|
689
|
-
systemPrompt: "Do work",
|
|
690
|
-
systemPromptMode: "replace",
|
|
691
|
-
inheritProjectContext: false,
|
|
692
|
-
inheritSkills: false,
|
|
693
|
-
source: "project",
|
|
694
|
-
filePath,
|
|
695
|
-
defaultAsync: false,
|
|
696
|
-
defaultTimeoutMs: 90_000,
|
|
697
|
-
defaultToolTimeoutMs: 600_000,
|
|
698
|
-
defaultAcceptance: { level: "none", reason: "lightweight lookup" },
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
const serialized = serializeAgent(agent);
|
|
702
|
-
assert.match(serialized, /^async: false$/m);
|
|
703
|
-
assert.match(serialized, /^timeoutMs: 90000$/m);
|
|
704
|
-
assert.match(serialized, /^toolTimeoutMs: 600000$/m);
|
|
705
|
-
assert.match(serialized, /^acceptance: \{"level":"none","reason":"lightweight lookup"\}$/m);
|
|
706
|
-
writeAgent(filePath, serialized);
|
|
707
|
-
|
|
708
|
-
const worker = discoverAgents(dir, "project").agents.find((candidate) => candidate.name === "worker");
|
|
709
|
-
assert.equal(worker?.defaultAsync, false);
|
|
710
|
-
assert.equal(worker?.defaultTimeoutMs, 90_000);
|
|
711
|
-
assert.equal(worker?.defaultToolTimeoutMs, 600_000);
|
|
712
|
-
assert.deepEqual(worker?.defaultAcceptance, { level: "none", reason: "lightweight lookup" });
|
|
713
|
-
});
|
|
714
|
-
|
|
715
|
-
it("parses scalar acceptance defaults and rejects invalid policies", () => {
|
|
716
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-acceptance-defaults-"));
|
|
717
|
-
tempDirs.push(dir);
|
|
718
|
-
const filePath = path.join(dir, ".selesai", "agents", "worker.md");
|
|
719
|
-
writeAgent(filePath, `---
|
|
720
|
-
name: worker
|
|
721
|
-
description: Worker
|
|
722
|
-
acceptance: checked
|
|
723
|
-
---
|
|
724
|
-
|
|
725
|
-
Do work
|
|
726
|
-
`);
|
|
727
|
-
assert.equal(discoverAgents(dir, "project").agents.find((agent) => agent.name === "worker")?.defaultAcceptance, "checked");
|
|
728
|
-
|
|
729
|
-
writeAgent(filePath, `---
|
|
730
|
-
name: worker
|
|
731
|
-
description: Worker
|
|
732
|
-
acceptance: { level: "none", reason: "NA" }
|
|
733
|
-
---
|
|
734
|
-
|
|
735
|
-
Do work
|
|
736
|
-
`);
|
|
737
|
-
assert.deepEqual(
|
|
738
|
-
discoverAgents(dir, "project").agents.find((agent) => agent.name === "worker")?.defaultAcceptance,
|
|
739
|
-
{ level: "none", reason: "NA" },
|
|
740
|
-
);
|
|
741
|
-
|
|
742
|
-
writeAgent(filePath, `---
|
|
743
|
-
name: worker
|
|
744
|
-
description: Worker
|
|
745
|
-
acceptance: none
|
|
746
|
-
---
|
|
747
|
-
|
|
748
|
-
Do work
|
|
749
|
-
`);
|
|
750
|
-
assert.match(discoverAgents(dir, "project").agentDiagnostics?.[0]?.error ?? "", /Agent 'worker' acceptance frontmatter level "none" requires a reason/);
|
|
751
|
-
});
|
|
752
|
-
|
|
753
|
-
it("parses, serializes, and validates acceptance roles", () => {
|
|
754
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-acceptance-role-"));
|
|
755
|
-
tempDirs.push(dir);
|
|
756
|
-
const filePath = path.join(dir, ".selesai", "agents", "explorer.md");
|
|
757
|
-
writeAgent(filePath, `---
|
|
758
|
-
name: explorer
|
|
759
|
-
description: Explorer
|
|
760
|
-
acceptanceRole: read-only
|
|
761
|
-
---
|
|
762
|
-
|
|
763
|
-
Explore the codebase
|
|
764
|
-
`);
|
|
765
|
-
|
|
766
|
-
const explorer = discoverAgents(dir, "project").agents.find((agent) => agent.name === "explorer");
|
|
767
|
-
assert.equal(explorer?.acceptanceRole, "read-only");
|
|
768
|
-
assert.match(serializeAgent(explorer!), /^acceptanceRole: read-only$/m);
|
|
769
|
-
assert.equal(explorer?.extraFields?.acceptanceRole, undefined);
|
|
770
|
-
|
|
771
|
-
writeAgent(filePath, `---
|
|
772
|
-
name: explorer
|
|
773
|
-
description: Explorer
|
|
774
|
-
acceptanceRole: observer
|
|
775
|
-
---
|
|
776
|
-
|
|
777
|
-
Explore the codebase
|
|
778
|
-
`);
|
|
779
|
-
assert.match(discoverAgents(dir, "project").agentDiagnostics?.[0]?.error ?? "", /Agent 'explorer' has invalid acceptanceRole frontmatter; expected 'read-only' or 'writer'/);
|
|
780
|
-
});
|
|
781
|
-
|
|
782
|
-
it("rejects invalid launch defaults instead of silently ignoring them", () => {
|
|
783
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-invalid-launch-defaults-"));
|
|
784
|
-
tempDirs.push(dir);
|
|
785
|
-
writeAgent(path.join(dir, ".selesai", "agents", "worker.md"), `---
|
|
786
|
-
name: worker
|
|
787
|
-
description: Worker
|
|
788
|
-
async: sometimes
|
|
789
|
-
---
|
|
790
|
-
|
|
791
|
-
Do work
|
|
792
|
-
`);
|
|
793
|
-
|
|
794
|
-
assert.match(discoverAgents(dir, "project").agentDiagnostics?.[0]?.error ?? "", /Agent 'worker' has invalid async frontmatter; expected true or false/);
|
|
795
|
-
});
|
|
796
|
-
|
|
797
|
-
it("rejects oversized toolTimeoutMs frontmatter at discovery", () => {
|
|
798
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-oversized-tool-timeout-"));
|
|
799
|
-
tempDirs.push(dir);
|
|
800
|
-
writeAgent(path.join(dir, ".selesai", "agents", "worker.md"), `---
|
|
801
|
-
name: worker
|
|
802
|
-
description: Worker
|
|
803
|
-
toolTimeoutMs: 2147483648
|
|
804
|
-
---
|
|
805
|
-
|
|
806
|
-
Do work
|
|
807
|
-
`);
|
|
808
|
-
|
|
809
|
-
assert.match(discoverAgents(dir, "project").agentDiagnostics?.[0]?.error ?? "", /Agent 'worker' has invalid toolTimeoutMs frontmatter; expected a positive integer no larger than 2147483647/);
|
|
810
|
-
});
|
|
811
|
-
});
|
|
812
|
-
|
|
813
|
-
describe("chain discovery", () => {
|
|
814
|
-
it("prefers same-scope .chain.json over .chain.md for the same runtime name", () => {
|
|
815
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-chain-format-precedence-"));
|
|
816
|
-
tempDirs.push(dir);
|
|
817
|
-
const chainsDir = path.join(dir, ".selesai", "chains");
|
|
818
|
-
fs.mkdirSync(chainsDir, { recursive: true });
|
|
819
|
-
fs.writeFileSync(path.join(chainsDir, "dynamic-review.chain.md"), `---
|
|
820
|
-
name: dynamic-review
|
|
821
|
-
description: Markdown fallback
|
|
822
|
-
---
|
|
823
|
-
|
|
824
|
-
## scout
|
|
825
|
-
|
|
826
|
-
Run the markdown chain
|
|
827
|
-
`, "utf-8");
|
|
828
|
-
fs.writeFileSync(path.join(chainsDir, "dynamic-review.chain.json"), JSON.stringify({
|
|
829
|
-
name: "dynamic-review",
|
|
830
|
-
description: "JSON dynamic chain",
|
|
831
|
-
chain: [
|
|
832
|
-
{
|
|
833
|
-
agent: "scout",
|
|
834
|
-
task: "Return targets",
|
|
835
|
-
as: "targets",
|
|
836
|
-
outputSchema: { type: "object" },
|
|
837
|
-
},
|
|
838
|
-
{
|
|
839
|
-
expand: { from: { output: "targets", path: "/items" }, maxItems: 4 },
|
|
840
|
-
parallel: { agent: "reviewer", task: "Review {item.path}" },
|
|
841
|
-
collect: { as: "reviews" },
|
|
842
|
-
},
|
|
843
|
-
],
|
|
844
|
-
}), "utf-8");
|
|
845
|
-
|
|
846
|
-
const result = discoverAgentsAll(dir);
|
|
847
|
-
const chain = result.chains.find((candidate) => candidate.name === "dynamic-review");
|
|
848
|
-
assert.equal(chain?.description, "JSON dynamic chain");
|
|
849
|
-
assert.equal(chain?.filePath.endsWith(".chain.json"), true);
|
|
850
|
-
assert.equal("expand" in (chain?.steps[1] ?? {}), true);
|
|
851
|
-
});
|
|
852
|
-
});
|
|
853
|
-
|
|
854
|
-
describe("package-provided agents and chains", () => {
|
|
855
|
-
it("discovers package agents and chains from installed package manifests", () => withTempHome(() => {
|
|
856
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-package-discovery-"));
|
|
857
|
-
tempDirs.push(dir);
|
|
858
|
-
const workflowRoot = path.join(dir, ".selesai", "npm", "node_modules", "my-pi-workflow");
|
|
859
|
-
const chainsRoot = path.join(dir, ".selesai", "npm", "node_modules", "@scope", "chain-workflow");
|
|
860
|
-
writeJson(path.join(workflowRoot, "package.json"), {
|
|
861
|
-
name: "my-pi-workflow",
|
|
862
|
-
version: "1.2.3",
|
|
863
|
-
"pi-subagents": {
|
|
864
|
-
agents: ["./agents"],
|
|
865
|
-
},
|
|
866
|
-
});
|
|
867
|
-
writeAgent(path.join(workflowRoot, "agents", "reviewer.md"), `---
|
|
868
|
-
name: reviewer
|
|
869
|
-
package: my-workflow
|
|
870
|
-
description: Review changes for this workflow.
|
|
871
|
-
---
|
|
872
|
-
|
|
873
|
-
Review the workflow.
|
|
874
|
-
`);
|
|
875
|
-
writeJson(path.join(chainsRoot, "package.json"), {
|
|
876
|
-
name: "@scope/chain-workflow",
|
|
877
|
-
pi: {
|
|
878
|
-
subagents: {
|
|
879
|
-
chains: ["./chains"],
|
|
880
|
-
},
|
|
881
|
-
},
|
|
882
|
-
});
|
|
883
|
-
writeAgent(path.join(chainsRoot, "chains", "review.chain.md"), `---
|
|
884
|
-
name: review
|
|
885
|
-
package: my-workflow
|
|
886
|
-
description: Run workflow review.
|
|
887
|
-
---
|
|
888
|
-
|
|
889
|
-
## my-workflow.reviewer
|
|
890
|
-
|
|
891
|
-
Review the task.
|
|
892
|
-
`);
|
|
893
|
-
|
|
894
|
-
const all = discoverAgentsAll(dir);
|
|
895
|
-
const packagedAgent = all.package.find((agent) => agent.name === "my-workflow.reviewer");
|
|
896
|
-
assert.ok(packagedAgent);
|
|
897
|
-
assert.equal(packagedAgent.source, "package");
|
|
898
|
-
assert.equal(packagedAgent.packageName, "my-workflow");
|
|
899
|
-
assert.equal(packagedAgent.packageSourceName, "my-pi-workflow");
|
|
900
|
-
assert.equal(packagedAgent.packageSourceVersion, "1.2.3");
|
|
901
|
-
assert.equal(packagedAgent.packageSourceRoot, workflowRoot);
|
|
902
|
-
assert.equal(packagedAgent.filePath, path.join(workflowRoot, "agents", "reviewer.md"));
|
|
903
|
-
assert.equal(discoverAgents(dir, "both").agents.find((agent) => agent.name === "my-workflow.reviewer")?.source, "package");
|
|
904
|
-
|
|
905
|
-
const packagedChain = all.chains.find((chain) => chain.name === "my-workflow.review");
|
|
906
|
-
assert.ok(packagedChain);
|
|
907
|
-
assert.equal(packagedChain.source, "package");
|
|
908
|
-
assert.equal(packagedChain.steps[0]?.agent, "my-workflow.reviewer");
|
|
909
|
-
}));
|
|
910
|
-
|
|
911
|
-
it("loads packages referenced from Pi settings", () => withTempHome(() => {
|
|
912
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-settings-package-"));
|
|
913
|
-
tempDirs.push(dir);
|
|
914
|
-
const packageRoot = path.join(dir, ".selesai", "vendor", "workflow");
|
|
915
|
-
writeJson(path.join(dir, ".selesai", "settings.json"), {
|
|
916
|
-
packages: [{ source: "file:./vendor/workflow" }],
|
|
917
|
-
});
|
|
918
|
-
writeJson(path.join(packageRoot, "package.json"), {
|
|
919
|
-
name: "settings-workflow",
|
|
920
|
-
pi: {
|
|
921
|
-
subagents: {
|
|
922
|
-
agents: ["./agents"],
|
|
923
|
-
},
|
|
924
|
-
},
|
|
925
|
-
});
|
|
926
|
-
writeAgent(path.join(packageRoot, "agents", "planner.md"), `---
|
|
927
|
-
name: planner
|
|
928
|
-
package: settings-workflow
|
|
929
|
-
description: Plan from a settings-installed package.
|
|
930
|
-
---
|
|
931
|
-
|
|
932
|
-
Plan the work.
|
|
933
|
-
`);
|
|
934
|
-
|
|
935
|
-
const agent = discoverAgents(dir, "both").agents.find((candidate) => candidate.name === "settings-workflow.planner");
|
|
936
|
-
assert.ok(agent);
|
|
937
|
-
assert.equal(agent.source, "package");
|
|
938
|
-
}));
|
|
939
|
-
|
|
940
|
-
it("loads bare HTTPS git packages from project Pi settings", () => withTempHome(() => {
|
|
941
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-settings-bare-git-package-"));
|
|
942
|
-
tempDirs.push(dir);
|
|
943
|
-
const packageRoot = path.join(dir, ".selesai", "git", "github.com", "user", "repo");
|
|
944
|
-
writeJson(path.join(dir, ".selesai", "settings.json"), {
|
|
945
|
-
packages: ["https://github.com/user/repo.git"],
|
|
946
|
-
});
|
|
947
|
-
writeJson(path.join(packageRoot, "package.json"), {
|
|
948
|
-
name: "bare-git-workflow",
|
|
949
|
-
"pi-subagents": { agents: ["./agents"] },
|
|
950
|
-
});
|
|
951
|
-
writeAgent(path.join(packageRoot, "agents", "planner.md"), `---
|
|
952
|
-
name: planner
|
|
953
|
-
package: bare-git-workflow
|
|
954
|
-
description: Plan from a bare HTTPS git package.
|
|
955
|
-
---
|
|
956
|
-
|
|
957
|
-
Plan the work.
|
|
958
|
-
`);
|
|
959
|
-
|
|
960
|
-
const agent = discoverAgents(dir, "both").agents.find((candidate) => candidate.name === "bare-git-workflow.planner");
|
|
961
|
-
assert.ok(agent);
|
|
962
|
-
assert.equal(agent.source, "package");
|
|
963
|
-
assert.equal(agent.packageSourceRoot, packageRoot);
|
|
964
|
-
}));
|
|
965
|
-
|
|
966
|
-
it("loads bare HTTP git packages from user Pi settings", () => withTempHome((home) => {
|
|
967
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-user-settings-bare-git-package-"));
|
|
968
|
-
tempDirs.push(dir);
|
|
969
|
-
const agentDir = path.join(home, ".selesai", "agent");
|
|
970
|
-
const packageRoot = path.join(agentDir, "git", "git.example.com", "team", "repo");
|
|
971
|
-
writeJson(path.join(agentDir, "settings.json"), {
|
|
972
|
-
packages: ["http://git.example.com/team/repo.git"],
|
|
973
|
-
});
|
|
974
|
-
writeJson(path.join(packageRoot, "package.json"), {
|
|
975
|
-
name: "user-bare-git-workflow",
|
|
976
|
-
"pi-subagents": { agents: ["./agents"] },
|
|
977
|
-
});
|
|
978
|
-
writeAgent(path.join(packageRoot, "agents", "reviewer.md"), `---
|
|
979
|
-
name: reviewer
|
|
980
|
-
package: user-bare-git-workflow
|
|
981
|
-
description: Review from a bare HTTP git package.
|
|
982
|
-
---
|
|
983
|
-
|
|
984
|
-
Review the work.
|
|
985
|
-
`);
|
|
986
|
-
|
|
987
|
-
const agent = discoverAgents(dir, "both").agents.find((candidate) => candidate.name === "user-bare-git-workflow.reviewer");
|
|
988
|
-
assert.ok(agent);
|
|
989
|
-
assert.equal(agent.source, "package");
|
|
990
|
-
assert.equal(agent.packageSourceRoot, packageRoot);
|
|
991
|
-
}));
|
|
992
|
-
|
|
993
|
-
it("discovers project package agents when cwd is nested below the project root", () => withTempHome(() => {
|
|
994
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-nested-package-discovery-"));
|
|
995
|
-
tempDirs.push(dir);
|
|
996
|
-
const nested = path.join(dir, "packages", "app", "src");
|
|
997
|
-
const packageRoot = path.join(dir, ".selesai", "npm", "node_modules", "nested-workflow");
|
|
998
|
-
fs.mkdirSync(nested, { recursive: true });
|
|
999
|
-
writeJson(path.join(packageRoot, "package.json"), {
|
|
1000
|
-
name: "nested-workflow",
|
|
1001
|
-
"pi-subagents": {
|
|
1002
|
-
agents: ["./agents"],
|
|
1003
|
-
},
|
|
1004
|
-
});
|
|
1005
|
-
writeAgent(path.join(packageRoot, "agents", "reviewer.md"), `---
|
|
1006
|
-
name: reviewer
|
|
1007
|
-
package: nested-workflow
|
|
1008
|
-
description: Review from a project package.
|
|
1009
|
-
---
|
|
1010
|
-
|
|
1011
|
-
Review nested project work.
|
|
1012
|
-
`);
|
|
1013
|
-
|
|
1014
|
-
const agent = discoverAgents(nested, "both").agents.find((candidate) => candidate.name === "nested-workflow.reviewer");
|
|
1015
|
-
assert.ok(agent);
|
|
1016
|
-
assert.equal(agent.source, "package");
|
|
1017
|
-
assert.equal(agent.filePath, path.join(packageRoot, "agents", "reviewer.md"));
|
|
1018
|
-
}));
|
|
1019
|
-
|
|
1020
|
-
it("keeps nearest project root discovery by default when a nested .selesai exists", () => withTempHome(() => {
|
|
1021
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-nearest-root-default-"));
|
|
1022
|
-
tempDirs.push(dir);
|
|
1023
|
-
const nested = path.join(dir, "packages", "app", "src");
|
|
1024
|
-
const nestedConfigDir = path.join(dir, "packages", "app", ".selesai");
|
|
1025
|
-
const packageRoot = path.join(dir, ".selesai", "npm", "node_modules", "outer-workflow");
|
|
1026
|
-
fs.mkdirSync(nested, { recursive: true });
|
|
1027
|
-
fs.mkdirSync(nestedConfigDir, { recursive: true });
|
|
1028
|
-
fs.mkdirSync(path.join(dir, ".git"), { recursive: true });
|
|
1029
|
-
writeJson(path.join(packageRoot, "package.json"), {
|
|
1030
|
-
name: "outer-workflow",
|
|
1031
|
-
"pi-subagents": { agents: ["./agents"] },
|
|
1032
|
-
});
|
|
1033
|
-
writeAgent(path.join(packageRoot, "agents", "planner.md"), `---
|
|
1034
|
-
name: planner
|
|
1035
|
-
package: outer-workflow
|
|
1036
|
-
description: Plan from the outer project package.
|
|
1037
|
-
---
|
|
1038
|
-
|
|
1039
|
-
Plan outer project work.
|
|
1040
|
-
`);
|
|
1041
|
-
|
|
1042
|
-
const agent = discoverAgents(nested, "both").agents.find((candidate) => candidate.name === "outer-workflow.planner");
|
|
1043
|
-
assert.equal(agent, undefined);
|
|
1044
|
-
}));
|
|
1045
|
-
|
|
1046
|
-
it("can resolve project packages and overrides from the git root", () => withTempHome(() => {
|
|
1047
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-git-root-resolution-"));
|
|
1048
|
-
tempDirs.push(dir);
|
|
1049
|
-
const nested = path.join(dir, "packages", "app", "src");
|
|
1050
|
-
const nestedConfigDir = path.join(dir, "packages", "app", ".selesai");
|
|
1051
|
-
const packageRoot = path.join(dir, ".selesai", "npm", "node_modules", "outer-workflow");
|
|
1052
|
-
fs.mkdirSync(nested, { recursive: true });
|
|
1053
|
-
fs.mkdirSync(nestedConfigDir, { recursive: true });
|
|
1054
|
-
fs.writeFileSync(path.join(dir, ".git"), "gitdir: ../.git/worktrees/app\n", "utf-8");
|
|
1055
|
-
writeJson(path.join(dir, ".selesai", "settings.json"), {
|
|
1056
|
-
subagents: {
|
|
1057
|
-
projectRootResolution: "git-root",
|
|
1058
|
-
agentOverrides: {
|
|
1059
|
-
reviewer: { model: "openai/gpt-5.4" },
|
|
1060
|
-
},
|
|
1061
|
-
},
|
|
1062
|
-
});
|
|
1063
|
-
writeJson(path.join(packageRoot, "package.json"), {
|
|
1064
|
-
name: "outer-workflow",
|
|
1065
|
-
"pi-subagents": { agents: ["./agents"] },
|
|
1066
|
-
});
|
|
1067
|
-
writeAgent(path.join(packageRoot, "agents", "planner.md"), `---
|
|
1068
|
-
name: planner
|
|
1069
|
-
package: outer-workflow
|
|
1070
|
-
description: Plan from the outer project package.
|
|
1071
|
-
---
|
|
1072
|
-
|
|
1073
|
-
Plan outer project work.
|
|
1074
|
-
`);
|
|
1075
|
-
|
|
1076
|
-
const agents = discoverAgents(nested, "both").agents;
|
|
1077
|
-
const packageAgent = agents.find((candidate) => candidate.name === "outer-workflow.planner");
|
|
1078
|
-
assert.ok(packageAgent);
|
|
1079
|
-
assert.equal(packageAgent.source, "package");
|
|
1080
|
-
assert.equal(packageAgent.filePath, path.join(packageRoot, "agents", "planner.md"));
|
|
1081
|
-
const reviewer = agents.find((candidate) => candidate.name === "reviewer");
|
|
1082
|
-
assert.equal(reviewer?.model, "openai/gpt-5.4");
|
|
1083
|
-
assert.equal(reviewer?.override?.path, path.join(dir, ".selesai", "settings.json"));
|
|
1084
|
-
}));
|
|
1085
|
-
|
|
1086
|
-
it("keeps git-root discovery stable when a nested linked worktree creates incidental .selesai state", () => withTempHome(() => {
|
|
1087
|
-
const { repo, worktree } = createNestedLinkedWorktree();
|
|
1088
|
-
const { packageAgentName, packageAgentPath, settingsPath } = writeLinkedWorktreePackage(repo);
|
|
1089
|
-
|
|
1090
|
-
const before = discoverAgents(worktree, "both").agents;
|
|
1091
|
-
const beforePackageAgent = before.find((candidate) => candidate.name === packageAgentName);
|
|
1092
|
-
assert.ok(beforePackageAgent);
|
|
1093
|
-
assert.equal(beforePackageAgent.source, "package");
|
|
1094
|
-
assert.equal(beforePackageAgent.filePath, packageAgentPath);
|
|
1095
|
-
assert.equal(before.find((candidate) => candidate.name === "reviewer")?.override?.path, settingsPath);
|
|
1096
|
-
|
|
1097
|
-
fs.mkdirSync(path.join(worktree, ".selesai", "todos"), { recursive: true });
|
|
1098
|
-
|
|
1099
|
-
const after = discoverAgents(worktree, "both").agents;
|
|
1100
|
-
const all = discoverAgentsAll(worktree);
|
|
1101
|
-
const afterPackageAgent = after.find((candidate) => candidate.name === packageAgentName);
|
|
1102
|
-
const allPackageAgent = all.package.find((candidate) => candidate.name === packageAgentName);
|
|
1103
|
-
assert.equal(afterPackageAgent?.source, beforePackageAgent.source);
|
|
1104
|
-
assert.equal(afterPackageAgent?.filePath, beforePackageAgent.filePath);
|
|
1105
|
-
assert.equal(allPackageAgent?.filePath, afterPackageAgent.filePath);
|
|
1106
|
-
assert.equal(all.projectSettingsPath, settingsPath);
|
|
1107
|
-
assert.equal(after.find((candidate) => candidate.name === "reviewer")?.override?.path, all.projectSettingsPath);
|
|
1108
|
-
}));
|
|
1109
|
-
|
|
1110
|
-
it("lets a linked worktree opt back into nearest-root discovery", () => withTempHome(() => {
|
|
1111
|
-
const { repo, worktree } = createNestedLinkedWorktree();
|
|
1112
|
-
const { packageAgentName } = writeLinkedWorktreePackage(repo);
|
|
1113
|
-
const worktreeSettingsPath = path.join(worktree, ".selesai", "settings.json");
|
|
1114
|
-
writeJson(worktreeSettingsPath, {
|
|
1115
|
-
subagents: {
|
|
1116
|
-
projectRootResolution: "nearest",
|
|
1117
|
-
agentOverrides: {
|
|
1118
|
-
reviewer: { model: "issue950/worktree-model" },
|
|
1119
|
-
},
|
|
1120
|
-
},
|
|
1121
|
-
});
|
|
1122
|
-
|
|
1123
|
-
const discovered = discoverAgents(worktree, "both").agents;
|
|
1124
|
-
const all = discoverAgentsAll(worktree);
|
|
1125
|
-
assert.equal(discovered.find((candidate) => candidate.name === packageAgentName), undefined);
|
|
1126
|
-
assert.equal(all.package.find((candidate) => candidate.name === packageAgentName), undefined);
|
|
1127
|
-
assert.equal(discovered.find((candidate) => candidate.name === "reviewer")?.model, "issue950/worktree-model");
|
|
1128
|
-
assert.equal(all.projectSettingsPath, worktreeSettingsPath);
|
|
1129
|
-
}));
|
|
1130
|
-
|
|
1131
|
-
it("does not register legacy skill files from broad package agent roots", () => withTempHome(() => {
|
|
1132
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-broad-package-skills-"));
|
|
1133
|
-
tempDirs.push(dir);
|
|
1134
|
-
const packageRoot = path.join(dir, ".selesai", "npm", "node_modules", "broad-workflow");
|
|
1135
|
-
writeJson(path.join(packageRoot, "package.json"), {
|
|
1136
|
-
name: "broad-workflow",
|
|
1137
|
-
"pi-subagents": {
|
|
1138
|
-
agents: ["."],
|
|
1139
|
-
},
|
|
1140
|
-
});
|
|
1141
|
-
writeAgent(path.join(packageRoot, "agent.md"), `---
|
|
1142
|
-
name: package-agent
|
|
1143
|
-
description: Package agent
|
|
1144
|
-
---
|
|
1145
|
-
|
|
1146
|
-
Package prompt
|
|
1147
|
-
`);
|
|
1148
|
-
writeAgent(path.join(packageRoot, ".agents", "skills", "package-skill", "SKILL.md"), `---
|
|
1149
|
-
name: package-skill
|
|
1150
|
-
description: Package skill
|
|
1151
|
-
---
|
|
1152
|
-
|
|
1153
|
-
Skill prompt
|
|
1154
|
-
`);
|
|
1155
|
-
writeAgent(path.join(packageRoot, "agents", "SKILL.md"), `---
|
|
1156
|
-
name: skill-named-package-agent
|
|
1157
|
-
description: Skill-named package agent
|
|
1158
|
-
---
|
|
1159
|
-
|
|
1160
|
-
Agent prompt
|
|
1161
|
-
`);
|
|
1162
|
-
|
|
1163
|
-
const packageAgents = discoverAgentsAll(dir).package;
|
|
1164
|
-
assert.ok(packageAgents.find((agent) => agent.name === "package-agent" && agent.filePath === path.join(packageRoot, "agent.md")));
|
|
1165
|
-
assert.ok(packageAgents.find((agent) => agent.name === "skill-named-package-agent" && agent.filePath === path.join(packageRoot, "agents", "SKILL.md")));
|
|
1166
|
-
assert.equal(packageAgents.some((agent) => agent.filePath.includes(`${path.sep}.agents${path.sep}skills${path.sep}`)), false);
|
|
1167
|
-
assert.equal(packageAgents.some((agent) => agent.name === "package-skill"), false);
|
|
1168
|
-
}));
|
|
1169
|
-
|
|
1170
|
-
it("prunes repo internals and nested project roots from broad package discovery", () => withTempHome(() => {
|
|
1171
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-broad-package-prune-"));
|
|
1172
|
-
tempDirs.push(dir);
|
|
1173
|
-
writeJson(path.join(dir, "package.json"), {
|
|
1174
|
-
name: "repo-root-workflow",
|
|
1175
|
-
pi: {
|
|
1176
|
-
subagents: {
|
|
1177
|
-
agents: ["."],
|
|
1178
|
-
chains: ["."],
|
|
1179
|
-
},
|
|
1180
|
-
},
|
|
1181
|
-
});
|
|
1182
|
-
writeAgent(path.join(dir, "root-agent.md"), `---
|
|
1183
|
-
name: root-agent
|
|
1184
|
-
description: Root package agent
|
|
1185
|
-
---
|
|
1186
|
-
|
|
1187
|
-
Root prompt
|
|
1188
|
-
`);
|
|
1189
|
-
writeAgent(path.join(dir, "root.chain.md"), `---
|
|
1190
|
-
name: root-chain
|
|
1191
|
-
description: Root package chain
|
|
1192
|
-
---
|
|
1193
|
-
|
|
1194
|
-
## root-agent
|
|
1195
|
-
|
|
1196
|
-
Run root agent
|
|
1197
|
-
`);
|
|
1198
|
-
writeAgent(path.join(dir, "node_modules", "bad-agent.md"), `---
|
|
1199
|
-
name: node-modules-agent
|
|
1200
|
-
description: Should not be discovered
|
|
1201
|
-
---
|
|
1202
|
-
|
|
1203
|
-
Ignored
|
|
1204
|
-
`);
|
|
1205
|
-
writeAgent(path.join(dir, ".git", "hooks", "bad-agent.md"), `---
|
|
1206
|
-
name: git-agent
|
|
1207
|
-
description: Should not be discovered
|
|
1208
|
-
---
|
|
1209
|
-
|
|
1210
|
-
Ignored
|
|
1211
|
-
`);
|
|
1212
|
-
writeAgent(path.join(dir, "vendor", "submodule", "submodule-agent.md"), `---
|
|
1213
|
-
name: submodule-agent
|
|
1214
|
-
description: Should not be discovered
|
|
1215
|
-
---
|
|
1216
|
-
|
|
1217
|
-
Ignored
|
|
1218
|
-
`);
|
|
1219
|
-
fs.writeFileSync(path.join(dir, "vendor", "submodule", ".git"), "gitdir: ../.git/modules/submodule\n", "utf-8");
|
|
1220
|
-
writeAgent(path.join(dir, "packages", "app", "local-agent.md"), `---
|
|
1221
|
-
name: nested-project-agent
|
|
1222
|
-
description: Should not be discovered
|
|
1223
|
-
---
|
|
1224
|
-
|
|
1225
|
-
Ignored
|
|
1226
|
-
`);
|
|
1227
|
-
fs.mkdirSync(path.join(dir, "packages", "app", ".selesai"), { recursive: true });
|
|
1228
|
-
writeAgent(path.join(dir, "node_modules", "bad.chain.md"), `---
|
|
1229
|
-
name: node-modules-chain
|
|
1230
|
-
description: Should not be discovered
|
|
1231
|
-
---
|
|
1232
|
-
|
|
1233
|
-
## root-agent
|
|
1234
|
-
|
|
1235
|
-
Ignored
|
|
1236
|
-
`);
|
|
1237
|
-
|
|
1238
|
-
const all = discoverAgentsAll(dir);
|
|
1239
|
-
assert.ok(all.package.find((agent) => agent.name === "root-agent" && agent.filePath === path.join(dir, "root-agent.md")));
|
|
1240
|
-
for (const name of ["node-modules-agent", "git-agent", "submodule-agent", "nested-project-agent"]) {
|
|
1241
|
-
assert.equal(all.package.some((agent) => agent.name === name), false, `${name} should be pruned`);
|
|
1242
|
-
}
|
|
1243
|
-
assert.ok(all.chains.find((chain) => chain.name === "root-chain" && chain.filePath === path.join(dir, "root.chain.md")));
|
|
1244
|
-
assert.equal(all.chains.some((chain) => chain.name === "node-modules-chain"), false);
|
|
1245
|
-
}));
|
|
1246
|
-
|
|
1247
|
-
it("keeps package definitions below user and project overrides", () => withTempHome((home) => {
|
|
1248
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-package-precedence-"));
|
|
1249
|
-
tempDirs.push(dir);
|
|
1250
|
-
const packageRoot = path.join(dir, ".selesai", "npm", "node_modules", "override-workflow");
|
|
1251
|
-
writeJson(path.join(packageRoot, "package.json"), {
|
|
1252
|
-
name: "override-workflow",
|
|
1253
|
-
"pi-subagents": {
|
|
1254
|
-
agents: ["./agents"],
|
|
1255
|
-
chains: ["./chains"],
|
|
1256
|
-
},
|
|
1257
|
-
});
|
|
1258
|
-
writeAgent(path.join(packageRoot, "agents", "scout.md"), `---
|
|
1259
|
-
name: scout
|
|
1260
|
-
description: Package scout
|
|
1261
|
-
---
|
|
1262
|
-
|
|
1263
|
-
Package scout.
|
|
1264
|
-
`);
|
|
1265
|
-
writeAgent(path.join(packageRoot, "chains", "shared.chain.md"), `---
|
|
1266
|
-
name: shared
|
|
1267
|
-
description: Package chain
|
|
1268
|
-
---
|
|
1269
|
-
|
|
1270
|
-
## scout
|
|
1271
|
-
|
|
1272
|
-
Package chain.
|
|
1273
|
-
`);
|
|
1274
|
-
writeAgent(path.join(home, ".selesai", "agent", "agents", "scout.md"), `---
|
|
1275
|
-
name: scout
|
|
1276
|
-
description: User scout
|
|
1277
|
-
---
|
|
1278
|
-
|
|
1279
|
-
User scout.
|
|
1280
|
-
`);
|
|
1281
|
-
writeAgent(path.join(dir, ".selesai", "agents", "scout.md"), `---
|
|
1282
|
-
name: scout
|
|
1283
|
-
description: Project scout
|
|
1284
|
-
---
|
|
1285
|
-
|
|
1286
|
-
Project scout.
|
|
1287
|
-
`);
|
|
1288
|
-
writeAgent(path.join(home, ".selesai", "agent", "chains", "shared.chain.md"), `---
|
|
1289
|
-
name: shared
|
|
1290
|
-
description: User chain
|
|
1291
|
-
---
|
|
1292
|
-
|
|
1293
|
-
## scout
|
|
1294
|
-
|
|
1295
|
-
User chain.
|
|
1296
|
-
`);
|
|
1297
|
-
writeAgent(path.join(dir, ".selesai", "chains", "shared.chain.md"), `---
|
|
1298
|
-
name: shared
|
|
1299
|
-
description: Project chain
|
|
1300
|
-
---
|
|
1301
|
-
|
|
1302
|
-
## scout
|
|
1303
|
-
|
|
1304
|
-
Project chain.
|
|
1305
|
-
`);
|
|
1306
|
-
|
|
1307
|
-
assert.equal(discoverAgents(dir, "user").agents.find((agent) => agent.name === "scout")?.source, "user");
|
|
1308
|
-
assert.equal(discoverAgents(dir, "project").agents.find((agent) => agent.name === "scout")?.source, "project");
|
|
1309
|
-
const chainByName = new Map(discoverAgentsAll(dir).chains.map((chain) => [chain.name, chain]));
|
|
1310
|
-
assert.equal(chainByName.get("shared")?.source, "project");
|
|
1311
|
-
}));
|
|
1312
|
-
|
|
1313
|
-
it("does not allow management updates to package agents", () => withTempHome(() => {
|
|
1314
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-package-readonly-"));
|
|
1315
|
-
tempDirs.push(dir);
|
|
1316
|
-
const packageRoot = path.join(dir, ".selesai", "npm", "node_modules", "readonly-workflow");
|
|
1317
|
-
writeJson(path.join(packageRoot, "package.json"), {
|
|
1318
|
-
name: "readonly-workflow",
|
|
1319
|
-
"pi-subagents": {
|
|
1320
|
-
agents: ["./agents"],
|
|
1321
|
-
},
|
|
1322
|
-
});
|
|
1323
|
-
writeAgent(path.join(packageRoot, "agents", "reviewer.md"), `---
|
|
1324
|
-
name: reviewer
|
|
1325
|
-
package: readonly-workflow
|
|
1326
|
-
description: Read-only package reviewer.
|
|
1327
|
-
---
|
|
1328
|
-
|
|
1329
|
-
Review only.
|
|
1330
|
-
`);
|
|
1331
|
-
|
|
1332
|
-
const result = handleManagementAction("update", {
|
|
1333
|
-
agent: "readonly-workflow.reviewer",
|
|
1334
|
-
config: { description: "Changed" },
|
|
1335
|
-
}, {
|
|
1336
|
-
cwd: dir,
|
|
1337
|
-
modelRegistry: { getAvailable: () => [] },
|
|
1338
|
-
});
|
|
1339
|
-
|
|
1340
|
-
assert.equal(result.isError, true);
|
|
1341
|
-
assert.match(result.content[0]?.text ?? "", /read-only/);
|
|
1342
|
-
}));
|
|
1343
|
-
});
|
|
1344
|
-
|
|
1345
|
-
describe("agent frontmatter completionGuard", () => {
|
|
1346
|
-
it("serializes disabled completion guard into agent frontmatter", () => {
|
|
1347
|
-
const agent: AgentConfig = {
|
|
1348
|
-
name: "test-runner",
|
|
1349
|
-
description: "Test runner",
|
|
1350
|
-
systemPrompt: "Validate changes",
|
|
1351
|
-
systemPromptMode: "replace",
|
|
1352
|
-
inheritProjectContext: false,
|
|
1353
|
-
inheritSkills: false,
|
|
1354
|
-
source: "project",
|
|
1355
|
-
filePath: "/tmp/test-runner.md",
|
|
1356
|
-
completionGuard: false,
|
|
1357
|
-
};
|
|
1358
|
-
|
|
1359
|
-
const serialized = serializeAgent(agent);
|
|
1360
|
-
assert.match(serialized, /completionGuard: false/);
|
|
1361
|
-
});
|
|
1362
|
-
|
|
1363
|
-
it("omits enabled completion guard from serialized frontmatter", () => {
|
|
1364
|
-
const agent: AgentConfig = {
|
|
1365
|
-
name: "test-runner",
|
|
1366
|
-
description: "Test runner",
|
|
1367
|
-
systemPrompt: "Validate changes",
|
|
1368
|
-
systemPromptMode: "replace",
|
|
1369
|
-
inheritProjectContext: false,
|
|
1370
|
-
inheritSkills: false,
|
|
1371
|
-
source: "project",
|
|
1372
|
-
filePath: "/tmp/test-runner.md",
|
|
1373
|
-
completionGuard: true,
|
|
1374
|
-
};
|
|
1375
|
-
|
|
1376
|
-
const serialized = serializeAgent(agent);
|
|
1377
|
-
assert.doesNotMatch(serialized, /completionGuard:/);
|
|
1378
|
-
});
|
|
1379
|
-
|
|
1380
|
-
it("parses completionGuard from discovered agent frontmatter", () => {
|
|
1381
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-completion-guard-"));
|
|
1382
|
-
tempDirs.push(dir);
|
|
1383
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1384
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1385
|
-
fs.writeFileSync(path.join(agentsDir, "test-runner.md"), `---
|
|
1386
|
-
name: test-runner
|
|
1387
|
-
description: Test runner
|
|
1388
|
-
completionGuard: false
|
|
1389
|
-
---
|
|
1390
|
-
|
|
1391
|
-
Validate changes
|
|
1392
|
-
`, "utf-8");
|
|
1393
|
-
|
|
1394
|
-
const result = discoverAgents(dir, "project");
|
|
1395
|
-
const runner = result.agents.find((agent) => agent.name === "test-runner");
|
|
1396
|
-
assert.equal(runner?.completionGuard, false);
|
|
1397
|
-
assert.equal(runner?.extraFields?.completionGuard, undefined);
|
|
1398
|
-
});
|
|
1399
|
-
});
|
|
1400
|
-
|
|
1401
|
-
describe("agent frontmatter maxSubagentDepth", () => {
|
|
1402
|
-
it("serializes maxSubagentDepth into agent frontmatter", () => {
|
|
1403
|
-
const agent: AgentConfig = {
|
|
1404
|
-
name: "scout",
|
|
1405
|
-
description: "Scout",
|
|
1406
|
-
systemPrompt: "Inspect code",
|
|
1407
|
-
systemPromptMode: "replace",
|
|
1408
|
-
inheritProjectContext: false,
|
|
1409
|
-
inheritSkills: false,
|
|
1410
|
-
source: "project",
|
|
1411
|
-
filePath: "/tmp/scout.md",
|
|
1412
|
-
maxSubagentDepth: 1,
|
|
1413
|
-
};
|
|
1414
|
-
|
|
1415
|
-
const serialized = serializeAgent(agent);
|
|
1416
|
-
assert.match(serialized, /maxSubagentDepth: 1/);
|
|
1417
|
-
});
|
|
1418
|
-
|
|
1419
|
-
it("parses maxSubagentDepth from discovered agent frontmatter", () => {
|
|
1420
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-frontmatter-"));
|
|
1421
|
-
tempDirs.push(dir);
|
|
1422
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1423
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1424
|
-
fs.writeFileSync(path.join(agentsDir, "scout.md"), `---
|
|
1425
|
-
name: scout
|
|
1426
|
-
description: Scout
|
|
1427
|
-
maxSubagentDepth: 1
|
|
1428
|
-
---
|
|
1429
|
-
|
|
1430
|
-
Inspect code
|
|
1431
|
-
`, "utf-8");
|
|
1432
|
-
|
|
1433
|
-
const result = discoverAgents(dir, "project");
|
|
1434
|
-
const scout = result.agents.find((agent) => agent.name === "scout");
|
|
1435
|
-
assert.equal(scout?.maxSubagentDepth, 1);
|
|
1436
|
-
});
|
|
1437
|
-
});
|
|
1438
|
-
|
|
1439
|
-
describe("agent frontmatter allowNestedSubagents", () => {
|
|
1440
|
-
it("serializes and parses explicit nested fanout authorization", () => {
|
|
1441
|
-
const agent: AgentConfig = {
|
|
1442
|
-
name: "delegator",
|
|
1443
|
-
description: "Delegator",
|
|
1444
|
-
systemPrompt: "Delegate focused work",
|
|
1445
|
-
systemPromptMode: "replace",
|
|
1446
|
-
inheritProjectContext: false,
|
|
1447
|
-
inheritSkills: false,
|
|
1448
|
-
source: "project",
|
|
1449
|
-
filePath: "/tmp/delegator.md",
|
|
1450
|
-
allowNestedSubagents: true,
|
|
1451
|
-
};
|
|
1452
|
-
assert.match(serializeAgent(agent), /allowNestedSubagents: true/);
|
|
1453
|
-
|
|
1454
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-nested-fanout-"));
|
|
1455
|
-
tempDirs.push(dir);
|
|
1456
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1457
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1458
|
-
fs.writeFileSync(path.join(agentsDir, "delegator.md"), `---
|
|
1459
|
-
name: delegator
|
|
1460
|
-
description: Delegator
|
|
1461
|
-
allowNestedSubagents: true
|
|
1462
|
-
---
|
|
1463
|
-
|
|
1464
|
-
Delegate focused work
|
|
1465
|
-
`, "utf-8");
|
|
1466
|
-
const discovered = discoverAgents(dir, "project").agents.find((candidate) => candidate.name === "delegator");
|
|
1467
|
-
assert.equal(discovered?.allowNestedSubagents, true);
|
|
1468
|
-
assert.equal(discovered?.extraFields?.allowNestedSubagents, undefined);
|
|
1469
|
-
});
|
|
1470
|
-
});
|
|
1471
|
-
|
|
1472
|
-
describe("agent frontmatter thinking", () => {
|
|
1473
|
-
it("coerces frontmatter false strings to disabled thinking", () => {
|
|
1474
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-thinking-false-"));
|
|
1475
|
-
tempDirs.push(dir);
|
|
1476
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1477
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1478
|
-
|
|
1479
|
-
for (const [name, value] of [["unquoted", "false"], ["quoted", "\"false\""]] as const) {
|
|
1480
|
-
fs.writeFileSync(path.join(agentsDir, `${name}.md`), `---
|
|
1481
|
-
name: ${name}
|
|
1482
|
-
description: ${name}
|
|
1483
|
-
model: glm-5.2-short-fast
|
|
1484
|
-
thinking: ${value}
|
|
1485
|
-
---
|
|
1486
|
-
|
|
1487
|
-
Do work
|
|
1488
|
-
`, "utf-8");
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1491
|
-
const agents = discoverAgents(dir, "project").agents;
|
|
1492
|
-
for (const name of ["unquoted", "quoted"]) {
|
|
1493
|
-
const agent = agents.find((candidate) => candidate.name === name);
|
|
1494
|
-
assert.ok(agent);
|
|
1495
|
-
assert.equal(agent.thinking, false);
|
|
1496
|
-
|
|
1497
|
-
const { args } = buildPiArgs({
|
|
1498
|
-
baseArgs: ["-p"],
|
|
1499
|
-
task: "hello",
|
|
1500
|
-
sessionEnabled: false,
|
|
1501
|
-
model: agent.model,
|
|
1502
|
-
thinking: agent.thinking,
|
|
1503
|
-
inheritProjectContext: agent.inheritProjectContext,
|
|
1504
|
-
inheritSkills: agent.inheritSkills,
|
|
1505
|
-
});
|
|
1506
|
-
|
|
1507
|
-
assert.ok(args.includes("--model"));
|
|
1508
|
-
assert.ok(args.includes("glm-5.2-short-fast"));
|
|
1509
|
-
assert.ok(!args.some((arg) => arg.includes(":false")));
|
|
1510
|
-
}
|
|
1511
|
-
});
|
|
1512
|
-
|
|
1513
|
-
it("preserves supported frontmatter thinking strings", () => {
|
|
1514
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-thinking-levels-"));
|
|
1515
|
-
tempDirs.push(dir);
|
|
1516
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1517
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1518
|
-
|
|
1519
|
-
for (const level of THINKING_LEVELS) {
|
|
1520
|
-
fs.writeFileSync(path.join(agentsDir, `${level}.md`), `---
|
|
1521
|
-
name: thinker-${level}
|
|
1522
|
-
description: Thinking ${level}
|
|
1523
|
-
thinking: ${level}
|
|
1524
|
-
---
|
|
1525
|
-
|
|
1526
|
-
Do work
|
|
1527
|
-
`, "utf-8");
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
const agents = discoverAgents(dir, "project").agents;
|
|
1531
|
-
for (const level of THINKING_LEVELS) {
|
|
1532
|
-
const agent = agents.find((candidate) => candidate.name === `thinker-${level}`);
|
|
1533
|
-
assert.ok(agent);
|
|
1534
|
-
assert.equal(agent.thinking, level);
|
|
1535
|
-
}
|
|
1536
|
-
});
|
|
1537
|
-
});
|
|
1538
|
-
|
|
1539
|
-
describe("agent frontmatter fallbackModels", () => {
|
|
1540
|
-
it("serializes fallbackModels into agent frontmatter", () => {
|
|
1541
|
-
const agent: AgentConfig = {
|
|
1542
|
-
name: "worker",
|
|
1543
|
-
description: "Worker",
|
|
1544
|
-
systemPrompt: "Do work",
|
|
1545
|
-
systemPromptMode: "replace",
|
|
1546
|
-
inheritProjectContext: false,
|
|
1547
|
-
inheritSkills: false,
|
|
1548
|
-
source: "project",
|
|
1549
|
-
filePath: "/tmp/worker.md",
|
|
1550
|
-
fallbackModels: ["openai/gpt-5-mini", "anthropic/claude-sonnet-4"],
|
|
1551
|
-
};
|
|
1552
|
-
|
|
1553
|
-
const serialized = serializeAgent(agent);
|
|
1554
|
-
assert.match(serialized, /fallbackModels: openai\/gpt-5-mini, anthropic\/claude-sonnet-4/);
|
|
1555
|
-
});
|
|
1556
|
-
|
|
1557
|
-
it("parses fallbackModels from discovered agent frontmatter", () => {
|
|
1558
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-fallback-frontmatter-"));
|
|
1559
|
-
tempDirs.push(dir);
|
|
1560
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1561
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1562
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---
|
|
1563
|
-
name: worker
|
|
1564
|
-
description: Worker
|
|
1565
|
-
fallbackModels: openai/gpt-5-mini, anthropic/claude-sonnet-4
|
|
1566
|
-
---
|
|
1567
|
-
|
|
1568
|
-
Do work
|
|
1569
|
-
`, "utf-8");
|
|
1570
|
-
|
|
1571
|
-
const result = discoverAgents(dir, "project");
|
|
1572
|
-
const worker = result.agents.find((agent) => agent.name === "worker");
|
|
1573
|
-
assert.deepEqual(worker?.fallbackModels, ["openai/gpt-5-mini", "anthropic/claude-sonnet-4"]);
|
|
1574
|
-
});
|
|
1575
|
-
});
|
|
1576
|
-
|
|
1577
|
-
describe("agent frontmatter systemPromptMode", () => {
|
|
1578
|
-
it("serializes systemPromptMode into agent frontmatter", () => {
|
|
1579
|
-
const agent: AgentConfig = {
|
|
1580
|
-
name: "worker",
|
|
1581
|
-
description: "Worker",
|
|
1582
|
-
systemPrompt: "Do work",
|
|
1583
|
-
systemPromptMode: "replace",
|
|
1584
|
-
inheritProjectContext: false,
|
|
1585
|
-
inheritSkills: false,
|
|
1586
|
-
source: "project",
|
|
1587
|
-
filePath: "/tmp/worker.md",
|
|
1588
|
-
};
|
|
1589
|
-
|
|
1590
|
-
const serialized = serializeAgent(agent);
|
|
1591
|
-
assert.match(serialized, /systemPromptMode: replace/);
|
|
1592
|
-
});
|
|
1593
|
-
|
|
1594
|
-
it("parses systemPromptMode from discovered agent frontmatter", () => {
|
|
1595
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-prompt-mode-frontmatter-"));
|
|
1596
|
-
tempDirs.push(dir);
|
|
1597
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1598
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1599
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---
|
|
1600
|
-
name: worker
|
|
1601
|
-
description: Worker
|
|
1602
|
-
systemPromptMode: replace
|
|
1603
|
-
---
|
|
1604
|
-
|
|
1605
|
-
Do work
|
|
1606
|
-
`, "utf-8");
|
|
1607
|
-
|
|
1608
|
-
const result = discoverAgents(dir, "project");
|
|
1609
|
-
const worker = result.agents.find((agent) => agent.name === "worker");
|
|
1610
|
-
assert.equal(worker?.systemPromptMode, "replace");
|
|
1611
|
-
});
|
|
1612
|
-
});
|
|
1613
|
-
|
|
1614
|
-
describe("agent frontmatter prompt inheritance flags", () => {
|
|
1615
|
-
it("serializes inheritProjectContext and inheritSkills into agent frontmatter", () => {
|
|
1616
|
-
const agent: AgentConfig = {
|
|
1617
|
-
name: "worker",
|
|
1618
|
-
description: "Worker",
|
|
1619
|
-
systemPrompt: "Do work",
|
|
1620
|
-
systemPromptMode: "replace",
|
|
1621
|
-
inheritProjectContext: true,
|
|
1622
|
-
inheritGlobalContext: true,
|
|
1623
|
-
inheritSkills: true,
|
|
1624
|
-
source: "project",
|
|
1625
|
-
filePath: "/tmp/worker.md",
|
|
1626
|
-
};
|
|
1627
|
-
|
|
1628
|
-
const serialized = serializeAgent(agent);
|
|
1629
|
-
assert.match(serialized, /inheritProjectContext: true/);
|
|
1630
|
-
assert.match(serialized, /inheritGlobalContext: true/);
|
|
1631
|
-
assert.match(serialized, /inheritSkills: true/);
|
|
1632
|
-
});
|
|
1633
|
-
|
|
1634
|
-
it("parses inheritProjectContext and inheritSkills from discovered agent frontmatter", () => {
|
|
1635
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-prompt-inheritance-frontmatter-"));
|
|
1636
|
-
tempDirs.push(dir);
|
|
1637
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1638
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1639
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---
|
|
1640
|
-
name: worker
|
|
1641
|
-
description: Worker
|
|
1642
|
-
inheritProjectContext: true
|
|
1643
|
-
inheritGlobalContext: true
|
|
1644
|
-
inheritSkills: true
|
|
1645
|
-
---
|
|
1646
|
-
|
|
1647
|
-
Do work
|
|
1648
|
-
`, "utf-8");
|
|
1649
|
-
|
|
1650
|
-
const result = discoverAgents(dir, "project");
|
|
1651
|
-
const worker = result.agents.find((agent) => agent.name === "worker");
|
|
1652
|
-
assert.equal(worker?.inheritProjectContext, true);
|
|
1653
|
-
assert.equal(worker?.inheritGlobalContext, true);
|
|
1654
|
-
assert.equal(worker?.inheritSkills, true);
|
|
1655
|
-
});
|
|
1656
|
-
|
|
1657
|
-
it("defaults inheritGlobalContext to false when frontmatter omits it", () => {
|
|
1658
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-prompt-inheritance-frontmatter-"));
|
|
1659
|
-
tempDirs.push(dir);
|
|
1660
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1661
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1662
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---
|
|
1663
|
-
name: worker
|
|
1664
|
-
description: Worker
|
|
1665
|
-
---
|
|
1666
|
-
|
|
1667
|
-
Do work
|
|
1668
|
-
`, "utf-8");
|
|
1669
|
-
|
|
1670
|
-
const result = discoverAgents(dir, "project");
|
|
1671
|
-
const worker = result.agents.find((agent) => agent.name === "worker");
|
|
1672
|
-
assert.equal(worker?.inheritGlobalContext, false);
|
|
1673
|
-
});
|
|
1674
|
-
});
|
|
1675
|
-
|
|
1676
|
-
describe("agent frontmatter subagentOnlyExtensions", () => {
|
|
1677
|
-
it("serializes subagentOnlyExtensions into agent frontmatter", () => {
|
|
1678
|
-
const agent: AgentConfig = {
|
|
1679
|
-
name: "worker",
|
|
1680
|
-
description: "Worker",
|
|
1681
|
-
systemPrompt: "Do work",
|
|
1682
|
-
systemPromptMode: "replace",
|
|
1683
|
-
inheritProjectContext: false,
|
|
1684
|
-
inheritSkills: false,
|
|
1685
|
-
source: "project",
|
|
1686
|
-
filePath: "/tmp/worker.md",
|
|
1687
|
-
subagentOnlyExtensions: ["./tools/child-search.ts", "/opt/pi/child-only.ts"],
|
|
1688
|
-
};
|
|
1689
|
-
|
|
1690
|
-
const serialized = serializeAgent(agent);
|
|
1691
|
-
assert.match(serialized, /subagentOnlyExtensions: \.\/tools\/child-search\.ts, \/opt\/pi\/child-only\.ts/);
|
|
1692
|
-
});
|
|
1693
|
-
|
|
1694
|
-
it("parses subagentOnlyExtensions from discovered agent frontmatter", () => {
|
|
1695
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-child-ext-"));
|
|
1696
|
-
tempDirs.push(dir);
|
|
1697
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1698
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1699
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---
|
|
1700
|
-
name: worker
|
|
1701
|
-
description: Worker
|
|
1702
|
-
subagentOnlyExtensions: ./tools/child-search.ts, /opt/pi/child-only.ts
|
|
1703
|
-
---
|
|
1704
|
-
|
|
1705
|
-
Do work
|
|
1706
|
-
`, "utf-8");
|
|
1707
|
-
|
|
1708
|
-
const result = discoverAgents(dir, "project");
|
|
1709
|
-
const worker = result.agents.find((agent) => agent.name === "worker");
|
|
1710
|
-
assert.deepEqual(worker?.subagentOnlyExtensions, [path.join(agentsDir, "tools", "child-search.ts"), "/opt/pi/child-only.ts"]);
|
|
1711
|
-
});
|
|
1712
|
-
});
|
|
1713
|
-
|
|
1714
|
-
describe("agent frontmatter fast mode", () => {
|
|
1715
|
-
it("parses and serializes fast mode", () => {
|
|
1716
|
-
const agent: AgentConfig = {
|
|
1717
|
-
name: "worker",
|
|
1718
|
-
description: "Worker",
|
|
1719
|
-
systemPrompt: "Do work",
|
|
1720
|
-
systemPromptMode: "replace",
|
|
1721
|
-
inheritProjectContext: false,
|
|
1722
|
-
inheritSkills: false,
|
|
1723
|
-
source: "project",
|
|
1724
|
-
filePath: "/tmp/worker.md",
|
|
1725
|
-
fast: true,
|
|
1726
|
-
};
|
|
1727
|
-
|
|
1728
|
-
const serialized = serializeAgent(agent);
|
|
1729
|
-
assert.match(serialized, /fast: true/);
|
|
1730
|
-
|
|
1731
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-fast-mode-"));
|
|
1732
|
-
tempDirs.push(dir);
|
|
1733
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1734
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1735
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---
|
|
1736
|
-
name: worker
|
|
1737
|
-
description: Worker
|
|
1738
|
-
model: openai-codex/gpt-5.6-luna
|
|
1739
|
-
fast: true
|
|
1740
|
-
---
|
|
1741
|
-
|
|
1742
|
-
Do work
|
|
1743
|
-
`, "utf-8");
|
|
1744
|
-
|
|
1745
|
-
const result = discoverAgents(dir, "project");
|
|
1746
|
-
const worker = result.agents.find((candidate) => candidate.name === "worker");
|
|
1747
|
-
assert.equal(worker?.fast, true);
|
|
1748
|
-
assert.equal(worker?.extraFields?.fast, undefined);
|
|
1749
|
-
});
|
|
1750
|
-
|
|
1751
|
-
it("adds the fast extension only for allowlisted native models", () => {
|
|
1752
|
-
const allowed = buildPiArgs({
|
|
1753
|
-
baseArgs: ["-p"],
|
|
1754
|
-
task: "hello",
|
|
1755
|
-
sessionEnabled: false,
|
|
1756
|
-
model: "openai-codex/gpt-5.6-luna:low",
|
|
1757
|
-
fast: true,
|
|
1758
|
-
inheritProjectContext: false,
|
|
1759
|
-
inheritSkills: false,
|
|
1760
|
-
});
|
|
1761
|
-
|
|
1762
|
-
assert.ok(allowed.args.some((arg) => arg.endsWith("fast-mode-extension.ts")));
|
|
1763
|
-
assert.throws(() => buildPiArgs({
|
|
1764
|
-
baseArgs: ["-p"],
|
|
1765
|
-
task: "hello",
|
|
1766
|
-
sessionEnabled: false,
|
|
1767
|
-
model: "anthropic/claude-sonnet-4",
|
|
1768
|
-
fast: true,
|
|
1769
|
-
inheritProjectContext: false,
|
|
1770
|
-
inheritSkills: false,
|
|
1771
|
-
}), /fast mode supports only/);
|
|
1772
|
-
});
|
|
1773
|
-
});
|
|
1774
|
-
|
|
1775
|
-
describe("agent frontmatter prompt assembly defaults", () => {
|
|
1776
|
-
it("defaults ordinary agents to replace mode with no inherited context or skills", () => {
|
|
1777
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-default-prompt-settings-"));
|
|
1778
|
-
tempDirs.push(dir);
|
|
1779
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1780
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1781
|
-
fs.writeFileSync(path.join(agentsDir, "worker.md"), `---
|
|
1782
|
-
name: worker
|
|
1783
|
-
description: Worker
|
|
1784
|
-
---
|
|
1785
|
-
|
|
1786
|
-
Do work
|
|
1787
|
-
`, "utf-8");
|
|
1788
|
-
|
|
1789
|
-
const result = discoverAgents(dir, "project");
|
|
1790
|
-
const worker = result.agents.find((agent) => agent.name === "worker");
|
|
1791
|
-
assert.equal(worker?.systemPromptMode, "replace");
|
|
1792
|
-
assert.equal(worker?.inheritProjectContext, false);
|
|
1793
|
-
assert.equal(worker?.inheritSkills, false);
|
|
1794
|
-
});
|
|
1795
|
-
|
|
1796
|
-
it("builtin agents inherit project context by default", () => {
|
|
1797
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-builtin-default-prompt-settings-"));
|
|
1798
|
-
const homeDir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-builtin-default-home-"));
|
|
1799
|
-
tempDirs.push(dir);
|
|
1800
|
-
tempDirs.push(homeDir);
|
|
1801
|
-
const previousHome = process.env.HOME;
|
|
1802
|
-
const previousUserProfile = process.env.USERPROFILE;
|
|
1803
|
-
|
|
1804
|
-
try {
|
|
1805
|
-
process.env.HOME = homeDir;
|
|
1806
|
-
process.env.USERPROFILE = homeDir;
|
|
1807
|
-
|
|
1808
|
-
const result = discoverAgents(dir, "both");
|
|
1809
|
-
const scout = result.agents.find((agent) => agent.name === "scout");
|
|
1810
|
-
const reviewer = result.agents.find((agent) => agent.name === "reviewer");
|
|
1811
|
-
const delegate = result.agents.find((agent) => agent.name === "delegate");
|
|
1812
|
-
assert.equal(scout?.inheritProjectContext, true);
|
|
1813
|
-
assert.equal(reviewer?.inheritProjectContext, true);
|
|
1814
|
-
assert.equal(delegate?.inheritProjectContext, true);
|
|
1815
|
-
} finally {
|
|
1816
|
-
if (previousHome === undefined) delete process.env.HOME;
|
|
1817
|
-
else process.env.HOME = previousHome;
|
|
1818
|
-
if (previousUserProfile === undefined) delete process.env.USERPROFILE;
|
|
1819
|
-
else process.env.USERPROFILE = previousUserProfile;
|
|
1820
|
-
}
|
|
1821
|
-
});
|
|
1822
|
-
|
|
1823
|
-
it("bundled agents all have explicit tool allowlists", () => {
|
|
1824
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-builtin-tools-"));
|
|
1825
|
-
const homeDir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-builtin-tools-home-"));
|
|
1826
|
-
tempDirs.push(dir);
|
|
1827
|
-
tempDirs.push(homeDir);
|
|
1828
|
-
const previousHome = process.env.HOME;
|
|
1829
|
-
const previousUserProfile = process.env.USERPROFILE;
|
|
1830
|
-
|
|
1831
|
-
try {
|
|
1832
|
-
process.env.HOME = homeDir;
|
|
1833
|
-
process.env.USERPROFILE = homeDir;
|
|
1834
|
-
const builtins = discoverAgentsAll(dir).builtin;
|
|
1835
|
-
assert.ok(builtins.length > 0);
|
|
1836
|
-
for (const agent of builtins) {
|
|
1837
|
-
if (agent.runner?.type === "external-cli" || agent.runner?.type === "external-job") continue;
|
|
1838
|
-
assert.ok(agent.tools && agent.tools.length > 0, `${agent.name} should have explicit tools frontmatter`);
|
|
1839
|
-
}
|
|
1840
|
-
} finally {
|
|
1841
|
-
if (previousHome === undefined) delete process.env.HOME;
|
|
1842
|
-
else process.env.HOME = previousHome;
|
|
1843
|
-
if (previousUserProfile === undefined) delete process.env.USERPROFILE;
|
|
1844
|
-
else process.env.USERPROFILE = previousUserProfile;
|
|
1845
|
-
}
|
|
1846
|
-
});
|
|
1847
|
-
|
|
1848
|
-
it("worker and delegate include the child-facing supervisor tool", () => {
|
|
1849
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-builtin-supervisor-tool-"));
|
|
1850
|
-
const homeDir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-builtin-supervisor-tool-home-"));
|
|
1851
|
-
tempDirs.push(dir);
|
|
1852
|
-
tempDirs.push(homeDir);
|
|
1853
|
-
const previousHome = process.env.HOME;
|
|
1854
|
-
const previousUserProfile = process.env.USERPROFILE;
|
|
1855
|
-
|
|
1856
|
-
try {
|
|
1857
|
-
process.env.HOME = homeDir;
|
|
1858
|
-
process.env.USERPROFILE = homeDir;
|
|
1859
|
-
const agents = discoverAgentsAll(dir).builtin;
|
|
1860
|
-
for (const name of ["worker", "delegate"]) {
|
|
1861
|
-
const agent = agents.find((candidate) => candidate.name === name);
|
|
1862
|
-
assert.ok(agent, `${name} builtin should be discovered`);
|
|
1863
|
-
assert.deepEqual(agent?.tools, ["read", "grep", "find", "ls", "bash", "edit", "write", "contact_supervisor"]);
|
|
1864
|
-
}
|
|
1865
|
-
} finally {
|
|
1866
|
-
if (previousHome === undefined) delete process.env.HOME;
|
|
1867
|
-
else process.env.HOME = previousHome;
|
|
1868
|
-
if (previousUserProfile === undefined) delete process.env.USERPROFILE;
|
|
1869
|
-
else process.env.USERPROFILE = previousUserProfile;
|
|
1870
|
-
}
|
|
1871
|
-
});
|
|
1872
|
-
|
|
1873
|
-
it("defaults delegate to append mode with inherited project context", () => {
|
|
1874
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-agent-delegate-default-prompt-settings-"));
|
|
1875
|
-
tempDirs.push(dir);
|
|
1876
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1877
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1878
|
-
fs.writeFileSync(path.join(agentsDir, "delegate.md"), `---
|
|
1879
|
-
name: delegate
|
|
1880
|
-
description: Delegate
|
|
1881
|
-
---
|
|
1882
|
-
|
|
1883
|
-
Do work
|
|
1884
|
-
`, "utf-8");
|
|
1885
|
-
|
|
1886
|
-
const result = discoverAgents(dir, "project");
|
|
1887
|
-
const delegate = result.agents.find((agent) => agent.name === "delegate");
|
|
1888
|
-
assert.equal(delegate?.systemPromptMode, "append");
|
|
1889
|
-
assert.equal(delegate?.inheritProjectContext, true);
|
|
1890
|
-
assert.equal(delegate?.inheritSkills, false);
|
|
1891
|
-
});
|
|
1892
|
-
});
|
|
1893
|
-
|
|
1894
|
-
describe("packaged agent and chain discovery", () => {
|
|
1895
|
-
it("recursively discovers nested project agents while keeping chain files separate", () => {
|
|
1896
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-recursive-agent-discovery-"));
|
|
1897
|
-
tempDirs.push(dir);
|
|
1898
|
-
const nestedDir = path.join(dir, ".selesai", "agents", "code-analysis", "deep");
|
|
1899
|
-
const nestedChainDir = path.join(dir, ".selesai", "chains", "code-analysis", "deep");
|
|
1900
|
-
fs.mkdirSync(nestedDir, { recursive: true });
|
|
1901
|
-
fs.mkdirSync(nestedChainDir, { recursive: true });
|
|
1902
|
-
fs.writeFileSync(path.join(nestedDir, "scout.md"), `---
|
|
1903
|
-
name: scout
|
|
1904
|
-
description: Nested scout
|
|
1905
|
-
---
|
|
1906
|
-
|
|
1907
|
-
Inspect code
|
|
1908
|
-
`, "utf-8");
|
|
1909
|
-
fs.writeFileSync(path.join(nestedChainDir, "review.chain.md"), `---
|
|
1910
|
-
name: review-flow
|
|
1911
|
-
description: Review flow
|
|
1912
|
-
---
|
|
1913
|
-
|
|
1914
|
-
## scout
|
|
1915
|
-
|
|
1916
|
-
Review
|
|
1917
|
-
`, "utf-8");
|
|
1918
|
-
|
|
1919
|
-
const result = discoverAgentsAll(dir);
|
|
1920
|
-
assert.ok(result.project.find((agent) => agent.name === "scout" && agent.filePath === path.join(nestedDir, "scout.md")));
|
|
1921
|
-
assert.ok(result.chains.find((chain) => chain.name === "review-flow" && chain.filePath === path.join(nestedChainDir, "review.chain.md")));
|
|
1922
|
-
assert.equal(result.project.some((agent) => agent.filePath.endsWith("review.chain.md")), false);
|
|
1923
|
-
});
|
|
1924
|
-
|
|
1925
|
-
it("registers packaged agents by runtime name and serializes local name plus package", () => {
|
|
1926
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-packaged-agent-"));
|
|
1927
|
-
tempDirs.push(dir);
|
|
1928
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
1929
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
1930
|
-
fs.writeFileSync(path.join(agentsDir, "scout.md"), `---
|
|
1931
|
-
name: scout
|
|
1932
|
-
package: code-analysis
|
|
1933
|
-
description: Fast recon
|
|
1934
|
-
---
|
|
1935
|
-
|
|
1936
|
-
Inspect code
|
|
1937
|
-
`, "utf-8");
|
|
1938
|
-
|
|
1939
|
-
const scout = discoverAgents(dir, "project").agents.find((agent) => agent.name === "code-analysis.scout");
|
|
1940
|
-
assert.ok(scout);
|
|
1941
|
-
assert.equal(scout.localName, "scout");
|
|
1942
|
-
assert.equal(scout.packageName, "code-analysis");
|
|
1943
|
-
const serialized = serializeAgent(scout);
|
|
1944
|
-
assert.match(serialized, /^name: scout$/m);
|
|
1945
|
-
assert.match(serialized, /^package: code-analysis$/m);
|
|
1946
|
-
assert.doesNotMatch(serialized, /^name: code-analysis\.scout$/m);
|
|
1947
|
-
});
|
|
1948
|
-
|
|
1949
|
-
it("recursively discovers packaged chains by runtime name and preserves package on serialize", () => {
|
|
1950
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-packaged-chain-"));
|
|
1951
|
-
tempDirs.push(dir);
|
|
1952
|
-
const nestedDir = path.join(dir, ".selesai", "chains", "flows");
|
|
1953
|
-
fs.mkdirSync(nestedDir, { recursive: true });
|
|
1954
|
-
const content = `---
|
|
1955
|
-
name: review-flow
|
|
1956
|
-
package: code-analysis
|
|
1957
|
-
description: Review flow
|
|
1958
|
-
---
|
|
1959
|
-
|
|
1960
|
-
## code-analysis.scout
|
|
1961
|
-
|
|
1962
|
-
Inspect {task}
|
|
1963
|
-
`;
|
|
1964
|
-
fs.writeFileSync(path.join(nestedDir, "review.chain.md"), content, "utf-8");
|
|
1965
|
-
|
|
1966
|
-
const chain = discoverAgentsAll(dir).chains.find((candidate) => candidate.name === "code-analysis.review-flow");
|
|
1967
|
-
assert.ok(chain);
|
|
1968
|
-
assert.equal(chain.localName, "review-flow");
|
|
1969
|
-
assert.equal(chain.packageName, "code-analysis");
|
|
1970
|
-
assert.equal(chain.steps[0]?.agent, "code-analysis.scout");
|
|
1971
|
-
const serialized = serializeChain(chain);
|
|
1972
|
-
assert.match(serialized, /^name: review-flow$/m);
|
|
1973
|
-
assert.match(serialized, /^package: code-analysis$/m);
|
|
1974
|
-
assert.match(serialized, /^## code-analysis\.scout$/m);
|
|
1975
|
-
assert.doesNotMatch(serialized, /^name: code-analysis\.review-flow$/m);
|
|
1976
|
-
});
|
|
1977
|
-
|
|
1978
|
-
it("keeps packaged and un-packaged runtime names distinct while preserving un-packaged precedence", () => {
|
|
1979
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-packaged-collisions-"));
|
|
1980
|
-
tempDirs.push(dir);
|
|
1981
|
-
fs.mkdirSync(path.join(dir, ".agents"), { recursive: true });
|
|
1982
|
-
fs.mkdirSync(path.join(dir, ".selesai", "agents"), { recursive: true });
|
|
1983
|
-
fs.writeFileSync(path.join(dir, ".agents", "scout.md"), `---
|
|
1984
|
-
name: scout
|
|
1985
|
-
description: Legacy scout
|
|
1986
|
-
---
|
|
1987
|
-
|
|
1988
|
-
Legacy
|
|
1989
|
-
`, "utf-8");
|
|
1990
|
-
fs.writeFileSync(path.join(dir, ".selesai", "agents", "scout.md"), `---
|
|
1991
|
-
name: scout
|
|
1992
|
-
description: Project scout
|
|
1993
|
-
---
|
|
1994
|
-
|
|
1995
|
-
Project
|
|
1996
|
-
`, "utf-8");
|
|
1997
|
-
fs.writeFileSync(path.join(dir, ".selesai", "agents", "packaged.md"), `---
|
|
1998
|
-
name: scout
|
|
1999
|
-
package: code-analysis
|
|
2000
|
-
description: Packaged scout
|
|
2001
|
-
---
|
|
2002
|
-
|
|
2003
|
-
Packaged
|
|
2004
|
-
`, "utf-8");
|
|
2005
|
-
|
|
2006
|
-
const agents = discoverAgents(dir, "project").agents;
|
|
2007
|
-
const unqualified = agents.find((agent) => agent.name === "scout");
|
|
2008
|
-
const packaged = agents.find((agent) => agent.name === "code-analysis.scout");
|
|
2009
|
-
assert.equal(unqualified?.description, "Project scout");
|
|
2010
|
-
assert.equal(unqualified?.filePath, path.join(dir, ".selesai", "agents", "scout.md"));
|
|
2011
|
-
assert.equal(packaged?.description, "Packaged scout");
|
|
2012
|
-
});
|
|
2013
|
-
|
|
2014
|
-
it("parses packaged chains directly from serializer helpers", () => {
|
|
2015
|
-
const parsed = parseChain(`---
|
|
2016
|
-
name: review-flow
|
|
2017
|
-
package: code-analysis
|
|
2018
|
-
description: Review flow
|
|
2019
|
-
---
|
|
2020
|
-
|
|
2021
|
-
## code-analysis.scout
|
|
2022
|
-
|
|
2023
|
-
Inspect
|
|
2024
|
-
`, "project", "/tmp/review.chain.md");
|
|
2025
|
-
|
|
2026
|
-
assert.equal(parsed.name, "code-analysis.review-flow");
|
|
2027
|
-
assert.equal(parsed.localName, "review-flow");
|
|
2028
|
-
assert.equal(parsed.packageName, "code-analysis");
|
|
2029
|
-
assert.match(serializeChain(parsed), /^name: review-flow$/m);
|
|
2030
|
-
});
|
|
2031
|
-
|
|
2032
|
-
it("normalizes package frontmatter consistently for agents and chains", () => {
|
|
2033
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-package-normalize-"));
|
|
2034
|
-
tempDirs.push(dir);
|
|
2035
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
2036
|
-
const chainsDir = path.join(dir, ".selesai", "chains");
|
|
2037
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
2038
|
-
fs.mkdirSync(chainsDir, { recursive: true });
|
|
2039
|
-
fs.writeFileSync(path.join(agentsDir, "scout.md"), `---
|
|
2040
|
-
name: scout
|
|
2041
|
-
package: Code Analysis!
|
|
2042
|
-
description: Fast recon
|
|
2043
|
-
---
|
|
2044
|
-
|
|
2045
|
-
Inspect
|
|
2046
|
-
`, "utf-8");
|
|
2047
|
-
fs.writeFileSync(path.join(chainsDir, "review.chain.md"), `---
|
|
2048
|
-
name: review-flow
|
|
2049
|
-
package: Code Analysis!
|
|
2050
|
-
description: Review flow
|
|
2051
|
-
---
|
|
2052
|
-
|
|
2053
|
-
## code-analysis.scout
|
|
2054
|
-
|
|
2055
|
-
Review
|
|
2056
|
-
`, "utf-8");
|
|
2057
|
-
|
|
2058
|
-
const result = discoverAgentsAll(dir);
|
|
2059
|
-
assert.ok(result.project.find((agent) => agent.name === "code-analysis.scout"));
|
|
2060
|
-
assert.ok(result.chains.find((chain) => chain.name === "code-analysis.review-flow"));
|
|
2061
|
-
});
|
|
2062
|
-
|
|
2063
|
-
it("skips invalid package frontmatter that cannot be normalized", () => {
|
|
2064
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-invalid-package-"));
|
|
2065
|
-
tempDirs.push(dir);
|
|
2066
|
-
const agentsDir = path.join(dir, ".selesai", "agents");
|
|
2067
|
-
const chainsDir = path.join(dir, ".selesai", "chains");
|
|
2068
|
-
fs.mkdirSync(agentsDir, { recursive: true });
|
|
2069
|
-
fs.mkdirSync(chainsDir, { recursive: true });
|
|
2070
|
-
fs.writeFileSync(path.join(agentsDir, "scout.md"), `---
|
|
2071
|
-
name: scout
|
|
2072
|
-
package: !!!
|
|
2073
|
-
description: Fast recon
|
|
2074
|
-
---
|
|
2075
|
-
|
|
2076
|
-
Inspect
|
|
2077
|
-
`, "utf-8");
|
|
2078
|
-
fs.writeFileSync(path.join(chainsDir, "review.chain.md"), `---
|
|
2079
|
-
name: review-flow
|
|
2080
|
-
package: !!!
|
|
2081
|
-
description: Review flow
|
|
2082
|
-
---
|
|
2083
|
-
|
|
2084
|
-
## scout
|
|
2085
|
-
|
|
2086
|
-
Review
|
|
2087
|
-
`, "utf-8");
|
|
2088
|
-
|
|
2089
|
-
const result = discoverAgentsAll(dir);
|
|
2090
|
-
assert.equal(result.project.some((agent) => agent.filePath.endsWith("scout.md")), false);
|
|
2091
|
-
assert.match(result.agentDiagnostics?.find((diagnostic) => diagnostic.filePath.endsWith("scout.md"))?.error ?? "", /Agent 'scout' package is invalid after sanitization/);
|
|
2092
|
-
assert.equal(result.chains.some((chain) => chain.filePath.endsWith("review.chain.md")), false);
|
|
2093
|
-
});
|
|
2094
|
-
});
|
|
2095
|
-
|
|
2096
|
-
describe("project agent directory discovery", () => {
|
|
2097
|
-
it("discovers project agents from both .agents and .selesai/agents", () => {
|
|
2098
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-project-agent-dirs-"));
|
|
2099
|
-
tempDirs.push(dir);
|
|
2100
|
-
fs.mkdirSync(path.join(dir, ".agents", "skills"), { recursive: true });
|
|
2101
|
-
fs.mkdirSync(path.join(dir, ".selesai", "agents"), { recursive: true });
|
|
2102
|
-
fs.writeFileSync(path.join(dir, ".agents", "legacy.md"), `---
|
|
2103
|
-
name: legacy
|
|
2104
|
-
description: Legacy
|
|
2105
|
-
---
|
|
2106
|
-
|
|
2107
|
-
Legacy prompt
|
|
2108
|
-
`, "utf-8");
|
|
2109
|
-
fs.writeFileSync(path.join(dir, ".selesai", "agents", "canonical.md"), `---
|
|
2110
|
-
name: canonical
|
|
2111
|
-
description: Canonical
|
|
2112
|
-
---
|
|
2113
|
-
|
|
2114
|
-
Canonical prompt
|
|
2115
|
-
`, "utf-8");
|
|
2116
|
-
fs.writeFileSync(path.join(dir, ".selesai", "agents", "SKILL.md"), `---
|
|
2117
|
-
name: skill-named-agent
|
|
2118
|
-
description: Skill-named agent
|
|
2119
|
-
---
|
|
2120
|
-
|
|
2121
|
-
Skill-named agent prompt
|
|
2122
|
-
`, "utf-8");
|
|
2123
|
-
|
|
2124
|
-
const result = discoverAgents(dir, "project");
|
|
2125
|
-
assert.ok(result.agents.find((agent) => agent.name === "legacy" && agent.filePath === path.join(dir, ".agents", "legacy.md")));
|
|
2126
|
-
assert.ok(result.agents.find((agent) => agent.name === "canonical" && agent.filePath === path.join(dir, ".selesai", "agents", "canonical.md")));
|
|
2127
|
-
assert.ok(result.agents.find((agent) => agent.name === "skill-named-agent" && agent.filePath === path.join(dir, ".selesai", "agents", "SKILL.md")));
|
|
2128
|
-
assert.equal(result.projectAgentsDir, path.join(dir, ".selesai", "agents"));
|
|
2129
|
-
});
|
|
2130
|
-
|
|
2131
|
-
it("does not register legacy project skill files as agents", () => {
|
|
2132
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-project-skills-not-agents-"));
|
|
2133
|
-
tempDirs.push(dir);
|
|
2134
|
-
writeAgent(path.join(dir, ".agents", "legacy.md"), `---
|
|
2135
|
-
name: legacy
|
|
2136
|
-
description: Legacy
|
|
2137
|
-
---
|
|
2138
|
-
|
|
2139
|
-
Legacy prompt
|
|
2140
|
-
`);
|
|
2141
|
-
writeAgent(path.join(dir, ".agents", "skills", "directory-skill", "SKILL.md"), `---
|
|
2142
|
-
name: directory-skill
|
|
2143
|
-
description: Directory skill
|
|
2144
|
-
---
|
|
2145
|
-
|
|
2146
|
-
Skill prompt
|
|
2147
|
-
`);
|
|
2148
|
-
writeAgent(path.join(dir, ".agents", "skills", "file-skill.md"), `---
|
|
2149
|
-
name: file-skill
|
|
2150
|
-
description: File skill
|
|
2151
|
-
---
|
|
2152
|
-
|
|
2153
|
-
Skill prompt
|
|
2154
|
-
`);
|
|
2155
|
-
|
|
2156
|
-
const agents = discoverAgents(dir, "project").agents;
|
|
2157
|
-
assert.ok(agents.find((agent) => agent.name === "legacy"));
|
|
2158
|
-
assert.equal(agents.some((agent) => agent.filePath.includes(`${path.sep}.agents${path.sep}skills${path.sep}`)), false);
|
|
2159
|
-
assert.equal(agents.some((agent) => agent.name === "directory-skill"), false);
|
|
2160
|
-
assert.equal(agents.some((agent) => agent.name === "file-skill"), false);
|
|
2161
|
-
});
|
|
2162
|
-
|
|
2163
|
-
it("does not register user SKILL.md files as agents", () => withTempHome((home) => {
|
|
2164
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-user-skills-not-agents-"));
|
|
2165
|
-
tempDirs.push(dir);
|
|
2166
|
-
writeAgent(path.join(home, ".agents", "user-agent.md"), `---
|
|
2167
|
-
name: user-agent
|
|
2168
|
-
description: User agent
|
|
2169
|
-
---
|
|
2170
|
-
|
|
2171
|
-
User prompt
|
|
2172
|
-
`);
|
|
2173
|
-
writeAgent(path.join(home, ".agents", "skills", "user-skill", "SKILL.md"), `---
|
|
2174
|
-
name: user-skill
|
|
2175
|
-
description: User skill
|
|
2176
|
-
---
|
|
2177
|
-
|
|
2178
|
-
Skill prompt
|
|
2179
|
-
`);
|
|
2180
|
-
|
|
2181
|
-
const agents = discoverAgents(dir, "user").agents;
|
|
2182
|
-
assert.ok(agents.find((agent) => agent.name === "user-agent"));
|
|
2183
|
-
assert.equal(agents.some((agent) => agent.filePath.includes(`${path.sep}.agents${path.sep}skills${path.sep}`)), false);
|
|
2184
|
-
assert.equal(agents.some((agent) => agent.name === "user-skill"), false);
|
|
2185
|
-
}));
|
|
2186
|
-
|
|
2187
|
-
it("prefers .selesai/agents over .agents on project agent name collisions", () => {
|
|
2188
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-project-agent-collision-"));
|
|
2189
|
-
tempDirs.push(dir);
|
|
2190
|
-
fs.mkdirSync(path.join(dir, ".agents"), { recursive: true });
|
|
2191
|
-
fs.mkdirSync(path.join(dir, ".selesai", "agents"), { recursive: true });
|
|
2192
|
-
fs.writeFileSync(path.join(dir, ".agents", "shared.md"), `---
|
|
2193
|
-
name: shared
|
|
2194
|
-
description: Legacy shared
|
|
2195
|
-
---
|
|
2196
|
-
|
|
2197
|
-
Legacy prompt
|
|
2198
|
-
`, "utf-8");
|
|
2199
|
-
fs.writeFileSync(path.join(dir, ".selesai", "agents", "shared.md"), `---
|
|
2200
|
-
name: shared
|
|
2201
|
-
description: Canonical shared
|
|
2202
|
-
---
|
|
2203
|
-
|
|
2204
|
-
Canonical prompt
|
|
2205
|
-
`, "utf-8");
|
|
2206
|
-
|
|
2207
|
-
const shared = discoverAgents(dir, "project").agents.find((agent) => agent.name === "shared");
|
|
2208
|
-
assert.ok(shared);
|
|
2209
|
-
assert.equal(shared.filePath, path.join(dir, ".selesai", "agents", "shared.md"));
|
|
2210
|
-
assert.equal(shared.description, "Canonical shared");
|
|
2211
|
-
assert.equal(shared.systemPrompt.trim(), "Canonical prompt");
|
|
2212
|
-
});
|
|
2213
|
-
|
|
2214
|
-
it("uses the project root for the canonical project agent dir even when only .agents exists", () => {
|
|
2215
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-project-agent-root-"));
|
|
2216
|
-
tempDirs.push(dir);
|
|
2217
|
-
const nested = path.join(dir, "packages", "app");
|
|
2218
|
-
fs.mkdirSync(path.join(dir, ".agents", "skills"), { recursive: true });
|
|
2219
|
-
fs.mkdirSync(nested, { recursive: true });
|
|
2220
|
-
|
|
2221
|
-
const result = discoverAgentsAll(nested);
|
|
2222
|
-
assert.equal(result.projectDir, path.join(dir, ".selesai", "agents"));
|
|
2223
|
-
});
|
|
2224
|
-
|
|
2225
|
-
it("discovers project chains from .selesai/chains", () => {
|
|
2226
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-project-chain-dirs-"));
|
|
2227
|
-
tempDirs.push(dir);
|
|
2228
|
-
fs.mkdirSync(path.join(dir, ".selesai", "agents"), { recursive: true });
|
|
2229
|
-
fs.mkdirSync(path.join(dir, ".selesai", "chains", "flows"), { recursive: true });
|
|
2230
|
-
fs.writeFileSync(path.join(dir, ".selesai", "agents", "ignored.chain.md"), `---
|
|
2231
|
-
name: ignored-chain
|
|
2232
|
-
description: Ignored chain
|
|
2233
|
-
---
|
|
2234
|
-
|
|
2235
|
-
## scout
|
|
2236
|
-
|
|
2237
|
-
Ignore
|
|
2238
|
-
`, "utf-8");
|
|
2239
|
-
fs.writeFileSync(path.join(dir, ".selesai", "chains", "flows", "canonical.chain.md"), `---
|
|
2240
|
-
name: canonical-chain
|
|
2241
|
-
description: Canonical chain
|
|
2242
|
-
---
|
|
2243
|
-
|
|
2244
|
-
## worker
|
|
2245
|
-
|
|
2246
|
-
Inspect canonical
|
|
2247
|
-
`, "utf-8");
|
|
2248
|
-
|
|
2249
|
-
const result = discoverAgentsAll(dir);
|
|
2250
|
-
assert.equal(result.chains.some((chain) => chain.name === "ignored-chain"), false);
|
|
2251
|
-
assert.ok(result.chains.find((chain) => chain.name === "canonical-chain" && chain.filePath === path.join(dir, ".selesai", "chains", "flows", "canonical.chain.md")));
|
|
2252
|
-
assert.equal(result.projectDir, path.join(dir, ".selesai", "agents"));
|
|
2253
|
-
assert.equal(result.projectChainDir, path.join(dir, ".selesai", "chains"));
|
|
2254
|
-
});
|
|
2255
|
-
|
|
2256
|
-
it("prefers project .selesai/chains over user chains on name collisions", () => {
|
|
2257
|
-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-project-chain-collision-"));
|
|
2258
|
-
const home = fs.mkdtempSync(path.join(os.tmpdir(), "pi-subagents-user-chain-home-"));
|
|
2259
|
-
tempDirs.push(dir, home);
|
|
2260
|
-
const oldHome = process.env.HOME;
|
|
2261
|
-
const oldUserProfile = process.env.USERPROFILE;
|
|
2262
|
-
process.env.HOME = home;
|
|
2263
|
-
process.env.USERPROFILE = home;
|
|
2264
|
-
try {
|
|
2265
|
-
const userChainsDir = path.join(home, ".selesai", "agent", "chains");
|
|
2266
|
-
fs.mkdirSync(userChainsDir, { recursive: true });
|
|
2267
|
-
fs.mkdirSync(path.join(dir, ".selesai", "chains"), { recursive: true });
|
|
2268
|
-
fs.writeFileSync(path.join(userChainsDir, "shared.chain.md"), `---
|
|
2269
|
-
name: shared-chain
|
|
2270
|
-
description: User chain
|
|
2271
|
-
---
|
|
2272
|
-
|
|
2273
|
-
## scout
|
|
2274
|
-
|
|
2275
|
-
Inspect user
|
|
2276
|
-
`, "utf-8");
|
|
2277
|
-
fs.writeFileSync(path.join(dir, ".selesai", "chains", "shared.chain.md"), `---
|
|
2278
|
-
name: shared-chain
|
|
2279
|
-
description: Project chain
|
|
2280
|
-
---
|
|
2281
|
-
|
|
2282
|
-
## worker
|
|
2283
|
-
|
|
2284
|
-
Inspect project
|
|
2285
|
-
`, "utf-8");
|
|
2286
|
-
|
|
2287
|
-
const sharedChains = discoverAgentsAll(dir).chains.filter((chain) => chain.name === "shared-chain");
|
|
2288
|
-
assert.equal(sharedChains.length, 2);
|
|
2289
|
-
assert.deepEqual(sharedChains.map((chain) => chain.source), ["user", "project"]);
|
|
2290
|
-
const savedChainLookup = new Map(sharedChains.map((chain) => [chain.name, chain]));
|
|
2291
|
-
const shared = savedChainLookup.get("shared-chain");
|
|
2292
|
-
assert.ok(shared);
|
|
2293
|
-
assert.equal(shared.filePath, path.join(dir, ".selesai", "chains", "shared.chain.md"));
|
|
2294
|
-
assert.equal(shared.description, "Project chain");
|
|
2295
|
-
assert.equal(shared.steps[0]?.agent, "worker");
|
|
2296
|
-
assert.equal(shared.steps[0]?.task, "Inspect project");
|
|
2297
|
-
} finally {
|
|
2298
|
-
if (oldHome === undefined) delete process.env.HOME;
|
|
2299
|
-
else process.env.HOME = oldHome;
|
|
2300
|
-
if (oldUserProfile === undefined) delete process.env.USERPROFILE;
|
|
2301
|
-
else process.env.USERPROFILE = oldUserProfile;
|
|
2302
|
-
}
|
|
2303
|
-
});
|
|
2304
|
-
});
|