@nubl/maestro 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -3
- package/dist/config.json.example +30 -0
- package/dist/maestro/adapters/fake/fake-harness-adapter.d.ts +24 -0
- package/dist/maestro/adapters/fake/fake-harness-adapter.d.ts.map +1 -0
- package/dist/maestro/adapters/fake/fake-harness-adapter.js +210 -0
- package/dist/maestro/adapters/fake/fake-harness-adapter.js.map +1 -0
- package/dist/maestro/adapters/pi/accept-groups.d.ts +35 -0
- package/dist/maestro/adapters/pi/accept-groups.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/accept-groups.js +70 -0
- package/dist/maestro/adapters/pi/accept-groups.js.map +1 -0
- package/dist/maestro/adapters/pi/accept-runner.d.ts +37 -0
- package/dist/maestro/adapters/pi/accept-runner.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/accept-runner.js +161 -0
- package/dist/maestro/adapters/pi/accept-runner.js.map +1 -0
- package/dist/maestro/adapters/pi/activity-file.d.ts +39 -0
- package/dist/maestro/adapters/pi/activity-file.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/activity-file.js +454 -0
- package/dist/maestro/adapters/pi/activity-file.js.map +1 -0
- package/dist/maestro/adapters/pi/child/accept-check.d.ts +24 -0
- package/dist/maestro/adapters/pi/child/accept-check.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/child/accept-check.js +82 -0
- package/dist/maestro/adapters/pi/child/accept-check.js.map +1 -0
- package/dist/maestro/adapters/pi/child/declared-skills.d.ts +51 -0
- package/dist/maestro/adapters/pi/child/declared-skills.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/child/declared-skills.js +148 -0
- package/dist/maestro/adapters/pi/child/declared-skills.js.map +1 -0
- package/dist/maestro/adapters/pi/child/done-nudge.d.ts +38 -0
- package/dist/maestro/adapters/pi/child/done-nudge.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/child/done-nudge.js +77 -0
- package/dist/maestro/adapters/pi/child/done-nudge.js.map +1 -0
- package/dist/maestro/adapters/pi/child/entry.d.ts +3 -0
- package/dist/maestro/adapters/pi/child/entry.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/child/entry.js +3 -0
- package/dist/maestro/adapters/pi/child/entry.js.map +1 -0
- package/dist/maestro/adapters/pi/child/protocol.d.ts +56 -0
- package/dist/maestro/adapters/pi/child/protocol.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/child/protocol.js +510 -0
- package/dist/maestro/adapters/pi/child/protocol.js.map +1 -0
- package/dist/maestro/adapters/pi/completion.d.ts +45 -0
- package/dist/maestro/adapters/pi/completion.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/completion.js +295 -0
- package/dist/maestro/adapters/pi/completion.js.map +1 -0
- package/dist/maestro/adapters/pi/launch-command.d.ts +27 -0
- package/dist/maestro/adapters/pi/launch-command.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/launch-command.js +75 -0
- package/dist/maestro/adapters/pi/launch-command.js.map +1 -0
- package/dist/maestro/adapters/pi/launch-operations.d.ts +78 -0
- package/dist/maestro/adapters/pi/launch-operations.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/launch-operations.js +270 -0
- package/dist/maestro/adapters/pi/launch-operations.js.map +1 -0
- package/dist/maestro/adapters/pi/launch-resume.d.ts +4 -0
- package/dist/maestro/adapters/pi/launch-resume.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/launch-resume.js +183 -0
- package/dist/maestro/adapters/pi/launch-resume.js.map +1 -0
- package/dist/maestro/adapters/pi/launch.d.ts +148 -0
- package/dist/maestro/adapters/pi/launch.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/launch.js +655 -0
- package/dist/maestro/adapters/pi/launch.js.map +1 -0
- package/dist/maestro/adapters/pi/model-registry.d.ts +3 -0
- package/dist/maestro/adapters/pi/model-registry.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/model-registry.js +29 -0
- package/dist/maestro/adapters/pi/model-registry.js.map +1 -0
- package/dist/maestro/adapters/pi/pi-harness-adapter.d.ts +95 -0
- package/dist/maestro/adapters/pi/pi-harness-adapter.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/pi-harness-adapter.js +549 -0
- package/dist/maestro/adapters/pi/pi-harness-adapter.js.map +1 -0
- package/dist/maestro/adapters/pi/process-identity.d.ts +92 -0
- package/dist/maestro/adapters/pi/process-identity.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/process-identity.js +248 -0
- package/dist/maestro/adapters/pi/process-identity.js.map +1 -0
- package/dist/maestro/adapters/pi/process-tree.d.ts +48 -0
- package/dist/maestro/adapters/pi/process-tree.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/process-tree.js +69 -0
- package/dist/maestro/adapters/pi/process-tree.js.map +1 -0
- package/dist/maestro/adapters/pi/script-shell.d.ts +40 -0
- package/dist/maestro/adapters/pi/script-shell.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/script-shell.js +43 -0
- package/dist/maestro/adapters/pi/script-shell.js.map +1 -0
- package/dist/maestro/adapters/pi/session.d.ts +207 -0
- package/dist/maestro/adapters/pi/session.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/session.js +714 -0
- package/dist/maestro/adapters/pi/session.js.map +1 -0
- package/dist/maestro/adapters/pi/task-model-init.d.ts +4 -0
- package/dist/maestro/adapters/pi/task-model-init.d.ts.map +1 -0
- package/dist/maestro/adapters/pi/task-model-init.js +47 -0
- package/dist/maestro/adapters/pi/task-model-init.js.map +1 -0
- package/dist/maestro/core/accept.d.ts +150 -0
- package/dist/maestro/core/accept.d.ts.map +1 -0
- package/dist/maestro/core/accept.js +243 -0
- package/dist/maestro/core/accept.js.map +1 -0
- package/dist/maestro/core/activity.d.ts +4 -0
- package/dist/maestro/core/activity.d.ts.map +1 -0
- package/dist/maestro/core/activity.js +18 -0
- package/dist/maestro/core/activity.js.map +1 -0
- package/dist/maestro/core/child-busy.d.ts +14 -0
- package/dist/maestro/core/child-busy.d.ts.map +1 -0
- package/dist/maestro/core/child-busy.js +14 -0
- package/dist/maestro/core/child-busy.js.map +1 -0
- package/dist/maestro/core/config/guidelines-config.d.ts +8 -0
- package/dist/maestro/core/config/guidelines-config.d.ts.map +1 -0
- package/dist/maestro/core/config/guidelines-config.js +60 -0
- package/dist/maestro/core/config/guidelines-config.js.map +1 -0
- package/dist/maestro/core/config/herdr-config.d.ts +13 -0
- package/dist/maestro/core/config/herdr-config.d.ts.map +1 -0
- package/dist/maestro/core/config/herdr-config.js +65 -0
- package/dist/maestro/core/config/herdr-config.js.map +1 -0
- package/dist/maestro/core/config/model-config.d.ts +92 -0
- package/dist/maestro/core/config/model-config.d.ts.map +1 -0
- package/dist/maestro/core/config/model-config.js +522 -0
- package/dist/maestro/core/config/model-config.js.map +1 -0
- package/dist/maestro/core/config/outcome-ledger-config.d.ts +8 -0
- package/dist/maestro/core/config/outcome-ledger-config.d.ts.map +1 -0
- package/dist/maestro/core/config/outcome-ledger-config.js +49 -0
- package/dist/maestro/core/config/outcome-ledger-config.js.map +1 -0
- package/dist/maestro/core/config/pane-config.d.ts +15 -0
- package/dist/maestro/core/config/pane-config.d.ts.map +1 -0
- package/dist/maestro/core/config/pane-config.js +101 -0
- package/dist/maestro/core/config/pane-config.js.map +1 -0
- package/dist/maestro/core/config/persistent-config.d.ts +7 -0
- package/dist/maestro/core/config/persistent-config.d.ts.map +1 -0
- package/dist/maestro/core/config/persistent-config.js +72 -0
- package/dist/maestro/core/config/persistent-config.js.map +1 -0
- package/dist/maestro/core/config/role-config.d.ts +7 -0
- package/dist/maestro/core/config/role-config.d.ts.map +1 -0
- package/dist/maestro/core/config/role-config.js +74 -0
- package/dist/maestro/core/config/role-config.js.map +1 -0
- package/dist/maestro/core/config/spawning-config.d.ts +7 -0
- package/dist/maestro/core/config/spawning-config.d.ts.map +1 -0
- package/dist/maestro/core/config/spawning-config.js +65 -0
- package/dist/maestro/core/config/spawning-config.js.map +1 -0
- package/dist/maestro/core/config/supervision-config.d.ts +7 -0
- package/dist/maestro/core/config/supervision-config.d.ts.map +1 -0
- package/dist/maestro/core/config/supervision-config.js +69 -0
- package/dist/maestro/core/config/supervision-config.js.map +1 -0
- package/dist/maestro/core/config/task-model-init.d.ts +118 -0
- package/dist/maestro/core/config/task-model-init.d.ts.map +1 -0
- package/dist/maestro/core/config/task-model-init.js +168 -0
- package/dist/maestro/core/config/task-model-init.js.map +1 -0
- package/dist/maestro/core/config/task-model-types.d.ts +36 -0
- package/dist/maestro/core/config/task-model-types.d.ts.map +1 -0
- package/dist/maestro/core/config/task-model-types.js +17 -0
- package/dist/maestro/core/config/task-model-types.js.map +1 -0
- package/dist/maestro/core/config/type-guards.d.ts +22 -0
- package/dist/maestro/core/config/type-guards.d.ts.map +1 -0
- package/dist/maestro/core/config/type-guards.js +31 -0
- package/dist/maestro/core/config/type-guards.js.map +1 -0
- package/dist/maestro/core/deadline.d.ts +11 -0
- package/dist/maestro/core/deadline.d.ts.map +1 -0
- package/dist/maestro/core/deadline.js +30 -0
- package/dist/maestro/core/deadline.js.map +1 -0
- package/dist/maestro/core/declared-skills.d.ts +16 -0
- package/dist/maestro/core/declared-skills.d.ts.map +1 -0
- package/dist/maestro/core/declared-skills.js +52 -0
- package/dist/maestro/core/declared-skills.js.map +1 -0
- package/dist/maestro/core/delegation-depth.d.ts +38 -0
- package/dist/maestro/core/delegation-depth.d.ts.map +1 -0
- package/dist/maestro/core/delegation-depth.js +59 -0
- package/dist/maestro/core/delegation-depth.js.map +1 -0
- package/dist/maestro/core/git-environment.d.ts +3 -0
- package/dist/maestro/core/git-environment.d.ts.map +1 -0
- package/dist/maestro/core/git-environment.js +29 -0
- package/dist/maestro/core/git-environment.js.map +1 -0
- package/dist/maestro/core/harness-adapter.d.ts +89 -0
- package/dist/maestro/core/harness-adapter.d.ts.map +1 -0
- package/dist/maestro/core/harness-adapter.js +2 -0
- package/dist/maestro/core/harness-adapter.js.map +1 -0
- package/dist/maestro/core/host-text.d.ts +49 -0
- package/dist/maestro/core/host-text.d.ts.map +1 -0
- package/dist/maestro/core/host-text.js +106 -0
- package/dist/maestro/core/host-text.js.map +1 -0
- package/dist/maestro/core/index.d.ts +4 -0
- package/dist/maestro/core/index.d.ts.map +1 -0
- package/dist/maestro/core/index.js +2 -0
- package/dist/maestro/core/index.js.map +1 -0
- package/dist/maestro/core/lifecycle.d.ts +16 -0
- package/dist/maestro/core/lifecycle.d.ts.map +1 -0
- package/dist/maestro/core/lifecycle.js +429 -0
- package/dist/maestro/core/lifecycle.js.map +1 -0
- package/dist/maestro/core/opened-primary-workspace.d.ts +31 -0
- package/dist/maestro/core/opened-primary-workspace.d.ts.map +1 -0
- package/dist/maestro/core/opened-primary-workspace.js +49 -0
- package/dist/maestro/core/opened-primary-workspace.js.map +1 -0
- package/dist/maestro/core/platform-support.d.ts +15 -0
- package/dist/maestro/core/platform-support.d.ts.map +1 -0
- package/dist/maestro/core/platform-support.js +23 -0
- package/dist/maestro/core/platform-support.js.map +1 -0
- package/dist/maestro/core/realpath-without-opening.d.ts +9 -0
- package/dist/maestro/core/realpath-without-opening.d.ts.map +1 -0
- package/dist/maestro/core/realpath-without-opening.js +45 -0
- package/dist/maestro/core/realpath-without-opening.js.map +1 -0
- package/dist/maestro/core/roles/discovery.d.ts +64 -0
- package/dist/maestro/core/roles/discovery.d.ts.map +1 -0
- package/dist/maestro/core/roles/discovery.js +422 -0
- package/dist/maestro/core/roles/discovery.js.map +1 -0
- package/dist/maestro/core/routing.d.ts +115 -0
- package/dist/maestro/core/routing.d.ts.map +1 -0
- package/dist/maestro/core/routing.js +449 -0
- package/dist/maestro/core/routing.js.map +1 -0
- package/dist/maestro/core/script-launch.d.ts +47 -0
- package/dist/maestro/core/script-launch.d.ts.map +1 -0
- package/dist/maestro/core/script-launch.js +102 -0
- package/dist/maestro/core/script-launch.js.map +1 -0
- package/dist/maestro/core/shell.d.ts +2 -0
- package/dist/maestro/core/shell.d.ts.map +1 -0
- package/dist/maestro/core/shell.js +4 -0
- package/dist/maestro/core/shell.js.map +1 -0
- package/dist/maestro/core/specialist-notice.d.ts +36 -0
- package/dist/maestro/core/specialist-notice.d.ts.map +1 -0
- package/dist/maestro/core/specialist-notice.js +41 -0
- package/dist/maestro/core/specialist-notice.js.map +1 -0
- package/dist/maestro/core/status.d.ts +87 -0
- package/dist/maestro/core/status.d.ts.map +1 -0
- package/dist/maestro/core/status.js +369 -0
- package/dist/maestro/core/status.js.map +1 -0
- package/dist/maestro/core/supervision.d.ts +56 -0
- package/dist/maestro/core/supervision.d.ts.map +1 -0
- package/dist/maestro/core/supervision.js +249 -0
- package/dist/maestro/core/supervision.js.map +1 -0
- package/dist/maestro/core/surface-provider.d.ts +200 -0
- package/dist/maestro/core/surface-provider.d.ts.map +1 -0
- package/dist/maestro/core/surface-provider.js +71 -0
- package/dist/maestro/core/surface-provider.js.map +1 -0
- package/dist/maestro/core/types.d.ts +388 -0
- package/dist/maestro/core/types.d.ts.map +1 -0
- package/dist/maestro/core/types.js +2 -0
- package/dist/maestro/core/types.js.map +1 -0
- package/dist/maestro/core/undelivered-children.d.ts +27 -0
- package/dist/maestro/core/undelivered-children.d.ts.map +1 -0
- package/dist/maestro/core/undelivered-children.js +31 -0
- package/dist/maestro/core/undelivered-children.js.map +1 -0
- package/dist/maestro/core/wake.d.ts +32 -0
- package/dist/maestro/core/wake.d.ts.map +1 -0
- package/dist/maestro/core/wake.js +125 -0
- package/dist/maestro/core/wake.js.map +1 -0
- package/dist/maestro/core/worktree-cleanup.d.ts +75 -0
- package/dist/maestro/core/worktree-cleanup.d.ts.map +1 -0
- package/dist/maestro/core/worktree-cleanup.js +278 -0
- package/dist/maestro/core/worktree-cleanup.js.map +1 -0
- package/dist/maestro/core/worktree.d.ts +50 -0
- package/dist/maestro/core/worktree.d.ts.map +1 -0
- package/dist/maestro/core/worktree.js +23 -0
- package/dist/maestro/core/worktree.js.map +1 -0
- package/dist/maestro/engine.d.ts +5 -0
- package/dist/maestro/engine.d.ts.map +1 -0
- package/dist/maestro/engine.js +5 -0
- package/dist/maestro/engine.js.map +1 -0
- package/dist/maestro/pi/child.d.ts +8 -0
- package/dist/maestro/pi/child.d.ts.map +1 -0
- package/dist/maestro/pi/child.js +8 -0
- package/dist/maestro/pi/child.js.map +1 -0
- package/dist/maestro/pi/extension.d.ts +10 -0
- package/dist/maestro/pi/extension.d.ts.map +1 -0
- package/dist/maestro/pi/extension.js +8 -0
- package/dist/maestro/pi/extension.js.map +1 -0
- package/dist/maestro/pi/subagents-index.d.ts +9 -0
- package/dist/maestro/pi/subagents-index.d.ts.map +1 -0
- package/dist/maestro/pi/subagents-index.js +9 -0
- package/dist/maestro/pi/subagents-index.js.map +1 -0
- package/dist/maestro/pi.d.ts +9 -0
- package/dist/maestro/pi.d.ts.map +1 -0
- package/dist/maestro/pi.js +7 -0
- package/dist/maestro/pi.js.map +1 -0
- package/dist/maestro/runtime/accept-recheck.d.ts +32 -0
- package/dist/maestro/runtime/accept-recheck.d.ts.map +1 -0
- package/dist/maestro/runtime/accept-recheck.js +92 -0
- package/dist/maestro/runtime/accept-recheck.js.map +1 -0
- package/dist/maestro/runtime/delegated-marker.d.ts +112 -0
- package/dist/maestro/runtime/delegated-marker.d.ts.map +1 -0
- package/dist/maestro/runtime/delegated-marker.js +200 -0
- package/dist/maestro/runtime/delegated-marker.js.map +1 -0
- package/dist/maestro/runtime/host-surface-binding.d.ts +25 -0
- package/dist/maestro/runtime/host-surface-binding.d.ts.map +1 -0
- package/dist/maestro/runtime/host-surface-binding.js +2 -0
- package/dist/maestro/runtime/host-surface-binding.js.map +1 -0
- package/dist/maestro/runtime/index.d.ts +10 -0
- package/dist/maestro/runtime/index.d.ts.map +1 -0
- package/dist/maestro/runtime/index.js +6 -0
- package/dist/maestro/runtime/index.js.map +1 -0
- package/dist/maestro/runtime/pi-persistent-io.d.ts +7 -0
- package/dist/maestro/runtime/pi-persistent-io.d.ts.map +1 -0
- package/dist/maestro/runtime/pi-persistent-io.js +64 -0
- package/dist/maestro/runtime/pi-persistent-io.js.map +1 -0
- package/dist/maestro/runtime/pi-run-session-types.d.ts +328 -0
- package/dist/maestro/runtime/pi-run-session-types.d.ts.map +1 -0
- package/dist/maestro/runtime/pi-run-session-types.js +2 -0
- package/dist/maestro/runtime/pi-run-session-types.js.map +1 -0
- package/dist/maestro/runtime/pi-run-session.d.ts +12 -0
- package/dist/maestro/runtime/pi-run-session.d.ts.map +1 -0
- package/dist/maestro/runtime/pi-run-session.js +809 -0
- package/dist/maestro/runtime/pi-run-session.js.map +1 -0
- package/dist/maestro/runtime/run-session.d.ts +129 -0
- package/dist/maestro/runtime/run-session.d.ts.map +1 -0
- package/dist/maestro/runtime/run-session.js +680 -0
- package/dist/maestro/runtime/run-session.js.map +1 -0
- package/dist/maestro/runtime/surface-retention.d.ts +3 -0
- package/dist/maestro/runtime/surface-retention.d.ts.map +1 -0
- package/dist/maestro/runtime/surface-retention.js +5 -0
- package/dist/maestro/runtime/surface-retention.js.map +1 -0
- package/dist/maestro/runtime/task-model-init.d.ts +34 -0
- package/dist/maestro/runtime/task-model-init.d.ts.map +1 -0
- package/dist/maestro/runtime/task-model-init.js +78 -0
- package/dist/maestro/runtime/task-model-init.js.map +1 -0
- package/dist/maestro/runtime/worktree-operations.d.ts +31 -0
- package/dist/maestro/runtime/worktree-operations.d.ts.map +1 -0
- package/dist/maestro/runtime/worktree-operations.js +633 -0
- package/dist/maestro/runtime/worktree-operations.js.map +1 -0
- package/dist/maestro/surfaces/fake/fake-surface-provider.d.ts +54 -0
- package/dist/maestro/surfaces/fake/fake-surface-provider.d.ts.map +1 -0
- package/dist/maestro/surfaces/fake/fake-surface-provider.js +231 -0
- package/dist/maestro/surfaces/fake/fake-surface-provider.js.map +1 -0
- package/dist/maestro/testing/harness-adapter.conformance.d.ts +31 -0
- package/dist/maestro/testing/harness-adapter.conformance.d.ts.map +1 -0
- package/dist/maestro/testing/harness-adapter.conformance.js +181 -0
- package/dist/maestro/testing/harness-adapter.conformance.js.map +1 -0
- package/dist/maestro/testing/index.d.ts +5 -0
- package/dist/maestro/testing/index.d.ts.map +1 -0
- package/dist/maestro/testing/index.js +5 -0
- package/dist/maestro/testing/index.js.map +1 -0
- package/dist/maestro/testing/surface-provider.conformance.d.ts +20 -0
- package/dist/maestro/testing/surface-provider.conformance.d.ts.map +1 -0
- package/dist/maestro/testing/surface-provider.conformance.js +167 -0
- package/dist/maestro/testing/surface-provider.conformance.js.map +1 -0
- package/dist/pi-extension/subagents/catalog.d.ts +70 -0
- package/dist/pi-extension/subagents/catalog.d.ts.map +1 -0
- package/dist/pi-extension/subagents/catalog.js +231 -0
- package/dist/pi-extension/subagents/catalog.js.map +1 -0
- package/dist/pi-extension/subagents/config-path.d.ts +6 -0
- package/dist/pi-extension/subagents/config-path.d.ts.map +1 -0
- package/dist/pi-extension/subagents/config-path.js +21 -0
- package/dist/pi-extension/subagents/config-path.js.map +1 -0
- package/dist/pi-extension/subagents/control-tools.d.ts +21 -0
- package/dist/pi-extension/subagents/control-tools.d.ts.map +1 -0
- package/dist/pi-extension/subagents/control-tools.js +150 -0
- package/dist/pi-extension/subagents/control-tools.js.map +1 -0
- package/dist/pi-extension/subagents/controls.d.ts +52 -0
- package/dist/pi-extension/subagents/controls.d.ts.map +1 -0
- package/dist/pi-extension/subagents/controls.js +173 -0
- package/dist/pi-extension/subagents/controls.js.map +1 -0
- package/dist/pi-extension/subagents/deferred-tools.d.ts +43 -0
- package/dist/pi-extension/subagents/deferred-tools.d.ts.map +1 -0
- package/dist/pi-extension/subagents/deferred-tools.js +67 -0
- package/dist/pi-extension/subagents/deferred-tools.js.map +1 -0
- package/dist/pi-extension/subagents/delivery.d.ts +22 -0
- package/dist/pi-extension/subagents/delivery.d.ts.map +1 -0
- package/dist/pi-extension/subagents/delivery.js +365 -0
- package/dist/pi-extension/subagents/delivery.js.map +1 -0
- package/dist/pi-extension/subagents/extension.d.ts +100 -0
- package/dist/pi-extension/subagents/extension.d.ts.map +1 -0
- package/dist/pi-extension/subagents/extension.js +367 -0
- package/dist/pi-extension/subagents/extension.js.map +1 -0
- package/dist/pi-extension/subagents/launch-tools.d.ts +33 -0
- package/dist/pi-extension/subagents/launch-tools.d.ts.map +1 -0
- package/dist/pi-extension/subagents/launch-tools.js +373 -0
- package/dist/pi-extension/subagents/launch-tools.js.map +1 -0
- package/dist/pi-extension/subagents/launch.d.ts +86 -0
- package/dist/pi-extension/subagents/launch.d.ts.map +1 -0
- package/dist/pi-extension/subagents/launch.js +133 -0
- package/dist/pi-extension/subagents/launch.js.map +1 -0
- package/dist/pi-extension/subagents/model-registry.d.ts +13 -0
- package/dist/pi-extension/subagents/model-registry.d.ts.map +1 -0
- package/dist/pi-extension/subagents/model-registry.js +52 -0
- package/dist/pi-extension/subagents/model-registry.js.map +1 -0
- package/dist/pi-extension/subagents/observation.d.ts +38 -0
- package/dist/pi-extension/subagents/observation.d.ts.map +1 -0
- package/dist/pi-extension/subagents/observation.js +168 -0
- package/dist/pi-extension/subagents/observation.js.map +1 -0
- package/dist/pi-extension/subagents/persistent.d.ts +72 -0
- package/dist/pi-extension/subagents/persistent.d.ts.map +1 -0
- package/dist/pi-extension/subagents/persistent.js +322 -0
- package/dist/pi-extension/subagents/persistent.js.map +1 -0
- package/dist/pi-extension/subagents/presentation-hooks.d.ts +25 -0
- package/dist/pi-extension/subagents/presentation-hooks.d.ts.map +1 -0
- package/dist/pi-extension/subagents/presentation-hooks.js +2 -0
- package/dist/pi-extension/subagents/presentation-hooks.js.map +1 -0
- package/dist/pi-extension/subagents/presentation.d.ts +149 -0
- package/dist/pi-extension/subagents/presentation.d.ts.map +1 -0
- package/dist/pi-extension/subagents/presentation.js +419 -0
- package/dist/pi-extension/subagents/presentation.js.map +1 -0
- package/dist/pi-extension/subagents/state.d.ts +183 -0
- package/dist/pi-extension/subagents/state.d.ts.map +1 -0
- package/dist/pi-extension/subagents/state.js +92 -0
- package/dist/pi-extension/subagents/state.js.map +1 -0
- package/dist/pi-extension/subagents/task-models.d.ts +9 -0
- package/dist/pi-extension/subagents/task-models.d.ts.map +1 -0
- package/dist/pi-extension/subagents/task-models.js +293 -0
- package/dist/pi-extension/subagents/task-models.js.map +1 -0
- package/dist/pi-extension/subagents/tool-boundary.d.ts +16 -0
- package/dist/pi-extension/subagents/tool-boundary.d.ts.map +1 -0
- package/dist/pi-extension/subagents/tool-boundary.js +53 -0
- package/dist/pi-extension/subagents/tool-boundary.js.map +1 -0
- package/dist/pi-extension/subagents/worktree-tools.d.ts +16 -0
- package/dist/pi-extension/subagents/worktree-tools.d.ts.map +1 -0
- package/dist/pi-extension/subagents/worktree-tools.js +185 -0
- package/dist/pi-extension/subagents/worktree-tools.js.map +1 -0
- package/dist/provenance.json +5 -0
- package/package.json +540 -27
- package/index.d.ts +0 -1
- package/index.js +0 -2
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { isBoolean, isRecord } from "./type-guards.js";
|
|
4
|
+
function invalid(source, message) {
|
|
5
|
+
throw new Error(`Invalid outcomeLedger config in ${source}: ${message}`);
|
|
6
|
+
}
|
|
7
|
+
/** `outcomeLedger` is on unless set to `false`; any non-boolean is rejected. */
|
|
8
|
+
export function parseOutcomeLedgerConfig(rawConfig, source = "config.json") {
|
|
9
|
+
if (!isRecord(rawConfig))
|
|
10
|
+
invalid(source, "root must be an object");
|
|
11
|
+
if (!Object.hasOwn(rawConfig, "outcomeLedger"))
|
|
12
|
+
return { enabled: true };
|
|
13
|
+
if (!isBoolean(rawConfig.outcomeLedger))
|
|
14
|
+
invalid(source, "outcomeLedger must be true or false");
|
|
15
|
+
return { enabled: rawConfig.outcomeLedger };
|
|
16
|
+
}
|
|
17
|
+
export function loadOutcomeLedgerConfig(configDir, examplePath) {
|
|
18
|
+
const configPath = join(configDir, "config.json");
|
|
19
|
+
let sourcePath = configPath;
|
|
20
|
+
let rawConfig;
|
|
21
|
+
try {
|
|
22
|
+
rawConfig = readFileSync(configPath, "utf8");
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
// SAFETY: readFileSync only throws Node fs errors here, which carry code.
|
|
26
|
+
if (error.code !== "ENOENT")
|
|
27
|
+
throw error;
|
|
28
|
+
sourcePath = examplePath;
|
|
29
|
+
try {
|
|
30
|
+
rawConfig = readFileSync(examplePath, "utf8");
|
|
31
|
+
}
|
|
32
|
+
catch (exampleError) {
|
|
33
|
+
// SAFETY: readFileSync only throws Node fs errors here, which carry code.
|
|
34
|
+
if (exampleError.code === "ENOENT")
|
|
35
|
+
return { enabled: true };
|
|
36
|
+
throw exampleError;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
return parseOutcomeLedgerConfig(JSON.parse(rawConfig), sourcePath);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (error instanceof SyntaxError) {
|
|
44
|
+
throw new Error(`Invalid JSON in subagent config ${sourcePath}: ${error.message}`);
|
|
45
|
+
}
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=outcome-ledger-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome-ledger-config.js","sourceRoot":"","sources":["../../../../maestro/core/config/outcome-ledger-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAOvD,SAAS,OAAO,CAAC,MAAc,EAAE,OAAe;IAC/C,MAAM,IAAI,KAAK,CAAC,mCAAmC,MAAM,KAAK,OAAO,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,wBAAwB,CACvC,SAAc,EACd,MAAM,GAAG,aAAa;IAEtB,IAAI,CAAC,QAAQ,CAAC,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E,CAAC;YAClC,MAAM,IAAI,KAAK,CACd,mCAAmC,UAAU,KAAK,KAAK,CAAC,OAAO,EAAE,CACjE,CAAC;QACH,CAAC;QACD,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { isBoolean, isRecord } from \"./type-guards.ts\";\n\n/** Whether the parent appends one outcome-ledger line per model attempt. */\nexport interface OutcomeLedgerConfig {\n\tenabled: boolean;\n}\n\nfunction invalid(source: string, message: string): never {\n\tthrow new Error(`Invalid outcomeLedger config in ${source}: ${message}`);\n}\n\n/** `outcomeLedger` is on unless set to `false`; any non-boolean is rejected. */\nexport function parseOutcomeLedgerConfig(\n\trawConfig: any,\n\tsource = \"config.json\",\n): OutcomeLedgerConfig {\n\tif (!isRecord(rawConfig)) invalid(source, \"root must be an object\");\n\tif (!Object.hasOwn(rawConfig, \"outcomeLedger\")) return { enabled: true };\n\tif (!isBoolean(rawConfig.outcomeLedger))\n\t\tinvalid(source, \"outcomeLedger must be true or false\");\n\treturn { enabled: rawConfig.outcomeLedger };\n}\n\nexport function loadOutcomeLedgerConfig(\n\tconfigDir: string,\n\texamplePath: string,\n): OutcomeLedgerConfig {\n\tconst configPath = join(configDir, \"config.json\");\n\tlet sourcePath = configPath;\n\tlet rawConfig: string;\n\ttry {\n\t\trawConfig = readFileSync(configPath, \"utf8\");\n\t} catch (error) {\n\t\t// SAFETY: readFileSync only throws Node fs errors here, which carry code.\n\t\tif ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n\t\tsourcePath = examplePath;\n\t\ttry {\n\t\t\trawConfig = readFileSync(examplePath, \"utf8\");\n\t\t} catch (exampleError) {\n\t\t\t// SAFETY: readFileSync only throws Node fs errors here, which carry code.\n\t\t\tif ((exampleError as NodeJS.ErrnoException).code === \"ENOENT\")\n\t\t\t\treturn { enabled: true };\n\t\t\tthrow exampleError;\n\t\t}\n\t}\n\ttry {\n\t\treturn parseOutcomeLedgerConfig(JSON.parse(rawConfig), sourcePath);\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid JSON in subagent config ${sourcePath}: ${error.message}`,\n\t\t\t);\n\t\t}\n\t\tthrow error;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type PaneMode = "grouped" | "tab" | "split";
|
|
2
|
+
export type PaneDirection = "right" | "down";
|
|
3
|
+
export interface PaneConfig {
|
|
4
|
+
mode: PaneMode;
|
|
5
|
+
direction: PaneDirection;
|
|
6
|
+
maxPerTab: number;
|
|
7
|
+
}
|
|
8
|
+
type PaneCreator = (name: string, cwd?: string) => string;
|
|
9
|
+
type SplitPaneCreator = (name: string, direction: PaneDirection, cwd?: string) => string;
|
|
10
|
+
type GroupedPaneCreator = (name: string, cwd: string, maxPerTab: number, direction: PaneDirection) => string;
|
|
11
|
+
export declare function parsePaneConfig(rawConfig: any, source?: string): PaneConfig;
|
|
12
|
+
export declare function loadPaneConfig(configDir: string, examplePath: string): PaneConfig;
|
|
13
|
+
export declare function createSubagentPaneFactory(config: PaneConfig, createTab: PaneCreator, createSplit: SplitPaneCreator, createGrouped?: GroupedPaneCreator): PaneCreator;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=pane-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pane-config.d.ts","sourceRoot":"","sources":["../../../../maestro/core/config/pane-config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,KAAK,GAAG,OAAO,CAAC;AACnD,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,KAAK,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAC1D,KAAK,gBAAgB,GAAG,CACvB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,aAAa,EACxB,GAAG,CAAC,EAAE,MAAM,KACR,MAAM,CAAC;AACZ,KAAK,kBAAkB,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,aAAa,KACpB,MAAM,CAAC;AAMZ,wBAAgB,eAAe,CAC9B,SAAS,EAAE,GAAG,EACd,MAAM,SAAgB,GACpB,UAAU,CA2DZ;AAuCD,wBAAgB,cAAc,CAC7B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GACjB,UAAU,CAWZ;AAED,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,WAAW,EACtB,WAAW,EAAE,gBAAgB,EAC7B,aAAa,CAAC,EAAE,kBAAkB,GAChC,WAAW,CAWb"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { isPlainObject, isString } from "./type-guards.js";
|
|
4
|
+
function invalidPaneConfig(source, message) {
|
|
5
|
+
throw new Error(`Invalid subagent pane config in ${source}: ${message}`);
|
|
6
|
+
}
|
|
7
|
+
export function parsePaneConfig(rawConfig, source = "config.json") {
|
|
8
|
+
if (!isPlainObject(rawConfig)) {
|
|
9
|
+
invalidPaneConfig(source, "root must be an object");
|
|
10
|
+
}
|
|
11
|
+
if (!Object.hasOwn(rawConfig, "panes")) {
|
|
12
|
+
return { mode: "grouped", direction: "right", maxPerTab: 4 };
|
|
13
|
+
}
|
|
14
|
+
if (!isPlainObject(rawConfig.panes)) {
|
|
15
|
+
invalidPaneConfig(source, "panes must be an object");
|
|
16
|
+
}
|
|
17
|
+
const unsupportedKeys = Object.keys(rawConfig.panes).filter((key) => key !== "mode" && key !== "direction" && key !== "maxPerTab");
|
|
18
|
+
if (unsupportedKeys.length > 0) {
|
|
19
|
+
invalidPaneConfig(source, `panes has unsupported key(s): ${unsupportedKeys.join(", ")}`);
|
|
20
|
+
}
|
|
21
|
+
let mode = "grouped";
|
|
22
|
+
if (Object.hasOwn(rawConfig.panes, "mode")) {
|
|
23
|
+
if (!isString(rawConfig.panes.mode) ||
|
|
24
|
+
(rawConfig.panes.mode !== "grouped" &&
|
|
25
|
+
rawConfig.panes.mode !== "tab" &&
|
|
26
|
+
rawConfig.panes.mode !== "split")) {
|
|
27
|
+
invalidPaneConfig(source, 'panes.mode must be "grouped", "tab", or "split"');
|
|
28
|
+
}
|
|
29
|
+
mode = rawConfig.panes.mode;
|
|
30
|
+
}
|
|
31
|
+
let direction = "right";
|
|
32
|
+
if (Object.hasOwn(rawConfig.panes, "direction")) {
|
|
33
|
+
if (!isString(rawConfig.panes.direction) ||
|
|
34
|
+
(rawConfig.panes.direction !== "right" &&
|
|
35
|
+
rawConfig.panes.direction !== "down")) {
|
|
36
|
+
invalidPaneConfig(source, 'panes.direction must be "right" or "down"');
|
|
37
|
+
}
|
|
38
|
+
direction = rawConfig.panes.direction;
|
|
39
|
+
}
|
|
40
|
+
const maxPerTab = Object.hasOwn(rawConfig.panes, "maxPerTab")
|
|
41
|
+
? rawConfig.panes.maxPerTab
|
|
42
|
+
: 4;
|
|
43
|
+
if (!Number.isSafeInteger(maxPerTab) || maxPerTab < 1) {
|
|
44
|
+
invalidPaneConfig(source, "panes.maxPerTab must be a positive safe integer");
|
|
45
|
+
}
|
|
46
|
+
return { mode, direction, maxPerTab };
|
|
47
|
+
}
|
|
48
|
+
function readPaneConfigFile(configPath, examplePath) {
|
|
49
|
+
try {
|
|
50
|
+
return {
|
|
51
|
+
sourcePath: configPath,
|
|
52
|
+
rawConfig: readFileSync(configPath, "utf8"),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
// SAFETY: readFileSync only throws Node fs errors here, which carry code.
|
|
57
|
+
const errno = error;
|
|
58
|
+
if (errno.code !== "ENOENT")
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
return {
|
|
63
|
+
sourcePath: examplePath,
|
|
64
|
+
rawConfig: readFileSync(examplePath, "utf8"),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
// SAFETY: see the preceding readFileSync error handling.
|
|
69
|
+
const errno = error;
|
|
70
|
+
if (errno.code === "ENOENT") {
|
|
71
|
+
throw new Error(`Missing subagent pane config. Expected ${configPath} or ${examplePath}.`);
|
|
72
|
+
}
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export function loadPaneConfig(configDir, examplePath) {
|
|
77
|
+
const configPath = join(configDir, "config.json");
|
|
78
|
+
const { sourcePath, rawConfig } = readPaneConfigFile(configPath, examplePath);
|
|
79
|
+
let parsed;
|
|
80
|
+
try {
|
|
81
|
+
parsed = JSON.parse(rawConfig);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
85
|
+
throw new Error(`Invalid JSON in subagent config ${sourcePath}: ${detail}`);
|
|
86
|
+
}
|
|
87
|
+
return parsePaneConfig(parsed, sourcePath);
|
|
88
|
+
}
|
|
89
|
+
export function createSubagentPaneFactory(config, createTab, createSplit, createGrouped) {
|
|
90
|
+
if (config.mode === "grouped") {
|
|
91
|
+
return (name, cwd = process.cwd()) => {
|
|
92
|
+
if (!createGrouped)
|
|
93
|
+
throw new Error("Grouped pane creation is unavailable");
|
|
94
|
+
return createGrouped(name, cwd, config.maxPerTab, config.direction);
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return config.mode === "split"
|
|
98
|
+
? (name, cwd) => createSplit(name, config.direction, cwd)
|
|
99
|
+
: createTab;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMapping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MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,MAAM,IAAI,KAAK,CAAC,mCAAmC,UAAU,KAAK,MAAM,EAAE,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,yBAAyB,CACxC,MAAkB,EAClB,SAAsB,EACtB,WAA6B,EAC7B,aAAkC;IAElC,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,EAAE;YACpC,IAAI,CAAC,aAAa;gBACjB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;YACzD,OAAO,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;QACrE,CAAC,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,KAAK,OAAO;QAC7B,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC;QACzD,CAAC,CAAC,SAAS,CAAC;AACd,CAAC","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { isPlainObject, isString } from \"./type-guards.ts\";\n\nexport type PaneMode = \"grouped\" | \"tab\" | \"split\";\nexport type PaneDirection = \"right\" | \"down\";\n\nexport interface PaneConfig {\n\tmode: PaneMode;\n\tdirection: PaneDirection;\n\tmaxPerTab: number;\n}\n\ntype PaneCreator = (name: string, cwd?: string) => string;\ntype SplitPaneCreator = (\n\tname: string,\n\tdirection: PaneDirection,\n\tcwd?: string,\n) => string;\ntype GroupedPaneCreator = (\n\tname: string,\n\tcwd: string,\n\tmaxPerTab: number,\n\tdirection: PaneDirection,\n) => string;\n\nfunction invalidPaneConfig(source: string, message: string): never {\n\tthrow new Error(`Invalid subagent pane config in ${source}: ${message}`);\n}\n\nexport function parsePaneConfig(\n\trawConfig: any,\n\tsource = \"config.json\",\n): PaneConfig {\n\tif (!isPlainObject(rawConfig)) {\n\t\tinvalidPaneConfig(source, \"root must be an object\");\n\t}\n\tif (!Object.hasOwn(rawConfig, \"panes\")) {\n\t\treturn { mode: \"grouped\", direction: \"right\", maxPerTab: 4 };\n\t}\n\tif (!isPlainObject(rawConfig.panes)) {\n\t\tinvalidPaneConfig(source, \"panes must be an object\");\n\t}\n\n\tconst unsupportedKeys = Object.keys(rawConfig.panes).filter(\n\t\t(key) => key !== \"mode\" && key !== \"direction\" && key !== \"maxPerTab\",\n\t);\n\tif (unsupportedKeys.length > 0) {\n\t\tinvalidPaneConfig(\n\t\t\tsource,\n\t\t\t`panes has unsupported key(s): ${unsupportedKeys.join(\", \")}`,\n\t\t);\n\t}\n\n\tlet mode: PaneMode = \"grouped\";\n\tif (Object.hasOwn(rawConfig.panes, \"mode\")) {\n\t\tif (\n\t\t\t!isString(rawConfig.panes.mode) ||\n\t\t\t(rawConfig.panes.mode !== \"grouped\" &&\n\t\t\t\trawConfig.panes.mode !== \"tab\" &&\n\t\t\t\trawConfig.panes.mode !== \"split\")\n\t\t) {\n\t\t\tinvalidPaneConfig(\n\t\t\t\tsource,\n\t\t\t\t'panes.mode must be \"grouped\", \"tab\", or \"split\"',\n\t\t\t);\n\t\t}\n\t\tmode = rawConfig.panes.mode;\n\t}\n\n\tlet direction: PaneDirection = \"right\";\n\tif (Object.hasOwn(rawConfig.panes, \"direction\")) {\n\t\tif (\n\t\t\t!isString(rawConfig.panes.direction) ||\n\t\t\t(rawConfig.panes.direction !== \"right\" &&\n\t\t\t\trawConfig.panes.direction !== \"down\")\n\t\t) {\n\t\t\tinvalidPaneConfig(source, 'panes.direction must be \"right\" or \"down\"');\n\t\t}\n\t\tdirection = rawConfig.panes.direction;\n\t}\n\n\tconst maxPerTab = Object.hasOwn(rawConfig.panes, \"maxPerTab\")\n\t\t? rawConfig.panes.maxPerTab\n\t\t: 4;\n\tif (!Number.isSafeInteger(maxPerTab) || maxPerTab < 1) {\n\t\tinvalidPaneConfig(\n\t\t\tsource,\n\t\t\t\"panes.maxPerTab must be a positive safe integer\",\n\t\t);\n\t}\n\treturn { mode, direction, maxPerTab };\n}\n\ninterface PaneConfigSource {\n\tsourcePath: string;\n\trawConfig: string;\n}\n\nfunction readPaneConfigFile(\n\tconfigPath: string,\n\texamplePath: string,\n): PaneConfigSource {\n\ttry {\n\t\treturn {\n\t\t\tsourcePath: configPath,\n\t\t\trawConfig: readFileSync(configPath, \"utf8\"),\n\t\t};\n\t} catch (error) {\n\t\t// SAFETY: readFileSync only throws Node fs errors here, which carry code.\n\t\tconst errno = error as NodeJS.ErrnoException;\n\t\tif (errno.code !== \"ENOENT\") throw error;\n\t}\n\n\ttry {\n\t\treturn {\n\t\t\tsourcePath: examplePath,\n\t\t\trawConfig: readFileSync(examplePath, \"utf8\"),\n\t\t};\n\t} catch (error) {\n\t\t// SAFETY: see the preceding readFileSync error handling.\n\t\tconst errno = error as NodeJS.ErrnoException;\n\t\tif (errno.code === \"ENOENT\") {\n\t\t\tthrow new Error(\n\t\t\t\t`Missing subagent pane config. Expected ${configPath} or ${examplePath}.`,\n\t\t\t);\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nexport function loadPaneConfig(\n\tconfigDir: string,\n\texamplePath: string,\n): PaneConfig {\n\tconst configPath = join(configDir, \"config.json\");\n\tconst { sourcePath, rawConfig } = readPaneConfigFile(configPath, examplePath);\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(rawConfig);\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tthrow new Error(`Invalid JSON in subagent config ${sourcePath}: ${detail}`);\n\t}\n\treturn parsePaneConfig(parsed, sourcePath);\n}\n\nexport function createSubagentPaneFactory(\n\tconfig: PaneConfig,\n\tcreateTab: PaneCreator,\n\tcreateSplit: SplitPaneCreator,\n\tcreateGrouped?: GroupedPaneCreator,\n): PaneCreator {\n\tif (config.mode === \"grouped\") {\n\t\treturn (name, cwd = process.cwd()) => {\n\t\t\tif (!createGrouped)\n\t\t\t\tthrow new Error(\"Grouped pane creation is unavailable\");\n\t\t\treturn createGrouped(name, cwd, config.maxPerTab, config.direction);\n\t\t};\n\t}\n\treturn config.mode === \"split\"\n\t\t? (name, cwd) => createSplit(name, config.direction, cwd)\n\t\t: createTab;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const DEFAULT_MAX_PERSISTENT_AGENTS = 3;
|
|
2
|
+
export interface PersistentConfig {
|
|
3
|
+
maxAgents: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function parsePersistentConfig(rawConfig: any, source?: string): PersistentConfig;
|
|
6
|
+
export declare function loadPersistentConfig(configDir: string, examplePath: string): PersistentConfig;
|
|
7
|
+
//# sourceMappingURL=persistent-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistent-config.d.ts","sourceRoot":"","sources":["../../../../maestro/core/config/persistent-config.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,MAAM,CAAC;CAClB;AAQD,wBAAgB,qBAAqB,CACpC,SAAS,EAAE,GAAG,EACd,MAAM,SAAgB,GACpB,gBAAgB,CAkClB;AAoCD,wBAAgB,oBAAoB,CACnC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GACjB,gBAAgB,CAclB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { isFiniteNumber, isRecord } from "./type-guards.js";
|
|
4
|
+
export const DEFAULT_MAX_PERSISTENT_AGENTS = 3;
|
|
5
|
+
function invalidPersistentConfig(source, message) {
|
|
6
|
+
throw new Error(`Invalid persistent specialist config in ${source}: ${message}`);
|
|
7
|
+
}
|
|
8
|
+
export function parsePersistentConfig(rawConfig, source = "config.json") {
|
|
9
|
+
if (!isRecord(rawConfig)) {
|
|
10
|
+
invalidPersistentConfig(source, "root must be an object");
|
|
11
|
+
}
|
|
12
|
+
if (!Object.hasOwn(rawConfig, "persistent")) {
|
|
13
|
+
return { maxAgents: DEFAULT_MAX_PERSISTENT_AGENTS };
|
|
14
|
+
}
|
|
15
|
+
if (!isRecord(rawConfig.persistent)) {
|
|
16
|
+
invalidPersistentConfig(source, "persistent must be an object");
|
|
17
|
+
}
|
|
18
|
+
const unsupported = Object.keys(rawConfig.persistent).filter((key) => key !== "maxAgents");
|
|
19
|
+
if (unsupported.length > 0) {
|
|
20
|
+
invalidPersistentConfig(source, `persistent has unsupported key(s): ${unsupported.join(", ")}`);
|
|
21
|
+
}
|
|
22
|
+
if (!Object.hasOwn(rawConfig.persistent, "maxAgents")) {
|
|
23
|
+
return { maxAgents: DEFAULT_MAX_PERSISTENT_AGENTS };
|
|
24
|
+
}
|
|
25
|
+
const { maxAgents } = rawConfig.persistent;
|
|
26
|
+
if (!isFiniteNumber(maxAgents) ||
|
|
27
|
+
!Number.isInteger(maxAgents) ||
|
|
28
|
+
maxAgents < 1) {
|
|
29
|
+
invalidPersistentConfig(source, "persistent.maxAgents must be a positive integer");
|
|
30
|
+
}
|
|
31
|
+
return { maxAgents };
|
|
32
|
+
}
|
|
33
|
+
function readPersistentConfigFile(configPath, examplePath) {
|
|
34
|
+
try {
|
|
35
|
+
return {
|
|
36
|
+
sourcePath: configPath,
|
|
37
|
+
rawConfig: readFileSync(configPath, "utf8"),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
// SAFETY: readFileSync only throws Node fs errors here, which carry code.
|
|
42
|
+
if (error.code !== "ENOENT")
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
return {
|
|
47
|
+
sourcePath: examplePath,
|
|
48
|
+
rawConfig: readFileSync(examplePath, "utf8"),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
// SAFETY: readFileSync only throws Node fs errors here, which carry code.
|
|
53
|
+
if (error.code === "ENOENT") {
|
|
54
|
+
throw new Error(`Missing persistent specialist config. Expected ${configPath} or ${examplePath}.`);
|
|
55
|
+
}
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export function loadPersistentConfig(configDir, examplePath) {
|
|
60
|
+
const configPath = join(configDir, "config.json");
|
|
61
|
+
const { sourcePath, rawConfig } = readPersistentConfigFile(configPath, examplePath);
|
|
62
|
+
let parsed;
|
|
63
|
+
try {
|
|
64
|
+
parsed = JSON.parse(rawConfig);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
68
|
+
throw new Error(`Invalid JSON in subagent config ${sourcePath}: ${detail}`);
|
|
69
|
+
}
|
|
70
|
+
return parsePersistentConfig(parsed, sourcePath);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=persistent-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistent-config.js","sourceRoot":"","sources":["../../../../maestro/core/config/persistent-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5D,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAM/C,SAAS,uBAAuB,CAAC,MAAc,EAAE,OAAe;IAC/D,MAAM,IAAI,KAAK,CACd,2CAA2C,MAAM,KA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AAC,CAAC;IAC7E,CAAC;IACD,OAAO,qBAAqB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { isFiniteNumber, isRecord } from \"./type-guards.ts\";\n\nexport const DEFAULT_MAX_PERSISTENT_AGENTS = 3;\n\nexport interface PersistentConfig {\n\tmaxAgents: number;\n}\n\nfunction invalidPersistentConfig(source: string, message: string): never {\n\tthrow new Error(\n\t\t`Invalid persistent specialist config in ${source}: ${message}`,\n\t);\n}\n\nexport function parsePersistentConfig(\n\trawConfig: any,\n\tsource = \"config.json\",\n): PersistentConfig {\n\tif (!isRecord(rawConfig)) {\n\t\tinvalidPersistentConfig(source, \"root must be an object\");\n\t}\n\tif (!Object.hasOwn(rawConfig, \"persistent\")) {\n\t\treturn { maxAgents: DEFAULT_MAX_PERSISTENT_AGENTS };\n\t}\n\tif (!isRecord(rawConfig.persistent)) {\n\t\tinvalidPersistentConfig(source, \"persistent must be an object\");\n\t}\n\tconst unsupported = Object.keys(rawConfig.persistent).filter(\n\t\t(key) => key !== \"maxAgents\",\n\t);\n\tif (unsupported.length > 0) {\n\t\tinvalidPersistentConfig(\n\t\t\tsource,\n\t\t\t`persistent has unsupported key(s): ${unsupported.join(\", \")}`,\n\t\t);\n\t}\n\tif (!Object.hasOwn(rawConfig.persistent, \"maxAgents\")) {\n\t\treturn { maxAgents: DEFAULT_MAX_PERSISTENT_AGENTS };\n\t}\n\tconst { maxAgents } = rawConfig.persistent;\n\tif (\n\t\t!isFiniteNumber(maxAgents) ||\n\t\t!Number.isInteger(maxAgents) ||\n\t\tmaxAgents < 1\n\t) {\n\t\tinvalidPersistentConfig(\n\t\t\tsource,\n\t\t\t\"persistent.maxAgents must be a positive integer\",\n\t\t);\n\t}\n\treturn { maxAgents };\n}\n\ninterface ConfigSource {\n\tsourcePath: string;\n\trawConfig: string;\n}\n\nfunction readPersistentConfigFile(\n\tconfigPath: string,\n\texamplePath: string,\n): ConfigSource {\n\ttry {\n\t\treturn {\n\t\t\tsourcePath: configPath,\n\t\t\trawConfig: readFileSync(configPath, \"utf8\"),\n\t\t};\n\t} catch (error) {\n\t\t// SAFETY: readFileSync only throws Node fs errors here, which carry code.\n\t\tif ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n\t}\n\ttry {\n\t\treturn {\n\t\t\tsourcePath: examplePath,\n\t\t\trawConfig: readFileSync(examplePath, \"utf8\"),\n\t\t};\n\t} catch (error) {\n\t\t// SAFETY: readFileSync only throws Node fs errors here, which carry code.\n\t\tif ((error as NodeJS.ErrnoException).code === \"ENOENT\") {\n\t\t\tthrow new Error(\n\t\t\t\t`Missing persistent specialist config. Expected ${configPath} or ${examplePath}.`,\n\t\t\t);\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nexport function loadPersistentConfig(\n\tconfigDir: string,\n\texamplePath: string,\n): PersistentConfig {\n\tconst configPath = join(configDir, \"config.json\");\n\tconst { sourcePath, rawConfig } = readPersistentConfigFile(\n\t\tconfigPath,\n\t\texamplePath,\n\t);\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(rawConfig);\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tthrow new Error(`Invalid JSON in subagent config ${sourcePath}: ${detail}`);\n\t}\n\treturn parsePersistentConfig(parsed, sourcePath);\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface RoleConfig {
|
|
2
|
+
/** Accepted no-op settings, each with actionable migration text. */
|
|
3
|
+
deprecations: string[];
|
|
4
|
+
}
|
|
5
|
+
export declare function parseRoleConfig(rawConfig: any, source?: string): RoleConfig;
|
|
6
|
+
export declare function loadRoleConfig(configDir: string, examplePath: string): RoleConfig;
|
|
7
|
+
//# sourceMappingURL=role-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role-config.d.ts","sourceRoot":"","sources":["../../../../maestro/core/config/role-config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IAC1B,oEAAoE;IACpE,YAAY,EAAE,MAAM,EAAE,CAAC;CACvB;AAMD,wBAAgB,eAAe,CAC9B,SAAS,EAAE,GAAG,EACd,MAAM,SAAgB,GACpB,UAAU,CA6BZ;AAuCD,wBAAgB,cAAc,CAC7B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GACjB,UAAU,CAWZ"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { isBoolean, isPlainObject } from "./type-guards.js";
|
|
4
|
+
function invalidRoleConfig(source, message) {
|
|
5
|
+
throw new Error(`Invalid subagent role config in ${source}: ${message}`);
|
|
6
|
+
}
|
|
7
|
+
export function parseRoleConfig(rawConfig, source = "config.json") {
|
|
8
|
+
if (!isPlainObject(rawConfig)) {
|
|
9
|
+
invalidRoleConfig(source, "root must be an object");
|
|
10
|
+
}
|
|
11
|
+
if (!Object.hasOwn(rawConfig, "roles"))
|
|
12
|
+
return { deprecations: [] };
|
|
13
|
+
if (!isPlainObject(rawConfig.roles)) {
|
|
14
|
+
invalidRoleConfig(source, "roles must be an object");
|
|
15
|
+
}
|
|
16
|
+
const unsupportedKeys = Object.keys(rawConfig.roles).filter((key) => key !== "bundled");
|
|
17
|
+
if (unsupportedKeys.length > 0) {
|
|
18
|
+
invalidRoleConfig(source, `roles has unsupported key(s): ${unsupportedKeys.join(", ")}`);
|
|
19
|
+
}
|
|
20
|
+
if (!Object.hasOwn(rawConfig.roles, "bundled"))
|
|
21
|
+
return { deprecations: [] };
|
|
22
|
+
if (!isBoolean(rawConfig.roles.bundled)) {
|
|
23
|
+
invalidRoleConfig(source, "roles.bundled must be a boolean");
|
|
24
|
+
}
|
|
25
|
+
// The host ships no roles, so both legacy booleans are no-ops. Never rewrite
|
|
26
|
+
// user configuration to remove the key.
|
|
27
|
+
return {
|
|
28
|
+
deprecations: [
|
|
29
|
+
`Deprecated setting roles.bundled (${rawConfig.roles.bundled}) in ${source} is ignored: pi-herdr-agents no longer ships bundled roles. Install a role pack or add global or project definitions for the roles you use, then remove roles.bundled. The file was not changed.`,
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function readRoleConfigFile(configPath, examplePath) {
|
|
34
|
+
try {
|
|
35
|
+
return {
|
|
36
|
+
sourcePath: configPath,
|
|
37
|
+
rawConfig: readFileSync(configPath, "utf8"),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
// SAFETY: readFileSync only throws Node fs errors here, which carry code.
|
|
42
|
+
const errno = error;
|
|
43
|
+
if (errno.code !== "ENOENT")
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
return {
|
|
48
|
+
sourcePath: examplePath,
|
|
49
|
+
rawConfig: readFileSync(examplePath, "utf8"),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
// SAFETY: see the preceding readFileSync error handling.
|
|
54
|
+
const errno = error;
|
|
55
|
+
if (errno.code === "ENOENT") {
|
|
56
|
+
throw new Error(`Missing subagent role config. Expected ${configPath} or ${examplePath}.`);
|
|
57
|
+
}
|
|
58
|
+
throw error;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export function loadRoleConfig(configDir, examplePath) {
|
|
62
|
+
const configPath = join(configDir, "config.json");
|
|
63
|
+
const { sourcePath, rawConfig } = readRoleConfigFile(configPath, examplePath);
|
|
64
|
+
let parsed;
|
|
65
|
+
try {
|
|
66
|
+
parsed = JSON.parse(rawConfig);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
70
|
+
throw new Error(`Invalid JSON in subagent config ${sourcePath}: ${detail}`);
|
|
71
|
+
}
|
|
72
|
+
return parseRoleConfig(parsed, sourcePath);
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=role-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role-config.js","sourceRoot":"","sources":["../../../../maestro/core/config/role-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAO5D,SAAS,iBAAiB,CAAC,MAAc,EAAE,OAAe;IACzD,MAAM,IAAI,KAAK,CAAC,mCAAmC,MAAM,KAAK,OAAO,EAAE,CAAC,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,eAAe,CAC9B,SAAc,EACd,MAAM,GAAG,aAAa;IAEtB,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;QAC/B,iBAAiB,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC;QAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IACpE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,iBAAiB,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM,CAC1D,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,SAAS,CAC1B,CAAC;IACF,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChC,iBAAiB,CAChB,MAAM,EACN,iCAAiC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC7D,CAAC;IACH,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,S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AAC,CAAC;IAClD,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,kBAAkB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAC9E,IAAI,MAAM,CAAC;IACX,IAAI,CAAC;QACJ,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,MAAM,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACtE,MAAM,IAAI,KAAK,CAAC,mCAAmC,UAAU,KAAK,MAAM,EAAE,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { isBoolean, isPlainObject } from \"./type-guards.ts\";\n\nexport interface RoleConfig {\n\t/** Accepted no-op settings, each with actionable migration text. */\n\tdeprecations: string[];\n}\n\nfunction invalidRoleConfig(source: string, message: string): never {\n\tthrow new Error(`Invalid subagent role config in ${source}: ${message}`);\n}\n\nexport function parseRoleConfig(\n\trawConfig: any,\n\tsource = \"config.json\",\n): RoleConfig {\n\tif (!isPlainObject(rawConfig)) {\n\t\tinvalidRoleConfig(source, \"root must be an object\");\n\t}\n\tif (!Object.hasOwn(rawConfig, \"roles\")) return { deprecations: [] };\n\tif (!isPlainObject(rawConfig.roles)) {\n\t\tinvalidRoleConfig(source, \"roles must be an object\");\n\t}\n\n\tconst unsupportedKeys = Object.keys(rawConfig.roles).filter(\n\t\t(key) => key !== \"bundled\",\n\t);\n\tif (unsupportedKeys.length > 0) {\n\t\tinvalidRoleConfig(\n\t\t\tsource,\n\t\t\t`roles has unsupported key(s): ${unsupportedKeys.join(\", \")}`,\n\t\t);\n\t}\n\tif (!Object.hasOwn(rawConfig.roles, \"bundled\")) return { deprecations: [] };\n\tif (!isBoolean(rawConfig.roles.bundled)) {\n\t\tinvalidRoleConfig(source, \"roles.bundled must be a boolean\");\n\t}\n\t// The host ships no roles, so both legacy booleans are no-ops. Never rewrite\n\t// user configuration to remove the key.\n\treturn {\n\t\tdeprecations: [\n\t\t\t`Deprecated setting roles.bundled (${rawConfig.roles.bundled}) in ${source} is ignored: pi-herdr-agents no longer ships bundled roles. Install a role pack or add global or project definitions for the roles you use, then remove roles.bundled. The file was not changed.`,\n\t\t],\n\t};\n}\n\ninterface RoleConfigSource {\n\tsourcePath: string;\n\trawConfig: string;\n}\n\nfunction readRoleConfigFile(\n\tconfigPath: string,\n\texamplePath: string,\n): RoleConfigSource {\n\ttry {\n\t\treturn {\n\t\t\tsourcePath: configPath,\n\t\t\trawConfig: readFileSync(configPath, \"utf8\"),\n\t\t};\n\t} catch (error) {\n\t\t// SAFETY: readFileSync only throws Node fs errors here, which carry code.\n\t\tconst errno = error as NodeJS.ErrnoException;\n\t\tif (errno.code !== \"ENOENT\") throw error;\n\t}\n\n\ttry {\n\t\treturn {\n\t\t\tsourcePath: examplePath,\n\t\t\trawConfig: readFileSync(examplePath, \"utf8\"),\n\t\t};\n\t} catch (error) {\n\t\t// SAFETY: see the preceding readFileSync error handling.\n\t\tconst errno = error as NodeJS.ErrnoException;\n\t\tif (errno.code === \"ENOENT\") {\n\t\t\tthrow new Error(\n\t\t\t\t`Missing subagent role config. Expected ${configPath} or ${examplePath}.`,\n\t\t\t);\n\t\t}\n\t\tthrow error;\n\t}\n}\n\nexport function loadRoleConfig(\n\tconfigDir: string,\n\texamplePath: string,\n): RoleConfig {\n\tconst configPath = join(configDir, \"config.json\");\n\tconst { sourcePath, rawConfig } = readRoleConfigFile(configPath, examplePath);\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(rawConfig);\n\t} catch (error) {\n\t\tconst detail = error instanceof Error ? error.message : String(error);\n\t\tthrow new Error(`Invalid JSON in subagent config ${sourcePath}: ${detail}`);\n\t}\n\treturn parseRoleConfig(parsed, sourcePath);\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface SpawningConfig {
|
|
2
|
+
/** Deepest child a launch may create; a top-level session is depth 0. */
|
|
3
|
+
maxDepth: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function parseSpawningConfig(rawConfig: any, source?: string): SpawningConfig;
|
|
6
|
+
export declare function loadSpawningConfig(configDir: string, examplePath: string): SpawningConfig;
|
|
7
|
+
//# sourceMappingURL=spawning-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawning-config.d.ts","sourceRoot":"","sources":["../../../../maestro/core/config/spawning-config.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,cAAc;IAC9B,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;CACjB;AAMD,wBAAgB,mBAAmB,CAClC,SAAS,EAAE,GAAG,EACd,MAAM,SAAgB,GACpB,cAAc,CA6BhB;AAED,wBAAgB,kBAAkB,CACjC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GACjB,cAAc,CAgChB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { DEFAULT_MAX_DELEGATION_DEPTH } from "../delegation-depth.js";
|
|
4
|
+
import { isFiniteNumber, isRecord } from "./type-guards.js";
|
|
5
|
+
function invalid(source, message) {
|
|
6
|
+
throw new Error(`Invalid spawning config in ${source}: ${message}`);
|
|
7
|
+
}
|
|
8
|
+
export function parseSpawningConfig(rawConfig, source = "config.json") {
|
|
9
|
+
if (!isRecord(rawConfig))
|
|
10
|
+
invalid(source, "root must be an object");
|
|
11
|
+
if (!Object.hasOwn(rawConfig, "spawning")) {
|
|
12
|
+
return { maxDepth: DEFAULT_MAX_DELEGATION_DEPTH };
|
|
13
|
+
}
|
|
14
|
+
if (!isRecord(rawConfig.spawning)) {
|
|
15
|
+
invalid(source, "spawning must be an object");
|
|
16
|
+
}
|
|
17
|
+
const unsupported = Object.keys(rawConfig.spawning).filter((key) => key !== "maxDepth");
|
|
18
|
+
if (unsupported.length > 0) {
|
|
19
|
+
invalid(source, `spawning has unsupported key(s): ${unsupported.join(", ")}`);
|
|
20
|
+
}
|
|
21
|
+
if (!Object.hasOwn(rawConfig.spawning, "maxDepth")) {
|
|
22
|
+
return { maxDepth: DEFAULT_MAX_DELEGATION_DEPTH };
|
|
23
|
+
}
|
|
24
|
+
const { maxDepth } = rawConfig.spawning;
|
|
25
|
+
if (!isFiniteNumber(maxDepth) ||
|
|
26
|
+
!Number.isSafeInteger(maxDepth) ||
|
|
27
|
+
maxDepth < 1) {
|
|
28
|
+
invalid(source, "spawning.maxDepth must be a positive integer");
|
|
29
|
+
}
|
|
30
|
+
return { maxDepth };
|
|
31
|
+
}
|
|
32
|
+
export function loadSpawningConfig(configDir, examplePath) {
|
|
33
|
+
const configPath = join(configDir, "config.json");
|
|
34
|
+
let sourcePath = configPath;
|
|
35
|
+
let rawConfig;
|
|
36
|
+
try {
|
|
37
|
+
rawConfig = readFileSync(configPath, "utf8");
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
// SAFETY: readFileSync only throws Node fs errors here, which carry code.
|
|
41
|
+
if (error.code !== "ENOENT")
|
|
42
|
+
throw error;
|
|
43
|
+
sourcePath = examplePath;
|
|
44
|
+
try {
|
|
45
|
+
rawConfig = readFileSync(examplePath, "utf8");
|
|
46
|
+
}
|
|
47
|
+
catch (exampleError) {
|
|
48
|
+
// SAFETY: readFileSync only throws Node fs errors here, which carry code.
|
|
49
|
+
if (exampleError.code === "ENOENT") {
|
|
50
|
+
throw new Error(`Missing spawning config. Expected ${configPath} or ${examplePath}.`);
|
|
51
|
+
}
|
|
52
|
+
throw exampleError;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
return parseSpawningConfig(JSON.parse(rawConfig), sourcePath);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
if (error instanceof SyntaxError) {
|
|
60
|
+
throw new Error(`Invalid JSON in subagent config ${sourcePath}: ${error.message}`);
|
|
61
|
+
}
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=spawning-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawning-config.js","sourceRoot":"","sources":["../../../../maestro/core/config/spawning-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAO5D,SAAS,OAAO,CAAC,MAAc,EAAE,OAAe;IAC/C,MAAM,IAAI,KAAK,CAAC,8BAA8B,MAAM,KAAK,OAAO,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,mBAAmB,CAClC,SAAc,EACd,MAAM,GAAG,aAAa;IAEtB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IACpE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,CAAC;QAC3C,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,CAAC;IACnD,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnC,OAAO,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;IAC/C,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,MAAM,CACzD,CAAC,GAAG,EAAE,EAAE,CAAC,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,QAAQ,EAAE,CAAC;gBAC/D,MAAM,IAAI,KAAK,CACd,qCAAqC,UAAU,OAAO,WAAW,GAAG,CACpE,CAAC;YACH,CAAC;YACD,MAAM,YAAY,CAAC;QACpB,CAAC;IACF,CAAC;IACD,IAAI,CAAC;QACJ,OAAO,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CACd,mCAAmC,UAAU,KAAK,KAAK,CAAC,OAAO,EAAE,CACjE,CAAC;QACH,CAAC;QACD,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { DEFAULT_MAX_DELEGATION_DEPTH } from \"../delegation-depth.ts\";\nimport { isFiniteNumber, isRecord } from \"./type-guards.ts\";\n\nexport interface SpawningConfig {\n\t/** Deepest child a launch may create; a top-level session is depth 0. */\n\tmaxDepth: number;\n}\n\nfunction invalid(source: string, message: string): never {\n\tthrow new Error(`Invalid spawning config in ${source}: ${message}`);\n}\n\nexport function parseSpawningConfig(\n\trawConfig: any,\n\tsource = \"config.json\",\n): SpawningConfig {\n\tif (!isRecord(rawConfig)) invalid(source, \"root must be an object\");\n\tif (!Object.hasOwn(rawConfig, \"spawning\")) {\n\t\treturn { maxDepth: DEFAULT_MAX_DELEGATION_DEPTH };\n\t}\n\tif (!isRecord(rawConfig.spawning)) {\n\t\tinvalid(source, \"spawning must be an object\");\n\t}\n\tconst unsupported = Object.keys(rawConfig.spawning).filter(\n\t\t(key) => key !== \"maxDepth\",\n\t);\n\tif (unsupported.length > 0) {\n\t\tinvalid(\n\t\t\tsource,\n\t\t\t`spawning has unsupported key(s): ${unsupported.join(\", \")}`,\n\t\t);\n\t}\n\tif (!Object.hasOwn(rawConfig.spawning, \"maxDepth\")) {\n\t\treturn { maxDepth: DEFAULT_MAX_DELEGATION_DEPTH };\n\t}\n\tconst { maxDepth } = rawConfig.spawning;\n\tif (\n\t\t!isFiniteNumber(maxDepth) ||\n\t\t!Number.isSafeInteger(maxDepth) ||\n\t\tmaxDepth < 1\n\t) {\n\t\tinvalid(source, \"spawning.maxDepth must be a positive integer\");\n\t}\n\treturn { maxDepth };\n}\n\nexport function loadSpawningConfig(\n\tconfigDir: string,\n\texamplePath: string,\n): SpawningConfig {\n\tconst configPath = join(configDir, \"config.json\");\n\tlet sourcePath = configPath;\n\tlet rawConfig: string;\n\ttry {\n\t\trawConfig = readFileSync(configPath, \"utf8\");\n\t} catch (error) {\n\t\t// SAFETY: readFileSync only throws Node fs errors here, which carry code.\n\t\tif ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n\t\tsourcePath = examplePath;\n\t\ttry {\n\t\t\trawConfig = readFileSync(examplePath, \"utf8\");\n\t\t} catch (exampleError) {\n\t\t\t// SAFETY: readFileSync only throws Node fs errors here, which carry code.\n\t\t\tif ((exampleError as NodeJS.ErrnoException).code === \"ENOENT\") {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Missing spawning config. Expected ${configPath} or ${examplePath}.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthrow exampleError;\n\t\t}\n\t}\n\ttry {\n\t\treturn parseSpawningConfig(JSON.parse(rawConfig), sourcePath);\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid JSON in subagent config ${sourcePath}: ${error.message}`,\n\t\t\t);\n\t\t}\n\t\tthrow error;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface SupervisionConfig {
|
|
2
|
+
forcePolling: boolean;
|
|
3
|
+
hangWarningMinutes: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function parseSupervisionConfig(rawConfig: any, source?: string): SupervisionConfig;
|
|
6
|
+
export declare function loadSupervisionConfig(configDir: string, examplePath: string): SupervisionConfig;
|
|
7
|
+
//# sourceMappingURL=supervision-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supervision-config.d.ts","sourceRoot":"","sources":["../../../../maestro/core/config/supervision-config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,iBAAiB;IACjC,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AAQD,wBAAgB,sBAAsB,CACrC,SAAS,EAAE,GAAG,EACd,MAAM,SAAgB,GACpB,iBAAiB,CAwCnB;AAED,wBAAgB,qBAAqB,CACpC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,GACjB,iBAAiB,CAgCnB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { isBoolean, isFiniteNumber, isRecord } from "./type-guards.js";
|
|
4
|
+
function invalid(source, message) {
|
|
5
|
+
throw new Error(`Invalid subagent supervision config in ${source}: ${message}`);
|
|
6
|
+
}
|
|
7
|
+
export function parseSupervisionConfig(rawConfig, source = "config.json") {
|
|
8
|
+
if (!isRecord(rawConfig))
|
|
9
|
+
invalid(source, "root must be an object");
|
|
10
|
+
if (!Object.hasOwn(rawConfig, "supervision")) {
|
|
11
|
+
return { forcePolling: false, hangWarningMinutes: 15 };
|
|
12
|
+
}
|
|
13
|
+
if (!isRecord(rawConfig.supervision)) {
|
|
14
|
+
invalid(source, "supervision must be an object");
|
|
15
|
+
}
|
|
16
|
+
const unsupported = Object.keys(rawConfig.supervision).filter((key) => key !== "forcePolling" && key !== "hangWarningMinutes");
|
|
17
|
+
if (unsupported.length > 0) {
|
|
18
|
+
invalid(source, `supervision has unsupported key(s): ${unsupported.join(", ")}`);
|
|
19
|
+
}
|
|
20
|
+
const forcePolling = Object.hasOwn(rawConfig.supervision, "forcePolling")
|
|
21
|
+
? rawConfig.supervision.forcePolling
|
|
22
|
+
: false;
|
|
23
|
+
if (!isBoolean(forcePolling)) {
|
|
24
|
+
invalid(source, "supervision.forcePolling must be a boolean");
|
|
25
|
+
}
|
|
26
|
+
const hangWarningMinutes = Object.hasOwn(rawConfig.supervision, "hangWarningMinutes")
|
|
27
|
+
? rawConfig.supervision.hangWarningMinutes
|
|
28
|
+
: 15;
|
|
29
|
+
if (!isFiniteNumber(hangWarningMinutes) ||
|
|
30
|
+
!Number.isInteger(hangWarningMinutes) ||
|
|
31
|
+
hangWarningMinutes < 0) {
|
|
32
|
+
invalid(source, "supervision.hangWarningMinutes must be a non-negative integer");
|
|
33
|
+
}
|
|
34
|
+
return { forcePolling, hangWarningMinutes };
|
|
35
|
+
}
|
|
36
|
+
export function loadSupervisionConfig(configDir, examplePath) {
|
|
37
|
+
const configPath = join(configDir, "config.json");
|
|
38
|
+
let sourcePath = configPath;
|
|
39
|
+
let rawConfig;
|
|
40
|
+
try {
|
|
41
|
+
rawConfig = readFileSync(configPath, "utf8");
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
// SAFETY: readFileSync only throws Node fs errors here, which carry code.
|
|
45
|
+
if (error.code !== "ENOENT")
|
|
46
|
+
throw error;
|
|
47
|
+
sourcePath = examplePath;
|
|
48
|
+
try {
|
|
49
|
+
rawConfig = readFileSync(examplePath, "utf8");
|
|
50
|
+
}
|
|
51
|
+
catch (exampleError) {
|
|
52
|
+
// SAFETY: readFileSync only throws Node fs errors here, which carry code.
|
|
53
|
+
if (exampleError.code === "ENOENT") {
|
|
54
|
+
throw new Error(`Missing subagent supervision config. Expected ${configPath} or ${examplePath}.`);
|
|
55
|
+
}
|
|
56
|
+
throw exampleError;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
return parseSupervisionConfig(JSON.parse(rawConfig), sourcePath);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
if (error instanceof SyntaxError) {
|
|
64
|
+
throw new Error(`Invalid JSON in subagent config ${sourcePath}: ${error.message}`);
|
|
65
|
+
}
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=supervision-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supervision-config.js","sourceRoot":"","sources":["../../../../maestro/core/config/supervision-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAOvE,SAAS,OAAO,CAAC,MAAc,EAAE,OAAe;IAC/C,MAAM,IAAI,KAAK,CACd,0CAA0C,MAAM,KAAK,OAAO,EAAE,CAC9D,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CACrC,SAAc,EACd,MAAM,GAAG,aAAa;IAEtB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IACpE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,aAAa,CAAC,EAAE,CAAC;QAC9C,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC;IACxD,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;QACtC,OAAO,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC;IAClD,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,MAAM,CAC5D,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,cAAc,IAAI,GAAG,KAAK,oBAAoB,CAC/D,CAAC;IACF,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,E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QACzB,IAAI,CAAC;YACJ,SAAS,GAAG,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC/C,CAAC;QAAC,OAAO,YAAY,EAAE,CAAC;YACvB,0EAA0E;YAC1E,IAAK,YAAsC,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC/D,MAAM,IAAI,KAAK,CACd,iDAAiD,UAAU,OAAO,WAAW,GAAG,CAChF,CAAC;YACH,CAAC;YACD,MAAM,YAAY,CAAC;QACpB,CAAC;IACF,CAAC;IACD,IAAI,CAAC;QACJ,OAAO,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CACd,mCAAmC,UAAU,KAAK,KAAK,CAAC,OAAO,EAAE,CACjE,CAAC;QACH,CAAC;QACD,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { isBoolean, isFiniteNumber, isRecord } from \"./type-guards.ts\";\n\nexport interface SupervisionConfig {\n\tforcePolling: boolean;\n\thangWarningMinutes: number;\n}\n\nfunction invalid(source: string, message: string): never {\n\tthrow new Error(\n\t\t`Invalid subagent supervision config in ${source}: ${message}`,\n\t);\n}\n\nexport function parseSupervisionConfig(\n\trawConfig: any,\n\tsource = \"config.json\",\n): SupervisionConfig {\n\tif (!isRecord(rawConfig)) invalid(source, \"root must be an object\");\n\tif (!Object.hasOwn(rawConfig, \"supervision\")) {\n\t\treturn { forcePolling: false, hangWarningMinutes: 15 };\n\t}\n\tif (!isRecord(rawConfig.supervision)) {\n\t\tinvalid(source, \"supervision must be an object\");\n\t}\n\tconst unsupported = Object.keys(rawConfig.supervision).filter(\n\t\t(key) => key !== \"forcePolling\" && key !== \"hangWarningMinutes\",\n\t);\n\tif (unsupported.length > 0) {\n\t\tinvalid(\n\t\t\tsource,\n\t\t\t`supervision has unsupported key(s): ${unsupported.join(\", \")}`,\n\t\t);\n\t}\n\tconst forcePolling = Object.hasOwn(rawConfig.supervision, \"forcePolling\")\n\t\t? rawConfig.supervision.forcePolling\n\t\t: false;\n\tif (!isBoolean(forcePolling)) {\n\t\tinvalid(source, \"supervision.forcePolling must be a boolean\");\n\t}\n\tconst hangWarningMinutes = Object.hasOwn(\n\t\trawConfig.supervision,\n\t\t\"hangWarningMinutes\",\n\t)\n\t\t? rawConfig.supervision.hangWarningMinutes\n\t\t: 15;\n\tif (\n\t\t!isFiniteNumber(hangWarningMinutes) ||\n\t\t!Number.isInteger(hangWarningMinutes) ||\n\t\thangWarningMinutes < 0\n\t) {\n\t\tinvalid(\n\t\t\tsource,\n\t\t\t\"supervision.hangWarningMinutes must be a non-negative integer\",\n\t\t);\n\t}\n\treturn { forcePolling, hangWarningMinutes };\n}\n\nexport function loadSupervisionConfig(\n\tconfigDir: string,\n\texamplePath: string,\n): SupervisionConfig {\n\tconst configPath = join(configDir, \"config.json\");\n\tlet sourcePath = configPath;\n\tlet rawConfig: string;\n\ttry {\n\t\trawConfig = readFileSync(configPath, \"utf8\");\n\t} catch (error) {\n\t\t// SAFETY: readFileSync only throws Node fs errors here, which carry code.\n\t\tif ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error;\n\t\tsourcePath = examplePath;\n\t\ttry {\n\t\t\trawConfig = readFileSync(examplePath, \"utf8\");\n\t\t} catch (exampleError) {\n\t\t\t// SAFETY: readFileSync only throws Node fs errors here, which carry code.\n\t\t\tif ((exampleError as NodeJS.ErrnoException).code === \"ENOENT\") {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Missing subagent supervision config. Expected ${configPath} or ${examplePath}.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tthrow exampleError;\n\t\t}\n\t}\n\ttry {\n\t\treturn parseSupervisionConfig(JSON.parse(rawConfig), sourcePath);\n\t} catch (error) {\n\t\tif (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid JSON in subagent config ${sourcePath}: ${error.message}`,\n\t\t\t);\n\t\t}\n\t\tthrow error;\n\t}\n}\n"]}
|