mirror-mind 0.0.1 → 0.32.1

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 (467) hide show
  1. package/.claude/hooks/log-session-end.sh +85 -0
  2. package/.claude/hooks/log-user-prompt.sh +85 -0
  3. package/.claude/hooks/mirror-inject.sh +85 -0
  4. package/.claude/hooks/session-start.sh +85 -0
  5. package/.gemini/hooks/log-assistant.sh +85 -0
  6. package/.gemini/hooks/log-user.sh +85 -0
  7. package/.gemini/hooks/session-end.sh +85 -0
  8. package/.gemini/hooks/session-start.sh +85 -0
  9. package/.pi/extensions/mirror-logger.ts +561 -0
  10. package/.pi/skills/mm-backup/SKILL.md +21 -0
  11. package/.pi/skills/mm-build/SKILL.md +1206 -0
  12. package/.pi/skills/mm-consolidate/SKILL.md +112 -0
  13. package/.pi/skills/mm-consult/SKILL.md +70 -0
  14. package/.pi/skills/mm-conversations/SKILL.md +16 -0
  15. package/.pi/skills/mm-discard/SKILL.md +39 -0
  16. package/.pi/skills/mm-explore/SKILL.md +255 -0
  17. package/.pi/skills/mm-help/SKILL.md +74 -0
  18. package/.pi/skills/mm-identity/SKILL.md +96 -0
  19. package/.pi/skills/mm-journal/SKILL.md +16 -0
  20. package/.pi/skills/mm-journey/SKILL.md +23 -0
  21. package/.pi/skills/mm-journeys/SKILL.md +15 -0
  22. package/.pi/skills/mm-memories/SKILL.md +17 -0
  23. package/.pi/skills/mm-mirror/SKILL.md +98 -0
  24. package/.pi/skills/mm-mute/SKILL.md +18 -0
  25. package/.pi/skills/mm-new/SKILL.md +18 -0
  26. package/.pi/skills/mm-recall/SKILL.md +17 -0
  27. package/.pi/skills/mm-release-notes/SKILL.md +52 -0
  28. package/.pi/skills/mm-seed/SKILL.md +19 -0
  29. package/.pi/skills/mm-shadow/SKILL.md +117 -0
  30. package/.pi/skills/mm-soul/SKILL.md +502 -0
  31. package/.pi/skills/mm-tasks/SKILL.md +24 -0
  32. package/.pi/skills/mm-update/SKILL.md +32 -0
  33. package/.pi/skills/mm-week/SKILL.md +28 -0
  34. package/.pi/skills/mm-welcome/SKILL.md +24 -0
  35. package/AGENTS.md +188 -0
  36. package/README.md +126 -9
  37. package/bin/loader.js +67 -0
  38. package/bin/mirror-hook.js +7 -0
  39. package/bin/mirror.js +7 -0
  40. package/docs/releases/index.md +99 -0
  41. package/docs/releases/pending-cutoffs.md +510 -0
  42. package/docs/releases/v0.10.0.md +123 -0
  43. package/docs/releases/v0.10.1.md +66 -0
  44. package/docs/releases/v0.10.10.md +51 -0
  45. package/docs/releases/v0.10.11.md +39 -0
  46. package/docs/releases/v0.10.12.md +57 -0
  47. package/docs/releases/v0.10.13.md +35 -0
  48. package/docs/releases/v0.10.14.md +42 -0
  49. package/docs/releases/v0.10.15.md +53 -0
  50. package/docs/releases/v0.10.16.md +35 -0
  51. package/docs/releases/v0.10.17.md +43 -0
  52. package/docs/releases/v0.10.2.md +64 -0
  53. package/docs/releases/v0.10.3.md +78 -0
  54. package/docs/releases/v0.10.4.md +42 -0
  55. package/docs/releases/v0.10.5.md +57 -0
  56. package/docs/releases/v0.10.6.md +47 -0
  57. package/docs/releases/v0.10.7.md +53 -0
  58. package/docs/releases/v0.10.8.md +49 -0
  59. package/docs/releases/v0.10.9.md +37 -0
  60. package/docs/releases/v0.11.0.md +86 -0
  61. package/docs/releases/v0.12.0.md +67 -0
  62. package/docs/releases/v0.13.0.md +64 -0
  63. package/docs/releases/v0.14.0.md +68 -0
  64. package/docs/releases/v0.15.0.md +48 -0
  65. package/docs/releases/v0.16.0.md +50 -0
  66. package/docs/releases/v0.16.1.md +55 -0
  67. package/docs/releases/v0.16.2.md +36 -0
  68. package/docs/releases/v0.17.0.md +50 -0
  69. package/docs/releases/v0.17.1.md +58 -0
  70. package/docs/releases/v0.17.2.md +42 -0
  71. package/docs/releases/v0.17.3.md +58 -0
  72. package/docs/releases/v0.18.0.md +84 -0
  73. package/docs/releases/v0.18.1.md +51 -0
  74. package/docs/releases/v0.18.2.md +69 -0
  75. package/docs/releases/v0.19.0.md +85 -0
  76. package/docs/releases/v0.19.1.md +46 -0
  77. package/docs/releases/v0.20.0.md +85 -0
  78. package/docs/releases/v0.21.0.md +61 -0
  79. package/docs/releases/v0.21.1.md +47 -0
  80. package/docs/releases/v0.22.0.md +77 -0
  81. package/docs/releases/v0.22.1.md +42 -0
  82. package/docs/releases/v0.23.0.md +105 -0
  83. package/docs/releases/v0.24.0.md +125 -0
  84. package/docs/releases/v0.25.0.md +107 -0
  85. package/docs/releases/v0.26.0.md +139 -0
  86. package/docs/releases/v0.26.1.md +65 -0
  87. package/docs/releases/v0.26.2.md +43 -0
  88. package/docs/releases/v0.27.0.md +63 -0
  89. package/docs/releases/v0.28.0.md +59 -0
  90. package/docs/releases/v0.29.0.md +61 -0
  91. package/docs/releases/v0.29.1.md +59 -0
  92. package/docs/releases/v0.29.2.md +59 -0
  93. package/docs/releases/v0.29.3.md +93 -0
  94. package/docs/releases/v0.30.0.md +75 -0
  95. package/docs/releases/v0.30.1.md +93 -0
  96. package/docs/releases/v0.30.2.md +66 -0
  97. package/docs/releases/v0.31.0.md +122 -0
  98. package/docs/releases/v0.31.1.md +142 -0
  99. package/docs/releases/v0.31.10.md +118 -0
  100. package/docs/releases/v0.31.11.md +88 -0
  101. package/docs/releases/v0.31.12.md +105 -0
  102. package/docs/releases/v0.31.13.md +99 -0
  103. package/docs/releases/v0.31.14.md +97 -0
  104. package/docs/releases/v0.31.2.md +115 -0
  105. package/docs/releases/v0.31.3.md +142 -0
  106. package/docs/releases/v0.31.4.md +117 -0
  107. package/docs/releases/v0.31.5.md +155 -0
  108. package/docs/releases/v0.31.6.md +132 -0
  109. package/docs/releases/v0.31.7.md +132 -0
  110. package/docs/releases/v0.31.8.md +120 -0
  111. package/docs/releases/v0.31.9.md +120 -0
  112. package/docs/releases/v0.32.0.md +261 -0
  113. package/docs/releases/v0.32.1.md +59 -0
  114. package/docs/releases/v0.8.0.md +118 -0
  115. package/docs/releases/v0.9.0.md +98 -0
  116. package/docs/releases/v0.9.1.md +83 -0
  117. package/package.json +102 -6
  118. package/plugins/mirror-mind/.claude-plugin/plugin.json +13 -0
  119. package/plugins/mirror-mind/hooks/hooks.json +50 -0
  120. package/plugins/mirror-mind/hooks/log-session-end.sh +98 -0
  121. package/plugins/mirror-mind/hooks/log-user-prompt.sh +98 -0
  122. package/plugins/mirror-mind/hooks/mirror-inject.sh +98 -0
  123. package/plugins/mirror-mind/hooks/session-start.sh +98 -0
  124. package/plugins/mirror-mind/mcp/launch.sh +52 -0
  125. package/plugins/mirror-mind/skills/mm-backup/SKILL.md +27 -0
  126. package/plugins/mirror-mind/skills/mm-build/SKILL.md +1206 -0
  127. package/plugins/mirror-mind/skills/mm-consolidate/SKILL.md +112 -0
  128. package/plugins/mirror-mind/skills/mm-consult/SKILL.md +83 -0
  129. package/plugins/mirror-mind/skills/mm-conversations/SKILL.md +17 -0
  130. package/plugins/mirror-mind/skills/mm-discard/SKILL.md +40 -0
  131. package/plugins/mirror-mind/skills/mm-explore/SKILL.md +241 -0
  132. package/plugins/mirror-mind/skills/mm-help/SKILL.md +104 -0
  133. package/plugins/mirror-mind/skills/mm-identity/SKILL.md +96 -0
  134. package/plugins/mirror-mind/skills/mm-journal/SKILL.md +21 -0
  135. package/plugins/mirror-mind/skills/mm-journey/SKILL.md +37 -0
  136. package/plugins/mirror-mind/skills/mm-journeys/SKILL.md +15 -0
  137. package/plugins/mirror-mind/skills/mm-memories/SKILL.md +20 -0
  138. package/plugins/mirror-mind/skills/mm-mirror/SKILL.md +65 -0
  139. package/plugins/mirror-mind/skills/mm-mute/SKILL.md +18 -0
  140. package/plugins/mirror-mind/skills/mm-new/SKILL.md +18 -0
  141. package/plugins/mirror-mind/skills/mm-recall/SKILL.md +17 -0
  142. package/plugins/mirror-mind/skills/mm-release-notes/SKILL.md +31 -0
  143. package/plugins/mirror-mind/skills/mm-seed/SKILL.md +15 -0
  144. package/plugins/mirror-mind/skills/mm-shadow/SKILL.md +117 -0
  145. package/plugins/mirror-mind/skills/mm-soul/SKILL.md +488 -0
  146. package/plugins/mirror-mind/skills/mm-tasks/SKILL.md +36 -0
  147. package/plugins/mirror-mind/skills/mm-update/SKILL.md +30 -0
  148. package/plugins/mirror-mind/skills/mm-week/SKILL.md +46 -0
  149. package/plugins/mirror-mind/skills/mm-welcome/SKILL.md +22 -0
  150. package/scripts/codex-hooks/session-end.sh +85 -0
  151. package/scripts/codex-hooks/session-start.sh +85 -0
  152. package/scripts/codex-mirror.sh +48 -0
  153. package/templates/identity/README.md +119 -0
  154. package/templates/identity/ego/behavior.yaml +52 -0
  155. package/templates/identity/ego/constraints.yaml +15 -0
  156. package/templates/identity/ego/identity.yaml +43 -0
  157. package/templates/identity/journeys/personal-growth.yaml +39 -0
  158. package/templates/identity/organization/identity.yaml +24 -0
  159. package/templates/identity/organization/principles.yaml +17 -0
  160. package/templates/identity/personas/coach.yaml +94 -0
  161. package/templates/identity/personas/designer.yaml +93 -0
  162. package/templates/identity/personas/doctor.yaml +96 -0
  163. package/templates/identity/personas/engineer.yaml +77 -0
  164. package/templates/identity/personas/financial.yaml +97 -0
  165. package/templates/identity/personas/prompt-engineer.yaml +122 -0
  166. package/templates/identity/personas/researcher.yaml +88 -0
  167. package/templates/identity/personas/strategist.yaml +91 -0
  168. package/templates/identity/personas/teacher.yaml +95 -0
  169. package/templates/identity/personas/therapist.yaml +91 -0
  170. package/templates/identity/personas/thinker.yaml +74 -0
  171. package/templates/identity/personas/writer.yaml +76 -0
  172. package/templates/identity/self/config.yaml +16 -0
  173. package/templates/identity/self/soul.yaml +105 -0
  174. package/templates/identity/user/identity.yaml +30 -0
  175. package/ts/src/backup/staging.ts +62 -0
  176. package/ts/src/backup/zipBackup.ts +267 -0
  177. package/ts/src/backup/zipReader.ts +109 -0
  178. package/ts/src/backup/zipWriter.ts +148 -0
  179. package/ts/src/builder/activeCheckpoint.ts +134 -0
  180. package/ts/src/builder/aggregateStatus.ts +34 -0
  181. package/ts/src/builder/approve.ts +149 -0
  182. package/ts/src/builder/argv.ts +292 -0
  183. package/ts/src/builder/ariadMethod.ts +536 -0
  184. package/ts/src/builder/artifacts/artifactSurfaces.ts +106 -0
  185. package/ts/src/builder/artifacts/artifactWriter.ts +113 -0
  186. package/ts/src/builder/artifacts/closureArtifacts.ts +199 -0
  187. package/ts/src/builder/artifacts/deliveryStoryArtifacts.ts +316 -0
  188. package/ts/src/builder/artifacts/planArtifacts.ts +242 -0
  189. package/ts/src/builder/artifacts/scaffoldSections.ts +273 -0
  190. package/ts/src/builder/artifacts/scaffoldState.ts +227 -0
  191. package/ts/src/builder/artifacts/storyFiles.ts +61 -0
  192. package/ts/src/builder/artifacts/storyIndex.ts +166 -0
  193. package/ts/src/builder/cadence.ts +59 -0
  194. package/ts/src/builder/card.ts +192 -0
  195. package/ts/src/builder/checkpointRefused.ts +66 -0
  196. package/ts/src/builder/closure.ts +964 -0
  197. package/ts/src/builder/commands.ts +2053 -0
  198. package/ts/src/builder/cursorPosition.ts +176 -0
  199. package/ts/src/builder/cursorTransitions.ts +77 -0
  200. package/ts/src/builder/deliveryCursor.ts +577 -0
  201. package/ts/src/builder/deliveryStoryClosure.ts +521 -0
  202. package/ts/src/builder/deliveryStoryPlan.ts +536 -0
  203. package/ts/src/builder/deliveryStoryReady.ts +160 -0
  204. package/ts/src/builder/deliveryStoryRoadmapClosure.ts +151 -0
  205. package/ts/src/builder/expand.ts +336 -0
  206. package/ts/src/builder/flowUnit.ts +339 -0
  207. package/ts/src/builder/homeSurface.ts +122 -0
  208. package/ts/src/builder/implementationGuard.ts +125 -0
  209. package/ts/src/builder/index.ts +11 -0
  210. package/ts/src/builder/lifecycleRefusal.ts +92 -0
  211. package/ts/src/builder/lifecycleRibbon.ts +159 -0
  212. package/ts/src/builder/load.ts +313 -0
  213. package/ts/src/builder/methodAdoption.ts +113 -0
  214. package/ts/src/builder/methodDefinition.ts +429 -0
  215. package/ts/src/builder/methodInspection.ts +371 -0
  216. package/ts/src/builder/plan.ts +408 -0
  217. package/ts/src/builder/planPreauthorization.ts +265 -0
  218. package/ts/src/builder/prepare.ts +225 -0
  219. package/ts/src/builder/projectPaths.ts +64 -0
  220. package/ts/src/builder/pull.ts +356 -0
  221. package/ts/src/builder/pullCandidates.ts +463 -0
  222. package/ts/src/builder/pullCandidatesRender.ts +238 -0
  223. package/ts/src/builder/refinementField.ts +93 -0
  224. package/ts/src/builder/releaseIntent.ts +173 -0
  225. package/ts/src/builder/resumeState.ts +84 -0
  226. package/ts/src/builder/resumeSurface.ts +149 -0
  227. package/ts/src/builder/roadmapGrammar.ts +300 -0
  228. package/ts/src/builder/roadmapScan.ts +97 -0
  229. package/ts/src/builder/roadmapScope.ts +210 -0
  230. package/ts/src/builder/scopePhrases.ts +146 -0
  231. package/ts/src/builder/storyPaths.ts +196 -0
  232. package/ts/src/builder/storyPlanPreauthorization.ts +287 -0
  233. package/ts/src/builder/surfaceProtocol.ts +42 -0
  234. package/ts/src/builder/templateGeneration.ts +148 -0
  235. package/ts/src/builder/transition.ts +178 -0
  236. package/ts/src/consult/args.ts +99 -0
  237. package/ts/src/consult/core.ts +122 -0
  238. package/ts/src/consult/modelCatalog.ts +55 -0
  239. package/ts/src/consult/render.ts +47 -0
  240. package/ts/src/conversation/append.ts +414 -0
  241. package/ts/src/conversation/backfill.ts +387 -0
  242. package/ts/src/conversation/closeTail.ts +467 -0
  243. package/ts/src/conversation/extraction.ts +333 -0
  244. package/ts/src/conversation/extractionDriver.ts +130 -0
  245. package/ts/src/conversation/extractionRun.ts +70 -0
  246. package/ts/src/conversation/journeyInference.ts +165 -0
  247. package/ts/src/conversation/journeyRepair.ts +114 -0
  248. package/ts/src/conversation/lifecycleFaces.ts +197 -0
  249. package/ts/src/conversation/lifecycleWrites.ts +313 -0
  250. package/ts/src/conversation/listing.ts +77 -0
  251. package/ts/src/conversation/logger.ts +576 -0
  252. package/ts/src/conversation/loggerCli.ts +282 -0
  253. package/ts/src/conversation/loggerRuntime.ts +259 -0
  254. package/ts/src/conversation/metadataLifecycle.ts +443 -0
  255. package/ts/src/conversation/recall.ts +66 -0
  256. package/ts/src/conversation/sessionComposites.ts +258 -0
  257. package/ts/src/conversation/sessionImport.ts +90 -0
  258. package/ts/src/conversation/transcriptBackfill.ts +141 -0
  259. package/ts/src/cultivation/applyActions.ts +241 -0
  260. package/ts/src/cultivation/cluster.ts +86 -0
  261. package/ts/src/cultivation/consolidationStore.ts +281 -0
  262. package/ts/src/cultivation/promptContext.ts +62 -0
  263. package/ts/src/cultivation/propose.ts +305 -0
  264. package/ts/src/cultivation/scan.ts +155 -0
  265. package/ts/src/db/backupGate.ts +47 -0
  266. package/ts/src/db/bootstrap.ts +108 -0
  267. package/ts/src/db/bootstrapLock.ts +223 -0
  268. package/ts/src/db/copyGuard.ts +60 -0
  269. package/ts/src/db/database.ts +397 -0
  270. package/ts/src/db/decode.ts +66 -0
  271. package/ts/src/db/ftsIntegrity.ts +41 -0
  272. package/ts/src/db/migrateOnOpen.ts +214 -0
  273. package/ts/src/db/migrations.ts +576 -0
  274. package/ts/src/db/readyOnOpen.ts +35 -0
  275. package/ts/src/db/rowDecode.ts +42 -0
  276. package/ts/src/db/schema.ts +432 -0
  277. package/ts/src/db/schemaInventory.ts +225 -0
  278. package/ts/src/db/schemaInventorySnapshot.ts +2107 -0
  279. package/ts/src/db/schemaState.ts +91 -0
  280. package/ts/src/db/schemaTsDivergence.ts +114 -0
  281. package/ts/src/descriptor/descriptorRead.ts +49 -0
  282. package/ts/src/docs/docsLint.ts +265 -0
  283. package/ts/src/explorer/handoff.ts +522 -0
  284. package/ts/src/explorer/render.ts +335 -0
  285. package/ts/src/explorer/story.ts +769 -0
  286. package/ts/src/explorer/transition.ts +72 -0
  287. package/ts/src/extensions/bindings.ts +170 -0
  288. package/ts/src/extensions/catalog.ts +249 -0
  289. package/ts/src/extensions/catalogCommands.ts +513 -0
  290. package/ts/src/extensions/catalogWrites.ts +652 -0
  291. package/ts/src/extensions/contextRuntime.ts +325 -0
  292. package/ts/src/extensions/dispatch.ts +374 -0
  293. package/ts/src/extensions/errors.ts +24 -0
  294. package/ts/src/extensions/manifest.ts +356 -0
  295. package/ts/src/extensions/migrations.ts +350 -0
  296. package/ts/src/extraction/conversation.ts +304 -0
  297. package/ts/src/extraction/conversationMetadata.ts +206 -0
  298. package/ts/src/extraction/fencing.ts +106 -0
  299. package/ts/src/extraction/json.ts +17 -0
  300. package/ts/src/extraction/prompts.ts +470 -0
  301. package/ts/src/frontDoor/args.ts +30 -0
  302. package/ts/src/frontDoor/argvShape.ts +106 -0
  303. package/ts/src/frontDoor/buildLoadRuntime.ts +139 -0
  304. package/ts/src/frontDoor/buildRoute.ts +398 -0
  305. package/ts/src/frontDoor/cli.ts +1865 -0
  306. package/ts/src/frontDoor/cloneRoleGuard.ts +98 -0
  307. package/ts/src/frontDoor/consultRoute.ts +50 -0
  308. package/ts/src/frontDoor/contentTailRoute.ts +239 -0
  309. package/ts/src/frontDoor/conversationLoggerRoute.ts +73 -0
  310. package/ts/src/frontDoor/cultivationRoute.ts +210 -0
  311. package/ts/src/frontDoor/dbPath.ts +131 -0
  312. package/ts/src/frontDoor/dbSafetyToolsRoute.ts +240 -0
  313. package/ts/src/frontDoor/exploreRoute.ts +572 -0
  314. package/ts/src/frontDoor/extensionCatalogRoute.ts +252 -0
  315. package/ts/src/frontDoor/frontDoorLog.ts +57 -0
  316. package/ts/src/frontDoor/identityWrite.ts +36 -0
  317. package/ts/src/frontDoor/journeyWriteRoute.ts +26 -0
  318. package/ts/src/frontDoor/lifecycleWriteRoute.ts +110 -0
  319. package/ts/src/frontDoor/liveBackup.ts +100 -0
  320. package/ts/src/frontDoor/mirrorModeRoute.ts +163 -0
  321. package/ts/src/frontDoor/namedRefusal.ts +35 -0
  322. package/ts/src/frontDoor/nodeSupport.ts +24 -0
  323. package/ts/src/frontDoor/render/consolidate.ts +199 -0
  324. package/ts/src/frontDoor/render/conversations.ts +33 -0
  325. package/ts/src/frontDoor/render/cultivationShared.ts +21 -0
  326. package/ts/src/frontDoor/render/descriptor.ts +20 -0
  327. package/ts/src/frontDoor/render/detectPersona.ts +50 -0
  328. package/ts/src/frontDoor/render/icons.ts +13 -0
  329. package/ts/src/frontDoor/render/identity.ts +59 -0
  330. package/ts/src/frontDoor/render/identityRows.ts +17 -0
  331. package/ts/src/frontDoor/render/inspectPersona.ts +53 -0
  332. package/ts/src/frontDoor/render/journeyStatus.ts +78 -0
  333. package/ts/src/frontDoor/render/journeys.ts +79 -0
  334. package/ts/src/frontDoor/render/list.ts +41 -0
  335. package/ts/src/frontDoor/render/memories.ts +67 -0
  336. package/ts/src/frontDoor/render/recall.ts +49 -0
  337. package/ts/src/frontDoor/render/shadow.ts +155 -0
  338. package/ts/src/frontDoor/render/tasks.ts +99 -0
  339. package/ts/src/frontDoor/render/tasksImportSync.ts +63 -0
  340. package/ts/src/frontDoor/render/week.ts +113 -0
  341. package/ts/src/frontDoor/routing.ts +999 -0
  342. package/ts/src/frontDoor/runtimeRoute.ts +623 -0
  343. package/ts/src/frontDoor/searchRoute.ts +166 -0
  344. package/ts/src/frontDoor/seedPaths.ts +98 -0
  345. package/ts/src/frontDoor/soulRoute.ts +433 -0
  346. package/ts/src/frontDoor/tasksImportSyncRoute.ts +110 -0
  347. package/ts/src/frontDoor/tasksWriteRoute.ts +101 -0
  348. package/ts/src/frontDoor/usage.ts +176 -0
  349. package/ts/src/guards/claudePlugin.ts +252 -0
  350. package/ts/src/guards/packContents.ts +306 -0
  351. package/ts/src/guards/piSourcedSkills.ts +70 -0
  352. package/ts/src/guards/retiredRouteShadows.ts +57 -0
  353. package/ts/src/guards/retiredSurfaces.ts +564 -0
  354. package/ts/src/hooks/claude.ts +176 -0
  355. package/ts/src/hooks/codex.ts +45 -0
  356. package/ts/src/hooks/gemini.ts +126 -0
  357. package/ts/src/hooks/main.ts +109 -0
  358. package/ts/src/hooks/mirrorState.ts +71 -0
  359. package/ts/src/hooks/payload.ts +68 -0
  360. package/ts/src/hooks/runtime.ts +159 -0
  361. package/ts/src/identity/applyConsolidationIdentityUpdate.ts +67 -0
  362. package/ts/src/identity/descriptorGenerate.ts +162 -0
  363. package/ts/src/identity/identityEdit.ts +143 -0
  364. package/ts/src/identity/identityKey.ts +77 -0
  365. package/ts/src/identity/identityRead.ts +69 -0
  366. package/ts/src/identity/identityStore.ts +80 -0
  367. package/ts/src/identity/journeyListing.ts +53 -0
  368. package/ts/src/identity/personaInspect.ts +44 -0
  369. package/ts/src/identity/personaListing.ts +37 -0
  370. package/ts/src/identity/setIdentity.ts +64 -0
  371. package/ts/src/index.ts +231 -0
  372. package/ts/src/init/init.ts +111 -0
  373. package/ts/src/journey/journeyOptions.ts +131 -0
  374. package/ts/src/journey/journeyRemoval.ts +158 -0
  375. package/ts/src/journey/journeyStatus.ts +149 -0
  376. package/ts/src/journey/journeySyncFile.ts +87 -0
  377. package/ts/src/journey/journeyWrite.ts +203 -0
  378. package/ts/src/journey/parentJourney.ts +41 -0
  379. package/ts/src/journey/validateParentJourney.ts +55 -0
  380. package/ts/src/mcp/boundary.ts +151 -0
  381. package/ts/src/mcp/guards.ts +244 -0
  382. package/ts/src/mcp/main.ts +121 -0
  383. package/ts/src/mcp/payload.ts +141 -0
  384. package/ts/src/mcp/protocol.ts +141 -0
  385. package/ts/src/mcp/readModels.ts +241 -0
  386. package/ts/src/mcp/registry.ts +201 -0
  387. package/ts/src/mcp/serve.ts +120 -0
  388. package/ts/src/mcp/tools/deterministic.ts +137 -0
  389. package/ts/src/mcp/tools/providerCrossing.ts +187 -0
  390. package/ts/src/mcp/wire.ts +8 -0
  391. package/ts/src/memory/journal.ts +180 -0
  392. package/ts/src/memory/listing.ts +107 -0
  393. package/ts/src/memory/memoryWrite.ts +88 -0
  394. package/ts/src/memory/reinforcement.ts +35 -0
  395. package/ts/src/mirror/context.ts +161 -0
  396. package/ts/src/mirror/defaultResolution.ts +199 -0
  397. package/ts/src/mirror/orchestration.ts +364 -0
  398. package/ts/src/mirror/reception.ts +194 -0
  399. package/ts/src/mirror/render.ts +75 -0
  400. package/ts/src/mirror/runtimeSession.ts +205 -0
  401. package/ts/src/mode/operatingMode.ts +148 -0
  402. package/ts/src/observability/callOutcome.ts +115 -0
  403. package/ts/src/observability/inspectLedger.ts +329 -0
  404. package/ts/src/observability/ledgerHooks.ts +126 -0
  405. package/ts/src/observability/llmCalls.ts +154 -0
  406. package/ts/src/persona/detectPersona.ts +81 -0
  407. package/ts/src/planning/promptAssembly.ts +111 -0
  408. package/ts/src/planning/weekPending.ts +81 -0
  409. package/ts/src/planning/weekPlan.ts +183 -0
  410. package/ts/src/planning/weekSave.ts +117 -0
  411. package/ts/src/providers/config.ts +189 -0
  412. package/ts/src/providers/cost.ts +64 -0
  413. package/ts/src/providers/credits.ts +204 -0
  414. package/ts/src/providers/embedding.ts +321 -0
  415. package/ts/src/providers/familyProviders.ts +147 -0
  416. package/ts/src/providers/llm.ts +334 -0
  417. package/ts/src/providers/openrouter.ts +244 -0
  418. package/ts/src/providers/redaction.ts +110 -0
  419. package/ts/src/providers/replay.ts +15 -0
  420. package/ts/src/providers/transport.ts +410 -0
  421. package/ts/src/repair/encodingRepair.ts +253 -0
  422. package/ts/src/runtime/backup.ts +151 -0
  423. package/ts/src/runtime/channel.ts +146 -0
  424. package/ts/src/runtime/config.ts +168 -0
  425. package/ts/src/runtime/diagnose.ts +686 -0
  426. package/ts/src/runtime/git.ts +510 -0
  427. package/ts/src/runtime/installKind.ts +220 -0
  428. package/ts/src/runtime/migrate.ts +154 -0
  429. package/ts/src/runtime/packageIdentity.ts +102 -0
  430. package/ts/src/runtime/releaseNotes.ts +244 -0
  431. package/ts/src/runtime/status.ts +557 -0
  432. package/ts/src/runtime/strategies/clone.ts +200 -0
  433. package/ts/src/runtime/strategies/package.ts +328 -0
  434. package/ts/src/runtime/treeRoot.ts +30 -0
  435. package/ts/src/runtime/update.ts +445 -0
  436. package/ts/src/runtime/updateGate.ts +40 -0
  437. package/ts/src/runtime/updatePipeline.ts +159 -0
  438. package/ts/src/runtime/version.ts +36 -0
  439. package/ts/src/runtime/wiring.ts +130 -0
  440. package/ts/src/search/memorySearch.ts +338 -0
  441. package/ts/src/search/ranker.ts +154 -0
  442. package/ts/src/seed/seed.ts +256 -0
  443. package/ts/src/seed/seedYaml.ts +133 -0
  444. package/ts/src/soul/apply.ts +218 -0
  445. package/ts/src/soul/harvest.ts +267 -0
  446. package/ts/src/soul/prompts/soul_beauty_voice.md +103 -0
  447. package/ts/src/soul/prompts/soul_self_voice.md +219 -0
  448. package/ts/src/soul/prompts/soul_wisdom_voice.md +121 -0
  449. package/ts/src/soul/prompts.ts +85 -0
  450. package/ts/src/soul/render.ts +358 -0
  451. package/ts/src/soul/state.ts +212 -0
  452. package/ts/src/soul/transition.ts +37 -0
  453. package/ts/src/tasks/journeyPathParse.ts +113 -0
  454. package/ts/src/tasks/taskImportSync.ts +142 -0
  455. package/ts/src/tasks/taskStore.ts +312 -0
  456. package/ts/src/tasks/weekView.ts +120 -0
  457. package/ts/src/util/clipCodePoints.ts +26 -0
  458. package/ts/src/util/paths.ts +63 -0
  459. package/ts/src/util/program.ts +9 -0
  460. package/ts/src/util/pyGenerators.ts +144 -0
  461. package/ts/src/util/pythonText.ts +317 -0
  462. package/ts/src/util/semver.ts +45 -0
  463. package/ts/src/util/shellWord.ts +25 -0
  464. package/ts/src/util/slug.ts +64 -0
  465. package/ts/src/welcome/card.ts +339 -0
  466. package/ts/src/welcome/statusLine.ts +101 -0
  467. package/ts/src/welcome/updateCache.ts +129 -0
