@kya-os/cli 1.7.0 → 1.8.3
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/dist/commands/agent.d.ts +35 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +321 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/build.js +2 -2
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/check.js +3 -3
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/checkpoint-init.d.ts +32 -0
- package/dist/commands/checkpoint-init.d.ts.map +1 -0
- package/dist/commands/checkpoint-init.js +521 -0
- package/dist/commands/checkpoint-init.js.map +1 -0
- package/dist/commands/claim.js +2 -2
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/dco.d.ts +59 -0
- package/dist/commands/dco.d.ts.map +1 -1
- package/dist/commands/dco.js +280 -5
- package/dist/commands/dco.js.map +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +18 -24
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env.js +6 -6
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/identity.js +3 -3
- package/dist/commands/identity.js.map +1 -1
- package/dist/commands/init-stages.d.ts +141 -0
- package/dist/commands/init-stages.d.ts.map +1 -0
- package/dist/commands/init-stages.js +684 -0
- package/dist/commands/init-stages.js.map +1 -0
- package/dist/commands/init.d.ts +46 -16
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +229 -279
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/orchestrator.d.ts +18 -0
- package/dist/commands/orchestrator.d.ts.map +1 -0
- package/dist/commands/orchestrator.js +251 -0
- package/dist/commands/orchestrator.js.map +1 -0
- package/dist/commands/register.d.ts +1 -1
- package/dist/commands/register.d.ts.map +1 -1
- package/dist/commands/register.js +35 -7
- package/dist/commands/register.js.map +1 -1
- package/dist/commands/review.d.ts +48 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +220 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/rotate.js +4 -4
- package/dist/commands/rotate.js.map +1 -1
- package/dist/commands/score.d.ts +15 -0
- package/dist/commands/score.d.ts.map +1 -0
- package/dist/commands/score.js +471 -0
- package/dist/commands/score.js.map +1 -0
- package/dist/commands/start.js +3 -3
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/verify.js +6 -6
- package/dist/commands/verify.js.map +1 -1
- package/dist/dco.d.ts +4 -0
- package/dist/dco.d.ts.map +1 -0
- package/dist/dco.js +23 -0
- package/dist/dco.js.map +1 -0
- package/dist/index.js +62 -11
- package/dist/orchestrator/daemon.d.ts +137 -0
- package/dist/orchestrator/daemon.d.ts.map +1 -0
- package/dist/orchestrator/daemon.js +242 -0
- package/dist/orchestrator/daemon.js.map +1 -0
- package/dist/orchestrator/db/dispatches.d.ts +108 -0
- package/dist/orchestrator/db/dispatches.d.ts.map +1 -0
- package/dist/orchestrator/db/dispatches.js +122 -0
- package/dist/orchestrator/db/dispatches.js.map +1 -0
- package/dist/orchestrator/db/index.d.ts +50 -0
- package/dist/orchestrator/db/index.d.ts.map +1 -0
- package/dist/orchestrator/db/index.js +116 -0
- package/dist/orchestrator/db/index.js.map +1 -0
- package/dist/orchestrator/db/journal.d.ts +93 -0
- package/dist/orchestrator/db/journal.d.ts.map +1 -0
- package/dist/orchestrator/db/journal.js +91 -0
- package/dist/orchestrator/db/journal.js.map +1 -0
- package/dist/orchestrator/db/liveness.d.ts +97 -0
- package/dist/orchestrator/db/liveness.d.ts.map +1 -0
- package/dist/orchestrator/db/liveness.js +105 -0
- package/dist/orchestrator/db/liveness.js.map +1 -0
- package/dist/orchestrator/db/mission.d.ts +78 -0
- package/dist/orchestrator/db/mission.d.ts.map +1 -0
- package/dist/orchestrator/db/mission.js +99 -0
- package/dist/orchestrator/db/mission.js.map +1 -0
- package/dist/orchestrator/db/schema.d.ts +14 -0
- package/dist/orchestrator/db/schema.d.ts.map +1 -0
- package/dist/orchestrator/db/schema.js +169 -0
- package/dist/orchestrator/db/schema.js.map +1 -0
- package/dist/orchestrator/db/tickets.d.ts +147 -0
- package/dist/orchestrator/db/tickets.d.ts.map +1 -0
- package/dist/orchestrator/db/tickets.js +238 -0
- package/dist/orchestrator/db/tickets.js.map +1 -0
- package/dist/orchestrator/db/verdicts.d.ts +187 -0
- package/dist/orchestrator/db/verdicts.d.ts.map +1 -0
- package/dist/orchestrator/db/verdicts.js +197 -0
- package/dist/orchestrator/db/verdicts.js.map +1 -0
- package/dist/orchestrator/events.d.ts +69 -0
- package/dist/orchestrator/events.d.ts.map +1 -0
- package/dist/orchestrator/events.js +20 -0
- package/dist/orchestrator/events.js.map +1 -0
- package/dist/orchestrator/github-credential-anchor-sender.d.ts +159 -0
- package/dist/orchestrator/github-credential-anchor-sender.d.ts.map +1 -0
- package/dist/orchestrator/github-credential-anchor-sender.js +313 -0
- package/dist/orchestrator/github-credential-anchor-sender.js.map +1 -0
- package/dist/orchestrator/hub-dispatch.d.ts +120 -0
- package/dist/orchestrator/hub-dispatch.d.ts.map +1 -0
- package/dist/orchestrator/hub-dispatch.js +257 -0
- package/dist/orchestrator/hub-dispatch.js.map +1 -0
- package/dist/orchestrator/hub-observer.d.ts +201 -0
- package/dist/orchestrator/hub-observer.d.ts.map +1 -0
- package/dist/orchestrator/hub-observer.js +474 -0
- package/dist/orchestrator/hub-observer.js.map +1 -0
- package/dist/orchestrator/journal-writer.d.ts +80 -0
- package/dist/orchestrator/journal-writer.d.ts.map +1 -0
- package/dist/orchestrator/journal-writer.js +113 -0
- package/dist/orchestrator/journal-writer.js.map +1 -0
- package/dist/orchestrator/mcp/server.d.ts +136 -0
- package/dist/orchestrator/mcp/server.d.ts.map +1 -0
- package/dist/orchestrator/mcp/server.js +582 -0
- package/dist/orchestrator/mcp/server.js.map +1 -0
- package/dist/orchestrator/mcp/stdio.d.ts +22 -0
- package/dist/orchestrator/mcp/stdio.d.ts.map +1 -0
- package/dist/orchestrator/mcp/stdio.js +51 -0
- package/dist/orchestrator/mcp/stdio.js.map +1 -0
- package/dist/orchestrator/review.d.ts +131 -0
- package/dist/orchestrator/review.d.ts.map +1 -0
- package/dist/orchestrator/review.js +322 -0
- package/dist/orchestrator/review.js.map +1 -0
- package/dist/tui/app.d.ts +33 -0
- package/dist/tui/app.d.ts.map +1 -0
- package/dist/tui/app.js +71 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/components.d.ts +110 -0
- package/dist/tui/components.d.ts.map +1 -0
- package/dist/tui/components.js +118 -0
- package/dist/tui/components.js.map +1 -0
- package/dist/tui/index.d.ts +30 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +95 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/keymap.d.ts +33 -0
- package/dist/tui/keymap.d.ts.map +1 -0
- package/dist/tui/keymap.js +49 -0
- package/dist/tui/keymap.js.map +1 -0
- package/dist/tui/nav.d.ts +29 -0
- package/dist/tui/nav.d.ts.map +1 -0
- package/dist/tui/nav.js +39 -0
- package/dist/tui/nav.js.map +1 -0
- package/dist/tui/sanitize.d.ts +25 -0
- package/dist/tui/sanitize.d.ts.map +1 -0
- package/dist/tui/sanitize.js +36 -0
- package/dist/tui/sanitize.js.map +1 -0
- package/dist/tui/theme.d.ts +32 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +63 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/tui/views/agents.d.ts +67 -0
- package/dist/tui/views/agents.d.ts.map +1 -0
- package/dist/tui/views/agents.js +231 -0
- package/dist/tui/views/agents.js.map +1 -0
- package/dist/tui/views/index.d.ts +93 -0
- package/dist/tui/views/index.d.ts.map +1 -0
- package/dist/tui/views/index.js +150 -0
- package/dist/tui/views/index.js.map +1 -0
- package/dist/tui/views/registry.d.ts +22 -0
- package/dist/tui/views/registry.d.ts.map +1 -0
- package/dist/tui/views/registry.js +110 -0
- package/dist/tui/views/registry.js.map +1 -0
- package/dist/utils/agent/backoff.d.ts +31 -0
- package/dist/utils/agent/backoff.d.ts.map +1 -0
- package/dist/utils/agent/backoff.js +51 -0
- package/dist/utils/agent/backoff.js.map +1 -0
- package/dist/utils/agent/markers.d.ts +87 -0
- package/dist/utils/agent/markers.d.ts.map +1 -0
- package/dist/utils/agent/markers.js +147 -0
- package/dist/utils/agent/markers.js.map +1 -0
- package/dist/utils/agent/review.d.ts +67 -0
- package/dist/utils/agent/review.d.ts.map +1 -0
- package/dist/utils/agent/review.js +305 -0
- package/dist/utils/agent/review.js.map +1 -0
- package/dist/utils/agent/spawn-agent.d.ts +117 -0
- package/dist/utils/agent/spawn-agent.d.ts.map +1 -0
- package/dist/utils/agent/spawn-agent.js +177 -0
- package/dist/utils/agent/spawn-agent.js.map +1 -0
- package/dist/utils/agent/task.d.ts +101 -0
- package/dist/utils/agent/task.d.ts.map +1 -0
- package/dist/utils/agent/task.js +357 -0
- package/dist/utils/agent/task.js.map +1 -0
- package/dist/utils/agent/verify.d.ts +47 -0
- package/dist/utils/agent/verify.d.ts.map +1 -0
- package/dist/utils/agent/verify.js +144 -0
- package/dist/utils/agent/verify.js.map +1 -0
- package/dist/utils/agent-detector.d.ts +48 -0
- package/dist/utils/agent-detector.d.ts.map +1 -0
- package/dist/utils/agent-detector.js +74 -0
- package/dist/utils/agent-detector.js.map +1 -0
- package/dist/utils/agent-profile-stage.d.ts +70 -0
- package/dist/utils/agent-profile-stage.d.ts.map +1 -0
- package/dist/utils/agent-profile-stage.js +153 -0
- package/dist/utils/agent-profile-stage.js.map +1 -0
- package/dist/utils/agent-profiles.d.ts +27 -0
- package/dist/utils/agent-profiles.d.ts.map +1 -0
- package/dist/utils/agent-profiles.js +61 -0
- package/dist/utils/agent-profiles.js.map +1 -0
- package/dist/utils/checkpoint-api.d.ts +86 -0
- package/dist/utils/checkpoint-api.d.ts.map +1 -0
- package/dist/utils/checkpoint-api.js +196 -0
- package/dist/utils/checkpoint-api.js.map +1 -0
- package/dist/utils/checkpoint-env.d.ts +23 -0
- package/dist/utils/checkpoint-env.d.ts.map +1 -0
- package/dist/utils/checkpoint-env.js +59 -0
- package/dist/utils/checkpoint-env.js.map +1 -0
- package/dist/utils/checkpoint-scaffold.d.ts +61 -0
- package/dist/utils/checkpoint-scaffold.d.ts.map +1 -0
- package/dist/utils/checkpoint-scaffold.js +268 -0
- package/dist/utils/checkpoint-scaffold.js.map +1 -0
- package/dist/utils/cli-kit/browser.d.ts +24 -0
- package/dist/utils/cli-kit/browser.d.ts.map +1 -0
- package/dist/utils/cli-kit/browser.js +58 -0
- package/dist/utils/cli-kit/browser.js.map +1 -0
- package/dist/utils/cli-kit/claim-polling.d.ts +18 -0
- package/dist/utils/cli-kit/claim-polling.d.ts.map +1 -0
- package/dist/utils/{claim-polling.js → cli-kit/claim-polling.js} +19 -26
- package/dist/utils/cli-kit/claim-polling.js.map +1 -0
- package/dist/utils/cli-kit/diagnostics.d.ts +9 -0
- package/dist/utils/cli-kit/diagnostics.d.ts.map +1 -0
- package/dist/utils/cli-kit/diagnostics.js +11 -0
- package/dist/utils/cli-kit/diagnostics.js.map +1 -0
- package/dist/utils/cli-kit/fs-safe.d.ts +14 -0
- package/dist/utils/cli-kit/fs-safe.d.ts.map +1 -0
- package/dist/utils/cli-kit/fs-safe.js +20 -0
- package/dist/utils/cli-kit/fs-safe.js.map +1 -0
- package/dist/utils/cli-kit/index.d.ts +15 -0
- package/dist/utils/cli-kit/index.d.ts.map +1 -0
- package/dist/utils/cli-kit/index.js +10 -0
- package/dist/utils/cli-kit/index.js.map +1 -0
- package/dist/utils/cli-kit/json-file.d.ts +21 -0
- package/dist/utils/cli-kit/json-file.d.ts.map +1 -0
- package/dist/utils/cli-kit/json-file.js +51 -0
- package/dist/utils/cli-kit/json-file.js.map +1 -0
- package/dist/utils/cli-kit/marker-block.d.ts +26 -0
- package/dist/utils/cli-kit/marker-block.d.ts.map +1 -0
- package/dist/utils/cli-kit/marker-block.js +61 -0
- package/dist/utils/cli-kit/marker-block.js.map +1 -0
- package/dist/utils/cli-kit/paths.d.ts +15 -0
- package/dist/utils/cli-kit/paths.d.ts.map +1 -0
- package/dist/utils/cli-kit/paths.js +21 -0
- package/dist/utils/cli-kit/paths.js.map +1 -0
- package/dist/utils/cli-kit/secure-storage.d.ts +14 -0
- package/dist/utils/cli-kit/secure-storage.d.ts.map +1 -0
- package/dist/utils/cli-kit/secure-storage.js +20 -0
- package/dist/utils/cli-kit/secure-storage.js.map +1 -0
- package/dist/utils/cli-kit/step-report.d.ts +16 -0
- package/dist/utils/cli-kit/step-report.d.ts.map +1 -0
- package/dist/utils/cli-kit/step-report.js +36 -0
- package/dist/utils/cli-kit/step-report.js.map +1 -0
- package/dist/utils/dco/agent-metadata.d.ts +1 -1
- package/dist/utils/dco/agent-metadata.js +1 -1
- package/dist/utils/dco/agent-metadata.js.map +1 -1
- package/dist/utils/dco/claude-config.d.ts +18 -8
- package/dist/utils/dco/claude-config.d.ts.map +1 -1
- package/dist/utils/dco/claude-config.js +33 -79
- package/dist/utils/dco/claude-config.js.map +1 -1
- package/dist/utils/dco/dispatch.d.ts +134 -0
- package/dist/utils/dco/dispatch.d.ts.map +1 -0
- package/dist/utils/dco/dispatch.js +399 -0
- package/dist/utils/dco/dispatch.js.map +1 -0
- package/dist/utils/dco/fix.d.ts +122 -0
- package/dist/utils/dco/fix.d.ts.map +1 -0
- package/dist/utils/dco/fix.js +560 -0
- package/dist/utils/dco/fix.js.map +1 -0
- package/dist/utils/dco/git-config.d.ts.map +1 -1
- package/dist/utils/dco/git-config.js +5 -3
- package/dist/utils/dco/git-config.js.map +1 -1
- package/dist/utils/dco/github.d.ts +101 -0
- package/dist/utils/dco/github.d.ts.map +1 -1
- package/dist/utils/dco/github.js +133 -0
- package/dist/utils/dco/github.js.map +1 -1
- package/dist/utils/dco/paths.d.ts +1 -8
- package/dist/utils/dco/paths.d.ts.map +1 -1
- package/dist/utils/dco/paths.js +3 -12
- package/dist/utils/dco/paths.js.map +1 -1
- package/dist/utils/dco/render.d.ts +1 -1
- package/dist/utils/dco/render.d.ts.map +1 -1
- package/dist/utils/dco/render.js +4 -21
- package/dist/utils/dco/render.js.map +1 -1
- package/dist/utils/dco/resolve-agent.d.ts +54 -0
- package/dist/utils/dco/resolve-agent.d.ts.map +1 -0
- package/dist/utils/dco/resolve-agent.js +164 -0
- package/dist/utils/dco/resolve-agent.js.map +1 -0
- package/dist/utils/dco/setup.d.ts +10 -7
- package/dist/utils/dco/setup.d.ts.map +1 -1
- package/dist/utils/dco/setup.js +264 -199
- package/dist/utils/dco/setup.js.map +1 -1
- package/dist/utils/dco/signing-key-writer.d.ts +40 -0
- package/dist/utils/dco/signing-key-writer.d.ts.map +1 -0
- package/dist/utils/dco/signing-key-writer.js +76 -0
- package/dist/utils/dco/signing-key-writer.js.map +1 -0
- package/dist/utils/dco/ssh-key.d.ts +50 -0
- package/dist/utils/dco/ssh-key.d.ts.map +1 -1
- package/dist/utils/dco/ssh-key.js +129 -8
- package/dist/utils/dco/ssh-key.js.map +1 -1
- package/dist/utils/dco/status.d.ts +1 -1
- package/dist/utils/dco/status.d.ts.map +1 -1
- package/dist/utils/dco/status.js +3 -3
- package/dist/utils/dco/status.js.map +1 -1
- package/dist/utils/dco/verify.d.ts +170 -0
- package/dist/utils/dco/verify.d.ts.map +1 -0
- package/dist/utils/dco/verify.js +550 -0
- package/dist/utils/dco/verify.js.map +1 -0
- package/dist/utils/dependency-installer.d.ts +37 -0
- package/dist/utils/dependency-installer.d.ts.map +1 -0
- package/dist/utils/dependency-installer.js +32 -0
- package/dist/utils/dependency-installer.js.map +1 -0
- package/dist/utils/github-credential-stage.d.ts +87 -0
- package/dist/utils/github-credential-stage.d.ts.map +1 -0
- package/dist/utils/github-credential-stage.js +168 -0
- package/dist/utils/github-credential-stage.js.map +1 -0
- package/dist/utils/github-credential.d.ts +160 -0
- package/dist/utils/github-credential.d.ts.map +1 -0
- package/dist/utils/github-credential.js +308 -0
- package/dist/utils/github-credential.js.map +1 -0
- package/dist/utils/gitignore.d.ts +17 -0
- package/dist/utils/gitignore.d.ts.map +1 -0
- package/dist/utils/gitignore.js +40 -0
- package/dist/utils/gitignore.js.map +1 -0
- package/dist/utils/hub-config.d.ts +21 -0
- package/dist/utils/hub-config.d.ts.map +1 -0
- package/dist/utils/hub-config.js +28 -0
- package/dist/utils/hub-config.js.map +1 -0
- package/dist/utils/identity-heal.d.ts +16 -0
- package/dist/utils/identity-heal.d.ts.map +1 -0
- package/dist/utils/identity-heal.js +37 -0
- package/dist/utils/identity-heal.js.map +1 -0
- package/dist/utils/init/pipeline.d.ts +74 -0
- package/dist/utils/init/pipeline.d.ts.map +1 -0
- package/dist/utils/init/pipeline.js +96 -0
- package/dist/utils/init/pipeline.js.map +1 -0
- package/dist/utils/poll.d.ts +64 -0
- package/dist/utils/poll.d.ts.map +1 -0
- package/dist/utils/poll.js +76 -0
- package/dist/utils/poll.js.map +1 -0
- package/dist/utils/register-agent-identity.d.ts +67 -0
- package/dist/utils/register-agent-identity.d.ts.map +1 -0
- package/dist/utils/register-agent-identity.js +34 -0
- package/dist/utils/register-agent-identity.js.map +1 -0
- package/dist/utils/review/did-web-key.d.ts +34 -0
- package/dist/utils/review/did-web-key.d.ts.map +1 -0
- package/dist/utils/review/did-web-key.js +104 -0
- package/dist/utils/review/did-web-key.js.map +1 -0
- package/dist/utils/review/load-registry.d.ts +33 -0
- package/dist/utils/review/load-registry.d.ts.map +1 -0
- package/dist/utils/review/load-registry.js +62 -0
- package/dist/utils/review/load-registry.js.map +1 -0
- package/dist/utils/review/verdict-verify.d.ts +43 -0
- package/dist/utils/review/verdict-verify.d.ts.map +1 -0
- package/dist/utils/review/verdict-verify.js +53 -0
- package/dist/utils/review/verdict-verify.js.map +1 -0
- package/dist/utils/review-registry-writer.d.ts +52 -0
- package/dist/utils/review-registry-writer.d.ts.map +1 -0
- package/dist/utils/review-registry-writer.js +79 -0
- package/dist/utils/review-registry-writer.js.map +1 -0
- package/dist/utils/should-install-dependency.d.ts +17 -0
- package/dist/utils/should-install-dependency.d.ts.map +1 -0
- package/dist/utils/should-install-dependency.js +25 -0
- package/dist/utils/should-install-dependency.js.map +1 -0
- package/dist/utils/tool-readiness.d.ts +57 -0
- package/dist/utils/tool-readiness.d.ts.map +1 -0
- package/dist/utils/tool-readiness.js +114 -0
- package/dist/utils/tool-readiness.js.map +1 -0
- package/dist/utils/which.d.ts +2 -0
- package/dist/utils/which.d.ts.map +1 -0
- package/dist/utils/which.js +22 -0
- package/dist/utils/which.js.map +1 -0
- package/dist/version.d.ts +15 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +29 -0
- package/dist/version.js.map +1 -0
- package/package.json +19 -6
- package/dist/utils/claim-polling.d.ts +0 -21
- package/dist/utils/claim-polling.d.ts.map +0 -1
- package/dist/utils/claim-polling.js.map +0 -1
- package/dist/utils/dco/fs-safe.d.ts +0 -14
- package/dist/utils/dco/fs-safe.d.ts.map +0 -1
- package/dist/utils/dco/fs-safe.js +0 -20
- package/dist/utils/dco/fs-safe.js.map +0 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI palette.
|
|
3
|
+
*
|
|
4
|
+
* Muted, with exactly ONE accent, per the terminal.shop interaction grammar.
|
|
5
|
+
* A second accent is how a terminal UI starts looking like a Christmas tree:
|
|
6
|
+
* once two colours both mean "important", neither does.
|
|
7
|
+
*
|
|
8
|
+
* Colours are named by ROLE, not by hue, so a future theme swap changes one
|
|
9
|
+
* file and every call site keeps reading correctly.
|
|
10
|
+
*
|
|
11
|
+
* @module cli/tui/theme
|
|
12
|
+
*/
|
|
13
|
+
export declare const theme: {
|
|
14
|
+
/** The single accent. Selection, focus, the active nav row. */
|
|
15
|
+
readonly accent: "#b4530a";
|
|
16
|
+
/** Primary text. */
|
|
17
|
+
readonly fg: "white";
|
|
18
|
+
/** Secondary text: labels, units, timestamps, anything you read second. */
|
|
19
|
+
readonly dim: "gray";
|
|
20
|
+
/** Dividers and rules. */
|
|
21
|
+
readonly line: "gray";
|
|
22
|
+
/** Status colours, deliberately few and reused across every view. */
|
|
23
|
+
readonly ok: "green";
|
|
24
|
+
readonly warn: "yellow";
|
|
25
|
+
readonly bad: "red";
|
|
26
|
+
readonly info: "cyan";
|
|
27
|
+
};
|
|
28
|
+
/** Ticket status -> colour. One mapping, so no two views disagree. */
|
|
29
|
+
export declare function statusColor(status: string): string;
|
|
30
|
+
/** Review-finding severity -> colour, matching the contracts vocabulary. */
|
|
31
|
+
export declare function severityColor(severity: string | null): string;
|
|
32
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/tui/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,KAAK;IAChB,+DAA+D;;IAE/D,oBAAoB;;IAEpB,2EAA2E;;IAE3E,0BAA0B;;IAG1B,qEAAqE;;;;;CAK7D,CAAC;AAEX,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAkBlD;AAED,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAa7D"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI palette.
|
|
3
|
+
*
|
|
4
|
+
* Muted, with exactly ONE accent, per the terminal.shop interaction grammar.
|
|
5
|
+
* A second accent is how a terminal UI starts looking like a Christmas tree:
|
|
6
|
+
* once two colours both mean "important", neither does.
|
|
7
|
+
*
|
|
8
|
+
* Colours are named by ROLE, not by hue, so a future theme swap changes one
|
|
9
|
+
* file and every call site keeps reading correctly.
|
|
10
|
+
*
|
|
11
|
+
* @module cli/tui/theme
|
|
12
|
+
*/
|
|
13
|
+
export const theme = {
|
|
14
|
+
/** The single accent. Selection, focus, the active nav row. */
|
|
15
|
+
accent: "#b4530a",
|
|
16
|
+
/** Primary text. */
|
|
17
|
+
fg: "white",
|
|
18
|
+
/** Secondary text: labels, units, timestamps, anything you read second. */
|
|
19
|
+
dim: "gray",
|
|
20
|
+
/** Dividers and rules. */
|
|
21
|
+
line: "gray",
|
|
22
|
+
/** Status colours, deliberately few and reused across every view. */
|
|
23
|
+
ok: "green",
|
|
24
|
+
warn: "yellow",
|
|
25
|
+
bad: "red",
|
|
26
|
+
info: "cyan",
|
|
27
|
+
};
|
|
28
|
+
/** Ticket status -> colour. One mapping, so no two views disagree. */
|
|
29
|
+
export function statusColor(status) {
|
|
30
|
+
switch (status) {
|
|
31
|
+
case "open":
|
|
32
|
+
return theme.info;
|
|
33
|
+
case "claimed":
|
|
34
|
+
case "in-progress":
|
|
35
|
+
return theme.accent;
|
|
36
|
+
case "in-review":
|
|
37
|
+
return theme.warn;
|
|
38
|
+
case "blocked":
|
|
39
|
+
return theme.bad;
|
|
40
|
+
case "ready":
|
|
41
|
+
return theme.ok;
|
|
42
|
+
case "closed":
|
|
43
|
+
return theme.dim;
|
|
44
|
+
default:
|
|
45
|
+
return theme.fg;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/** Review-finding severity -> colour, matching the contracts vocabulary. */
|
|
49
|
+
export function severityColor(severity) {
|
|
50
|
+
switch (severity) {
|
|
51
|
+
case "blocking":
|
|
52
|
+
return theme.bad;
|
|
53
|
+
case "major":
|
|
54
|
+
return theme.warn;
|
|
55
|
+
case "minor":
|
|
56
|
+
return theme.info;
|
|
57
|
+
case "nit":
|
|
58
|
+
return theme.dim;
|
|
59
|
+
default:
|
|
60
|
+
return theme.dim;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","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0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agents view (review-loop P18 commit 2): one row per profile from
|
|
3
|
+
* `listProfiles()` (`~/.mcpi/profiles/`), not the SQLite ledger the other
|
|
4
|
+
* "ledger" views read -- so it stays honest and simple, this file reads
|
|
5
|
+
* profiles directly rather than folding them into `LedgerSnapshot`. Hub
|
|
6
|
+
* connection state and per-DID lifecycle status come from the same
|
|
7
|
+
* ledger snapshot every other view already has (dispatches/journal),
|
|
8
|
+
* read-only: the orchestrator daemon owns writing that ledger, this view
|
|
9
|
+
* never does.
|
|
10
|
+
*
|
|
11
|
+
* Row focus is a deliberate sub-mode, entered with Enter and exited with
|
|
12
|
+
* Escape, because its own keys (j/k to move the cursor, letters to act)
|
|
13
|
+
* would otherwise collide with the frame's global nav keys, which read the
|
|
14
|
+
* exact same input. `setNavSuspended` is how it tells the frame to stop
|
|
15
|
+
* reading nav keys while it owns the keyboard.
|
|
16
|
+
*
|
|
17
|
+
* @module cli/tui/views/agents
|
|
18
|
+
*/
|
|
19
|
+
import type { ViewProps } from "./index.js";
|
|
20
|
+
import type { AgentProfile } from "../../utils/agent-profiles.js";
|
|
21
|
+
import type { DispatchRow } from "../../orchestrator/db/dispatches.js";
|
|
22
|
+
import type { JournalRow } from "../../orchestrator/db/journal.js";
|
|
23
|
+
/** A dispatch outcome, as the caller-provided dispatch action reports it. */
|
|
24
|
+
export interface DispatchOutcome {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
/** "accepted" | "completed" | "refused" | "timeout" | "error" | ... */
|
|
27
|
+
status: string;
|
|
28
|
+
detail?: string;
|
|
29
|
+
/** A transport-trust warning (e.g. plaintext ws:// to a non-loopback host). */
|
|
30
|
+
warning?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface AgentsViewProps extends ViewProps {
|
|
33
|
+
profiles: AgentProfile[];
|
|
34
|
+
dispatches: DispatchRow[];
|
|
35
|
+
journal: JournalRow[];
|
|
36
|
+
/** Whether ~/.mcpi/hub.json exists -- gates the dispatch action entirely. */
|
|
37
|
+
hubConnected: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Writes text to the system clipboard via an OSC 52 escape sequence (no
|
|
40
|
+
* clipboard dependency). Injectable so tests can capture it instead of
|
|
41
|
+
* writing real escape sequences into the test harness's stdout buffer.
|
|
42
|
+
*/
|
|
43
|
+
copyToClipboard?: (text: string) => void;
|
|
44
|
+
/**
|
|
45
|
+
* review-loop P13's dispatchable run functions, once that PR lands.
|
|
46
|
+
* Undefined means "not available" -- the launch action is hidden, not
|
|
47
|
+
* merely disabled, so this PR does not depend on P13 to ship.
|
|
48
|
+
*/
|
|
49
|
+
launchAgentFlow?: (kind: "task" | "review", profile: AgentProfile) => void;
|
|
50
|
+
/**
|
|
51
|
+
* The dispatch action itself (review-loop P18 commit 4). Undefined
|
|
52
|
+
* exercises the "hidden without hub.json" path; commit 4 wires the real
|
|
53
|
+
* implementation in from registry.tsx.
|
|
54
|
+
*/
|
|
55
|
+
dispatchTask?: (profile: AgentProfile, command: string) => Promise<DispatchOutcome>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* OSC 52: set the system clipboard from a terminal, with no clipboard
|
|
59
|
+
* dependency -- most modern terminal emulators (iTerm2, kitty, WezTerm,
|
|
60
|
+
* Windows Terminal, tmux with `set -g set-clipboard on`) implement this
|
|
61
|
+
* escape sequence, so a real "copy" works without shelling out to a
|
|
62
|
+
* platform clipboard binary or adding a cross-platform clipboard package.
|
|
63
|
+
* BEL-terminated: the most widely supported form.
|
|
64
|
+
*/
|
|
65
|
+
export declare function osc52SetClipboard(text: string): string;
|
|
66
|
+
export declare function AgentsView({ width, profiles, dispatches, journal, hubConnected, copyToClipboard, launchAgentFlow, dispatchTask, setNavSuspended, }: AgentsViewProps): JSX.Element;
|
|
67
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/tui/views/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,EAAE,eAAe,GAAG,GAAG,CAAC,OAAO,CA6N/B"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The agents view (review-loop P18 commit 2): one row per profile from
|
|
4
|
+
* `listProfiles()` (`~/.mcpi/profiles/`), not the SQLite ledger the other
|
|
5
|
+
* "ledger" views read -- so it stays honest and simple, this file reads
|
|
6
|
+
* profiles directly rather than folding them into `LedgerSnapshot`. Hub
|
|
7
|
+
* connection state and per-DID lifecycle status come from the same
|
|
8
|
+
* ledger snapshot every other view already has (dispatches/journal),
|
|
9
|
+
* read-only: the orchestrator daemon owns writing that ledger, this view
|
|
10
|
+
* never does.
|
|
11
|
+
*
|
|
12
|
+
* Row focus is a deliberate sub-mode, entered with Enter and exited with
|
|
13
|
+
* Escape, because its own keys (j/k to move the cursor, letters to act)
|
|
14
|
+
* would otherwise collide with the frame's global nav keys, which read the
|
|
15
|
+
* exact same input. `setNavSuspended` is how it tells the frame to stop
|
|
16
|
+
* reading nav keys while it owns the keyboard.
|
|
17
|
+
*
|
|
18
|
+
* @module cli/tui/views/agents
|
|
19
|
+
*/
|
|
20
|
+
import React, { useState } from "react";
|
|
21
|
+
import { Box, Text, useInput } from "ink";
|
|
22
|
+
import { theme } from "../theme.js";
|
|
23
|
+
import { Rule, StatStrip, Table } from "../components.js";
|
|
24
|
+
import { plain } from "../sanitize.js";
|
|
25
|
+
function truncatedDid(did) {
|
|
26
|
+
if (did.length <= 28)
|
|
27
|
+
return did;
|
|
28
|
+
return `${did.slice(0, 18)}…${did.slice(-8)}`;
|
|
29
|
+
}
|
|
30
|
+
/** The most recent dispatch/journal entry for this DID, or "-" if none. */
|
|
31
|
+
function lastKnownStatus(did, dispatches, journal) {
|
|
32
|
+
const forDid = dispatches.filter((d) => d.worker_did === did);
|
|
33
|
+
if (forDid.length > 0) {
|
|
34
|
+
const latest = forDid.reduce((a, b) => (a.dispatched_at > b.dispatched_at ? a : b));
|
|
35
|
+
return latest.status;
|
|
36
|
+
}
|
|
37
|
+
const journalForDid = journal.filter((j) => j.agent_did === did);
|
|
38
|
+
if (journalForDid.length > 0) {
|
|
39
|
+
const latest = journalForDid.reduce((a, b) => (a.observed_at > b.observed_at ? a : b));
|
|
40
|
+
return latest.event_type;
|
|
41
|
+
}
|
|
42
|
+
return "-";
|
|
43
|
+
}
|
|
44
|
+
const ESC = String.fromCharCode(27);
|
|
45
|
+
const BEL = String.fromCharCode(7);
|
|
46
|
+
/**
|
|
47
|
+
* OSC 52: set the system clipboard from a terminal, with no clipboard
|
|
48
|
+
* dependency -- most modern terminal emulators (iTerm2, kitty, WezTerm,
|
|
49
|
+
* Windows Terminal, tmux with `set -g set-clipboard on`) implement this
|
|
50
|
+
* escape sequence, so a real "copy" works without shelling out to a
|
|
51
|
+
* platform clipboard binary or adding a cross-platform clipboard package.
|
|
52
|
+
* BEL-terminated: the most widely supported form.
|
|
53
|
+
*/
|
|
54
|
+
export function osc52SetClipboard(text) {
|
|
55
|
+
return `${ESC}]52;c;${Buffer.from(text, "utf8").toString("base64")}${BEL}`;
|
|
56
|
+
}
|
|
57
|
+
export function AgentsView({ width, profiles, dispatches, journal, hubConnected, copyToClipboard = (text) => process.stdout.write(osc52SetClipboard(text)), launchAgentFlow, dispatchTask, setNavSuspended, }) {
|
|
58
|
+
const [mode, setMode] = useState({ kind: "idle" });
|
|
59
|
+
// A generation counter, not a single "abandoned" boolean (an earlier
|
|
60
|
+
// version used one and a fresh /get pass caught the bug: escaping one
|
|
61
|
+
// in-flight dispatch and immediately starting another reset the shared
|
|
62
|
+
// flag to false, so the FIRST (abandoned) dispatch's late result still
|
|
63
|
+
// passed the check and clobbered the second, still-live one). Every
|
|
64
|
+
// dispatch captures the counter's value at its own start; Esc/q AND
|
|
65
|
+
// starting a new dispatch both bump it. A `.then`/`.catch` callback
|
|
66
|
+
// applies its result only if the counter still equals what it captured
|
|
67
|
+
// -- true for at most one dispatch at a time, cleared the instant
|
|
68
|
+
// either a newer dispatch starts or this one is abandoned. A ref, not
|
|
69
|
+
// state: the callbacks close over it and must read the LATEST value
|
|
70
|
+
// when they fire, which can be well after the render that started
|
|
71
|
+
// them. This does not cancel the underlying request (dispatchTask has
|
|
72
|
+
// no AbortController seam) -- it only stops a stale result from
|
|
73
|
+
// painting over whatever the user has navigated to since.
|
|
74
|
+
const dispatchGenerationRef = React.useRef(0);
|
|
75
|
+
const suspend = (next) => {
|
|
76
|
+
setMode(next);
|
|
77
|
+
setNavSuspended?.(true);
|
|
78
|
+
};
|
|
79
|
+
const resume = () => {
|
|
80
|
+
setMode({ kind: "idle" });
|
|
81
|
+
setNavSuspended?.(false);
|
|
82
|
+
};
|
|
83
|
+
useInput((input, key) => {
|
|
84
|
+
if (mode.kind === "idle") {
|
|
85
|
+
if (key.return && profiles.length > 0) {
|
|
86
|
+
suspend({ kind: "focused", cursor: 0 });
|
|
87
|
+
}
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (mode.kind === "focused") {
|
|
91
|
+
if (key.escape || input === "q") {
|
|
92
|
+
resume();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (key.downArrow || input === "j") {
|
|
96
|
+
setMode({ kind: "focused", cursor: Math.min(profiles.length - 1, mode.cursor + 1) });
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (key.upArrow || input === "k") {
|
|
100
|
+
setMode({ kind: "focused", cursor: Math.max(0, mode.cursor - 1) });
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const profile = profiles[mode.cursor];
|
|
104
|
+
if (!profile)
|
|
105
|
+
return;
|
|
106
|
+
if (input === "c") {
|
|
107
|
+
if (profile.claimUrl) {
|
|
108
|
+
copyToClipboard(profile.claimUrl);
|
|
109
|
+
setMode({ kind: "message", cursor: mode.cursor, text: "Copied claim URL.", tone: "ok" });
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
setMode({
|
|
113
|
+
kind: "message",
|
|
114
|
+
cursor: mode.cursor,
|
|
115
|
+
text: "No claim URL for this profile.",
|
|
116
|
+
tone: "warn",
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (input === "p") {
|
|
122
|
+
copyToClipboard(`kya-os agent run ${profile.slug} -- <command>`);
|
|
123
|
+
setMode({
|
|
124
|
+
kind: "message",
|
|
125
|
+
cursor: mode.cursor,
|
|
126
|
+
text: `Copied: kya-os agent run ${profile.slug} -- <command>`,
|
|
127
|
+
tone: "ok",
|
|
128
|
+
});
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (input === "t" && launchAgentFlow) {
|
|
132
|
+
launchAgentFlow("task", profile);
|
|
133
|
+
resume();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (input === "d" && hubConnected && dispatchTask) {
|
|
137
|
+
setMode({ kind: "entering-command", cursor: mode.cursor, buffer: "" });
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (mode.kind === "message") {
|
|
143
|
+
// Any key dismisses the status line and returns to row focus.
|
|
144
|
+
setMode({ kind: "focused", cursor: mode.cursor });
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (mode.kind === "entering-command") {
|
|
148
|
+
if (key.escape) {
|
|
149
|
+
setMode({ kind: "focused", cursor: mode.cursor });
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (key.return) {
|
|
153
|
+
const profile = profiles[mode.cursor];
|
|
154
|
+
if (profile && dispatchTask && mode.buffer.trim().length > 0) {
|
|
155
|
+
const cursor = mode.cursor;
|
|
156
|
+
const generation = ++dispatchGenerationRef.current;
|
|
157
|
+
setMode({ kind: "dispatching", cursor });
|
|
158
|
+
dispatchTask(profile, mode.buffer.trim())
|
|
159
|
+
.then((outcome) => {
|
|
160
|
+
if (dispatchGenerationRef.current !== generation)
|
|
161
|
+
return;
|
|
162
|
+
const resultLine = outcome.status === "refused"
|
|
163
|
+
? `Refused: ${outcome.detail ?? "not permitted"}`
|
|
164
|
+
: `${outcome.status}${outcome.detail ? `: ${outcome.detail}` : ""}`;
|
|
165
|
+
setMode({
|
|
166
|
+
kind: "message",
|
|
167
|
+
cursor,
|
|
168
|
+
text: outcome.warning ? `Warning: ${outcome.warning} ${resultLine}` : resultLine,
|
|
169
|
+
tone: outcome.ok && !outcome.warning ? "ok" : "warn",
|
|
170
|
+
});
|
|
171
|
+
})
|
|
172
|
+
.catch((error) => {
|
|
173
|
+
if (dispatchGenerationRef.current !== generation)
|
|
174
|
+
return;
|
|
175
|
+
setMode({
|
|
176
|
+
kind: "message",
|
|
177
|
+
cursor,
|
|
178
|
+
text: `Dispatch failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
179
|
+
tone: "warn",
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (key.backspace || key.delete) {
|
|
186
|
+
setMode({ ...mode, buffer: mode.buffer.slice(0, -1) });
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
// Printable characters only -- ignore other control/modifier keys.
|
|
190
|
+
if (input && !key.ctrl && !key.meta) {
|
|
191
|
+
setMode({ ...mode, buffer: mode.buffer + input });
|
|
192
|
+
}
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (mode.kind === "dispatching") {
|
|
196
|
+
// The wire call itself keeps running (no AbortController seam),
|
|
197
|
+
// but the keyboard must not stay frozen for up to 40s (10s
|
|
198
|
+
// handshake + 30s dispatch timeout) with no way out short of
|
|
199
|
+
// SIGINT. Esc/q hands the keyboard back now; bumping the
|
|
200
|
+
// generation counter stops THIS dispatch's eventual result from
|
|
201
|
+
// popping a stale "message" screen over wherever the user has
|
|
202
|
+
// navigated to by then, without also swallowing a DIFFERENT,
|
|
203
|
+
// still-live dispatch the user might start next.
|
|
204
|
+
if (key.escape || input === "q") {
|
|
205
|
+
dispatchGenerationRef.current++;
|
|
206
|
+
setMode({ kind: "focused", cursor: mode.cursor });
|
|
207
|
+
}
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
}, { isActive: true });
|
|
211
|
+
if (profiles.length === 0) {
|
|
212
|
+
return (_jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(Text, { color: theme.dim, children: "No agent profiles yet. Run kya-os init to create one." }) }));
|
|
213
|
+
}
|
|
214
|
+
const columns = [
|
|
215
|
+
{ header: "Kind", width: 14, render: (p) => p.kind },
|
|
216
|
+
{ header: "Slug", width: 22, render: (p) => p.slug },
|
|
217
|
+
{ header: "DID", width: 30, render: (p) => truncatedDid(p.did) },
|
|
218
|
+
{ header: "Hub", width: 11, render: () => (hubConnected ? "connected" : "-") },
|
|
219
|
+
{
|
|
220
|
+
header: "Status",
|
|
221
|
+
width: 12,
|
|
222
|
+
render: (p) => lastKnownStatus(p.did, dispatches, journal),
|
|
223
|
+
},
|
|
224
|
+
];
|
|
225
|
+
const selected = mode.kind === "idle" ? undefined : mode.cursor;
|
|
226
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(StatStrip, { width: width, stats: [
|
|
227
|
+
{ value: profiles.length, label: "profiles" },
|
|
228
|
+
{ value: hubConnected ? "connected" : "not configured", label: "hub" },
|
|
229
|
+
] }), _jsx(Rule, { width: width }), _jsx(Box, { marginTop: 1, children: _jsx(Table, { columns: columns, rows: profiles, selected: selected, empty: "", width: width }) }), _jsxs(Box, { marginTop: 1, children: [mode.kind === "idle" && _jsx(Text, { color: theme.dim, children: "Enter to focus a row." }), mode.kind === "focused" && (_jsxs(Text, { color: theme.dim, children: ["c copy claim URL \u00B7 p copy run command", launchAgentFlow ? " · t launch task" : "", hubConnected && dispatchTask ? " · d dispatch" : "", " \u00B7 Esc back"] })), mode.kind === "entering-command" && (_jsxs(Text, { children: [_jsx(Text, { color: theme.dim, children: "Command: " }), plain(mode.buffer), _jsx(Text, { color: theme.accent, children: "▏" })] })), mode.kind === "dispatching" && (_jsx(Text, { color: theme.dim, children: "Dispatching\u2026 \u00B7 Esc to back out (does not cancel the request)" })), mode.kind === "message" && (_jsx(Text, { color: mode.tone === "ok" ? theme.ok : theme.warn, children: plain(mode.text) }))] })] }));
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../src/tui/views/agents.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAe,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AA0CvC,SAAS,YAAY,CAAC,GAAW;IAC/B,IAAI,GAAG,CAAC,MAAM,IAAI,EAAE;QAAE,OAAO,GAAG,CAAC;IACjC,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAChD,CAAC;AAED,2EAA2E;AAC3E,SAAS,eAAe,CACtB,GAAW,EACX,UAAyB,EACzB,OAAqB;IAErB,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC;IAC9D,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,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
|
+
*
|
|
4
|
+
* Two families behind one interface. Ledger-backed views read the local SQLite
|
|
5
|
+
* file and have real data now. Checkpoint-backed views need the
|
|
6
|
+
* `/api/v1/cli/monitor` read plane, which does not exist yet, so they render
|
|
7
|
+
* an honest "not connected" state rather than a convincing empty table.
|
|
8
|
+
*
|
|
9
|
+
* That distinction is deliberate and visible: a view that looks populated but
|
|
10
|
+
* is structurally incapable of having data is worse than one that says so,
|
|
11
|
+
* because the reader cannot tell "nothing happened" from "nothing is wired".
|
|
12
|
+
*
|
|
13
|
+
* @module cli/tui/views
|
|
14
|
+
*/
|
|
15
|
+
import type { Ticket } from "../../orchestrator/db/tickets.js";
|
|
16
|
+
import type { JournalRow } from "../../orchestrator/db/journal.js";
|
|
17
|
+
import type { DispatchRow } from "../../orchestrator/db/dispatches.js";
|
|
18
|
+
export interface LedgerSnapshot {
|
|
19
|
+
tickets: Ticket[];
|
|
20
|
+
journal: JournalRow[];
|
|
21
|
+
dispatches: DispatchRow[];
|
|
22
|
+
}
|
|
23
|
+
export interface ViewProps {
|
|
24
|
+
width: number;
|
|
25
|
+
authenticated: boolean;
|
|
26
|
+
/** Index into this view's own filter list; views without filters ignore it. */
|
|
27
|
+
filter?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the frame's global nav keys are currently suspended. A view
|
|
30
|
+
* that captures its own keyboard input (a row cursor, a text prompt) sets
|
|
31
|
+
* this via {@link setNavSuspended} for exactly as long as it needs
|
|
32
|
+
* exclusive input, then clears it -- most views never touch either prop.
|
|
33
|
+
*/
|
|
34
|
+
navSuspended?: boolean;
|
|
35
|
+
setNavSuspended?: (suspended: boolean) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The newest timestamp in a set, computed rather than assumed.
|
|
39
|
+
*
|
|
40
|
+
* Both stat strips said "most recent activity" while reading row zero, which
|
|
41
|
+
* is only the newest row if a reader three files away happens to sort that
|
|
42
|
+
* way. It did not for tickets -- listTickets orders by created_at ascending,
|
|
43
|
+
* so row zero is the OLDEST ticket and the strip reported its update time as
|
|
44
|
+
* the latest activity. Filtering made it worse: row zero of a filtered set is
|
|
45
|
+
* arbitrary. Taking the max says what the label already claims.
|
|
46
|
+
*
|
|
47
|
+
* Compares the strings directly, which is sound only because every writer in
|
|
48
|
+
* db/ stamps `new Date(...).toISOString()`: fixed-width UTC, so lexical order
|
|
49
|
+
* is chronological order. A writer that stored a local-time or offset format
|
|
50
|
+
* would break this quietly, which is why the columns carry no SQL default.
|
|
51
|
+
*/
|
|
52
|
+
export declare function mostRecent<T>(rows: readonly T[], pick: (row: T) => string): string | undefined;
|
|
53
|
+
/** Relative time, the dashboard's "just now / 5m ago" idiom. */
|
|
54
|
+
export declare function ago(iso: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* The state every Checkpoint-backed view shows until the read plane exists.
|
|
57
|
+
*
|
|
58
|
+
* Names the reason and the fix. "No data" would be a lie of omission: there is
|
|
59
|
+
* plenty of data, we simply have no route to it.
|
|
60
|
+
*/
|
|
61
|
+
export declare function NotConnected({ what }: {
|
|
62
|
+
what: string;
|
|
63
|
+
}): JSX.Element;
|
|
64
|
+
/**
|
|
65
|
+
* The ticket filters, as data.
|
|
66
|
+
*
|
|
67
|
+
* Declared here rather than inline so the chip row, the counts and the actual
|
|
68
|
+
* row filtering all read from one list. Split across three places, a new
|
|
69
|
+
* filter is three edits and the chip that silently filters nothing is the one
|
|
70
|
+
* you ship.
|
|
71
|
+
*/
|
|
72
|
+
export declare const TICKET_FILTERS: {
|
|
73
|
+
label: string;
|
|
74
|
+
match: (t: Ticket) => boolean;
|
|
75
|
+
}[];
|
|
76
|
+
export declare function TicketsView({ snap, width, filter, }: {
|
|
77
|
+
snap: LedgerSnapshot;
|
|
78
|
+
width: number;
|
|
79
|
+
filter?: number;
|
|
80
|
+
}): JSX.Element;
|
|
81
|
+
export declare function DispatchesView({ snap, width }: {
|
|
82
|
+
snap: LedgerSnapshot;
|
|
83
|
+
width: number;
|
|
84
|
+
}): JSX.Element;
|
|
85
|
+
export declare function JournalView({ snap, width }: {
|
|
86
|
+
snap: LedgerSnapshot;
|
|
87
|
+
width: number;
|
|
88
|
+
}): JSX.Element;
|
|
89
|
+
export declare function ReviewView({ snap, width }: {
|
|
90
|
+
snap: LedgerSnapshot;
|
|
91
|
+
width: number;
|
|
92
|
+
}): JSX.Element;
|
|
93
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tui/views/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAcH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEvE,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,UAAU,EAAE,WAAW,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAChD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,GAAG,SAAS,CAO9F;AAED,gEAAgE;AAChE,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAWvC;AAED;;;;;GAKG;AACH,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