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.
Files changed (502) hide show
  1. package/bin/total-recall.mjs +10 -6
  2. package/docs/ARCHITECTURE.md +10 -7
  3. package/docs/reference/cli-reference.md +13 -8
  4. package/frontend/dist/assets/index-BRYE1jmv.css +1 -0
  5. package/frontend/dist/assets/index-D1goIPjC.js +5598 -0
  6. package/frontend/dist/index.html +2 -2
  7. package/frontend/dist/sw.js +5 -4
  8. package/frontend/src/App.tsx +185 -238
  9. package/frontend/src/api/auth-inventory.ts +62 -0
  10. package/frontend/src/api/memory.ts +13 -8
  11. package/frontend/src/api/plugin-credentials.ts +23 -0
  12. package/frontend/src/api/plugins.ts +37 -53
  13. package/frontend/src/api/workspace-drawers.ts +97 -0
  14. package/frontend/src/components/BrainSelector.tsx +9 -3
  15. package/frontend/src/components/plugins/PluginPanel.tsx +83 -42
  16. package/frontend/src/components/plugins/PluginSettings.tsx +10 -20
  17. package/frontend/src/components/plugins/PluginWorkspace.tsx +367 -0
  18. package/frontend/src/components/plugins/ScopedPluginCommands.tsx +142 -0
  19. package/frontend/src/components/plugins/plugin-frame.ts +44 -33
  20. package/frontend/src/components/plugins/scoped-plugin-operations.ts +28 -0
  21. package/frontend/src/components/workspace/DrawerChat.tsx +110 -0
  22. package/frontend/src/components/workspace/DrawerLayout.tsx +196 -0
  23. package/frontend/src/components/workspace/DrawerMarkup.tsx +49 -0
  24. package/frontend/src/components/workspace/PluginChunkLibrary.tsx +92 -0
  25. package/frontend/src/components/workspace/PluginHome.tsx +76 -0
  26. package/frontend/src/components/workspace/WorkspaceDrawers.tsx +96 -0
  27. package/frontend/src/components/workspace/WorkspacePage.tsx +95 -0
  28. package/frontend/src/components/workspace/usePluginDesign.ts +38 -0
  29. package/frontend/src/index.css +409 -136
  30. package/frontend/src/pages/HelpPage.tsx +15 -46
  31. package/frontend/src/pages/MemoryPage.tsx +19 -36
  32. package/frontend/src/pages/SettingsPage.tsx +1 -1
  33. package/metadata.plugin.schema.json +53 -227
  34. package/package.json +1 -1
  35. package/scaffold/.agent/skills/plugin/SKILL.md +13 -11
  36. package/scaffold/.agent/skills/plugin/evals/README.md +14 -21
  37. package/scaffold/.agent/skills/plugin/evals/cases/01-fabricated-seed.mjs +15 -18
  38. package/scaffold/.agent/skills/plugin/evals/cases/02-reassuring-default.mjs +19 -24
  39. package/scaffold/.agent/skills/plugin/evals/cases/03-declared-template.mjs +12 -20
  40. package/scaffold/.agent/skills/plugin/evals/cases/04-home-collects-credential.mjs +35 -0
  41. package/scaffold/.agent/skills/plugin/evals/cases/05-host-leak-in-scaffold.mjs +8 -28
  42. package/scaffold/.agent/skills/plugin/evals/cases/06-correct-plugin.mjs +85 -47
  43. package/scaffold/.agent/skills/plugin/evals/run.mjs +17 -18
  44. package/scaffold/.agent/skills/plugin/prompts/05-credentials.md +4 -4
  45. package/scaffold/.agent/skills/plugin/prompts/07-scaffold.md +2 -2
  46. package/scaffold/.agent/skills/plugin/prompts/08-verify.md +4 -4
  47. package/scaffold/.agent/skills/plugin/references/anti-patterns.md +2 -2
  48. package/scaffold/.agent/skills/plugin/references/generative-home.md +38 -0
  49. package/scaffold/.agent/skills/plugin/references/scaffold.md +5 -5
  50. package/scaffold/.agent/skills/plugin/references/surfaces.md +13 -4
  51. package/scaffold/.agent/skills/plugin/scripts/record.mjs +75 -153
  52. package/scaffold/.agent/skills/plugin/subagents/plugin-reviewer.md +4 -4
  53. package/scaffold/.agent/skills/total-recall/plugins/auth/DESIGN.md +76 -0
  54. package/scaffold/.agent/skills/total-recall/plugins/auth/README.md +3 -1
  55. package/scaffold/.agent/skills/total-recall/plugins/auth/cli.mjs +20 -15
  56. package/scaffold/.agent/skills/total-recall/plugins/auth/package-lock.json +7 -7
  57. package/scaffold/.agent/skills/total-recall/plugins/auth/package.json +2 -1
  58. package/scaffold/.agent/skills/total-recall/plugins/auth/plugin.json +13 -51
  59. package/scaffold/.agent/skills/total-recall/plugins/auth/src/cli-secret.mjs +20 -1
  60. package/scaffold/.agent/skills/total-recall/plugins/auth/src/secrets-store.mjs +12 -1
  61. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/access-overview.md +17 -0
  62. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/agent-login.md +20 -0
  63. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/baseline-audit.md +22 -0
  64. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/credential-repository-binding.md +17 -0
  65. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/credential-store-maintenance.md +17 -0
  66. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/dashboard-password.md +18 -0
  67. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/dashboard-sessions.md +18 -0
  68. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/endpoint-probe.md +23 -0
  69. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/google-sign-in.md +21 -0
  70. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/mesh-machines.md +16 -0
  71. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/passkey-enrollment.md +21 -0
  72. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/registered-brains.md +16 -0
  73. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/scoped-access-keys.md +17 -0
  74. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/secret-inventory.md +25 -0
  75. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/chunks/signing-key-rotation.md +22 -0
  76. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/home.js +375 -0
  77. package/scaffold/.agent/skills/total-recall/plugins/automations/BRICK.md +7 -0
  78. package/scaffold/.agent/skills/total-recall/plugins/automations/DESIGN.md +53 -0
  79. package/scaffold/.agent/skills/total-recall/plugins/automations/LICENSE +21 -0
  80. package/scaffold/.agent/skills/total-recall/plugins/automations/README.md +66 -0
  81. package/scaffold/.agent/skills/total-recall/plugins/automations/adapters.mjs +247 -0
  82. package/scaffold/.agent/skills/total-recall/plugins/automations/capability/index.mjs +16 -0
  83. package/scaffold/.agent/skills/total-recall/plugins/automations/cli.mjs +130 -0
  84. package/{src/core/plugin-cron.mjs → scaffold/.agent/skills/total-recall/plugins/automations/cron.mjs} +1 -3
  85. package/scaffold/.agent/skills/total-recall/plugins/automations/inventory.mjs +88 -0
  86. package/scaffold/.agent/skills/total-recall/plugins/automations/package-lock.json +7661 -0
  87. package/scaffold/.agent/skills/total-recall/plugins/automations/package.json +36 -0
  88. package/scaffold/.agent/skills/total-recall/plugins/automations/plugin.json +151 -0
  89. package/scaffold/.agent/skills/total-recall/plugins/automations/scheduler.mjs +246 -0
  90. package/scaffold/.agent/skills/total-recall/plugins/automations/ui/automations.js +2 -0
  91. package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/control-ledger.md +42 -0
  92. package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/local-inventory-triage.md +17 -0
  93. package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/pending-control.md +39 -0
  94. package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/run-evidence.md +41 -0
  95. package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/schedule-vs-run-evidence.md +17 -0
  96. package/scaffold/.agent/skills/total-recall/plugins/automations/ui/chunks/source-coverage.md +41 -0
  97. package/scaffold/.agent/skills/total-recall/plugins/automations/ui/home.js +278 -0
  98. package/scaffold/.agent/skills/total-recall/plugins/code-quality/DESIGN.md +53 -0
  99. package/scaffold/.agent/skills/total-recall/plugins/code-quality/cli.mjs +23 -0
  100. package/scaffold/.agent/skills/total-recall/plugins/code-quality/commands/run-core.mjs +5 -3
  101. package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/check.mjs +61 -7
  102. package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/report-data.mjs +40 -14
  103. package/scaffold/.agent/skills/total-recall/plugins/code-quality/core/report.mjs +15 -40
  104. package/scaffold/.agent/skills/total-recall/plugins/code-quality/package-lock.json +7 -7
  105. package/scaffold/.agent/skills/total-recall/plugins/code-quality/package.json +2 -1
  106. package/scaffold/.agent/skills/total-recall/plugins/code-quality/plugin.json +40 -40
  107. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/config.md +15 -0
  108. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/detect.md +15 -0
  109. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/gate.md +15 -0
  110. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/init.md +15 -0
  111. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/report.md +17 -0
  112. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/run.md +17 -0
  113. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/chunks/snapshot.md +15 -0
  114. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/code-quality-report.mjs +55 -23
  115. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/home.mjs +214 -0
  116. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/DESIGN.md +146 -0
  117. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/package-lock.json +7 -7
  118. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/package.json +2 -1
  119. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/plugin.json +51 -34
  120. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/src/command.mjs +1 -1
  121. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/create.md +35 -0
  122. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/history.md +35 -0
  123. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/library.md +49 -0
  124. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/list.md +42 -0
  125. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/promote.md +40 -0
  126. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/read.md +25 -0
  127. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/remove.md +26 -0
  128. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/rollback.md +26 -0
  129. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/show.md +53 -0
  130. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/status.md +40 -0
  131. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/test-path.md +38 -0
  132. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/test.md +46 -0
  133. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/chunks/update.md +32 -0
  134. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/home.js +533 -0
  135. package/scaffold/.agent/skills/total-recall/plugins/embeddings/DESIGN.md +110 -0
  136. package/scaffold/.agent/skills/total-recall/plugins/embeddings/package-lock.json +7 -7
  137. package/scaffold/.agent/skills/total-recall/plugins/embeddings/package.json +2 -1
  138. package/scaffold/.agent/skills/total-recall/plugins/embeddings/plugin.json +13 -10
  139. package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/chunks/benchmark.md +49 -0
  140. package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/chunks/coverage.md +53 -0
  141. package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/chunks/models.md +43 -0
  142. package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/chunks/pull.md +41 -0
  143. package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/chunks/status.md +59 -0
  144. package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/home.js +353 -0
  145. package/scaffold/.agent/skills/total-recall/plugins/git/DESIGN.md +31 -0
  146. package/scaffold/.agent/skills/total-recall/plugins/git/README.md +136 -0
  147. package/scaffold/.agent/skills/total-recall/plugins/{git-sentinel → git}/cli.mjs +140 -24
  148. package/scaffold/.agent/skills/total-recall/plugins/{git-sentinel → git}/package-lock.json +9 -9
  149. package/scaffold/.agent/skills/total-recall/plugins/{git-sentinel → git}/package.json +4 -2
  150. package/scaffold/.agent/skills/total-recall/plugins/git/plugin.json +151 -0
  151. package/scaffold/.agent/skills/total-recall/plugins/git/src/lib/context.mjs +94 -0
  152. package/scaffold/.agent/skills/total-recall/plugins/git/src/lib/phase3-spec-support.mjs +50 -0
  153. package/scaffold/.agent/skills/total-recall/plugins/git/src/lib/runtime.mjs +40 -0
  154. package/scaffold/.agent/skills/total-recall/plugins/git/src/lib/spec-support.mjs +51 -0
  155. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/_support.mjs +195 -0
  156. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/auth.mjs +201 -0
  157. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/bisect.mjs +40 -0
  158. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/cli-meta.mjs +159 -0
  159. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/commit-memory.mjs +54 -0
  160. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/commit.mjs +46 -0
  161. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/fleet.mjs +174 -0
  162. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/force-push.mjs +58 -0
  163. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/group.mjs +119 -0
  164. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/handoff.mjs +59 -0
  165. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/message.mjs +22 -0
  166. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/resolve.mjs +60 -0
  167. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/rules.mjs +81 -0
  168. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/secret-firewall.mjs +92 -0
  169. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/undo.mjs +156 -0
  170. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/unmerged.mjs +182 -0
  171. package/scaffold/.agent/skills/total-recall/plugins/git/src/ops/why.mjs +16 -0
  172. package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/change-comparison.md +27 -0
  173. package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/commit-identity.md +22 -0
  174. package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/create-worktree.md +25 -0
  175. package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/registered-worktrees.md +22 -0
  176. package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/remove-worktree.md +23 -0
  177. package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/repository-ledger.md +25 -0
  178. package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/unmerged-work.md +22 -0
  179. package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/upstream-divergence.md +17 -0
  180. package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/worktree-conflict-triage.md +17 -0
  181. package/scaffold/.agent/skills/total-recall/plugins/git/ui/chunks/worktree-terminal.md +22 -0
  182. package/scaffold/.agent/skills/total-recall/plugins/git/ui/home.js +273 -0
  183. package/scaffold/.agent/skills/total-recall/plugins/mesh/DESIGN.md +35 -0
  184. package/scaffold/.agent/skills/total-recall/plugins/mesh/README.md +4 -5
  185. package/scaffold/.agent/skills/total-recall/plugins/mesh/cli.mjs +9 -3
  186. package/scaffold/.agent/skills/total-recall/plugins/mesh/package-lock.json +7 -7
  187. package/scaffold/.agent/skills/total-recall/plugins/mesh/package.json +2 -1
  188. package/scaffold/.agent/skills/total-recall/plugins/mesh/plugin.json +37 -39
  189. package/scaffold/.agent/skills/total-recall/plugins/mesh/src/cli/mesh.mjs +5 -3
  190. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/active-device-dispatch.md +22 -0
  191. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/control-probe.md +25 -0
  192. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/control-server.md +22 -0
  193. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/credential-readiness.md +23 -0
  194. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/elected-leader.md +22 -0
  195. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/enrollment-key.md +22 -0
  196. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/file-receipt.md +25 -0
  197. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/fleet-execution.md +23 -0
  198. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/fleet-presence.md +23 -0
  199. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/interactive-ssh.md +22 -0
  200. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/local-enrollment.md +23 -0
  201. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/mesh-policy.md +23 -0
  202. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/network-atlas.md +25 -0
  203. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/node-roster.md +26 -0
  204. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/node-selection-proof.md +17 -0
  205. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/owner-observations.md +23 -0
  206. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/peer-path.md +23 -0
  207. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/pinned-leader.md +24 -0
  208. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/reachability-evidence-ladder.md +17 -0
  209. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/recorded-login.md +23 -0
  210. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/remote-execution.md +22 -0
  211. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/chunks/secret-grants.md +26 -0
  212. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/{card.js → home.js} +93 -22
  213. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/DESIGN.md +86 -0
  214. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/README.md +44 -9
  215. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/capability/BRICK.md +1 -1
  216. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/capability/index.mjs +18 -6
  217. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/cli.mjs +128 -24
  218. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/package-lock.json +7 -7
  219. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/package.json +3 -2
  220. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/plugin.json +188 -34
  221. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/skills/meta-harness/SKILL.md +17 -3
  222. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/adoption.mjs +2 -2
  223. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/alerts.mjs +3 -3
  224. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/cascade.mjs +92 -18
  225. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/chat.mjs +80 -0
  226. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/control.mjs +145 -0
  227. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/coordinator.mjs +42 -21
  228. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/dispatch-request.mjs +4 -2
  229. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/dispatch.mjs +33 -9
  230. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/documentation.mjs +55 -11
  231. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/executor.mjs +26 -4
  232. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/gate-adapters/hermes.mjs +29 -1
  233. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/gate-adapters/index.mjs +1 -1
  234. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/included-usage.mjs +1 -1
  235. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/jobs.mjs +84 -0
  236. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/learner.mjs +3 -12
  237. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/maintenance.mjs +17 -0
  238. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/mcp-server.mjs +228 -0
  239. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/process-manager.mjs +25 -2
  240. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/reasoning.mjs +1 -1
  241. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/remote-operation.mjs +5 -1
  242. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/review.mjs +34 -3
  243. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/reviews.mjs +25 -0
  244. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/router.mjs +1 -1
  245. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session/claude.mjs +319 -0
  246. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session/codex.mjs +387 -0
  247. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session/result.mjs +67 -0
  248. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session/resume.mjs +373 -0
  249. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session/run.mjs +223 -0
  250. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/session-jobs.mjs +72 -0
  251. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/setup.mjs +6 -3
  252. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/termination.mjs +16 -12
  253. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/threads.mjs +32 -1
  254. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/usage-queue.mjs +1 -1
  255. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/verify-ssss.mjs +3 -3
  256. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/worker.mjs +285 -40
  257. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/src/worktree.mjs +76 -9
  258. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/adapter-docs-freshness.md +16 -0
  259. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/chat-handoff.md +26 -0
  260. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/fleet-maintenance.md +21 -0
  261. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/harness-inventory.md +21 -0
  262. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/included-access.md +18 -0
  263. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/included-usage-verification.md +15 -0
  264. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/independent-review.md +17 -0
  265. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/managed-execution.md +20 -0
  266. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/official-documentation.md +18 -0
  267. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/quota-recovery.md +21 -0
  268. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/review-routing-decision.md +16 -0
  269. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/route-work.md +18 -0
  270. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/routing-evidence.md +18 -0
  271. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/chunks/run-ledger.md +18 -0
  272. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/home.js +198 -0
  273. package/scaffold/.agent/skills/total-recall/plugins/openwiki/DESIGN.md +75 -0
  274. package/scaffold/.agent/skills/total-recall/plugins/openwiki/README.md +2 -0
  275. package/scaffold/.agent/skills/total-recall/plugins/openwiki/cli.mjs +64 -32
  276. package/scaffold/.agent/skills/total-recall/plugins/openwiki/package-lock.json +7 -7
  277. package/scaffold/.agent/skills/total-recall/plugins/openwiki/package.json +2 -1
  278. package/scaffold/.agent/skills/total-recall/plugins/openwiki/plugin.json +10 -44
  279. package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/generate.mjs +5 -4
  280. package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/graph.mjs +3 -4
  281. package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/ingest.mjs +23 -18
  282. package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/mesh-vaults.mjs +8 -3
  283. package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/refresh-diagnostics.mjs +44 -0
  284. package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/refresh.mjs +123 -113
  285. package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/search.mjs +3 -5
  286. package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/token.mjs +21 -47
  287. package/scaffold/.agent/skills/total-recall/plugins/openwiki/src/upstream-watcher.mjs +17 -6
  288. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/auto-refresh.md +18 -0
  289. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/bootstrap-pages.md +18 -0
  290. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/generate-wiki.md +21 -0
  291. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/generator-settings.md +18 -0
  292. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/host-probe.md +18 -0
  293. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/ingest-preview.md +18 -0
  294. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/link-hygiene.md +21 -0
  295. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/link-topology.md +19 -0
  296. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/passage-search.md +19 -0
  297. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/propagation-plan.md +18 -0
  298. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/provider-credentials.md +18 -0
  299. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/refresh-report.md +18 -0
  300. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/task-evidence.md +22 -0
  301. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/upstream-record.md +18 -0
  302. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/watch-upstream.md +18 -0
  303. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/chunks/wiki-atlas.md +19 -0
  304. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/panel.js +261 -513
  305. package/scaffold/.agent/skills/total-recall/plugins/security/DESIGN.md +84 -0
  306. package/scaffold/.agent/skills/total-recall/plugins/security/README.md +4 -2
  307. package/scaffold/.agent/skills/total-recall/plugins/security/cli.mjs +7 -19
  308. package/scaffold/.agent/skills/total-recall/plugins/security/package-lock.json +7 -7
  309. package/scaffold/.agent/skills/total-recall/plugins/security/package.json +2 -3
  310. package/scaffold/.agent/skills/total-recall/plugins/security/plugin.json +19 -52
  311. package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/device-evidence.md +21 -0
  312. package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/evidence-desk.md +18 -0
  313. package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/guided-device-review.md +17 -0
  314. package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/host-and-network.md +21 -0
  315. package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/https-headers.md +17 -0
  316. package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/mesh-coverage.md +18 -0
  317. package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/private-security-tools.md +16 -0
  318. package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/single-origin-header-check.md +17 -0
  319. package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/source-review.md +21 -0
  320. package/scaffold/.agent/skills/total-recall/plugins/security/ui/chunks/ssh-permission-plan.md +17 -0
  321. package/scaffold/.agent/skills/total-recall/plugins/security/ui/home.js +283 -0
  322. package/scaffold/.agent/skills/total-recall/plugins/ssss/DESIGN.md +93 -0
  323. package/scaffold/.agent/skills/total-recall/plugins/ssss/package-lock.json +2 -2
  324. package/scaffold/.agent/skills/total-recall/plugins/ssss/package.json +2 -1
  325. package/scaffold/.agent/skills/total-recall/plugins/ssss/plugin.json +5 -3
  326. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/conformance.md +26 -0
  327. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/registry.md +37 -0
  328. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/repair.md +42 -0
  329. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/scaffold.md +33 -0
  330. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/status.md +43 -0
  331. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/validate.md +34 -0
  332. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/validation-diagnostics.md +17 -0
  333. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/chunks/workspace-registry-preflight.md +17 -0
  334. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/home.js +348 -0
  335. package/scaffold/.agent/skills/total-recall/references/operations.md +3 -1
  336. package/src/cli/agent.mjs +1 -1
  337. package/src/cli/api.mjs +3 -3
  338. package/src/cli/brief.mjs +3 -0
  339. package/src/cli/command.mjs +41 -2
  340. package/src/cli/config.mjs +16 -0
  341. package/src/cli/connect.mjs +2 -7
  342. package/src/cli/dream.mjs +93 -69
  343. package/src/cli/harness.mjs +4 -4
  344. package/src/cli/help.mjs +1 -1
  345. package/src/cli/init.mjs +0 -25
  346. package/src/cli/lessons.mjs +51 -0
  347. package/src/cli/memory-plugin.mjs +1 -1
  348. package/src/cli/plugin/chunks.mjs +145 -0
  349. package/src/cli/plugin/copies.mjs +64 -14
  350. package/src/cli/plugin/create.mjs +30 -59
  351. package/src/cli/plugin/index.mjs +31 -16
  352. package/src/cli/plugin/install.mjs +10 -15
  353. package/src/cli/plugin/remove.mjs +1 -1
  354. package/src/cli/plugin/search.mjs +2 -2
  355. package/src/cli/preflight.mjs +19 -6
  356. package/src/cli/proposals.mjs +1 -1
  357. package/src/cli/recall.mjs +66 -23
  358. package/src/cli/remember.mjs +3 -14
  359. package/src/cli/server.mjs +18 -0
  360. package/src/cli/setup.mjs +2 -9
  361. package/src/cli/start.mjs +1 -0
  362. package/src/cli/startup.mjs +19 -0
  363. package/src/cli/task.mjs +9 -2
  364. package/src/cli/update.mjs +6 -2
  365. package/src/core/access-ledger.mjs +78 -0
  366. package/src/core/agent-manager.mjs +2 -2
  367. package/src/core/app-deploy/design-tokens.mjs +14 -9
  368. package/src/core/app-deploy/ui-elements.mjs +1 -1
  369. package/src/core/brain-locate.mjs +15 -0
  370. package/src/core/brain-registry.mjs +5 -0
  371. package/src/core/brain-updates.mjs +35 -11
  372. package/src/core/claude-hooks.mjs +3 -1
  373. package/src/core/cleanup-task.mjs +15 -0
  374. package/src/core/cli-commands.mjs +2 -0
  375. package/src/core/cli-maintenance.mjs +4 -1
  376. package/src/core/cli-semantic-index.mjs +23 -3
  377. package/src/core/context-compiler.mjs +20 -0
  378. package/src/core/daemon-control.mjs +5 -1
  379. package/src/core/daemon-loop.mjs +39 -62
  380. package/src/core/dashboard-bundle.mjs +261 -0
  381. package/src/core/default-plugins.mjs +1 -1
  382. package/src/core/dream.mjs +33 -105
  383. package/src/core/ensure-dependencies.mjs +152 -0
  384. package/src/core/fast-recall.mjs +2 -2
  385. package/src/core/field-evaluation.mjs +23 -0
  386. package/src/core/gate-mode.mjs +1 -1
  387. package/src/core/harness-hooks.mjs +14 -2
  388. package/src/core/lesson-hooks.mjs +74 -0
  389. package/src/core/lesson-memory.mjs +24 -0
  390. package/src/core/lesson-sessions.mjs +52 -0
  391. package/src/core/lessons.mjs +96 -0
  392. package/src/core/memory-brain.mjs +30 -8
  393. package/src/core/meta-harness.mjs +2 -2
  394. package/src/core/optimizer.mjs +66 -165
  395. package/src/core/plugin-activation.mjs +63 -20
  396. package/src/core/plugin-contracts/{card.mjs → manifest.mjs} +26 -57
  397. package/src/core/plugin-contracts/startup-check.mjs +49 -0
  398. package/src/core/plugin-contracts/ui.mjs +9 -3
  399. package/src/core/plugin-distribution.mjs +6 -6
  400. package/src/core/plugin-lifecycle.mjs +58 -0
  401. package/src/core/plugin-loader.mjs +21 -8
  402. package/src/core/plugin-runner.mjs +21 -10
  403. package/src/core/plugin-runtime.mjs +40 -1
  404. package/src/core/plugin-startup-checks.mjs +44 -0
  405. package/src/core/plugin-state.mjs +19 -5
  406. package/src/core/plugin-store.mjs +64 -33
  407. package/src/core/post-mortem.mjs +52 -36
  408. package/src/core/preflight-gate.mjs +23 -2
  409. package/src/core/project-id.mjs +15 -5
  410. package/src/core/proposal-applier.mjs +31 -2
  411. package/src/core/repo-sync.mjs +4 -6
  412. package/src/core/required-plugins.mjs +57 -10
  413. package/src/core/rule-length.mjs +23 -0
  414. package/src/core/runtime.mjs +1 -1
  415. package/src/core/scheduler.mjs +35 -43
  416. package/src/core/schema.mjs +3 -2
  417. package/src/core/search.mjs +4 -3
  418. package/src/core/server-service.mjs +148 -0
  419. package/src/core/session-watcher.mjs +19 -1
  420. package/src/core/skill-gap.mjs +16 -0
  421. package/src/core/ssss-kernel-bridge.mjs +32 -4
  422. package/src/core/ssss-operation-service.mjs +1 -0
  423. package/src/core/startup-health.mjs +34 -4
  424. package/src/core/surface.mjs +65 -54
  425. package/src/core/task-executors.mjs +54 -106
  426. package/src/core/testing/plugin-fixture.mjs +22 -21
  427. package/src/core/throttled-fetch.mjs +25 -18
  428. package/src/core/ui-chunk-choice.mjs +77 -0
  429. package/src/core/ui-chunk.registry.json +23 -0
  430. package/src/core/ui-chunks.mjs +434 -0
  431. package/src/core/validated-write.mjs +1 -0
  432. package/src/core/vault-cache.mjs +58 -59
  433. package/src/core/vector-field.mjs +134 -192
  434. package/src/core/workspace-compositions.mjs +151 -0
  435. package/src/core/workspace-drawers.mjs +79 -0
  436. package/src/server/api.mjs +4 -27
  437. package/src/server/index.mjs +28 -21
  438. package/src/server/invoke-core-child.mjs +24 -0
  439. package/src/server/invoke-core-operations.mjs +102 -0
  440. package/src/server/memory-events.mjs +31 -0
  441. package/src/server/plugin-brain-targets.mjs +89 -0
  442. package/src/server/rest.mjs +2 -0
  443. package/src/server/route-inventory.mjs +3 -2
  444. package/src/server/route-manifest.json +47 -55
  445. package/src/server/routes/_shared.mjs +7 -14
  446. package/src/server/routes/brains.mjs +29 -62
  447. package/src/server/routes/context.mjs +0 -41
  448. package/src/server/routes/dashboard.mjs +26 -0
  449. package/src/server/routes/invoke.mjs +26 -1
  450. package/src/server/routes/plugins.mjs +154 -45
  451. package/src/server/routes/ssss.mjs +0 -169
  452. package/src/server/routes/system.mjs +0 -15
  453. package/src/server/routes/tasks.mjs +0 -26
  454. package/src/server/routes/ui-chunks.mjs +192 -0
  455. package/src/server/routes/vault.mjs +2 -23
  456. package/frontend/dist/assets/index-DD4qONvH.js +0 -5607
  457. package/frontend/dist/assets/index-DtwsDyFM.css +0 -1
  458. package/frontend/src/components/plugins/card/CardEngine.tsx +0 -108
  459. package/frontend/src/components/plugins/card/CardScenes.tsx +0 -103
  460. package/frontend/src/components/plugins/card/ExecutionPicker.tsx +0 -64
  461. package/frontend/src/components/plugins/card/args.ts +0 -28
  462. package/frontend/src/components/plugins/card/card.css +0 -32
  463. package/frontend/src/components/plugins/card/cli-line.ts +0 -13
  464. package/frontend/src/components/plugins/card/contract.ts +0 -91
  465. package/frontend/src/components/plugins/card/format.ts +0 -49
  466. package/frontend/src/components/plugins/card/runner-context.ts +0 -11
  467. package/frontend/src/components/plugins/card/runner.tsx +0 -43
  468. package/frontend/src/components/plugins/card/theme.ts +0 -35
  469. package/frontend/src/components/plugins/card/use-source.ts +0 -22
  470. package/frontend/src/components/plugins/card/widgets.tsx +0 -94
  471. package/frontend/src/components/plugins/workspace/WorkspaceHost.tsx +0 -23
  472. package/frontend/src/pages/PluginsPage.tsx +0 -1719
  473. package/scaffold/.agent/skills/plugin/evals/cases/04-card-collects-credential.mjs +0 -47
  474. package/scaffold/.agent/skills/plugin/prompts/06-card.md +0 -46
  475. package/scaffold/.agent/skills/plugin/references/card.md +0 -90
  476. package/scaffold/.agent/skills/plugin/subagents/card-designer.md +0 -60
  477. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/DESIGN.md +0 -67
  478. package/scaffold/.agent/skills/total-recall/plugins/auth/ui/card.js +0 -1179
  479. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/DESIGN.md +0 -32
  480. package/scaffold/.agent/skills/total-recall/plugins/code-quality/ui/card.js +0 -588
  481. package/scaffold/.agent/skills/total-recall/plugins/composable-cli/ui/card.js +0 -575
  482. package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/DESIGN.md +0 -32
  483. package/scaffold/.agent/skills/total-recall/plugins/embeddings/ui/card.js +0 -482
  484. package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/README.md +0 -53
  485. package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/plugin.json +0 -129
  486. package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/ui/DESIGN.md +0 -100
  487. package/scaffold/.agent/skills/total-recall/plugins/git-sentinel/ui/card.js +0 -637
  488. package/scaffold/.agent/skills/total-recall/plugins/mesh/ui/DESIGN.md +0 -217
  489. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/DESIGN.md +0 -32
  490. package/scaffold/.agent/skills/total-recall/plugins/meta-harness/ui/card.js +0 -1276
  491. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/DESIGN.md +0 -45
  492. package/scaffold/.agent/skills/total-recall/plugins/openwiki/ui/card.js +0 -1401
  493. package/scaffold/.agent/skills/total-recall/plugins/security/scripts/build-ui.mjs +0 -4
  494. package/scaffold/.agent/skills/total-recall/plugins/security/ui/DESIGN.md +0 -41
  495. package/scaffold/.agent/skills/total-recall/plugins/security/ui/card.js +0 -396
  496. package/scaffold/.agent/skills/total-recall/plugins/security/ui/panel.js +0 -98
  497. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/DESIGN.md +0 -15
  498. package/scaffold/.agent/skills/total-recall/plugins/ssss/ui/card.js +0 -182
  499. package/src/core/append-log.mjs +0 -131
  500. package/src/core/plugin-tasks.mjs +0 -173
  501. package/templates/onboarding-interview.md +0 -82
  502. /package/scaffold/.agent/skills/total-recall/plugins/{git-sentinel → git}/LICENSE +0 -0
