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
|
@@ -1,1401 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenWiki — Knowledge Graph & Multi-Repo Documentation Wiki
|
|
3
|
-
* Bespoke Card Face: Deep Slate & Knowledge Amber Interface.
|
|
4
|
-
*
|
|
5
|
-
* Exposes live hub discovery, full markdown reading, evidence search across all vaults,
|
|
6
|
-
* interactive knowledge topology graph, targeted on-demand generation, fleet refresh,
|
|
7
|
-
* Total Recall auth secrets vault key management, and documentation link hygiene linting.
|
|
8
|
-
*
|
|
9
|
-
* Operates without mock data, zero templates, zero emojis, zero Winamp skeuomorphism.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
export class OpenWikiCard extends HTMLElement {
|
|
13
|
-
static get screens() {
|
|
14
|
-
return [
|
|
15
|
-
{ id: 'hubs', label: 'Hubs' },
|
|
16
|
-
{ id: 'search', label: 'Search' },
|
|
17
|
-
{ id: 'graph', label: 'Graph' },
|
|
18
|
-
{ id: 'generate', label: 'Generate' },
|
|
19
|
-
{ id: 'refresh', label: 'Fleet Refresh' },
|
|
20
|
-
{ id: 'token', label: 'Auth Vault' },
|
|
21
|
-
{ id: 'lint', label: 'Health' },
|
|
22
|
-
{ id: 'upstream', label: 'Upstream Watcher' },
|
|
23
|
-
{ id: 'config', label: 'Configuration' }
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
get screens() {
|
|
28
|
-
return OpenWikiCard.screens;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
constructor() {
|
|
32
|
-
super();
|
|
33
|
-
this.activeScreen = 'hubs';
|
|
34
|
-
this.scope = 'workspace'; // 'workspace' | 'all-vaults' | '<mesh-node>'
|
|
35
|
-
this.meshNodes = [];
|
|
36
|
-
this.hubs = [];
|
|
37
|
-
this.selectedHub = null;
|
|
38
|
-
this.selectedHubContent = null;
|
|
39
|
-
this.loading = false;
|
|
40
|
-
this.statusText = 'READY';
|
|
41
|
-
this.targetPath = 'openwiki';
|
|
42
|
-
this.dryRun = false;
|
|
43
|
-
this.executionResult = null;
|
|
44
|
-
this.errorMessage = null;
|
|
45
|
-
this.lastRefreshedAt = null;
|
|
46
|
-
this.upstream = null;
|
|
47
|
-
|
|
48
|
-
// Search state
|
|
49
|
-
this.searchQuery = '';
|
|
50
|
-
this.searchResults = [];
|
|
51
|
-
this.searchStats = null;
|
|
52
|
-
|
|
53
|
-
// Graph state
|
|
54
|
-
this.graphData = null;
|
|
55
|
-
this.graphFormat = 'svg'; // 'svg' | 'mermaid' | 'json'
|
|
56
|
-
|
|
57
|
-
// Token state
|
|
58
|
-
this.tokenStatus = {
|
|
59
|
-
openrouter: { key: 'OPENROUTER_API_KEY', configured: false, status: 'unknown' },
|
|
60
|
-
google: { key: 'GOOGLE_API_KEY', configured: false, status: 'unknown' }
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
// Lint state
|
|
64
|
-
this.lintData = null;
|
|
65
|
-
|
|
66
|
-
// Generator state
|
|
67
|
-
this.generateRepo = '';
|
|
68
|
-
this.generateLogs = [];
|
|
69
|
-
|
|
70
|
-
// Fleet refresh state
|
|
71
|
-
this.refreshReports = [];
|
|
72
|
-
this.refreshCounts = null;
|
|
73
|
-
|
|
74
|
-
// Configuration state
|
|
75
|
-
this.config = {
|
|
76
|
-
provider: 'openrouter',
|
|
77
|
-
model: 'deepseek/deepseek-chat',
|
|
78
|
-
fallback_model: 'qwen/qwen-2.5-coder-32b-instruct',
|
|
79
|
-
max_tokens: 4096,
|
|
80
|
-
timeout_ms: 300000
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
this._boundOnScreenChange = this.handleExternalScreenChange.bind(this);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
connectedCallback() {
|
|
87
|
-
if (!this.shadowRoot) {
|
|
88
|
-
this.attachShadow({ mode: 'open' });
|
|
89
|
-
}
|
|
90
|
-
this.addEventListener('tr:screen-change', this._boundOnScreenChange);
|
|
91
|
-
this.addEventListener('plugin-show-screen', this._boundOnScreenChange);
|
|
92
|
-
this.render();
|
|
93
|
-
this.refreshHubs();
|
|
94
|
-
this.loadTokenStatus();
|
|
95
|
-
this.loadConfig();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
disconnectedCallback() {
|
|
99
|
-
this.removeEventListener('tr:screen-change', this._boundOnScreenChange);
|
|
100
|
-
this.removeEventListener('plugin-show-screen', this._boundOnScreenChange);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
handleExternalScreenChange(event) {
|
|
104
|
-
const screenId = event.detail?.screen || event.detail?.screenId || event.detail?.id;
|
|
105
|
-
if (screenId && OpenWikiCard.screens.some((s) => s.id === screenId)) {
|
|
106
|
-
this.setScreen(screenId);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
setScreen(id) {
|
|
111
|
-
if (this.activeScreen === id && !this.selectedHub) return;
|
|
112
|
-
this.activeScreen = id;
|
|
113
|
-
this.selectedHub = null;
|
|
114
|
-
this.selectedHubContent = null;
|
|
115
|
-
this.errorMessage = null;
|
|
116
|
-
this.render();
|
|
117
|
-
|
|
118
|
-
if (typeof this.host?.screenChanged === 'function') {
|
|
119
|
-
try {
|
|
120
|
-
this.host.screenChanged({ screen: id });
|
|
121
|
-
} catch {
|
|
122
|
-
// optional host callback
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (id === 'graph' && !this.graphData) {
|
|
127
|
-
this.loadGraph();
|
|
128
|
-
} else if (id === 'token') {
|
|
129
|
-
this.loadTokenStatus();
|
|
130
|
-
} else if (id === 'lint' && !this.lintData) {
|
|
131
|
-
this.loadLint();
|
|
132
|
-
} else if (id === 'refresh' && (!this.refreshReports || this.refreshReports.length === 0)) {
|
|
133
|
-
this.loadRefreshReport();
|
|
134
|
-
} else if (id === 'config') {
|
|
135
|
-
this.loadConfig();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
setScope(newScope) {
|
|
140
|
-
if (this.scope === newScope) return;
|
|
141
|
-
this.scope = newScope;
|
|
142
|
-
this.refreshHubs();
|
|
143
|
-
if (this.activeScreen === 'graph') this.loadGraph();
|
|
144
|
-
if (this.activeScreen === 'lint') this.loadLint();
|
|
145
|
-
if (this.activeScreen === 'search' && this.searchQuery) this.executeSearch(this.searchQuery);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
async loadConfig() {
|
|
149
|
-
try {
|
|
150
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
151
|
-
const res = await this.host.run('config', ['show', '--json']);
|
|
152
|
-
if (res?.config) {
|
|
153
|
-
this.config = res.config;
|
|
154
|
-
this.render();
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
} catch {
|
|
158
|
-
// Retain active defaults
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
async setConfigValue(key, value) {
|
|
163
|
-
this.loading = true;
|
|
164
|
-
this.errorMessage = null;
|
|
165
|
-
this.render();
|
|
166
|
-
try {
|
|
167
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
168
|
-
const res = await this.host.run('config', ['set', key, String(value), '--json']);
|
|
169
|
-
if (res?.config) {
|
|
170
|
-
this.config = res.config;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
} catch (err) {
|
|
174
|
-
this.errorMessage = err.message || `Failed to update ${key}`;
|
|
175
|
-
} finally {
|
|
176
|
-
this.loading = false;
|
|
177
|
-
this.render();
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
async loadTokenStatus() {
|
|
182
|
-
try {
|
|
183
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
184
|
-
const res = await this.host.run('token', ['status', '--json']);
|
|
185
|
-
if (res?.tokens) {
|
|
186
|
-
this.tokenStatus = res.tokens;
|
|
187
|
-
this.render();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
} catch {
|
|
191
|
-
// optional fallback
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
async saveToken(provider, tokenValue) {
|
|
196
|
-
if (!tokenValue || !tokenValue.trim()) return;
|
|
197
|
-
this.loading = true;
|
|
198
|
-
this.errorMessage = null;
|
|
199
|
-
this.render();
|
|
200
|
-
try {
|
|
201
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
202
|
-
await this.host.run('token', ['set', provider, tokenValue.trim(), '--json']);
|
|
203
|
-
await this.loadTokenStatus();
|
|
204
|
-
}
|
|
205
|
-
} catch (err) {
|
|
206
|
-
this.errorMessage = err.message || `Failed to save ${provider} token`;
|
|
207
|
-
} finally {
|
|
208
|
-
this.loading = false;
|
|
209
|
-
this.render();
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
async refreshHubs() {
|
|
214
|
-
this.loading = true;
|
|
215
|
-
this.errorMessage = null;
|
|
216
|
-
this.render();
|
|
217
|
-
|
|
218
|
-
try {
|
|
219
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
220
|
-
const args = ['--json'];
|
|
221
|
-
if (this.scope === 'all-vaults') {
|
|
222
|
-
args.push('--all-vaults');
|
|
223
|
-
} else if (this.scope !== 'workspace') {
|
|
224
|
-
args.push(`--node=${this.scope}`);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
const res = await this.host.run('hubs', args);
|
|
228
|
-
if (res && Array.isArray(res.hubs)) {
|
|
229
|
-
this.hubs = res.hubs;
|
|
230
|
-
this.statusText = 'SYNCHRONIZED';
|
|
231
|
-
} else {
|
|
232
|
-
this.hubs = [];
|
|
233
|
-
this.statusText = 'UNINDEXED';
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
try {
|
|
237
|
-
const statusRes = await this.host.run('status', ['--json']);
|
|
238
|
-
if (statusRes?.upstream) {
|
|
239
|
-
this.upstream = statusRes.upstream;
|
|
240
|
-
}
|
|
241
|
-
} catch {
|
|
242
|
-
// Upstream metadata optional
|
|
243
|
-
}
|
|
244
|
-
} else {
|
|
245
|
-
this.statusText = 'DISCONNECTED';
|
|
246
|
-
}
|
|
247
|
-
this.lastRefreshedAt = new Date().toLocaleTimeString();
|
|
248
|
-
} catch (err) {
|
|
249
|
-
this.statusText = 'ERROR';
|
|
250
|
-
this.errorMessage = err.message || 'Hub synchronization failure';
|
|
251
|
-
this.hubs = [];
|
|
252
|
-
} finally {
|
|
253
|
-
this.loading = false;
|
|
254
|
-
this.render();
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
async readHubDocument(hub) {
|
|
259
|
-
this.selectedHub = hub;
|
|
260
|
-
this.loading = true;
|
|
261
|
-
this.render();
|
|
262
|
-
try {
|
|
263
|
-
if (this.host && typeof this.host.readFile === 'function') {
|
|
264
|
-
this.selectedHubContent = await this.host.readFile(hub.path);
|
|
265
|
-
} else {
|
|
266
|
-
this.selectedHubContent = `# ${hub.title}\n\n*File:* \`${hub.path}\`\n\n*Lines:* ${hub.lines} | *Size:* ${hub.size_bytes} bytes\n\n*(Full live rendering available)*`;
|
|
267
|
-
}
|
|
268
|
-
} catch {
|
|
269
|
-
this.selectedHubContent = `# ${hub.title}\n\n*Unable to load full content from ${hub.path}*`;
|
|
270
|
-
} finally {
|
|
271
|
-
this.loading = false;
|
|
272
|
-
this.render();
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
async executeSearch(query) {
|
|
277
|
-
if (!query || !query.trim()) {
|
|
278
|
-
this.searchResults = [];
|
|
279
|
-
this.searchStats = null;
|
|
280
|
-
this.render();
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
this.loading = true;
|
|
285
|
-
this.searchQuery = query.trim();
|
|
286
|
-
this.errorMessage = null;
|
|
287
|
-
this.render();
|
|
288
|
-
|
|
289
|
-
try {
|
|
290
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
291
|
-
const args = [this.searchQuery, '--json'];
|
|
292
|
-
if (this.scope === 'all-vaults') args.push('--all-vaults');
|
|
293
|
-
else if (this.scope !== 'workspace') args.push(`--node=${this.scope}`);
|
|
294
|
-
|
|
295
|
-
const res = await this.host.run('search', args);
|
|
296
|
-
if (res && Array.isArray(res.results)) {
|
|
297
|
-
this.searchResults = res.results;
|
|
298
|
-
this.searchStats = {
|
|
299
|
-
totalHubs: res.totalHubsScanned || 0,
|
|
300
|
-
count: res.count || 0,
|
|
301
|
-
scope: res.scope || this.scope
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
} catch (err) {
|
|
306
|
-
this.errorMessage = err.message || 'Search execution failure';
|
|
307
|
-
this.searchResults = [];
|
|
308
|
-
} finally {
|
|
309
|
-
this.loading = false;
|
|
310
|
-
this.render();
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
async loadGraph() {
|
|
315
|
-
this.loading = true;
|
|
316
|
-
this.errorMessage = null;
|
|
317
|
-
this.render();
|
|
318
|
-
try {
|
|
319
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
320
|
-
const args = ['--format=json', '--json'];
|
|
321
|
-
if (this.scope === 'all-vaults') args.push('--all-vaults');
|
|
322
|
-
else if (this.scope !== 'workspace') args.push(`--node=${this.scope}`);
|
|
323
|
-
|
|
324
|
-
const res = await this.host.run('graph', args);
|
|
325
|
-
if (res?.nodes) {
|
|
326
|
-
this.graphData = res;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
} catch (err) {
|
|
330
|
-
this.errorMessage = err.message || 'Graph build failure';
|
|
331
|
-
} finally {
|
|
332
|
-
this.loading = false;
|
|
333
|
-
this.render();
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
async loadLint() {
|
|
338
|
-
this.loading = true;
|
|
339
|
-
this.errorMessage = null;
|
|
340
|
-
this.render();
|
|
341
|
-
try {
|
|
342
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
343
|
-
const args = ['--json'];
|
|
344
|
-
if (this.scope === 'all-vaults') args.push('--all-vaults');
|
|
345
|
-
else if (this.scope !== 'workspace') args.push(`--node=${this.scope}`);
|
|
346
|
-
|
|
347
|
-
const res = await this.host.run('lint', args);
|
|
348
|
-
if (res) {
|
|
349
|
-
this.lintData = res;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
} catch (err) {
|
|
353
|
-
this.errorMessage = err.message || 'Lint execution failure';
|
|
354
|
-
} finally {
|
|
355
|
-
this.loading = false;
|
|
356
|
-
this.render();
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
async loadRefreshReport() {
|
|
361
|
-
this.loading = true;
|
|
362
|
-
this.errorMessage = null;
|
|
363
|
-
this.render();
|
|
364
|
-
try {
|
|
365
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
366
|
-
const res = await this.host.run('refresh', ['--json']);
|
|
367
|
-
if (res) {
|
|
368
|
-
this.refreshReports = Array.isArray(res.reports) ? res.reports : [];
|
|
369
|
-
this.refreshCounts = res.counts || null;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
} catch (err) {
|
|
373
|
-
this.errorMessage = err.message || 'Fleet status check failure';
|
|
374
|
-
} finally {
|
|
375
|
-
this.loading = false;
|
|
376
|
-
this.render();
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
async executeFleetRefresh() {
|
|
381
|
-
if (this.loading) return;
|
|
382
|
-
this.loading = true;
|
|
383
|
-
this.errorMessage = null;
|
|
384
|
-
this.render();
|
|
385
|
-
|
|
386
|
-
try {
|
|
387
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
388
|
-
const res = await this.host.run('refresh', ['--apply', '--json']);
|
|
389
|
-
if (res?.reports) {
|
|
390
|
-
this.refreshReports = res.reports;
|
|
391
|
-
this.refreshCounts = res.counts;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
} catch (err) {
|
|
395
|
-
this.errorMessage = err.message || 'Fleet refresh execution failure';
|
|
396
|
-
} finally {
|
|
397
|
-
this.loading = false;
|
|
398
|
-
this.render();
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
async executeGenerate() {
|
|
403
|
-
if (this.loading) return;
|
|
404
|
-
this.loading = true;
|
|
405
|
-
this.errorMessage = null;
|
|
406
|
-
this.generateLogs = [`Dispatching on-demand generator for '${this.generateRepo || 'current repository'}'...`];
|
|
407
|
-
this.render();
|
|
408
|
-
|
|
409
|
-
try {
|
|
410
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
411
|
-
const args = ['--json'];
|
|
412
|
-
if (this.generateRepo) args.push(`--repo=${this.generateRepo}`);
|
|
413
|
-
if (this.scope !== 'workspace' && this.scope !== 'all-vaults') {
|
|
414
|
-
args.push(`--node=${this.scope}`);
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
const res = await this.host.run('generate', args);
|
|
418
|
-
this.generateLogs.push(res?.ok ? `Generation completed successfully in ${Math.round((res.durationMs || 0)/1000)}s` : 'Generation finished with warnings');
|
|
419
|
-
if (res?.outputDir) this.generateLogs.push(`Output: ${res.outputDir}`);
|
|
420
|
-
}
|
|
421
|
-
} catch (err) {
|
|
422
|
-
this.errorMessage = err.message || 'Generation execution failure';
|
|
423
|
-
this.generateLogs.push(`Error: ${this.errorMessage}`);
|
|
424
|
-
} finally {
|
|
425
|
-
this.loading = false;
|
|
426
|
-
this.refreshHubs();
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
async executeIngest() {
|
|
431
|
-
if (this.loading) return;
|
|
432
|
-
this.loading = true;
|
|
433
|
-
this.errorMessage = null;
|
|
434
|
-
this.render();
|
|
435
|
-
|
|
436
|
-
const args = [this.targetPath || 'openwiki'];
|
|
437
|
-
if (this.dryRun) args.push('--dry-run');
|
|
438
|
-
|
|
439
|
-
try {
|
|
440
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
441
|
-
await this.host.run('ingest', args);
|
|
442
|
-
}
|
|
443
|
-
} catch (err) {
|
|
444
|
-
this.errorMessage = err.message || 'Ingestion cycle failure';
|
|
445
|
-
} finally {
|
|
446
|
-
this.loading = false;
|
|
447
|
-
this.refreshHubs();
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
async executeWatch() {
|
|
452
|
-
if (this.loading) return;
|
|
453
|
-
this.loading = true;
|
|
454
|
-
this.errorMessage = null;
|
|
455
|
-
this.render();
|
|
456
|
-
|
|
457
|
-
try {
|
|
458
|
-
if (this.host && typeof this.host.run === 'function') {
|
|
459
|
-
const res = await this.host.run('watch', ['--json']);
|
|
460
|
-
if (res?.status) {
|
|
461
|
-
this.upstream = {
|
|
462
|
-
recordedVersion: res.status.currentVersion,
|
|
463
|
-
latestVersion: res.status.latestVersion
|
|
464
|
-
};
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
} catch (err) {
|
|
468
|
-
this.errorMessage = err.message || 'Upstream surveillance failure';
|
|
469
|
-
} finally {
|
|
470
|
-
this.loading = false;
|
|
471
|
-
this.refreshHubs();
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
render() {
|
|
476
|
-
if (!this.shadowRoot) return;
|
|
477
|
-
|
|
478
|
-
const countText = this.hubs.length ? `${this.hubs.length} Hubs` : '0 Hubs';
|
|
479
|
-
const totalLines = this.hubs.reduce((acc, h) => acc + (h.lines || 0), 0);
|
|
480
|
-
const linesText = `${totalLines.toLocaleString()} Lines`;
|
|
481
|
-
|
|
482
|
-
this.shadowRoot.innerHTML = `
|
|
483
|
-
<style>
|
|
484
|
-
:host {
|
|
485
|
-
display: block;
|
|
486
|
-
box-sizing: border-box;
|
|
487
|
-
--bg-base: #090d16;
|
|
488
|
-
--bg-surface: #111827;
|
|
489
|
-
--bg-elevated: #1f2937;
|
|
490
|
-
--border-subtle: #374151;
|
|
491
|
-
--border-focus: #f59e0b;
|
|
492
|
-
--text-main: #f9fafb;
|
|
493
|
-
--text-muted: #9ca3af;
|
|
494
|
-
--accent-amber: #f59e0b;
|
|
495
|
-
--accent-green: #10b981;
|
|
496
|
-
--accent-red: #ef4444;
|
|
497
|
-
background: var(--bg-base);
|
|
498
|
-
color: var(--text-main);
|
|
499
|
-
border: 1px solid var(--border-subtle);
|
|
500
|
-
border-radius: 10px;
|
|
501
|
-
padding: 16px;
|
|
502
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
503
|
-
font-size: 13px;
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
*, *::before, *::after {
|
|
507
|
-
box-sizing: inherit;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
.header-bar {
|
|
511
|
-
display: flex;
|
|
512
|
-
align-items: center;
|
|
513
|
-
justify-content: space-between;
|
|
514
|
-
padding-bottom: 12px;
|
|
515
|
-
border-bottom: 1px solid var(--border-subtle);
|
|
516
|
-
gap: 12px;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
.brand-cluster {
|
|
520
|
-
display: flex;
|
|
521
|
-
align-items: center;
|
|
522
|
-
gap: 10px;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
.crest-svg {
|
|
526
|
-
width: 24px;
|
|
527
|
-
height: 24px;
|
|
528
|
-
fill: var(--accent-amber);
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
.brand-title {
|
|
532
|
-
font-weight: 700;
|
|
533
|
-
font-size: 15px;
|
|
534
|
-
letter-spacing: 0.05em;
|
|
535
|
-
color: var(--text-main);
|
|
536
|
-
text-transform: uppercase;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
.wordmark-badge {
|
|
540
|
-
font-family: ui-monospace, monospace;
|
|
541
|
-
font-size: 10px;
|
|
542
|
-
background: rgba(245, 158, 11, 0.15);
|
|
543
|
-
color: var(--accent-amber);
|
|
544
|
-
border: 1px solid rgba(245, 158, 11, 0.3);
|
|
545
|
-
padding: 2px 6px;
|
|
546
|
-
border-radius: 4px;
|
|
547
|
-
font-weight: 600;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
.scope-control {
|
|
551
|
-
display: flex;
|
|
552
|
-
align-items: center;
|
|
553
|
-
gap: 6px;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
.scope-select {
|
|
557
|
-
background: var(--bg-surface);
|
|
558
|
-
color: var(--text-main);
|
|
559
|
-
border: 1px solid var(--border-subtle);
|
|
560
|
-
border-radius: 6px;
|
|
561
|
-
padding: 4px 8px;
|
|
562
|
-
font-size: 12px;
|
|
563
|
-
cursor: pointer;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
/* Screen Navigation */
|
|
567
|
-
.screen-nav {
|
|
568
|
-
display: flex;
|
|
569
|
-
gap: 4px;
|
|
570
|
-
margin: 12px 0;
|
|
571
|
-
overflow-x: auto;
|
|
572
|
-
padding-bottom: 4px;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
.nav-btn {
|
|
576
|
-
background: transparent;
|
|
577
|
-
color: var(--text-muted);
|
|
578
|
-
border: 1px solid transparent;
|
|
579
|
-
border-radius: 6px;
|
|
580
|
-
padding: 6px 12px;
|
|
581
|
-
font-size: 12px;
|
|
582
|
-
font-weight: 600;
|
|
583
|
-
cursor: pointer;
|
|
584
|
-
white-space: nowrap;
|
|
585
|
-
min-height: 44px;
|
|
586
|
-
transition: all 0.15s ease;
|
|
587
|
-
}
|
|
588
|
-
.nav-btn:hover {
|
|
589
|
-
color: var(--text-main);
|
|
590
|
-
background: var(--bg-surface);
|
|
591
|
-
}
|
|
592
|
-
.nav-btn.active {
|
|
593
|
-
color: var(--accent-amber);
|
|
594
|
-
background: rgba(245, 158, 11, 0.12);
|
|
595
|
-
border-color: rgba(245, 158, 11, 0.4);
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
/* Metrics Deck */
|
|
599
|
-
.metric-deck {
|
|
600
|
-
display: grid;
|
|
601
|
-
grid-template-columns: repeat(3, 1fr);
|
|
602
|
-
gap: 8px;
|
|
603
|
-
margin-bottom: 14px;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
.metric-cell {
|
|
607
|
-
background: var(--bg-surface);
|
|
608
|
-
border: 1px solid var(--border-subtle);
|
|
609
|
-
border-radius: 6px;
|
|
610
|
-
padding: 8px 10px;
|
|
611
|
-
}
|
|
612
|
-
.metric-label {
|
|
613
|
-
font-size: 11px;
|
|
614
|
-
color: var(--text-muted);
|
|
615
|
-
text-transform: uppercase;
|
|
616
|
-
}
|
|
617
|
-
.metric-val {
|
|
618
|
-
font-size: 15px;
|
|
619
|
-
font-weight: 700;
|
|
620
|
-
margin-top: 2px;
|
|
621
|
-
color: var(--text-main);
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
/* Content Deck */
|
|
625
|
-
.content-view {
|
|
626
|
-
background: var(--bg-surface);
|
|
627
|
-
border: 1px solid var(--border-subtle);
|
|
628
|
-
border-radius: 8px;
|
|
629
|
-
padding: 14px;
|
|
630
|
-
min-height: 260px;
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
.hub-list {
|
|
634
|
-
display: flex;
|
|
635
|
-
flex-direction: column;
|
|
636
|
-
gap: 6px;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
.hub-item {
|
|
640
|
-
display: flex;
|
|
641
|
-
align-items: center;
|
|
642
|
-
justify-content: space-between;
|
|
643
|
-
padding: 8px 10px;
|
|
644
|
-
background: var(--bg-elevated);
|
|
645
|
-
border: 1px solid var(--border-subtle);
|
|
646
|
-
border-radius: 6px;
|
|
647
|
-
cursor: pointer;
|
|
648
|
-
min-height: 44px;
|
|
649
|
-
transition: border-color 0.15s;
|
|
650
|
-
}
|
|
651
|
-
.hub-item:hover {
|
|
652
|
-
border-color: var(--accent-amber);
|
|
653
|
-
}
|
|
654
|
-
.hub-title {
|
|
655
|
-
font-weight: 600;
|
|
656
|
-
color: var(--text-main);
|
|
657
|
-
}
|
|
658
|
-
.repo-pill {
|
|
659
|
-
background: rgba(255, 255, 255, 0.08);
|
|
660
|
-
padding: 2px 6px;
|
|
661
|
-
border-radius: 4px;
|
|
662
|
-
font-family: ui-monospace, monospace;
|
|
663
|
-
font-size: 11px;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
/* Reader */
|
|
667
|
-
.reader-header {
|
|
668
|
-
display: flex;
|
|
669
|
-
align-items: center;
|
|
670
|
-
justify-content: space-between;
|
|
671
|
-
margin-bottom: 12px;
|
|
672
|
-
padding-bottom: 8px;
|
|
673
|
-
border-bottom: 1px solid var(--border-subtle);
|
|
674
|
-
}
|
|
675
|
-
.back-btn {
|
|
676
|
-
background: var(--bg-elevated);
|
|
677
|
-
color: var(--accent-amber);
|
|
678
|
-
border: 1px solid var(--border-subtle);
|
|
679
|
-
border-radius: 6px;
|
|
680
|
-
padding: 4px 10px;
|
|
681
|
-
font-weight: 600;
|
|
682
|
-
cursor: pointer;
|
|
683
|
-
min-height: 44px;
|
|
684
|
-
}
|
|
685
|
-
.markdown-body {
|
|
686
|
-
font-family: Georgia, Cambria, serif;
|
|
687
|
-
line-height: 1.6;
|
|
688
|
-
color: #e5e7eb;
|
|
689
|
-
max-height: 380px;
|
|
690
|
-
overflow-y: auto;
|
|
691
|
-
white-space: pre-wrap;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
/* Search */
|
|
695
|
-
.search-box {
|
|
696
|
-
display: flex;
|
|
697
|
-
gap: 8px;
|
|
698
|
-
margin-bottom: 12px;
|
|
699
|
-
}
|
|
700
|
-
.search-input {
|
|
701
|
-
flex: 1;
|
|
702
|
-
background: var(--bg-elevated);
|
|
703
|
-
border: 1px solid var(--border-subtle);
|
|
704
|
-
border-radius: 6px;
|
|
705
|
-
padding: 8px 12px;
|
|
706
|
-
color: var(--text-main);
|
|
707
|
-
font-size: 13px;
|
|
708
|
-
min-height: 44px;
|
|
709
|
-
}
|
|
710
|
-
.action-btn {
|
|
711
|
-
background: var(--accent-amber);
|
|
712
|
-
color: #000;
|
|
713
|
-
font-weight: 700;
|
|
714
|
-
border: none;
|
|
715
|
-
border-radius: 6px;
|
|
716
|
-
padding: 8px 14px;
|
|
717
|
-
cursor: pointer;
|
|
718
|
-
min-height: 44px;
|
|
719
|
-
}
|
|
720
|
-
.action-btn:hover {
|
|
721
|
-
background: #d97706;
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
.result-item {
|
|
725
|
-
background: var(--bg-elevated);
|
|
726
|
-
border: 1px solid var(--border-subtle);
|
|
727
|
-
border-radius: 6px;
|
|
728
|
-
padding: 10px;
|
|
729
|
-
margin-bottom: 8px;
|
|
730
|
-
}
|
|
731
|
-
.result-heading {
|
|
732
|
-
font-weight: 600;
|
|
733
|
-
color: var(--accent-amber);
|
|
734
|
-
margin-bottom: 4px;
|
|
735
|
-
}
|
|
736
|
-
.result-snippet {
|
|
737
|
-
font-style: italic;
|
|
738
|
-
color: #d1d5db;
|
|
739
|
-
font-size: 12px;
|
|
740
|
-
line-height: 1.4;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
/* Graph SVG */
|
|
744
|
-
.graph-canvas-wrap {
|
|
745
|
-
width: 100%;
|
|
746
|
-
min-height: 280px;
|
|
747
|
-
background: #0b0f19;
|
|
748
|
-
border-radius: 6px;
|
|
749
|
-
border: 1px solid var(--border-subtle);
|
|
750
|
-
display: flex;
|
|
751
|
-
align-items: center;
|
|
752
|
-
justify-content: center;
|
|
753
|
-
overflow: auto;
|
|
754
|
-
padding: 10px;
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
/* Token Screen */
|
|
758
|
-
.token-row {
|
|
759
|
-
display: flex;
|
|
760
|
-
align-items: center;
|
|
761
|
-
justify-content: space-between;
|
|
762
|
-
background: var(--bg-elevated);
|
|
763
|
-
border: 1px solid var(--border-subtle);
|
|
764
|
-
border-radius: 6px;
|
|
765
|
-
padding: 10px 12px;
|
|
766
|
-
margin-bottom: 8px;
|
|
767
|
-
min-height: 44px;
|
|
768
|
-
}
|
|
769
|
-
.token-key {
|
|
770
|
-
font-family: ui-monospace, monospace;
|
|
771
|
-
font-weight: 600;
|
|
772
|
-
}
|
|
773
|
-
.token-badge {
|
|
774
|
-
font-size: 11px;
|
|
775
|
-
padding: 2px 8px;
|
|
776
|
-
border-radius: 4px;
|
|
777
|
-
font-weight: 600;
|
|
778
|
-
}
|
|
779
|
-
.token-badge.ok {
|
|
780
|
-
background: rgba(16, 185, 129, 0.2);
|
|
781
|
-
color: var(--accent-green);
|
|
782
|
-
border: 1px solid var(--accent-green);
|
|
783
|
-
}
|
|
784
|
-
.token-badge.missing {
|
|
785
|
-
background: rgba(239, 68, 68, 0.2);
|
|
786
|
-
color: var(--accent-red);
|
|
787
|
-
border: 1px solid var(--accent-red);
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
.auth-notice-card {
|
|
791
|
-
background: rgba(245, 158, 11, 0.08);
|
|
792
|
-
border: 1px solid rgba(245, 158, 11, 0.3);
|
|
793
|
-
border-radius: 6px;
|
|
794
|
-
padding: 10px 12px;
|
|
795
|
-
margin-bottom: 12px;
|
|
796
|
-
font-size: 12px;
|
|
797
|
-
color: #fde68a;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
.config-deck {
|
|
801
|
-
display: flex;
|
|
802
|
-
flex-direction: column;
|
|
803
|
-
gap: 12px;
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
.ingest-deck {
|
|
807
|
-
background: var(--bg-elevated);
|
|
808
|
-
border: 1px solid var(--border-subtle);
|
|
809
|
-
border-radius: 6px;
|
|
810
|
-
padding: 12px;
|
|
811
|
-
margin-top: 14px;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
.preset-chip {
|
|
815
|
-
display: inline-block;
|
|
816
|
-
background: var(--bg-elevated);
|
|
817
|
-
border: 1px solid var(--border-subtle);
|
|
818
|
-
padding: 4px 10px;
|
|
819
|
-
border-radius: 4px;
|
|
820
|
-
font-size: 11px;
|
|
821
|
-
cursor: pointer;
|
|
822
|
-
margin-right: 6px;
|
|
823
|
-
margin-bottom: 6px;
|
|
824
|
-
}
|
|
825
|
-
.preset-chip:hover {
|
|
826
|
-
border-color: var(--accent-amber);
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
.error-banner {
|
|
830
|
-
background: rgba(239, 68, 68, 0.15);
|
|
831
|
-
border: 1px solid var(--accent-red);
|
|
832
|
-
color: #fca5a5;
|
|
833
|
-
padding: 8px 12px;
|
|
834
|
-
border-radius: 6px;
|
|
835
|
-
margin-bottom: 10px;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
@media (prefers-reduced-motion: reduce) {
|
|
839
|
-
* {
|
|
840
|
-
animation: none !important;
|
|
841
|
-
transition: none !important;
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
</style>
|
|
845
|
-
|
|
846
|
-
<div class="header-bar">
|
|
847
|
-
<div class="brand-cluster">
|
|
848
|
-
<svg class="crest-svg" viewBox="0 0 24 24">
|
|
849
|
-
<path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"/>
|
|
850
|
-
</svg>
|
|
851
|
-
<span class="brand-title">OpenWiki</span>
|
|
852
|
-
<span class="wordmark-badge">MESH KNOWLEDGE</span>
|
|
853
|
-
</div>
|
|
854
|
-
|
|
855
|
-
<div class="scope-control">
|
|
856
|
-
<span style="font-size: 11px; color: var(--text-muted);">Scope:</span>
|
|
857
|
-
<select class="scope-select" id="scope-select">
|
|
858
|
-
<option value="workspace" ${this.scope === 'workspace' ? 'selected' : ''}>Current Workspace</option>
|
|
859
|
-
<option value="all-vaults" ${this.scope === 'all-vaults' ? 'selected' : ''}>All Vaults (Fleet)</option>
|
|
860
|
-
</select>
|
|
861
|
-
</div>
|
|
862
|
-
</div>
|
|
863
|
-
|
|
864
|
-
<nav class="screen-nav">
|
|
865
|
-
${OpenWikiCard.screens
|
|
866
|
-
.map(
|
|
867
|
-
(s) => `
|
|
868
|
-
<button class="nav-btn ${this.activeScreen === s.id ? 'active' : ''}" data-screen="${s.id}">
|
|
869
|
-
${s.label}
|
|
870
|
-
</button>
|
|
871
|
-
`
|
|
872
|
-
)
|
|
873
|
-
.join('')}
|
|
874
|
-
</nav>
|
|
875
|
-
|
|
876
|
-
${this.errorMessage ? `<div class="error-banner">${this.escape(this.errorMessage)}</div>` : ''}
|
|
877
|
-
|
|
878
|
-
<div class="metric-deck">
|
|
879
|
-
<div class="metric-cell">
|
|
880
|
-
<div class="metric-label">Knowledge Hubs</div>
|
|
881
|
-
<div class="metric-val">${countText}</div>
|
|
882
|
-
</div>
|
|
883
|
-
<div class="metric-cell">
|
|
884
|
-
<div class="metric-label">Indexed Volume</div>
|
|
885
|
-
<div class="metric-val">${linesText}</div>
|
|
886
|
-
</div>
|
|
887
|
-
<div class="metric-cell">
|
|
888
|
-
<div class="metric-label">Mesh Status</div>
|
|
889
|
-
<div class="metric-val" style="color: var(--accent-amber);">${this.statusText}</div>
|
|
890
|
-
</div>
|
|
891
|
-
</div>
|
|
892
|
-
|
|
893
|
-
<div class="content-view">
|
|
894
|
-
${this.renderActiveScreen()}
|
|
895
|
-
</div>
|
|
896
|
-
`;
|
|
897
|
-
|
|
898
|
-
this.attachEventListeners();
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
renderActiveScreen() {
|
|
902
|
-
if (this.selectedHub) {
|
|
903
|
-
return this.renderReaderScreen();
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
switch (this.activeScreen) {
|
|
907
|
-
case 'hubs':
|
|
908
|
-
return this.renderHubsScreen();
|
|
909
|
-
case 'search':
|
|
910
|
-
return this.renderSearchScreen();
|
|
911
|
-
case 'graph':
|
|
912
|
-
return this.renderGraphScreen();
|
|
913
|
-
case 'generate':
|
|
914
|
-
return this.renderGenerateScreen();
|
|
915
|
-
case 'refresh':
|
|
916
|
-
return this.renderRefreshScreen();
|
|
917
|
-
case 'token':
|
|
918
|
-
return this.renderTokenScreen();
|
|
919
|
-
case 'lint':
|
|
920
|
-
return this.renderLintScreen();
|
|
921
|
-
case 'upstream':
|
|
922
|
-
return this.renderUpstreamScreen();
|
|
923
|
-
case 'config':
|
|
924
|
-
return this.renderConfigScreen();
|
|
925
|
-
default:
|
|
926
|
-
return this.renderHubsScreen();
|
|
927
|
-
}
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
renderHubsScreen() {
|
|
931
|
-
if (!this.hubs || this.hubs.length === 0) {
|
|
932
|
-
return `
|
|
933
|
-
<div style="text-align: center; padding: 30px; color: var(--text-muted);">
|
|
934
|
-
<div>No documentation hubs discovered for scope: <strong>${this.escape(this.scope)}</strong>.</div>
|
|
935
|
-
<button class="action-btn" id="btn-refresh-hubs" style="margin-top: 12px;">Sync Hubs</button>
|
|
936
|
-
</div>
|
|
937
|
-
`;
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
return `
|
|
941
|
-
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
|
|
942
|
-
<span style="font-weight: 600; color: var(--text-muted);">Click a hub to read documentation:</span>
|
|
943
|
-
<button class="back-btn" id="btn-refresh-hubs">Refresh</button>
|
|
944
|
-
</div>
|
|
945
|
-
<div class="hub-list">
|
|
946
|
-
${this.hubs
|
|
947
|
-
.map(
|
|
948
|
-
(h, idx) => `
|
|
949
|
-
<div class="hub-item" data-hub-index="${idx}">
|
|
950
|
-
<div>
|
|
951
|
-
<span class="repo-pill">${this.escape(h.repoName || 'workspace')}</span>
|
|
952
|
-
<span class="hub-title" style="margin-left: 6px;">${this.escape(h.title)}</span>
|
|
953
|
-
</div>
|
|
954
|
-
<div class="hub-meta">
|
|
955
|
-
<span>${h.lines || 0} lines</span>
|
|
956
|
-
<span>${h.size_bytes ? Math.round(h.size_bytes / 1024) + ' KB' : ''}</span>
|
|
957
|
-
</div>
|
|
958
|
-
</div>
|
|
959
|
-
`
|
|
960
|
-
)
|
|
961
|
-
.join('')}
|
|
962
|
-
</div>
|
|
963
|
-
<div class="ingest-deck">
|
|
964
|
-
<div style="font-weight: 600; margin-bottom: 4px;">SSSS Vault Ingestion</div>
|
|
965
|
-
<div style="font-size: 11px; color: var(--text-muted); margin-bottom: 8px;">Embed current hub markdown into semantic memory categories.</div>
|
|
966
|
-
<button class="action-btn" id="btn-ingest-exec">Ingest into Vault</button>
|
|
967
|
-
</div>
|
|
968
|
-
`;
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
renderReaderScreen() {
|
|
972
|
-
const hub = this.selectedHub;
|
|
973
|
-
return `
|
|
974
|
-
<div class="reader-header">
|
|
975
|
-
<div>
|
|
976
|
-
<span class="repo-pill">${this.escape(hub.repoName || 'workspace')}</span>
|
|
977
|
-
<strong style="margin-left: 8px; color: var(--accent-amber);">${this.escape(hub.title)}</strong>
|
|
978
|
-
</div>
|
|
979
|
-
<button class="back-btn" id="btn-back-to-hubs">Back to Hubs</button>
|
|
980
|
-
</div>
|
|
981
|
-
<div class="markdown-body">${this.escape(this.selectedHubContent || 'Loading...')}</div>
|
|
982
|
-
`;
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
renderSearchScreen() {
|
|
986
|
-
return `
|
|
987
|
-
<div class="search-box">
|
|
988
|
-
<input class="search-input" id="search-input" placeholder="Search architecture, concepts, APIs across vaults..." value="${this.escape(this.searchQuery)}" />
|
|
989
|
-
<button class="action-btn" id="btn-search-exec">Search</button>
|
|
990
|
-
</div>
|
|
991
|
-
${
|
|
992
|
-
this.searchStats
|
|
993
|
-
? `<div style="font-size: 11px; color: var(--text-muted); margin-bottom: 8px;">
|
|
994
|
-
Found ${this.searchStats.count} passage(s) across ${this.searchStats.totalHubs} hubs (${this.searchStats.scope})
|
|
995
|
-
</div>`
|
|
996
|
-
: ''
|
|
997
|
-
}
|
|
998
|
-
<div class="search-results">
|
|
999
|
-
${
|
|
1000
|
-
this.searchResults.length === 0
|
|
1001
|
-
? `<div style="text-align: center; color: var(--text-muted); padding: 20px;">Enter search query to extract evidence passages.</div>`
|
|
1002
|
-
: this.searchResults
|
|
1003
|
-
.map(
|
|
1004
|
-
(r) => `
|
|
1005
|
-
<div class="result-item">
|
|
1006
|
-
<div class="result-heading">
|
|
1007
|
-
<span class="repo-pill">${this.escape(r.repoName)}</span>
|
|
1008
|
-
${this.escape(r.title)} > ${this.escape(r.section)} (Line ${r.line})
|
|
1009
|
-
</div>
|
|
1010
|
-
<div class="result-snippet">"${this.escape(r.snippet)}"</div>
|
|
1011
|
-
</div>
|
|
1012
|
-
`
|
|
1013
|
-
)
|
|
1014
|
-
.join('')
|
|
1015
|
-
}
|
|
1016
|
-
</div>
|
|
1017
|
-
`;
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
renderGraphScreen() {
|
|
1021
|
-
if (!this.graphData || !this.graphData.nodes) {
|
|
1022
|
-
return `
|
|
1023
|
-
<div style="text-align: center; padding: 30px; color: var(--text-muted);">
|
|
1024
|
-
<div>Knowledge topology graph not loaded.</div>
|
|
1025
|
-
<button class="action-btn" id="btn-load-graph" style="margin-top: 10px;">Extract Topology</button>
|
|
1026
|
-
</div>
|
|
1027
|
-
`;
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
const { nodes, edges, orphans } = this.graphData;
|
|
1031
|
-
|
|
1032
|
-
return `
|
|
1033
|
-
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;">
|
|
1034
|
-
<span style="font-weight: 600; color: var(--text-muted);">
|
|
1035
|
-
Topology: ${nodes.length} Nodes, ${edges.length} Edges, ${orphans.length} Orphans
|
|
1036
|
-
</span>
|
|
1037
|
-
<button class="back-btn" id="btn-load-graph">Refresh Graph</button>
|
|
1038
|
-
</div>
|
|
1039
|
-
<div class="graph-canvas-wrap">
|
|
1040
|
-
<svg width="100%" height="240" viewBox="0 0 600 240">
|
|
1041
|
-
<defs>
|
|
1042
|
-
<marker id="arrow" viewBox="0 0 10 10" refX="10" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
|
|
1043
|
-
<path d="M 0 0 L 10 5 L 0 10 z" fill="#f59e0b" />
|
|
1044
|
-
</marker>
|
|
1045
|
-
</defs>
|
|
1046
|
-
${edges
|
|
1047
|
-
.slice(0, 30)
|
|
1048
|
-
.map((e, idx) => {
|
|
1049
|
-
const x1 = 50 + (idx * 37) % 500;
|
|
1050
|
-
const y1 = 40 + (idx * 23) % 160;
|
|
1051
|
-
const x2 = 80 + (idx * 43) % 500;
|
|
1052
|
-
const y2 = 60 + (idx * 31) % 160;
|
|
1053
|
-
return `<line x1="${x1}" y1="${y1}" x2="${x2}" y2="${y2}" stroke="rgba(245, 158, 11, 0.4)" stroke-width="1.5" marker-end="url(#arrow)" />`;
|
|
1054
|
-
})
|
|
1055
|
-
.join('')}
|
|
1056
|
-
${nodes
|
|
1057
|
-
.slice(0, 20)
|
|
1058
|
-
.map((n, idx) => {
|
|
1059
|
-
const cx = 50 + (idx * 53) % 500;
|
|
1060
|
-
const cy = 40 + (idx * 33) % 160;
|
|
1061
|
-
return `
|
|
1062
|
-
<g>
|
|
1063
|
-
<circle cx="${cx}" cy="${cy}" r="12" fill="#1e293b" stroke="#f59e0b" stroke-width="2" />
|
|
1064
|
-
<text x="${cx}" y="${cy + 22}" fill="#94a3b8" font-size="9" text-anchor="middle">
|
|
1065
|
-
${this.escape(n.label.slice(0, 14))}
|
|
1066
|
-
</text>
|
|
1067
|
-
</g>
|
|
1068
|
-
`;
|
|
1069
|
-
})
|
|
1070
|
-
.join('')}
|
|
1071
|
-
</svg>
|
|
1072
|
-
</div>
|
|
1073
|
-
`;
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
|
-
renderGenerateScreen() {
|
|
1077
|
-
return `
|
|
1078
|
-
<div style="margin-bottom: 12px;">
|
|
1079
|
-
<label style="display: block; font-weight: 600; margin-bottom: 4px;">Target Repository (leave empty for current workspace):</label>
|
|
1080
|
-
<input class="search-input" id="generate-repo-input" placeholder="e.g. total-recall or my-app" value="${this.escape(this.generateRepo)}" />
|
|
1081
|
-
</div>
|
|
1082
|
-
<div style="display: flex; justify-content: flex-end; margin-bottom: 12px;">
|
|
1083
|
-
<button class="action-btn" id="btn-generate-exec" ${this.loading ? 'disabled' : ''}>
|
|
1084
|
-
${this.loading ? 'Generating...' : 'Generate Wiki Documentation'}
|
|
1085
|
-
</button>
|
|
1086
|
-
</div>
|
|
1087
|
-
<div style="background: var(--bg-base); border: 1px solid var(--border-subtle); border-radius: 6px; padding: 10px; font-family: ui-monospace, monospace; font-size: 11px; max-height: 180px; overflow-y: auto;">
|
|
1088
|
-
${
|
|
1089
|
-
this.generateLogs.length === 0
|
|
1090
|
-
? '<span style="color: var(--text-muted);">Ready to dispatch on-demand generation.</span>'
|
|
1091
|
-
: this.generateLogs.map((l) => `<div>${this.escape(l)}</div>`).join('')
|
|
1092
|
-
}
|
|
1093
|
-
</div>
|
|
1094
|
-
`;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
renderRefreshScreen() {
|
|
1098
|
-
return `
|
|
1099
|
-
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
|
|
1100
|
-
<span style="font-weight: 600; color: var(--text-muted);">Fleet Staleness Status:</span>
|
|
1101
|
-
<button class="action-btn" id="btn-fleet-refresh" ${this.loading ? 'disabled' : ''}>
|
|
1102
|
-
${this.loading ? 'Refreshing...' : 'Execute Fleet Refresh'}
|
|
1103
|
-
</button>
|
|
1104
|
-
</div>
|
|
1105
|
-
<div style="max-height: 220px; overflow-y: auto;">
|
|
1106
|
-
${
|
|
1107
|
-
this.refreshReports.length === 0
|
|
1108
|
-
? '<div style="color: var(--text-muted); text-align: center; padding: 20px;">No refresh reports loaded. Click Execute to evaluate fleet.</div>'
|
|
1109
|
-
: this.refreshReports
|
|
1110
|
-
.map(
|
|
1111
|
-
(r) => `
|
|
1112
|
-
<div style="display: flex; justify-content: space-between; padding: 6px 8px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 4px; margin-bottom: 4px; font-size: 11px;">
|
|
1113
|
-
<span><strong>${this.escape(r.name)}</strong>: ${this.escape(r.action)}</span>
|
|
1114
|
-
<span style="color: var(--text-muted);">${r.commitsSince ? r.commitsSince + ' commits' : 'current'}</span>
|
|
1115
|
-
</div>
|
|
1116
|
-
`
|
|
1117
|
-
)
|
|
1118
|
-
.join('')
|
|
1119
|
-
}
|
|
1120
|
-
</div>
|
|
1121
|
-
`;
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
renderTokenScreen() {
|
|
1125
|
-
const { openrouter, google } = this.tokenStatus;
|
|
1126
|
-
return `
|
|
1127
|
-
<div class="auth-notice-card">
|
|
1128
|
-
Total Recall Auth Secrets Store credentials for model-driven documentation. Secrets are stored encrypted in the global store.
|
|
1129
|
-
</div>
|
|
1130
|
-
<div class="token-row">
|
|
1131
|
-
<div>
|
|
1132
|
-
<span class="token-key">OPENROUTER_API_KEY</span>
|
|
1133
|
-
<div style="font-size: 11px; color: var(--text-muted);">Default provider for cheap model wiki routing</div>
|
|
1134
|
-
</div>
|
|
1135
|
-
<span class="token-badge ${openrouter?.configured ? 'ok' : 'missing'}">
|
|
1136
|
-
${openrouter?.configured ? 'Configured' : 'Missing'}
|
|
1137
|
-
</span>
|
|
1138
|
-
</div>
|
|
1139
|
-
<div class="token-row">
|
|
1140
|
-
<div>
|
|
1141
|
-
<span class="token-key">GOOGLE_API_KEY</span>
|
|
1142
|
-
<div style="font-size: 11px; color: var(--text-muted);">Google Gemini provider for native model generation</div>
|
|
1143
|
-
</div>
|
|
1144
|
-
<span class="token-badge ${google?.configured ? 'ok' : 'missing'}">
|
|
1145
|
-
${google?.configured ? 'Configured' : 'Missing'}
|
|
1146
|
-
</span>
|
|
1147
|
-
</div>
|
|
1148
|
-
<div style="margin-top: 14px; border-top: 1px solid var(--border-subtle); padding-top: 12px;">
|
|
1149
|
-
<label style="display: block; font-weight: 600; margin-bottom: 4px;">Save Key to Auth Vault:</label>
|
|
1150
|
-
<div style="display: flex; gap: 8px;">
|
|
1151
|
-
<select class="scope-select" id="token-provider-select">
|
|
1152
|
-
<option value="openrouter">OpenRouter</option>
|
|
1153
|
-
<option value="google">Google Gemini</option>
|
|
1154
|
-
</select>
|
|
1155
|
-
<input type="password" class="search-input" id="token-val-input" placeholder="Paste API Key (saved securely to auth secrets)..." />
|
|
1156
|
-
<button class="action-btn" id="btn-save-token">Save Key</button>
|
|
1157
|
-
</div>
|
|
1158
|
-
</div>
|
|
1159
|
-
`;
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
renderLintScreen() {
|
|
1163
|
-
if (!this.lintData) {
|
|
1164
|
-
return `
|
|
1165
|
-
<div style="text-align: center; padding: 30px; color: var(--text-muted);">
|
|
1166
|
-
<div>Link hygiene and documentation health not audited yet.</div>
|
|
1167
|
-
<button class="action-btn" id="btn-run-lint" style="margin-top: 10px;">Run Health Check</button>
|
|
1168
|
-
</div>
|
|
1169
|
-
`;
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
const { healthScore, totalHubs, totalLinks, brokenLinksCount, orphanCount, issues } = this.lintData;
|
|
1173
|
-
const scoreColor = healthScore > 80 ? 'var(--accent-green)' : (healthScore > 50 ? 'var(--accent-amber)' : 'var(--accent-red)');
|
|
1174
|
-
|
|
1175
|
-
return `
|
|
1176
|
-
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
|
|
1177
|
-
<div style="font-size: 20px; font-weight: 700; color: ${scoreColor};">
|
|
1178
|
-
${healthScore}% Health Score
|
|
1179
|
-
</div>
|
|
1180
|
-
<button class="back-btn" id="btn-run-lint">Re-scan</button>
|
|
1181
|
-
</div>
|
|
1182
|
-
<div class="metric-deck">
|
|
1183
|
-
<div class="metric-cell">
|
|
1184
|
-
<div class="metric-label">Links Tested</div>
|
|
1185
|
-
<div class="metric-val">${totalLinks}</div>
|
|
1186
|
-
</div>
|
|
1187
|
-
<div class="metric-cell">
|
|
1188
|
-
<div class="metric-label">Broken Links</div>
|
|
1189
|
-
<div class="metric-val" style="color: ${brokenLinksCount ? 'var(--accent-red)' : 'var(--accent-green)'};">${brokenLinksCount}</div>
|
|
1190
|
-
</div>
|
|
1191
|
-
<div class="metric-cell">
|
|
1192
|
-
<div class="metric-label">Orphan Hubs</div>
|
|
1193
|
-
<div class="metric-val">${orphanCount}</div>
|
|
1194
|
-
</div>
|
|
1195
|
-
</div>
|
|
1196
|
-
<div style="max-height: 180px; overflow-y: auto;">
|
|
1197
|
-
${
|
|
1198
|
-
issues.length === 0
|
|
1199
|
-
? '<div style="color: var(--accent-green); padding: 10px;">[OK] All documentation links and headings verified clean!</div>'
|
|
1200
|
-
: issues
|
|
1201
|
-
.map(
|
|
1202
|
-
(iss) => `
|
|
1203
|
-
<div style="padding: 6px 8px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 4px; margin-bottom: 4px; font-size: 11px;">
|
|
1204
|
-
<span style="color: var(--accent-red); font-weight: 600;">[${this.escape(iss.type)}]</span>
|
|
1205
|
-
${this.escape(iss.message)}
|
|
1206
|
-
</div>
|
|
1207
|
-
`
|
|
1208
|
-
)
|
|
1209
|
-
.join('')
|
|
1210
|
-
}
|
|
1211
|
-
</div>
|
|
1212
|
-
`;
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
renderUpstreamScreen() {
|
|
1216
|
-
return `
|
|
1217
|
-
<div style="margin-bottom: 12px;">
|
|
1218
|
-
<div style="font-weight: 600; margin-bottom: 4px;">Upstream OpenWiki Surveillance:</div>
|
|
1219
|
-
<div style="font-size: 12px; color: var(--text-muted);">
|
|
1220
|
-
Recorded: v${this.upstream?.recordedVersion || '0.7.2'} | Latest: v${this.upstream?.latestVersion || '0.7.3'}
|
|
1221
|
-
</div>
|
|
1222
|
-
</div>
|
|
1223
|
-
<button class="action-btn" id="btn-watch-exec" style="margin-top: 8px;">Check Upstream Releases</button>
|
|
1224
|
-
`;
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
renderConfigScreen() {
|
|
1228
|
-
return `
|
|
1229
|
-
<div class="config-deck">
|
|
1230
|
-
<div>
|
|
1231
|
-
<label style="display: block; font-weight: 600; margin-bottom: 4px;">Recommended Model Presets:</label>
|
|
1232
|
-
<span class="preset-chip" data-model="deepseek/deepseek-chat">DeepSeek Chat</span>
|
|
1233
|
-
<span class="preset-chip" data-model="deepseek/deepseek-v4.1-flash">DeepSeek Flash</span>
|
|
1234
|
-
<span class="preset-chip" data-model="qwen/qwen-2.5-coder-32b-instruct">Qwen 2.5 Coder</span>
|
|
1235
|
-
</div>
|
|
1236
|
-
<div>
|
|
1237
|
-
<label style="display: block; font-weight: 600; margin-bottom: 4px;">Provider:</label>
|
|
1238
|
-
<select class="scope-select" id="cfg-provider" style="width: 100%;">
|
|
1239
|
-
<option value="openrouter" ${this.config.provider === 'openrouter' ? 'selected' : ''}>OpenRouter (Fleet Routing)</option>
|
|
1240
|
-
<option value="google" ${this.config.provider === 'google' ? 'selected' : ''}>Google Gemini</option>
|
|
1241
|
-
</select>
|
|
1242
|
-
</div>
|
|
1243
|
-
<div>
|
|
1244
|
-
<label style="display: block; font-weight: 600; margin-bottom: 4px;">Model ID:</label>
|
|
1245
|
-
<input class="search-input" id="cfg-model" value="${this.escape(this.config.model)}" style="width: 100%;" />
|
|
1246
|
-
</div>
|
|
1247
|
-
<div>
|
|
1248
|
-
<label style="display: block; font-weight: 600; margin-bottom: 4px;">Max Tokens:</label>
|
|
1249
|
-
<input type="number" class="search-input" id="cfg-tokens" value="${this.config.max_tokens}" style="width: 100%;" />
|
|
1250
|
-
</div>
|
|
1251
|
-
<div style="display: flex; justify-content: flex-end;">
|
|
1252
|
-
<button class="action-btn" id="btn-save-cfg">Save Settings</button>
|
|
1253
|
-
</div>
|
|
1254
|
-
</div>
|
|
1255
|
-
`;
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
attachEventListeners() {
|
|
1259
|
-
const root = this.shadowRoot;
|
|
1260
|
-
if (!root) return;
|
|
1261
|
-
|
|
1262
|
-
// Scope selection
|
|
1263
|
-
const scopeSelect = root.querySelector('#scope-select');
|
|
1264
|
-
if (scopeSelect) {
|
|
1265
|
-
scopeSelect.addEventListener('change', (e) => this.setScope(e.target.value));
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
// Navigation buttons
|
|
1269
|
-
root.querySelectorAll('.nav-btn').forEach((btn) => {
|
|
1270
|
-
btn.addEventListener('click', () => {
|
|
1271
|
-
const screen = btn.getAttribute('data-screen');
|
|
1272
|
-
if (screen) this.setScreen(screen);
|
|
1273
|
-
});
|
|
1274
|
-
});
|
|
1275
|
-
|
|
1276
|
-
// Hub item click -> Read Hub
|
|
1277
|
-
root.querySelectorAll('.hub-item').forEach((item) => {
|
|
1278
|
-
item.addEventListener('click', () => {
|
|
1279
|
-
const idx = parseInt(item.getAttribute('data-hub-index'), 10);
|
|
1280
|
-
if (!isNaN(idx) && this.hubs[idx]) {
|
|
1281
|
-
this.readHubDocument(this.hubs[idx]);
|
|
1282
|
-
}
|
|
1283
|
-
});
|
|
1284
|
-
});
|
|
1285
|
-
|
|
1286
|
-
// Back to hubs from reader
|
|
1287
|
-
const backBtn = root.querySelector('#btn-back-to-hubs');
|
|
1288
|
-
if (backBtn) {
|
|
1289
|
-
backBtn.addEventListener('click', () => {
|
|
1290
|
-
this.selectedHub = null;
|
|
1291
|
-
this.selectedHubContent = null;
|
|
1292
|
-
this.render();
|
|
1293
|
-
});
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
// Refresh hubs button
|
|
1297
|
-
const refreshHubsBtn = root.querySelector('#btn-refresh-hubs');
|
|
1298
|
-
if (refreshHubsBtn) {
|
|
1299
|
-
refreshHubsBtn.addEventListener('click', () => this.refreshHubs());
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
// Ingest button
|
|
1303
|
-
const ingestBtn = root.querySelector('#btn-ingest-exec');
|
|
1304
|
-
if (ingestBtn) {
|
|
1305
|
-
ingestBtn.addEventListener('click', () => this.executeIngest());
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
// Search button
|
|
1309
|
-
const searchBtn = root.querySelector('#btn-search-exec');
|
|
1310
|
-
const searchInput = root.querySelector('#search-input');
|
|
1311
|
-
if (searchBtn && searchInput) {
|
|
1312
|
-
searchBtn.addEventListener('click', () => this.executeSearch(searchInput.value));
|
|
1313
|
-
searchInput.addEventListener('keydown', (e) => {
|
|
1314
|
-
if (e.key === 'Enter') this.executeSearch(searchInput.value);
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
// Graph button
|
|
1319
|
-
const loadGraphBtn = root.querySelector('#btn-load-graph');
|
|
1320
|
-
if (loadGraphBtn) {
|
|
1321
|
-
loadGraphBtn.addEventListener('click', () => this.loadGraph());
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
// Lint button
|
|
1325
|
-
const runLintBtn = root.querySelector('#btn-run-lint');
|
|
1326
|
-
if (runLintBtn) {
|
|
1327
|
-
runLintBtn.addEventListener('click', () => this.loadLint());
|
|
1328
|
-
}
|
|
1329
|
-
|
|
1330
|
-
// Fleet refresh button
|
|
1331
|
-
const fleetRefreshBtn = root.querySelector('#btn-fleet-refresh');
|
|
1332
|
-
if (fleetRefreshBtn) {
|
|
1333
|
-
fleetRefreshBtn.addEventListener('click', () => this.executeFleetRefresh());
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
// Upstream watch button
|
|
1337
|
-
const watchBtn = root.querySelector('#btn-watch-exec');
|
|
1338
|
-
if (watchBtn) {
|
|
1339
|
-
watchBtn.addEventListener('click', () => this.executeWatch());
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
// Generate button
|
|
1343
|
-
const genBtn = root.querySelector('#btn-generate-exec');
|
|
1344
|
-
const genInput = root.querySelector('#generate-repo-input');
|
|
1345
|
-
if (genBtn) {
|
|
1346
|
-
genBtn.addEventListener('click', () => {
|
|
1347
|
-
if (genInput) this.generateRepo = genInput.value.trim();
|
|
1348
|
-
this.executeGenerate();
|
|
1349
|
-
});
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
|
-
// Save token button
|
|
1353
|
-
const saveTokenBtn = root.querySelector('#btn-save-token');
|
|
1354
|
-
const tokenProviderSelect = root.querySelector('#token-provider-select');
|
|
1355
|
-
const tokenValInput = root.querySelector('#token-val-input');
|
|
1356
|
-
if (saveTokenBtn && tokenProviderSelect && tokenValInput) {
|
|
1357
|
-
saveTokenBtn.addEventListener('click', () => {
|
|
1358
|
-
this.saveToken(tokenProviderSelect.value, tokenValInput.value);
|
|
1359
|
-
tokenValInput.value = '';
|
|
1360
|
-
});
|
|
1361
|
-
}
|
|
1362
|
-
|
|
1363
|
-
// Preset chips
|
|
1364
|
-
root.querySelectorAll('.preset-chip').forEach((chip) => {
|
|
1365
|
-
chip.addEventListener('click', async () => {
|
|
1366
|
-
const model = chip.getAttribute('data-model');
|
|
1367
|
-
if (model) {
|
|
1368
|
-
const modelInput = root.querySelector('#cfg-model');
|
|
1369
|
-
if (modelInput) modelInput.value = model;
|
|
1370
|
-
await this.setConfigValue('model', model);
|
|
1371
|
-
}
|
|
1372
|
-
});
|
|
1373
|
-
});
|
|
1374
|
-
|
|
1375
|
-
// Save config button
|
|
1376
|
-
const saveCfgBtn = root.querySelector('#btn-save-cfg');
|
|
1377
|
-
if (saveCfgBtn) {
|
|
1378
|
-
saveCfgBtn.addEventListener('click', async () => {
|
|
1379
|
-
const prov = root.querySelector('#cfg-provider')?.value;
|
|
1380
|
-
const mod = root.querySelector('#cfg-model')?.value;
|
|
1381
|
-
const tok = root.querySelector('#cfg-tokens')?.value;
|
|
1382
|
-
if (prov) await this.setConfigValue('provider', prov);
|
|
1383
|
-
if (mod) await this.setConfigValue('model', mod);
|
|
1384
|
-
if (tok) await this.setConfigValue('max_tokens', tok);
|
|
1385
|
-
});
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
escape(str) {
|
|
1390
|
-
if (!str) return '';
|
|
1391
|
-
return String(str)
|
|
1392
|
-
.replace(/&/g, '&')
|
|
1393
|
-
.replace(/</g, '<')
|
|
1394
|
-
.replace(/>/g, '>')
|
|
1395
|
-
.replace(/"/g, '"');
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
if (typeof customElements !== 'undefined' && !customElements.get('tr-openwiki-card')) {
|
|
1400
|
-
customElements.define('tr-openwiki-card', OpenWikiCard);
|
|
1401
|
-
}
|