@llblab/pi-kit 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/AGENTS.md +35 -0
- package/BACKLOG.md +3 -0
- package/CHANGELOG.md +9 -0
- package/LICENSE +21 -0
- package/README.md +43 -0
- package/node_modules/@llblab/pi-actors/AGENTS.md +150 -0
- package/node_modules/@llblab/pi-actors/BACKLOG.md +6 -0
- package/node_modules/@llblab/pi-actors/CHANGELOG.md +865 -0
- package/node_modules/@llblab/pi-actors/README.md +231 -0
- package/node_modules/@llblab/pi-actors/banner.jpg +0 -0
- package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/artifact-manifest.json +9 -0
- package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/control-endpoint.json +6 -0
- package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/control-record.json +9 -0
- package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/recipe-summary.json +8 -0
- package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/run-state.json +10 -0
- package/node_modules/@llblab/pi-actors/dist/fixtures/protocol/trace-event.json +9 -0
- package/node_modules/@llblab/pi-actors/dist/index.d.ts +7 -0
- package/node_modules/@llblab/pi-actors/dist/index.js +17 -0
- package/node_modules/@llblab/pi-actors/dist/lib/async-runs.d.ts +146 -0
- package/node_modules/@llblab/pi-actors/dist/lib/async-runs.js +800 -0
- package/node_modules/@llblab/pi-actors/dist/lib/automatic-review-runtime.d.ts +20 -0
- package/node_modules/@llblab/pi-actors/dist/lib/automatic-review-runtime.js +103 -0
- package/node_modules/@llblab/pi-actors/dist/lib/command-templates.d.ts +85 -0
- package/node_modules/@llblab/pi-actors/dist/lib/command-templates.js +804 -0
- package/node_modules/@llblab/pi-actors/dist/lib/config.d.ts +34 -0
- package/node_modules/@llblab/pi-actors/dist/lib/config.js +216 -0
- package/node_modules/@llblab/pi-actors/dist/lib/control-projection.d.ts +20 -0
- package/node_modules/@llblab/pi-actors/dist/lib/control-projection.js +66 -0
- package/node_modules/@llblab/pi-actors/dist/lib/control.d.ts +15 -0
- package/node_modules/@llblab/pi-actors/dist/lib/control.js +97 -0
- package/node_modules/@llblab/pi-actors/dist/lib/draft-consolidation-transaction.d.ts +65 -0
- package/node_modules/@llblab/pi-actors/dist/lib/draft-consolidation-transaction.js +610 -0
- package/node_modules/@llblab/pi-actors/dist/lib/draft-consolidation.d.ts +35 -0
- package/node_modules/@llblab/pi-actors/dist/lib/draft-consolidation.js +126 -0
- package/node_modules/@llblab/pi-actors/dist/lib/draft-review.d.ts +56 -0
- package/node_modules/@llblab/pi-actors/dist/lib/draft-review.js +254 -0
- package/node_modules/@llblab/pi-actors/dist/lib/draft-sleep.d.ts +65 -0
- package/node_modules/@llblab/pi-actors/dist/lib/draft-sleep.js +467 -0
- package/node_modules/@llblab/pi-actors/dist/lib/execution-output.d.ts +25 -0
- package/node_modules/@llblab/pi-actors/dist/lib/execution-output.js +88 -0
- package/node_modules/@llblab/pi-actors/dist/lib/execution-sessions.d.ts +17 -0
- package/node_modules/@llblab/pi-actors/dist/lib/execution-sessions.js +85 -0
- package/node_modules/@llblab/pi-actors/dist/lib/execution.d.ts +99 -0
- package/node_modules/@llblab/pi-actors/dist/lib/execution.js +725 -0
- package/node_modules/@llblab/pi-actors/dist/lib/extension-runtime.d.ts +21 -0
- package/node_modules/@llblab/pi-actors/dist/lib/extension-runtime.js +141 -0
- package/node_modules/@llblab/pi-actors/dist/lib/file-state.d.ts +18 -0
- package/node_modules/@llblab/pi-actors/dist/lib/file-state.js +310 -0
- package/node_modules/@llblab/pi-actors/dist/lib/identity.d.ts +9 -0
- package/node_modules/@llblab/pi-actors/dist/lib/identity.js +27 -0
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-actions.d.ts +16 -0
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-actions.js +57 -0
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-command.d.ts +7 -0
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-command.js +37 -0
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-overlay.d.ts +100 -0
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-overlay.js +824 -0
- package/node_modules/@llblab/pi-actors/dist/lib/inspector.d.ts +20 -0
- package/node_modules/@llblab/pi-actors/dist/lib/inspector.js +136 -0
- package/node_modules/@llblab/pi-actors/dist/lib/limits.d.ts +28 -0
- package/node_modules/@llblab/pi-actors/dist/lib/limits.js +28 -0
- package/node_modules/@llblab/pi-actors/dist/lib/model-context.d.ts +56 -0
- package/node_modules/@llblab/pi-actors/dist/lib/model-context.js +220 -0
- package/node_modules/@llblab/pi-actors/dist/lib/observability.d.ts +186 -0
- package/node_modules/@llblab/pi-actors/dist/lib/observability.js +951 -0
- package/node_modules/@llblab/pi-actors/dist/lib/paths.d.ts +27 -0
- package/node_modules/@llblab/pi-actors/dist/lib/paths.js +72 -0
- package/node_modules/@llblab/pi-actors/dist/lib/pi.d.ts +19 -0
- package/node_modules/@llblab/pi-actors/dist/lib/pi.js +21 -0
- package/node_modules/@llblab/pi-actors/dist/lib/preflight-diagnostics.d.ts +27 -0
- package/node_modules/@llblab/pi-actors/dist/lib/preflight-diagnostics.js +86 -0
- package/node_modules/@llblab/pi-actors/dist/lib/prompts.d.ts +24 -0
- package/node_modules/@llblab/pi-actors/dist/lib/prompts.js +49 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipe-control.d.ts +7 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipe-control.js +43 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipes-context.d.ts +36 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipes-context.js +197 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipes-discovery.d.ts +77 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipes-discovery.js +783 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipes-references.d.ts +113 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipes-references.js +1108 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipes-usage.d.ts +21 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipes-usage.js +494 -0
- package/node_modules/@llblab/pi-actors/dist/lib/registry.d.ts +67 -0
- package/node_modules/@llblab/pi-actors/dist/lib/registry.js +504 -0
- package/node_modules/@llblab/pi-actors/dist/lib/review-control.d.ts +14 -0
- package/node_modules/@llblab/pi-actors/dist/lib/review-control.js +110 -0
- package/node_modules/@llblab/pi-actors/dist/lib/review-diagnostics.d.ts +11 -0
- package/node_modules/@llblab/pi-actors/dist/lib/review-diagnostics.js +148 -0
- package/node_modules/@llblab/pi-actors/dist/lib/review-projection.d.ts +14 -0
- package/node_modules/@llblab/pi-actors/dist/lib/review-projection.js +166 -0
- package/node_modules/@llblab/pi-actors/dist/lib/run-evidence-policy.d.ts +95 -0
- package/node_modules/@llblab/pi-actors/dist/lib/run-evidence-policy.js +177 -0
- package/node_modules/@llblab/pi-actors/dist/lib/run-ui-runtime.d.ts +18 -0
- package/node_modules/@llblab/pi-actors/dist/lib/run-ui-runtime.js +125 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-artifacts.d.ts +21 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-artifacts.js +68 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-control-delivery.d.ts +28 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-control-delivery.js +150 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-control.d.ts +21 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-control.js +89 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-controls.d.ts +39 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-controls.js +283 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-identity.d.ts +5 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-identity.js +11 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-index.d.ts +27 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-index.js +142 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-ownership.d.ts +7 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-ownership.js +96 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-parent-teardown.d.ts +51 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-parent-teardown.js +172 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-process.d.ts +22 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-process.js +125 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-retention.d.ts +18 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-retention.js +108 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-start.d.ts +12 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-start.js +68 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-status.d.ts +10 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-status.js +68 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-trace.d.ts +48 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-trace.js +491 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runtime-identity.d.ts +7 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runtime-identity.js +35 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runtime-triage.d.ts +29 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runtime-triage.js +60 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runtime.d.ts +69 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runtime.js +339 -0
- package/node_modules/@llblab/pi-actors/dist/lib/schema.d.ts +60 -0
- package/node_modules/@llblab/pi-actors/dist/lib/schema.js +428 -0
- package/node_modules/@llblab/pi-actors/dist/lib/session-evidence.d.ts +45 -0
- package/node_modules/@llblab/pi-actors/dist/lib/session-evidence.js +204 -0
- package/node_modules/@llblab/pi-actors/dist/lib/state-readers.d.ts +21 -0
- package/node_modules/@llblab/pi-actors/dist/lib/state-readers.js +74 -0
- package/node_modules/@llblab/pi-actors/dist/lib/temp.d.ts +10 -0
- package/node_modules/@llblab/pi-actors/dist/lib/temp.js +90 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tool-review-lineage-transaction.d.ts +27 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tool-review-lineage-transaction.js +597 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tool-review-lineage.d.ts +24 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tool-review-lineage.js +98 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tool-review-scheduler.d.ts +80 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tool-review-scheduler.js +494 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tool-review-transaction.d.ts +50 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tool-review-transaction.js +362 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tool-review.d.ts +56 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tool-review.js +197 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-access.d.ts +19 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-access.js +44 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-inspect.d.ts +15 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-inspect.js +532 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-local.d.ts +17 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-local.js +191 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-message.d.ts +9 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-message.js +139 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-register.d.ts +18 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-register.js +41 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-response.d.ts +20 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-response.js +243 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-spawn.d.ts +15 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-spawn.js +133 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools.d.ts +28 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools.js +49 -0
- package/node_modules/@llblab/pi-actors/dist/lib/trace-projection.d.ts +22 -0
- package/node_modules/@llblab/pi-actors/dist/lib/trace-projection.js +231 -0
- package/node_modules/@llblab/pi-actors/dist/pi-actors/index.js +1 -0
- package/node_modules/@llblab/pi-actors/dist/scripts/async-runner.mjs +555 -0
- package/node_modules/@llblab/pi-actors/dist/scripts/build-dist.mjs +60 -0
- package/node_modules/@llblab/pi-actors/dist/scripts/conformance.mjs +63 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/SKILL.md +126 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/command-validate.json +13 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/jsonl-tail.json +10 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/recipe-validate.json +11 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/resource-locker-snapshot.json +11 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/resource-locker.json +25 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/run-ops-snapshot.json +15 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/run-state-files.json +13 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/recipes/run-summary.json +9 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/references/diagnostics.md +44 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/references/persistent-tools.md +76 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/references/recipes.md +51 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/references/runs.md +41 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/scripts/resource-locker.mjs +425 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/scripts/run-utils.mjs +164 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/scripts/validate-recipe.mjs +370 -0
- package/node_modules/@llblab/pi-actors/dist/skills/artifacts/SKILL.md +33 -0
- package/node_modules/@llblab/pi-actors/dist/skills/artifacts/recipes/bundle.json +77 -0
- package/node_modules/@llblab/pi-actors/dist/skills/artifacts/recipes/file-write.json +14 -0
- package/node_modules/@llblab/pi-actors/dist/skills/artifacts/recipes/manifest.json +14 -0
- package/node_modules/@llblab/pi-actors/dist/skills/artifacts/recipes/report.json +39 -0
- package/node_modules/@llblab/pi-actors/dist/skills/artifacts/recipes/write.json +53 -0
- package/node_modules/@llblab/pi-actors/dist/skills/artifacts/scripts/artifact-utils.mjs +63 -0
- package/node_modules/@llblab/pi-actors/dist/skills/music-player/SKILL.md +57 -0
- package/node_modules/@llblab/pi-actors/dist/skills/music-player/genapps/music-player.mjs +360 -0
- package/node_modules/@llblab/pi-actors/dist/skills/music-player/recipes/playback.json +29 -0
- package/node_modules/@llblab/pi-actors/dist/skills/music-player/scripts/playback-client.mjs +143 -0
- package/node_modules/@llblab/pi-actors/dist/skills/music-player/scripts/playback.mjs +1446 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/SKILL.md +37 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/changelog-head.json +11 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/changelog-section.json +11 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/docs-maintenance.json +66 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/git-log.json +11 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/git-status.json +9 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/markdown-index.json +14 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/package-summary.json +9 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/release-readiness.json +115 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/release-summary.json +74 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/repo-health.json +75 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/run-ops.json +56 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/recipes/skill-summary.json +11 -0
- package/node_modules/@llblab/pi-actors/dist/skills/project-work/scripts/project-utils.mjs +89 -0
- package/node_modules/@llblab/pi-actors/dist/skills/recipe-memory/SKILL.md +36 -0
- package/node_modules/@llblab/pi-actors/dist/skills/recipe-memory/recipes/draft-review.json +14 -0
- package/node_modules/@llblab/pi-actors/dist/skills/recipe-memory/recipes/tool-review.json +14 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/SKILL.md +84 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/architect.json +82 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/checkpoint-continuation.json +51 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/development-tasking.json +67 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/lens-review.json +63 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/quorum-review.json +65 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/research-synthesis.json +81 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/review-readiness.json +59 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-artifact.json +21 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-checkpoint.json +21 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-conflict-report.json +19 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-contradiction-map.json +20 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-critic.json +22 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-evidence-map.json +20 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-followup.json +21 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-judge.json +22 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-merge.json +24 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-normalize.json +20 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-plan.json +20 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-preflight.json +18 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-prompt.json +16 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-prompts.json +39 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-quorum.json +31 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-review-coordinator.json +170 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-review.json +26 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-task-card.json +22 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-tools.json +15 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/recipes/subagent-verify.json +23 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/references/development-swarm.md +189 -0
- package/node_modules/@llblab/pi-actors/dist/skills/swarm/references/review-swarms.md +115 -0
- package/node_modules/@llblab/pi-actors/docs/README.md +20 -0
- package/node_modules/@llblab/pi-actors/docs/actor-inspector.md +50 -0
- package/node_modules/@llblab/pi-actors/docs/async-runs.md +141 -0
- package/node_modules/@llblab/pi-actors/docs/command-templates.md +321 -0
- package/node_modules/@llblab/pi-actors/docs/recipe-library.md +89 -0
- package/node_modules/@llblab/pi-actors/docs/releasing.md +28 -0
- package/node_modules/@llblab/pi-actors/docs/template-recipes.md +175 -0
- package/node_modules/@llblab/pi-actors/docs/tool-registry.md +90 -0
- package/node_modules/@llblab/pi-actors/fixtures/protocol/artifact-manifest.json +9 -0
- package/node_modules/@llblab/pi-actors/fixtures/protocol/control-endpoint.json +6 -0
- package/node_modules/@llblab/pi-actors/fixtures/protocol/control-record.json +9 -0
- package/node_modules/@llblab/pi-actors/fixtures/protocol/recipe-summary.json +8 -0
- package/node_modules/@llblab/pi-actors/fixtures/protocol/run-state.json +10 -0
- package/node_modules/@llblab/pi-actors/fixtures/protocol/trace-event.json +9 -0
- package/node_modules/@llblab/pi-actors/index.ts +30 -0
- package/node_modules/@llblab/pi-actors/lib/async-runs.ts +1245 -0
- package/node_modules/@llblab/pi-actors/lib/automatic-review-runtime.ts +148 -0
- package/node_modules/@llblab/pi-actors/lib/command-templates.ts +1116 -0
- package/node_modules/@llblab/pi-actors/lib/config.ts +261 -0
- package/node_modules/@llblab/pi-actors/lib/control-projection.ts +105 -0
- package/node_modules/@llblab/pi-actors/lib/control.ts +117 -0
- package/node_modules/@llblab/pi-actors/lib/draft-consolidation-transaction.ts +821 -0
- package/node_modules/@llblab/pi-actors/lib/draft-consolidation.ts +181 -0
- package/node_modules/@llblab/pi-actors/lib/draft-review.ts +325 -0
- package/node_modules/@llblab/pi-actors/lib/draft-sleep.ts +575 -0
- package/node_modules/@llblab/pi-actors/lib/execution-output.ts +123 -0
- package/node_modules/@llblab/pi-actors/lib/execution-sessions.ts +111 -0
- package/node_modules/@llblab/pi-actors/lib/execution.ts +1153 -0
- package/node_modules/@llblab/pi-actors/lib/extension-runtime.ts +181 -0
- package/node_modules/@llblab/pi-actors/lib/file-state.ts +306 -0
- package/node_modules/@llblab/pi-actors/lib/identity.ts +29 -0
- package/node_modules/@llblab/pi-actors/lib/inspector-actions.ts +79 -0
- package/node_modules/@llblab/pi-actors/lib/inspector-command.ts +54 -0
- package/node_modules/@llblab/pi-actors/lib/inspector-overlay.ts +901 -0
- package/node_modules/@llblab/pi-actors/lib/inspector.ts +204 -0
- package/node_modules/@llblab/pi-actors/lib/limits.ts +29 -0
- package/node_modules/@llblab/pi-actors/lib/model-context.ts +359 -0
- package/node_modules/@llblab/pi-actors/lib/observability.ts +1337 -0
- package/node_modules/@llblab/pi-actors/lib/paths.ts +111 -0
- package/node_modules/@llblab/pi-actors/lib/pi.ts +47 -0
- package/node_modules/@llblab/pi-actors/lib/preflight-diagnostics.ts +132 -0
- package/node_modules/@llblab/pi-actors/lib/prompts.ts +69 -0
- package/node_modules/@llblab/pi-actors/lib/recipe-control.ts +52 -0
- package/node_modules/@llblab/pi-actors/lib/recipes-context.ts +268 -0
- package/node_modules/@llblab/pi-actors/lib/recipes-discovery.ts +1060 -0
- package/node_modules/@llblab/pi-actors/lib/recipes-references.ts +1598 -0
- package/node_modules/@llblab/pi-actors/lib/recipes-usage.ts +638 -0
- package/node_modules/@llblab/pi-actors/lib/registry.ts +806 -0
- package/node_modules/@llblab/pi-actors/lib/review-control.ts +136 -0
- package/node_modules/@llblab/pi-actors/lib/review-diagnostics.ts +164 -0
- package/node_modules/@llblab/pi-actors/lib/review-projection.ts +196 -0
- package/node_modules/@llblab/pi-actors/lib/run-evidence-policy.ts +242 -0
- package/node_modules/@llblab/pi-actors/lib/run-ui-runtime.ts +155 -0
- package/node_modules/@llblab/pi-actors/lib/runs-artifacts.ts +96 -0
- package/node_modules/@llblab/pi-actors/lib/runs-control-delivery.ts +209 -0
- package/node_modules/@llblab/pi-actors/lib/runs-control.ts +148 -0
- package/node_modules/@llblab/pi-actors/lib/runs-controls.ts +282 -0
- package/node_modules/@llblab/pi-actors/lib/runs-identity.ts +14 -0
- package/node_modules/@llblab/pi-actors/lib/runs-index.ts +192 -0
- package/node_modules/@llblab/pi-actors/lib/runs-ownership.ts +136 -0
- package/node_modules/@llblab/pi-actors/lib/runs-parent-teardown.ts +257 -0
- package/node_modules/@llblab/pi-actors/lib/runs-process.ts +174 -0
- package/node_modules/@llblab/pi-actors/lib/runs-retention.ts +140 -0
- package/node_modules/@llblab/pi-actors/lib/runs-start.ts +113 -0
- package/node_modules/@llblab/pi-actors/lib/runs-status.ts +101 -0
- package/node_modules/@llblab/pi-actors/lib/runs-trace.ts +611 -0
- package/node_modules/@llblab/pi-actors/lib/runtime-identity.ts +39 -0
- package/node_modules/@llblab/pi-actors/lib/runtime-triage.ts +106 -0
- package/node_modules/@llblab/pi-actors/lib/runtime.ts +430 -0
- package/node_modules/@llblab/pi-actors/lib/schema.ts +525 -0
- package/node_modules/@llblab/pi-actors/lib/session-evidence.ts +302 -0
- package/node_modules/@llblab/pi-actors/lib/state-readers.ts +93 -0
- package/node_modules/@llblab/pi-actors/lib/temp.ts +99 -0
- package/node_modules/@llblab/pi-actors/lib/tool-review-lineage-transaction.ts +881 -0
- package/node_modules/@llblab/pi-actors/lib/tool-review-lineage.ts +145 -0
- package/node_modules/@llblab/pi-actors/lib/tool-review-scheduler.ts +635 -0
- package/node_modules/@llblab/pi-actors/lib/tool-review-transaction.ts +563 -0
- package/node_modules/@llblab/pi-actors/lib/tool-review.ts +270 -0
- package/node_modules/@llblab/pi-actors/lib/tools-access.ts +68 -0
- package/node_modules/@llblab/pi-actors/lib/tools-inspect.ts +673 -0
- package/node_modules/@llblab/pi-actors/lib/tools-local.ts +303 -0
- package/node_modules/@llblab/pi-actors/lib/tools-message.ts +176 -0
- package/node_modules/@llblab/pi-actors/lib/tools-register.ts +63 -0
- package/node_modules/@llblab/pi-actors/lib/tools-response.ts +285 -0
- package/node_modules/@llblab/pi-actors/lib/tools-spawn.ts +212 -0
- package/node_modules/@llblab/pi-actors/lib/tools.ts +88 -0
- package/node_modules/@llblab/pi-actors/lib/trace-projection.ts +306 -0
- package/node_modules/@llblab/pi-actors/package.json +76 -0
- package/node_modules/@llblab/pi-actors/scripts/async-runner.mjs +555 -0
- package/node_modules/@llblab/pi-actors/scripts/build-dist.mjs +60 -0
- package/node_modules/@llblab/pi-actors/scripts/conformance.mjs +63 -0
- package/node_modules/@llblab/pi-actors/skills/actors/SKILL.md +126 -0
- package/node_modules/@llblab/pi-actors/skills/actors/recipes/command-validate.json +13 -0
- package/node_modules/@llblab/pi-actors/skills/actors/recipes/jsonl-tail.json +10 -0
- package/node_modules/@llblab/pi-actors/skills/actors/recipes/recipe-validate.json +11 -0
- package/node_modules/@llblab/pi-actors/skills/actors/recipes/resource-locker-snapshot.json +11 -0
- package/node_modules/@llblab/pi-actors/skills/actors/recipes/resource-locker.json +25 -0
- package/node_modules/@llblab/pi-actors/skills/actors/recipes/run-ops-snapshot.json +15 -0
- package/node_modules/@llblab/pi-actors/skills/actors/recipes/run-state-files.json +13 -0
- package/node_modules/@llblab/pi-actors/skills/actors/recipes/run-summary.json +9 -0
- package/node_modules/@llblab/pi-actors/skills/actors/references/diagnostics.md +44 -0
- package/node_modules/@llblab/pi-actors/skills/actors/references/persistent-tools.md +76 -0
- package/node_modules/@llblab/pi-actors/skills/actors/references/recipes.md +51 -0
- package/node_modules/@llblab/pi-actors/skills/actors/references/runs.md +41 -0
- package/node_modules/@llblab/pi-actors/skills/actors/scripts/resource-locker.mjs +425 -0
- package/node_modules/@llblab/pi-actors/skills/actors/scripts/run-utils.mjs +164 -0
- package/node_modules/@llblab/pi-actors/skills/actors/scripts/validate-recipe.mjs +370 -0
- package/node_modules/@llblab/pi-actors/skills/artifacts/SKILL.md +33 -0
- package/node_modules/@llblab/pi-actors/skills/artifacts/recipes/bundle.json +77 -0
- package/node_modules/@llblab/pi-actors/skills/artifacts/recipes/file-write.json +14 -0
- package/node_modules/@llblab/pi-actors/skills/artifacts/recipes/manifest.json +14 -0
- package/node_modules/@llblab/pi-actors/skills/artifacts/recipes/report.json +39 -0
- package/node_modules/@llblab/pi-actors/skills/artifacts/recipes/write.json +53 -0
- package/node_modules/@llblab/pi-actors/skills/artifacts/scripts/artifact-utils.mjs +63 -0
- package/node_modules/@llblab/pi-actors/skills/music-player/SKILL.md +57 -0
- package/node_modules/@llblab/pi-actors/skills/music-player/genapps/music-player.mjs +360 -0
- package/node_modules/@llblab/pi-actors/skills/music-player/recipes/playback.json +29 -0
- package/node_modules/@llblab/pi-actors/skills/music-player/scripts/playback-client.mjs +143 -0
- package/node_modules/@llblab/pi-actors/skills/music-player/scripts/playback.mjs +1446 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/SKILL.md +37 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/changelog-head.json +11 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/changelog-section.json +11 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/docs-maintenance.json +66 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/git-log.json +11 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/git-status.json +9 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/markdown-index.json +14 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/package-summary.json +9 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/release-readiness.json +115 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/release-summary.json +74 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/repo-health.json +75 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/run-ops.json +56 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/recipes/skill-summary.json +11 -0
- package/node_modules/@llblab/pi-actors/skills/project-work/scripts/project-utils.mjs +89 -0
- package/node_modules/@llblab/pi-actors/skills/recipe-memory/SKILL.md +36 -0
- package/node_modules/@llblab/pi-actors/skills/recipe-memory/recipes/draft-review.json +14 -0
- package/node_modules/@llblab/pi-actors/skills/recipe-memory/recipes/tool-review.json +14 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/SKILL.md +84 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/architect.json +82 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/checkpoint-continuation.json +51 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/development-tasking.json +67 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/lens-review.json +63 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/quorum-review.json +65 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/research-synthesis.json +81 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/review-readiness.json +59 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-artifact.json +21 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-checkpoint.json +21 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-conflict-report.json +19 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-contradiction-map.json +20 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-critic.json +22 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-evidence-map.json +20 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-followup.json +21 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-judge.json +22 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-merge.json +24 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-normalize.json +20 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-plan.json +20 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-preflight.json +18 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-prompt.json +16 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-prompts.json +39 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-quorum.json +31 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-review-coordinator.json +170 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-review.json +26 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-task-card.json +22 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-tools.json +15 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/recipes/subagent-verify.json +23 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/references/development-swarm.md +189 -0
- package/node_modules/@llblab/pi-actors/skills/swarm/references/review-swarms.md +115 -0
- package/node_modules/@llblab/pi-codex-usage/AGENTS.md +17 -0
- package/node_modules/@llblab/pi-codex-usage/BACKLOG.md +8 -0
- package/node_modules/@llblab/pi-codex-usage/CHANGELOG.md +80 -0
- package/node_modules/@llblab/pi-codex-usage/LICENSE +22 -0
- package/node_modules/@llblab/pi-codex-usage/README.md +113 -0
- package/node_modules/@llblab/pi-codex-usage/banner.jpg +0 -0
- package/node_modules/@llblab/pi-codex-usage/index.ts +1525 -0
- package/node_modules/@llblab/pi-codex-usage/package.json +59 -0
- package/node_modules/@llblab/pi-grow-loop/AGENTS.md +56 -0
- package/node_modules/@llblab/pi-grow-loop/BACKLOG.md +3 -0
- package/node_modules/@llblab/pi-grow-loop/CHANGELOG.md +126 -0
- package/node_modules/@llblab/pi-grow-loop/README.md +216 -0
- package/node_modules/@llblab/pi-grow-loop/banner.jpg +0 -0
- package/node_modules/@llblab/pi-grow-loop/index.ts +219 -0
- package/node_modules/@llblab/pi-grow-loop/package.json +64 -0
- package/node_modules/@llblab/pi-grow-loop/skills/grow-loop/SKILL.md +131 -0
- package/node_modules/@llblab/pi-grow-loop/skills/while-true/SKILL.md +233 -0
- package/node_modules/@llblab/pi-telegram/AGENTS.md +157 -0
- package/node_modules/@llblab/pi-telegram/BACKLOG.md +15 -0
- package/node_modules/@llblab/pi-telegram/CHANGELOG.md +886 -0
- package/node_modules/@llblab/pi-telegram/README.md +330 -0
- package/node_modules/@llblab/pi-telegram/api/activity.ts +15 -0
- package/node_modules/@llblab/pi-telegram/api/commands.ts +11 -0
- package/node_modules/@llblab/pi-telegram/api/delivery.ts +21 -0
- package/node_modules/@llblab/pi-telegram/api/inbound.ts +14 -0
- package/node_modules/@llblab/pi-telegram/api/keyboard.ts +11 -0
- package/node_modules/@llblab/pi-telegram/api/outbound.ts +11 -0
- package/node_modules/@llblab/pi-telegram/api/sections.ts +17 -0
- package/node_modules/@llblab/pi-telegram/api/status.ts +12 -0
- package/node_modules/@llblab/pi-telegram/api/updates.ts +16 -0
- package/node_modules/@llblab/pi-telegram/api/voice.ts +24 -0
- package/node_modules/@llblab/pi-telegram/docs/README.md +25 -0
- package/node_modules/@llblab/pi-telegram/docs/activity.md +304 -0
- package/node_modules/@llblab/pi-telegram/docs/architecture.md +418 -0
- package/node_modules/@llblab/pi-telegram/docs/callback-namespaces.md +48 -0
- package/node_modules/@llblab/pi-telegram/docs/command-templates.md +365 -0
- package/node_modules/@llblab/pi-telegram/docs/compact-matrix-literal.md +176 -0
- package/node_modules/@llblab/pi-telegram/docs/delivery.md +225 -0
- package/node_modules/@llblab/pi-telegram/docs/generative-apps.md +310 -0
- package/node_modules/@llblab/pi-telegram/docs/inbound.md +136 -0
- package/node_modules/@llblab/pi-telegram/docs/multi-instance-bus.md +467 -0
- package/node_modules/@llblab/pi-telegram/docs/outbound.md +193 -0
- package/node_modules/@llblab/pi-telegram/docs/public-api.md +599 -0
- package/node_modules/@llblab/pi-telegram/docs/sections.md +452 -0
- package/node_modules/@llblab/pi-telegram/docs/ui-style.md +256 -0
- package/node_modules/@llblab/pi-telegram/docs/updates.md +171 -0
- package/node_modules/@llblab/pi-telegram/docs/voice.md +217 -0
- package/node_modules/@llblab/pi-telegram/index.ts +1336 -0
- package/node_modules/@llblab/pi-telegram/lib/activity-verbosity.ts +714 -0
- package/node_modules/@llblab/pi-telegram/lib/activity.ts +782 -0
- package/node_modules/@llblab/pi-telegram/lib/agent-messages.ts +121 -0
- package/node_modules/@llblab/pi-telegram/lib/bindings.ts +1129 -0
- package/node_modules/@llblab/pi-telegram/lib/bus-api.ts +379 -0
- package/node_modules/@llblab/pi-telegram/lib/bus-follower.ts +1941 -0
- package/node_modules/@llblab/pi-telegram/lib/bus-leader.ts +2119 -0
- package/node_modules/@llblab/pi-telegram/lib/bus-transport.ts +244 -0
- package/node_modules/@llblab/pi-telegram/lib/bus.ts +2645 -0
- package/node_modules/@llblab/pi-telegram/lib/command-templates.ts +954 -0
- package/node_modules/@llblab/pi-telegram/lib/commands.ts +1854 -0
- package/node_modules/@llblab/pi-telegram/lib/config.ts +1143 -0
- package/node_modules/@llblab/pi-telegram/lib/delivery.ts +891 -0
- package/node_modules/@llblab/pi-telegram/lib/generative-app-worker.mjs +104 -0
- package/node_modules/@llblab/pi-telegram/lib/generative-apps.ts +958 -0
- package/node_modules/@llblab/pi-telegram/lib/inbound.ts +824 -0
- package/node_modules/@llblab/pi-telegram/lib/journal.ts +3140 -0
- package/node_modules/@llblab/pi-telegram/lib/keyboard.ts +59 -0
- package/node_modules/@llblab/pi-telegram/lib/lifecycle.ts +623 -0
- package/node_modules/@llblab/pi-telegram/lib/locks.ts +1422 -0
- package/node_modules/@llblab/pi-telegram/lib/logs.ts +393 -0
- package/node_modules/@llblab/pi-telegram/lib/media.ts +921 -0
- package/node_modules/@llblab/pi-telegram/lib/menu-model.ts +1182 -0
- package/node_modules/@llblab/pi-telegram/lib/menu-queue.ts +926 -0
- package/node_modules/@llblab/pi-telegram/lib/menu-settings.ts +876 -0
- package/node_modules/@llblab/pi-telegram/lib/menu-status.ts +274 -0
- package/node_modules/@llblab/pi-telegram/lib/menu-thinking.ts +185 -0
- package/node_modules/@llblab/pi-telegram/lib/menu.ts +867 -0
- package/node_modules/@llblab/pi-telegram/lib/model.ts +672 -0
- package/node_modules/@llblab/pi-telegram/lib/outbound-attachments.ts +981 -0
- package/node_modules/@llblab/pi-telegram/lib/outbound-buttons.ts +331 -0
- package/node_modules/@llblab/pi-telegram/lib/outbound-markup.ts +515 -0
- package/node_modules/@llblab/pi-telegram/lib/outbound-voice.ts +285 -0
- package/node_modules/@llblab/pi-telegram/lib/outbound.ts +1007 -0
- package/node_modules/@llblab/pi-telegram/lib/ownership.ts +298 -0
- package/node_modules/@llblab/pi-telegram/lib/paths.ts +127 -0
- package/node_modules/@llblab/pi-telegram/lib/pi.ts +197 -0
- package/node_modules/@llblab/pi-telegram/lib/polling.ts +1588 -0
- package/node_modules/@llblab/pi-telegram/lib/preview.ts +846 -0
- package/node_modules/@llblab/pi-telegram/lib/prompt-templates.ts +158 -0
- package/node_modules/@llblab/pi-telegram/lib/prompts.ts +218 -0
- package/node_modules/@llblab/pi-telegram/lib/queue.ts +3075 -0
- package/node_modules/@llblab/pi-telegram/lib/recovery.ts +464 -0
- package/node_modules/@llblab/pi-telegram/lib/rendering.ts +1213 -0
- package/node_modules/@llblab/pi-telegram/lib/replies.ts +892 -0
- package/node_modules/@llblab/pi-telegram/lib/routing.ts +2889 -0
- package/node_modules/@llblab/pi-telegram/lib/runtime.ts +628 -0
- package/node_modules/@llblab/pi-telegram/lib/sections.ts +710 -0
- package/node_modules/@llblab/pi-telegram/lib/setup.ts +220 -0
- package/node_modules/@llblab/pi-telegram/lib/skills.ts +21 -0
- package/node_modules/@llblab/pi-telegram/lib/status.ts +1550 -0
- package/node_modules/@llblab/pi-telegram/lib/sync.ts +883 -0
- package/node_modules/@llblab/pi-telegram/lib/target.ts +49 -0
- package/node_modules/@llblab/pi-telegram/lib/telegram-api.ts +1747 -0
- package/node_modules/@llblab/pi-telegram/lib/text-groups.ts +487 -0
- package/node_modules/@llblab/pi-telegram/lib/thread-reconciler.ts +1002 -0
- package/node_modules/@llblab/pi-telegram/lib/threads.ts +3183 -0
- package/node_modules/@llblab/pi-telegram/lib/time-injection.ts +78 -0
- package/node_modules/@llblab/pi-telegram/lib/turns.ts +753 -0
- package/node_modules/@llblab/pi-telegram/lib/updates.ts +4950 -0
- package/node_modules/@llblab/pi-telegram/lib/voice.ts +340 -0
- package/node_modules/@llblab/pi-telegram/package.json +83 -0
- package/node_modules/@llblab/pi-telegram/screenshot.png +0 -0
- package/node_modules/@llblab/pi-telegram/scripts/check-downgrade.mjs +435 -0
- package/node_modules/@llblab/pi-telegram/skills/generated-control-surface/SKILL.md +241 -0
- package/node_modules/@llblab/pi-telegram/skills/generative-apps/SKILL.md +114 -0
- package/node_modules/@llblab/pi-telegram/skills/telegram-bridge/SKILL.md +149 -0
- package/package.json +67 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actor Inspector evidence readers.
|
|
3
|
+
* Zones: owned actor-instance inventory and captured Recipe projection
|
|
4
|
+
* Owns actor-instance TUI evidence; Trace, Control, and execution parsing stay in their domains.
|
|
5
|
+
*/
|
|
6
|
+
export interface ActorInspectorRunItem {
|
|
7
|
+
run: string;
|
|
8
|
+
runInstanceId?: string;
|
|
9
|
+
status: string;
|
|
10
|
+
updatedAt?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function readActorInspectorRuns(stateRoot: string, ownerId: string): ActorInspectorRunItem[];
|
|
13
|
+
export interface ActorInspectorRecipeView {
|
|
14
|
+
composition: Array<Record<string, unknown>>;
|
|
15
|
+
definition?: Record<string, unknown>;
|
|
16
|
+
diagnostics: string[];
|
|
17
|
+
identity: Record<string, unknown>;
|
|
18
|
+
launch: Record<string, unknown>;
|
|
19
|
+
}
|
|
20
|
+
export declare function readActorInspectorRecipe(stateDir: string): ActorInspectorRecipeView;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Actor Inspector evidence readers.
|
|
3
|
+
* Zones: owned actor-instance inventory and captured Recipe projection
|
|
4
|
+
* Owns actor-instance TUI evidence; Trace, Control, and execution parsing stay in their domains.
|
|
5
|
+
*/
|
|
6
|
+
import * as fs from "node:fs";
|
|
7
|
+
import * as path from "node:path";
|
|
8
|
+
import * as SessionEvidence from "./session-evidence.js";
|
|
9
|
+
import { readJsonFileResilient } from "./state-readers.js";
|
|
10
|
+
function matchesOwner(stateDir, ownerId) {
|
|
11
|
+
const meta = readJsonFileResilient(path.join(stateDir, "run.json"), {}).value;
|
|
12
|
+
return meta.ownerId === ownerId;
|
|
13
|
+
}
|
|
14
|
+
export function readActorInspectorRuns(stateRoot, ownerId) {
|
|
15
|
+
try {
|
|
16
|
+
return fs
|
|
17
|
+
.readdirSync(stateRoot, { withFileTypes: true })
|
|
18
|
+
.filter((entry) => entry.isDirectory())
|
|
19
|
+
.flatMap((entry) => {
|
|
20
|
+
const stateDir = path.join(stateRoot, entry.name);
|
|
21
|
+
if (!matchesOwner(stateDir, ownerId))
|
|
22
|
+
return [];
|
|
23
|
+
const runMeta = readJsonFileResilient(path.join(stateDir, "run.json"), {}).value;
|
|
24
|
+
const progress = readJsonFileResilient(path.join(stateDir, "progress.json"), {}).value;
|
|
25
|
+
const result = readJsonFileResilient(path.join(stateDir, "result.json"), {}).value;
|
|
26
|
+
return [{
|
|
27
|
+
run: entry.name,
|
|
28
|
+
...(typeof runMeta.run_instance_id === "string"
|
|
29
|
+
? { runInstanceId: runMeta.run_instance_id }
|
|
30
|
+
: {}),
|
|
31
|
+
status: String(progress.phase ??
|
|
32
|
+
(Object.keys(result).length ? "terminal" : "unknown")),
|
|
33
|
+
...(typeof progress.updatedAt === "string"
|
|
34
|
+
? { updatedAt: progress.updatedAt }
|
|
35
|
+
: typeof result.completedAt === "string"
|
|
36
|
+
? { updatedAt: result.completedAt }
|
|
37
|
+
: {}),
|
|
38
|
+
}];
|
|
39
|
+
})
|
|
40
|
+
.sort((left, right) => String(right.updatedAt ?? "").localeCompare(String(left.updatedAt ?? "")) ||
|
|
41
|
+
right.run.localeCompare(left.run));
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function readActorInspectorRecipe(stateDir) {
|
|
48
|
+
const result = readJsonFileResilient(path.join(stateDir, "run.json"), {});
|
|
49
|
+
const meta = result.value;
|
|
50
|
+
const contexts = Array.isArray(meta.recipe_context_records)
|
|
51
|
+
? meta.recipe_context_records.filter((entry) => Boolean(entry && typeof entry === "object" && !Array.isArray(entry)))
|
|
52
|
+
: [];
|
|
53
|
+
const primary = contexts.find((entry) => entry.depth === 0) ?? contexts[0];
|
|
54
|
+
const definition = primary?.recipe &&
|
|
55
|
+
typeof primary.recipe === "object" &&
|
|
56
|
+
!Array.isArray(primary.recipe)
|
|
57
|
+
? primary.recipe
|
|
58
|
+
: undefined;
|
|
59
|
+
const stripPrivateOrigins = (value) => {
|
|
60
|
+
if (Array.isArray(value))
|
|
61
|
+
return value.map(stripPrivateOrigins);
|
|
62
|
+
if (!value || typeof value !== "object")
|
|
63
|
+
return value;
|
|
64
|
+
return Object.fromEntries(Object.entries(value)
|
|
65
|
+
.filter(([key, entry]) => entry !== undefined &&
|
|
66
|
+
key !== "recipe_dir" &&
|
|
67
|
+
key !== "skill_dir" &&
|
|
68
|
+
key !== "source_file")
|
|
69
|
+
.map(([key, entry]) => [
|
|
70
|
+
key,
|
|
71
|
+
key === "actorRecipeContext" && entry && typeof entry === "object"
|
|
72
|
+
? stripPrivateOrigins(Object.fromEntries(Object.entries(entry).filter(([contextKey]) => contextKey !== "file")))
|
|
73
|
+
: stripPrivateOrigins(entry),
|
|
74
|
+
]));
|
|
75
|
+
};
|
|
76
|
+
const redactedRecord = (value) => SessionEvidence.redactSessionEvidenceValue(stripPrivateOrigins(value));
|
|
77
|
+
const primarySourceKind = primary?.source_kind === "active_skill_component"
|
|
78
|
+
? "active_skill_component"
|
|
79
|
+
: primary?.source_kind === "user_registry_capability" ||
|
|
80
|
+
meta.launch_source === "tool"
|
|
81
|
+
? "user_registry_capability"
|
|
82
|
+
: "explicit_file_recipe";
|
|
83
|
+
const primaryLogicalReference = typeof primary?.logical_reference === "string"
|
|
84
|
+
? primary.logical_reference
|
|
85
|
+
: typeof primary?.name === "string"
|
|
86
|
+
? primary.name
|
|
87
|
+
: typeof meta.recipe === "string"
|
|
88
|
+
? meta.recipe
|
|
89
|
+
: "unknown";
|
|
90
|
+
const launchValues = meta.values && typeof meta.values === "object" && !Array.isArray(meta.values)
|
|
91
|
+
? Object.fromEntries(Object.entries(meta.values).filter(([key]) => key !== "recipe_dir" && key !== "skill_dir"))
|
|
92
|
+
: meta.values;
|
|
93
|
+
return {
|
|
94
|
+
composition: contexts.map((entry) => redactedRecord({
|
|
95
|
+
...(typeof entry.alias === "string" ? { alias: entry.alias } : {}),
|
|
96
|
+
depth: entry.depth,
|
|
97
|
+
import_path: entry.import_path,
|
|
98
|
+
logical_reference: entry.logical_reference ?? entry.name,
|
|
99
|
+
recipe_stem: entry.name,
|
|
100
|
+
role: entry.role,
|
|
101
|
+
...(typeof entry.skill === "string" ? { skill: entry.skill } : {}),
|
|
102
|
+
source_kind: entry.source_kind === "active_skill_component"
|
|
103
|
+
? "active_skill_component"
|
|
104
|
+
: entry.source_kind === "user_registry_capability" ||
|
|
105
|
+
(entry.depth === 0 && meta.launch_source === "tool")
|
|
106
|
+
? "user_registry_capability"
|
|
107
|
+
: "explicit_file_recipe",
|
|
108
|
+
})),
|
|
109
|
+
...(definition ? { definition: redactedRecord(definition) } : {}),
|
|
110
|
+
diagnostics: result.diagnostics.map((diagnostic) => diagnostic.message),
|
|
111
|
+
identity: redactedRecord({
|
|
112
|
+
run: meta.run,
|
|
113
|
+
recipe: meta.recipe,
|
|
114
|
+
recipe_stem: primary?.name ?? meta.recipe,
|
|
115
|
+
logical_reference: primaryLogicalReference,
|
|
116
|
+
...(typeof primary?.skill === "string" ? { skill: primary.skill } : {}),
|
|
117
|
+
source_kind: primarySourceKind,
|
|
118
|
+
launch_kind: meta.launch_kind ?? meta.launch_source,
|
|
119
|
+
launch_source: meta.launch_source,
|
|
120
|
+
...(meta.singleton === true
|
|
121
|
+
? { singleton: true, singleton_recipe_id: meta.singleton_recipe_id }
|
|
122
|
+
: {}),
|
|
123
|
+
}),
|
|
124
|
+
launch: redactedRecord({
|
|
125
|
+
cwd: meta.cwd,
|
|
126
|
+
template: meta.template,
|
|
127
|
+
values: launchValues,
|
|
128
|
+
model_policy: meta.model_policy,
|
|
129
|
+
control: meta.control,
|
|
130
|
+
artifacts: meta.artifacts,
|
|
131
|
+
notification_policy: meta.notification_policy,
|
|
132
|
+
retire_when: meta.retire_when,
|
|
133
|
+
singleton_values: meta.singleton_values,
|
|
134
|
+
}),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared output, preview, and Control envelope limits.
|
|
3
|
+
* Zones: output governance, Trace previews, Inspect defaults, Control portability
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_INSPECT_LINES = 40;
|
|
6
|
+
export declare const TOOL_OUTPUT_MAX_BYTES: number;
|
|
7
|
+
export declare const TOOL_OUTPUT_MAX_LINES = 2000;
|
|
8
|
+
export declare const COMPACT_PREVIEW_CHARS = 160;
|
|
9
|
+
export declare const CONTROL_ACTION_MAX_LENGTH = 64;
|
|
10
|
+
export declare const CONTROL_INPUT_MAX_BYTES = 380;
|
|
11
|
+
export declare const CONTROL_WIRE_MAX_BYTES = 512;
|
|
12
|
+
export declare const INSPECTOR_BODY_PREVIEW_CHARS = 320;
|
|
13
|
+
export declare const DOCTOR_ACTION_PREVIEW_CHARS = 72;
|
|
14
|
+
export declare const SESSION_EVIDENCE_MAX_TURNS = 100;
|
|
15
|
+
export declare const SESSION_EVIDENCE_TEXT_CHARS = 4000;
|
|
16
|
+
export declare const SESSION_EVIDENCE_MAX_TOOL_CALLS = 100;
|
|
17
|
+
export declare const TRACE_EVENT_MAX_BYTES: number;
|
|
18
|
+
export declare const TRACE_EVENT_MAX_READ = 200;
|
|
19
|
+
export declare const TRACE_JOURNAL_MAX_EVENTS = 2048;
|
|
20
|
+
export declare const TRACE_JOURNAL_TARGET_EVENTS = 1536;
|
|
21
|
+
export declare const TRACE_JOURNAL_MAX_BYTES: number;
|
|
22
|
+
export declare const TRACE_JOURNAL_TARGET_BYTES: number;
|
|
23
|
+
export declare const RUN_CONTROL_PENDING_LIMIT = 64;
|
|
24
|
+
export declare const RUN_CONTROL_TERMINAL_LIMIT = 128;
|
|
25
|
+
export declare const RUN_CONTROL_ERROR_MAX_BYTES: number;
|
|
26
|
+
export declare const RUN_CONTROL_JOURNAL_MAX_BYTES: number;
|
|
27
|
+
export declare const RUN_RETENTION_MAX_RECORDS = 256;
|
|
28
|
+
export declare const RUN_RETENTION_MAX_BYTES: number;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared output, preview, and Control envelope limits.
|
|
3
|
+
* Zones: output governance, Trace previews, Inspect defaults, Control portability
|
|
4
|
+
*/
|
|
5
|
+
export const DEFAULT_INSPECT_LINES = 40;
|
|
6
|
+
export const TOOL_OUTPUT_MAX_BYTES = 50 * 1024;
|
|
7
|
+
export const TOOL_OUTPUT_MAX_LINES = 2_000;
|
|
8
|
+
export const COMPACT_PREVIEW_CHARS = 160;
|
|
9
|
+
export const CONTROL_ACTION_MAX_LENGTH = 64;
|
|
10
|
+
export const CONTROL_INPUT_MAX_BYTES = 380;
|
|
11
|
+
export const CONTROL_WIRE_MAX_BYTES = 512;
|
|
12
|
+
export const INSPECTOR_BODY_PREVIEW_CHARS = 320;
|
|
13
|
+
export const DOCTOR_ACTION_PREVIEW_CHARS = 72;
|
|
14
|
+
export const SESSION_EVIDENCE_MAX_TURNS = 100;
|
|
15
|
+
export const SESSION_EVIDENCE_TEXT_CHARS = 4_000;
|
|
16
|
+
export const SESSION_EVIDENCE_MAX_TOOL_CALLS = 100;
|
|
17
|
+
export const TRACE_EVENT_MAX_BYTES = 64 * 1024;
|
|
18
|
+
export const TRACE_EVENT_MAX_READ = 200;
|
|
19
|
+
export const TRACE_JOURNAL_MAX_EVENTS = 2_048;
|
|
20
|
+
export const TRACE_JOURNAL_TARGET_EVENTS = 1_536;
|
|
21
|
+
export const TRACE_JOURNAL_MAX_BYTES = 4 * 1024 * 1024;
|
|
22
|
+
export const TRACE_JOURNAL_TARGET_BYTES = 3 * 1024 * 1024;
|
|
23
|
+
export const RUN_CONTROL_PENDING_LIMIT = 64;
|
|
24
|
+
export const RUN_CONTROL_TERMINAL_LIMIT = 128;
|
|
25
|
+
export const RUN_CONTROL_ERROR_MAX_BYTES = 4 * 1024;
|
|
26
|
+
export const RUN_CONTROL_JOURNAL_MAX_BYTES = 1024 * 1024;
|
|
27
|
+
export const RUN_RETENTION_MAX_RECORDS = 256;
|
|
28
|
+
export const RUN_RETENTION_MAX_BYTES = 1024 * 1024;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Current model/thinking propagation helpers
|
|
3
|
+
* Zones: pi session context, recipe inheritance
|
|
4
|
+
* Owns current model/thinking extraction from Pi tool contexts and implicit command-template values.
|
|
5
|
+
*/
|
|
6
|
+
export interface CurrentModelContext {
|
|
7
|
+
currentThinking?: unknown;
|
|
8
|
+
getThinkingLevel?: () => unknown;
|
|
9
|
+
model?: {
|
|
10
|
+
id?: unknown;
|
|
11
|
+
modelId?: unknown;
|
|
12
|
+
provider?: unknown;
|
|
13
|
+
};
|
|
14
|
+
sessionManager?: {
|
|
15
|
+
getBranch?: () => unknown[];
|
|
16
|
+
getSessionId?: () => string;
|
|
17
|
+
};
|
|
18
|
+
thinkingLevel?: unknown;
|
|
19
|
+
}
|
|
20
|
+
export declare const CURRENT_MODEL_VALUE_KEY = "current_model";
|
|
21
|
+
export declare const CURRENT_THINKING_VALUE_KEY = "current_thinking";
|
|
22
|
+
export type CurrentPolicySource = "explicit" | "inherited" | "mixed" | "unresolved" | "unused";
|
|
23
|
+
export interface CurrentPolicyAxisProvenance {
|
|
24
|
+
explicit_keys?: string[];
|
|
25
|
+
inherited_keys?: string[];
|
|
26
|
+
source: CurrentPolicySource;
|
|
27
|
+
unresolved_keys?: string[];
|
|
28
|
+
value?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface CurrentPolicyProvenance {
|
|
31
|
+
model: CurrentPolicyAxisProvenance;
|
|
32
|
+
thinking: CurrentPolicyAxisProvenance;
|
|
33
|
+
}
|
|
34
|
+
export interface CurrentPolicyRecipeSummary {
|
|
35
|
+
model?: {
|
|
36
|
+
inherited_defaults?: string[];
|
|
37
|
+
public_args?: string[];
|
|
38
|
+
};
|
|
39
|
+
thinking?: {
|
|
40
|
+
inherited_defaults?: string[];
|
|
41
|
+
public_args?: string[];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export declare function getCurrentModelPattern(ctx: CurrentModelContext | undefined): string | undefined;
|
|
45
|
+
export declare function getCurrentThinkingLevel(ctx: CurrentModelContext | undefined): string | undefined;
|
|
46
|
+
export declare function withCurrentModelValues<T extends Record<string, unknown>>(values: T, ctx: CurrentModelContext | undefined): T & Record<string, unknown>;
|
|
47
|
+
export declare function describeCurrentPolicyProvenance(input: {
|
|
48
|
+
defaults?: Record<string, unknown>;
|
|
49
|
+
template: unknown;
|
|
50
|
+
values?: Record<string, unknown>;
|
|
51
|
+
}): CurrentPolicyProvenance;
|
|
52
|
+
export declare function describeRecipeCurrentPolicy(input: {
|
|
53
|
+
args?: unknown;
|
|
54
|
+
defaults?: Record<string, unknown>;
|
|
55
|
+
template: unknown;
|
|
56
|
+
}): CurrentPolicyRecipeSummary | undefined;
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Current model/thinking propagation helpers
|
|
3
|
+
* Zones: pi session context, recipe inheritance
|
|
4
|
+
* Owns current model/thinking extraction from Pi tool contexts and implicit command-template values.
|
|
5
|
+
*/
|
|
6
|
+
export const CURRENT_MODEL_VALUE_KEY = "current_model";
|
|
7
|
+
export const CURRENT_THINKING_VALUE_KEY = "current_thinking";
|
|
8
|
+
export function getCurrentModelPattern(ctx) {
|
|
9
|
+
const provider = ctx?.model?.provider;
|
|
10
|
+
const id = ctx?.model?.id ?? ctx?.model?.modelId;
|
|
11
|
+
if (typeof provider !== "string" || !provider.trim())
|
|
12
|
+
return undefined;
|
|
13
|
+
if (typeof id !== "string" || !id.trim())
|
|
14
|
+
return undefined;
|
|
15
|
+
return `${provider.trim()}/${id.trim()}`;
|
|
16
|
+
}
|
|
17
|
+
function normalizeThinkingLevel(value) {
|
|
18
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
19
|
+
}
|
|
20
|
+
function getSessionThinkingLevel(ctx) {
|
|
21
|
+
const branch = ctx?.sessionManager?.getBranch?.();
|
|
22
|
+
if (!Array.isArray(branch))
|
|
23
|
+
return undefined;
|
|
24
|
+
for (const entry of [...branch].reverse()) {
|
|
25
|
+
if (!entry || typeof entry !== "object")
|
|
26
|
+
continue;
|
|
27
|
+
const record = entry;
|
|
28
|
+
if (record.type !== "thinking_level_change")
|
|
29
|
+
continue;
|
|
30
|
+
const level = normalizeThinkingLevel(record.thinkingLevel);
|
|
31
|
+
if (level)
|
|
32
|
+
return level;
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
export function getCurrentThinkingLevel(ctx) {
|
|
37
|
+
return (normalizeThinkingLevel(ctx?.currentThinking) ??
|
|
38
|
+
normalizeThinkingLevel(ctx?.thinkingLevel) ??
|
|
39
|
+
normalizeThinkingLevel(ctx?.getThinkingLevel?.()) ??
|
|
40
|
+
getSessionThinkingLevel(ctx));
|
|
41
|
+
}
|
|
42
|
+
export function withCurrentModelValues(values, ctx) {
|
|
43
|
+
const currentModel = getCurrentModelPattern(ctx);
|
|
44
|
+
const currentThinking = getCurrentThinkingLevel(ctx);
|
|
45
|
+
if (!currentModel && !currentThinking)
|
|
46
|
+
return values;
|
|
47
|
+
return {
|
|
48
|
+
...values,
|
|
49
|
+
...(currentModel ? { [CURRENT_MODEL_VALUE_KEY]: currentModel } : {}),
|
|
50
|
+
...(currentThinking
|
|
51
|
+
? { [CURRENT_THINKING_VALUE_KEY]: currentThinking }
|
|
52
|
+
: {}),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function isRecord(value) {
|
|
56
|
+
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
57
|
+
}
|
|
58
|
+
function stringReferencesPlaceholder(value, placeholder) {
|
|
59
|
+
return new RegExp(`\\{\\s*${placeholder}\\s*\\}`).test(value);
|
|
60
|
+
}
|
|
61
|
+
function modelPolicyKeyMatches(key) {
|
|
62
|
+
return /(^|_)models?$/.test(key);
|
|
63
|
+
}
|
|
64
|
+
function thinkingPolicyKeyMatches(key) {
|
|
65
|
+
return /(^|_)(thinking|thinking_level)$/.test(key);
|
|
66
|
+
}
|
|
67
|
+
function argName(token) {
|
|
68
|
+
if (typeof token !== "string")
|
|
69
|
+
return undefined;
|
|
70
|
+
return token.split(":")[0]?.trim() || undefined;
|
|
71
|
+
}
|
|
72
|
+
function collectPolicyDefaults(value, placeholder, path = "template", keys = new Set()) {
|
|
73
|
+
if (Array.isArray(value)) {
|
|
74
|
+
value.forEach((item, index) => collectPolicyDefaults(item, placeholder, `${path}[${index}]`, keys));
|
|
75
|
+
return keys;
|
|
76
|
+
}
|
|
77
|
+
if (!isRecord(value))
|
|
78
|
+
return keys;
|
|
79
|
+
for (const [key, child] of Object.entries(value)) {
|
|
80
|
+
if (key === "defaults" && isRecord(child)) {
|
|
81
|
+
for (const [defaultKey, defaultValue] of Object.entries(child)) {
|
|
82
|
+
if (typeof defaultValue === "string" &&
|
|
83
|
+
stringReferencesPlaceholder(defaultValue, placeholder)) {
|
|
84
|
+
keys.add(defaultKey);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
collectPolicyDefaults(child, placeholder, `${path}.${key}`, keys);
|
|
90
|
+
}
|
|
91
|
+
return keys;
|
|
92
|
+
}
|
|
93
|
+
function collectPolicyDirectRefs(value, placeholder, path = "template", refs = new Set()) {
|
|
94
|
+
if (typeof value === "string") {
|
|
95
|
+
if (stringReferencesPlaceholder(value, placeholder))
|
|
96
|
+
refs.add(path);
|
|
97
|
+
return refs;
|
|
98
|
+
}
|
|
99
|
+
if (Array.isArray(value)) {
|
|
100
|
+
value.forEach((item, index) => collectPolicyDirectRefs(item, placeholder, `${path}[${index}]`, refs));
|
|
101
|
+
return refs;
|
|
102
|
+
}
|
|
103
|
+
if (!isRecord(value))
|
|
104
|
+
return refs;
|
|
105
|
+
for (const [key, child] of Object.entries(value)) {
|
|
106
|
+
if (key === "defaults")
|
|
107
|
+
continue;
|
|
108
|
+
collectPolicyDirectRefs(child, placeholder, `${path}.${key}`, refs);
|
|
109
|
+
}
|
|
110
|
+
return refs;
|
|
111
|
+
}
|
|
112
|
+
function summarizePolicyAxis(input) {
|
|
113
|
+
const explicitKeys = Object.keys(input.explicitValues)
|
|
114
|
+
.filter((key) => key !== CURRENT_MODEL_VALUE_KEY &&
|
|
115
|
+
key !== CURRENT_THINKING_VALUE_KEY &&
|
|
116
|
+
input.explicitKeyMatches(key))
|
|
117
|
+
.sort();
|
|
118
|
+
const inheritedKeys = [...input.inheritedDefaultKeys]
|
|
119
|
+
.filter((key) => !Object.hasOwn(input.explicitValues, key))
|
|
120
|
+
.sort();
|
|
121
|
+
const directRefs = [...input.directRefs].length > 0 ? [input.directRefKey] : [];
|
|
122
|
+
const inheritedOrDirect = [...new Set([...inheritedKeys, ...directRefs])].sort();
|
|
123
|
+
const unresolvedKeys = input.currentValue ? [] : inheritedOrDirect;
|
|
124
|
+
const inheritedResolvedKeys = input.currentValue ? inheritedOrDirect : [];
|
|
125
|
+
const hasExplicit = explicitKeys.length > 0;
|
|
126
|
+
const hasInherited = inheritedResolvedKeys.length > 0;
|
|
127
|
+
const source = unresolvedKeys.length
|
|
128
|
+
? "unresolved"
|
|
129
|
+
: hasExplicit && hasInherited
|
|
130
|
+
? "mixed"
|
|
131
|
+
: hasExplicit
|
|
132
|
+
? "explicit"
|
|
133
|
+
: hasInherited
|
|
134
|
+
? "inherited"
|
|
135
|
+
: "unused";
|
|
136
|
+
const explicitValue = explicitKeys
|
|
137
|
+
.map((key) => input.explicitValues[key])
|
|
138
|
+
.find((value) => typeof value === "string" && value.trim());
|
|
139
|
+
const value = hasInherited
|
|
140
|
+
? input.currentValue
|
|
141
|
+
: typeof explicitValue === "string"
|
|
142
|
+
? explicitValue
|
|
143
|
+
: undefined;
|
|
144
|
+
return {
|
|
145
|
+
...(explicitKeys.length ? { explicit_keys: explicitKeys } : {}),
|
|
146
|
+
...(inheritedResolvedKeys.length
|
|
147
|
+
? { inherited_keys: inheritedResolvedKeys }
|
|
148
|
+
: {}),
|
|
149
|
+
source,
|
|
150
|
+
...(unresolvedKeys.length ? { unresolved_keys: unresolvedKeys } : {}),
|
|
151
|
+
...(value ? { value } : {}),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function collectPolicyDefaultsAcross(items, placeholder) {
|
|
155
|
+
return items.reduce((keys, item) => collectPolicyDefaults(item, placeholder, "template", keys), new Set());
|
|
156
|
+
}
|
|
157
|
+
function collectPolicyDirectRefsAcross(items, placeholder) {
|
|
158
|
+
return items.reduce((refs, item) => collectPolicyDirectRefs(item, placeholder, "template", refs), new Set());
|
|
159
|
+
}
|
|
160
|
+
export function describeCurrentPolicyProvenance(input) {
|
|
161
|
+
const explicitValues = input.values ?? {};
|
|
162
|
+
const defaultsEnvelope = input.defaults ? { defaults: input.defaults } : {};
|
|
163
|
+
const templateAndDefaults = [defaultsEnvelope, input.template];
|
|
164
|
+
return {
|
|
165
|
+
model: summarizePolicyAxis({
|
|
166
|
+
currentValue: typeof explicitValues[CURRENT_MODEL_VALUE_KEY] === "string"
|
|
167
|
+
? String(explicitValues[CURRENT_MODEL_VALUE_KEY])
|
|
168
|
+
: undefined,
|
|
169
|
+
directRefKey: CURRENT_MODEL_VALUE_KEY,
|
|
170
|
+
directRefs: collectPolicyDirectRefsAcross(templateAndDefaults, "current_model"),
|
|
171
|
+
explicitKeyMatches: modelPolicyKeyMatches,
|
|
172
|
+
explicitValues,
|
|
173
|
+
inheritedDefaultKeys: collectPolicyDefaultsAcross(templateAndDefaults, "current_model"),
|
|
174
|
+
}),
|
|
175
|
+
thinking: summarizePolicyAxis({
|
|
176
|
+
currentValue: typeof explicitValues[CURRENT_THINKING_VALUE_KEY] === "string"
|
|
177
|
+
? String(explicitValues[CURRENT_THINKING_VALUE_KEY])
|
|
178
|
+
: undefined,
|
|
179
|
+
directRefKey: CURRENT_THINKING_VALUE_KEY,
|
|
180
|
+
directRefs: collectPolicyDirectRefsAcross(templateAndDefaults, "current_thinking"),
|
|
181
|
+
explicitKeyMatches: thinkingPolicyKeyMatches,
|
|
182
|
+
explicitValues,
|
|
183
|
+
inheritedDefaultKeys: collectPolicyDefaultsAcross(templateAndDefaults, "current_thinking"),
|
|
184
|
+
}),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function publicPolicyArgs(args, matches) {
|
|
188
|
+
return Array.isArray(args)
|
|
189
|
+
? args
|
|
190
|
+
.map(argName)
|
|
191
|
+
.filter((key) => Boolean(key && matches(key)))
|
|
192
|
+
.sort()
|
|
193
|
+
: [];
|
|
194
|
+
}
|
|
195
|
+
function nonEmptyAxisRecipeSummary(inheritedDefaults, publicArgs) {
|
|
196
|
+
if (inheritedDefaults.length === 0 && publicArgs.length === 0)
|
|
197
|
+
return undefined;
|
|
198
|
+
return {
|
|
199
|
+
...(inheritedDefaults.length
|
|
200
|
+
? { inherited_defaults: inheritedDefaults }
|
|
201
|
+
: {}),
|
|
202
|
+
...(publicArgs.length ? { public_args: publicArgs } : {}),
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
export function describeRecipeCurrentPolicy(input) {
|
|
206
|
+
const templateAndDefaults = [
|
|
207
|
+
input.defaults ? { defaults: input.defaults } : {},
|
|
208
|
+
input.template,
|
|
209
|
+
];
|
|
210
|
+
const model = nonEmptyAxisRecipeSummary([...collectPolicyDefaultsAcross(templateAndDefaults, "current_model")].sort(), publicPolicyArgs(input.args, modelPolicyKeyMatches));
|
|
211
|
+
const thinking = nonEmptyAxisRecipeSummary([
|
|
212
|
+
...collectPolicyDefaultsAcross(templateAndDefaults, "current_thinking"),
|
|
213
|
+
].sort(), publicPolicyArgs(input.args, thinkingPolicyKeyMatches));
|
|
214
|
+
if (!model && !thinking)
|
|
215
|
+
return undefined;
|
|
216
|
+
return {
|
|
217
|
+
...(model ? { model } : {}),
|
|
218
|
+
...(thinking ? { thinking } : {}),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Async run observability helpers
|
|
3
|
+
* Zones: async runtime, ambient UI, diagnostics
|
|
4
|
+
* Owns ambient summaries, terminal events, and Trace-attention delivery for detached Runs
|
|
5
|
+
*/
|
|
6
|
+
import { type FSWatcher } from "node:fs";
|
|
7
|
+
import * as AsyncRuns from "./async-runs.ts";
|
|
8
|
+
export type RunObservedStatus = "running" | "done" | "failed" | "exited" | "cancelled" | "killed";
|
|
9
|
+
export type RunTraceAttention = "log" | "notify" | "followup";
|
|
10
|
+
export type RunTraceLevel = "info" | "warning" | "error";
|
|
11
|
+
export interface RunObservation {
|
|
12
|
+
activeSubagents?: number;
|
|
13
|
+
completed?: number;
|
|
14
|
+
descendantSubagents?: number;
|
|
15
|
+
failures?: number;
|
|
16
|
+
ownerId?: string;
|
|
17
|
+
artifacts?: Record<string, string>;
|
|
18
|
+
launchCorrelation?: Record<string, string>;
|
|
19
|
+
launchSource?: AsyncRuns.AsyncRunLaunchSource;
|
|
20
|
+
modelPolicy?: Record<string, unknown>;
|
|
21
|
+
notificationPolicy?: "normal" | "silent";
|
|
22
|
+
recipeFile?: string;
|
|
23
|
+
terminalHandled?: boolean;
|
|
24
|
+
retireWhen?: string;
|
|
25
|
+
run: string;
|
|
26
|
+
semanticResult?: RunTerminalSemanticResult;
|
|
27
|
+
tool?: string;
|
|
28
|
+
stateDir?: string;
|
|
29
|
+
status: RunObservedStatus;
|
|
30
|
+
updatedAt?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface RunSummary {
|
|
33
|
+
cancelled: number;
|
|
34
|
+
done: number;
|
|
35
|
+
exited: number;
|
|
36
|
+
failed: number;
|
|
37
|
+
killed: number;
|
|
38
|
+
running: number;
|
|
39
|
+
runningSubagents: number;
|
|
40
|
+
runs: RunObservation[];
|
|
41
|
+
total: number;
|
|
42
|
+
}
|
|
43
|
+
export interface RunUiObservationState {
|
|
44
|
+
attentionEventIds: Map<string, Set<string>>;
|
|
45
|
+
legacyEventLines: Map<string, number>;
|
|
46
|
+
frame: number;
|
|
47
|
+
observed: Map<string, RunObservedStatus>;
|
|
48
|
+
}
|
|
49
|
+
export interface RunUiSnapshot {
|
|
50
|
+
attentionEvents: RunAttentionEvent[];
|
|
51
|
+
status: string | undefined;
|
|
52
|
+
summary: RunSummary;
|
|
53
|
+
transitions: RunTransition[];
|
|
54
|
+
}
|
|
55
|
+
export interface RunUiNotificationSink {
|
|
56
|
+
notify(message: string, level: "info" | "warning" | "error"): void;
|
|
57
|
+
sendFollowUp(message: {
|
|
58
|
+
customType: string;
|
|
59
|
+
content: string;
|
|
60
|
+
display: false;
|
|
61
|
+
details: unknown;
|
|
62
|
+
}): void;
|
|
63
|
+
}
|
|
64
|
+
export declare function createRunUiObservationState(): RunUiObservationState;
|
|
65
|
+
export declare function primeRunAttentionState(state: RunUiObservationState, ownerId: string, stateRoot?: string): void;
|
|
66
|
+
export declare function readRunUiSnapshot(state: RunUiObservationState, ownerId: string, options?: {
|
|
67
|
+
includeAttention?: boolean;
|
|
68
|
+
stateRoot?: string;
|
|
69
|
+
}): RunUiSnapshot;
|
|
70
|
+
export declare function pruneRunUiObservationState(state: RunUiObservationState, snapshot: Pick<RunUiSnapshot, "summary" | "transitions">): void;
|
|
71
|
+
export declare function deliverRunTransitionNotifications(transitions: RunTransition[], sink: RunUiNotificationSink, inFlight?: Set<string>): void;
|
|
72
|
+
export declare function reconcileRunTerminalNotifications(input: {
|
|
73
|
+
inFlight?: Set<string>;
|
|
74
|
+
ownerId: string;
|
|
75
|
+
sink: RunUiNotificationSink;
|
|
76
|
+
state: RunUiObservationState;
|
|
77
|
+
stateRoot?: string;
|
|
78
|
+
includeAttention?: boolean;
|
|
79
|
+
}): RunUiSnapshot;
|
|
80
|
+
export declare function deliverRunAttentionNotifications(events: RunAttentionEvent[], sink: RunUiNotificationSink): void;
|
|
81
|
+
export interface RunRetirementCandidate {
|
|
82
|
+
activeSubagents: number;
|
|
83
|
+
childRuns: number;
|
|
84
|
+
descendantSubagents: number;
|
|
85
|
+
run: string;
|
|
86
|
+
stateDir: string;
|
|
87
|
+
terminalChildRuns: number;
|
|
88
|
+
}
|
|
89
|
+
export interface RunRetirementExecution {
|
|
90
|
+
action: "stop" | "cancel" | "skip" | "failed";
|
|
91
|
+
error?: string;
|
|
92
|
+
run: string;
|
|
93
|
+
stateDir: string;
|
|
94
|
+
}
|
|
95
|
+
export type RunStateWatcherDiagnosticCode = "attach_failed" | "error" | "removed" | "rearmed";
|
|
96
|
+
export interface RunStateWatcherDiagnostic {
|
|
97
|
+
code: RunStateWatcherDiagnosticCode;
|
|
98
|
+
id: number;
|
|
99
|
+
message: string;
|
|
100
|
+
path: string;
|
|
101
|
+
scope: "root" | "run";
|
|
102
|
+
ts: string;
|
|
103
|
+
}
|
|
104
|
+
export interface RunStateWatcher {
|
|
105
|
+
close(): void;
|
|
106
|
+
getDiagnostics(): RunStateWatcherDiagnostic[];
|
|
107
|
+
refresh(): void;
|
|
108
|
+
}
|
|
109
|
+
export declare function createRunStateWatcher(input: {
|
|
110
|
+
exists?: (path: string) => boolean;
|
|
111
|
+
listDirectories?: (path: string) => string[];
|
|
112
|
+
onChange: () => void;
|
|
113
|
+
stateRoot?: string;
|
|
114
|
+
watchPath?: (path: string, onChange: () => void) => FSWatcher;
|
|
115
|
+
}): RunStateWatcher;
|
|
116
|
+
export interface RunTerminalReconciliationLoop {
|
|
117
|
+
close(): void;
|
|
118
|
+
reconcileNow(): void;
|
|
119
|
+
start(): void;
|
|
120
|
+
}
|
|
121
|
+
export declare function createRunTerminalReconciliationLoop(input: {
|
|
122
|
+
intervalMs?: number;
|
|
123
|
+
onError?: (error: unknown) => void;
|
|
124
|
+
reconcile: () => void;
|
|
125
|
+
refreshWatcher: () => void;
|
|
126
|
+
}): RunTerminalReconciliationLoop;
|
|
127
|
+
export interface RunRetirementExecutorOptions {
|
|
128
|
+
attempted?: Set<string>;
|
|
129
|
+
cancelRun: (candidate: RunRetirementCandidate) => Record<string, unknown>;
|
|
130
|
+
notify?: (message: string, level: "info" | "warning" | "error") => void;
|
|
131
|
+
sendStop: (candidate: RunRetirementCandidate) => Promise<unknown>;
|
|
132
|
+
}
|
|
133
|
+
export interface RunTransition {
|
|
134
|
+
from: RunObservedStatus;
|
|
135
|
+
run: string;
|
|
136
|
+
stateDir?: string;
|
|
137
|
+
artifacts?: Record<string, string>;
|
|
138
|
+
launchCorrelation?: Record<string, string>;
|
|
139
|
+
launchSource?: AsyncRuns.AsyncRunLaunchSource;
|
|
140
|
+
modelPolicy?: Record<string, unknown>;
|
|
141
|
+
recipeFile?: string;
|
|
142
|
+
terminalHandled?: boolean;
|
|
143
|
+
to: RunObservedStatus;
|
|
144
|
+
tool?: string;
|
|
145
|
+
semanticResult?: RunTerminalSemanticResult;
|
|
146
|
+
}
|
|
147
|
+
export interface RunTerminalSemanticResult {
|
|
148
|
+
body?: string;
|
|
149
|
+
correlationId?: string;
|
|
150
|
+
metadata: Record<string, unknown>;
|
|
151
|
+
summary: string;
|
|
152
|
+
synthesized: boolean;
|
|
153
|
+
type: string;
|
|
154
|
+
}
|
|
155
|
+
export interface RunAttentionEvent {
|
|
156
|
+
body?: unknown;
|
|
157
|
+
data?: unknown;
|
|
158
|
+
attention: RunTraceAttention;
|
|
159
|
+
id: string;
|
|
160
|
+
kind: string;
|
|
161
|
+
level: RunTraceLevel;
|
|
162
|
+
metadata?: Record<string, unknown>;
|
|
163
|
+
run: string;
|
|
164
|
+
stateDir: string;
|
|
165
|
+
summary: string;
|
|
166
|
+
ts: string;
|
|
167
|
+
}
|
|
168
|
+
export type RunTransitionNotificationType = "info" | "warning" | "error";
|
|
169
|
+
export declare function summarizeRuns(stateRoot?: string, ownerId?: string): RunSummary;
|
|
170
|
+
export declare function countRunningSubagentsByRun(stateRoot?: string, ownerId?: string): Map<string, number>;
|
|
171
|
+
export declare function countRunningSubagents(stateRoot?: string, ownerId?: string): number;
|
|
172
|
+
export declare function renderSubagentStatus(count: number, frame?: number): string | undefined;
|
|
173
|
+
export declare function renderRunStatus(summary: RunSummary, frame?: number): string | undefined;
|
|
174
|
+
export declare function findRunRetirementCandidates(summary: RunSummary): RunRetirementCandidate[];
|
|
175
|
+
export declare function executeRunRetirements(summary: RunSummary, options: RunRetirementExecutorOptions): Promise<RunRetirementExecution[]>;
|
|
176
|
+
export declare function detectRunTransitions(previous: Map<string, RunObservedStatus>, summary: RunSummary): RunTransition[];
|
|
177
|
+
export declare function pruneRunObservationState(previousStatuses: Map<string, RunObservedStatus>, previousLineCounts: Map<string, number>, summary: RunSummary, terminalRuns?: Iterable<string>, seenEventIds?: Map<string, Set<string>>): void;
|
|
178
|
+
export declare function detectRunAttentionEvents(legacyLineCounts: Map<string, number>, summary: RunSummary, seenEventIds?: Map<string, Set<string>>, prime?: boolean): RunAttentionEvent[];
|
|
179
|
+
export declare function getRunAttentionNotificationType(event: RunAttentionEvent): RunTransitionNotificationType;
|
|
180
|
+
export declare function shouldNotifyRunAttentionEvent(event: RunAttentionEvent): boolean;
|
|
181
|
+
export declare function shouldSendRunAttentionFollowUp(event: RunAttentionEvent): boolean;
|
|
182
|
+
export declare function formatRunAttentionMessage(event: RunAttentionEvent): string;
|
|
183
|
+
export declare function getRunTransitionNotificationType(transition: RunTransition): RunTransitionNotificationType;
|
|
184
|
+
export declare function shouldNotifyRunTransition(transition: RunTransition): boolean;
|
|
185
|
+
export declare function shouldSendRunTransitionFollowUp(transition: RunTransition): boolean;
|
|
186
|
+
export declare function formatRunTransitionMessage(transition: RunTransition): string;
|