@@ -1,637 +0,0 @@
1
- /**
2
- * Git Hygiene — repository hygiene.
3
- *
4
- * This face answers one question with a deadline attached: is this repository
5
- * safe to walk away from? So it leads with unpushed commits, then conflicts,
6
- * then the four-way dirty split — ordered by the consequence of ignoring each.
7
- *
8
- * Every value comes from the returned payload. A value the command did not
9
- * supply renders an em dash with its reason; nothing is seeded and nothing is
10
- * defaulted to a reassuring word.
11
- *
12
- * Design rationale: ui/DESIGN.md. Requirements: GITSENTINEL_CARD_BESPOKE_PRD.md.
13
- */
14
-
15
- const DASH = '\u2014';
16
-
17
- /** Upstream states the command distinguishes, and whether each needs action. */
18
- const UPSTREAM_STATES = {
19
- tracking: { label: 'tracking', action: false },
20
- none: { label: 'no upstream', action: false },
21
- gone: { label: 'upstream gone', action: true },
22
- detached: { label: 'detached HEAD', action: false },
23
- unborn: { label: 'no commits yet', action: false },
24
- unknown: { label: 'unresolved', action: true },
25
- error: { label: 'check failed', action: true },
26
- };
27
-
28
- /** The four dirty categories, each with the action it implies. */
29
- const DIRTY_ROWS = [
30
- { key: 'stagedFiles', label: 'staged', action: 'stage and commit' },
31
- { key: 'unstagedFiles', label: 'unstaged', action: 'review and commit' },
32
- { key: 'untrackedFiles', label: 'untracked', action: 'decide whether to track' },
33
- { key: 'conflictedFiles', label: 'conflicted', action: 'resolve before anything else' },
34
- ];
35
-
36
- function escapeHtml(value) {
37
- return String(value).replace(/[&<>"']/g, (c) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
38
- }
39
-
40
- /** A count only when the payload supplied a real number. */
41
- function count(payload, key) {
42
- const value = payload ? payload[key] : undefined;
43
- return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
44
- }
45
-
46
- function text(payload, key) {
47
- const value = payload ? payload[key] : undefined;
48
- return typeof value === 'string' && value ? value : undefined;
49
- }
50
-
51
- function asObject(result) {
52
- if (result === null || result === undefined) return null;
53
- if (typeof result === 'object') {
54
- if (typeof result.output === 'string') {
55
- try { const parsed = JSON.parse(result.output); return typeof parsed === 'object' ? parsed : null; } catch { return null; }
56
- }
57
- return result;
58
- }
59
- if (typeof result === 'string') {
60
- try { const parsed = JSON.parse(result); return typeof parsed === 'object' ? parsed : null; } catch { return null; }
61
- }
62
- return null;
63
- }
64
-
65
- function rawText(result) {
66
- if (result === null || result === undefined) return '';
67
- if (typeof result === 'string') return result;
68
- if (typeof result.output === 'string') return result.output;
69
- try { return JSON.stringify(result, null, 2); } catch { return String(result); }
70
- }
71
-
72
- export class GitSentinelCard extends HTMLElement {
73
- constructor() {
74
- super();
75
- this.state = 'loading';
76
- this.audit = null;
77
- this.auditRaw = '';
78
- this.diff = null;
79
- this.diffRaw = '';
80
- this.lastError = null;
81
- this.lastAttempt = null;
82
- this.busy = false;
83
- this.screen = 'hygiene';
84
- }
85
-
86
- /** Screens this face offers; the host only provides the flipper. */
87
- get screens() {
88
- return [
89
- { id: 'hygiene', label: 'Hygiene' },
90
- { id: 'changes', label: 'Changes' },
91
- { id: 'upstream', label: 'Upstream' },
92
- { id: 'provenance', label: 'Provenance' },
93
- ];
94
- }
95
-
96
- connectedCallback() {
97
- if (!this.shadowRoot) this.attachShadow({ mode: 'open' });
98
- this.render();
99
- this.onScreen = (event) => {
100
- const detail = event.detail || {};
101
- if (detail.pluginId && detail.pluginId !== this.host?.pluginId) return;
102
- if (detail.screen && this.screens.some((s) => s.id === detail.screen)) this.show(detail.screen);
103
- };
104
- window.addEventListener('plugin-show-screen', this.onScreen);
105
- void this.read();
106
- }
107
-
108
- disconnectedCallback() {
109
- if (this.onScreen) window.removeEventListener('plugin-show-screen', this.onScreen);
110
- }
111
-
112
- /* ------------------------------------------------------------------ data */
113
-
114
- async call(subcommand, args) {
115
- if (!this.host || typeof this.host.run !== 'function') {
116
- throw new Error('The host did not provide a command runner, so the repository cannot be inspected.');
117
- }
118
- return this.host.run(subcommand, args);
119
- }
120
-
121
- /** Read the repository state. A failure clears every figure rather than keeping one. */
122
- async read() {
123
- if (this.busy) return;
124
- this.busy = true;
125
- this.lastAttempt = new Date();
126
- this.paintControls();
127
- try {
128
- const returned = await this.call('audit', ['--json']);
129
- const payload = asObject(returned);
130
- if (!payload || typeof payload !== 'object') throw new Error('The audit command did not return a readable payload.');
131
- this.audit = payload;
132
- this.auditRaw = rawText(returned);
133
- this.lastError = null;
134
- this.state = Array.isArray(payload.errors) && payload.errors.length ? 'partial' : 'ok';
135
- } catch (err) {
136
- // No previous reading is retained: an unread repository is not a clean one.
137
- this.audit = null;
138
- this.auditRaw = '';
139
- this.lastError = err && err.message ? err.message : String(err);
140
- this.state = 'error';
141
- } finally {
142
- this.busy = false;
143
- this.paintHygiene();
144
- this.paintUpstream();
145
- this.paintProvenance();
146
- this.paintControls();
147
- }
148
- }
149
-
150
- async readDiff() {
151
- try {
152
- const returned = await this.call('diff', ['--json']);
153
- this.diff = asObject(returned);
154
- this.diffRaw = rawText(returned);
155
- } catch (err) {
156
- this.diff = null;
157
- this.diffRaw = err && err.message ? err.message : String(err);
158
- }
159
- this.paintChanges();
160
- }
161
-
162
- /* ----------------------------------------------------------------- events */
163
-
164
- show(id) {
165
- this.screen = id;
166
- this.shadowRoot.querySelectorAll('[data-screen]').forEach((el) => { el.hidden = el.dataset.screen !== id; });
167
- this.shadowRoot.querySelectorAll('[data-tab]').forEach((el) => el.setAttribute('aria-selected', el.dataset.tab === id ? 'true' : 'false'));
168
- if (id === 'changes' && !this.diff) void this.readDiff();
169
- }
170
-
171
- /* ---------------------------------------------------------------- verdict */
172
-
173
- /**
174
- * The verdict, computed only from returned values and in priority order.
175
- * The unknowable case is stated rather than implied to be clean.
176
- */
177
- verdict() {
178
- if (this.state === 'error') return { tone: 'danger', text: 'Cannot verify — the repository audit failed.' };
179
- const a = this.audit;
180
- if (!a) return { tone: 'neutral', text: 'Reading the repository\u2026' };
181
-
182
- const upstreamState = text(a, 'upstreamStatus');
183
- const errors = Array.isArray(a.errors) ? a.errors : [];
184
- if (upstreamState === 'error' || errors.length) {
185
- return { tone: 'warn', text: `Partially verified — ${errors.length ? errors.join(', ') : 'the upstream check failed'}.` };
186
- }
187
-
188
- const conflicts = count(a, 'conflictedFiles');
189
- if (conflicts) return { tone: 'danger', text: `${conflicts} conflict${conflicts === 1 ? '' : 's'} open — resolve before anything else.` };
190
-
191
- const unpushed = count(a, 'unpushedCommits');
192
- if (unpushed) return { tone: 'danger', text: `${unpushed} commit${unpushed === 1 ? '' : 's'} unpushed.` };
193
-
194
- if (upstreamState === 'gone') return { tone: 'danger', text: 'The upstream branch is gone — re-point it or push a new one.' };
195
- if (upstreamState === 'none' || upstreamState === 'detached' || upstreamState === 'unborn') {
196
- return { tone: 'warn', text: `Cannot tell whether work is pushed — ${UPSTREAM_STATES[upstreamState]?.label || upstreamState}.` };
197
- }
198
- if (upstreamState !== 'tracking') {
199
- return { tone: 'warn', text: 'Cannot tell whether work is pushed — the upstream could not be resolved.' };
200
- }
201
-
202
- const dirty = count(a, 'totalDirty');
203
- if (dirty) return { tone: 'warn', text: `Dirty worktree — ${dirty} file${dirty === 1 ? '' : 's'} not committed.` };
204
-
205
- const stashes = count(a, 'stashCount');
206
- if (stashes) return { tone: 'warn', text: `Clean and pushed, with ${stashes} stash${stashes === 1 ? '' : 'es'} parked.` };
207
- if (dirty === undefined) return { tone: 'neutral', text: 'Cannot confirm the worktree is clean.' };
208
- return { tone: 'ok', text: 'Safe to leave — everything is pushed and the worktree is clean.' };
209
- }
210
-
211
- /* ------------------------------------------------------------------ paint */
212
-
213
- paintHygiene() {
214
- const root = this.shadowRoot;
215
- if (!root) return;
216
- const a = this.audit;
217
- const v = this.verdict();
218
-
219
- const verdictEl = root.querySelector('#verdict');
220
- if (verdictEl) {
221
- verdictEl.textContent = v.text;
222
- verdictEl.dataset.tone = v.tone;
223
- }
224
-
225
- // Primary figure: unpushed commits. Unknowable is explained, never zeroed.
226
- const unpushed = count(a, 'unpushedCommits');
227
- const upstreamState = text(a, 'upstreamStatus');
228
- // The accent border lives on the figure wrapper, so the tone goes on both.
229
- const setTone = (figureId, numEl, tone) => {
230
- if (numEl) numEl.dataset.tone = tone;
231
- const wrap = root.querySelector(figureId);
232
- if (wrap) wrap.dataset.tone = tone;
233
- };
234
-
235
- const unpushedEl = root.querySelector('#unpushed');
236
- if (unpushedEl) unpushedEl.textContent = unpushed === undefined ? DASH : String(unpushed);
237
- setTone('#fig-unpushed', unpushedEl, unpushed === undefined ? 'neutral' : (unpushed > 0 ? 'danger' : 'ok'));
238
- const unpushedNote = root.querySelector('#unpushed-note');
239
- if (unpushedNote) {
240
- unpushedNote.textContent = unpushed === undefined
241
- ? `unknown \u00b7 ${UPSTREAM_STATES[upstreamState]?.label || 'no comparison available'}`
242
- : (unpushed > 0 ? 'not yet on the upstream' : 'nothing waiting to push');
243
- }
244
-
245
- const conflicts = count(a, 'conflictedFiles');
246
- const conflictsEl = root.querySelector('#conflicts');
247
- if (conflictsEl) conflictsEl.textContent = conflicts === undefined ? DASH : String(conflicts);
248
- setTone('#fig-conflicts', conflictsEl, conflicts === undefined ? 'neutral' : (conflicts > 0 ? 'danger' : 'ok'));
249
- const conflictsNote = root.querySelector('#conflicts-note');
250
- if (conflictsNote) conflictsNote.textContent = conflicts ? 'merge in progress' : (conflicts === 0 ? 'none open' : 'unknown');
251
-
252
- const dirty = count(a, 'totalDirty');
253
- const dirtyEl = root.querySelector('#dirty');
254
- if (dirtyEl) dirtyEl.textContent = dirty === undefined ? DASH : String(dirty);
255
- setTone('#fig-dirty', dirtyEl, dirty === undefined ? 'neutral' : (dirty > 0 ? 'warn' : 'ok'));
256
- const dirtyNote = root.querySelector('#dirty-note');
257
- if (dirtyNote) {
258
- if (dirty === undefined) dirtyNote.textContent = 'unknown';
259
- else {
260
- const parts = DIRTY_ROWS.map((r) => count(a, r.key) ?? 0);
261
- // Compact abbreviations: the full words wrap inside a figure tile, and
262
- // the four-way breakdown is already labelled in full below.
263
- dirtyNote.textContent = `${parts[0]} stg \u00b7 ${parts[1]} unstg \u00b7 ${parts[2]} untr \u00b7 ${parts[3]} conf`;
264
- }
265
- }
266
-
267
- const stashes = count(a, 'stashCount');
268
- const stashEl = root.querySelector('#stashes');
269
- if (stashEl) {
270
- stashEl.textContent = stashes === undefined ? DASH : String(stashes);
271
- }
272
- setTone('#fig-stashes', stashEl, stashes === undefined ? 'neutral' : (stashes > 0 ? 'warn' : 'ok'));
273
- const stashNote = root.querySelector('#stashes-note');
274
- if (stashNote) stashNote.textContent = stashes ? 'parked work' : (stashes === 0 ? 'nothing parked' : 'unknown');
275
-
276
- // The four-way breakdown, each row stating the action it implies.
277
- const rows = root.querySelector('#dirty-rows');
278
- if (rows) {
279
- rows.innerHTML = DIRTY_ROWS.map((r) => {
280
- const value = count(a, r.key);
281
- const tone = value === undefined ? 'neutral' : (value > 0 ? (r.key === 'conflictedFiles' ? 'danger' : 'warn') : 'neutral');
282
- return `<div class="dirty-row">
283
- <span class="dirty-label">${r.label}</span>
284
- <span class="dirty-count" data-tone="${tone}">${value === undefined ? DASH : value}</span>
285
- <span class="dirty-action">${escapeHtml(r.action)}</span>
286
- </div>`;
287
- }).join('');
288
- }
289
-
290
- const last = root.querySelector('#last-commit');
291
- if (last) last.textContent = text(a, 'lastCommit') || DASH;
292
-
293
- // Placement <-> Upstream screen: the branch is shown in the header too.
294
- const branchHead = root.querySelector('#up-branch-head');
295
- if (branchHead) {
296
- const branch = text(a, 'branch');
297
- const upstream = text(a, 'upstream');
298
- const info = UPSTREAM_STATES[upstreamState];
299
- branchHead.textContent = branch
300
- ? `${branch}${upstream ? ` \u2192 ${upstream}` : ''}${info ? ` \u00b7 ${info.label}` : ''}`
301
- : DASH;
302
- }
303
-
304
- const side = (selector, value) => { const el = root.querySelector(selector); if (el) el.textContent = value; };
305
- side('#up-branch-side', text(a, 'branch') || DASH);
306
- side('#up-name-side', text(a, 'upstream') || DASH);
307
- const aheadSide = count(a, 'unpushedCommits');
308
- const behindSide = count(a, 'behindCommits');
309
- side('#up-ahead-side', aheadSide === undefined ? DASH : String(aheadSide));
310
- side('#up-behind-side', behindSide === undefined ? DASH : String(behindSide));
311
-
312
- const errEl = root.querySelector('#errors');
313
- if (errEl) {
314
- const errors = a && Array.isArray(a.errors) ? a.errors : [];
315
- const failed = this.state === 'error';
316
- errEl.hidden = !failed && errors.length === 0;
317
- errEl.textContent = failed
318
- ? `${this.lastError || 'The audit failed.'} Last attempt ${this.lastAttempt ? this.lastAttempt.toLocaleTimeString() : DASH}.`
319
- : (errors.length ? `The command reported these failed checks: ${errors.join(', ')}. Figures below may be incomplete.` : '');
320
- }
321
- }
322
-
323
- paintChanges() {
324
- const root = this.shadowRoot;
325
- if (!root) return;
326
- const stat = root.querySelector('#diff-stat');
327
- const raw = root.querySelector('#diff-raw');
328
- const note = root.querySelector('#diff-note');
329
- const dirty = count(this.audit, 'unstagedFiles');
330
- if (note) {
331
- note.textContent = this.audit
332
- ? (dirty === undefined ? 'The unstaged count is unknown.'
333
- : dirty === 0 ? 'Nothing unstaged to show.' : `${dirty} unstaged file${dirty === 1 ? '' : 's'} changed.`)
334
- : 'Read the repository on the Hygiene screen first.';
335
- }
336
- const diffStat = this.diff && typeof this.diff.diffStat === 'string' ? this.diff.diffStat : '';
337
- if (stat) stat.textContent = diffStat || (this.diffRaw ? '' : 'No diffstat yet.');
338
- if (raw) raw.textContent = this.diffRaw || '';
339
- }
340
-
341
- paintUpstream() {
342
- const root = this.shadowRoot;
343
- if (!root) return;
344
- const a = this.audit;
345
- const state = text(a, 'upstreamStatus');
346
- const info = UPSTREAM_STATES[state];
347
-
348
- const set = (selector, value, tone) => {
349
- const el = root.querySelector(selector);
350
- if (!el) return;
351
- el.textContent = value;
352
- if (tone) el.dataset.tone = tone; else delete el.dataset.tone;
353
- };
354
-
355
- set('#up-branch', text(a, 'branch') || DASH);
356
- set('#up-head', text(a, 'headState') || DASH);
357
- set('#up-name', text(a, 'upstream') || DASH);
358
- set('#up-state', info ? info.label : (state || DASH), info ? (info.action ? 'danger' : 'neutral') : 'neutral');
359
-
360
- const ahead = count(a, 'unpushedCommits');
361
- const behind = count(a, 'behindCommits');
362
- set('#up-ahead', ahead === undefined ? DASH : String(ahead), ahead ? 'danger' : (ahead === 0 ? 'ok' : 'neutral'));
363
- set('#up-behind', behind === undefined ? DASH : String(behind));
364
- set('#up-last', text(a, 'lastCommit') || DASH);
365
-
366
- const note = root.querySelector('#up-note');
367
- if (note) {
368
- note.textContent = !a ? 'No reading yet.'
369
- : state === 'tracking' ? 'Ahead and behind are counted against the upstream branch.'
370
- : info?.action ? 'This state needs attention before the ahead and behind counts mean anything.'
371
- : 'This is a fact about the repository, not a failure.';
372
- }
373
-
374
- const errEl = root.querySelector('#up-errors');
375
- if (errEl) {
376
- const errors = a && Array.isArray(a.errors) ? a.errors : [];
377
- errEl.hidden = errors.length === 0;
378
- errEl.textContent = errors.length ? `Failed checks: ${errors.join(', ')}` : '';
379
- }
380
- }
381
-
382
- paintProvenance() {
383
- const root = this.shadowRoot;
384
- const out = root?.querySelector('#prov-audit');
385
- if (out) out.textContent = this.auditRaw || 'No audit reading yet.';
386
- const diff = root?.querySelector('#prov-diff');
387
- if (diff) diff.textContent = this.diffRaw || 'No diff reading yet.';
388
- }
389
-
390
- paintControls() {
391
- const root = this.shadowRoot;
392
- if (!root) return;
393
- const badge = root.querySelector('#read-state');
394
- if (badge) {
395
- const labels = { loading: 'Reading', ok: 'Verified', partial: 'Partial', error: 'Failed' };
396
- badge.textContent = labels[this.state] || 'Reading';
397
- badge.dataset.state = this.state;
398
- }
399
- const again = root.querySelector('#reread');
400
- if (again) again.disabled = this.busy;
401
- }
402
-
403
- /* ----------------------------------------------------------------- render */
404
-
405
- render() {
406
- this.shadowRoot.innerHTML = `
407
- <style>
408
- :host {
409
- display: block; width: 100%; min-width: 0;
410
- --face-ok: #047857;
411
- --face-warn: #b45309;
412
- --face-danger: #b91c1c;
413
- --face-text-default: #111827;
414
- --face-muted-default: #6b7280;
415
- --face-line-default: #e5e7eb;
416
- --face-surface-default: #f9fafb;
417
- --face-accent-default: #b45309;
418
- --face-dark-ok: #34d399;
419
- --face-dark-warn: #fbbf24;
420
- --face-dark-danger: #f87171;
421
- --face-dark-text: #e8eaf0;
422
- --face-dark-muted: #a2a8b8;
423
- --face-dark-line: #2a3040;
424
- --face-dark-surface: #171a23;
425
- --face-radius: 6px;
426
- --face-motion: 140ms ease-out;
427
- --face-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
428
- --face-text: var(--text-primary, var(--face-text-default));
429
- --face-muted: var(--text-secondary, var(--face-muted-default));
430
- --face-line: var(--border, var(--face-line-default));
431
- --face-surface: var(--bg-secondary, var(--face-surface-default));
432
- --face-accent: var(--card-color, var(--face-accent-default));
433
- font-family: 'Space Grotesk', var(--font-sans, system-ui, sans-serif);
434
- color: var(--face-text);
435
- }
436
- /* The light state colours are unreadable on a dark surface, including the
437
- verdict line, so they are retuned whenever the host is dark. */
438
- @media (prefers-color-scheme: dark) {
439
- :host {
440
- --face-ok: var(--face-dark-ok);
441
- --face-warn: var(--face-dark-warn);
442
- --face-danger: var(--face-dark-danger);
443
- --face-text: var(--text-primary, var(--face-dark-text));
444
- --face-muted: var(--text-secondary, var(--face-dark-muted));
445
- --face-line: var(--border, var(--face-dark-line));
446
- --face-surface: var(--bg-secondary, var(--face-dark-surface));
447
- }
448
- }
449
- :host-context([data-theme="dark"]),
450
- :host-context(.theme-dark),
451
- :host-context(.dark) {
452
- --face-ok: var(--face-dark-ok);
453
- --face-warn: var(--face-dark-warn);
454
- --face-danger: var(--face-dark-danger);
455
- --face-text: var(--text-primary, var(--face-dark-text));
456
- --face-muted: var(--text-secondary, var(--face-dark-muted));
457
- --face-line: var(--border, var(--face-dark-line));
458
- --face-surface: var(--bg-secondary, var(--face-dark-surface));
459
- }
460
- * { box-sizing: border-box; }
461
- .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
462
- .ident { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
463
- .ident h2 { margin: 0; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
464
- .ident .where { font-family: var(--face-mono); font-size: 12px; color: var(--face-muted); overflow-wrap: anywhere; }
465
- #read-state { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--face-line); color: var(--face-muted); }
466
- #read-state[data-state="ok"] { color: var(--face-ok); border-color: color-mix(in srgb, var(--face-ok) 35%, transparent); }
467
- #read-state[data-state="partial"] { color: var(--face-warn); border-color: color-mix(in srgb, var(--face-warn) 35%, transparent); }
468
- #read-state[data-state="error"] { color: var(--face-danger); border-color: color-mix(in srgb, var(--face-danger) 35%, transparent); }
469
- .controls { display: flex; gap: 8px; flex-wrap: wrap; }
470
- button { min-height: 44px; padding: 8px 14px; font: inherit; font-size: 12px; font-weight: 600; border-radius: var(--face-radius); cursor: pointer; color: var(--face-text); background: transparent; border: 1px solid var(--face-line); transition: border-color var(--face-motion); }
471
- button:hover { border-color: var(--face-accent); }
472
- button:focus-visible { outline: 2px solid var(--face-accent); outline-offset: 1px; }
473
- button[disabled] { opacity: 0.5; cursor: not-allowed; }
474
- .tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--face-line); margin-bottom: 14px; overflow-x: auto; }
475
- .tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--face-muted); white-space: nowrap; }
476
- .tabs button[aria-selected="true"] { color: var(--face-text); border-bottom-color: var(--face-accent); }
477
- #verdict { font-size: 15px; font-weight: 700; margin: 0 0 16px; }
478
- #verdict[data-tone="ok"] { color: var(--face-ok); }
479
- #verdict[data-tone="warn"] { color: var(--face-warn); }
480
- #verdict[data-tone="danger"] { color: var(--face-danger); }
481
- #verdict[data-tone="neutral"] { color: var(--face-muted); }
482
- .figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }
483
- .figure { border: 1px solid var(--face-line); border-left: 3px solid var(--face-line); border-radius: var(--face-radius); padding: 12px; background: var(--face-surface); min-width: 0; }
484
- .figure[data-tone="ok"] { border-left-color: var(--face-ok); }
485
- .figure[data-tone="warn"] { border-left-color: var(--face-warn); }
486
- .figure[data-tone="danger"] { border-left-color: var(--face-danger); }
487
- .figure dt { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--face-muted); margin: 0 0 6px; }
488
- .figure dd { margin: 0; }
489
- .figure .num { font-family: var(--face-mono); font-size: 38px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
490
- .num[data-tone="ok"] { color: var(--face-ok); }
491
- .num[data-tone="warn"] { color: var(--face-warn); }
492
- .num[data-tone="danger"] { color: var(--face-danger); }
493
- .num[data-tone="neutral"] { color: var(--face-muted); }
494
- .figure .note { font-size: 11px; color: var(--face-muted); margin-top: 6px; font-family: var(--face-mono); overflow-wrap: anywhere; line-height: 1.5; }
495
- .lower { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-top: 18px; }
496
- @media (max-width: 760px) { .lower { grid-template-columns: 1fr; } }
497
- h3 { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--face-muted); margin: 0 0 10px; }
498
- .dirty-row { display: grid; grid-template-columns: 92px 44px minmax(0, 1fr); align-items: baseline; gap: 10px; padding: 5px 0; border-bottom: 1px solid color-mix(in srgb, var(--face-line) 60%, transparent); }
499
- .dirty-row:last-child { border-bottom: 0; }
500
- .dirty-label { font-size: 12px; }
501
- .dirty-count { font-family: var(--face-mono); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
502
- .dirty-count[data-tone="danger"] { color: var(--face-danger); }
503
- .dirty-count[data-tone="warn"] { color: var(--face-warn); }
504
- .dirty-action { font-size: 11px; color: var(--face-muted); }
505
- .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin: 0; }
506
- /* Two columns read as a block; auto-fit strands the fourth item alone. */
507
- .facts-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
508
- .fact { border-top: 1px solid var(--face-line); padding-top: 8px; min-width: 0; }
509
- .fact dt { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--face-muted); margin: 0 0 3px; }
510
- .fact dd { margin: 0; font-family: var(--face-mono); font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
511
- .fact dd[data-tone="ok"] { color: var(--face-ok); }
512
- .fact dd[data-tone="danger"] { color: var(--face-danger); }
513
- .last-commit { margin-top: 18px; border-top: 1px solid var(--face-line); padding-top: 10px; }
514
- .last-commit p { margin: 0; font-family: var(--face-mono); font-size: 12px; color: var(--face-muted); overflow-wrap: anywhere; }
515
- pre { font-family: var(--face-mono); font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; margin: 6px 0 0; color: var(--face-muted); }
516
- .empty { font-size: 12px; color: var(--face-muted); margin: 0; }
517
- .error { font-size: 12px; color: var(--face-danger); margin: 0 0 14px; }
518
- .warn { font-size: 12px; color: var(--face-warn); margin: 0 0 14px; }
519
- .prose { font-size: 12px; color: var(--face-muted); line-height: 1.6; margin: 0 0 12px; }
520
- @media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
521
- </style>
522
-
523
- <div class="top">
524
- <div class="ident">
525
- <h2>Git Hygiene</h2>
526
- <span class="where" id="up-branch-head">${DASH}</span>
527
- <span id="read-state" data-state="loading">Reading</span>
528
- </div>
529
- <div class="controls"><button type="button" id="reread">Re-read</button></div>
530
- </div>
531
-
532
- <div class="tabs" role="tablist" aria-label="Repository screens">
533
- <button type="button" role="tab" data-tab="hygiene" aria-selected="true">Hygiene</button>
534
- <button type="button" role="tab" data-tab="changes" aria-selected="false">Changes</button>
535
- <button type="button" role="tab" data-tab="upstream" aria-selected="false">Upstream</button>
536
- <button type="button" role="tab" data-tab="provenance" aria-selected="false">Provenance</button>
537
- </div>
538
-
539
- <section data-screen="hygiene">
540
- <p class="error" id="errors" hidden></p>
541
- <p id="verdict" data-tone="neutral">Reading the repository\u2026</p>
542
-
543
- <dl class="figures">
544
- <div class="figure" id="fig-unpushed">
545
- <dt>Unpushed commits</dt>
546
- <dd><span class="num" id="unpushed" data-tone="neutral">${DASH}</span></dd>
547
- <dd class="note" id="unpushed-note">reading</dd>
548
- </div>
549
- <div class="figure" id="fig-conflicts">
550
- <dt>Conflicts</dt>
551
- <dd><span class="num" id="conflicts" data-tone="neutral">${DASH}</span></dd>
552
- <dd class="note" id="conflicts-note">reading</dd>
553
- </div>
554
- <div class="figure" id="fig-dirty">
555
- <dt>Dirty files</dt>
556
- <dd><span class="num" id="dirty" data-tone="neutral">${DASH}</span></dd>
557
- <dd class="note" id="dirty-note">reading</dd>
558
- </div>
559
- <div class="figure" id="fig-stashes">
560
- <dt>Stashes</dt>
561
- <dd><span class="num" id="stashes" data-tone="neutral">${DASH}</span></dd>
562
- <dd class="note" id="stashes-note">reading</dd>
563
- </div>
564
- </dl>
565
-
566
- <div class="lower">
567
- <div>
568
- <h3>Working tree, and what each category asks for</h3>
569
- <div id="dirty-rows"></div>
570
- </div>
571
- <div>
572
- <h3>Upstream</h3>
573
- <dl class="facts facts-side">
574
- <div class="fact"><dt>Branch</dt><dd id="up-branch-side">${DASH}</dd></div>
575
- <div class="fact"><dt>Upstream</dt><dd id="up-name-side">${DASH}</dd></div>
576
- <div class="fact"><dt>Ahead</dt><dd id="up-ahead-side">${DASH}</dd></div>
577
- <div class="fact"><dt>Behind</dt><dd id="up-behind-side">${DASH}</dd></div>
578
- </dl>
579
- </div>
580
- </div>
581
-
582
- <div class="last-commit">
583
- <h3>Last commit</h3>
584
- <p id="last-commit">${DASH}</p>
585
- </div>
586
- </section>
587
-
588
- <section data-screen="changes" hidden>
589
- <p class="prose" id="diff-note"></p>
590
- <h3>Diffstat of unstaged changes</h3>
591
- <pre id="diff-stat"></pre>
592
- <h3 style="margin-top:16px">Raw diff output</h3>
593
- <pre id="diff-raw"></pre>
594
- </section>
595
-
596
- <section data-screen="upstream" hidden>
597
- <p class="prose" id="up-note"></p>
598
- <dl class="facts">
599
- <div class="fact"><dt>Branch</dt><dd id="up-branch">${DASH}</dd></div>
600
- <div class="fact"><dt>HEAD state</dt><dd id="up-head">${DASH}</dd></div>
601
- <div class="fact"><dt>Upstream</dt><dd id="up-name">${DASH}</dd></div>
602
- <div class="fact"><dt>Upstream state</dt><dd id="up-state">${DASH}</dd></div>
603
- <div class="fact"><dt>Ahead</dt><dd id="up-ahead">${DASH}</dd></div>
604
- <div class="fact"><dt>Behind</dt><dd id="up-behind">${DASH}</dd></div>
605
- </dl>
606
- <div class="last-commit"><h3>Last commit</h3><p id="up-last">${DASH}</p></div>
607
- <p class="warn" id="up-errors" hidden></p>
608
- </section>
609
-
610
- <section data-screen="provenance" hidden>
611
- <p class="prose">Every figure on the other screens comes from these two commands. Nothing is inferred.</p>
612
- <h3>audit --json</h3>
613
- <pre id="prov-audit"></pre>
614
- <h3 style="margin-top:16px">diff --json</h3>
615
- <pre id="prov-diff"></pre>
616
- </section>
617
- `;
618
-
619
- const root = this.shadowRoot;
620
- root.querySelector('#reread')?.addEventListener('click', () => void this.read());
621
- root.querySelector('[aria-label="Repository screens"]')?.addEventListener('click', (event) => {
622
- const button = event.target.closest('button[data-tab]');
623
- if (button) this.show(button.dataset.tab);
624
- });
625
-
626
- this.show(this.screen);
627
- this.paintHygiene();
628
- this.paintChanges();
629
- this.paintUpstream();
630
- this.paintProvenance();
631
- this.paintControls();
632
- }
633
- }
634
-
635
- if (!customElements.get('tr-git-sentinel-card')) {
636
- customElements.define('tr-git-sentinel-card', GitSentinelCard);
637
- }