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
|
@@ -46,6 +46,7 @@ export function patchVfsDocument(vfsPath, patches, options = {}) {
|
|
|
46
46
|
type: 'patch',
|
|
47
47
|
...envelopeBase(vfsPath, options),
|
|
48
48
|
patches,
|
|
49
|
+
...(options.expectedBeforeHash === undefined ? {} : { expected_before_hash: options.expectedBeforeHash }),
|
|
49
50
|
}, options);
|
|
50
51
|
}
|
|
51
52
|
|
|
@@ -10,6 +10,23 @@ import { CLI_COMMANDS } from './cli-commands.mjs';
|
|
|
10
10
|
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..');
|
|
11
11
|
export const cliEntry = path.join(packageRoot, 'bin/total-recall.mjs');
|
|
12
12
|
|
|
13
|
+
/** Whether this package's dashboard bundle is as new as its frontend sources (the server rebuilds it). */
|
|
14
|
+
async function defaultDashboardCheck() {
|
|
15
|
+
try {
|
|
16
|
+
const { checkDistFreshness, dashboardTargets } = await import('./dashboard-bundle.mjs');
|
|
17
|
+
if (!fs.existsSync(path.join(packageRoot, 'frontend', 'package.json'))) return { status: 'not-shipped' };
|
|
18
|
+
const result = await checkDistFreshness(dashboardTargets(packageRoot));
|
|
19
|
+
const status = result.ok ? 'current' : result.reason === 'missing-bundle' ? 'missing' : 'stale';
|
|
20
|
+
return {
|
|
21
|
+
status,
|
|
22
|
+
...(result.bundle ? { built_at: new Date(result.bundle.mtimeMs).toISOString() } : {}),
|
|
23
|
+
...(!result.ok && result.source ? { newer_source: path.relative(packageRoot, result.source.path) } : {}),
|
|
24
|
+
};
|
|
25
|
+
} catch (error) {
|
|
26
|
+
return { status: 'unknown', reason: error.message };
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
13
30
|
export function runBounded(binary, args, { cwd = process.cwd(), timeoutMs = 15000, maxBytes = 262144 } = {}) {
|
|
14
31
|
return new Promise(resolve => {
|
|
15
32
|
let child, output = '', stderr = '', size = 0, reason = null, settled = false, timer, escalation;
|
|
@@ -81,8 +98,8 @@ export function processIdentity(pidFile, hint, { alive = pid => { try { process.
|
|
|
81
98
|
}
|
|
82
99
|
|
|
83
100
|
/** The single installation-aware daemon observation for status and lifecycle. */
|
|
84
|
-
export function observeDaemon(brainDir, { identity = processIdentity } = {}) {
|
|
85
|
-
const expected_entry =
|
|
101
|
+
export function observeDaemon(brainDir, { identity = processIdentity, expectedEntry = path.join(packageRoot, 'src', 'core', 'daemon-loop.mjs') } = {}) {
|
|
102
|
+
const expected_entry = expectedEntry;
|
|
86
103
|
return { ...identity(path.join(brainDir, 'daemon.pid'), expected_entry), expected_entry, source: 'local-pid' };
|
|
87
104
|
}
|
|
88
105
|
|
|
@@ -130,7 +147,8 @@ export async function fetchStartup(url, options = {}, fetchImpl = fetch) {
|
|
|
130
147
|
}
|
|
131
148
|
|
|
132
149
|
export async function startupHealth({ cwd = process.cwd(), brainDir, brainUrl = null, token = null, brainId = null, ensure = false,
|
|
133
|
-
appCheck = null, appStart = null, run = runBounded, fetchImpl = fetch, onDiskVersion = packageVersionOnDisk, listener = verifyListener, platform = process.platform, home = os.homedir(), identity = processIdentity
|
|
150
|
+
appCheck = null, appStart = null, run = runBounded, fetchImpl = fetch, onDiskVersion = packageVersionOnDisk, listener = verifyListener, platform = process.platform, home = os.homedir(), identity = processIdentity,
|
|
151
|
+
dashboardCheck = null, pluginChecks = null } = {}) {
|
|
134
152
|
const actions = [];
|
|
135
153
|
const serverFile = path.join(brainDir, 'server.pid');
|
|
136
154
|
const report = { checked_at: new Date().toISOString(), server: { status: 'not-configured' }, brain: { status: 'unknown' }, daemon: { status: 'unknown' },
|
|
@@ -148,7 +166,12 @@ export async function startupHealth({ cwd = process.cwd(), brainDir, brainUrl =
|
|
|
148
166
|
remoteDaemon = { status: body.daemon === 'running' ? 'running' : ['dead', 'stopped', 'not-started'].includes(body.daemon) ? 'stopped' : 'unknown', source: 'remote-health' };
|
|
149
167
|
if (local) {
|
|
150
168
|
const own = identity(serverFile, path.join(packageRoot, 'src', 'server', 'index.mjs'));
|
|
151
|
-
if (own.status !== 'running')
|
|
169
|
+
if (own.status !== 'running') {
|
|
170
|
+
const actualRoot = own.entry?.endsWith(path.join('src', 'server', 'index.mjs'))
|
|
171
|
+
? path.resolve(path.dirname(own.entry), '../..') : null;
|
|
172
|
+
return { status: own.status === 'conflict' ? 'conflict' : 'unknown',
|
|
173
|
+
reason: actualRoot ? `server runs from ${actualRoot}; expected ${packageRoot}; run total-recall server ensure` : 'server-process-unverified' };
|
|
174
|
+
}
|
|
152
175
|
if (!await listener(own.pid, new URL(brainUrl), { run, cwd })) return { status: 'unknown', reason: 'server-listener-unverified' };
|
|
153
176
|
}
|
|
154
177
|
const drift = local && verdict.status === 'ready' ? serverCodeDrift(verdict.version, onDiskVersion()) : null;
|
|
@@ -230,6 +253,13 @@ export async function startupHealth({ cwd = process.cwd(), brainDir, brainUrl =
|
|
|
230
253
|
}
|
|
231
254
|
const { inspectRequiredPlugins } = await import('./required-plugins.mjs');
|
|
232
255
|
report.required_plugins = inspectRequiredPlugins(brainDir);
|
|
256
|
+
// Reported, not part of readiness: a stale dashboard or unfinished work still
|
|
257
|
+
// leaves the runtime usable, but neither may stay invisible.
|
|
258
|
+
report.dashboard = await (dashboardCheck ?? defaultDashboardCheck)();
|
|
259
|
+
report.plugin_checks = await (pluginChecks ?? (async () => {
|
|
260
|
+
const { runPluginStartupChecks } = await import('./plugin-startup-checks.mjs');
|
|
261
|
+
return runPluginStartupChecks({ cwd });
|
|
262
|
+
}))();
|
|
233
263
|
report.shared_ready = report.required_plugins.status === 'ready' && report.server.status === 'ready' && report.brain.status === 'ready' && report.daemon.status === 'running' && report.ssss.status === 'available';
|
|
234
264
|
report.ready_scope = appCheck ? 'shared-and-declared-current-repo-app' : 'shared-runtime-only';
|
|
235
265
|
report.ready = report.shared_ready && (!appCheck || report.app.status === 'ready');
|
package/src/core/surface.mjs
CHANGED
|
@@ -496,13 +496,8 @@ function injectDirectives(fileContent, rulesBlock) {
|
|
|
496
496
|
return prependDirectives(authored, rulesBlock);
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
if (!content.includes('total-recall/SKILL.md')) {
|
|
502
|
-
content = baseline + '\n\n' + content;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
return prependDirectives(content, rulesBlock);
|
|
499
|
+
// The managed block carries the start-here instructions; authored text stays as written.
|
|
500
|
+
return prependDirectives(fileContent.trimEnd(), rulesBlock);
|
|
506
501
|
}
|
|
507
502
|
|
|
508
503
|
function prependDirectives(authored, rulesBlock) {
|
|
@@ -516,14 +511,28 @@ function prependDirectives(authored, rulesBlock) {
|
|
|
516
511
|
/**
|
|
517
512
|
* Write or update a platform instruction shim with the pointer and active rules.
|
|
518
513
|
*/
|
|
514
|
+
/**
|
|
515
|
+
* The whole managed part of every client entry file (ON-DEMAND-CONTEXT-01). It is static: no rule
|
|
516
|
+
* bodies, CLI list, plugin table or command list, so a rule or plugin change rewrites no repository.
|
|
517
|
+
* The rules for a task are compiled when the agent acknowledges preflight, and commands are looked
|
|
518
|
+
* up when needed.
|
|
519
|
+
*/
|
|
520
|
+
export const ENTRY_BLOCK = `# Total Recall: start here
|
|
521
|
+
|
|
522
|
+
This repository uses Total Recall. Its rules are not copied into this file: they are compiled for your task when you acknowledge preflight.
|
|
523
|
+
|
|
524
|
+
1. Read \`.agent/skills/total-recall/SKILL.md\`.
|
|
525
|
+
2. Run \`total-recall tr-preflight --ack --task "<task>" --action read,edit,test\` and read everything it prints. Those are the rules for this task. Until it passes, working tools are denied.
|
|
526
|
+
3. Route the task through Metaharness with \`total-recall meta-harness route "<task>" --json\` and follow the route.
|
|
527
|
+
4. Look commands up only when you need them: \`total-recall --help\`, \`total-recall <namespace> --help\`, \`total-recall plugin library\`.`;
|
|
528
|
+
|
|
519
529
|
async function writeShim(shimPath, skillsDir, nodes = [], { vaultDir, derivedDir, force = false } = {}) {
|
|
520
530
|
const shimDir = path.dirname(shimPath);
|
|
521
|
-
const rulesBlock =
|
|
522
|
-
const baseline = '# 🔴 MANDATORY FIRST STEP ON EVERY TURN: TOTAL RECALL FIRST\n1. Run `total-recall --help` (or `node bin/total-recall.mjs --help`) to discover all tools, plugins, and commands.\n2. Read and follow .agent/skills/total-recall/SKILL.md before doing ANYTHING.\n3. Run `total-recall context "<task>"` and `total-recall recall "<topic>" --local` before any decision or action.\nTotal Recall is the mandatory working memory and toolset across all tasks and harnesses. Never skip this.\n';
|
|
531
|
+
const rulesBlock = ENTRY_BLOCK;
|
|
523
532
|
const mdcHeader = shimPath.endsWith('.mdc')
|
|
524
|
-
? '---\ndescription: "Total Recall —
|
|
533
|
+
? '---\ndescription: "Total Recall — start here."\nglobs:\nalwaysApply: true\n---\n\n'
|
|
525
534
|
: '';
|
|
526
|
-
const fullContent = prependDirectives(
|
|
535
|
+
const fullContent = prependDirectives(mdcHeader, rulesBlock);
|
|
527
536
|
|
|
528
537
|
try {
|
|
529
538
|
const normShim = path.normalize(shimPath);
|
|
@@ -772,46 +781,50 @@ export async function compileSurface({ vaultDir, skillsDir, derivedDir, instruct
|
|
|
772
781
|
? mergeGlobalRuleNodes(nodes, getNodes(globalVault))
|
|
773
782
|
: nodes;
|
|
774
783
|
|
|
775
|
-
// ──
|
|
776
|
-
//
|
|
777
|
-
//
|
|
784
|
+
// ── Each output has its own trigger (ON-DEMAND-CONTEXT-01) ──
|
|
785
|
+
// Entry files are static: they change only with the entry block or the client list.
|
|
786
|
+
// Indexes change only with this vault. The CLI index changes only with this brain's
|
|
787
|
+
// plugin catalog. A plugin or global-rule change therefore rewrites no repository's
|
|
788
|
+
// entry files and starts no embeddings pass; rules reach agents at preflight.
|
|
778
789
|
const hashFile = path.join(derivedDir, 'vault-hash.txt');
|
|
779
790
|
const currentHash = computeVaultHash(vaultDir);
|
|
780
|
-
const globalHashFile = path.join(derivedDir, 'global-rules-hash.txt');
|
|
781
|
-
const globalHash = globalVault && fs.existsSync(globalVault) ? computeVaultHash(globalVault) : '';
|
|
782
|
-
// Commands and skills feed the surface too; a change to either must recompile
|
|
783
|
-
// even when no memory node changed.
|
|
784
791
|
const inputsHashFile = path.join(derivedDir, 'surface-inputs-hash.txt');
|
|
792
|
+
const cliHashFile = path.join(derivedDir, 'cli-index-hash.txt');
|
|
785
793
|
const files = instructionFiles(instructionsFile, skillsDir);
|
|
786
794
|
const surfaceDir = path.dirname(instructionsFile);
|
|
787
795
|
const artifactsFile = path.join(derivedDir, 'surface-artifacts.json');
|
|
788
|
-
const inputsHash =
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
};
|
|
804
|
-
}
|
|
796
|
+
const inputsHash = crypto.createHash('sha256').update(ENTRY_BLOCK).update(JSON.stringify(files.map(file => path.relative(surfaceDir, file)))).digest('hex');
|
|
797
|
+
const stored = file => (fs.existsSync(file) ? fs.readFileSync(file, 'utf8').trim() : null);
|
|
798
|
+
const entryCurrent = !force && stored(inputsHashFile) === inputsHash && instructionArtifactsMatch(files, surfaceDir, artifactsFile);
|
|
799
|
+
const vaultCurrent = !force && stored(hashFile) === currentHash;
|
|
800
|
+
const cliCurrent = !force && stored(cliHashFile) === catalog.fingerprint;
|
|
801
|
+
|
|
802
|
+
if (entryCurrent && vaultCurrent && cliCurrent) {
|
|
803
|
+
return {
|
|
804
|
+
nodesProcessed: nodes.length,
|
|
805
|
+
skillsInjected: 0,
|
|
806
|
+
semanticIndexed: 0,
|
|
807
|
+
semanticUnavailable: false,
|
|
808
|
+
skipped: true,
|
|
809
|
+
reason: 'vault-hash-unchanged'
|
|
810
|
+
};
|
|
805
811
|
}
|
|
806
812
|
|
|
807
|
-
// 1. Write pointer and active rules to all instruction shims
|
|
808
|
-
const skillsInjected = await compilePointers(instructionsFile, skillsDir, ruleNodes, { vaultDir, derivedDir, force, files });
|
|
809
|
-
|
|
810
|
-
// 2. Build derived indexes (powers semantic search API)
|
|
811
813
|
if (!fs.existsSync(derivedDir)) {
|
|
812
814
|
fs.mkdirSync(derivedDir, { recursive: true });
|
|
813
815
|
}
|
|
814
816
|
|
|
817
|
+
// 1. Entry files, only when the entry block or client list changed (or a file drifted).
|
|
818
|
+
const skillsInjected = entryCurrent ? 0 : await compilePointers(instructionsFile, skillsDir, ruleNodes, { vaultDir, derivedDir, force, files });
|
|
819
|
+
if (!entryCurrent) {
|
|
820
|
+
atomicWrite(inputsHashFile, inputsHash);
|
|
821
|
+
atomicWrite(artifactsFile, JSON.stringify({ version: 1, files: files.map(file => describeInstruction(file, surfaceDir)) }, null, 2));
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
// 2. Derived indexes, only when this vault changed.
|
|
825
|
+
let semanticResult = { indexed: 0, skipped: nodes.length, unavailable: false };
|
|
826
|
+
if (!vaultCurrent) {
|
|
827
|
+
|
|
815
828
|
const graphIndex = nodes.map(n => ({
|
|
816
829
|
slug: n.slug,
|
|
817
830
|
title: n.title,
|
|
@@ -844,7 +857,7 @@ export async function compileSurface({ vaultDir, skillsDir, derivedDir, instruct
|
|
|
844
857
|
// caller could detect any of it.
|
|
845
858
|
// Awaiting is cheap in steady state: buildEmbeddingsIndex skips nodes whose
|
|
846
859
|
// content hash is unchanged, so only genuinely new or edited nodes cost a call.
|
|
847
|
-
|
|
860
|
+
semanticResult = { indexed: 0, skipped: nodes.length, unavailable: true };
|
|
848
861
|
if (!semantic || process.env.TR_EMBEDDINGS_DISABLED === '1') {
|
|
849
862
|
logger.info('surface', 'Semantic embeddings explicitly disabled; local indexes updated.', { derivedDir });
|
|
850
863
|
} else try {
|
|
@@ -869,9 +882,18 @@ export async function compileSurface({ vaultDir, skillsDir, derivedDir, instruct
|
|
|
869
882
|
semanticResult = { indexed: 0, skipped: nodes.length, unavailable: true, error: err.message };
|
|
870
883
|
}
|
|
871
884
|
|
|
872
|
-
//
|
|
873
|
-
let cliIndexResult = { built: 0, skipped: 0, failed: 0 };
|
|
885
|
+
// 4. Generate Obsidian Canvas
|
|
874
886
|
try {
|
|
887
|
+
generateCanvas(nodes, vaultDir);
|
|
888
|
+
} catch { /* non-fatal */ }
|
|
889
|
+
|
|
890
|
+
atomicWrite(hashFile, currentHash);
|
|
891
|
+
writeProjectionManifest(derivedDir, currentHash);
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
// 3. The CLI semantic index, only when this brain's plugin catalog changed.
|
|
895
|
+
let cliIndexResult = { built: 0, skipped: 0, failed: 0 };
|
|
896
|
+
if (!cliCurrent) try {
|
|
875
897
|
const { buildCliSemanticIndex } = await import('./cli-semantic-index.mjs');
|
|
876
898
|
const projectRoot = skillsDir ? path.dirname(path.dirname(skillsDir)) : process.cwd();
|
|
877
899
|
cliIndexResult = await buildCliSemanticIndex({
|
|
@@ -884,22 +906,11 @@ export async function compileSurface({ vaultDir, skillsDir, derivedDir, instruct
|
|
|
884
906
|
if (cliIndexResult.built > 0) {
|
|
885
907
|
logger.info('surface', `CLI semantic index: ${cliIndexResult.built} indexed, ${cliIndexResult.skipped} skipped.`, { derivedDir });
|
|
886
908
|
}
|
|
909
|
+
atomicWrite(cliHashFile, catalog.fingerprint);
|
|
887
910
|
} catch (err) {
|
|
888
911
|
logger.warn('surface', `CLI semantic index build non-fatal warning: ${err.message}`, { derivedDir });
|
|
889
912
|
}
|
|
890
913
|
|
|
891
|
-
// 4. Generate Obsidian Canvas
|
|
892
|
-
try {
|
|
893
|
-
generateCanvas(nodes, vaultDir);
|
|
894
|
-
} catch { /* non-fatal */ }
|
|
895
|
-
|
|
896
|
-
// 5. Write vault hash + projection manifest
|
|
897
|
-
atomicWrite(hashFile, currentHash);
|
|
898
|
-
atomicWrite(globalHashFile, globalHash);
|
|
899
|
-
atomicWrite(inputsHashFile, inputsHash);
|
|
900
|
-
atomicWrite(artifactsFile, JSON.stringify({ version: 1, files: files.map(file => describeInstruction(file, surfaceDir)) }, null, 2));
|
|
901
|
-
writeProjectionManifest(derivedDir, currentHash);
|
|
902
|
-
|
|
903
914
|
return {
|
|
904
915
|
nodesProcessed: nodes.length,
|
|
905
916
|
skillsInjected,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { loadPluginModule as __loadOwnedPlugin } from './plugin-runtime.mjs';
|
|
2
1
|
/**
|
|
3
2
|
* Executor registry for daemon tasks.
|
|
4
3
|
*
|
|
@@ -41,43 +40,18 @@ function policyCheck(task) {
|
|
|
41
40
|
|
|
42
41
|
async function runDream(task, ctx) {
|
|
43
42
|
const { runDreamCycle } = await import('./dream.mjs');
|
|
44
|
-
await runDreamCycle({
|
|
43
|
+
const result = await runDreamCycle({
|
|
45
44
|
vaultDir: ctx.vaultDir,
|
|
46
45
|
skillsDir: ctx.skillsDir,
|
|
47
46
|
derivedDir: ctx.derivedDir,
|
|
48
47
|
conflictsDir: ctx.conflictsDir,
|
|
49
48
|
instructionsFile: ctx.instructionsFile,
|
|
49
|
+
runtimeConfig: ctx.runtimeConfig,
|
|
50
50
|
});
|
|
51
|
+
if (result?.status !== 'success') return { success: false, error: result?.errors?.join('; ') || 'unsupported', executor: 'dream' };
|
|
51
52
|
return { success: true, output: 'Dream cycle complete', executor: 'dream' };
|
|
52
53
|
}
|
|
53
54
|
|
|
54
|
-
async function runSessionIngest(task, ctx) {
|
|
55
|
-
const { scanAndIngest } = await import('./session-watcher.mjs');
|
|
56
|
-
const result = scanAndIngest(ctx.sessionsDir);
|
|
57
|
-
return {
|
|
58
|
-
success: true,
|
|
59
|
-
output: `Ingested ${result.ingested} new sessions`,
|
|
60
|
-
executor: 'session-ingest',
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
async function runSurfaceCompile(task, ctx) {
|
|
65
|
-
const { compileSurface } = await import('./surface.mjs');
|
|
66
|
-
await compileSurface({
|
|
67
|
-
vaultDir: ctx.vaultDir,
|
|
68
|
-
skillsDir: ctx.skillsDir,
|
|
69
|
-
derivedDir: ctx.derivedDir,
|
|
70
|
-
instructionsFile: ctx.instructionsFile,
|
|
71
|
-
});
|
|
72
|
-
return { success: true, output: 'Surface recompiled', executor: 'surface-compile' };
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
async function runPrune(task, ctx) {
|
|
76
|
-
const { autoPruneStorage } = await import('./dream.mjs');
|
|
77
|
-
autoPruneStorage(ctx.brainDir, ctx.vaultDir, ctx.conflictsDir);
|
|
78
|
-
return { success: true, output: 'Storage prune complete', executor: 'prune' };
|
|
79
|
-
}
|
|
80
|
-
|
|
81
55
|
async function runCustom(task, ctx) {
|
|
82
56
|
const land = task.result?.land || 'inbox';
|
|
83
57
|
const intent = task.intent || task.body || task.reason || task.slug;
|
|
@@ -89,8 +63,8 @@ async function runCustom(task, ctx) {
|
|
|
89
63
|
message: `Custom task (log only): ${task.slug} — ${intent}`,
|
|
90
64
|
});
|
|
91
65
|
return {
|
|
92
|
-
success:
|
|
93
|
-
|
|
66
|
+
success: false,
|
|
67
|
+
error: 'unsupported',
|
|
94
68
|
executor: 'custom',
|
|
95
69
|
};
|
|
96
70
|
}
|
|
@@ -207,7 +181,7 @@ async function runLegacyCategoryDispatch(task, ctx) {
|
|
|
207
181
|
}
|
|
208
182
|
|
|
209
183
|
if (category === 'system2-deliberation') {
|
|
210
|
-
if (process.env.TR_POWER_EXECUTORS !== '1' && !task._research_id) {
|
|
184
|
+
if (process.env.TR_POWER_EXECUTORS !== '1' && !task._research_id && !(task.created_by === 'automations' && task.payload?.scheduledIdle)) {
|
|
211
185
|
return {
|
|
212
186
|
success: false,
|
|
213
187
|
error: 'system2-deliberation requires TR_POWER_EXECUTORS=1 (or research-queue phase)',
|
|
@@ -221,6 +195,7 @@ async function runLegacyCategoryDispatch(task, ctx) {
|
|
|
221
195
|
inboxDir: path.join(BRAIN_DIR, 'memory-inbox', 'pending'),
|
|
222
196
|
runtimeConfig,
|
|
223
197
|
});
|
|
198
|
+
if (result.error || result.success === false) return { success: false, error: result.error || 'Inference failed', executor: 'system2' };
|
|
224
199
|
return {
|
|
225
200
|
success: true,
|
|
226
201
|
output: `Inference complete: ${result.conclusions?.length || 0} conclusions`,
|
|
@@ -253,7 +228,9 @@ async function runLegacyCategoryDispatch(task, ctx) {
|
|
|
253
228
|
vaultDir: VAULT_DIR,
|
|
254
229
|
inboxDir: path.join(BRAIN_DIR, 'memory-inbox', 'pending'),
|
|
255
230
|
runtimeConfig,
|
|
231
|
+
fromTurn: 1,
|
|
256
232
|
});
|
|
233
|
+
if (result.error) return { success: false, error: result.error, executor: 'post-mortem' };
|
|
257
234
|
return {
|
|
258
235
|
success: true,
|
|
259
236
|
output: `Post-mortem: ${result.nodesCreated || 0} nodes`,
|
|
@@ -280,6 +257,7 @@ async function runLegacyCategoryDispatch(task, ctx) {
|
|
|
280
257
|
inboxDir: path.join(BRAIN_DIR, 'memory-inbox', 'pending'),
|
|
281
258
|
runtimeConfig,
|
|
282
259
|
});
|
|
260
|
+
if (result.error || result.success === false) return { success: false, error: result.error || 'Clarity review failed', executor: 'clarity' };
|
|
283
261
|
return {
|
|
284
262
|
success: true,
|
|
285
263
|
output: `Clarity review: rewrote=${result.rewrote}`,
|
|
@@ -287,17 +265,8 @@ async function runLegacyCategoryDispatch(task, ctx) {
|
|
|
287
265
|
};
|
|
288
266
|
}
|
|
289
267
|
if (String(task.slug || '').startsWith('memory-compaction-')) {
|
|
290
|
-
const {
|
|
291
|
-
|
|
292
|
-
vaultDir: VAULT_DIR,
|
|
293
|
-
inboxDir: path.join(BRAIN_DIR, 'memory-inbox', 'pending'),
|
|
294
|
-
runtimeConfig,
|
|
295
|
-
});
|
|
296
|
-
return {
|
|
297
|
-
success: true,
|
|
298
|
-
output: `Compaction: ${result.consolidatedCount || 0} nodes`,
|
|
299
|
-
executor: 'compaction',
|
|
300
|
-
};
|
|
268
|
+
const { fileCleanupProposals } = await import('./cleanup-task.mjs');
|
|
269
|
+
return fileCleanupProposals(VAULT_DIR);
|
|
301
270
|
}
|
|
302
271
|
// generic maintenance: lease vacuum
|
|
303
272
|
try {
|
|
@@ -324,10 +293,10 @@ async function runLegacyCategoryDispatch(task, ctx) {
|
|
|
324
293
|
return { success: true, output: 'Maintenance complete', executor: 'maintenance' };
|
|
325
294
|
}
|
|
326
295
|
|
|
327
|
-
if (category === '
|
|
296
|
+
if (category === 'self-evaluation' || category === 'skill-engineering') {
|
|
328
297
|
return {
|
|
329
|
-
success:
|
|
330
|
-
|
|
298
|
+
success: false,
|
|
299
|
+
error: 'unsupported',
|
|
331
300
|
executor: category,
|
|
332
301
|
};
|
|
333
302
|
}
|
|
@@ -335,7 +304,7 @@ async function runLegacyCategoryDispatch(task, ctx) {
|
|
|
335
304
|
// Unknown — fail loud
|
|
336
305
|
return {
|
|
337
306
|
success: false,
|
|
338
|
-
error:
|
|
307
|
+
error: 'unsupported',
|
|
339
308
|
executor: 'unknown',
|
|
340
309
|
};
|
|
341
310
|
}
|
|
@@ -375,7 +344,7 @@ async function runResearchLegacy(task, ctx) {
|
|
|
375
344
|
// researched — so it is now a no-op (RESEARCH_SYSTEM2).
|
|
376
345
|
const topic = String(task.target || '').trim();
|
|
377
346
|
if (!topic || topic === 'global') {
|
|
378
|
-
return { success:
|
|
347
|
+
return { success: false, error: 'unsupported', executor: 'research' };
|
|
379
348
|
}
|
|
380
349
|
|
|
381
350
|
// Prefer deep multi-source research when this came from the research queue
|
|
@@ -514,7 +483,7 @@ async function runResearchLegacy(task, ctx) {
|
|
|
514
483
|
quarantineDir: path.join(BRAIN_DIR, 'memory-inbox', 'quarantine'),
|
|
515
484
|
});
|
|
516
485
|
if (result.skipped) {
|
|
517
|
-
return { success:
|
|
486
|
+
return { success: false, error: 'unsupported', executor: 'research' };
|
|
518
487
|
}
|
|
519
488
|
return {
|
|
520
489
|
success: true,
|
|
@@ -525,7 +494,7 @@ async function runResearchLegacy(task, ctx) {
|
|
|
525
494
|
|
|
526
495
|
return {
|
|
527
496
|
success: false,
|
|
528
|
-
error:
|
|
497
|
+
error: 'unsupported',
|
|
529
498
|
executor: 'research',
|
|
530
499
|
};
|
|
531
500
|
}
|
|
@@ -571,47 +540,39 @@ function findLatestResearchDraftSlug(inboxDir, topic) {
|
|
|
571
540
|
|
|
572
541
|
// ─── Registry ───────────────────────────────────────────────────────────────────
|
|
573
542
|
|
|
574
|
-
async function
|
|
575
|
-
const {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
const { runSecretsExportAll } = await __loadOwnedPlugin('auth', 'secrets-rotate');
|
|
581
|
-
return runSecretsExportAll(ctx);
|
|
543
|
+
async function runSkillGap(task, ctx) {
|
|
544
|
+
const { requestSkillGap } = await import('./skill-gap.mjs');
|
|
545
|
+
const topic = task.payload?.topic || task.target || /topic "([^"]+)"/.exec(task.reason || '')?.[1];
|
|
546
|
+
const session = task.source_session || task.origin?.session_id;
|
|
547
|
+
return requestSkillGap(topic, task.payload?.evidence ||
|
|
548
|
+
(session ? `session://${session}` : null), { projectRoot: ctx.projectRoot || process.cwd() });
|
|
582
549
|
}
|
|
583
550
|
|
|
584
|
-
async function
|
|
585
|
-
|
|
586
|
-
const
|
|
587
|
-
if (!
|
|
588
|
-
|
|
551
|
+
async function runLessonReview(task, ctx) {
|
|
552
|
+
const { runPostMortem } = await import('./post-mortem.mjs');
|
|
553
|
+
const sessionPath = task.payload?.sessionPath || (task.target && path.join(ctx.sessionsDir, task.target));
|
|
554
|
+
if (!sessionPath) return { success: false, error: 'Lesson review requires a session transcript and turn range' };
|
|
555
|
+
const result = await runPostMortem(sessionPath, {
|
|
556
|
+
vaultDir: ctx.vaultDir, inboxDir: path.join(ctx.brainDir, 'memory-inbox', 'pending'), runtimeConfig: ctx.runtimeConfig,
|
|
557
|
+
// Scheduled snapshots already contain exactly the requested range.
|
|
558
|
+
fromTurn: task.payload?.sessionPath ? 1 : task.payload?.fromTurn,
|
|
559
|
+
toTurn: task.payload?.sessionPath ? Infinity : task.payload?.toTurn,
|
|
560
|
+
sourceRef: task.payload?.sessionId ? `${task.payload.sessionId}/turns/${task.payload.fromTurn}-${task.payload.toTurn}` : task.slug,
|
|
561
|
+
hold: task.payload?.hold === true,
|
|
562
|
+
});
|
|
563
|
+
if (result.error) return { success: false, error: result.error, executor: 'lesson-review' };
|
|
564
|
+
if (task.slug?.startsWith('lesson-review-')) {
|
|
565
|
+
const dir = path.join(ctx.brainDir, 'lesson-reviews');
|
|
566
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
567
|
+
atomicWrite(path.join(dir, `${task.slug}.done`), new Date().toISOString());
|
|
589
568
|
}
|
|
590
|
-
|
|
591
|
-
const assist = await getBrowserRotateAssist(ctx.brainDir, key);
|
|
592
|
-
return {
|
|
593
|
-
success: true,
|
|
594
|
-
output: `Browser rotation assist ready for ${key}. Console: ${assist.console_url || 'n/a'}. Use browser tools with human 2FA; then secret rotate --export-env.`,
|
|
595
|
-
executor: 'secrets-rotation-assist',
|
|
596
|
-
assist: {
|
|
597
|
-
key: assist.key,
|
|
598
|
-
console_url: assist.console_url,
|
|
599
|
-
docs_url: assist.docs_url,
|
|
600
|
-
overdue: assist.overdue,
|
|
601
|
-
// prompt available to agent; do not echo secrets
|
|
602
|
-
prompt: assist.prompt,
|
|
603
|
-
},
|
|
604
|
-
};
|
|
569
|
+
return { success: true, output: `Lesson review: ${result.patterns?.length || 0} patterns, ${result.facts?.length || 0} facts, ${result.skill_gaps?.length || 0} skill gaps, ${result.violations?.length || 0} violations`, executor: 'lesson-review' };
|
|
605
570
|
}
|
|
606
571
|
|
|
607
572
|
const EXECUTORS = {
|
|
608
|
-
'
|
|
609
|
-
'
|
|
610
|
-
'secrets-rotation-assist': { id: 'secrets-rotation-assist', run: runSecretsRotationAssist },
|
|
573
|
+
'lesson-review': { id: 'lesson-review', run: runLessonReview },
|
|
574
|
+
'skill-manager': { id: 'skill-manager', run: runSkillGap },
|
|
611
575
|
dream: { id: 'dream', run: runDream },
|
|
612
|
-
'session-ingest': { id: 'session-ingest', run: runSessionIngest },
|
|
613
|
-
'surface-compile': { id: 'surface-compile', run: runSurfaceCompile },
|
|
614
|
-
prune: { id: 'prune', run: runPrune },
|
|
615
576
|
custom: { id: 'custom', run: runCustom },
|
|
616
577
|
research: { id: 'research', run: runResearchLegacy },
|
|
617
578
|
legacy: { id: 'legacy', run: runLegacyDispatch },
|
|
@@ -623,31 +584,16 @@ const EXECUTORS = {
|
|
|
623
584
|
export function resolveExecutor(task) {
|
|
624
585
|
const t = normalizeTask(task);
|
|
625
586
|
|
|
626
|
-
if (t.
|
|
627
|
-
|
|
628
|
-
|
|
587
|
+
if (t.category === 'skill-engineering') return EXECUTORS['skill-manager'];
|
|
588
|
+
if (t.category === 'lesson-review' || t.category === 'self-evaluation') return EXECUTORS['lesson-review'];
|
|
589
|
+
|
|
590
|
+
// An explicit unsupported executor must never fall through to kind/category.
|
|
591
|
+
if (t.executor) return typeof t.executor === 'string' && Object.hasOwn(EXECUTORS, t.executor) ? EXECUTORS[t.executor] : null;
|
|
629
592
|
|
|
630
593
|
// System / named slugs
|
|
631
594
|
if (t.slug === 'dream' || String(t.slug || '').startsWith('dream-') || t.executor === 'dream') {
|
|
632
595
|
return EXECUTORS.dream;
|
|
633
596
|
}
|
|
634
|
-
if (String(t.slug || '').startsWith('session-ingest')) return EXECUTORS['session-ingest'];
|
|
635
|
-
if (String(t.slug || '').startsWith('surface-compile')) return EXECUTORS['surface-compile'];
|
|
636
|
-
if (String(t.slug || '').startsWith('prune-') || t.slug === 'prune') return EXECUTORS.prune;
|
|
637
|
-
if (String(t.slug || '').startsWith('secret-rotate-') || t.category === 'secrets-rotation') {
|
|
638
|
-
return EXECUTORS['secrets-rotation-assist'];
|
|
639
|
-
}
|
|
640
|
-
if (String(t.slug || '').startsWith('secrets-rotation-check') || t.executor === 'secrets-rotation-check') {
|
|
641
|
-
return EXECUTORS['secrets-rotation-check'];
|
|
642
|
-
}
|
|
643
|
-
if (String(t.slug || '').startsWith('secrets-export') || t.executor === 'secrets-export-env') {
|
|
644
|
-
return EXECUTORS['secrets-export-env'];
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
if (t.kind === 'custom' || t.category === 'custom' || t.executor === 'custom') {
|
|
648
|
-
return EXECUTORS.custom;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
597
|
// Known legacy categories still registered
|
|
652
598
|
const legacyCategories = new Set([
|
|
653
599
|
'conscious-enforcement',
|
|
@@ -658,13 +604,14 @@ export function resolveExecutor(task) {
|
|
|
658
604
|
'proactive-research',
|
|
659
605
|
'skill-engineering',
|
|
660
606
|
'self-evaluation',
|
|
661
|
-
'exploration',
|
|
662
607
|
]);
|
|
663
608
|
|
|
664
609
|
if (legacyCategories.has(t.category) || t._research_id || t._is_remote_vault_sync) {
|
|
665
610
|
return EXECUTORS.legacy;
|
|
666
611
|
}
|
|
667
612
|
|
|
613
|
+
if (t.category === 'custom' || (t.kind === 'custom' && !t.category)) return EXECUTORS.custom;
|
|
614
|
+
|
|
668
615
|
if (t.kind === 'research') return EXECUTORS.research;
|
|
669
616
|
if (t.kind === 'system' || t.kind === 'maintenance' || t.kind === 'memory') {
|
|
670
617
|
return EXECUTORS.legacy;
|
|
@@ -691,11 +638,12 @@ export async function dispatchTask(task, ctx) {
|
|
|
691
638
|
`Unknown task executor for slug=${normalized.slug} ` +
|
|
692
639
|
`category=${normalized.category} kind=${normalized.kind} executor=${normalized.executor}`;
|
|
693
640
|
logger.info({ subsystem: 'task-executors', message: msg });
|
|
694
|
-
return { success: false, error:
|
|
641
|
+
return { success: false, error: 'unsupported', executor: 'unknown' };
|
|
695
642
|
}
|
|
696
643
|
|
|
697
644
|
try {
|
|
698
645
|
const result = await executor.run(normalized, ctx);
|
|
646
|
+
if (!result || typeof result.success !== 'boolean') return { success: false, error: 'unsupported', executor: executor.id };
|
|
699
647
|
return { ...result, executor: result.executor || executor.id };
|
|
700
648
|
} catch (err) {
|
|
701
649
|
return {
|