total-recall-brain 3.44.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 +10 -6
- package/docs/ARCHITECTURE.md +10 -7
- package/docs/reference/cli-reference.md +13 -8
- 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 +185 -238
- 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 +7 -7
- 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/src/cli-secret.mjs +20 -1
- package/scaffold/.agent/skills/total-recall/plugins/auth/src/secrets-store.mjs +12 -1
- 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/BRICK.md +7 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/DESIGN.md +53 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/LICENSE +21 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/README.md +66 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/adapters.mjs +247 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/capability/index.mjs +16 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/cli.mjs +130 -0
- package/{src/core/plugin-cron.mjs → scaffold/.agent/skills/total-recall/plugins/automations/cron.mjs} +1 -3
- package/scaffold/.agent/skills/total-recall/plugins/automations/inventory.mjs +88 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/package-lock.json +7661 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/package.json +36 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/plugin.json +151 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/scheduler.mjs +246 -0
- package/scaffold/.agent/skills/total-recall/plugins/automations/ui/automations.js +2 -0
- 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/home.js +278 -0
- 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 +5 -3
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/check.mjs +61 -7
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/report-data.mjs +40 -14
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/report.mjs +15 -40
- package/scaffold/.agent/skills/total-recall/plugins/code-quality/package-lock.json +7 -7
- 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 +7 -7
- 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 +7 -7
- 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 +136 -0
- package/scaffold/.agent/skills/total-recall/plugins/{git-sentinel → git}/cli.mjs +140 -24
- package/scaffold/.agent/skills/total-recall/plugins/{git-sentinel → git}/package-lock.json +9 -9
- package/scaffold/.agent/skills/total-recall/plugins/{git-sentinel → git}/package.json +4 -2
- package/scaffold/.agent/skills/total-recall/plugins/git/plugin.json +151 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/lib/context.mjs +94 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/lib/phase3-spec-support.mjs +50 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/lib/runtime.mjs +40 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/lib/spec-support.mjs +51 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/_support.mjs +195 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/auth.mjs +201 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/bisect.mjs +40 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/cli-meta.mjs +159 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/commit-memory.mjs +54 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/commit.mjs +46 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/fleet.mjs +174 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/force-push.mjs +58 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/group.mjs +119 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/handoff.mjs +59 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/message.mjs +22 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/resolve.mjs +60 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/rules.mjs +81 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/secret-firewall.mjs +92 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/undo.mjs +156 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/unmerged.mjs +182 -0
- package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/why.mjs +16 -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 +7 -7
- 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 +44 -9
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/capability/BRICK.md +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/capability/index.mjs +18 -6
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/cli.mjs +128 -24
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/package-lock.json +7 -7
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/package.json +3 -2
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/plugin.json +188 -34
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/skills/meta-harness/SKILL.md +17 -3
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/adoption.mjs +2 -2
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/alerts.mjs +3 -3
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/cascade.mjs +92 -18
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/chat.mjs +80 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/control.mjs +145 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/coordinator.mjs +42 -21
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/dispatch-request.mjs +4 -2
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/dispatch.mjs +33 -9
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/documentation.mjs +55 -11
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/executor.mjs +26 -4
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/gate-adapters/hermes.mjs +29 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/gate-adapters/index.mjs +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/included-usage.mjs +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/jobs.mjs +84 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/learner.mjs +3 -12
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/maintenance.mjs +17 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/mcp-server.mjs +228 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/process-manager.mjs +25 -2
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/reasoning.mjs +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/remote-operation.mjs +5 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/review.mjs +34 -3
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/reviews.mjs +25 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/router.mjs +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session/claude.mjs +319 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session/codex.mjs +387 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session/result.mjs +67 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session/resume.mjs +373 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session/run.mjs +223 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session-jobs.mjs +72 -0
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/setup.mjs +6 -3
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/termination.mjs +16 -12
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/threads.mjs +32 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/usage-queue.mjs +1 -1
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/verify-ssss.mjs +3 -3
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/worker.mjs +285 -40
- package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/worktree.mjs +76 -9
- 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 +64 -32
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/package-lock.json +7 -7
- 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-diagnostics.mjs +44 -0
- package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/refresh.mjs +123 -113
- 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 +7 -7
- 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 +3 -1
- package/src/cli/agent.mjs +1 -1
- package/src/cli/api.mjs +3 -3
- package/src/cli/brief.mjs +3 -0
- package/src/cli/command.mjs +41 -2
- package/src/cli/config.mjs +16 -0
- package/src/cli/connect.mjs +2 -7
- package/src/cli/dream.mjs +93 -69
- package/src/cli/harness.mjs +4 -4
- package/src/cli/help.mjs +1 -1
- package/src/cli/init.mjs +0 -25
- package/src/cli/lessons.mjs +51 -0
- package/src/cli/memory-plugin.mjs +1 -1
- package/src/cli/plugin/chunks.mjs +145 -0
- package/src/cli/plugin/copies.mjs +64 -14
- package/src/cli/plugin/create.mjs +30 -59
- package/src/cli/plugin/index.mjs +31 -16
- package/src/cli/plugin/install.mjs +10 -15
- package/src/cli/plugin/remove.mjs +1 -1
- package/src/cli/plugin/search.mjs +2 -2
- package/src/cli/preflight.mjs +19 -6
- package/src/cli/proposals.mjs +1 -1
- package/src/cli/recall.mjs +66 -23
- package/src/cli/remember.mjs +3 -14
- package/src/cli/server.mjs +18 -0
- package/src/cli/setup.mjs +2 -9
- package/src/cli/start.mjs +1 -0
- package/src/cli/startup.mjs +19 -0
- package/src/cli/task.mjs +9 -2
- package/src/cli/update.mjs +6 -2
- package/src/core/access-ledger.mjs +78 -0
- package/src/core/agent-manager.mjs +2 -2
- package/src/core/app-deploy/design-tokens.mjs +14 -9
- package/src/core/app-deploy/ui-elements.mjs +1 -1
- package/src/core/brain-locate.mjs +15 -0
- package/src/core/brain-registry.mjs +5 -0
- package/src/core/brain-updates.mjs +35 -11
- package/src/core/claude-hooks.mjs +3 -1
- package/src/core/cleanup-task.mjs +15 -0
- package/src/core/cli-commands.mjs +2 -0
- package/src/core/cli-maintenance.mjs +4 -1
- package/src/core/cli-semantic-index.mjs +23 -3
- package/src/core/context-compiler.mjs +20 -0
- package/src/core/daemon-control.mjs +5 -1
- package/src/core/daemon-loop.mjs +39 -62
- package/src/core/dashboard-bundle.mjs +261 -0
- package/src/core/default-plugins.mjs +1 -1
- package/src/core/dream.mjs +33 -105
- package/src/core/ensure-dependencies.mjs +152 -0
- package/src/core/fast-recall.mjs +2 -2
- package/src/core/field-evaluation.mjs +23 -0
- package/src/core/gate-mode.mjs +1 -1
- package/src/core/harness-hooks.mjs +14 -2
- package/src/core/lesson-hooks.mjs +74 -0
- package/src/core/lesson-memory.mjs +24 -0
- package/src/core/lesson-sessions.mjs +52 -0
- package/src/core/lessons.mjs +96 -0
- package/src/core/memory-brain.mjs +30 -8
- package/src/core/meta-harness.mjs +2 -2
- package/src/core/optimizer.mjs +66 -165
- package/src/core/plugin-activation.mjs +63 -20
- package/src/core/plugin-contracts/{card.mjs → manifest.mjs} +26 -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 +21 -8
- package/src/core/plugin-runner.mjs +21 -10
- package/src/core/plugin-runtime.mjs +40 -1
- package/src/core/plugin-startup-checks.mjs +44 -0
- package/src/core/plugin-state.mjs +19 -5
- package/src/core/plugin-store.mjs +64 -33
- package/src/core/post-mortem.mjs +52 -36
- package/src/core/preflight-gate.mjs +23 -2
- package/src/core/project-id.mjs +15 -5
- package/src/core/proposal-applier.mjs +31 -2
- package/src/core/repo-sync.mjs +4 -6
- package/src/core/required-plugins.mjs +57 -10
- package/src/core/rule-length.mjs +23 -0
- package/src/core/runtime.mjs +1 -1
- package/src/core/scheduler.mjs +35 -43
- package/src/core/schema.mjs +3 -2
- package/src/core/search.mjs +4 -3
- package/src/core/server-service.mjs +148 -0
- package/src/core/session-watcher.mjs +19 -1
- package/src/core/skill-gap.mjs +16 -0
- package/src/core/ssss-kernel-bridge.mjs +32 -4
- package/src/core/ssss-operation-service.mjs +1 -0
- package/src/core/startup-health.mjs +34 -4
- package/src/core/surface.mjs +65 -54
- package/src/core/task-executors.mjs +54 -106
- 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/validated-write.mjs +1 -0
- package/src/core/vault-cache.mjs +58 -59
- package/src/core/vector-field.mjs +134 -192
- 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/invoke-core-child.mjs +24 -0
- package/src/server/invoke-core-operations.mjs +102 -0
- 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 +47 -55
- package/src/server/routes/_shared.mjs +7 -14
- package/src/server/routes/brains.mjs +29 -62
- package/src/server/routes/context.mjs +0 -41
- package/src/server/routes/dashboard.mjs +26 -0
- package/src/server/routes/invoke.mjs +26 -1
- package/src/server/routes/plugins.mjs +154 -45
- package/src/server/routes/ssss.mjs +0 -169
- package/src/server/routes/system.mjs +0 -15
- package/src/server/routes/tasks.mjs +0 -26
- package/src/server/routes/ui-chunks.mjs +192 -0
- package/src/server/routes/vault.mjs +2 -23
- package/frontend/dist/assets/index-DD4qONvH.js +0 -5607
- 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-sentinel/README.md +0 -53
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/plugin.json +0 -129
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/ui/DESIGN.md +0 -100
- package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/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
- package/src/core/append-log.mjs +0 -131
- package/src/core/plugin-tasks.mjs +0 -173
- package/templates/onboarding-interview.md +0 -82
- /package/scaffold/.agent/skills/total-recall/plugins/{git-sentinel → git}/LICENSE +0 -0
|
@@ -7,7 +7,7 @@ import fs from "node:fs";
|
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { runBootstrapCommand } from './src/bootstrap.mjs';
|
|
9
9
|
import { describeRetention, hasWiki, isDue, readProjects, refreshProject, refreshProjectAsync, resolveKey, staleness } from './src/refresh.mjs';
|
|
10
|
-
import { watchUpstream, propagateUpdates, readUpstreamState } from './src/upstream-watcher.mjs';
|
|
10
|
+
import { watchUpstream, propagateUpdates, readUpstreamState, bundledGeneratorVersion } from './src/upstream-watcher.mjs';
|
|
11
11
|
import { loadOpenWikiConfig, setOpenWikiConfigValue, resetOpenWikiConfig, resolveConfigPath, ALLOWED_CONFIG_KEYS, ALLOWED_PROVIDERS } from './src/config.mjs';
|
|
12
12
|
import { discoverAllHubs } from './src/mesh-vaults.mjs';
|
|
13
13
|
import { searchWikiHubs } from './src/search.mjs';
|
|
@@ -16,6 +16,7 @@ import { getTokenStatus, setTokenValue } from './src/token.mjs';
|
|
|
16
16
|
import { lintWikiHubs } from './src/lint.mjs';
|
|
17
17
|
import { generateWiki } from './src/generate.mjs';
|
|
18
18
|
import { retrieveContext } from './src/context-provider.mjs';
|
|
19
|
+
import { refreshDiagnostics } from './src/refresh-diagnostics.mjs';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Regenerate the generated pages of every registered project that carries them.
|
|
@@ -25,7 +26,14 @@ import { retrieveContext } from './src/context-provider.mjs';
|
|
|
25
26
|
* Defaults to a report; --apply performs the refreshes, because regenerating a
|
|
26
27
|
* repository's documentation is a write to that repository.
|
|
27
28
|
*/
|
|
28
|
-
async function refreshCommand(args
|
|
29
|
+
export async function refreshCommand(args, {
|
|
30
|
+
read = readProjects, dueFor = isDue, refresh = refreshProjectAsync,
|
|
31
|
+
getKey = resolveKey, configFor = loadOpenWikiConfig,
|
|
32
|
+
} = {}) {
|
|
33
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
34
|
+
console.log('Usage: total-recall openwiki refresh [--repo <name>] [--apply] [--force] [--diagnostics [--slot <local-minute>]] [--json]');
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
29
37
|
const json = args.includes('--json');
|
|
30
38
|
const apply = args.includes('--apply');
|
|
31
39
|
const force = args.includes('--force');
|
|
@@ -37,7 +45,7 @@ async function refreshCommand(args) {
|
|
|
37
45
|
|
|
38
46
|
let projects;
|
|
39
47
|
try {
|
|
40
|
-
projects =
|
|
48
|
+
projects = read();
|
|
41
49
|
} catch (err) {
|
|
42
50
|
if (json) console.log(JSON.stringify({ ok: false, error: err.message }));
|
|
43
51
|
else console.error(`OpenWiki refresh: ${err.message}`);
|
|
@@ -52,20 +60,28 @@ async function refreshCommand(args) {
|
|
|
52
60
|
return;
|
|
53
61
|
}
|
|
54
62
|
|
|
63
|
+
if (args.includes('--diagnostics')) {
|
|
64
|
+
const slotIndex = args.indexOf('--slot');
|
|
65
|
+
const result = await refreshDiagnostics({ projects, slot: slotIndex >= 0 ? args[slotIndex + 1] : null });
|
|
66
|
+
console.log(JSON.stringify(result, null, 2));
|
|
67
|
+
if (!result.ok) process.exitCode = 1;
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
55
71
|
const reports = [];
|
|
56
72
|
for (const project of projects) {
|
|
57
73
|
let state;
|
|
58
74
|
try {
|
|
59
|
-
state =
|
|
75
|
+
state = dueFor(project, { force });
|
|
60
76
|
} catch (err) {
|
|
61
|
-
reports.push({ ...project, action: '
|
|
77
|
+
reports.push({ ...project, action: 'failed', reason: err.message });
|
|
62
78
|
continue;
|
|
63
79
|
}
|
|
64
80
|
if (!state.due) {
|
|
65
81
|
if (state.skipped) {
|
|
66
82
|
reports.push({ ...project, action: 'skipped', reason: state.reason });
|
|
67
83
|
} else {
|
|
68
|
-
reports.push({ ...project, action: 'current', generatedAt: state.generatedAt, commitsSince: state.commitsSince });
|
|
84
|
+
reports.push({ ...project, action: 'current', reason: state.reason, generationCommit: state.generationCommit, generationTime: state.generationTime, generatedAt: state.generatedAt, commitsSince: state.commitsSince });
|
|
69
85
|
}
|
|
70
86
|
continue;
|
|
71
87
|
}
|
|
@@ -73,7 +89,10 @@ async function refreshCommand(args) {
|
|
|
73
89
|
...project,
|
|
74
90
|
action: 'due',
|
|
75
91
|
uninitialized: Boolean(state.uninitialized),
|
|
92
|
+
mode: state.mode,
|
|
76
93
|
generatedAt: state.generatedAt,
|
|
94
|
+
generationCommit: state.generationCommit,
|
|
95
|
+
generationTime: state.generationTime,
|
|
77
96
|
commitsSince: state.commitsSince,
|
|
78
97
|
reason: state.reason
|
|
79
98
|
});
|
|
@@ -82,8 +101,8 @@ async function refreshCommand(args) {
|
|
|
82
101
|
const due = reports.filter((r) => r.action === 'due');
|
|
83
102
|
let payloadBudgetNote = null;
|
|
84
103
|
if (apply && due.length) {
|
|
85
|
-
const config =
|
|
86
|
-
const { key, from } =
|
|
104
|
+
const config = configFor();
|
|
105
|
+
const { key, from } = getKey({ provider: config.provider });
|
|
87
106
|
if (!key) {
|
|
88
107
|
const keyName = config.provider === 'google' ? 'GOOGLE_API_KEY' : 'OPENROUTER_API_KEY';
|
|
89
108
|
const error = `No model credential for provider '${config.provider}'. Save via: total-recall auth secret set ${keyName} --stdin`;
|
|
@@ -109,20 +128,25 @@ async function refreshCommand(args) {
|
|
|
109
128
|
while (queueIndex < due.length) {
|
|
110
129
|
const itemIndex = queueIndex++;
|
|
111
130
|
const entry = due[itemIndex];
|
|
112
|
-
const mode = entry.uninitialized ? 'init' : 'update';
|
|
131
|
+
const mode = entry.mode || (entry.uninitialized ? 'init' : 'update');
|
|
113
132
|
if (!json) {
|
|
114
133
|
console.log(`[${itemIndex + 1}/${due.length}] ▶ ${entry.name.padEnd(28)} starting ${mode}...`);
|
|
115
134
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
135
|
+
let result;
|
|
136
|
+
try {
|
|
137
|
+
result = await refresh(
|
|
138
|
+
{ name: entry.name, root: entry.root },
|
|
139
|
+
{ key, model: config.model, provider: config.provider, timeoutMs: config.timeout_ms }
|
|
140
|
+
);
|
|
141
|
+
} catch (error) {
|
|
142
|
+
result = { action: 'failed', reason: error.message.split(key).join('[REDACTED]') };
|
|
143
|
+
}
|
|
120
144
|
completedCount++;
|
|
121
145
|
const index = reports.findIndex((r) => r.root === entry.root);
|
|
122
146
|
reports[index] = { ...reports[index], ...result, credential: from };
|
|
123
147
|
if (!json) {
|
|
124
|
-
const duration = Math.round((
|
|
125
|
-
const icon = result.action
|
|
148
|
+
const duration = Math.round((result.durationMs || 0) / 1000);
|
|
149
|
+
const icon = ['failed', 'partial'].includes(result.action) ? '✖' : '✔';
|
|
126
150
|
console.log(`[${completedCount}/${due.length}] ${icon} ${entry.name.padEnd(28)} ${result.action} (${duration}s)${result.reason ? ` — ${result.reason}` : ''}`);
|
|
127
151
|
}
|
|
128
152
|
}
|
|
@@ -133,8 +157,9 @@ async function refreshCommand(args) {
|
|
|
133
157
|
}
|
|
134
158
|
|
|
135
159
|
const failed = reports.filter((r) => r.action === 'failed');
|
|
160
|
+
const partial = reports.filter((r) => r.action === 'partial');
|
|
136
161
|
const payload = {
|
|
137
|
-
ok: failed.length === 0,
|
|
162
|
+
ok: failed.length === 0 && partial.length === 0,
|
|
138
163
|
applied: apply,
|
|
139
164
|
retention: describeRetention(),
|
|
140
165
|
note: payloadBudgetNote,
|
|
@@ -145,6 +170,8 @@ async function refreshCommand(args) {
|
|
|
145
170
|
uninitialized: reports.filter((r) => r.uninitialized).length,
|
|
146
171
|
refreshed: reports.filter((r) => r.action === 'refreshed' || r.action === 'initialized').length,
|
|
147
172
|
failed: failed.length,
|
|
173
|
+
partial: partial.length,
|
|
174
|
+
skipped: reports.filter((r) => r.action === 'skipped').length,
|
|
148
175
|
current: reports.filter((r) => r.action === 'current').length,
|
|
149
176
|
},
|
|
150
177
|
reports,
|
|
@@ -152,15 +179,17 @@ async function refreshCommand(args) {
|
|
|
152
179
|
if (json) console.log(JSON.stringify(payload, null, 2));
|
|
153
180
|
else {
|
|
154
181
|
console.log(`OpenWiki refresh (${apply ? 'apply' : 'report'}): ${payload.counts.registered} registered, ${payload.counts.due} due (${payload.counts.uninitialized} uninitialized)`);
|
|
155
|
-
|
|
182
|
+
// Put failures last so bounded scheduler tails retain their causes.
|
|
183
|
+
for (const r of [...reports].sort((a, b) => Number(['failed', 'partial'].includes(a.action)) - Number(['failed', 'partial'].includes(b.action)))) {
|
|
156
184
|
if (r.action === 'current') continue;
|
|
157
|
-
const age = r.uninitialized ? 'uninitialized' : (r.generatedAt ? `
|
|
185
|
+
const age = r.action === 'skipped' ? 'outside repository generation' : r.generationTime ? `generated ${r.generationTime} at ${r.generationCommit}` : r.uninitialized ? 'uninitialized' : (r.generatedAt ? `last attempt ${r.generatedAt}; generation commit unknown` : 'never generated');
|
|
158
186
|
console.log(` ${r.action.padEnd(9)} ${r.name.padEnd(28)} ${age}${Number.isFinite(r.commitsSince) && r.commitsSince !== Infinity ? `, ${r.commitsSince} commits since` : ''}${r.reason ? ` — ${r.reason}` : ''}`);
|
|
159
187
|
}
|
|
160
188
|
if (payloadBudgetNote) console.log(payloadBudgetNote);
|
|
161
189
|
if (!apply && due.length) console.log('Re-run with --apply to regenerate. Pages are a projection; vault content is never touched.');
|
|
162
190
|
}
|
|
163
|
-
if (
|
|
191
|
+
if (!payload.ok) process.exitCode = 1;
|
|
192
|
+
return payload;
|
|
164
193
|
}
|
|
165
194
|
|
|
166
195
|
async function probeCommand(args) {
|
|
@@ -316,22 +345,17 @@ async function tokenCommand(args) {
|
|
|
316
345
|
const icon = t.configured ? '✔' : '✖';
|
|
317
346
|
console.log(` ${icon} ${provider.padEnd(12)} : ${t.key} (${t.status})`);
|
|
318
347
|
}
|
|
319
|
-
console.log('\nTo set a token: total-recall openwiki token set <openrouter|google>
|
|
320
|
-
console.log('Or via stdin: echo "$KEY" | total-recall openwiki token set <provider> --stdin\n');
|
|
348
|
+
console.log('\nTo set a token: total-recall openwiki token set <openrouter|google> --stdin\n');
|
|
321
349
|
}
|
|
322
350
|
return;
|
|
323
351
|
}
|
|
324
352
|
|
|
325
353
|
if (verb === 'set') {
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
if (args.includes('--stdin')) {
|
|
330
|
-
value = fs.readFileSync(0, 'utf8').trim();
|
|
331
|
-
}
|
|
332
|
-
if (!provider || !value) {
|
|
333
|
-
throw new Error('Provider and secret value required: openwiki token set <provider> <value> (or --stdin)');
|
|
354
|
+
const [, provider, ...extra] = args.filter(arg => arg !== '--json' && arg !== '--stdin');
|
|
355
|
+
if (!args.includes('--stdin') || !provider || extra.length) {
|
|
356
|
+
throw new Error('Use openwiki token set <provider> --stdin with the credential on standard input');
|
|
334
357
|
}
|
|
358
|
+
const value = fs.readFileSync(0, 'utf8');
|
|
335
359
|
const res = setTokenValue(provider, value);
|
|
336
360
|
if (json) console.log(JSON.stringify(res, null, 2));
|
|
337
361
|
else console.log(`✔ ${res.message}`);
|
|
@@ -428,8 +452,14 @@ async function generateCommand(args) {
|
|
|
428
452
|
import { runOpenWikiIngest } from "./src/ingest.mjs";
|
|
429
453
|
|
|
430
454
|
async function ingestCommand(args) {
|
|
431
|
-
const
|
|
432
|
-
|
|
455
|
+
const json = args.includes('--json');
|
|
456
|
+
try {
|
|
457
|
+
const result = await runOpenWikiIngest(args);
|
|
458
|
+
if (json && !args.some(arg => arg === '--help' || arg === '-h')) console.log(JSON.stringify(result));
|
|
459
|
+
if (!result.ok) process.exitCode = 1;
|
|
460
|
+
} catch (error) {
|
|
461
|
+
if (json) console.log(JSON.stringify({ ok: false, error: error.message }));
|
|
462
|
+
else console.error(`OpenWiki ingest error: ${error.message}`);
|
|
433
463
|
process.exitCode = 1;
|
|
434
464
|
}
|
|
435
465
|
}
|
|
@@ -646,6 +676,7 @@ export async function run(argv = process.argv) {
|
|
|
646
676
|
const status = {
|
|
647
677
|
plugin: "openwiki",
|
|
648
678
|
implemented: Object.keys(IMPLEMENTED),
|
|
679
|
+
generatorVersion: bundledGeneratorVersion(),
|
|
649
680
|
upstream: {
|
|
650
681
|
recordedVersion: upstream.currentRecordedVersion,
|
|
651
682
|
latestVersion: upstream.latestKnownVersion,
|
|
@@ -656,6 +687,7 @@ export async function run(argv = process.argv) {
|
|
|
656
687
|
if (json) console.log(JSON.stringify(status, null, 2));
|
|
657
688
|
else {
|
|
658
689
|
console.log(`OpenWiki: implemented subcommands: ${status.implemented.join(", ")}`);
|
|
690
|
+
console.log(`Bundled generator: ${status.generatorVersion || 'unavailable'}`);
|
|
659
691
|
console.log(`Upstream Status: recorded v${status.upstream.recordedVersion}, latest v${status.upstream.latestVersion}`);
|
|
660
692
|
}
|
|
661
693
|
return;
|
|
@@ -680,7 +712,7 @@ export async function run(argv = process.argv) {
|
|
|
680
712
|
Extract knowledge graph topology, nodes, and inter-hub links
|
|
681
713
|
generate [--repo <name>] [--force] [--dry-run] [--node <node>] [--json]
|
|
682
714
|
Targeted on-demand documentation generation
|
|
683
|
-
token [status|set <provider>
|
|
715
|
+
token [status|set <provider> --stdin] [--json]
|
|
684
716
|
Check or securely configure Total Recall secrets store keys
|
|
685
717
|
lint [--all-vaults] [--node <node>] [--json]
|
|
686
718
|
Validate link integrity, dead targets, and orphaned hubs
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tr-plugin-openwiki",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "tr-plugin-openwiki",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.2.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@gregiteen/ssss-cli": "0.14.5"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"total-recall-brain": "3.
|
|
15
|
+
"total-recall-brain": "3.45.0"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"node_modules/@alcalzone/ansi-tokenize": {
|
|
@@ -5529,9 +5529,9 @@
|
|
|
5529
5529
|
}
|
|
5530
5530
|
},
|
|
5531
5531
|
"node_modules/total-recall-brain": {
|
|
5532
|
-
"version": "3.
|
|
5533
|
-
"resolved": "https://registry.npmjs.org/total-recall-brain/-/total-recall-brain-3.
|
|
5534
|
-
"integrity": "sha512-
|
|
5532
|
+
"version": "3.45.0",
|
|
5533
|
+
"resolved": "https://registry.npmjs.org/total-recall-brain/-/total-recall-brain-3.45.0.tgz",
|
|
5534
|
+
"integrity": "sha512-HDYfROazZbsLHQsFPnlBcSpe1HL1QEi7JG8x/eNRUI06RxVQsZWl8LwBo2lTWjWRDrKmCy7BUmSXQDuWF3lrEw==",
|
|
5535
5535
|
"dev": true,
|
|
5536
5536
|
"license": "MIT",
|
|
5537
5537
|
"workspaces": [
|
|
@@ -5539,7 +5539,7 @@
|
|
|
5539
5539
|
],
|
|
5540
5540
|
"dependencies": {
|
|
5541
5541
|
"@simplewebauthn/server": "^13.3.2",
|
|
5542
|
-
"@ssss/cli": "npm:@gregiteen/ssss-cli@0.14.
|
|
5542
|
+
"@ssss/cli": "npm:@gregiteen/ssss-cli@0.14.5",
|
|
5543
5543
|
"bcrypt": "^6.0.0",
|
|
5544
5544
|
"better-sqlite3": "^12.11.1",
|
|
5545
5545
|
"cookie-parser": "^1.4.7",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tr-plugin-openwiki",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Multi-repo knowledge graph and documentation wiki engine for Total Recall",
|
|
6
6
|
"scripts": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"cli.mjs",
|
|
13
13
|
"plugin.json",
|
|
14
14
|
"README.md",
|
|
15
|
+
"DESIGN.md",
|
|
15
16
|
"LICENSE",
|
|
16
17
|
"ui/",
|
|
17
18
|
"src/",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://github.com/gregiteen/total-recall/blob/main/metadata.plugin.schema.json",
|
|
3
3
|
"id": "openwiki",
|
|
4
4
|
"name": "OpenWiki",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.2.0",
|
|
6
6
|
"description": "Multi-repo knowledge graph and documentation wiki engine for Total Recall.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"runtime": {
|
|
@@ -41,29 +41,6 @@
|
|
|
41
41
|
"required": false
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
|
-
"card_face": {
|
|
45
|
-
"headline": "OpenWiki Control Deck",
|
|
46
|
-
"quick_actions": [
|
|
47
|
-
{
|
|
48
|
-
"subcommand": "status",
|
|
49
|
-
"label": "STATUS"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"subcommand": "hubs",
|
|
53
|
-
"label": "HUBS"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"subcommand": "ingest",
|
|
57
|
-
"label": "INGEST"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"subcommand": "probe",
|
|
61
|
-
"label": "200 PROBE"
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
"touch_layout": "comfortable",
|
|
65
|
-
"interactive": true
|
|
66
|
-
},
|
|
67
44
|
"ssss_schemas": {
|
|
68
45
|
"categories": [
|
|
69
46
|
{
|
|
@@ -233,6 +210,12 @@
|
|
|
233
210
|
"flag": "--project",
|
|
234
211
|
"label": "Target project brain",
|
|
235
212
|
"type": "boolean"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "json",
|
|
216
|
+
"flag": "--json",
|
|
217
|
+
"label": "JSON output",
|
|
218
|
+
"type": "boolean"
|
|
236
219
|
}
|
|
237
220
|
]
|
|
238
221
|
},
|
|
@@ -443,32 +426,15 @@
|
|
|
443
426
|
]
|
|
444
427
|
},
|
|
445
428
|
"ui": {
|
|
446
|
-
"
|
|
429
|
+
"home": "panel",
|
|
430
|
+
"design_tokens": "DESIGN.md",
|
|
447
431
|
"elements": [
|
|
448
432
|
{
|
|
449
433
|
"id": "panel",
|
|
450
434
|
"kind": "panel",
|
|
451
435
|
"tag": "openwiki-panel",
|
|
452
436
|
"module": "ui/panel.js",
|
|
453
|
-
"description": "
|
|
454
|
-
"events": [
|
|
455
|
-
"save-token"
|
|
456
|
-
],
|
|
457
|
-
"tokens": [
|
|
458
|
-
"color-text",
|
|
459
|
-
"color-surface",
|
|
460
|
-
"color-border",
|
|
461
|
-
"spacing-md",
|
|
462
|
-
"radius-md"
|
|
463
|
-
],
|
|
464
|
-
"optional_tokens": []
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
"id": "card",
|
|
468
|
-
"kind": "card",
|
|
469
|
-
"tag": "tr-openwiki-card",
|
|
470
|
-
"module": "ui/card.js",
|
|
471
|
-
"description": "Knowledge Graph Card Face"
|
|
437
|
+
"description": "Workspace wiki atlas"
|
|
472
438
|
}
|
|
473
439
|
]
|
|
474
440
|
},
|
|
@@ -28,14 +28,15 @@ export async function generateWiki({
|
|
|
28
28
|
const isSelf = selfNode && (selfNode.ip === node || selfNode.hostname.toLowerCase() === node.toLowerCase());
|
|
29
29
|
|
|
30
30
|
if (!isSelf) {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const meshRes = execOnMeshNode(node, [
|
|
32
|
+
'generate', ...(repo ? [`--repo=${repo}`] : []), ...(force ? ['--force'] : []),
|
|
33
|
+
...(dryRun ? ['--dry-run'] : []), '--json',
|
|
34
|
+
]);
|
|
34
35
|
if (meshRes.ok) {
|
|
35
36
|
try {
|
|
36
37
|
return JSON.parse(meshRes.stdout);
|
|
37
38
|
} catch {
|
|
38
|
-
|
|
39
|
+
throw new Error('Mesh generation returned invalid JSON');
|
|
39
40
|
}
|
|
40
41
|
} else {
|
|
41
42
|
throw new Error(`Mesh generation failed on node ${node}: ${meshRes.stderr || meshRes.error}`);
|
|
@@ -19,10 +19,9 @@ export async function buildKnowledgeGraph({
|
|
|
19
19
|
} = {}) {
|
|
20
20
|
// If remote mesh node specified, dispatch via mesh
|
|
21
21
|
if (node && node !== 'local' && node !== 'self') {
|
|
22
|
-
const meshRes = execOnMeshNode(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
22
|
+
const meshRes = execOnMeshNode(node, [
|
|
23
|
+
'graph', ...(allVaults ? ['--all-vaults'] : []), '--format', format, '--json',
|
|
24
|
+
]);
|
|
26
25
|
if (meshRes.ok) {
|
|
27
26
|
try {
|
|
28
27
|
return JSON.parse(meshRes.stdout);
|
|
@@ -13,6 +13,7 @@ function printHelp() {
|
|
|
13
13
|
--dry-run Preview import without writing
|
|
14
14
|
--global Target the global brain
|
|
15
15
|
--project Target the project brain (default)
|
|
16
|
+
--json Return a structured import receipt
|
|
16
17
|
--help, -h Show this help
|
|
17
18
|
`);
|
|
18
19
|
}
|
|
@@ -22,6 +23,9 @@ export async function runOpenWikiIngest(args = []) {
|
|
|
22
23
|
let dryRun = false;
|
|
23
24
|
let layerFlag = '--project';
|
|
24
25
|
let help = false;
|
|
26
|
+
const json = args.includes('--json');
|
|
27
|
+
const log = message => { if (!json) console.log(message); };
|
|
28
|
+
const warn = message => { if (!json) console.error(message); };
|
|
25
29
|
|
|
26
30
|
for (let i = 0; i < args.length; i++) {
|
|
27
31
|
const arg = args[i];
|
|
@@ -37,20 +41,20 @@ export async function runOpenWikiIngest(args = []) {
|
|
|
37
41
|
}
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
if (help || !openwikiPath) {
|
|
44
|
+
if (help || (!json && !openwikiPath)) {
|
|
41
45
|
printHelp();
|
|
42
46
|
return { ok: true, imported: 0, errors: 0 };
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
if (openwikiPath
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return { ok: false, error
|
|
49
|
+
if (!openwikiPath || !fs.statSync(openwikiPath, { throwIfNoEntry: false })?.isDirectory()) {
|
|
50
|
+
const error = 'An existing OpenWiki directory is required';
|
|
51
|
+
warn(error);
|
|
52
|
+
return { ok: false, error };
|
|
49
53
|
}
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (dryRun)
|
|
55
|
+
log(`\n Importing OpenWiki from: ${openwikiPath}`);
|
|
56
|
+
log(` Target Brain: ${layerFlag.replace('--', '')}`);
|
|
57
|
+
if (dryRun) log(' DRY RUN: No actual writes will be committed.\n');
|
|
54
58
|
|
|
55
59
|
const mdFiles = [];
|
|
56
60
|
function scanDir(dir) {
|
|
@@ -69,6 +73,7 @@ export async function runOpenWikiIngest(args = []) {
|
|
|
69
73
|
scanDir(openwikiPath);
|
|
70
74
|
|
|
71
75
|
let imported = 0;
|
|
76
|
+
let planned = 0;
|
|
72
77
|
let errors = 0;
|
|
73
78
|
|
|
74
79
|
for (const file of mdFiles) {
|
|
@@ -85,8 +90,8 @@ export async function runOpenWikiIngest(args = []) {
|
|
|
85
90
|
const slug = 'openwiki-' + slugBase.toLowerCase();
|
|
86
91
|
|
|
87
92
|
if (dryRun) {
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
log(` [DRY RUN] Would import: ${slug} ("${title}")`);
|
|
94
|
+
planned++;
|
|
90
95
|
continue;
|
|
91
96
|
}
|
|
92
97
|
|
|
@@ -101,27 +106,27 @@ export async function runOpenWikiIngest(args = []) {
|
|
|
101
106
|
|
|
102
107
|
const result = spawnSync(TR_BIN, cliArgs, { encoding: 'utf8' });
|
|
103
108
|
if (result.status === 0) {
|
|
104
|
-
|
|
109
|
+
log(` Imported: ${slug}`);
|
|
105
110
|
imported++;
|
|
106
111
|
} else {
|
|
107
|
-
|
|
112
|
+
warn(` Error importing ${slug}: ${result.stderr}`);
|
|
108
113
|
errors++;
|
|
109
114
|
}
|
|
110
115
|
} catch (err) {
|
|
111
|
-
|
|
116
|
+
warn(` Exception on ${file}: ${err.message}`);
|
|
112
117
|
errors++;
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
log('\n Import Summary:');
|
|
122
|
+
log(dryRun ? ` Would import: ${planned} files` : ` Imported: ${imported} files`);
|
|
123
|
+
log(` Errors: ${errors} files`);
|
|
119
124
|
|
|
120
125
|
if (!dryRun && imported > 0) {
|
|
121
|
-
|
|
126
|
+
log('\n OpenWiki knowledge graph successfully indexed into Total Recall.');
|
|
122
127
|
}
|
|
123
128
|
|
|
124
|
-
return { ok: errors === 0, imported, errors };
|
|
129
|
+
return { ok: errors === 0, dryRun, imported, planned, errors };
|
|
125
130
|
}
|
|
126
131
|
|
|
127
132
|
export default runOpenWikiIngest;
|
|
@@ -102,7 +102,7 @@ export function getMeshNodes() {
|
|
|
102
102
|
* Execute a command on a remote mesh node via Total Recall mesh plugin.
|
|
103
103
|
* Guarded against self-execution (never ssh a machine into itself).
|
|
104
104
|
*/
|
|
105
|
-
export function execOnMeshNode(nodeTarget,
|
|
105
|
+
export function execOnMeshNode(nodeTarget, args, { timeoutMs = 25000 } = {}) {
|
|
106
106
|
if (!nodeTarget || typeof nodeTarget !== 'string') {
|
|
107
107
|
throw new Error('A valid mesh node identifier or IP is required');
|
|
108
108
|
}
|
|
@@ -117,7 +117,12 @@ export function execOnMeshNode(nodeTarget, commandStr, { timeoutMs = 25000 } = {
|
|
|
117
117
|
throw new Error(`Target node '${nodeTarget}' is the local host. Do not mesh exec into self.`);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
if (!Array.isArray(args) || args.some(arg => typeof arg !== 'string')) {
|
|
121
|
+
throw new Error('Mesh operation requires OpenWiki CLI arguments');
|
|
122
|
+
}
|
|
123
|
+
const quote = arg => "'" + arg.replaceAll("'", "'\\''") + "'";
|
|
124
|
+
const command = ['total-recall', 'openwiki', ...args].map(quote).join(' ');
|
|
125
|
+
const result = spawnSync('total-recall', ['mesh', 'exec', nodeTarget, command], {
|
|
121
126
|
encoding: 'utf8',
|
|
122
127
|
timeout: timeoutMs,
|
|
123
128
|
});
|
|
@@ -203,7 +208,7 @@ export async function discoverAllHubs({
|
|
|
203
208
|
const isSelf = selfNode && (selfNode.ip === node || selfNode.hostname.toLowerCase() === node.toLowerCase());
|
|
204
209
|
|
|
205
210
|
if (!isSelf) {
|
|
206
|
-
const meshRes = execOnMeshNode(node,
|
|
211
|
+
const meshRes = execOnMeshNode(node, ['hubs', ...(allVaults ? ['--all-vaults'] : []), '--json']);
|
|
207
212
|
if (meshRes.ok) {
|
|
208
213
|
try {
|
|
209
214
|
const parsed = JSON.parse(meshRes.stdout);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import { readProjects } from './refresh.mjs';
|
|
6
|
+
|
|
7
|
+
/** Read through Total Recall's event service. Never open vault files here. */
|
|
8
|
+
async function readTaskEvents(options) {
|
|
9
|
+
const service = process.env.TR_PACKAGE_ROOT
|
|
10
|
+
? pathToFileURL(path.join(process.env.TR_PACKAGE_ROOT, 'src', 'core', 'ssss-operation-service.mjs')).href
|
|
11
|
+
: 'total-recall-brain/src/core/ssss-operation-service.mjs';
|
|
12
|
+
const { listVfsEvents } = await import(service);
|
|
13
|
+
return listVfsEvents(options);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function refreshDiagnostics({
|
|
17
|
+
projects = readProjects(),
|
|
18
|
+
vaultRoot = path.join(os.homedir(), '.agent', 'skills', 'total-recall', 'memory-vault'),
|
|
19
|
+
listEvents = readTaskEvents,
|
|
20
|
+
slot = null,
|
|
21
|
+
} = {}) {
|
|
22
|
+
let taskEvents = [], eventError = null;
|
|
23
|
+
try {
|
|
24
|
+
taskEvents = (await listEvents({ vaultRoot })).flatMap(event => {
|
|
25
|
+
let payload = event.payload || event.content;
|
|
26
|
+
if (typeof payload === 'string') {
|
|
27
|
+
try { payload = JSON.parse(payload); } catch { return []; }
|
|
28
|
+
}
|
|
29
|
+
return payload?.kind === 'plugin.task_run' && payload.plugin_id === 'openwiki' && payload.command === 'auto-refresh'
|
|
30
|
+
? [{ at: event.timestamp || event.created_at || null, ...payload }] : [];
|
|
31
|
+
});
|
|
32
|
+
} catch (error) { eventError = error.message; }
|
|
33
|
+
taskEvents.sort((a, b) => String(a.at).localeCompare(String(b.at)));
|
|
34
|
+
taskEvents = slot ? taskEvents.filter(event => event.slot === slot) : taskEvents.slice(-1);
|
|
35
|
+
const reports = projects.map(project => {
|
|
36
|
+
const logPath = path.join(project.root, 'openwiki', '.refresh-attempt.json');
|
|
37
|
+
try { return { ...project, logPath, attempt: JSON.parse(fs.readFileSync(logPath, 'utf8')) }; }
|
|
38
|
+
catch (error) { return { ...project, logPath, attempt: null, logError: error.code === 'ENOENT' ? 'No retained generator output' : error.message }; }
|
|
39
|
+
});
|
|
40
|
+
return {
|
|
41
|
+
ok: !eventError, eventError, taskEvents, reports,
|
|
42
|
+
note: 'Task events retain only an output tail. Full legacy generator output was not saved; it cannot be reconstructed from that tail.',
|
|
43
|
+
};
|
|
44
|
+
}
|