total-recall-brain 3.45.0 → 3.46.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/bin/total-recall.mjs +4 -2
- package/frontend/dist/assets/index-BRYE1jmv.css +1 -0
- package/frontend/dist/assets/index-D1goIPjC.js +5598 -0
- package/frontend/dist/index.html +2 -2
- package/frontend/dist/sw.js +5 -4
- package/frontend/src/App.tsx +183 -236
- package/frontend/src/api/auth-inventory.ts +62 -0
- package/frontend/src/api/memory.ts +13 -8
- package/frontend/src/api/plugin-credentials.ts +23 -0
- package/frontend/src/api/plugins.ts +37 -53
- package/frontend/src/api/workspace-drawers.ts +97 -0
- package/frontend/src/components/BrainSelector.tsx +9 -3
- package/frontend/src/components/plugins/PluginPanel.tsx +83 -42
- package/frontend/src/components/plugins/PluginSettings.tsx +10 -20
- package/frontend/src/components/plugins/PluginWorkspace.tsx +367 -0
- package/frontend/src/components/plugins/ScopedPluginCommands.tsx +142 -0
- package/frontend/src/components/plugins/plugin-frame.ts +44 -33
- package/frontend/src/components/plugins/scoped-plugin-operations.ts +28 -0
- package/frontend/src/components/workspace/DrawerChat.tsx +110 -0
- package/frontend/src/components/workspace/DrawerLayout.tsx +196 -0
- package/frontend/src/components/workspace/DrawerMarkup.tsx +49 -0
- package/frontend/src/components/workspace/PluginChunkLibrary.tsx +92 -0
- package/frontend/src/components/workspace/PluginHome.tsx +76 -0
- package/frontend/src/components/workspace/WorkspaceDrawers.tsx +96 -0
- package/frontend/src/components/workspace/WorkspacePage.tsx +95 -0
- package/frontend/src/components/workspace/usePluginDesign.ts +38 -0
- package/frontend/src/index.css +409 -136
- package/frontend/src/pages/HelpPage.tsx +15 -46
- package/frontend/src/pages/MemoryPage.tsx +19 -36
- package/frontend/src/pages/SettingsPage.tsx +1 -1
- package/metadata.plugin.schema.json +53 -227
- package/package.json +1 -1
- package/scaffold/.agent/skills/plugin/SKILL.md +13 -11
- package/scaffold/.agent/skills/plugin/evals/README.md +14 -21
- package/scaffold/.agent/skills/plugin/evals/cases/01-fabricated-seed.mjs +15 -18
- package/scaffold/.agent/skills/plugin/evals/cases/02-reassuring-default.mjs +19 -24
- package/scaffold/.agent/skills/plugin/evals/cases/03-declared-template.mjs +12 -20
- package/scaffold/.agent/skills/plugin/evals/cases/04-home-collects-credential.mjs +35 -0
- package/scaffold/.agent/skills/plugin/evals/cases/05-host-leak-in-scaffold.mjs +8 -28
- package/scaffold/.agent/skills/plugin/evals/cases/06-correct-plugin.mjs +85 -47
- package/scaffold/.agent/skills/plugin/evals/run.mjs +17 -18
- package/scaffold/.agent/skills/plugin/prompts/05-credentials.md +4 -4
- package/scaffold/.agent/skills/plugin/prompts/07-scaffold.md +2 -2
- package/scaffold/.agent/skills/plugin/prompts/08-verify.md +4 -4
- package/scaffold/.agent/skills/plugin/references/anti-patterns.md +2 -2
- package/scaffold/.agent/skills/plugin/references/generative-home.md +38 -0
- package/scaffold/.agent/skills/plugin/references/scaffold.md +5 -5
- package/scaffold/.agent/skills/plugin/references/surfaces.md +13 -4
- package/scaffold/.agent/skills/plugin/scripts/record.mjs +75 -153
- package/scaffold/.agent/skills/plugin/subagents/plugin-reviewer.md +4 -4
- package/scaffold/.agent/skills/total-recall/plugins/auth/DESIGN.md +76 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/README.md +3 -1
- package/scaffold/.agent/skills/total-recall/plugins/auth/cli.mjs +20 -15
- package/scaffold/.agent/skills/total-recall/plugins/auth/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/auth/package.json +2 -1
- package/scaffold/.agent/skills/total-recall/plugins/auth/plugin.json +13 -51
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/access-overview.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/agent-login.md +20 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/baseline-audit.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/credential-repository-binding.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/credential-store-maintenance.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/dashboard-password.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/dashboard-sessions.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/endpoint-probe.md +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/google-sign-in.md +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/mesh-machines.md +16 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/passkey-enrollment.md +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/registered-brains.md +16 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/scoped-access-keys.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/secret-inventory.md +25 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/signing-key-rotation.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/home.js +375 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/{ui/DESIGN.md → DESIGN.md} +32 -21
- package/scaffold/.agent/skills/total-recall/plugins/automations/adapters.mjs +17 -1
- package/scaffold/.agent/skills/total-recall/plugins/automations/cli.mjs +10 -1
- package/scaffold/.agent/skills/total-recall/plugins/automations/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/automations/package.json +4 -3
- package/scaffold/.agent/skills/total-recall/plugins/automations/plugin.json +11 -27
- package/scaffold/.agent/skills/total-recall/plugins/automations/ui/automations.js +2 -2
- package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/control-ledger.md +42 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/local-inventory-triage.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/pending-control.md +39 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/run-evidence.md +41 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/schedule-vs-run-evidence.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/source-coverage.md +41 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/ui/{card.js → home.js} +32 -27
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/DESIGN.md +53 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/cli.mjs +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/commands/run-core.mjs +4 -2
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/check.mjs +4 -2
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/package.json +2 -1
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/plugin.json +40 -40
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/config.md +15 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/detect.md +15 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/gate.md +15 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/init.md +15 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/report.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/run.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/snapshot.md +15 -0
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/code-quality-report.mjs +55 -23
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/home.mjs +214 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/DESIGN.md +146 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/package.json +2 -1
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/plugin.json +51 -34
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/command.mjs +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/create.md +35 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/history.md +35 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/library.md +49 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/list.md +42 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/promote.md +40 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/read.md +25 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/remove.md +26 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/rollback.md +26 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/show.md +53 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/status.md +40 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/test-path.md +38 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/test.md +46 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/update.md +32 -0
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/home.js +533 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/DESIGN.md +110 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/package.json +2 -1
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/plugin.json +13 -10
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/chunks/benchmark.md +49 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/chunks/coverage.md +53 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/chunks/models.md +43 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/chunks/pull.md +41 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/chunks/status.md +59 -0
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/home.js +353 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/DESIGN.md +31 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/README.md +25 -1
- package/scaffold/.agent/skills/total-recall/plugins/git/cli.mjs +5 -1
- package/scaffold/.agent/skills/total-recall/plugins/git/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/git/package.json +2 -1
- package/scaffold/.agent/skills/total-recall/plugins/git/plugin.json +17 -27
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/commit-memory.mjs +30 -6
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/fleet.mjs +24 -6
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/secret-firewall.mjs +33 -7
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/undo.mjs +29 -5
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/unmerged.mjs +182 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/change-comparison.md +27 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/commit-identity.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/create-worktree.md +25 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/registered-worktrees.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/remove-worktree.md +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/repository-ledger.md +25 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/unmerged-work.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/upstream-divergence.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/worktree-conflict-triage.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/worktree-terminal.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/home.js +273 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/DESIGN.md +35 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/README.md +4 -5
- package/scaffold/.agent/skills/total-recall/plugins/mesh/cli.mjs +9 -3
- package/scaffold/.agent/skills/total-recall/plugins/mesh/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/mesh/package.json +2 -1
- package/scaffold/.agent/skills/total-recall/plugins/mesh/plugin.json +37 -39
- package/scaffold/.agent/skills/total-recall/plugins/mesh/src/cli/mesh.mjs +5 -3
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/active-device-dispatch.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/control-probe.md +25 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/control-server.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/credential-readiness.md +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/elected-leader.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/enrollment-key.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/file-receipt.md +25 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/fleet-execution.md +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/fleet-presence.md +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/interactive-ssh.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/local-enrollment.md +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/mesh-policy.md +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/network-atlas.md +25 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/node-roster.md +26 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/node-selection-proof.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/owner-observations.md +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/peer-path.md +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/pinned-leader.md +24 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/reachability-evidence-ladder.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/recorded-login.md +23 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/remote-execution.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/secret-grants.md +26 -0
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/{card.js → home.js} +93 -22
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/DESIGN.md +86 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/README.md +19 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/cli.mjs +5 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/package.json +2 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/plugin.json +43 -22
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/chat.mjs +80 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/adapter-docs-freshness.md +16 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/chat-handoff.md +26 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/fleet-maintenance.md +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/harness-inventory.md +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/included-access.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/included-usage-verification.md +15 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/independent-review.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/managed-execution.md +20 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/official-documentation.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/quota-recovery.md +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/review-routing-decision.md +16 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/route-work.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/routing-evidence.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/run-ledger.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/home.js +198 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/DESIGN.md +75 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/README.md +2 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/cli.mjs +17 -14
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/package.json +2 -1
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/plugin.json +10 -44
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/generate.mjs +5 -4
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/graph.mjs +3 -4
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/ingest.mjs +23 -18
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/mesh-vaults.mjs +8 -3
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/refresh.mjs +6 -3
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/search.mjs +3 -5
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/token.mjs +21 -47
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/upstream-watcher.mjs +17 -6
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/auto-refresh.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/bootstrap-pages.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/generate-wiki.md +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/generator-settings.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/host-probe.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/ingest-preview.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/link-hygiene.md +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/link-topology.md +19 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/passage-search.md +19 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/propagation-plan.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/provider-credentials.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/refresh-report.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/task-evidence.md +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/upstream-record.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/watch-upstream.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/wiki-atlas.md +19 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/panel.js +261 -513
- package/scaffold/.agent/skills/total-recall/plugins/security/DESIGN.md +84 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/README.md +4 -2
- package/scaffold/.agent/skills/total-recall/plugins/security/cli.mjs +7 -19
- package/scaffold/.agent/skills/total-recall/plugins/security/package-lock.json +6 -6
- package/scaffold/.agent/skills/total-recall/plugins/security/package.json +2 -3
- package/scaffold/.agent/skills/total-recall/plugins/security/plugin.json +19 -52
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/device-evidence.md +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/evidence-desk.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/guided-device-review.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/host-and-network.md +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/https-headers.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/mesh-coverage.md +18 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/private-security-tools.md +16 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/single-origin-header-check.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/source-review.md +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/ssh-permission-plan.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/home.js +283 -0
- package/scaffold/.agent/skills/total-recall/plugins/ssss/DESIGN.md +93 -0
- package/scaffold/.agent/skills/total-recall/plugins/ssss/package-lock.json +2 -2
- package/scaffold/.agent/skills/total-recall/plugins/ssss/package.json +2 -1
- package/scaffold/.agent/skills/total-recall/plugins/ssss/plugin.json +5 -3
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/conformance.md +26 -0
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/registry.md +37 -0
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/repair.md +42 -0
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/scaffold.md +33 -0
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/status.md +43 -0
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/validate.md +34 -0
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/validation-diagnostics.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/workspace-registry-preflight.md +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/home.js +348 -0
- package/scaffold/.agent/skills/total-recall/references/operations.md +2 -0
- package/src/cli/api.mjs +3 -3
- package/src/cli/brief.mjs +3 -0
- package/src/cli/config.mjs +16 -0
- package/src/cli/connect.mjs +2 -7
- package/src/cli/plugin/chunks.mjs +145 -0
- package/src/cli/plugin/create.mjs +24 -52
- package/src/cli/plugin/index.mjs +20 -9
- package/src/cli/setup.mjs +2 -9
- package/src/cli/start.mjs +1 -0
- package/src/cli/startup.mjs +18 -0
- package/src/core/app-deploy/design-tokens.mjs +14 -9
- package/src/core/app-deploy/ui-elements.mjs +1 -1
- package/src/core/brain-registry.mjs +5 -0
- package/src/core/brain-updates.mjs +5 -1
- package/src/core/daemon-control.mjs +5 -1
- package/src/core/dashboard-bundle.mjs +261 -0
- package/src/core/ensure-dependencies.mjs +19 -15
- package/src/core/memory-brain.mjs +30 -8
- package/src/core/plugin-activation.mjs +63 -20
- package/src/core/plugin-contracts/{card.mjs → manifest.mjs} +23 -57
- package/src/core/plugin-contracts/startup-check.mjs +49 -0
- package/src/core/plugin-contracts/ui.mjs +9 -3
- package/src/core/plugin-distribution.mjs +6 -6
- package/src/core/plugin-lifecycle.mjs +58 -0
- package/src/core/plugin-loader.mjs +9 -5
- package/src/core/plugin-runner.mjs +21 -10
- package/src/core/plugin-startup-checks.mjs +44 -0
- package/src/core/plugin-state.mjs +19 -5
- package/src/core/plugin-store.mjs +30 -11
- package/src/core/project-id.mjs +15 -5
- package/src/core/required-plugins.mjs +31 -6
- package/src/core/schema.mjs +2 -0
- package/src/core/ssss-operation-service.mjs +1 -0
- package/src/core/startup-health.mjs +28 -3
- package/src/core/testing/plugin-fixture.mjs +22 -21
- package/src/core/throttled-fetch.mjs +25 -18
- package/src/core/ui-chunk-choice.mjs +77 -0
- package/src/core/ui-chunk.registry.json +23 -0
- package/src/core/ui-chunks.mjs +434 -0
- package/src/core/vault-cache.mjs +58 -59
- package/src/core/workspace-compositions.mjs +151 -0
- package/src/core/workspace-drawers.mjs +79 -0
- package/src/server/api.mjs +4 -27
- package/src/server/index.mjs +28 -21
- package/src/server/memory-events.mjs +31 -0
- package/src/server/plugin-brain-targets.mjs +89 -0
- package/src/server/rest.mjs +2 -0
- package/src/server/route-inventory.mjs +3 -2
- package/src/server/route-manifest.json +52 -4
- package/src/server/routes/_shared.mjs +7 -14
- package/src/server/routes/brains.mjs +29 -44
- package/src/server/routes/dashboard.mjs +26 -0
- package/src/server/routes/plugins.mjs +154 -45
- package/src/server/routes/ui-chunks.mjs +192 -0
- package/frontend/dist/assets/index-DACh1dhx.js +0 -5613
- package/frontend/dist/assets/index-DtwsDyFM.css +0 -1
- package/frontend/src/components/plugins/card/CardEngine.tsx +0 -108
- package/frontend/src/components/plugins/card/CardScenes.tsx +0 -103
- package/frontend/src/components/plugins/card/ExecutionPicker.tsx +0 -64
- package/frontend/src/components/plugins/card/args.ts +0 -28
- package/frontend/src/components/plugins/card/card.css +0 -32
- package/frontend/src/components/plugins/card/cli-line.ts +0 -13
- package/frontend/src/components/plugins/card/contract.ts +0 -91
- package/frontend/src/components/plugins/card/format.ts +0 -49
- package/frontend/src/components/plugins/card/runner-context.ts +0 -11
- package/frontend/src/components/plugins/card/runner.tsx +0 -43
- package/frontend/src/components/plugins/card/theme.ts +0 -35
- package/frontend/src/components/plugins/card/use-source.ts +0 -22
- package/frontend/src/components/plugins/card/widgets.tsx +0 -94
- package/frontend/src/components/plugins/workspace/WorkspaceHost.tsx +0 -23
- package/frontend/src/pages/PluginsPage.tsx +0 -1719
- package/scaffold/.agent/skills/plugin/evals/cases/04-card-collects-credential.mjs +0 -47
- package/scaffold/.agent/skills/plugin/prompts/06-card.md +0 -46
- package/scaffold/.agent/skills/plugin/references/card.md +0 -90
- package/scaffold/.agent/skills/plugin/subagents/card-designer.md +0 -60
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/DESIGN.md +0 -67
- package/scaffold/.agent/skills/total-recall/plugins/auth/ui/card.js +0 -1179
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/DESIGN.md +0 -32
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/card.js +0 -588
- package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/card.js +0 -575
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/DESIGN.md +0 -32
- package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/card.js +0 -482
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/DESIGN.md +0 -100
- package/scaffold/.agent/skills/total-recall/plugins/git/ui/card.js +0 -637
- package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/DESIGN.md +0 -217
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/DESIGN.md +0 -32
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/card.js +0 -1276
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/DESIGN.md +0 -45
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/card.js +0 -1401
- package/scaffold/.agent/skills/total-recall/plugins/security/scripts/build-ui.mjs +0 -4
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/DESIGN.md +0 -41
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/card.js +0 -396
- package/scaffold/.agent/skills/total-recall/plugins/security/ui/panel.js +0 -98
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/DESIGN.md +0 -15
- package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/card.js +0 -182
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: ui-chunk:chunk
|
|
3
|
+
plugin: composable-cli
|
|
4
|
+
id: test
|
|
5
|
+
title: Run a command's test
|
|
6
|
+
description: Runs the selected composed command's test file with Node's test runner and returns its real outcome and output.
|
|
7
|
+
timestamp: '2026-11-08T08:12:00Z'
|
|
8
|
+
intents:
|
|
9
|
+
- Test a composed command and see the actual result
|
|
10
|
+
surfaces: [page]
|
|
11
|
+
operations: [test]
|
|
12
|
+
data:
|
|
13
|
+
- test:/ok
|
|
14
|
+
- test:/name
|
|
15
|
+
- test:/scope
|
|
16
|
+
- test:/testFile
|
|
17
|
+
- test:/exitCode
|
|
18
|
+
- test:/signal
|
|
19
|
+
- test:/stdout
|
|
20
|
+
- test:/stderr
|
|
21
|
+
- test:/error
|
|
22
|
+
panel: home
|
|
23
|
+
---
|
|
24
|
+
<section data-design-component="op-sheet">
|
|
25
|
+
<style>
|
|
26
|
+
[data-design-component="op-sheet"]{background:var(--color-surface);color:var(--color-text);font-family:var(--typography-body-font-family);font-size:var(--typography-body-font-size);line-height:var(--typography-body-line-height);border-radius:var(--radius-lg);padding:var(--spacing-lg)}
|
|
27
|
+
[data-design-component="op-sheet"] h2{font-family:var(--typography-title-font-family);font-size:var(--typography-title-font-size);font-weight:var(--typography-title-font-weight);margin:0 0 var(--spacing-sm)}
|
|
28
|
+
[data-design-component="op-sheet"] p{margin:0 0 var(--spacing-md)}
|
|
29
|
+
[data-design-component="risk-badge"]{font-family:var(--typography-label-font-family);font-size:var(--typography-label-font-size);font-weight:var(--typography-label-font-weight);letter-spacing:var(--typography-label-letter-spacing);text-transform:uppercase;border-radius:var(--radius-sm);padding:2px var(--spacing-xs);color:var(--color-warn);background:var(--color-warn-soft)}
|
|
30
|
+
[data-design-component="field-list"]{color:var(--color-muted);font-family:var(--typography-code-font-family);font-size:var(--typography-code-font-size);margin:0}
|
|
31
|
+
[data-design-component="field-list"] dt{color:var(--color-text)}
|
|
32
|
+
[data-design-component="field-list"] dd{margin:0 0 var(--spacing-sm);font-family:var(--typography-body-font-family)}
|
|
33
|
+
code{font-family:var(--typography-code-font-family)}
|
|
34
|
+
</style>
|
|
35
|
+
<h2>Run a command's test</h2>
|
|
36
|
+
<p><span data-design-component="risk-badge">write</span> Executes <code><name>.test.mjs</code> from the command's scope with <code>node --test</code>. The test runs real code, is stopped after 120 seconds, and its output is capped.</p>
|
|
37
|
+
<p>Run <code>total-recall composable-cli test <name> --json</code>, adding <code>--global</code> or <code>--group <id></code> for those scopes. A failing test exits non-zero. The CmdSmith Home runs it only when you select Run test.</p>
|
|
38
|
+
<dl data-design-component="field-list">
|
|
39
|
+
<dt>ok</dt><dd>True only when the test process finished with exit code 0.</dd>
|
|
40
|
+
<dt>name, scope, testFile</dt><dd>Which command was tested, in which scope, and the exact test file.</dd>
|
|
41
|
+
<dt>exitCode, signal</dt><dd>How the test process ended. A timeout shows a signal and no exit code.</dd>
|
|
42
|
+
<dt>stdout, stderr</dt><dd>What the test runner printed.</dd>
|
|
43
|
+
<dt>error</dt><dd>A process start or timeout code, or null.</dd>
|
|
44
|
+
</dl>
|
|
45
|
+
<p>When the scope has no regular test file for the command, the result is <code>{ ok: false, error }</code> and nothing runs.</p>
|
|
46
|
+
</section>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: ui-chunk:chunk
|
|
3
|
+
plugin: composable-cli
|
|
4
|
+
id: update
|
|
5
|
+
title: Update a command
|
|
6
|
+
description: Replaces a composed command's code, keeping a snapshot of the previous version and raising the registry version by one.
|
|
7
|
+
timestamp: '2026-11-08T08:12:00Z'
|
|
8
|
+
intents:
|
|
9
|
+
- Change what an existing composed command does
|
|
10
|
+
surfaces: [page]
|
|
11
|
+
operations: [update]
|
|
12
|
+
---
|
|
13
|
+
<section data-design-component="op-sheet">
|
|
14
|
+
<style>
|
|
15
|
+
[data-design-component="op-sheet"]{background:var(--color-surface);color:var(--color-text);font-family:var(--typography-body-font-family);font-size:var(--typography-body-font-size);line-height:var(--typography-body-line-height);border-radius:var(--radius-lg);padding:var(--spacing-lg)}
|
|
16
|
+
[data-design-component="op-sheet"] h2{font-family:var(--typography-title-font-family);font-size:var(--typography-title-font-size);font-weight:var(--typography-title-font-weight);margin:0 0 var(--spacing-sm)}
|
|
17
|
+
[data-design-component="op-sheet"] p{margin:0 0 var(--spacing-md)}
|
|
18
|
+
[data-design-component="risk-badge"]{font-family:var(--typography-label-font-family);font-size:var(--typography-label-font-size);font-weight:var(--typography-label-font-weight);letter-spacing:var(--typography-label-letter-spacing);text-transform:uppercase;border-radius:var(--radius-sm);padding:2px var(--spacing-xs);color:var(--color-warn);background:var(--color-warn-soft)}
|
|
19
|
+
[data-design-component="field-list"]{color:var(--color-muted);font-family:var(--typography-code-font-family);font-size:var(--typography-code-font-size);margin:0}
|
|
20
|
+
[data-design-component="field-list"] dt{color:var(--color-text)}
|
|
21
|
+
[data-design-component="field-list"] dd{margin:0 0 var(--spacing-sm);font-family:var(--typography-body-font-family)}
|
|
22
|
+
code{font-family:var(--typography-code-font-family)}
|
|
23
|
+
</style>
|
|
24
|
+
<h2>Update a command</h2>
|
|
25
|
+
<p><span data-design-component="risk-badge">write</span> Saves the current version to history, writes the new code, raises the registry version by one and refreshes the command inventories.</p>
|
|
26
|
+
<p>Run <code>total-recall composable-cli update <name> "<code>"</code>. It confirms in plain text.</p>
|
|
27
|
+
<dl data-design-component="field-list">
|
|
28
|
+
<dt>--description, --risk</dt><dd>Optional. When left out, the command keeps its current description and risk class.</dd>
|
|
29
|
+
<dt>--global, --group <id></dt><dd>Update the command in that scope instead of this project.</dd>
|
|
30
|
+
</dl>
|
|
31
|
+
<p>The previous version can be restored with <code>rollback</code>.</p>
|
|
32
|
+
</section>
|
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CmdSmith Home: the Composable CLI plugin's native panel.
|
|
3
|
+
*
|
|
4
|
+
* Reads real CLI output through this.host.run(<operation>, [..., '--json']):
|
|
5
|
+
* status, list, show and history. Runs test, rollback and remove only when the
|
|
6
|
+
* operator clicks, and remove only after a second confirming click. Every
|
|
7
|
+
* region states "Unavailable" with the reason when the host or an operation
|
|
8
|
+
* fails. Styles come from DESIGN.md frontmatter tokens only.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const RISK_TONE = {
|
|
12
|
+
read: 'ok',
|
|
13
|
+
write: 'warn',
|
|
14
|
+
money: 'danger',
|
|
15
|
+
'dns-cert': 'danger',
|
|
16
|
+
'production-deploy': 'danger',
|
|
17
|
+
'secret-revoke': 'danger',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const SCOPES = [
|
|
21
|
+
{ id: 'all', label: 'All' },
|
|
22
|
+
{ id: 'project', label: 'Project' },
|
|
23
|
+
{ id: 'group', label: 'Group' },
|
|
24
|
+
{ id: 'global', label: 'Global' },
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
function escapeHtml(value) {
|
|
28
|
+
if (value === null || value === undefined) return '';
|
|
29
|
+
return String(value).replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function formatTime(value) {
|
|
33
|
+
if (!value) return 'Not recorded';
|
|
34
|
+
const date = new Date(value);
|
|
35
|
+
return Number.isNaN(date.getTime()) ? String(value) : date.toLocaleString();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function parseJsonText(text) {
|
|
39
|
+
const trimmed = String(text).trim();
|
|
40
|
+
if (!trimmed) throw new Error('The operation returned no output');
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse(trimmed);
|
|
43
|
+
} catch {
|
|
44
|
+
throw new Error('The operation output was not JSON');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Accept an object, a JSON string, or a host wrapper carrying the JSON in stdout. */
|
|
49
|
+
function normalize(raw) {
|
|
50
|
+
if (raw === null || raw === undefined) throw new Error('The operation returned no output');
|
|
51
|
+
if (typeof raw === 'string') return parseJsonText(raw);
|
|
52
|
+
if (typeof raw === 'object' && !Array.isArray(raw) && typeof raw.stdout === 'string' && !('testFile' in raw)) {
|
|
53
|
+
return parseJsonText(raw.stdout);
|
|
54
|
+
}
|
|
55
|
+
return raw;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function failureOf(data) {
|
|
59
|
+
return data && typeof data === 'object' && !Array.isArray(data) && data.ok === false && !('testFile' in data)
|
|
60
|
+
? (typeof data.error === 'string' && data.error ? data.error : 'The operation failed')
|
|
61
|
+
: null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Scope flags the CLI's detectScope() expects for a list item, or null when the item cannot be addressed. */
|
|
65
|
+
function scopeArgs(item) {
|
|
66
|
+
if (!item || item.scope === 'project') return [];
|
|
67
|
+
if (item.scope === 'global') return ['--global'];
|
|
68
|
+
if (item.scope === 'group') {
|
|
69
|
+
const parts = String(item.path || '').split(/[\\/]+/);
|
|
70
|
+
const index = parts.lastIndexOf('groups');
|
|
71
|
+
const id = index >= 0 ? parts[index + 1] : '';
|
|
72
|
+
return /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,127}$/.test(id) ? ['--group', id] : null;
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export class ComposableCliHome extends HTMLElement {
|
|
78
|
+
constructor() {
|
|
79
|
+
super();
|
|
80
|
+
this._host = null;
|
|
81
|
+
this.status = { state: 'loading' };
|
|
82
|
+
this.commands = { state: 'loading', items: [] };
|
|
83
|
+
this.scope = 'all';
|
|
84
|
+
this.selected = null;
|
|
85
|
+
this.detail = null;
|
|
86
|
+
this.action = null;
|
|
87
|
+
this.armedRemove = false;
|
|
88
|
+
this.busy = false;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get host() {
|
|
92
|
+
return this._host;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
set host(value) {
|
|
96
|
+
this._host = value;
|
|
97
|
+
if (this.isConnected) this.load();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
connectedCallback() {
|
|
101
|
+
if (!this.shadowRoot) this.attachShadow({ mode: 'open' });
|
|
102
|
+
this.setAttribute('data-loaded', '');
|
|
103
|
+
this.load();
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async call(operation, args) {
|
|
107
|
+
if (!this._host || typeof this._host.run !== 'function') {
|
|
108
|
+
throw new Error('No Total Recall host connection');
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
return normalize(await this._host.run(operation, args));
|
|
112
|
+
} catch (error) {
|
|
113
|
+
// A non-zero exit can still carry the operation's JSON result.
|
|
114
|
+
const text = error && (typeof error.stdout === 'string' ? error.stdout :
|
|
115
|
+
typeof error.output === 'string' ? error.output : error.message);
|
|
116
|
+
if (typeof text === 'string' && /^\s*[\[{]/.test(text)) {
|
|
117
|
+
try { return parseJsonText(text); } catch { /* keep the original operation error */ }
|
|
118
|
+
}
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** For operations that confirm in prose on success and print { ok:false } JSON on failure. */
|
|
124
|
+
async callConfirm(operation, args) {
|
|
125
|
+
if (!this._host || typeof this._host.run !== 'function') {
|
|
126
|
+
throw new Error('No Total Recall host connection');
|
|
127
|
+
}
|
|
128
|
+
const raw = await this._host.run(operation, args);
|
|
129
|
+
const text = typeof raw === 'string' ? raw : raw && typeof raw.stdout === 'string' ? raw.stdout : null;
|
|
130
|
+
if (text && /^\s*\{/.test(text)) {
|
|
131
|
+
const failure = failureOf(parseJsonText(text));
|
|
132
|
+
if (failure) throw new Error(failure);
|
|
133
|
+
} else if (raw && typeof raw === 'object') {
|
|
134
|
+
const failure = failureOf(raw);
|
|
135
|
+
if (failure) throw new Error(failure);
|
|
136
|
+
}
|
|
137
|
+
return text ? text.trim() : 'Done';
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async load() {
|
|
141
|
+
if (!this.shadowRoot) return;
|
|
142
|
+
this.status = { state: 'loading' };
|
|
143
|
+
this.commands = { state: 'loading', items: this.commands.items };
|
|
144
|
+
this.render();
|
|
145
|
+
const [status, list] = await Promise.allSettled([
|
|
146
|
+
this.call('status', ['--json']),
|
|
147
|
+
this.call('list', ['--json']),
|
|
148
|
+
]);
|
|
149
|
+
this.status = this.settle(status, data => data && typeof data === 'object' && Array.isArray(data.implemented));
|
|
150
|
+
const commands = this.settle(list, Array.isArray);
|
|
151
|
+
this.commands = commands.state === 'ready'
|
|
152
|
+
? { state: 'ready', items: commands.data.filter(item => item && typeof item.name === 'string') }
|
|
153
|
+
: { state: 'error', error: commands.error, items: [] };
|
|
154
|
+
const current = this.commands.items.find(item => this.key(item) === this.selected);
|
|
155
|
+
if (current) await this.inspect(current, { keepAction: true });
|
|
156
|
+
else {
|
|
157
|
+
this.selected = null;
|
|
158
|
+
this.detail = null;
|
|
159
|
+
this.render();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
settle(result, valid) {
|
|
164
|
+
if (result.status === 'rejected') {
|
|
165
|
+
return { state: 'error', error: result.reason instanceof Error ? result.reason.message : String(result.reason) };
|
|
166
|
+
}
|
|
167
|
+
const failure = failureOf(result.value);
|
|
168
|
+
if (failure) return { state: 'error', error: failure };
|
|
169
|
+
if (!valid(result.value)) return { state: 'error', error: 'The operation returned an unexpected shape' };
|
|
170
|
+
return { state: 'ready', data: result.value };
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
key(item) {
|
|
174
|
+
return `${item.scope}:${item.path || item.name}`;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async inspect(item, { keepAction = false } = {}) {
|
|
178
|
+
this.selected = this.key(item);
|
|
179
|
+
this.armedRemove = false;
|
|
180
|
+
if (!keepAction) this.action = null;
|
|
181
|
+
const flags = scopeArgs(item);
|
|
182
|
+
if (!flags) {
|
|
183
|
+
this.detail = { item, state: 'error', error: 'This command\'s scope cannot be addressed from its path' };
|
|
184
|
+
this.render();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
this.detail = { item, state: 'loading' };
|
|
188
|
+
this.render();
|
|
189
|
+
const [show, history] = await Promise.allSettled([
|
|
190
|
+
this.call('show', [item.name, ...flags, '--json']),
|
|
191
|
+
this.call('history', [item.name, ...flags, '--json']),
|
|
192
|
+
]);
|
|
193
|
+
if (this.selected !== this.key(item)) return;
|
|
194
|
+
this.detail = {
|
|
195
|
+
item,
|
|
196
|
+
state: 'ready',
|
|
197
|
+
show: this.settle(show, data => data && typeof data === 'object' && 'code' in data),
|
|
198
|
+
history: this.settle(history, data => data && typeof data === 'object' && Array.isArray(data.versions)),
|
|
199
|
+
};
|
|
200
|
+
this.render();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
selectedItem() {
|
|
204
|
+
return this.commands.items.find(item => this.key(item) === this.selected) || null;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
async runTest() {
|
|
208
|
+
const item = this.selectedItem();
|
|
209
|
+
const flags = scopeArgs(item);
|
|
210
|
+
if (!item || !flags || this.busy) return;
|
|
211
|
+
this.busy = true;
|
|
212
|
+
this.armedRemove = false;
|
|
213
|
+
this.action = { kind: 'test', state: 'running' };
|
|
214
|
+
this.render();
|
|
215
|
+
try {
|
|
216
|
+
const data = await this.call('test', [item.name, ...flags, '--json']);
|
|
217
|
+
if (data && typeof data === 'object' && 'testFile' in data) this.action = { kind: 'test', state: 'done', data };
|
|
218
|
+
else this.action = { kind: 'test', state: 'error', error: failureOf(data) || 'The test returned an unexpected shape' };
|
|
219
|
+
} catch (error) {
|
|
220
|
+
this.action = { kind: 'test', state: 'error', error: error instanceof Error ? error.message : String(error) };
|
|
221
|
+
} finally {
|
|
222
|
+
this.busy = false;
|
|
223
|
+
this.render();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
async runRollback(version) {
|
|
228
|
+
const item = this.selectedItem();
|
|
229
|
+
const flags = scopeArgs(item);
|
|
230
|
+
if (!item || !flags || this.busy || !Number.isInteger(version)) return;
|
|
231
|
+
this.busy = true;
|
|
232
|
+
this.armedRemove = false;
|
|
233
|
+
this.action = { kind: 'rollback', state: 'running', version };
|
|
234
|
+
this.render();
|
|
235
|
+
try {
|
|
236
|
+
const message = await this.callConfirm('rollback', [item.name, String(version), ...flags, '--json']);
|
|
237
|
+
this.action = { kind: 'rollback', state: 'done', message };
|
|
238
|
+
} catch (error) {
|
|
239
|
+
this.action = { kind: 'rollback', state: 'error', error: error instanceof Error ? error.message : String(error) };
|
|
240
|
+
} finally {
|
|
241
|
+
this.busy = false;
|
|
242
|
+
}
|
|
243
|
+
await this.load();
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
async runRemove() {
|
|
247
|
+
const item = this.selectedItem();
|
|
248
|
+
const flags = scopeArgs(item);
|
|
249
|
+
if (!item || !flags || this.busy) return;
|
|
250
|
+
if (!this.armedRemove) {
|
|
251
|
+
this.armedRemove = true;
|
|
252
|
+
this.render();
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
this.busy = true;
|
|
256
|
+
this.armedRemove = false;
|
|
257
|
+
this.action = { kind: 'remove', state: 'running' };
|
|
258
|
+
this.render();
|
|
259
|
+
try {
|
|
260
|
+
const message = await this.callConfirm('remove', [item.name, ...flags, '--json']);
|
|
261
|
+
this.action = { kind: 'remove', state: 'done', message };
|
|
262
|
+
} catch (error) {
|
|
263
|
+
this.action = { kind: 'remove', state: 'error', error: error instanceof Error ? error.message : String(error) };
|
|
264
|
+
} finally {
|
|
265
|
+
this.busy = false;
|
|
266
|
+
}
|
|
267
|
+
await this.load();
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
riskBadge(risk) {
|
|
271
|
+
const tone = RISK_TONE[risk] || 'info';
|
|
272
|
+
return `<span class="risk risk-${tone}" data-design-component="risk-badge">${escapeHtml(risk || 'undeclared')}</span>`;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
renderStatus() {
|
|
276
|
+
const s = this.status;
|
|
277
|
+
if (s.state === 'loading') return `<p class="status-line" data-design-component="status-line" role="status">Reading plugin status…</p>`;
|
|
278
|
+
if (s.state === 'error') return `<p class="status-line is-error" data-design-component="status-line" role="status">Unavailable: ${escapeHtml(s.error)}</p>`;
|
|
279
|
+
const { implemented, scope = {} } = s.data;
|
|
280
|
+
return `
|
|
281
|
+
<dl class="status-line facts" data-design-component="status-line">
|
|
282
|
+
<div><dt>Operations</dt><dd>${implemented.length} implemented</dd></div>
|
|
283
|
+
<div><dt>Project commands</dt><dd class="mono">${escapeHtml(scope.project || 'Not resolved')}</dd></div>
|
|
284
|
+
<div><dt>Global commands</dt><dd class="mono">${escapeHtml(scope.global || 'Not resolved')}</dd></div>
|
|
285
|
+
</dl>`;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
renderList() {
|
|
289
|
+
const c = this.commands;
|
|
290
|
+
const filters = SCOPES.map(s => `
|
|
291
|
+
<button type="button" class="chip" data-scope="${s.id}" aria-pressed="${this.scope === s.id}">${s.label}</button>`).join('');
|
|
292
|
+
let body;
|
|
293
|
+
if (c.state === 'loading') body = `<p class="status-line" data-design-component="status-line" role="status">Reading composed commands…</p>`;
|
|
294
|
+
else if (c.state === 'error') body = `<p class="status-line is-error" data-design-component="status-line" role="status">Unavailable: ${escapeHtml(c.error)}</p>`;
|
|
295
|
+
else {
|
|
296
|
+
const items = c.items.filter(item => this.scope === 'all' || item.scope === this.scope);
|
|
297
|
+
body = items.length
|
|
298
|
+
? `<ul class="verbs">${items.map(item => {
|
|
299
|
+
const selected = this.key(item) === this.selected;
|
|
300
|
+
return `<li><button type="button" class="verb" data-key="${escapeHtml(this.key(item))}" aria-current="${selected}"
|
|
301
|
+
data-design-component="${selected ? 'verb-row-selected' : 'verb-row'}">
|
|
302
|
+
<span class="verb-name">${escapeHtml(item.name)}</span>
|
|
303
|
+
<span class="verb-meta">${this.riskBadge(item.risk)}<span class="scope-tag">${escapeHtml(item.scope)}</span></span>
|
|
304
|
+
${item.description ? `<span class="verb-desc">${escapeHtml(item.description)}</span>` : ''}
|
|
305
|
+
</button></li>`;
|
|
306
|
+
}).join('')}</ul>`
|
|
307
|
+
: `<p class="status-line" data-design-component="status-line">No composed commands in this scope. Create one with <code>total-recall composable-cli create</code>.</p>`;
|
|
308
|
+
}
|
|
309
|
+
return `<section class="deck" aria-label="Composed commands"><div class="chips" role="group" aria-label="Scope">${filters}</div>${body}</section>`;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
renderAction() {
|
|
313
|
+
const a = this.action;
|
|
314
|
+
if (!a) return '';
|
|
315
|
+
if (a.state === 'running') {
|
|
316
|
+
const label = a.kind === 'test' ? 'Running the test…' : a.kind === 'rollback' ? `Rolling back to v${a.version}…` : 'Removing…';
|
|
317
|
+
return `<p class="status-line" data-design-component="status-line" role="status">${label}</p>`;
|
|
318
|
+
}
|
|
319
|
+
if (a.state === 'error') return `<p class="status-line is-error" data-design-component="status-line" role="status">${escapeHtml(a.kind)} failed: ${escapeHtml(a.error)}</p>`;
|
|
320
|
+
if (a.kind !== 'test') return `<p class="status-line is-ok" data-design-component="status-line" role="status">${escapeHtml(a.message)}</p>`;
|
|
321
|
+
const d = a.data;
|
|
322
|
+
return `
|
|
323
|
+
<div class="result ${d.ok ? 'is-ok' : 'is-error'}" role="status">
|
|
324
|
+
<p class="result-head">${d.ok ? 'Test passed' : 'Test failed'}</p>
|
|
325
|
+
<dl class="facts">
|
|
326
|
+
<div><dt>Exit code</dt><dd>${escapeHtml(d.exitCode ?? 'none')}</dd></div>
|
|
327
|
+
<div><dt>Signal</dt><dd>${escapeHtml(d.signal ?? 'none')}</dd></div>
|
|
328
|
+
${d.error ? `<div><dt>Process error</dt><dd>${escapeHtml(d.error)}</dd></div>` : ''}
|
|
329
|
+
<div><dt>Test file</dt><dd class="mono">${escapeHtml(d.testFile)}</dd></div>
|
|
330
|
+
</dl>
|
|
331
|
+
${d.stdout ? `<pre class="code" aria-label="Test output">${escapeHtml(d.stdout)}</pre>` : ''}
|
|
332
|
+
${d.stderr ? `<pre class="code is-error" aria-label="Test errors">${escapeHtml(d.stderr)}</pre>` : ''}
|
|
333
|
+
</div>`;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
renderInspector() {
|
|
337
|
+
const d = this.detail;
|
|
338
|
+
if (!d) return `<section class="inspector" data-design-component="inspector">${this.renderAction()}<p class="muted">Select a composed command to read its record, history and source.</p></section>`;
|
|
339
|
+
const item = d.item;
|
|
340
|
+
const addressable = Boolean(scopeArgs(item));
|
|
341
|
+
const head = `
|
|
342
|
+
<div class="inspector-head">
|
|
343
|
+
<h3 class="mono">${escapeHtml(item.name)}</h3>
|
|
344
|
+
<div class="actions">
|
|
345
|
+
<button type="button" class="act act-primary" data-act="test" data-design-component="action-primary" ${this.busy || !addressable ? 'disabled' : ''}>Run test</button>
|
|
346
|
+
<button type="button" class="act act-danger" data-act="remove" data-design-component="action-danger" ${this.busy || !addressable ? 'disabled' : ''}>${this.armedRemove ? 'Confirm remove' : 'Remove'}</button>
|
|
347
|
+
</div>
|
|
348
|
+
</div>
|
|
349
|
+
${this.armedRemove ? `<p class="status-line is-error" data-design-component="status-line" role="alert">Removing deletes ${escapeHtml(item.name)} from the ${escapeHtml(item.scope)} scope. Select Confirm remove to continue.</p>` : ''}
|
|
350
|
+
${this.renderAction()}`;
|
|
351
|
+
if (d.state === 'loading') return `<section class="inspector" data-design-component="inspector">${head}<p class="status-line" data-design-component="status-line" role="status">Reading the command record…</p></section>`;
|
|
352
|
+
if (d.state === 'error') return `<section class="inspector" data-design-component="inspector">${head}<p class="status-line is-error" data-design-component="status-line" role="status">Unavailable: ${escapeHtml(d.error)}</p></section>`;
|
|
353
|
+
|
|
354
|
+
let record;
|
|
355
|
+
if (d.show.state === 'error') record = `<p class="status-line is-error" data-design-component="status-line">Record unavailable: ${escapeHtml(d.show.error)}</p>`;
|
|
356
|
+
else if (!d.show.data.registry) record = `<p class="status-line" data-design-component="status-line">No registry record. The command file exists without its cli_command document.</p>`;
|
|
357
|
+
else {
|
|
358
|
+
const r = d.show.data.registry;
|
|
359
|
+
record = `
|
|
360
|
+
<dl class="facts record">
|
|
361
|
+
<div><dt>Version</dt><dd>v${escapeHtml(r.version ?? '?')}</dd></div>
|
|
362
|
+
<div><dt>Risk</dt><dd>${this.riskBadge(r.risk)}</dd></div>
|
|
363
|
+
<div><dt>Scope</dt><dd>${escapeHtml(r.scope)}</dd></div>
|
|
364
|
+
<div><dt>Source</dt><dd>${escapeHtml(r.source || 'Not recorded')}</dd></div>
|
|
365
|
+
<div><dt>Author</dt><dd>${escapeHtml(r.author || 'Not recorded')}</dd></div>
|
|
366
|
+
<div><dt>Created</dt><dd>${escapeHtml(formatTime(r.created))}</dd></div>
|
|
367
|
+
<div><dt>Updated</dt><dd>${escapeHtml(formatTime(r.updated))}</dd></div>
|
|
368
|
+
<div><dt>Background runs</dt><dd>${r.background_allowed ? 'Allowed' : 'Not allowed'}</dd></div>
|
|
369
|
+
<div class="wide"><dt>Code digest</dt><dd class="mono">${escapeHtml(r.code_sha256 || 'Not recorded')}</dd></div>
|
|
370
|
+
${r.description ? `<div class="wide"><dt>Description</dt><dd>${escapeHtml(r.description)}</dd></div>` : ''}
|
|
371
|
+
</dl>`;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
let history;
|
|
375
|
+
if (d.history.state === 'error') history = `<p class="status-line is-error" data-design-component="status-line">History unavailable: ${escapeHtml(d.history.error)}</p>`;
|
|
376
|
+
else if (!d.history.data.versions.length) history = `<p class="muted">No earlier versions. Updates and rollbacks save a snapshot here.</p>`;
|
|
377
|
+
else history = `<ul class="versions">${d.history.data.versions.map(v => `
|
|
378
|
+
<li><span class="mono">v${escapeHtml(v)}</span>
|
|
379
|
+
<button type="button" class="act" data-rollback="${escapeHtml(v)}" ${this.busy || !addressable ? 'disabled' : ''}>Roll back to v${escapeHtml(v)}</button></li>`).join('')}</ul>`;
|
|
380
|
+
|
|
381
|
+
const source = d.show.state === 'ready'
|
|
382
|
+
? `<pre class="code" aria-label="Command source">${escapeHtml(d.show.data.code)}</pre>`
|
|
383
|
+
: '';
|
|
384
|
+
|
|
385
|
+
return `
|
|
386
|
+
<section class="inspector" data-design-component="inspector" aria-label="Command inspector">
|
|
387
|
+
${head}
|
|
388
|
+
<h4>Record</h4>${record}
|
|
389
|
+
<h4>History</h4>${history}
|
|
390
|
+
<h4>Source</h4>${source}
|
|
391
|
+
</section>`;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
render() {
|
|
395
|
+
const root = this.shadowRoot;
|
|
396
|
+
if (!root) return;
|
|
397
|
+
const count = this.commands.state === 'ready' ? `${this.commands.items.length} composed` : this.commands.state === 'error' ? 'Unavailable' : 'Reading…';
|
|
398
|
+
root.innerHTML = `
|
|
399
|
+
<style>
|
|
400
|
+
:host {
|
|
401
|
+
display: block;
|
|
402
|
+
background: var(--color-background);
|
|
403
|
+
color: var(--color-text);
|
|
404
|
+
font-family: var(--typography-body-font-family);
|
|
405
|
+
font-size: var(--typography-body-font-size);
|
|
406
|
+
line-height: var(--typography-body-line-height);
|
|
407
|
+
padding: var(--spacing-lg);
|
|
408
|
+
border: 1px solid var(--color-line);
|
|
409
|
+
border-radius: var(--radius-lg);
|
|
410
|
+
box-sizing: border-box;
|
|
411
|
+
}
|
|
412
|
+
* { box-sizing: border-box; }
|
|
413
|
+
h3, h4, p, dl, dd, ul { margin: 0; }
|
|
414
|
+
ul { padding: 0; list-style: none; }
|
|
415
|
+
.mono, code, .verb-name { font-family: var(--typography-code-font-family); font-size: var(--typography-code-font-size); }
|
|
416
|
+
.muted { color: var(--color-muted); }
|
|
417
|
+
header {
|
|
418
|
+
display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--spacing-md);
|
|
419
|
+
background: var(--color-secondary); border-radius: var(--radius-lg); padding: var(--spacing-md);
|
|
420
|
+
margin-bottom: var(--spacing-md);
|
|
421
|
+
}
|
|
422
|
+
.mark { display: flex; align-items: baseline; gap: var(--spacing-sm); }
|
|
423
|
+
.wordmark {
|
|
424
|
+
font-family: var(--typography-title-font-family); font-size: var(--typography-title-font-size);
|
|
425
|
+
font-weight: var(--typography-title-font-weight); line-height: var(--typography-title-line-height);
|
|
426
|
+
color: var(--color-primary-strong);
|
|
427
|
+
}
|
|
428
|
+
.badge, .scope-tag, .risk, dt {
|
|
429
|
+
font-family: var(--typography-label-font-family); font-size: var(--typography-label-font-size);
|
|
430
|
+
font-weight: var(--typography-label-font-weight); letter-spacing: var(--typography-label-letter-spacing);
|
|
431
|
+
text-transform: uppercase;
|
|
432
|
+
}
|
|
433
|
+
.badge { color: var(--color-muted); }
|
|
434
|
+
.head-right { display: flex; align-items: center; gap: var(--spacing-sm); }
|
|
435
|
+
.count { color: var(--color-text); }
|
|
436
|
+
button {
|
|
437
|
+
font: inherit; color: var(--color-text); cursor: pointer;
|
|
438
|
+
min-height: var(--spacing-touch); min-width: var(--spacing-touch);
|
|
439
|
+
border: 1px solid var(--color-line); border-radius: var(--radius-md);
|
|
440
|
+
background: var(--color-surface); padding: var(--spacing-xs) var(--spacing-md);
|
|
441
|
+
transition: background-color 120ms ease, border-color 120ms ease;
|
|
442
|
+
}
|
|
443
|
+
button:hover:not(:disabled) { border-color: var(--color-primary); }
|
|
444
|
+
button:focus-visible { outline: 2px solid var(--color-primary-strong); outline-offset: 2px; }
|
|
445
|
+
button:disabled { cursor: not-allowed; color: var(--color-muted); }
|
|
446
|
+
.status-line {
|
|
447
|
+
background: var(--color-surface-raised); color: var(--color-muted);
|
|
448
|
+
border-radius: var(--radius-md); padding: var(--spacing-sm); margin-bottom: var(--spacing-md);
|
|
449
|
+
}
|
|
450
|
+
.status-line.is-error, .is-error { color: var(--color-danger); }
|
|
451
|
+
.status-line.is-error { background: var(--color-danger-soft); }
|
|
452
|
+
.status-line.is-ok { background: var(--color-ok-soft); color: var(--color-ok); }
|
|
453
|
+
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--spacing-sm); }
|
|
454
|
+
.facts .wide { grid-column: 1 / -1; }
|
|
455
|
+
dt { color: var(--color-muted); margin-bottom: var(--spacing-xs); }
|
|
456
|
+
dd { overflow-wrap: anywhere; }
|
|
457
|
+
.split { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.6fr); gap: var(--spacing-md); }
|
|
458
|
+
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }
|
|
459
|
+
.chips { display: flex; flex-wrap: wrap; gap: var(--spacing-xs); margin-bottom: var(--spacing-sm); }
|
|
460
|
+
.chip[aria-pressed="true"] { background: var(--color-primary-soft); border-color: var(--color-primary); }
|
|
461
|
+
.verbs { display: flex; flex-direction: column; gap: var(--spacing-xs); max-height: 460px; overflow-y: auto; }
|
|
462
|
+
.verb {
|
|
463
|
+
width: 100%; text-align: left; display: grid; gap: var(--spacing-xs); padding: var(--spacing-sm);
|
|
464
|
+
grid-template-columns: 1fr auto;
|
|
465
|
+
}
|
|
466
|
+
.verb[aria-current="true"] { background: var(--color-primary-soft); border-color: var(--color-primary); }
|
|
467
|
+
.verb-meta { display: flex; gap: var(--spacing-xs); align-items: center; }
|
|
468
|
+
.verb-desc { grid-column: 1 / -1; color: var(--color-muted); }
|
|
469
|
+
.scope-tag { color: var(--color-info); background: var(--color-info-soft); border-radius: var(--radius-sm); padding: 2px var(--spacing-xs); }
|
|
470
|
+
.risk { border-radius: var(--radius-sm); padding: 2px var(--spacing-xs); }
|
|
471
|
+
.risk-ok { color: var(--color-ok); background: var(--color-ok-soft); }
|
|
472
|
+
.risk-warn { color: var(--color-warn); background: var(--color-warn-soft); }
|
|
473
|
+
.risk-danger { color: var(--color-danger); background: var(--color-danger-soft); }
|
|
474
|
+
.risk-info { color: var(--color-info); background: var(--color-info-soft); }
|
|
475
|
+
.inspector {
|
|
476
|
+
background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg);
|
|
477
|
+
padding: var(--spacing-lg); display: flex; flex-direction: column; gap: var(--spacing-sm); min-width: 0;
|
|
478
|
+
}
|
|
479
|
+
.inspector h4 { margin-top: var(--spacing-sm); color: var(--color-muted); font-size: var(--typography-label-font-size); text-transform: uppercase; letter-spacing: var(--typography-label-letter-spacing); }
|
|
480
|
+
.inspector-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--spacing-sm); }
|
|
481
|
+
.actions { display: flex; gap: var(--spacing-sm); }
|
|
482
|
+
.act-primary { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }
|
|
483
|
+
.act-primary:hover:not(:disabled) { background: var(--color-primary-strong); }
|
|
484
|
+
.act-danger { background: var(--color-danger-soft); color: var(--color-danger); border-color: var(--color-danger); }
|
|
485
|
+
.versions { display: flex; flex-direction: column; gap: var(--spacing-xs); }
|
|
486
|
+
.versions li { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-sm); }
|
|
487
|
+
.result { border: 1px solid var(--color-line); border-radius: var(--radius-md); padding: var(--spacing-sm); }
|
|
488
|
+
.result.is-ok { border-color: var(--color-ok); }
|
|
489
|
+
.result.is-error { border-color: var(--color-danger); }
|
|
490
|
+
.result-head { font-weight: var(--typography-title-font-weight); margin-bottom: var(--spacing-sm); }
|
|
491
|
+
.code {
|
|
492
|
+
font-family: var(--typography-code-font-family); font-size: var(--typography-code-font-size);
|
|
493
|
+
line-height: var(--typography-code-line-height); background: var(--color-background);
|
|
494
|
+
border: 1px solid var(--color-line); border-radius: var(--radius-md); padding: var(--spacing-sm);
|
|
495
|
+
max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: var(--spacing-sm) 0 0;
|
|
496
|
+
}
|
|
497
|
+
@media (prefers-reduced-motion: reduce) {
|
|
498
|
+
* { transition: none !important; animation: none !important; }
|
|
499
|
+
}
|
|
500
|
+
</style>
|
|
501
|
+
<header data-design-component="forge-header">
|
|
502
|
+
<div class="mark"><span class="wordmark">CmdSmith</span><span class="badge">Pipeline Forge</span></div>
|
|
503
|
+
<div class="head-right">
|
|
504
|
+
<span class="count" aria-live="polite">${escapeHtml(count)}</span>
|
|
505
|
+
<button type="button" data-act="refresh" ${this.busy ? 'disabled' : ''}>Refresh</button>
|
|
506
|
+
</div>
|
|
507
|
+
</header>
|
|
508
|
+
${this.renderStatus()}
|
|
509
|
+
<div class="split">
|
|
510
|
+
${this.renderList()}
|
|
511
|
+
${this.renderInspector()}
|
|
512
|
+
</div>`;
|
|
513
|
+
|
|
514
|
+
root.querySelector('[data-act="refresh"]')?.addEventListener('click', () => this.load());
|
|
515
|
+
root.querySelectorAll('[data-scope]').forEach(button => button.addEventListener('click', () => {
|
|
516
|
+
this.scope = button.getAttribute('data-scope');
|
|
517
|
+
this.render();
|
|
518
|
+
}));
|
|
519
|
+
root.querySelectorAll('[data-key]').forEach(button => button.addEventListener('click', () => {
|
|
520
|
+
const item = this.commands.items.find(entry => this.key(entry) === button.getAttribute('data-key'));
|
|
521
|
+
if (item) this.inspect(item);
|
|
522
|
+
}));
|
|
523
|
+
root.querySelector('[data-act="test"]')?.addEventListener('click', () => this.runTest());
|
|
524
|
+
root.querySelector('[data-act="remove"]')?.addEventListener('click', () => this.runRemove());
|
|
525
|
+
root.querySelectorAll('[data-rollback]').forEach(button => button.addEventListener('click', () => {
|
|
526
|
+
this.runRollback(Number.parseInt(button.getAttribute('data-rollback'), 10));
|
|
527
|
+
}));
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
if (!customElements.get('tr-composable-cli-home')) {
|
|
532
|
+
customElements.define('tr-composable-cli-home', ComposableCliHome);
|
|
533
|
+
}
|