@@ -0,0 +1,2107 @@
1
+ // Committed schema-inventory snapshot for the TS custody-transfer contract
2
+ // (CV22.DS6.TS1).
3
+ //
4
+ // Recorded from a real fresh database made by the Python core's bootstrap,
5
+ // while that core existed. It was the cross-language oracle: `schema.test.ts`
6
+ // asserts that a TS-created database's inventory (via `buildSchemaInventory` in
7
+ // `schemaInventory.ts`) equals this constant, and a Python drift guard asserted
8
+ // the same from the other side.
9
+ //
10
+ // FROZEN since CV22.DS10.TS5, like the goldens (`test/goldens/README.md`). The
11
+ // Python core and its drift guard are deleted, so nothing can regenerate this
12
+ // file, and TypeScript is the schema's only custodian. A deliberate schema
13
+ // change updates this snapshot -- or the enumerated TypeScript-only additions
14
+ // in `schemaTsDivergence.ts` -- by hand, in the same commit as its migration,
15
+ // with the reason recorded; `schema.test.ts` then proves they agree. The
16
+ // generator is readable at the `cv22-last-python-bearing` tag.
17
+ //
18
+ // Excludes `_migrations` (CV22.DS6.TS2 scope — a TS1 `createSchema()` fresh
19
+ // database does not create it) and FTS5-internal shadow tables (a
20
+ // SQLite-library-version implementation detail — see `schemaInventory.ts`).
21
+
22
+ import type { SchemaInventory } from "./schemaInventory.ts";
23
+
24
+ export const SCHEMA_INVENTORY_SNAPSHOT: SchemaInventory = {
25
+ "indexes": {
26
+ "idx_access_log_memory": {
27
+ "columns": ["memory_id"],
28
+ "sql": "CREATE INDEX idx_access_log_memory ON memory_access_log(memory_id)",
29
+ "table": "memory_access_log",
30
+ "unique": 0
31
+ },
32
+ "idx_attachments_journey": {
33
+ "columns": ["journey_id"],
34
+ "sql": "CREATE INDEX idx_attachments_journey ON attachments(journey_id)",
35
+ "table": "attachments",
36
+ "unique": 0
37
+ },
38
+ "idx_attachments_journey_name": {
39
+ "columns": ["journey_id", "name"],
40
+ "sql": "CREATE UNIQUE INDEX idx_attachments_journey_name ON attachments(journey_id, name)",
41
+ "table": "attachments",
42
+ "unique": 1
43
+ },
44
+ "idx_builder_change_requests_journey_status": {
45
+ "columns": ["journey", "status", "updated_at"],
46
+ "sql":
47
+ "CREATE INDEX idx_builder_change_requests_journey_status ON builder_change_requests(journey, status, updated_at)",
48
+ "table": "builder_change_requests",
49
+ "unique": 0
50
+ },
51
+ "idx_builder_change_requests_story_status": {
52
+ "columns": ["journey", "refinement_story_id", "status", "position", "updated_at"],
53
+ "sql":
54
+ "CREATE INDEX idx_builder_change_requests_story_status ON builder_change_requests(journey, refinement_story_id, status, position, updated_at)",
55
+ "table": "builder_change_requests",
56
+ "unique": 0
57
+ },
58
+ "idx_builder_refinement_stories_journey_status": {
59
+ "columns": ["journey", "status", "position", "updated_at"],
60
+ "sql":
61
+ "CREATE INDEX idx_builder_refinement_stories_journey_status ON builder_refinement_stories(journey, status, position, updated_at)",
62
+ "table": "builder_refinement_stories",
63
+ "unique": 0
64
+ },
65
+ "idx_consolidations_created": {
66
+ "columns": ["created_at"],
67
+ "sql": "CREATE INDEX idx_consolidations_created ON consolidations(created_at)",
68
+ "table": "consolidations",
69
+ "unique": 0
70
+ },
71
+ "idx_consolidations_status": {
72
+ "columns": ["status"],
73
+ "sql": "CREATE INDEX idx_consolidations_status ON consolidations(status)",
74
+ "table": "consolidations",
75
+ "unique": 0
76
+ },
77
+ "idx_exploratory_stories_journey": {
78
+ "columns": ["journey", "updated_at"],
79
+ "sql":
80
+ "CREATE INDEX idx_exploratory_stories_journey ON exploratory_stories(journey, updated_at)",
81
+ "table": "exploratory_stories",
82
+ "unique": 0
83
+ },
84
+ "idx_exploratory_stories_one_active_per_journey": {
85
+ "columns": ["journey"],
86
+ "sql":
87
+ "CREATE UNIQUE INDEX idx_exploratory_stories_one_active_per_journey ON exploratory_stories(journey) WHERE status = 'active'",
88
+ "table": "exploratory_stories",
89
+ "unique": 1
90
+ },
91
+ "idx_exploratory_stories_status": {
92
+ "columns": ["status"],
93
+ "sql": "CREATE INDEX idx_exploratory_stories_status ON exploratory_stories(status)",
94
+ "table": "exploratory_stories",
95
+ "unique": 0
96
+ },
97
+ "idx_ext_bindings_target": {
98
+ "columns": ["target_kind", "target_id"],
99
+ "sql": "CREATE INDEX idx_ext_bindings_target ON _ext_bindings(target_kind, target_id)",
100
+ "table": "_ext_bindings",
101
+ "unique": 0
102
+ },
103
+ "idx_identity_integrations_status": {
104
+ "columns": ["status"],
105
+ "sql": "CREATE INDEX idx_identity_integrations_status ON identity_integrations(status)",
106
+ "table": "identity_integrations",
107
+ "unique": 0
108
+ },
109
+ "idx_identity_integrations_target": {
110
+ "columns": ["layer", "key", "created_at"],
111
+ "sql":
112
+ "CREATE INDEX idx_identity_integrations_target ON identity_integrations(layer, key, created_at)",
113
+ "table": "identity_integrations",
114
+ "unique": 0
115
+ },
116
+ "idx_llm_calls_called_at": {
117
+ "columns": ["called_at"],
118
+ "sql": "CREATE INDEX idx_llm_calls_called_at ON llm_calls(called_at)",
119
+ "table": "llm_calls",
120
+ "unique": 0
121
+ },
122
+ "idx_llm_calls_conversation": {
123
+ "columns": ["conversation_id"],
124
+ "sql": "CREATE INDEX idx_llm_calls_conversation ON llm_calls(conversation_id)",
125
+ "table": "llm_calls",
126
+ "unique": 0
127
+ },
128
+ "idx_llm_calls_role": {
129
+ "columns": ["role"],
130
+ "sql": "CREATE INDEX idx_llm_calls_role ON llm_calls(role)",
131
+ "table": "llm_calls",
132
+ "unique": 0
133
+ },
134
+ "idx_memories_created": {
135
+ "columns": ["created_at"],
136
+ "sql": "CREATE INDEX idx_memories_created ON memories(created_at)",
137
+ "table": "memories",
138
+ "unique": 0
139
+ },
140
+ "idx_memories_journey": {
141
+ "columns": ["journey"],
142
+ "sql": "CREATE INDEX idx_memories_journey ON memories(journey)",
143
+ "table": "memories",
144
+ "unique": 0
145
+ },
146
+ "idx_memories_layer": {
147
+ "columns": ["layer"],
148
+ "sql": "CREATE INDEX idx_memories_layer ON memories(layer)",
149
+ "table": "memories",
150
+ "unique": 0
151
+ },
152
+ "idx_memories_type": {
153
+ "columns": ["memory_type"],
154
+ "sql": "CREATE INDEX idx_memories_type ON memories(memory_type)",
155
+ "table": "memories",
156
+ "unique": 0
157
+ },
158
+ "idx_messages_conversation": {
159
+ "columns": ["conversation_id"],
160
+ "sql": "CREATE INDEX idx_messages_conversation ON messages(conversation_id)",
161
+ "table": "messages",
162
+ "unique": 0
163
+ },
164
+ "idx_operation_run_events_run": {
165
+ "columns": ["run_id", "sequence"],
166
+ "sql": "CREATE INDEX idx_operation_run_events_run ON operation_run_events(run_id, sequence)",
167
+ "table": "operation_run_events",
168
+ "unique": 0
169
+ },
170
+ "idx_operation_runs_operation": {
171
+ "columns": ["operation_id"],
172
+ "sql": "CREATE INDEX idx_operation_runs_operation ON operation_runs(operation_id)",
173
+ "table": "operation_runs",
174
+ "unique": 0
175
+ },
176
+ "idx_operation_runs_started": {
177
+ "columns": ["started_at"],
178
+ "sql": "CREATE INDEX idx_operation_runs_started ON operation_runs(started_at)",
179
+ "table": "operation_runs",
180
+ "unique": 0
181
+ },
182
+ "idx_operation_runs_status": {
183
+ "columns": ["status"],
184
+ "sql": "CREATE INDEX idx_operation_runs_status ON operation_runs(status)",
185
+ "table": "operation_runs",
186
+ "unique": 0
187
+ },
188
+ "idx_runtime_sessions_active": {
189
+ "columns": ["active"],
190
+ "sql": "CREATE INDEX idx_runtime_sessions_active ON runtime_sessions(active)",
191
+ "table": "runtime_sessions",
192
+ "unique": 0
193
+ },
194
+ "idx_runtime_sessions_conversation": {
195
+ "columns": ["conversation_id"],
196
+ "sql": "CREATE INDEX idx_runtime_sessions_conversation ON runtime_sessions(conversation_id)",
197
+ "table": "runtime_sessions",
198
+ "unique": 0
199
+ },
200
+ "idx_tasks_due_date": {
201
+ "columns": ["due_date"],
202
+ "sql": "CREATE INDEX idx_tasks_due_date ON tasks(due_date)",
203
+ "table": "tasks",
204
+ "unique": 0
205
+ },
206
+ "idx_tasks_journey": {
207
+ "columns": ["journey"],
208
+ "sql": "CREATE INDEX idx_tasks_journey ON tasks(journey)",
209
+ "table": "tasks",
210
+ "unique": 0
211
+ },
212
+ "idx_tasks_status": {
213
+ "columns": ["status"],
214
+ "sql": "CREATE INDEX idx_tasks_status ON tasks(status)",
215
+ "table": "tasks",
216
+ "unique": 0
217
+ },
218
+ "sqlite_autoindex__ext_bindings_1": {
219
+ "columns": ["extension_id", "capability_id", "target_kind", "target_id"],
220
+ "sql": null,
221
+ "table": "_ext_bindings",
222
+ "unique": 1
223
+ },
224
+ "sqlite_autoindex__ext_migrations_1": {
225
+ "columns": ["extension_id", "filename"],
226
+ "sql": null,
227
+ "table": "_ext_migrations",
228
+ "unique": 1
229
+ },
230
+ "sqlite_autoindex_attachments_1": {
231
+ "columns": ["id"],
232
+ "sql": null,
233
+ "table": "attachments",
234
+ "unique": 1
235
+ },
236
+ "sqlite_autoindex_builder_change_requests_1": {
237
+ "columns": ["id"],
238
+ "sql": null,
239
+ "table": "builder_change_requests",
240
+ "unique": 1
241
+ },
242
+ "sqlite_autoindex_builder_refinement_cursors_1": {
243
+ "columns": ["journey"],
244
+ "sql": null,
245
+ "table": "builder_refinement_cursors",
246
+ "unique": 1
247
+ },
248
+ "sqlite_autoindex_builder_refinement_stories_1": {
249
+ "columns": ["id"],
250
+ "sql": null,
251
+ "table": "builder_refinement_stories",
252
+ "unique": 1
253
+ },
254
+ "sqlite_autoindex_consolidations_1": {
255
+ "columns": ["id"],
256
+ "sql": null,
257
+ "table": "consolidations",
258
+ "unique": 1
259
+ },
260
+ "sqlite_autoindex_conversation_embeddings_1": {
261
+ "columns": ["conversation_id"],
262
+ "sql": null,
263
+ "table": "conversation_embeddings",
264
+ "unique": 1
265
+ },
266
+ "sqlite_autoindex_conversations_1": {
267
+ "columns": ["id"],
268
+ "sql": null,
269
+ "table": "conversations",
270
+ "unique": 1
271
+ },
272
+ "sqlite_autoindex_exploratory_stories_1": {
273
+ "columns": ["id"],
274
+ "sql": null,
275
+ "table": "exploratory_stories",
276
+ "unique": 1
277
+ },
278
+ "sqlite_autoindex_identity_1": {
279
+ "columns": ["id"],
280
+ "sql": null,
281
+ "table": "identity",
282
+ "unique": 1
283
+ },
284
+ "sqlite_autoindex_identity_2": {
285
+ "columns": ["layer", "key"],
286
+ "sql": null,
287
+ "table": "identity",
288
+ "unique": 1
289
+ },
290
+ "sqlite_autoindex_identity_descriptors_1": {
291
+ "columns": ["layer", "key"],
292
+ "sql": null,
293
+ "table": "identity_descriptors",
294
+ "unique": 1
295
+ },
296
+ "sqlite_autoindex_identity_integrations_1": {
297
+ "columns": ["id"],
298
+ "sql": null,
299
+ "table": "identity_integrations",
300
+ "unique": 1
301
+ },
302
+ "sqlite_autoindex_journey_mutation_receipts_1": {
303
+ "columns": ["request_id"],
304
+ "sql": null,
305
+ "table": "journey_mutation_receipts",
306
+ "unique": 1
307
+ },
308
+ "sqlite_autoindex_llm_calls_1": {
309
+ "columns": ["id"],
310
+ "sql": null,
311
+ "table": "llm_calls",
312
+ "unique": 1
313
+ },
314
+ "sqlite_autoindex_memories_1": {
315
+ "columns": ["id"],
316
+ "sql": null,
317
+ "table": "memories",
318
+ "unique": 1
319
+ },
320
+ "sqlite_autoindex_messages_1": {
321
+ "columns": ["id"],
322
+ "sql": null,
323
+ "table": "messages",
324
+ "unique": 1
325
+ },
326
+ "sqlite_autoindex_operation_run_events_1": {
327
+ "columns": ["id"],
328
+ "sql": null,
329
+ "table": "operation_run_events",
330
+ "unique": 1
331
+ },
332
+ "sqlite_autoindex_operation_runs_1": {
333
+ "columns": ["id"],
334
+ "sql": null,
335
+ "table": "operation_runs",
336
+ "unique": 1
337
+ },
338
+ "sqlite_autoindex_runtime_sessions_1": {
339
+ "columns": ["session_id"],
340
+ "sql": null,
341
+ "table": "runtime_sessions",
342
+ "unique": 1
343
+ },
344
+ "sqlite_autoindex_tasks_1": {
345
+ "columns": ["id"],
346
+ "sql": null,
347
+ "table": "tasks",
348
+ "unique": 1
349
+ },
350
+ "ux_builder_change_requests_journey_display_code": {
351
+ "columns": ["journey", "display_code"],
352
+ "sql":
353
+ "CREATE UNIQUE INDEX ux_builder_change_requests_journey_display_code ON builder_change_requests(journey, display_code)",
354
+ "table": "builder_change_requests",
355
+ "unique": 1
356
+ },
357
+ "ux_builder_refinement_stories_journey_display_code": {
358
+ "columns": ["journey", "display_code"],
359
+ "sql":
360
+ "CREATE UNIQUE INDEX ux_builder_refinement_stories_journey_display_code ON builder_refinement_stories(journey, display_code)",
361
+ "table": "builder_refinement_stories",
362
+ "unique": 1
363
+ }
364
+ },
365
+ "tables": {
366
+ "_ext_bindings": {
367
+ "columns": [
368
+ {
369
+ "dflt_value": null,
370
+ "name": "extension_id",
371
+ "notnull": 1,
372
+ "pk": 1,
373
+ "type": "TEXT"
374
+ },
375
+ {
376
+ "dflt_value": null,
377
+ "name": "capability_id",
378
+ "notnull": 1,
379
+ "pk": 2,
380
+ "type": "TEXT"
381
+ },
382
+ {
383
+ "dflt_value": null,
384
+ "name": "target_kind",
385
+ "notnull": 1,
386
+ "pk": 3,
387
+ "type": "TEXT"
388
+ },
389
+ {
390
+ "dflt_value": null,
391
+ "name": "target_id",
392
+ "notnull": 0,
393
+ "pk": 4,
394
+ "type": "TEXT"
395
+ },
396
+ {
397
+ "dflt_value": null,
398
+ "name": "created_at",
399
+ "notnull": 1,
400
+ "pk": 0,
401
+ "type": "TEXT"
402
+ }
403
+ ],
404
+ "foreign_keys": [],
405
+ "sql":
406
+ "CREATE TABLE _ext_bindings ( extension_id TEXT NOT NULL, capability_id TEXT NOT NULL, target_kind TEXT NOT NULL, target_id TEXT, created_at TEXT NOT NULL, PRIMARY KEY (extension_id, capability_id, target_kind, target_id))"
407
+ },
408
+ "_ext_migrations": {
409
+ "columns": [
410
+ {
411
+ "dflt_value": null,
412
+ "name": "extension_id",
413
+ "notnull": 1,
414
+ "pk": 1,
415
+ "type": "TEXT"
416
+ },
417
+ {
418
+ "dflt_value": null,
419
+ "name": "filename",
420
+ "notnull": 1,
421
+ "pk": 2,
422
+ "type": "TEXT"
423
+ },
424
+ {
425
+ "dflt_value": null,
426
+ "name": "checksum",
427
+ "notnull": 1,
428
+ "pk": 0,
429
+ "type": "TEXT"
430
+ },
431
+ {
432
+ "dflt_value": null,
433
+ "name": "applied_at",
434
+ "notnull": 1,
435
+ "pk": 0,
436
+ "type": "TEXT"
437
+ }
438
+ ],
439
+ "foreign_keys": [],
440
+ "sql":
441
+ "CREATE TABLE _ext_migrations ( extension_id TEXT NOT NULL, filename TEXT NOT NULL, checksum TEXT NOT NULL, applied_at TEXT NOT NULL, PRIMARY KEY (extension_id, filename))"
442
+ },
443
+ "attachments": {
444
+ "columns": [
445
+ {
446
+ "dflt_value": null,
447
+ "name": "id",
448
+ "notnull": 0,
449
+ "pk": 1,
450
+ "type": "TEXT"
451
+ },
452
+ {
453
+ "dflt_value": null,
454
+ "name": "journey_id",
455
+ "notnull": 1,
456
+ "pk": 0,
457
+ "type": "TEXT"
458
+ },
459
+ {
460
+ "dflt_value": null,
461
+ "name": "name",
462
+ "notnull": 1,
463
+ "pk": 0,
464
+ "type": "TEXT"
465
+ },
466
+ {
467
+ "dflt_value": null,
468
+ "name": "description",
469
+ "notnull": 0,
470
+ "pk": 0,
471
+ "type": "TEXT"
472
+ },
473
+ {
474
+ "dflt_value": null,
475
+ "name": "content",
476
+ "notnull": 1,
477
+ "pk": 0,
478
+ "type": "TEXT"
479
+ },
480
+ {
481
+ "dflt_value": "'markdown'",
482
+ "name": "content_type",
483
+ "notnull": 1,
484
+ "pk": 0,
485
+ "type": "TEXT"
486
+ },
487
+ {
488
+ "dflt_value": null,
489
+ "name": "tags",
490
+ "notnull": 0,
491
+ "pk": 0,
492
+ "type": "TEXT"
493
+ },
494
+ {
495
+ "dflt_value": null,
496
+ "name": "embedding",
497
+ "notnull": 0,
498
+ "pk": 0,
499
+ "type": "BLOB"
500
+ },
501
+ {
502
+ "dflt_value": null,
503
+ "name": "created_at",
504
+ "notnull": 1,
505
+ "pk": 0,
506
+ "type": "TEXT"
507
+ },
508
+ {
509
+ "dflt_value": null,
510
+ "name": "updated_at",
511
+ "notnull": 1,
512
+ "pk": 0,
513
+ "type": "TEXT"
514
+ },
515
+ {
516
+ "dflt_value": null,
517
+ "name": "metadata",
518
+ "notnull": 0,
519
+ "pk": 0,
520
+ "type": "TEXT"
521
+ }
522
+ ],
523
+ "foreign_keys": [],
524
+ "sql":
525
+ "CREATE TABLE attachments ( id TEXT PRIMARY KEY, journey_id TEXT NOT NULL, name TEXT NOT NULL, description TEXT, content TEXT NOT NULL, content_type TEXT NOT NULL DEFAULT 'markdown', tags TEXT, embedding BLOB, created_at TEXT NOT NULL, updated_at TEXT NOT NULL, metadata TEXT)"
526
+ },
527
+ "builder_change_requests": {
528
+ "columns": [
529
+ {
530
+ "dflt_value": null,
531
+ "name": "id",
532
+ "notnull": 0,
533
+ "pk": 1,
534
+ "type": "TEXT"
535
+ },
536
+ {
537
+ "dflt_value": null,
538
+ "name": "journey",
539
+ "notnull": 1,
540
+ "pk": 0,
541
+ "type": "TEXT"
542
+ },
543
+ {
544
+ "dflt_value": null,
545
+ "name": "display_code",
546
+ "notnull": 1,
547
+ "pk": 0,
548
+ "type": "TEXT"
549
+ },
550
+ {
551
+ "dflt_value": null,
552
+ "name": "refinement_story_id",
553
+ "notnull": 0,
554
+ "pk": 0,
555
+ "type": "TEXT"
556
+ },
557
+ {
558
+ "dflt_value": null,
559
+ "name": "title",
560
+ "notnull": 1,
561
+ "pk": 0,
562
+ "type": "TEXT"
563
+ },
564
+ {
565
+ "dflt_value": null,
566
+ "name": "body",
567
+ "notnull": 1,
568
+ "pk": 0,
569
+ "type": "TEXT"
570
+ },
571
+ {
572
+ "dflt_value": "'captured'",
573
+ "name": "status",
574
+ "notnull": 1,
575
+ "pk": 0,
576
+ "type": "TEXT"
577
+ },
578
+ {
579
+ "dflt_value": "0",
580
+ "name": "position",
581
+ "notnull": 1,
582
+ "pk": 0,
583
+ "type": "INTEGER"
584
+ },
585
+ {
586
+ "dflt_value": "'manual'",
587
+ "name": "source",
588
+ "notnull": 1,
589
+ "pk": 0,
590
+ "type": "TEXT"
591
+ },
592
+ {
593
+ "dflt_value": null,
594
+ "name": "provenance",
595
+ "notnull": 0,
596
+ "pk": 0,
597
+ "type": "TEXT"
598
+ },
599
+ {
600
+ "dflt_value": null,
601
+ "name": "outcome_notes",
602
+ "notnull": 0,
603
+ "pk": 0,
604
+ "type": "TEXT"
605
+ },
606
+ {
607
+ "dflt_value": null,
608
+ "name": "created_at",
609
+ "notnull": 1,
610
+ "pk": 0,
611
+ "type": "TEXT"
612
+ },
613
+ {
614
+ "dflt_value": null,
615
+ "name": "updated_at",
616
+ "notnull": 1,
617
+ "pk": 0,
618
+ "type": "TEXT"
619
+ },
620
+ {
621
+ "dflt_value": null,
622
+ "name": "completed_at",
623
+ "notnull": 0,
624
+ "pk": 0,
625
+ "type": "TEXT"
626
+ }
627
+ ],
628
+ "foreign_keys": [
629
+ {
630
+ "from": "refinement_story_id",
631
+ "match": "NONE",
632
+ "on_delete": "NO ACTION",
633
+ "on_update": "NO ACTION",
634
+ "table": "builder_refinement_stories",
635
+ "to": "id"
636
+ }
637
+ ],
638
+ "sql":
639
+ "CREATE TABLE builder_change_requests ( id TEXT PRIMARY KEY, journey TEXT NOT NULL, display_code TEXT NOT NULL, refinement_story_id TEXT REFERENCES builder_refinement_stories(id), title TEXT NOT NULL, body TEXT NOT NULL, status TEXT NOT NULL DEFAULT 'captured', position INTEGER NOT NULL DEFAULT 0, source TEXT NOT NULL DEFAULT 'manual', provenance TEXT, outcome_notes TEXT, created_at TEXT NOT NULL, updated_at TEXT NOT NULL, completed_at TEXT, CHECK(status IN ( 'captured', 'planned', 'active', 'implemented', 'validated', 'done', 'parked', 'rejected', 'promoted')))"
640
+ },
641
+ "builder_refinement_cursors": {
642
+ "columns": [
643
+ {
644
+ "dflt_value": null,
645
+ "name": "journey",
646
+ "notnull": 0,
647
+ "pk": 1,
648
+ "type": "TEXT"
649
+ },
650
+ {
651
+ "dflt_value": null,
652
+ "name": "active_refinement_story_id",
653
+ "notnull": 0,
654
+ "pk": 0,
655
+ "type": "TEXT"
656
+ },
657
+ {
658
+ "dflt_value": null,
659
+ "name": "active_change_request_id",
660
+ "notnull": 0,
661
+ "pk": 0,
662
+ "type": "TEXT"
663
+ },
664
+ {
665
+ "dflt_value": null,
666
+ "name": "last_refinement_event",
667
+ "notnull": 0,
668
+ "pk": 0,
669
+ "type": "TEXT"
670
+ },
671
+ {
672
+ "dflt_value": null,
673
+ "name": "updated_at",
674
+ "notnull": 1,
675
+ "pk": 0,
676
+ "type": "TEXT"
677
+ }
678
+ ],
679
+ "foreign_keys": [
680
+ {
681
+ "from": "active_change_request_id",
682
+ "match": "NONE",
683
+ "on_delete": "NO ACTION",
684
+ "on_update": "NO ACTION",
685
+ "table": "builder_change_requests",
686
+ "to": "id"
687
+ },
688
+ {
689
+ "from": "active_refinement_story_id",
690
+ "match": "NONE",
691
+ "on_delete": "NO ACTION",
692
+ "on_update": "NO ACTION",
693
+ "table": "builder_refinement_stories",
694
+ "to": "id"
695
+ }
696
+ ],
697
+ "sql":
698
+ "CREATE TABLE builder_refinement_cursors ( journey TEXT PRIMARY KEY, active_refinement_story_id TEXT REFERENCES builder_refinement_stories(id), active_change_request_id TEXT REFERENCES builder_change_requests(id), last_refinement_event TEXT, updated_at TEXT NOT NULL)"
699
+ },
700
+ "builder_refinement_stories": {
701
+ "columns": [
702
+ {
703
+ "dflt_value": null,
704
+ "name": "id",
705
+ "notnull": 0,
706
+ "pk": 1,
707
+ "type": "TEXT"
708
+ },
709
+ {
710
+ "dflt_value": null,
711
+ "name": "journey",
712
+ "notnull": 1,
713
+ "pk": 0,
714
+ "type": "TEXT"
715
+ },
716
+ {
717
+ "dflt_value": null,
718
+ "name": "display_code",
719
+ "notnull": 1,
720
+ "pk": 0,
721
+ "type": "TEXT"
722
+ },
723
+ {
724
+ "dflt_value": null,
725
+ "name": "title",
726
+ "notnull": 1,
727
+ "pk": 0,
728
+ "type": "TEXT"
729
+ },
730
+ {
731
+ "dflt_value": null,
732
+ "name": "description",
733
+ "notnull": 0,
734
+ "pk": 0,
735
+ "type": "TEXT"
736
+ },
737
+ {
738
+ "dflt_value": "'draft'",
739
+ "name": "status",
740
+ "notnull": 1,
741
+ "pk": 0,
742
+ "type": "TEXT"
743
+ },
744
+ {
745
+ "dflt_value": "0",
746
+ "name": "position",
747
+ "notnull": 1,
748
+ "pk": 0,
749
+ "type": "INTEGER"
750
+ },
751
+ {
752
+ "dflt_value": "'manual'",
753
+ "name": "source",
754
+ "notnull": 1,
755
+ "pk": 0,
756
+ "type": "TEXT"
757
+ },
758
+ {
759
+ "dflt_value": null,
760
+ "name": "provenance",
761
+ "notnull": 0,
762
+ "pk": 0,
763
+ "type": "TEXT"
764
+ },
765
+ {
766
+ "dflt_value": null,
767
+ "name": "created_at",
768
+ "notnull": 1,
769
+ "pk": 0,
770
+ "type": "TEXT"
771
+ },
772
+ {
773
+ "dflt_value": null,
774
+ "name": "updated_at",
775
+ "notnull": 1,
776
+ "pk": 0,
777
+ "type": "TEXT"
778
+ },
779
+ {
780
+ "dflt_value": null,
781
+ "name": "pulled_at",
782
+ "notnull": 0,
783
+ "pk": 0,
784
+ "type": "TEXT"
785
+ },
786
+ {
787
+ "dflt_value": null,
788
+ "name": "closed_at",
789
+ "notnull": 0,
790
+ "pk": 0,
791
+ "type": "TEXT"
792
+ }
793
+ ],
794
+ "foreign_keys": [],
795
+ "sql":
796
+ "CREATE TABLE builder_refinement_stories ( id TEXT PRIMARY KEY, journey TEXT NOT NULL, display_code TEXT NOT NULL, title TEXT NOT NULL, description TEXT, status TEXT NOT NULL DEFAULT 'draft', position INTEGER NOT NULL DEFAULT 0, source TEXT NOT NULL DEFAULT 'manual', provenance TEXT, created_at TEXT NOT NULL, updated_at TEXT NOT NULL, pulled_at TEXT, closed_at TEXT, CHECK(status IN ('draft', 'open', 'active', 'closed', 'parked')))"
797
+ },
798
+ "consolidations": {
799
+ "columns": [
800
+ {
801
+ "dflt_value": null,
802
+ "name": "id",
803
+ "notnull": 0,
804
+ "pk": 1,
805
+ "type": "TEXT"
806
+ },
807
+ {
808
+ "dflt_value": null,
809
+ "name": "action",
810
+ "notnull": 1,
811
+ "pk": 0,
812
+ "type": "TEXT"
813
+ },
814
+ {
815
+ "dflt_value": null,
816
+ "name": "proposal",
817
+ "notnull": 1,
818
+ "pk": 0,
819
+ "type": "TEXT"
820
+ },
821
+ {
822
+ "dflt_value": null,
823
+ "name": "result",
824
+ "notnull": 0,
825
+ "pk": 0,
826
+ "type": "TEXT"
827
+ },
828
+ {
829
+ "dflt_value": null,
830
+ "name": "source_memory_ids",
831
+ "notnull": 1,
832
+ "pk": 0,
833
+ "type": "TEXT"
834
+ },
835
+ {
836
+ "dflt_value": null,
837
+ "name": "target_layer",
838
+ "notnull": 0,
839
+ "pk": 0,
840
+ "type": "TEXT"
841
+ },
842
+ {
843
+ "dflt_value": null,
844
+ "name": "target_key",
845
+ "notnull": 0,
846
+ "pk": 0,
847
+ "type": "TEXT"
848
+ },
849
+ {
850
+ "dflt_value": null,
851
+ "name": "rationale",
852
+ "notnull": 0,
853
+ "pk": 0,
854
+ "type": "TEXT"
855
+ },
856
+ {
857
+ "dflt_value": "'pending'",
858
+ "name": "status",
859
+ "notnull": 1,
860
+ "pk": 0,
861
+ "type": "TEXT"
862
+ },
863
+ {
864
+ "dflt_value": null,
865
+ "name": "created_at",
866
+ "notnull": 1,
867
+ "pk": 0,
868
+ "type": "TEXT"
869
+ },
870
+ {
871
+ "dflt_value": null,
872
+ "name": "reviewed_at",
873
+ "notnull": 0,
874
+ "pk": 0,
875
+ "type": "TEXT"
876
+ }
877
+ ],
878
+ "foreign_keys": [],
879
+ "sql":
880
+ "CREATE TABLE consolidations ( id TEXT PRIMARY KEY, action TEXT NOT NULL, proposal TEXT NOT NULL, result TEXT, source_memory_ids TEXT NOT NULL, target_layer TEXT, target_key TEXT, rationale TEXT, status TEXT NOT NULL DEFAULT 'pending', created_at TEXT NOT NULL, reviewed_at TEXT)"
881
+ },
882
+ "conversation_embeddings": {
883
+ "columns": [
884
+ {
885
+ "dflt_value": null,
886
+ "name": "conversation_id",
887
+ "notnull": 0,
888
+ "pk": 1,
889
+ "type": "TEXT"
890
+ },
891
+ {
892
+ "dflt_value": null,
893
+ "name": "summary_embedding",
894
+ "notnull": 0,
895
+ "pk": 0,
896
+ "type": "BLOB"
897
+ }
898
+ ],
899
+ "foreign_keys": [
900
+ {
901
+ "from": "conversation_id",
902
+ "match": "NONE",
903
+ "on_delete": "NO ACTION",
904
+ "on_update": "NO ACTION",
905
+ "table": "conversations",
906
+ "to": "id"
907
+ }
908
+ ],
909
+ "sql":
910
+ "CREATE TABLE conversation_embeddings ( conversation_id TEXT PRIMARY KEY REFERENCES conversations(id), summary_embedding BLOB)"
911
+ },
912
+ "conversations": {
913
+ "columns": [
914
+ {
915
+ "dflt_value": null,
916
+ "name": "id",
917
+ "notnull": 0,
918
+ "pk": 1,
919
+ "type": "TEXT"
920
+ },
921
+ {
922
+ "dflt_value": null,
923
+ "name": "title",
924
+ "notnull": 0,
925
+ "pk": 0,
926
+ "type": "TEXT"
927
+ },
928
+ {
929
+ "dflt_value": null,
930
+ "name": "started_at",
931
+ "notnull": 1,
932
+ "pk": 0,
933
+ "type": "TEXT"
934
+ },
935
+ {
936
+ "dflt_value": null,
937
+ "name": "ended_at",
938
+ "notnull": 0,
939
+ "pk": 0,
940
+ "type": "TEXT"
941
+ },
942
+ {
943
+ "dflt_value": null,
944
+ "name": "interface",
945
+ "notnull": 1,
946
+ "pk": 0,
947
+ "type": "TEXT"
948
+ },
949
+ {
950
+ "dflt_value": null,
951
+ "name": "persona",
952
+ "notnull": 0,
953
+ "pk": 0,
954
+ "type": "TEXT"
955
+ },
956
+ {
957
+ "dflt_value": null,
958
+ "name": "journey",
959
+ "notnull": 0,
960
+ "pk": 0,
961
+ "type": "TEXT"
962
+ },
963
+ {
964
+ "dflt_value": null,
965
+ "name": "summary",
966
+ "notnull": 0,
967
+ "pk": 0,
968
+ "type": "TEXT"
969
+ },
970
+ {
971
+ "dflt_value": null,
972
+ "name": "tags",
973
+ "notnull": 0,
974
+ "pk": 0,
975
+ "type": "TEXT"
976
+ },
977
+ {
978
+ "dflt_value": null,
979
+ "name": "metadata",
980
+ "notnull": 0,
981
+ "pk": 0,
982
+ "type": "TEXT"
983
+ }
984
+ ],
985
+ "foreign_keys": [],
986
+ "sql":
987
+ "CREATE TABLE conversations ( id TEXT PRIMARY KEY, title TEXT, started_at TEXT NOT NULL, ended_at TEXT, interface TEXT NOT NULL, persona TEXT, journey TEXT, summary TEXT, tags TEXT, metadata TEXT)"
988
+ },
989
+ "exploratory_stories": {
990
+ "columns": [
991
+ {
992
+ "dflt_value": null,
993
+ "name": "id",
994
+ "notnull": 0,
995
+ "pk": 1,
996
+ "type": "TEXT"
997
+ },
998
+ {
999
+ "dflt_value": null,
1000
+ "name": "journey",
1001
+ "notnull": 1,
1002
+ "pk": 0,
1003
+ "type": "TEXT"
1004
+ },
1005
+ {
1006
+ "dflt_value": null,
1007
+ "name": "title",
1008
+ "notnull": 0,
1009
+ "pk": 0,
1010
+ "type": "TEXT"
1011
+ },
1012
+ {
1013
+ "dflt_value": "'active'",
1014
+ "name": "status",
1015
+ "notnull": 1,
1016
+ "pk": 0,
1017
+ "type": "TEXT"
1018
+ },
1019
+ {
1020
+ "dflt_value": null,
1021
+ "name": "current_story",
1022
+ "notnull": 0,
1023
+ "pk": 0,
1024
+ "type": "TEXT"
1025
+ },
1026
+ {
1027
+ "dflt_value": null,
1028
+ "name": "narrative_summary",
1029
+ "notnull": 0,
1030
+ "pk": 0,
1031
+ "type": "TEXT"
1032
+ },
1033
+ {
1034
+ "dflt_value": null,
1035
+ "name": "last_story_card",
1036
+ "notnull": 0,
1037
+ "pk": 0,
1038
+ "type": "TEXT"
1039
+ },
1040
+ {
1041
+ "dflt_value": null,
1042
+ "name": "attractors_json",
1043
+ "notnull": 0,
1044
+ "pk": 0,
1045
+ "type": "TEXT"
1046
+ },
1047
+ {
1048
+ "dflt_value": null,
1049
+ "name": "experiment_proposal_json",
1050
+ "notnull": 0,
1051
+ "pk": 0,
1052
+ "type": "TEXT"
1053
+ },
1054
+ {
1055
+ "dflt_value": null,
1056
+ "name": "builder_handoff_json",
1057
+ "notnull": 0,
1058
+ "pk": 0,
1059
+ "type": "TEXT"
1060
+ },
1061
+ {
1062
+ "dflt_value": null,
1063
+ "name": "source_conversations_json",
1064
+ "notnull": 0,
1065
+ "pk": 0,
1066
+ "type": "TEXT"
1067
+ },
1068
+ {
1069
+ "dflt_value": null,
1070
+ "name": "artifact_dir",
1071
+ "notnull": 0,
1072
+ "pk": 0,
1073
+ "type": "TEXT"
1074
+ },
1075
+ {
1076
+ "dflt_value": null,
1077
+ "name": "created_at",
1078
+ "notnull": 1,
1079
+ "pk": 0,
1080
+ "type": "TEXT"
1081
+ },
1082
+ {
1083
+ "dflt_value": null,
1084
+ "name": "updated_at",
1085
+ "notnull": 1,
1086
+ "pk": 0,
1087
+ "type": "TEXT"
1088
+ },
1089
+ {
1090
+ "dflt_value": null,
1091
+ "name": "promoted_at",
1092
+ "notnull": 0,
1093
+ "pk": 0,
1094
+ "type": "TEXT"
1095
+ },
1096
+ {
1097
+ "dflt_value": null,
1098
+ "name": "archived_at",
1099
+ "notnull": 0,
1100
+ "pk": 0,
1101
+ "type": "TEXT"
1102
+ }
1103
+ ],
1104
+ "foreign_keys": [],
1105
+ "sql":
1106
+ "CREATE TABLE exploratory_stories ( id TEXT PRIMARY KEY, journey TEXT NOT NULL, title TEXT, status TEXT NOT NULL DEFAULT 'active', current_story TEXT, narrative_summary TEXT, last_story_card TEXT, attractors_json TEXT, experiment_proposal_json TEXT, builder_handoff_json TEXT, source_conversations_json TEXT, artifact_dir TEXT, created_at TEXT NOT NULL, updated_at TEXT NOT NULL, promoted_at TEXT, archived_at TEXT, CHECK(status IN ('active', 'archived', 'promoted')))"
1107
+ },
1108
+ "identity": {
1109
+ "columns": [
1110
+ {
1111
+ "dflt_value": null,
1112
+ "name": "id",
1113
+ "notnull": 0,
1114
+ "pk": 1,
1115
+ "type": "TEXT"
1116
+ },
1117
+ {
1118
+ "dflt_value": null,
1119
+ "name": "layer",
1120
+ "notnull": 1,
1121
+ "pk": 0,
1122
+ "type": "TEXT"
1123
+ },
1124
+ {
1125
+ "dflt_value": null,
1126
+ "name": "key",
1127
+ "notnull": 1,
1128
+ "pk": 0,
1129
+ "type": "TEXT"
1130
+ },
1131
+ {
1132
+ "dflt_value": null,
1133
+ "name": "content",
1134
+ "notnull": 1,
1135
+ "pk": 0,
1136
+ "type": "TEXT"
1137
+ },
1138
+ {
1139
+ "dflt_value": "'1.0.0'",
1140
+ "name": "version",
1141
+ "notnull": 0,
1142
+ "pk": 0,
1143
+ "type": "TEXT"
1144
+ },
1145
+ {
1146
+ "dflt_value": null,
1147
+ "name": "created_at",
1148
+ "notnull": 1,
1149
+ "pk": 0,
1150
+ "type": "TEXT"
1151
+ },
1152
+ {
1153
+ "dflt_value": null,
1154
+ "name": "updated_at",
1155
+ "notnull": 1,
1156
+ "pk": 0,
1157
+ "type": "TEXT"
1158
+ },
1159
+ {
1160
+ "dflt_value": null,
1161
+ "name": "metadata",
1162
+ "notnull": 0,
1163
+ "pk": 0,
1164
+ "type": "TEXT"
1165
+ }
1166
+ ],
1167
+ "foreign_keys": [],
1168
+ "sql":
1169
+ "CREATE TABLE identity ( id TEXT PRIMARY KEY, layer TEXT NOT NULL, key TEXT NOT NULL, content TEXT NOT NULL, version TEXT DEFAULT '1.0.0', created_at TEXT NOT NULL, updated_at TEXT NOT NULL, metadata TEXT, UNIQUE(layer, key))"
1170
+ },
1171
+ "identity_descriptors": {
1172
+ "columns": [
1173
+ {
1174
+ "dflt_value": null,
1175
+ "name": "layer",
1176
+ "notnull": 1,
1177
+ "pk": 1,
1178
+ "type": "TEXT"
1179
+ },
1180
+ {
1181
+ "dflt_value": null,
1182
+ "name": "key",
1183
+ "notnull": 1,
1184
+ "pk": 2,
1185
+ "type": "TEXT"
1186
+ },
1187
+ {
1188
+ "dflt_value": null,
1189
+ "name": "descriptor",
1190
+ "notnull": 1,
1191
+ "pk": 0,
1192
+ "type": "TEXT"
1193
+ },
1194
+ {
1195
+ "dflt_value": null,
1196
+ "name": "generated_at",
1197
+ "notnull": 1,
1198
+ "pk": 0,
1199
+ "type": "TEXT"
1200
+ }
1201
+ ],
1202
+ "foreign_keys": [],
1203
+ "sql":
1204
+ "CREATE TABLE identity_descriptors ( layer TEXT NOT NULL, key TEXT NOT NULL, descriptor TEXT NOT NULL, generated_at TEXT NOT NULL, PRIMARY KEY (layer, key))"
1205
+ },
1206
+ "identity_integrations": {
1207
+ "columns": [
1208
+ {
1209
+ "dflt_value": null,
1210
+ "name": "id",
1211
+ "notnull": 0,
1212
+ "pk": 1,
1213
+ "type": "TEXT"
1214
+ },
1215
+ {
1216
+ "dflt_value": null,
1217
+ "name": "layer",
1218
+ "notnull": 1,
1219
+ "pk": 0,
1220
+ "type": "TEXT"
1221
+ },
1222
+ {
1223
+ "dflt_value": null,
1224
+ "name": "key",
1225
+ "notnull": 1,
1226
+ "pk": 0,
1227
+ "type": "TEXT"
1228
+ },
1229
+ {
1230
+ "dflt_value": null,
1231
+ "name": "content",
1232
+ "notnull": 1,
1233
+ "pk": 0,
1234
+ "type": "TEXT"
1235
+ },
1236
+ {
1237
+ "dflt_value": "'soul_mode'",
1238
+ "name": "source",
1239
+ "notnull": 1,
1240
+ "pk": 0,
1241
+ "type": "TEXT"
1242
+ },
1243
+ {
1244
+ "dflt_value": null,
1245
+ "name": "origin",
1246
+ "notnull": 0,
1247
+ "pk": 0,
1248
+ "type": "TEXT"
1249
+ },
1250
+ {
1251
+ "dflt_value": null,
1252
+ "name": "conversation_id",
1253
+ "notnull": 0,
1254
+ "pk": 0,
1255
+ "type": "TEXT"
1256
+ },
1257
+ {
1258
+ "dflt_value": null,
1259
+ "name": "journal_id",
1260
+ "notnull": 0,
1261
+ "pk": 0,
1262
+ "type": "TEXT"
1263
+ },
1264
+ {
1265
+ "dflt_value": null,
1266
+ "name": "created_at",
1267
+ "notnull": 1,
1268
+ "pk": 0,
1269
+ "type": "TEXT"
1270
+ },
1271
+ {
1272
+ "dflt_value": "'active'",
1273
+ "name": "status",
1274
+ "notnull": 1,
1275
+ "pk": 0,
1276
+ "type": "TEXT"
1277
+ },
1278
+ {
1279
+ "dflt_value": "'{}'",
1280
+ "name": "metadata",
1281
+ "notnull": 1,
1282
+ "pk": 0,
1283
+ "type": "TEXT"
1284
+ }
1285
+ ],
1286
+ "foreign_keys": [
1287
+ {
1288
+ "from": "conversation_id",
1289
+ "match": "NONE",
1290
+ "on_delete": "NO ACTION",
1291
+ "on_update": "NO ACTION",
1292
+ "table": "conversations",
1293
+ "to": "id"
1294
+ },
1295
+ {
1296
+ "from": "journal_id",
1297
+ "match": "NONE",
1298
+ "on_delete": "NO ACTION",
1299
+ "on_update": "NO ACTION",
1300
+ "table": "memories",
1301
+ "to": "id"
1302
+ }
1303
+ ],
1304
+ "sql":
1305
+ "CREATE TABLE identity_integrations ( id TEXT PRIMARY KEY, layer TEXT NOT NULL, key TEXT NOT NULL, content TEXT NOT NULL, source TEXT NOT NULL DEFAULT 'soul_mode', origin TEXT, conversation_id TEXT REFERENCES conversations(id), journal_id TEXT REFERENCES memories(id), created_at TEXT NOT NULL, status TEXT NOT NULL DEFAULT 'active', metadata TEXT NOT NULL DEFAULT '{}')"
1306
+ },
1307
+ "journey_mutation_receipts": {
1308
+ "columns": [
1309
+ {
1310
+ "dflt_value": null,
1311
+ "name": "request_id",
1312
+ "notnull": 0,
1313
+ "pk": 1,
1314
+ "type": "TEXT"
1315
+ },
1316
+ {
1317
+ "dflt_value": null,
1318
+ "name": "request_digest",
1319
+ "notnull": 1,
1320
+ "pk": 0,
1321
+ "type": "TEXT"
1322
+ },
1323
+ {
1324
+ "dflt_value": null,
1325
+ "name": "source_version",
1326
+ "notnull": 1,
1327
+ "pk": 0,
1328
+ "type": "TEXT"
1329
+ },
1330
+ {
1331
+ "dflt_value": null,
1332
+ "name": "result_version",
1333
+ "notnull": 1,
1334
+ "pk": 0,
1335
+ "type": "TEXT"
1336
+ },
1337
+ {
1338
+ "dflt_value": null,
1339
+ "name": "operation",
1340
+ "notnull": 1,
1341
+ "pk": 0,
1342
+ "type": "TEXT"
1343
+ },
1344
+ {
1345
+ "dflt_value": null,
1346
+ "name": "journey_id",
1347
+ "notnull": 1,
1348
+ "pk": 0,
1349
+ "type": "TEXT"
1350
+ },
1351
+ {
1352
+ "dflt_value": null,
1353
+ "name": "created_at",
1354
+ "notnull": 1,
1355
+ "pk": 0,
1356
+ "type": "TEXT"
1357
+ }
1358
+ ],
1359
+ "foreign_keys": [],
1360
+ "sql":
1361
+ "CREATE TABLE journey_mutation_receipts ( request_id TEXT PRIMARY KEY, request_digest TEXT NOT NULL, source_version TEXT NOT NULL, result_version TEXT NOT NULL, operation TEXT NOT NULL, journey_id TEXT NOT NULL, created_at TEXT NOT NULL)"
1362
+ },
1363
+ "llm_calls": {
1364
+ "columns": [
1365
+ {
1366
+ "dflt_value": null,
1367
+ "name": "id",
1368
+ "notnull": 0,
1369
+ "pk": 1,
1370
+ "type": "TEXT"
1371
+ },
1372
+ {
1373
+ "dflt_value": null,
1374
+ "name": "role",
1375
+ "notnull": 1,
1376
+ "pk": 0,
1377
+ "type": "TEXT"
1378
+ },
1379
+ {
1380
+ "dflt_value": null,
1381
+ "name": "model",
1382
+ "notnull": 1,
1383
+ "pk": 0,
1384
+ "type": "TEXT"
1385
+ },
1386
+ {
1387
+ "dflt_value": null,
1388
+ "name": "prompt",
1389
+ "notnull": 1,
1390
+ "pk": 0,
1391
+ "type": "TEXT"
1392
+ },
1393
+ {
1394
+ "dflt_value": null,
1395
+ "name": "response",
1396
+ "notnull": 1,
1397
+ "pk": 0,
1398
+ "type": "TEXT"
1399
+ },
1400
+ {
1401
+ "dflt_value": null,
1402
+ "name": "prompt_tokens",
1403
+ "notnull": 0,
1404
+ "pk": 0,
1405
+ "type": "INTEGER"
1406
+ },
1407
+ {
1408
+ "dflt_value": null,
1409
+ "name": "completion_tokens",
1410
+ "notnull": 0,
1411
+ "pk": 0,
1412
+ "type": "INTEGER"
1413
+ },
1414
+ {
1415
+ "dflt_value": null,
1416
+ "name": "latency_ms",
1417
+ "notnull": 0,
1418
+ "pk": 0,
1419
+ "type": "INTEGER"
1420
+ },
1421
+ {
1422
+ "dflt_value": null,
1423
+ "name": "cost_usd",
1424
+ "notnull": 0,
1425
+ "pk": 0,
1426
+ "type": "REAL"
1427
+ },
1428
+ {
1429
+ "dflt_value": null,
1430
+ "name": "conversation_id",
1431
+ "notnull": 0,
1432
+ "pk": 0,
1433
+ "type": "TEXT"
1434
+ },
1435
+ {
1436
+ "dflt_value": null,
1437
+ "name": "session_id",
1438
+ "notnull": 0,
1439
+ "pk": 0,
1440
+ "type": "TEXT"
1441
+ },
1442
+ {
1443
+ "dflt_value": null,
1444
+ "name": "called_at",
1445
+ "notnull": 1,
1446
+ "pk": 0,
1447
+ "type": "TEXT"
1448
+ }
1449
+ ],
1450
+ "foreign_keys": [
1451
+ {
1452
+ "from": "conversation_id",
1453
+ "match": "NONE",
1454
+ "on_delete": "NO ACTION",
1455
+ "on_update": "NO ACTION",
1456
+ "table": "conversations",
1457
+ "to": "id"
1458
+ }
1459
+ ],
1460
+ "sql":
1461
+ "CREATE TABLE llm_calls ( id TEXT PRIMARY KEY, role TEXT NOT NULL, model TEXT NOT NULL, prompt TEXT NOT NULL, response TEXT NOT NULL, prompt_tokens INTEGER, completion_tokens INTEGER, latency_ms INTEGER, cost_usd REAL, conversation_id TEXT REFERENCES conversations(id), session_id TEXT, called_at TEXT NOT NULL)"
1462
+ },
1463
+ "memories": {
1464
+ "columns": [
1465
+ {
1466
+ "dflt_value": null,
1467
+ "name": "id",
1468
+ "notnull": 0,
1469
+ "pk": 1,
1470
+ "type": "TEXT"
1471
+ },
1472
+ {
1473
+ "dflt_value": null,
1474
+ "name": "conversation_id",
1475
+ "notnull": 0,
1476
+ "pk": 0,
1477
+ "type": "TEXT"
1478
+ },
1479
+ {
1480
+ "dflt_value": null,
1481
+ "name": "memory_type",
1482
+ "notnull": 1,
1483
+ "pk": 0,
1484
+ "type": "TEXT"
1485
+ },
1486
+ {
1487
+ "dflt_value": "'ego'",
1488
+ "name": "layer",
1489
+ "notnull": 1,
1490
+ "pk": 0,
1491
+ "type": "TEXT"
1492
+ },
1493
+ {
1494
+ "dflt_value": null,
1495
+ "name": "title",
1496
+ "notnull": 1,
1497
+ "pk": 0,
1498
+ "type": "TEXT"
1499
+ },
1500
+ {
1501
+ "dflt_value": null,
1502
+ "name": "content",
1503
+ "notnull": 1,
1504
+ "pk": 0,
1505
+ "type": "TEXT"
1506
+ },
1507
+ {
1508
+ "dflt_value": null,
1509
+ "name": "context",
1510
+ "notnull": 0,
1511
+ "pk": 0,
1512
+ "type": "TEXT"
1513
+ },
1514
+ {
1515
+ "dflt_value": null,
1516
+ "name": "journey",
1517
+ "notnull": 0,
1518
+ "pk": 0,
1519
+ "type": "TEXT"
1520
+ },
1521
+ {
1522
+ "dflt_value": null,
1523
+ "name": "persona",
1524
+ "notnull": 0,
1525
+ "pk": 0,
1526
+ "type": "TEXT"
1527
+ },
1528
+ {
1529
+ "dflt_value": null,
1530
+ "name": "tags",
1531
+ "notnull": 0,
1532
+ "pk": 0,
1533
+ "type": "TEXT"
1534
+ },
1535
+ {
1536
+ "dflt_value": null,
1537
+ "name": "created_at",
1538
+ "notnull": 1,
1539
+ "pk": 0,
1540
+ "type": "TEXT"
1541
+ },
1542
+ {
1543
+ "dflt_value": "1.0",
1544
+ "name": "relevance_score",
1545
+ "notnull": 0,
1546
+ "pk": 0,
1547
+ "type": "REAL"
1548
+ },
1549
+ {
1550
+ "dflt_value": null,
1551
+ "name": "embedding",
1552
+ "notnull": 0,
1553
+ "pk": 0,
1554
+ "type": "BLOB"
1555
+ },
1556
+ {
1557
+ "dflt_value": null,
1558
+ "name": "metadata",
1559
+ "notnull": 0,
1560
+ "pk": 0,
1561
+ "type": "TEXT"
1562
+ },
1563
+ {
1564
+ "dflt_value": null,
1565
+ "name": "last_accessed_at",
1566
+ "notnull": 0,
1567
+ "pk": 0,
1568
+ "type": "TEXT"
1569
+ },
1570
+ {
1571
+ "dflt_value": "0",
1572
+ "name": "use_count",
1573
+ "notnull": 1,
1574
+ "pk": 0,
1575
+ "type": "INTEGER"
1576
+ },
1577
+ {
1578
+ "dflt_value": "'observed'",
1579
+ "name": "readiness_state",
1580
+ "notnull": 1,
1581
+ "pk": 0,
1582
+ "type": "TEXT"
1583
+ }
1584
+ ],
1585
+ "foreign_keys": [
1586
+ {
1587
+ "from": "conversation_id",
1588
+ "match": "NONE",
1589
+ "on_delete": "NO ACTION",
1590
+ "on_update": "NO ACTION",
1591
+ "table": "conversations",
1592
+ "to": "id"
1593
+ }
1594
+ ],
1595
+ "sql":
1596
+ "CREATE TABLE memories ( id TEXT PRIMARY KEY, conversation_id TEXT REFERENCES conversations(id), memory_type TEXT NOT NULL, layer TEXT NOT NULL DEFAULT 'ego', title TEXT NOT NULL, content TEXT NOT NULL, context TEXT, journey TEXT, persona TEXT, tags TEXT, created_at TEXT NOT NULL, relevance_score REAL DEFAULT 1.0, embedding BLOB, metadata TEXT, last_accessed_at TEXT, use_count INTEGER NOT NULL DEFAULT 0, readiness_state TEXT NOT NULL DEFAULT 'observed')"
1597
+ },
1598
+ "memories_fts": {
1599
+ "columns": [
1600
+ {
1601
+ "dflt_value": null,
1602
+ "name": "title",
1603
+ "notnull": 0,
1604
+ "pk": 0,
1605
+ "type": ""
1606
+ },
1607
+ {
1608
+ "dflt_value": null,
1609
+ "name": "content",
1610
+ "notnull": 0,
1611
+ "pk": 0,
1612
+ "type": ""
1613
+ },
1614
+ {
1615
+ "dflt_value": null,
1616
+ "name": "context",
1617
+ "notnull": 0,
1618
+ "pk": 0,
1619
+ "type": ""
1620
+ }
1621
+ ],
1622
+ "foreign_keys": [],
1623
+ "sql":
1624
+ "CREATE VIRTUAL TABLE memories_fts USING fts5( title, content, context, content=memories, content_rowid=rowid)"
1625
+ },
1626
+ "memory_access_log": {
1627
+ "columns": [
1628
+ {
1629
+ "dflt_value": null,
1630
+ "name": "id",
1631
+ "notnull": 0,
1632
+ "pk": 1,
1633
+ "type": "INTEGER"
1634
+ },
1635
+ {
1636
+ "dflt_value": null,
1637
+ "name": "memory_id",
1638
+ "notnull": 1,
1639
+ "pk": 0,
1640
+ "type": "TEXT"
1641
+ },
1642
+ {
1643
+ "dflt_value": null,
1644
+ "name": "accessed_at",
1645
+ "notnull": 1,
1646
+ "pk": 0,
1647
+ "type": "TEXT"
1648
+ },
1649
+ {
1650
+ "dflt_value": null,
1651
+ "name": "access_context",
1652
+ "notnull": 0,
1653
+ "pk": 0,
1654
+ "type": "TEXT"
1655
+ }
1656
+ ],
1657
+ "foreign_keys": [
1658
+ {
1659
+ "from": "memory_id",
1660
+ "match": "NONE",
1661
+ "on_delete": "NO ACTION",
1662
+ "on_update": "NO ACTION",
1663
+ "table": "memories",
1664
+ "to": "id"
1665
+ }
1666
+ ],
1667
+ "sql":
1668
+ "CREATE TABLE memory_access_log ( id INTEGER PRIMARY KEY AUTOINCREMENT, memory_id TEXT NOT NULL REFERENCES memories(id), accessed_at TEXT NOT NULL, access_context TEXT)"
1669
+ },
1670
+ "messages": {
1671
+ "columns": [
1672
+ {
1673
+ "dflt_value": null,
1674
+ "name": "id",
1675
+ "notnull": 0,
1676
+ "pk": 1,
1677
+ "type": "TEXT"
1678
+ },
1679
+ {
1680
+ "dflt_value": null,
1681
+ "name": "conversation_id",
1682
+ "notnull": 1,
1683
+ "pk": 0,
1684
+ "type": "TEXT"
1685
+ },
1686
+ {
1687
+ "dflt_value": null,
1688
+ "name": "role",
1689
+ "notnull": 1,
1690
+ "pk": 0,
1691
+ "type": "TEXT"
1692
+ },
1693
+ {
1694
+ "dflt_value": null,
1695
+ "name": "content",
1696
+ "notnull": 1,
1697
+ "pk": 0,
1698
+ "type": "TEXT"
1699
+ },
1700
+ {
1701
+ "dflt_value": null,
1702
+ "name": "created_at",
1703
+ "notnull": 1,
1704
+ "pk": 0,
1705
+ "type": "TEXT"
1706
+ },
1707
+ {
1708
+ "dflt_value": null,
1709
+ "name": "token_count",
1710
+ "notnull": 0,
1711
+ "pk": 0,
1712
+ "type": "INTEGER"
1713
+ },
1714
+ {
1715
+ "dflt_value": null,
1716
+ "name": "metadata",
1717
+ "notnull": 0,
1718
+ "pk": 0,
1719
+ "type": "TEXT"
1720
+ }
1721
+ ],
1722
+ "foreign_keys": [
1723
+ {
1724
+ "from": "conversation_id",
1725
+ "match": "NONE",
1726
+ "on_delete": "NO ACTION",
1727
+ "on_update": "NO ACTION",
1728
+ "table": "conversations",
1729
+ "to": "id"
1730
+ }
1731
+ ],
1732
+ "sql":
1733
+ "CREATE TABLE messages ( id TEXT PRIMARY KEY, conversation_id TEXT NOT NULL REFERENCES conversations(id), role TEXT NOT NULL, content TEXT NOT NULL, created_at TEXT NOT NULL, token_count INTEGER, metadata TEXT)"
1734
+ },
1735
+ "operation_run_events": {
1736
+ "columns": [
1737
+ {
1738
+ "dflt_value": null,
1739
+ "name": "id",
1740
+ "notnull": 0,
1741
+ "pk": 1,
1742
+ "type": "TEXT"
1743
+ },
1744
+ {
1745
+ "dflt_value": null,
1746
+ "name": "run_id",
1747
+ "notnull": 1,
1748
+ "pk": 0,
1749
+ "type": "TEXT"
1750
+ },
1751
+ {
1752
+ "dflt_value": null,
1753
+ "name": "sequence",
1754
+ "notnull": 1,
1755
+ "pk": 0,
1756
+ "type": "INTEGER"
1757
+ },
1758
+ {
1759
+ "dflt_value": null,
1760
+ "name": "kind",
1761
+ "notnull": 1,
1762
+ "pk": 0,
1763
+ "type": "TEXT"
1764
+ },
1765
+ {
1766
+ "dflt_value": null,
1767
+ "name": "message",
1768
+ "notnull": 1,
1769
+ "pk": 0,
1770
+ "type": "TEXT"
1771
+ },
1772
+ {
1773
+ "dflt_value": null,
1774
+ "name": "details_json",
1775
+ "notnull": 0,
1776
+ "pk": 0,
1777
+ "type": "TEXT"
1778
+ },
1779
+ {
1780
+ "dflt_value": null,
1781
+ "name": "created_at",
1782
+ "notnull": 1,
1783
+ "pk": 0,
1784
+ "type": "TEXT"
1785
+ }
1786
+ ],
1787
+ "foreign_keys": [
1788
+ {
1789
+ "from": "run_id",
1790
+ "match": "NONE",
1791
+ "on_delete": "CASCADE",
1792
+ "on_update": "NO ACTION",
1793
+ "table": "operation_runs",
1794
+ "to": "id"
1795
+ }
1796
+ ],
1797
+ "sql":
1798
+ "CREATE TABLE operation_run_events ( id TEXT PRIMARY KEY, run_id TEXT NOT NULL REFERENCES operation_runs(id) ON DELETE CASCADE, sequence INTEGER NOT NULL, kind TEXT NOT NULL, message TEXT NOT NULL, details_json TEXT, created_at TEXT NOT NULL)"
1799
+ },
1800
+ "operation_runs": {
1801
+ "columns": [
1802
+ {
1803
+ "dflt_value": null,
1804
+ "name": "id",
1805
+ "notnull": 0,
1806
+ "pk": 1,
1807
+ "type": "TEXT"
1808
+ },
1809
+ {
1810
+ "dflt_value": null,
1811
+ "name": "operation_id",
1812
+ "notnull": 1,
1813
+ "pk": 0,
1814
+ "type": "TEXT"
1815
+ },
1816
+ {
1817
+ "dflt_value": null,
1818
+ "name": "status",
1819
+ "notnull": 1,
1820
+ "pk": 0,
1821
+ "type": "TEXT"
1822
+ },
1823
+ {
1824
+ "dflt_value": null,
1825
+ "name": "outcome",
1826
+ "notnull": 0,
1827
+ "pk": 0,
1828
+ "type": "TEXT"
1829
+ },
1830
+ {
1831
+ "dflt_value": null,
1832
+ "name": "parameters_json",
1833
+ "notnull": 1,
1834
+ "pk": 0,
1835
+ "type": "TEXT"
1836
+ },
1837
+ {
1838
+ "dflt_value": null,
1839
+ "name": "summary_json",
1840
+ "notnull": 0,
1841
+ "pk": 0,
1842
+ "type": "TEXT"
1843
+ },
1844
+ {
1845
+ "dflt_value": null,
1846
+ "name": "result_json",
1847
+ "notnull": 0,
1848
+ "pk": 0,
1849
+ "type": "TEXT"
1850
+ },
1851
+ {
1852
+ "dflt_value": null,
1853
+ "name": "error",
1854
+ "notnull": 0,
1855
+ "pk": 0,
1856
+ "type": "TEXT"
1857
+ },
1858
+ {
1859
+ "dflt_value": null,
1860
+ "name": "started_at",
1861
+ "notnull": 1,
1862
+ "pk": 0,
1863
+ "type": "TEXT"
1864
+ },
1865
+ {
1866
+ "dflt_value": null,
1867
+ "name": "completed_at",
1868
+ "notnull": 0,
1869
+ "pk": 0,
1870
+ "type": "TEXT"
1871
+ },
1872
+ {
1873
+ "dflt_value": null,
1874
+ "name": "created_at",
1875
+ "notnull": 1,
1876
+ "pk": 0,
1877
+ "type": "TEXT"
1878
+ }
1879
+ ],
1880
+ "foreign_keys": [],
1881
+ "sql":
1882
+ "CREATE TABLE operation_runs ( id TEXT PRIMARY KEY, operation_id TEXT NOT NULL, status TEXT NOT NULL, outcome TEXT, parameters_json TEXT NOT NULL, summary_json TEXT, result_json TEXT, error TEXT, started_at TEXT NOT NULL, completed_at TEXT, created_at TEXT NOT NULL)"
1883
+ },
1884
+ "runtime_sessions": {
1885
+ "columns": [
1886
+ {
1887
+ "dflt_value": null,
1888
+ "name": "session_id",
1889
+ "notnull": 0,
1890
+ "pk": 1,
1891
+ "type": "TEXT"
1892
+ },
1893
+ {
1894
+ "dflt_value": null,
1895
+ "name": "conversation_id",
1896
+ "notnull": 0,
1897
+ "pk": 0,
1898
+ "type": "TEXT"
1899
+ },
1900
+ {
1901
+ "dflt_value": null,
1902
+ "name": "interface",
1903
+ "notnull": 0,
1904
+ "pk": 0,
1905
+ "type": "TEXT"
1906
+ },
1907
+ {
1908
+ "dflt_value": "0",
1909
+ "name": "mirror_active",
1910
+ "notnull": 1,
1911
+ "pk": 0,
1912
+ "type": "INTEGER"
1913
+ },
1914
+ {
1915
+ "dflt_value": null,
1916
+ "name": "persona",
1917
+ "notnull": 0,
1918
+ "pk": 0,
1919
+ "type": "TEXT"
1920
+ },
1921
+ {
1922
+ "dflt_value": null,
1923
+ "name": "journey",
1924
+ "notnull": 0,
1925
+ "pk": 0,
1926
+ "type": "TEXT"
1927
+ },
1928
+ {
1929
+ "dflt_value": "0",
1930
+ "name": "hook_injected",
1931
+ "notnull": 1,
1932
+ "pk": 0,
1933
+ "type": "INTEGER"
1934
+ },
1935
+ {
1936
+ "dflt_value": "1",
1937
+ "name": "active",
1938
+ "notnull": 1,
1939
+ "pk": 0,
1940
+ "type": "INTEGER"
1941
+ },
1942
+ {
1943
+ "dflt_value": null,
1944
+ "name": "started_at",
1945
+ "notnull": 1,
1946
+ "pk": 0,
1947
+ "type": "TEXT"
1948
+ },
1949
+ {
1950
+ "dflt_value": null,
1951
+ "name": "updated_at",
1952
+ "notnull": 1,
1953
+ "pk": 0,
1954
+ "type": "TEXT"
1955
+ },
1956
+ {
1957
+ "dflt_value": null,
1958
+ "name": "closed_at",
1959
+ "notnull": 0,
1960
+ "pk": 0,
1961
+ "type": "TEXT"
1962
+ },
1963
+ {
1964
+ "dflt_value": null,
1965
+ "name": "metadata",
1966
+ "notnull": 0,
1967
+ "pk": 0,
1968
+ "type": "TEXT"
1969
+ }
1970
+ ],
1971
+ "foreign_keys": [
1972
+ {
1973
+ "from": "conversation_id",
1974
+ "match": "NONE",
1975
+ "on_delete": "NO ACTION",
1976
+ "on_update": "NO ACTION",
1977
+ "table": "conversations",
1978
+ "to": "id"
1979
+ }
1980
+ ],
1981
+ "sql":
1982
+ "CREATE TABLE runtime_sessions ( session_id TEXT PRIMARY KEY, conversation_id TEXT REFERENCES conversations(id), interface TEXT, mirror_active INTEGER NOT NULL DEFAULT 0, persona TEXT, journey TEXT, hook_injected INTEGER NOT NULL DEFAULT 0, active INTEGER NOT NULL DEFAULT 1, started_at TEXT NOT NULL, updated_at TEXT NOT NULL, closed_at TEXT, metadata TEXT)"
1983
+ },
1984
+ "tasks": {
1985
+ "columns": [
1986
+ {
1987
+ "dflt_value": null,
1988
+ "name": "id",
1989
+ "notnull": 0,
1990
+ "pk": 1,
1991
+ "type": "TEXT"
1992
+ },
1993
+ {
1994
+ "dflt_value": null,
1995
+ "name": "journey",
1996
+ "notnull": 0,
1997
+ "pk": 0,
1998
+ "type": "TEXT"
1999
+ },
2000
+ {
2001
+ "dflt_value": null,
2002
+ "name": "title",
2003
+ "notnull": 1,
2004
+ "pk": 0,
2005
+ "type": "TEXT"
2006
+ },
2007
+ {
2008
+ "dflt_value": "'todo'",
2009
+ "name": "status",
2010
+ "notnull": 1,
2011
+ "pk": 0,
2012
+ "type": "TEXT"
2013
+ },
2014
+ {
2015
+ "dflt_value": null,
2016
+ "name": "due_date",
2017
+ "notnull": 0,
2018
+ "pk": 0,
2019
+ "type": "TEXT"
2020
+ },
2021
+ {
2022
+ "dflt_value": null,
2023
+ "name": "stage",
2024
+ "notnull": 0,
2025
+ "pk": 0,
2026
+ "type": "TEXT"
2027
+ },
2028
+ {
2029
+ "dflt_value": null,
2030
+ "name": "context",
2031
+ "notnull": 0,
2032
+ "pk": 0,
2033
+ "type": "TEXT"
2034
+ },
2035
+ {
2036
+ "dflt_value": "'manual'",
2037
+ "name": "source",
2038
+ "notnull": 1,
2039
+ "pk": 0,
2040
+ "type": "TEXT"
2041
+ },
2042
+ {
2043
+ "dflt_value": null,
2044
+ "name": "created_at",
2045
+ "notnull": 1,
2046
+ "pk": 0,
2047
+ "type": "TEXT"
2048
+ },
2049
+ {
2050
+ "dflt_value": null,
2051
+ "name": "updated_at",
2052
+ "notnull": 1,
2053
+ "pk": 0,
2054
+ "type": "TEXT"
2055
+ },
2056
+ {
2057
+ "dflt_value": null,
2058
+ "name": "completed_at",
2059
+ "notnull": 0,
2060
+ "pk": 0,
2061
+ "type": "TEXT"
2062
+ },
2063
+ {
2064
+ "dflt_value": null,
2065
+ "name": "metadata",
2066
+ "notnull": 0,
2067
+ "pk": 0,
2068
+ "type": "TEXT"
2069
+ },
2070
+ {
2071
+ "dflt_value": null,
2072
+ "name": "scheduled_at",
2073
+ "notnull": 0,
2074
+ "pk": 0,
2075
+ "type": "TEXT"
2076
+ },
2077
+ {
2078
+ "dflt_value": null,
2079
+ "name": "time_hint",
2080
+ "notnull": 0,
2081
+ "pk": 0,
2082
+ "type": "TEXT"
2083
+ }
2084
+ ],
2085
+ "foreign_keys": [],
2086
+ "sql":
2087
+ "CREATE TABLE tasks ( id TEXT PRIMARY KEY, journey TEXT, title TEXT NOT NULL, status TEXT NOT NULL DEFAULT 'todo', due_date TEXT, stage TEXT, context TEXT, source TEXT NOT NULL DEFAULT 'manual', created_at TEXT NOT NULL, updated_at TEXT NOT NULL, completed_at TEXT, metadata TEXT, scheduled_at TEXT, time_hint TEXT)"
2088
+ }
2089
+ },
2090
+ "triggers": {
2091
+ "memories_fts_ad": {
2092
+ "sql":
2093
+ "CREATE TRIGGER memories_fts_ad AFTER DELETE ON memories BEGIN INSERT INTO memories_fts(memories_fts, rowid, title, content, context) VALUES ('delete', OLD.rowid, OLD.title, OLD.content, COALESCE(OLD.context, '')); END",
2094
+ "table": "memories"
2095
+ },
2096
+ "memories_fts_ai": {
2097
+ "sql":
2098
+ "CREATE TRIGGER memories_fts_ai AFTER INSERT ON memories BEGIN INSERT INTO memories_fts(rowid, title, content, context) VALUES (NEW.rowid, NEW.title, NEW.content, COALESCE(NEW.context, '')); END",
2099
+ "table": "memories"
2100
+ },
2101
+ "memories_fts_au": {
2102
+ "sql":
2103
+ "CREATE TRIGGER memories_fts_au AFTER UPDATE ON memories BEGIN INSERT INTO memories_fts(memories_fts, rowid, title, content, context) VALUES ('delete', OLD.rowid, OLD.title, OLD.content, COALESCE(OLD.context, '')); INSERT INTO memories_fts(rowid, title, content, context) VALUES (NEW.rowid, NEW.title, NEW.content, COALESCE(NEW.context, '')); END",
2104
+ "table": "memories"
2105
+ }
2106
+ }
2107
+ };