@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,824 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyboard-driven Actor Inspector overlay for concrete Run instances.
|
|
3
|
+
* Zones: owned actor selection, Recipe/Trace/Control tabs, safe Run Kill confirmation
|
|
4
|
+
* Owns manual kernel navigation; evidence parsing and lifecycle mutation stay in ports.
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync, statSync } from "node:fs";
|
|
7
|
+
import * as path from "node:path";
|
|
8
|
+
import { matchesKey, truncateToWidth, visibleWidth, } from "@earendil-works/pi-tui";
|
|
9
|
+
import * as ActorInspector from "./inspector.js";
|
|
10
|
+
import * as ControlProjection from "./control-projection.js";
|
|
11
|
+
import * as RunsControls from "./runs-controls.js";
|
|
12
|
+
import * as RunControlDelivery from "./runs-control-delivery.js";
|
|
13
|
+
import * as RunsTrace from "./runs-trace.js";
|
|
14
|
+
import * as Limits from "./limits.js";
|
|
15
|
+
import { computeRunControlCapacity } from "./run-evidence-policy.js";
|
|
16
|
+
import * as RuntimeTriage from "./runtime-triage.js";
|
|
17
|
+
import * as TraceProjection from "./trace-projection.js";
|
|
18
|
+
const TABS = ["recipe", "trace", "control"];
|
|
19
|
+
const TRACE_SOURCES = [
|
|
20
|
+
"all",
|
|
21
|
+
"lifecycle",
|
|
22
|
+
"control",
|
|
23
|
+
"process",
|
|
24
|
+
"agent",
|
|
25
|
+
"artifact",
|
|
26
|
+
"runtime",
|
|
27
|
+
];
|
|
28
|
+
export class ActorInspectorOverlay {
|
|
29
|
+
done;
|
|
30
|
+
killRun;
|
|
31
|
+
ownerId;
|
|
32
|
+
readRuns;
|
|
33
|
+
readTrace;
|
|
34
|
+
stateRoot;
|
|
35
|
+
theme;
|
|
36
|
+
tui;
|
|
37
|
+
refreshTimer;
|
|
38
|
+
contentStripeIndices = [];
|
|
39
|
+
documentScroll = 0;
|
|
40
|
+
detailScroll = 0;
|
|
41
|
+
feedback;
|
|
42
|
+
focus = "runs";
|
|
43
|
+
killConfirmation;
|
|
44
|
+
killDialogChoice = "cancel";
|
|
45
|
+
rowIndex = 0;
|
|
46
|
+
runCache;
|
|
47
|
+
selectedTraceId;
|
|
48
|
+
runIndex = 0;
|
|
49
|
+
selectorIndex = 0;
|
|
50
|
+
selectorMode;
|
|
51
|
+
tabIndex = 0;
|
|
52
|
+
traceCache;
|
|
53
|
+
traceDetail;
|
|
54
|
+
traceSourceIndex = 0;
|
|
55
|
+
constructor(options) {
|
|
56
|
+
this.done = options.done;
|
|
57
|
+
this.killRun = options.killRun;
|
|
58
|
+
this.ownerId = options.ownerId;
|
|
59
|
+
this.readRuns = options.readRuns ?? ActorInspector.readActorInspectorRuns;
|
|
60
|
+
this.readTrace = options.readTrace ?? TraceProjection.projectRunTrace;
|
|
61
|
+
this.stateRoot = options.stateRoot;
|
|
62
|
+
this.theme = options.theme;
|
|
63
|
+
this.tui = options.tui;
|
|
64
|
+
this.refreshTimer = setInterval(() => {
|
|
65
|
+
this.invalidate();
|
|
66
|
+
this.tui.requestRender();
|
|
67
|
+
}, 1_000);
|
|
68
|
+
this.refreshTimer.unref?.();
|
|
69
|
+
}
|
|
70
|
+
dispose() {
|
|
71
|
+
clearInterval(this.refreshTimer);
|
|
72
|
+
}
|
|
73
|
+
invalidate() {
|
|
74
|
+
this.runCache = undefined;
|
|
75
|
+
this.traceCache = undefined;
|
|
76
|
+
}
|
|
77
|
+
handleInput(data) {
|
|
78
|
+
const runs = this.runs();
|
|
79
|
+
this.runIndex = Math.min(this.runIndex, Math.max(0, runs.length - 1));
|
|
80
|
+
if (matchesKey(data, "ctrl+c")) {
|
|
81
|
+
this.done();
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (this.killConfirmation) {
|
|
85
|
+
this.handleKillInput(data);
|
|
86
|
+
this.tui.requestRender();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (data.toLowerCase() === "k") {
|
|
90
|
+
this.requestKill(runs[this.runIndex]);
|
|
91
|
+
this.tui.requestRender();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (matchesKey(data, "escape")) {
|
|
95
|
+
if (this.focus === "select") {
|
|
96
|
+
this.selectorMode = undefined;
|
|
97
|
+
this.focus = this.tab === "trace" ? "tabs" : "runs";
|
|
98
|
+
}
|
|
99
|
+
else if (this.focus === "detail") {
|
|
100
|
+
this.selectedTraceId = this.traceDetail?.id;
|
|
101
|
+
this.traceDetail = undefined;
|
|
102
|
+
this.detailScroll = 0;
|
|
103
|
+
this.focus = "list";
|
|
104
|
+
}
|
|
105
|
+
else if (this.focus === "document" || this.focus === "list") {
|
|
106
|
+
if (this.focus === "list")
|
|
107
|
+
this.selectedTraceId = undefined;
|
|
108
|
+
this.focus = "tabs";
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
this.done();
|
|
112
|
+
}
|
|
113
|
+
this.tui.requestRender();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (this.focus === "select") {
|
|
117
|
+
this.handleSelectorInput(data, runs);
|
|
118
|
+
this.tui.requestRender();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (this.focus === "detail") {
|
|
122
|
+
this.handleScrollableInput(data, "detail");
|
|
123
|
+
this.tui.requestRender();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
if (this.focus === "document") {
|
|
127
|
+
if (matchesKey(data, "left"))
|
|
128
|
+
this.focus = "tabs";
|
|
129
|
+
else if (matchesKey(data, "up") && this.documentScroll === 0)
|
|
130
|
+
this.focus = "tabs";
|
|
131
|
+
else
|
|
132
|
+
this.handleScrollableInput(data, "document");
|
|
133
|
+
this.tui.requestRender();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (this.focus === "runs") {
|
|
137
|
+
if (matchesKey(data, "left"))
|
|
138
|
+
this.cycleRun(runs, -1);
|
|
139
|
+
else if (matchesKey(data, "right"))
|
|
140
|
+
this.cycleRun(runs, 1);
|
|
141
|
+
else if (matchesKey(data, "down"))
|
|
142
|
+
this.focus = "tabs";
|
|
143
|
+
else if (matchesKey(data, "return") && runs.length > 0) {
|
|
144
|
+
this.selectorMode = "run";
|
|
145
|
+
this.selectorIndex = this.runIndex;
|
|
146
|
+
this.focus = "select";
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else if (this.focus === "tabs") {
|
|
150
|
+
if (matchesKey(data, "left") || matchesKey(data, "right") || matchesKey(data, "tab")) {
|
|
151
|
+
const direction = matchesKey(data, "left") ? -1 : 1;
|
|
152
|
+
this.tabIndex = (this.tabIndex + direction + TABS.length) % TABS.length;
|
|
153
|
+
this.resetContentPosition();
|
|
154
|
+
}
|
|
155
|
+
else if (matchesKey(data, "up")) {
|
|
156
|
+
this.focus = "runs";
|
|
157
|
+
}
|
|
158
|
+
else if (matchesKey(data, "down")) {
|
|
159
|
+
const items = this.tab === "trace" ? this.traceItems(runs[this.runIndex]) : [];
|
|
160
|
+
this.focus = items.length > 0 ? "list" : "document";
|
|
161
|
+
if (this.focus === "list") {
|
|
162
|
+
this.rowIndex = 0;
|
|
163
|
+
this.selectedTraceId = items[0]?.id;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else if (matchesKey(data, "return")) {
|
|
167
|
+
if (this.tab === "trace")
|
|
168
|
+
this.openSourceSelector(runs[this.runIndex]);
|
|
169
|
+
else
|
|
170
|
+
this.focus = "document";
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else if (this.focus === "list") {
|
|
174
|
+
const items = this.traceItems(runs[this.runIndex]);
|
|
175
|
+
const count = items.length;
|
|
176
|
+
if (matchesKey(data, "left")) {
|
|
177
|
+
this.selectedTraceId = undefined;
|
|
178
|
+
this.focus = "tabs";
|
|
179
|
+
}
|
|
180
|
+
else if (matchesKey(data, "up")) {
|
|
181
|
+
if (this.rowIndex === 0) {
|
|
182
|
+
this.selectedTraceId = undefined;
|
|
183
|
+
this.focus = "tabs";
|
|
184
|
+
}
|
|
185
|
+
else
|
|
186
|
+
this.rowIndex -= 1;
|
|
187
|
+
}
|
|
188
|
+
else if (matchesKey(data, "down")) {
|
|
189
|
+
this.rowIndex = Math.min(Math.max(0, count - 1), this.rowIndex + 1);
|
|
190
|
+
}
|
|
191
|
+
else if (matchesKey(data, "pageUp")) {
|
|
192
|
+
this.rowIndex = Math.max(0, this.rowIndex - this.contentViewportRows());
|
|
193
|
+
}
|
|
194
|
+
else if (matchesKey(data, "pageDown")) {
|
|
195
|
+
this.rowIndex = Math.min(Math.max(0, count - 1), this.rowIndex + this.contentViewportRows());
|
|
196
|
+
}
|
|
197
|
+
else if (matchesKey(data, "return") || matchesKey(data, "right")) {
|
|
198
|
+
const item = items[this.rowIndex];
|
|
199
|
+
if (item) {
|
|
200
|
+
this.traceDetail = item;
|
|
201
|
+
this.detailScroll = 0;
|
|
202
|
+
this.focus = "detail";
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (this.focus === "list")
|
|
206
|
+
this.selectedTraceId = items[this.rowIndex]?.id;
|
|
207
|
+
}
|
|
208
|
+
if (data.toLowerCase() === "f" && this.tab === "trace") {
|
|
209
|
+
this.cycleTraceSource(runs[this.runIndex]);
|
|
210
|
+
}
|
|
211
|
+
this.tui.requestRender();
|
|
212
|
+
}
|
|
213
|
+
render(width) {
|
|
214
|
+
const safeWidth = Math.max(24, width);
|
|
215
|
+
const innerWidth = safeWidth - 2;
|
|
216
|
+
const runs = this.runs();
|
|
217
|
+
this.runIndex = Math.min(this.runIndex, Math.max(0, runs.length - 1));
|
|
218
|
+
const run = runs[this.runIndex];
|
|
219
|
+
if (this.killConfirmation)
|
|
220
|
+
return this.renderKillDialog(innerWidth);
|
|
221
|
+
const lines = [this.border("╭", " Actor Inspector ", "╮", innerWidth)];
|
|
222
|
+
lines.push(this.row(this.renderRunControl(run, runs.length - this.runIndex), innerWidth));
|
|
223
|
+
lines.push(this.row(this.renderTabs(run), innerWidth));
|
|
224
|
+
lines.push(this.border("├", "", "┤", innerWidth));
|
|
225
|
+
this.contentStripeIndices = [];
|
|
226
|
+
let content = this.renderContent(run, innerWidth);
|
|
227
|
+
if (this.feedback) {
|
|
228
|
+
const color = this.feedback.ok
|
|
229
|
+
? "success"
|
|
230
|
+
: /^Kill (failed|rejected)/u.test(this.feedback.message)
|
|
231
|
+
? "error"
|
|
232
|
+
: "warning";
|
|
233
|
+
content = [this.theme.fg(color, ` ${this.feedback.message}`), ...content];
|
|
234
|
+
this.contentStripeIndices = [0, ...this.contentStripeIndices];
|
|
235
|
+
}
|
|
236
|
+
const viewportRows = this.contentViewportRows();
|
|
237
|
+
content = content.slice(0, viewportRows);
|
|
238
|
+
for (let index = 0; index < viewportRows; index += 1) {
|
|
239
|
+
lines.push(this.stripedRow(content[index] ?? "", innerWidth, this.contentStripeIndices[index] ?? index));
|
|
240
|
+
}
|
|
241
|
+
lines.push(this.footerBorder(this.renderKeyHints(), innerWidth));
|
|
242
|
+
return lines;
|
|
243
|
+
}
|
|
244
|
+
get tab() {
|
|
245
|
+
return TABS[this.tabIndex];
|
|
246
|
+
}
|
|
247
|
+
runs() {
|
|
248
|
+
if (this.runCache)
|
|
249
|
+
return this.runCache;
|
|
250
|
+
this.runCache = this.readRuns(this.stateRoot, this.ownerId);
|
|
251
|
+
return this.runCache;
|
|
252
|
+
}
|
|
253
|
+
contentViewportRows() {
|
|
254
|
+
const rows = this.tui.terminal?.rows ?? 30;
|
|
255
|
+
const overlayRows = Math.floor(rows * 0.94);
|
|
256
|
+
return Math.max(4, Math.min(24, overlayRows - 5));
|
|
257
|
+
}
|
|
258
|
+
resetContentPosition() {
|
|
259
|
+
this.documentScroll = 0;
|
|
260
|
+
this.detailScroll = 0;
|
|
261
|
+
this.rowIndex = 0;
|
|
262
|
+
this.selectedTraceId = undefined;
|
|
263
|
+
this.traceDetail = undefined;
|
|
264
|
+
}
|
|
265
|
+
cycleRun(runs, direction) {
|
|
266
|
+
if (runs.length === 0)
|
|
267
|
+
return;
|
|
268
|
+
this.runIndex = (this.runIndex + direction + runs.length) % runs.length;
|
|
269
|
+
this.resetContentPosition();
|
|
270
|
+
}
|
|
271
|
+
handleScrollableInput(data, target) {
|
|
272
|
+
const key = target === "detail" ? "detailScroll" : "documentScroll";
|
|
273
|
+
if (matchesKey(data, "up"))
|
|
274
|
+
this[key] = Math.max(0, this[key] - 1);
|
|
275
|
+
else if (matchesKey(data, "down"))
|
|
276
|
+
this[key] += 1;
|
|
277
|
+
else if (matchesKey(data, "pageUp")) {
|
|
278
|
+
this[key] = Math.max(0, this[key] - this.contentViewportRows());
|
|
279
|
+
}
|
|
280
|
+
else if (matchesKey(data, "pageDown")) {
|
|
281
|
+
this[key] += this.contentViewportRows();
|
|
282
|
+
}
|
|
283
|
+
else if (matchesKey(data, "left") && target === "detail") {
|
|
284
|
+
this.selectedTraceId = this.traceDetail?.id;
|
|
285
|
+
this.traceDetail = undefined;
|
|
286
|
+
this.detailScroll = 0;
|
|
287
|
+
this.focus = "list";
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
handleSelectorInput(data, runs) {
|
|
291
|
+
const run = runs[this.runIndex];
|
|
292
|
+
const options = this.selectorMode === "run"
|
|
293
|
+
? runs.map((item) => item.run)
|
|
294
|
+
: this.traceSources(run);
|
|
295
|
+
if (matchesKey(data, "up"))
|
|
296
|
+
this.selectorIndex = Math.max(0, this.selectorIndex - 1);
|
|
297
|
+
else if (matchesKey(data, "down")) {
|
|
298
|
+
this.selectorIndex = Math.min(Math.max(0, options.length - 1), this.selectorIndex + 1);
|
|
299
|
+
}
|
|
300
|
+
else if (matchesKey(data, "left")) {
|
|
301
|
+
this.focus = this.selectorMode === "run" ? "runs" : "tabs";
|
|
302
|
+
this.selectorMode = undefined;
|
|
303
|
+
}
|
|
304
|
+
else if (matchesKey(data, "return") || matchesKey(data, "right")) {
|
|
305
|
+
if (this.selectorMode === "run") {
|
|
306
|
+
this.runIndex = this.selectorIndex;
|
|
307
|
+
this.focus = "runs";
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
this.traceSourceIndex = this.selectorIndex;
|
|
311
|
+
this.focus = "tabs";
|
|
312
|
+
}
|
|
313
|
+
this.selectorMode = undefined;
|
|
314
|
+
this.resetContentPosition();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
openSourceSelector(run) {
|
|
318
|
+
const sources = this.traceSources(run);
|
|
319
|
+
this.selectorMode = "source";
|
|
320
|
+
this.selectorIndex = Math.min(this.traceSourceIndex, sources.length - 1);
|
|
321
|
+
this.focus = "select";
|
|
322
|
+
}
|
|
323
|
+
cycleTraceSource(run) {
|
|
324
|
+
const sources = this.traceSources(run);
|
|
325
|
+
this.traceSourceIndex = (this.traceSourceIndex + 1) % sources.length;
|
|
326
|
+
this.resetContentPosition();
|
|
327
|
+
}
|
|
328
|
+
requestKill(run) {
|
|
329
|
+
this.feedback = undefined;
|
|
330
|
+
if (this.focus !== "runs") {
|
|
331
|
+
this.feedback = { ok: false, message: "Focus Run before using Kill." };
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
if (!run) {
|
|
335
|
+
this.feedback = { ok: false, message: "Kill unavailable: no owned run." };
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
if (!this.killRun) {
|
|
339
|
+
this.feedback = { ok: false, message: "Kill unavailable in this Inspector." };
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
if (run.status !== "running") {
|
|
343
|
+
this.feedback = { ok: false, message: `Kill unavailable: run is ${run.status}.` };
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (!run.runInstanceId) {
|
|
347
|
+
this.feedback = { ok: false, message: "Kill unavailable: run generation unavailable." };
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
this.killConfirmation = {
|
|
351
|
+
run: run.run,
|
|
352
|
+
runInstanceId: run.runInstanceId,
|
|
353
|
+
status: run.status,
|
|
354
|
+
};
|
|
355
|
+
this.killDialogChoice = "cancel";
|
|
356
|
+
}
|
|
357
|
+
handleKillInput(data) {
|
|
358
|
+
const key = data.toLowerCase();
|
|
359
|
+
if (matchesKey(data, "escape") || key === "n") {
|
|
360
|
+
this.feedback = { ok: false, message: "Kill cancelled." };
|
|
361
|
+
this.killConfirmation = undefined;
|
|
362
|
+
this.killDialogChoice = "cancel";
|
|
363
|
+
}
|
|
364
|
+
else if (matchesKey(data, "left") || matchesKey(data, "right") || matchesKey(data, "tab")) {
|
|
365
|
+
this.killDialogChoice = this.killDialogChoice === "cancel" ? "kill" : "cancel";
|
|
366
|
+
}
|
|
367
|
+
else if (key === "y") {
|
|
368
|
+
this.confirmKill();
|
|
369
|
+
}
|
|
370
|
+
else if (matchesKey(data, "return")) {
|
|
371
|
+
if (this.killDialogChoice === "kill")
|
|
372
|
+
this.confirmKill();
|
|
373
|
+
else {
|
|
374
|
+
this.feedback = { ok: false, message: "Kill cancelled." };
|
|
375
|
+
this.killConfirmation = undefined;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
confirmKill() {
|
|
380
|
+
const confirmation = this.killConfirmation;
|
|
381
|
+
this.killConfirmation = undefined;
|
|
382
|
+
this.killDialogChoice = "cancel";
|
|
383
|
+
if (!confirmation || !this.killRun)
|
|
384
|
+
return;
|
|
385
|
+
try {
|
|
386
|
+
const result = this.killRun(confirmation.run, confirmation.runInstanceId);
|
|
387
|
+
this.feedback = result.ok ? undefined : result;
|
|
388
|
+
if (result.ok)
|
|
389
|
+
this.invalidate();
|
|
390
|
+
}
|
|
391
|
+
catch (error) {
|
|
392
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
393
|
+
this.feedback = {
|
|
394
|
+
ok: false,
|
|
395
|
+
message: `Kill failed: ${message.replaceAll(/\s+/g, " ").slice(0, 160)}.`,
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
renderKillDialog(innerWidth) {
|
|
400
|
+
const confirmation = this.killConfirmation;
|
|
401
|
+
const cancel = this.killDialogChoice === "cancel"
|
|
402
|
+
? this.theme.bg("customMessageBg", this.theme.fg("accent", " Cancel "))
|
|
403
|
+
: this.theme.fg("muted", " Cancel ");
|
|
404
|
+
const kill = this.killDialogChoice === "kill"
|
|
405
|
+
? this.theme.bg("customMessageBg", this.theme.fg("error", " Kill actor "))
|
|
406
|
+
: this.theme.fg("error", " Kill actor ");
|
|
407
|
+
const body = [
|
|
408
|
+
"",
|
|
409
|
+
this.theme.fg("error", "Kill this running actor?"),
|
|
410
|
+
"",
|
|
411
|
+
`${this.theme.fg("muted", "Run:")} ${this.theme.fg("accent", `run:${confirmation.run}`)}`,
|
|
412
|
+
`${this.theme.fg("muted", "Current status:")} ${this.theme.fg("warning", confirmation.status)}`,
|
|
413
|
+
"",
|
|
414
|
+
this.theme.fg("text", "This invokes generation-fenced runtime kill."),
|
|
415
|
+
"",
|
|
416
|
+
`${cancel} ${kill}`,
|
|
417
|
+
"",
|
|
418
|
+
];
|
|
419
|
+
const lines = [this.border("╭", " Confirm Actor Kill ", "╮", innerWidth)];
|
|
420
|
+
const availableRows = this.contentViewportRows() + 3;
|
|
421
|
+
const topPadding = Math.max(0, Math.floor((availableRows - body.length) / 2));
|
|
422
|
+
const rows = [...Array.from({ length: topPadding }, () => ""), ...body].slice(0, availableRows);
|
|
423
|
+
while (rows.length < availableRows)
|
|
424
|
+
rows.push("");
|
|
425
|
+
for (const line of rows)
|
|
426
|
+
lines.push(this.row(this.center(line, innerWidth), innerWidth));
|
|
427
|
+
lines.push(this.footerBorder(this.renderKeyHints(), innerWidth));
|
|
428
|
+
return lines;
|
|
429
|
+
}
|
|
430
|
+
renderRunControl(run, sequence) {
|
|
431
|
+
const active = this.focus === "runs" || (this.focus === "select" && this.selectorMode === "run");
|
|
432
|
+
const prefix = active ? this.theme.fg("accent", " ← ") : " ";
|
|
433
|
+
const suffix = active ? this.theme.fg("accent", " → ") : " ";
|
|
434
|
+
if (!run) {
|
|
435
|
+
const empty = this.theme.fg("muted", `${prefix}Run: none${suffix}`);
|
|
436
|
+
return this.focus === "runs" ? this.theme.bg("customMessageBg", empty) : empty;
|
|
437
|
+
}
|
|
438
|
+
const value = `${prefix}${this.theme.fg("muted", "Run: ")}${this.theme.fg("text", `#${sequence}`)} ${this.theme.fg("accent", run.run)} ${this.theme.fg(this.statusColor(run.status), run.status)}${suffix}`;
|
|
439
|
+
return this.focus === "runs" ? this.theme.bg("customMessageBg", value) : value;
|
|
440
|
+
}
|
|
441
|
+
renderTabs(run) {
|
|
442
|
+
const source = this.traceSource(run);
|
|
443
|
+
return TABS.map((tab, index) => {
|
|
444
|
+
const base = `${tab[0].toUpperCase()}${tab.slice(1)}`;
|
|
445
|
+
const label = tab === "trace" && source !== "all" ? `${base} (${source})` : base;
|
|
446
|
+
const selected = index === this.tabIndex;
|
|
447
|
+
const display = selected && this.focus !== "runs" ? `[ ${label} ]` : ` ${label} `;
|
|
448
|
+
const value = ` ${display} `;
|
|
449
|
+
if (!selected)
|
|
450
|
+
return this.theme.fg("muted", value);
|
|
451
|
+
const colored = this.theme.fg("accent", value);
|
|
452
|
+
return this.focus === "tabs" ? this.theme.bg("customMessageBg", colored) : colored;
|
|
453
|
+
}).join(" ");
|
|
454
|
+
}
|
|
455
|
+
renderContent(run, width) {
|
|
456
|
+
if (!run)
|
|
457
|
+
return [this.theme.fg("muted", " No owned actor runs")];
|
|
458
|
+
if (this.focus === "select")
|
|
459
|
+
return this.renderSelector(run);
|
|
460
|
+
if (this.focus === "detail")
|
|
461
|
+
return this.renderTraceDetail(width);
|
|
462
|
+
if (this.tab === "trace")
|
|
463
|
+
return this.renderTraceList(run);
|
|
464
|
+
const stateDir = path.join(this.stateRoot, run.run);
|
|
465
|
+
const value = this.tab === "recipe"
|
|
466
|
+
? ActorInspector.readActorInspectorRecipe(stateDir)
|
|
467
|
+
: this.controlDocument(run, stateDir);
|
|
468
|
+
const projection = this.documentProjection(value, width);
|
|
469
|
+
const maxStart = Math.max(0, projection.lines.length - this.contentViewportRows());
|
|
470
|
+
this.documentScroll = Math.min(this.documentScroll, maxStart);
|
|
471
|
+
this.contentStripeIndices = projection.stripes.slice(this.documentScroll, this.documentScroll + this.contentViewportRows());
|
|
472
|
+
return projection.lines.slice(this.documentScroll, this.documentScroll + this.contentViewportRows());
|
|
473
|
+
}
|
|
474
|
+
renderSelector(run) {
|
|
475
|
+
const options = this.selectorMode === "run"
|
|
476
|
+
? this.runs().map((item) => `run:${item.run} ${item.status}`)
|
|
477
|
+
: this.traceSources(run).map((source) => `Trace source: ${source}`);
|
|
478
|
+
const lines = this.renderMenuBox(options, this.selectorIndex);
|
|
479
|
+
this.contentStripeIndices = lines.map(() => 0);
|
|
480
|
+
return lines;
|
|
481
|
+
}
|
|
482
|
+
renderMenuBox(options, focusedIndex) {
|
|
483
|
+
if (options.length === 0)
|
|
484
|
+
return [this.theme.fg("muted", " No options")];
|
|
485
|
+
const visibleLimit = Math.max(1, Math.min(this.contentViewportRows(), options.length));
|
|
486
|
+
const maxStart = Math.max(0, options.length - visibleLimit);
|
|
487
|
+
const start = Math.max(0, Math.min(focusedIndex - Math.floor(visibleLimit / 2), maxStart));
|
|
488
|
+
const visible = options.slice(start, start + visibleLimit);
|
|
489
|
+
const width = Math.max(8, ...options.map((option) => visibleWidth(option) + 4));
|
|
490
|
+
const border = (left, right, marker = "") => this.theme.fg("borderAccent", `${left}${marker}${"─".repeat(Math.max(0, width - visibleWidth(marker)))}${right}`);
|
|
491
|
+
return [
|
|
492
|
+
border("╭", "╮", start > 0 ? "↑" : ""),
|
|
493
|
+
...visible.map((option, offset) => {
|
|
494
|
+
const index = start + offset;
|
|
495
|
+
const row = this.fit(`${index === focusedIndex ? " ▶ " : " "}${option}`, width);
|
|
496
|
+
const colored = index === focusedIndex ? this.theme.fg("accent", row) : row;
|
|
497
|
+
const styled = index === focusedIndex ? this.theme.bg("customMessageBg", colored) : colored;
|
|
498
|
+
return `${this.theme.fg("borderAccent", "│")}${styled}${this.theme.fg("borderAccent", "│")}`;
|
|
499
|
+
}),
|
|
500
|
+
border("╰", "╯", start + visible.length < options.length ? "↓" : ""),
|
|
501
|
+
];
|
|
502
|
+
}
|
|
503
|
+
renderTraceList(run) {
|
|
504
|
+
const items = this.traceItems(run);
|
|
505
|
+
const summary = RunsTrace.summarizeRunTraceJournal(RunsTrace.readRunTraceJournal(path.join(this.stateRoot, run.run)));
|
|
506
|
+
const banner = summary.history_complete ? [] : [this.theme.fg("warning", ` ! Trace history incomplete: ${summary.compacted ? `${summary.compactions_total} compaction(s), ` : ""}${summary.dropped_event_count_exact ? summary.dropped_events : "unknown"} dropped event(s), ${summary.dropped_bytes} bytes`)];
|
|
507
|
+
if (items.length === 0)
|
|
508
|
+
return [...banner, this.theme.fg("muted", " No Trace evidence")];
|
|
509
|
+
if (this.selectedTraceId) {
|
|
510
|
+
const selectedIndex = items.findIndex((item) => item.id === this.selectedTraceId);
|
|
511
|
+
if (selectedIndex >= 0)
|
|
512
|
+
this.rowIndex = selectedIndex;
|
|
513
|
+
else
|
|
514
|
+
this.selectedTraceId = undefined;
|
|
515
|
+
}
|
|
516
|
+
this.rowIndex = Math.min(this.rowIndex, items.length - 1);
|
|
517
|
+
if (this.focus === "list" && !this.selectedTraceId) {
|
|
518
|
+
this.selectedTraceId = items[this.rowIndex]?.id;
|
|
519
|
+
}
|
|
520
|
+
const viewportRows = this.contentViewportRows();
|
|
521
|
+
const maxStart = Math.max(0, items.length - viewportRows);
|
|
522
|
+
const start = Math.max(0, Math.min(this.rowIndex - Math.floor(viewportRows / 2), maxStart));
|
|
523
|
+
this.contentStripeIndices = items
|
|
524
|
+
.slice(start, start + viewportRows)
|
|
525
|
+
.map((_item, offset) => start + offset);
|
|
526
|
+
return [...banner, ...items.slice(start, start + viewportRows - banner.length).map((item, offset) => {
|
|
527
|
+
const index = start + offset;
|
|
528
|
+
const detail = item.detail && typeof item.detail === "object"
|
|
529
|
+
? item.detail
|
|
530
|
+
: {};
|
|
531
|
+
const marker = item.level === "error"
|
|
532
|
+
? this.theme.fg("error", "!")
|
|
533
|
+
: detail.attention
|
|
534
|
+
? this.theme.fg("warning", "A")
|
|
535
|
+
: " ";
|
|
536
|
+
const prefix = this.focus === "list" && index === this.rowIndex
|
|
537
|
+
? this.theme.fg("accent", " ▶ ")
|
|
538
|
+
: " ";
|
|
539
|
+
const row = `${prefix}${this.theme.fg("text", `#${items.length - index}`)} ${marker} ${this.theme.fg("muted", item.source)}/${this.theme.fg(item.level === "error" ? "error" : "accent", item.kind)} ${this.theme.fg("text", item.summary)}`;
|
|
540
|
+
return this.focus === "list" && index === this.rowIndex
|
|
541
|
+
? this.theme.fg("accent", row)
|
|
542
|
+
: row;
|
|
543
|
+
})];
|
|
544
|
+
}
|
|
545
|
+
renderTraceDetail(width) {
|
|
546
|
+
if (!this.traceDetail)
|
|
547
|
+
return [this.theme.fg("warning", " Trace row is no longer available")];
|
|
548
|
+
const projection = this.documentProjection(this.traceDetail, width);
|
|
549
|
+
const maxStart = Math.max(0, projection.lines.length - this.contentViewportRows());
|
|
550
|
+
this.detailScroll = Math.min(this.detailScroll, maxStart);
|
|
551
|
+
this.contentStripeIndices = projection.stripes.slice(this.detailScroll, this.detailScroll + this.contentViewportRows());
|
|
552
|
+
return projection.lines.slice(this.detailScroll, this.detailScroll + this.contentViewportRows());
|
|
553
|
+
}
|
|
554
|
+
controlDocument(run, stateDir) {
|
|
555
|
+
const endpoint = run.runInstanceId
|
|
556
|
+
? RunControlDelivery.readRunControlEndpoint(stateDir, run.runInstanceId)
|
|
557
|
+
: undefined;
|
|
558
|
+
const meta = this.readRunMeta(stateDir);
|
|
559
|
+
const journal = RunsControls.readRunControlJournalFromStateDir(stateDir);
|
|
560
|
+
const capacity = computeRunControlCapacity(journal.records);
|
|
561
|
+
const stalePending = journal.records.reduce((count, control) => count + Number(Boolean(RuntimeTriage.classifyRuntimeControl({ run: run.run,
|
|
562
|
+
runInstanceId: run.runInstanceId, status: run.status }, control, Date.now()).stale)), 0);
|
|
563
|
+
return {
|
|
564
|
+
status: run.status,
|
|
565
|
+
run_instance_id: run.runInstanceId,
|
|
566
|
+
pending: capacity.pending, pending_limit: capacity.limit,
|
|
567
|
+
available: capacity.available, backpressured: capacity.backpressured,
|
|
568
|
+
journal_bytes: (() => { try {
|
|
569
|
+
return statSync(RunsControls.runControlsFile(stateDir)).size;
|
|
570
|
+
}
|
|
571
|
+
catch {
|
|
572
|
+
return 0;
|
|
573
|
+
} })(),
|
|
574
|
+
journal_limit: Limits.RUN_CONTROL_JOURNAL_MAX_BYTES,
|
|
575
|
+
stale_pending: stalePending,
|
|
576
|
+
diagnostics: journal.diagnostics.map((item) => item.line === undefined
|
|
577
|
+
? { reason: "unreadable_control_journal" } : { line: item.line, reason: "invalid_control_json" }),
|
|
578
|
+
actor_actions: Array.isArray(meta.control) ? meta.control : [],
|
|
579
|
+
runtime_actions: run.status === "running" ? ["kill"] : ["archive", "prune"],
|
|
580
|
+
endpoint,
|
|
581
|
+
recent_controls: journal.records.slice(-20).reverse().map((control) => ControlProjection.projectRunControl(control)),
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
allTraceItems(run) {
|
|
585
|
+
if (!run)
|
|
586
|
+
return [];
|
|
587
|
+
if (this.traceCache?.run === run.run &&
|
|
588
|
+
this.traceCache.runInstanceId === run.runInstanceId) {
|
|
589
|
+
return this.traceCache.items;
|
|
590
|
+
}
|
|
591
|
+
const items = this.readTrace(path.join(this.stateRoot, run.run), {
|
|
592
|
+
limit: 100,
|
|
593
|
+
source: "all",
|
|
594
|
+
});
|
|
595
|
+
this.traceCache = { run: run.run, runInstanceId: run.runInstanceId, items };
|
|
596
|
+
return items;
|
|
597
|
+
}
|
|
598
|
+
traceSources(run) {
|
|
599
|
+
const present = new Set(this.allTraceItems(run).map((item) => item.source));
|
|
600
|
+
return TRACE_SOURCES.filter((source) => source === "all" || present.has(source));
|
|
601
|
+
}
|
|
602
|
+
traceSource(run) {
|
|
603
|
+
const sources = this.traceSources(run);
|
|
604
|
+
this.traceSourceIndex %= sources.length;
|
|
605
|
+
return sources[this.traceSourceIndex] ?? "all";
|
|
606
|
+
}
|
|
607
|
+
traceItems(run) {
|
|
608
|
+
const source = this.traceSource(run);
|
|
609
|
+
const items = this.allTraceItems(run);
|
|
610
|
+
return source === "all" ? items : items.filter((item) => item.source === source);
|
|
611
|
+
}
|
|
612
|
+
readRunMeta(stateDir) {
|
|
613
|
+
try {
|
|
614
|
+
return JSON.parse(readFileSync(path.join(stateDir, "run.json"), "utf8"));
|
|
615
|
+
}
|
|
616
|
+
catch {
|
|
617
|
+
return {};
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
documentProjection(value, width) {
|
|
621
|
+
const sections = value && typeof value === "object" && !Array.isArray(value)
|
|
622
|
+
? Object.entries(value).map(([key, item]) => this.labeledDocumentLines(key, item))
|
|
623
|
+
: [this.document(value)];
|
|
624
|
+
const lines = [];
|
|
625
|
+
const stripes = [];
|
|
626
|
+
sections.forEach((section, sectionIndex) => {
|
|
627
|
+
const wrapped = this.wrapDocument(section, width);
|
|
628
|
+
lines.push(...wrapped.map((line) => this.styleDocumentLine(line)));
|
|
629
|
+
stripes.push(...wrapped.map(() => sectionIndex));
|
|
630
|
+
});
|
|
631
|
+
return { lines, stripes };
|
|
632
|
+
}
|
|
633
|
+
inlineDocumentValue(value) {
|
|
634
|
+
if (Array.isArray(value)) {
|
|
635
|
+
if (value.length === 0)
|
|
636
|
+
return "[]";
|
|
637
|
+
if (value.every((item) => (item === null || typeof item !== "object") &&
|
|
638
|
+
!(typeof item === "string" && /[\r\n]/u.test(item)))) {
|
|
639
|
+
return `[${value.map((item) => String(item ?? "none")).join(", ")}]`;
|
|
640
|
+
}
|
|
641
|
+
return undefined;
|
|
642
|
+
}
|
|
643
|
+
if (value && typeof value === "object") {
|
|
644
|
+
if (Object.keys(value).length === 0)
|
|
645
|
+
return "{}";
|
|
646
|
+
}
|
|
647
|
+
return undefined;
|
|
648
|
+
}
|
|
649
|
+
labeledDocumentLines(key, value, depth = 0) {
|
|
650
|
+
const inline = this.inlineDocumentValue(value);
|
|
651
|
+
if (inline !== undefined)
|
|
652
|
+
return [`${" ".repeat(depth)}${key}: ${inline}`];
|
|
653
|
+
if (value && typeof value === "object") {
|
|
654
|
+
const indent = " ".repeat(depth);
|
|
655
|
+
const nested = this.document(value, depth);
|
|
656
|
+
return [`${indent}${key}: ${nested[0].slice(indent.length)}`, ...nested.slice(1)];
|
|
657
|
+
}
|
|
658
|
+
return this.labeledScalarLines(key, value, depth);
|
|
659
|
+
}
|
|
660
|
+
labeledScalarLines(key, value, depth = 0) {
|
|
661
|
+
const indent = " ".repeat(depth);
|
|
662
|
+
const [first = "", ...rest] = String(value ?? "none").split(/\r?\n/u);
|
|
663
|
+
return [
|
|
664
|
+
`${indent}${key}: ${first}`,
|
|
665
|
+
...rest.map((line) => `${indent} ${line}`),
|
|
666
|
+
];
|
|
667
|
+
}
|
|
668
|
+
document(value, depth = 0) {
|
|
669
|
+
if (value === null || value === undefined)
|
|
670
|
+
return [`${" ".repeat(depth)}none`];
|
|
671
|
+
const inline = this.inlineDocumentValue(value);
|
|
672
|
+
if (inline !== undefined)
|
|
673
|
+
return [`${" ".repeat(depth)}${inline}`];
|
|
674
|
+
if (Array.isArray(value)) {
|
|
675
|
+
const indent = " ".repeat(depth);
|
|
676
|
+
return [
|
|
677
|
+
`${indent}[`,
|
|
678
|
+
...value.flatMap((item, index) => {
|
|
679
|
+
const marker = `${indent} - #${index + 1}`;
|
|
680
|
+
const itemInline = this.inlineDocumentValue(item);
|
|
681
|
+
return itemInline !== undefined
|
|
682
|
+
? [`${marker}: ${itemInline}`]
|
|
683
|
+
: [marker, ...this.document(item, depth + 2)];
|
|
684
|
+
}),
|
|
685
|
+
`${indent}]`,
|
|
686
|
+
];
|
|
687
|
+
}
|
|
688
|
+
if (typeof value === "object") {
|
|
689
|
+
const indent = " ".repeat(depth);
|
|
690
|
+
const entries = Object.entries(value);
|
|
691
|
+
return [
|
|
692
|
+
`${indent}{`,
|
|
693
|
+
...entries.flatMap(([key, item], index) => {
|
|
694
|
+
const lines = this.labeledDocumentLines(key, item, depth + 1);
|
|
695
|
+
if (index < entries.length - 1)
|
|
696
|
+
lines[lines.length - 1] += ",";
|
|
697
|
+
return lines;
|
|
698
|
+
}),
|
|
699
|
+
`${indent}}`,
|
|
700
|
+
];
|
|
701
|
+
}
|
|
702
|
+
return String(value)
|
|
703
|
+
.split(/\r?\n/u)
|
|
704
|
+
.map((line) => `${" ".repeat(depth)}${line}`);
|
|
705
|
+
}
|
|
706
|
+
wrapDocument(lines, width) {
|
|
707
|
+
return lines.flatMap((line) => {
|
|
708
|
+
const normalized = line.replaceAll("\t", " ");
|
|
709
|
+
if (visibleWidth(normalized) <= width)
|
|
710
|
+
return [normalized];
|
|
711
|
+
const leading = normalized.match(/^ */u)?.[0] ?? "";
|
|
712
|
+
const continuation = `${leading} `;
|
|
713
|
+
const wrapped = [];
|
|
714
|
+
let rest = normalized.slice(leading.length);
|
|
715
|
+
let prefix = leading;
|
|
716
|
+
while (rest && visibleWidth(`${prefix}${rest}`) > width) {
|
|
717
|
+
const available = Math.max(1, width - visibleWidth(prefix));
|
|
718
|
+
const candidate = this.visiblePrefix(rest, available);
|
|
719
|
+
const minimumBreak = Math.floor(candidate.length * 0.6);
|
|
720
|
+
const preferred = Math.max(candidate.lastIndexOf(" "), candidate.lastIndexOf("/"), candidate.lastIndexOf(","));
|
|
721
|
+
const cut = preferred >= minimumBreak ? preferred + 1 : candidate.length;
|
|
722
|
+
wrapped.push(`${prefix}${rest.slice(0, cut).trimEnd()}`);
|
|
723
|
+
rest = rest.slice(cut).trimStart();
|
|
724
|
+
prefix = continuation;
|
|
725
|
+
}
|
|
726
|
+
if (rest)
|
|
727
|
+
wrapped.push(`${prefix}${rest}`);
|
|
728
|
+
return wrapped;
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
styleDocumentLine(line) {
|
|
732
|
+
const indent = line.match(/^ */u)?.[0] ?? "";
|
|
733
|
+
const content = line.slice(indent.length);
|
|
734
|
+
if (/^- #\d+$/u.test(content) || content.endsWith(":")) {
|
|
735
|
+
return `${indent}${this.theme.fg("accent", content)}`;
|
|
736
|
+
}
|
|
737
|
+
const labeled = /^([^:]+:)(.*)$/u.exec(content);
|
|
738
|
+
if (labeled) {
|
|
739
|
+
return `${indent}${this.theme.fg("muted", labeled[1])}${this.theme.fg("text", labeled[2])}`;
|
|
740
|
+
}
|
|
741
|
+
return `${indent}${this.theme.fg(content === "none" || content === "[]" ? "muted" : "text", content)}`;
|
|
742
|
+
}
|
|
743
|
+
visiblePrefix(value, width) {
|
|
744
|
+
let consumed = 0;
|
|
745
|
+
let result = "";
|
|
746
|
+
for (const character of value) {
|
|
747
|
+
const characterWidth = visibleWidth(character);
|
|
748
|
+
if (consumed + characterWidth > width)
|
|
749
|
+
break;
|
|
750
|
+
result += character;
|
|
751
|
+
consumed += characterWidth;
|
|
752
|
+
}
|
|
753
|
+
return result;
|
|
754
|
+
}
|
|
755
|
+
renderKeyHints() {
|
|
756
|
+
const hint = (keys, description) => `${this.theme.fg("accent", keys)}${this.theme.fg("borderAccent", ` ${description}`)}`;
|
|
757
|
+
const divider = this.theme.fg("borderAccent", " ─ ");
|
|
758
|
+
const hints = (...items) => items.map(([keys, description]) => hint(keys, description)).join(divider);
|
|
759
|
+
if (this.killConfirmation) {
|
|
760
|
+
return hints(["←→/tab", "choose"], ["enter/y", "confirm"], ["esc/n", "cancel"]);
|
|
761
|
+
}
|
|
762
|
+
if (this.focus === "select") {
|
|
763
|
+
return hints(["↑↓", "option"], ["enter/→", "apply"], ["←/esc", "back"]);
|
|
764
|
+
}
|
|
765
|
+
if (this.focus === "detail") {
|
|
766
|
+
return hints(["↑↓/pgup/pgdn", "scroll"], ["←/esc", "back"]);
|
|
767
|
+
}
|
|
768
|
+
if (this.focus === "document") {
|
|
769
|
+
return hints(["↑↓/pgup/pgdn", "scroll"], ["↑ at top", "tabs"], ["←/esc", "tabs"]);
|
|
770
|
+
}
|
|
771
|
+
if (this.focus === "list") {
|
|
772
|
+
return hints(["↑↓/pgup/pgdn", "row"], ["→/enter", "open"], ["←", "tabs"], ["esc", "close"]);
|
|
773
|
+
}
|
|
774
|
+
if (this.focus === "runs") {
|
|
775
|
+
const items = [["←→", "run"], ["↓", "tabs"], ["enter", "list"]];
|
|
776
|
+
const run = this.runs()[this.runIndex];
|
|
777
|
+
if (this.killRun && run?.status === "running" && run.runInstanceId)
|
|
778
|
+
items.push(["k", "kill"]);
|
|
779
|
+
items.push(["esc", "close"]);
|
|
780
|
+
return hints(...items);
|
|
781
|
+
}
|
|
782
|
+
return this.tab === "trace"
|
|
783
|
+
? hints(["←→", "tabs"], ["↑↓", "focus"], ["enter/f", "source"], ["esc", "close"])
|
|
784
|
+
: hints(["←→", "tabs"], ["↑↓", "focus"], ["enter", "open"], ["esc", "close"]);
|
|
785
|
+
}
|
|
786
|
+
statusColor(status) {
|
|
787
|
+
if (status === "failed")
|
|
788
|
+
return "error";
|
|
789
|
+
if (status === "running")
|
|
790
|
+
return "warning";
|
|
791
|
+
if (status === "done" || status === "terminal")
|
|
792
|
+
return "success";
|
|
793
|
+
return "muted";
|
|
794
|
+
}
|
|
795
|
+
footerBorder(hints, width) {
|
|
796
|
+
const prefix = " ";
|
|
797
|
+
const suffix = " ─";
|
|
798
|
+
const content = truncateToWidth(hints, Math.max(0, width - visibleWidth(prefix) - visibleWidth(suffix)), "");
|
|
799
|
+
const fill = "─".repeat(Math.max(0, width - visibleWidth(prefix) - visibleWidth(suffix) - visibleWidth(content)));
|
|
800
|
+
return `${this.theme.fg("borderAccent", `╰${prefix}`)}${content}${this.theme.fg("borderAccent", `${suffix}${fill}╯`)}`;
|
|
801
|
+
}
|
|
802
|
+
stripeBackground(content, index) {
|
|
803
|
+
return index % 2 === 0 ? content : this.theme.bg("customMessageBg", content);
|
|
804
|
+
}
|
|
805
|
+
stripedRow(content, width, index) {
|
|
806
|
+
const fitted = this.fit(content, width);
|
|
807
|
+
return `${this.theme.fg("borderAccent", "│")}${this.stripeBackground(fitted, index)}${this.theme.fg("borderAccent", "│")}`;
|
|
808
|
+
}
|
|
809
|
+
row(content, width) {
|
|
810
|
+
return `${this.theme.fg("borderAccent", "│")}${this.fit(content, width)}${this.theme.fg("borderAccent", "│")}`;
|
|
811
|
+
}
|
|
812
|
+
border(left, label, right, width) {
|
|
813
|
+
const bounded = truncateToWidth(label, width, "");
|
|
814
|
+
return this.theme.fg("borderAccent", `${left}${bounded}${"─".repeat(Math.max(0, width - visibleWidth(bounded)))}${right}`);
|
|
815
|
+
}
|
|
816
|
+
fit(content, width) {
|
|
817
|
+
const bounded = truncateToWidth(content, width, "");
|
|
818
|
+
return `${bounded}${" ".repeat(Math.max(0, width - visibleWidth(bounded)))}`;
|
|
819
|
+
}
|
|
820
|
+
center(content, width) {
|
|
821
|
+
const padding = Math.max(0, Math.floor((width - visibleWidth(content)) / 2));
|
|
822
|
+
return `${" ".repeat(padding)}${content}`;
|
|
823
|
+
}
|
|
824
|
+
}
|