neotoma 0.18.7 → 0.19.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 (461) hide show
  1. package/dist/actions.d.ts +3 -0
  2. package/dist/actions.d.ts.map +1 -1
  3. package/dist/actions.js +232 -6
  4. package/dist/actions.js.map +1 -1
  5. package/dist/cli/bootstrap.js +0 -0
  6. package/dist/cli/harness_configure.d.ts +3 -1
  7. package/dist/cli/harness_configure.d.ts.map +1 -1
  8. package/dist/cli/harness_configure.js +2 -1
  9. package/dist/cli/harness_configure.js.map +1 -1
  10. package/dist/cli/index.d.ts.map +1 -1
  11. package/dist/cli/index.js +9 -0
  12. package/dist/cli/index.js.map +1 -1
  13. package/dist/cli/mcp_config_scan.d.ts +15 -0
  14. package/dist/cli/mcp_config_scan.d.ts.map +1 -1
  15. package/dist/cli/mcp_config_scan.js +96 -20
  16. package/dist/cli/mcp_config_scan.js.map +1 -1
  17. package/dist/cli/permissions.d.ts.map +1 -1
  18. package/dist/cli/permissions.js +25 -2
  19. package/dist/cli/permissions.js.map +1 -1
  20. package/dist/cli/setup_runners.d.ts +3 -1
  21. package/dist/cli/setup_runners.d.ts.map +1 -1
  22. package/dist/cli/setup_runners.js +1 -0
  23. package/dist/cli/setup_runners.js.map +1 -1
  24. package/dist/docs/developer/cli_reference.md +1 -1
  25. package/dist/docs/developer/mcp/instructions.md +3 -3
  26. package/dist/docs/developer/mcp/proxy.md +6 -4
  27. package/dist/docs/foundation/entity_resolution.md +34 -7
  28. package/dist/docs/foundation/what_to_store.md +1 -1
  29. package/dist/docs/infrastructure/client_instance_deployment.md +151 -0
  30. package/dist/docs/integrations/hooks/claude_code.md +51 -0
  31. package/dist/docs/reference/error_codes.md +75 -23
  32. package/dist/docs/testing/automated_test_catalog.md +24 -12
  33. package/dist/inspector/assets/access_policies-6-6DPI39.js +1 -0
  34. package/dist/inspector/assets/{agent_badge-D5c8UAE9.js → agent_badge-CXSO0sXJ.js} +1 -1
  35. package/dist/inspector/assets/{agent_detail-lZm2dWDR.js → agent_detail-Cr7iqdye.js} +1 -1
  36. package/dist/inspector/assets/{agent_filter-_s9ctnZg.js → agent_filter-DQvQyxMp.js} +1 -1
  37. package/dist/inspector/assets/{agent_grant_detail-jPlKCXYO.js → agent_grant_detail-DRRM7KWw.js} +1 -1
  38. package/dist/inspector/assets/{agent_grant_form-BUQdfq4A.js → agent_grant_form-DNfWiVBQ.js} +1 -1
  39. package/dist/inspector/assets/{agent_grants-D7dYlLNX.js → agent_grants-BWgOPiOe.js} +1 -1
  40. package/dist/inspector/assets/{agents-Bl50GiDS.js → agents-CPLAQelS.js} +1 -1
  41. package/dist/inspector/assets/{api_not_configured_state-GASK-mhp.js → api_not_configured_state-DHesochj.js} +1 -1
  42. package/dist/inspector/assets/{attribution_card-Dks_zpQx.js → attribution_card-CCINKjRY.js} +1 -1
  43. package/dist/inspector/assets/{attribution_summary-Cli2qL-J.js → attribution_summary-Dkwz1aNS.js} +1 -1
  44. package/dist/inspector/assets/{bundles-4y41Dsvz.js → bundles-f-bRlQYm.js} +1 -1
  45. package/dist/inspector/assets/{card-DyP1iupa.js → card-18-eZw0x.js} +1 -1
  46. package/dist/inspector/assets/{checkbox-CIUQh9NP.js → checkbox-DUu6AMCH.js} +1 -1
  47. package/dist/inspector/assets/{compliance-CZT3IVp5.js → compliance-C1iqMRYK.js} +1 -1
  48. package/dist/inspector/assets/{confirm-dialog-DwPqhney.js → confirm-dialog-KIPuwTQR.js} +1 -1
  49. package/dist/inspector/assets/{conversation_common-DqXXK2sj.js → conversation_common-aPvd5zmX.js} +1 -1
  50. package/dist/inspector/assets/{conversation_detail-BUqgnrpM.js → conversation_detail-nJDDMCfc.js} +1 -1
  51. package/dist/inspector/assets/{copy_id_button-CFvm8hKT.js → copy_id_button-BwaRGKNA.js} +1 -1
  52. package/dist/inspector/assets/{copyable_code_block-Ds_m6kph.js → copyable_code_block-DDi03yAz.js} +1 -1
  53. package/dist/inspector/assets/{corrections-CYBwDzLB.js → corrections-Dz2v9ju9.js} +1 -1
  54. package/dist/inspector/assets/{dashboard-Bn74vHnA.js → dashboard-CZOdnoJJ.js} +1 -1
  55. package/dist/inspector/assets/{data-table-BdvHAu9o.js → data-table-5i_gqEfj.js} +1 -1
  56. package/dist/inspector/assets/{design-CvkXmrg8.js → design-BdKBUVmX.js} +1 -1
  57. package/dist/inspector/assets/{dialog-ClLKFBmR.js → dialog-CNJoZoQS.js} +1 -1
  58. package/dist/inspector/assets/{docs-DsWM97KO.js → docs-sXzc0LTz.js} +1 -1
  59. package/dist/inspector/assets/{docs_page_layout-B2uZRfVC.js → docs_page_layout-CGg8ubQX.js} +1 -1
  60. package/dist/inspector/assets/{embed_graph-dvewK9nr.js → embed_graph-BpLLD_vX.js} +1 -1
  61. package/dist/inspector/assets/{empty_state-Bc-ujW2X.js → empty_state-DNk61WLW.js} +1 -1
  62. package/dist/inspector/assets/{entities-BOrwMORJ.js → entities-Cexhp3qr.js} +1 -1
  63. package/dist/inspector/assets/{entity_correct-r178klDI.js → entity_correct-CfSggXgT.js} +1 -1
  64. package/dist/inspector/assets/{entity_history-CKLn3lKb.js → entity_history-CGila0eu.js} +1 -1
  65. package/dist/inspector/assets/{entity_history_sections-FVZdr00Y.js → entity_history_sections-CXYX1gph.js} +1 -1
  66. package/dist/inspector/assets/{entity_link-yKDYqbhx.js → entity_link-DUdsaj-A.js} +1 -1
  67. package/dist/inspector/assets/{entity_relationships_by_type-SQLvwlXL.js → entity_relationships_by_type-B_PH1APK.js} +1 -1
  68. package/dist/inspector/assets/{entity_segment_page-BXDQbUUp.js → entity_segment_page-DRYjT1AU.js} +1 -1
  69. package/dist/inspector/assets/{entity_table_column_toggle-D7CwUiAH.js → entity_table_column_toggle-DwwHY7Y8.js} +1 -1
  70. package/dist/inspector/assets/{entity_timeline-Dg0wEuRA.js → entity_timeline-B4XYY56n.js} +1 -1
  71. package/dist/inspector/assets/{entity_types-DLlkd4ex.js → entity_types-ByB2PWZM.js} +1 -1
  72. package/dist/inspector/assets/{faq-KbswV10B.js → faq-B-PEHwkf.js} +1 -1
  73. package/dist/inspector/assets/{graph_auto_fit-SqyYePaZ.js → graph_auto_fit-ClZnIOoR.js} +1 -1
  74. package/dist/inspector/assets/{graph_explorer-DZgjc-hi.js → graph_explorer-C-Xo8VWP.js} +1 -1
  75. package/dist/inspector/assets/{home-CUYUSmke.js → home-D1UVMr6_.js} +1 -1
  76. package/dist/inspector/assets/{index-BGqcUFFW.js → index-C6fxoS_Z.js} +1582 -1582
  77. package/dist/inspector/assets/{index-CBJY_OOI.js → index-Cp0BQ57U.js} +1 -1
  78. package/dist/inspector/assets/{index-DOxiDdC1.js → index-MnCv_KTr.js} +1 -1
  79. package/dist/inspector/assets/interpretations-BCs9qtw0.js +1 -0
  80. package/dist/inspector/assets/{interpretations-CSeyL3hr.js → interpretations-DG5kUN-V.js} +1 -1
  81. package/dist/inspector/assets/{issue_author_attribution-Czyui6JR.js → issue_author_attribution-D7_vwrHJ.js} +1 -1
  82. package/dist/inspector/assets/{issue_detail-DgdqvrIo.js → issue_detail-DKYUwKt_.js} +1 -1
  83. package/dist/inspector/assets/{issues-dw8Q41vn.js → issues-DcSMjt-p.js} +1 -1
  84. package/dist/inspector/assets/{json_viewer-CEMz7ftn.js → json_viewer-BKa7wwrs.js} +1 -1
  85. package/dist/inspector/assets/{label-qbFxe1yC.js → label-BO-aVMjO.js} +1 -1
  86. package/dist/inspector/assets/{live_relative_time-CVpdUZRq.js → live_relative_time-Dx00M9I6.js} +1 -1
  87. package/dist/inspector/assets/mobile_filter_popover-I9fJvTGr.js +1 -0
  88. package/dist/inspector/assets/{not_found-DFUrM9eP.js → not_found-DuCJouBh.js} +1 -1
  89. package/dist/inspector/assets/oauth_callback-w0kyGAb4.js +1 -0
  90. package/dist/inspector/assets/oauth_signin-3LQrxsKz.js +1 -0
  91. package/dist/inspector/assets/{observations-BO6KImWs.js → observations-Bq6mvl5m.js} +1 -1
  92. package/dist/inspector/assets/{page_shell-COxcPFXG.js → page_shell-BoTb5of6.js} +1 -1
  93. package/dist/inspector/assets/{pagination-NLnVe1CU.js → pagination-BJtT1Wgy.js} +1 -1
  94. package/dist/inspector/assets/{peer_detail-DdtQsiwD.js → peer_detail-BM1jhSS2.js} +1 -1
  95. package/dist/inspector/assets/{peers-D0bzQeyz.js → peers-CYSx-jAx.js} +1 -1
  96. package/dist/inspector/assets/{pin_primitive_button-BtuY3Ig7.js → pin_primitive_button-BdAR3e5K.js} +1 -1
  97. package/dist/inspector/assets/{recent_activity-8t3t2hCi.js → recent_activity-Dio9UBCA.js} +1 -1
  98. package/dist/inspector/assets/{recent_conversations-xURWFQ1G.js → recent_conversations-Be7S63h9.js} +1 -1
  99. package/dist/inspector/assets/{recent_conversations-B351X_is.js → recent_conversations-iJTSJf5e.js} +1 -1
  100. package/dist/inspector/assets/{recent_records_feed-C0auJYwP.js → recent_records_feed-ZxHjVjQ6.js} +1 -1
  101. package/dist/inspector/assets/record_activity-BmMC7Q7l.js +1 -0
  102. package/dist/inspector/assets/{relationship_detail-B9y50i1N.js → relationship_detail-i9rsGxA6.js} +1 -1
  103. package/dist/inspector/assets/{relationship_panel_groups-DgC2aJin.js → relationship_panel_groups-CXFlrRHU.js} +1 -1
  104. package/dist/inspector/assets/{relationships-u7QTLzYr.js → relationships-DqAzfnlB.js} +1 -1
  105. package/dist/inspector/assets/{relationships-DvN6JCJC.js → relationships-DvWtOU7W.js} +1 -1
  106. package/dist/inspector/assets/{sandbox-DzEfLQAo.js → sandbox-Cn4vq2Pz.js} +1 -1
  107. package/dist/inspector/assets/{schema_detail-BI3lLXFK.js → schema_detail-BdORXewP.js} +1 -1
  108. package/dist/inspector/assets/{schemas-DpAQVcki.js → schemas-HYsBtoHT.js} +1 -1
  109. package/dist/inspector/assets/{search-CjE75jdm.js → search-LzJnqvTB.js} +1 -1
  110. package/dist/inspector/assets/{segmented_control-D9QbgEtB.js → segmented_control-CHJO5zMt.js} +1 -1
  111. package/dist/inspector/assets/{select-KOFjYHgz.js → select-DFzP9laV.js} +1 -1
  112. package/dist/inspector/assets/settings-Bm0jNa4p.js +1 -0
  113. package/dist/inspector/assets/{source_content-Bi_jkeg2.js → source_content-PwVSPaIU.js} +1 -1
  114. package/dist/inspector/assets/{source_content_open_button-B9mhDPoj.js → source_content_open_button-C7NKRG7q.js} +1 -1
  115. package/dist/inspector/assets/{source_detail-B3jsntel.js → source_detail-C2D885Zy.js} +1 -1
  116. package/dist/inspector/assets/{source_link-DrAAN7IB.js → source_link-6lMlhQnK.js} +1 -1
  117. package/dist/inspector/assets/{sources-B7H4Tgy7.js → sources-BvGo5OZp.js} +1 -1
  118. package/dist/inspector/assets/{subscriptions-B79INOqC.js → subscriptions-BGYmtTLV.js} +1 -1
  119. package/dist/inspector/assets/{switch-DEw5ZD9Y.js → switch-DkusEYsE.js} +1 -1
  120. package/dist/inspector/assets/{tabs-CZDCOqHp.js → tabs-hkbPHxT0.js} +1 -1
  121. package/dist/inspector/assets/{textarea-DM2MsnIS.js → textarea-BhC7xtLk.js} +1 -1
  122. package/dist/inspector/assets/{timeline-DtGp-dM7.js → timeline-CHi-lYcV.js} +1 -1
  123. package/dist/inspector/assets/{timeline-CwKOl2cK.js → timeline-DmjoODDd.js} +1 -1
  124. package/dist/inspector/assets/{timeline_event_detail-D-gU-DZY.js → timeline_event_detail-BfKrsQih.js} +1 -1
  125. package/dist/inspector/assets/{turn_detail-D20KYWIY.js → turn_detail-DGj1lT0k.js} +1 -1
  126. package/dist/inspector/assets/{turns-CCukFhV6.js → turns-CHfOIg9X.js} +1 -1
  127. package/dist/inspector/assets/{use_agents-Duqes0yE.js → use_agents-6sUtEOpZ.js} +1 -1
  128. package/dist/inspector/assets/{use_entities-CAYbeIfx.js → use_entities-DeIlqnzx.js} +1 -1
  129. package/dist/inspector/assets/use_interpretations-DvfzvGu3.js +1 -0
  130. package/dist/inspector/assets/{use_mutations-CaZO8lpD.js → use_mutations-CQ3_5Ppg.js} +1 -1
  131. package/dist/inspector/assets/{use_peers-CGLvEf5V.js → use_peers-CW3OAs41.js} +1 -1
  132. package/dist/inspector/assets/{use_relationships-B8fSaOmY.js → use_relationships-Dbtmx8X8.js} +1 -1
  133. package/dist/inspector/assets/{use_stats-DHAaJFKE.js → use_stats-OyHBzetJ.js} +1 -1
  134. package/dist/inspector/assets/{use_timeline-BMIPVqoi.js → use_timeline-FINsibXm.js} +1 -1
  135. package/dist/inspector/assets/{use_turns-DRAnBf4e.js → use_turns-D4AhGAvM.js} +1 -1
  136. package/dist/inspector/assets/{world_time_event_timeline-CWFM4Q3K.js → world_time_event_timeline-F0elR7Vc.js} +1 -1
  137. package/dist/inspector/index.html +1 -1
  138. package/dist/proxy/mcp_stdio_proxy.d.ts +11 -5
  139. package/dist/proxy/mcp_stdio_proxy.d.ts.map +1 -1
  140. package/dist/proxy/mcp_stdio_proxy.js +12 -6
  141. package/dist/proxy/mcp_stdio_proxy.js.map +1 -1
  142. package/dist/repositories/sqlite/local_db_adapter.d.ts.map +1 -1
  143. package/dist/repositories/sqlite/local_db_adapter.js +12 -0
  144. package/dist/repositories/sqlite/local_db_adapter.js.map +1 -1
  145. package/dist/seed_schemas_entry.d.ts +28 -0
  146. package/dist/seed_schemas_entry.d.ts.map +1 -0
  147. package/dist/seed_schemas_entry.js +142 -0
  148. package/dist/seed_schemas_entry.js.map +1 -0
  149. package/dist/server.d.ts +9 -0
  150. package/dist/server.d.ts.map +1 -1
  151. package/dist/server.js +93 -3
  152. package/dist/server.js.map +1 -1
  153. package/dist/services/company_query.d.ts +54 -0
  154. package/dist/services/company_query.d.ts.map +1 -0
  155. package/dist/services/company_query.js +175 -0
  156. package/dist/services/company_query.js.map +1 -0
  157. package/dist/services/company_resolution.d.ts +86 -0
  158. package/dist/services/company_resolution.d.ts.map +1 -0
  159. package/dist/services/company_resolution.js +195 -0
  160. package/dist/services/company_resolution.js.map +1 -0
  161. package/dist/services/entity_resolution.d.ts.map +1 -1
  162. package/dist/services/entity_resolution.js +12 -2
  163. package/dist/services/entity_resolution.js.map +1 -1
  164. package/dist/services/google_oidc.d.ts +110 -0
  165. package/dist/services/google_oidc.d.ts.map +1 -0
  166. package/dist/services/google_oidc.js +249 -0
  167. package/dist/services/google_oidc.js.map +1 -0
  168. package/dist/services/inspector_mount.d.ts.map +1 -1
  169. package/dist/services/inspector_mount.js +9 -0
  170. package/dist/services/inspector_mount.js.map +1 -1
  171. package/dist/services/issues/observer_import.d.ts +1 -1
  172. package/dist/services/issues/observer_import.d.ts.map +1 -1
  173. package/dist/services/issues/observer_import.js +3 -3
  174. package/dist/services/issues/observer_import.js.map +1 -1
  175. package/dist/services/mcp_oauth.d.ts +1 -1
  176. package/dist/services/mcp_oauth.d.ts.map +1 -1
  177. package/dist/services/mcp_oauth.js +11 -1
  178. package/dist/services/mcp_oauth.js.map +1 -1
  179. package/dist/services/schema_definitions.d.ts.map +1 -1
  180. package/dist/services/schema_definitions.js +99 -1
  181. package/dist/services/schema_definitions.js.map +1 -1
  182. package/dist/services/schema_reference_linking.d.ts +61 -2
  183. package/dist/services/schema_reference_linking.d.ts.map +1 -1
  184. package/dist/services/schema_reference_linking.js +264 -21
  185. package/dist/services/schema_reference_linking.js.map +1 -1
  186. package/dist/services/schema_registry.d.ts +13 -0
  187. package/dist/services/schema_registry.d.ts.map +1 -1
  188. package/dist/services/schema_registry.js +3 -0
  189. package/dist/services/schema_registry.js.map +1 -1
  190. package/dist/shared/action_handlers/entity_identifier_handler.d.ts.map +1 -1
  191. package/dist/shared/action_handlers/entity_identifier_handler.js +131 -4
  192. package/dist/shared/action_handlers/entity_identifier_handler.js.map +1 -1
  193. package/dist/shared/action_schemas.d.ts +51 -26
  194. package/dist/shared/action_schemas.d.ts.map +1 -1
  195. package/dist/shared/action_schemas.js +17 -0
  196. package/dist/shared/action_schemas.js.map +1 -1
  197. package/dist/shared/contract_mappings.d.ts.map +1 -1
  198. package/dist/shared/contract_mappings.js +9 -0
  199. package/dist/shared/contract_mappings.js.map +1 -1
  200. package/dist/shared/openapi_types.d.ts +137 -0
  201. package/dist/shared/openapi_types.d.ts.map +1 -1
  202. package/dist/tool_definitions.d.ts +1 -1
  203. package/dist/tool_definitions.d.ts.map +1 -1
  204. package/dist/tool_definitions.js +6 -0
  205. package/dist/tool_definitions.js.map +1 -1
  206. package/docs/developer/mcp/instructions.md +3 -3
  207. package/openapi.yaml +129 -0
  208. package/package.json +6 -1
  209. package/packages/claude-code-plugin/.claude-plugin/marketplace.json +17 -0
  210. package/packages/claude-code-plugin/.claude-plugin/plugin.json +69 -0
  211. package/packages/claude-code-plugin/README.md +76 -0
  212. package/packages/claude-code-plugin/hooks/_common.py +494 -0
  213. package/packages/claude-code-plugin/hooks/neotoma_client/__init__.py +72 -0
  214. package/packages/claude-code-plugin/hooks/neotoma_client/client.py +231 -0
  215. package/packages/claude-code-plugin/hooks/neotoma_client/errors.py +20 -0
  216. package/packages/claude-code-plugin/hooks/neotoma_client/helpers.py +243 -0
  217. package/packages/claude-code-plugin/hooks/neotoma_client/memory.py +363 -0
  218. package/packages/claude-code-plugin/hooks/neotoma_client/types.py +93 -0
  219. package/packages/claude-code-plugin/hooks/neotoma_client/with_memory.py +118 -0
  220. package/packages/claude-code-plugin/hooks/post_tool_use.py +148 -0
  221. package/packages/claude-code-plugin/hooks/pre_compact.py +75 -0
  222. package/packages/claude-code-plugin/hooks/session_start.py +118 -0
  223. package/packages/claude-code-plugin/hooks/stop.py +87 -0
  224. package/packages/claude-code-plugin/hooks/user_prompt_submit.py +183 -0
  225. package/packages/codex-hooks/README.md +45 -0
  226. package/packages/codex-hooks/hooks/_common.py +341 -0
  227. package/packages/codex-hooks/hooks/notify.py +143 -0
  228. package/packages/codex-hooks/hooks/session_end.py +87 -0
  229. package/packages/codex-hooks/hooks/session_start.py +82 -0
  230. package/packages/codex-hooks/package.json +19 -0
  231. package/packages/codex-hooks/scripts/install.mjs +100 -0
  232. package/packages/cursor-hooks/README.md +93 -0
  233. package/packages/cursor-hooks/hooks/_common.ts +1490 -0
  234. package/packages/cursor-hooks/hooks/after_tool_use.ts +222 -0
  235. package/packages/cursor-hooks/hooks/before_submit_prompt.ts +185 -0
  236. package/packages/cursor-hooks/hooks/post_tool_use_failure.ts +181 -0
  237. package/packages/cursor-hooks/hooks/session_start.ts +116 -0
  238. package/packages/cursor-hooks/hooks/stop.ts +333 -0
  239. package/packages/cursor-hooks/hooks.template.json +31 -0
  240. package/packages/cursor-hooks/package-lock.json +75 -0
  241. package/packages/cursor-hooks/package.json +29 -0
  242. package/packages/cursor-hooks/scripts/install.mjs +149 -0
  243. package/packages/cursor-hooks/tsconfig.json +15 -0
  244. package/dist/cli/activate.d.ts +0 -72
  245. package/dist/cli/activate.d.ts.map +0 -1
  246. package/dist/cli/activate.js +0 -160
  247. package/dist/cli/activate.js.map +0 -1
  248. package/dist/cli/auth_keygen.d.ts +0 -11
  249. package/dist/cli/auth_keygen.d.ts.map +0 -1
  250. package/dist/cli/auth_keygen.js +0 -110
  251. package/dist/cli/auth_keygen.js.map +0 -1
  252. package/dist/cli/packs.d.ts +0 -15
  253. package/dist/cli/packs.d.ts.map +0 -1
  254. package/dist/cli/packs.js +0 -156
  255. package/dist/cli/packs.js.map +0 -1
  256. package/dist/cli/triage.d.ts +0 -33
  257. package/dist/cli/triage.d.ts.map +0 -1
  258. package/dist/cli/triage.js +0 -251
  259. package/dist/cli/triage.js.map +0 -1
  260. package/dist/inspector/assets/access_policies-C0QzIgOo.js +0 -1
  261. package/dist/inspector/assets/interpretations-B1shK6Is.js +0 -1
  262. package/dist/inspector/assets/mobile_filter_popover-CI_BhFTn.js +0 -1
  263. package/dist/inspector/assets/record_activity-DUwg1WBC.js +0 -1
  264. package/dist/inspector/assets/settings-CHzeuzGL.js +0 -1
  265. package/dist/inspector/assets/use_interpretations-D_RbNlHg.js +0 -1
  266. package/dist/services/activation/stage_zero_five.d.ts +0 -62
  267. package/dist/services/activation/stage_zero_five.d.ts.map +0 -1
  268. package/dist/services/activation/stage_zero_five.js +0 -126
  269. package/dist/services/activation/stage_zero_five.js.map +0 -1
  270. package/dist/services/activation/user_preference.d.ts +0 -110
  271. package/dist/services/activation/user_preference.d.ts.map +0 -1
  272. package/dist/services/activation/user_preference.js +0 -98
  273. package/dist/services/activation/user_preference.js.map +0 -1
  274. package/dist/services/activation/vertical_detection.d.ts +0 -78
  275. package/dist/services/activation/vertical_detection.d.ts.map +0 -1
  276. package/dist/services/activation/vertical_detection.js +0 -219
  277. package/dist/services/activation/vertical_detection.js.map +0 -1
  278. package/dist/services/app_mount.d.ts +0 -166
  279. package/dist/services/app_mount.d.ts.map +0 -1
  280. package/dist/services/app_mount.js +0 -626
  281. package/dist/services/app_mount.js.map +0 -1
  282. package/dist/services/bundled_pages/html_shell.d.ts +0 -118
  283. package/dist/services/bundled_pages/html_shell.d.ts.map +0 -1
  284. package/dist/services/bundled_pages/html_shell.js +0 -242
  285. package/dist/services/bundled_pages/html_shell.js.map +0 -1
  286. package/dist/services/bundled_pages/tokens.d.ts +0 -496
  287. package/dist/services/bundled_pages/tokens.d.ts.map +0 -1
  288. package/dist/services/bundled_pages/tokens.js +0 -261
  289. package/dist/services/bundled_pages/tokens.js.map +0 -1
  290. package/dist/services/compliance/alerting.d.ts +0 -123
  291. package/dist/services/compliance/alerting.d.ts.map +0 -1
  292. package/dist/services/compliance/alerting.js +0 -169
  293. package/dist/services/compliance/alerting.js.map +0 -1
  294. package/dist/services/compliance/historical_backfill.d.ts +0 -74
  295. package/dist/services/compliance/historical_backfill.d.ts.map +0 -1
  296. package/dist/services/compliance/historical_backfill.js +0 -244
  297. package/dist/services/compliance/historical_backfill.js.map +0 -1
  298. package/dist/services/compliance/renderer.d.ts +0 -21
  299. package/dist/services/compliance/renderer.d.ts.map +0 -1
  300. package/dist/services/compliance/renderer.js +0 -208
  301. package/dist/services/compliance/renderer.js.map +0 -1
  302. package/dist/services/compliance/routes.d.ts +0 -55
  303. package/dist/services/compliance/routes.d.ts.map +0 -1
  304. package/dist/services/compliance/routes.js +0 -212
  305. package/dist/services/compliance/routes.js.map +0 -1
  306. package/dist/services/docs/site_page_frontmatter.d.ts +0 -58
  307. package/dist/services/docs/site_page_frontmatter.d.ts.map +0 -1
  308. package/dist/services/docs/site_page_frontmatter.js +0 -106
  309. package/dist/services/docs/site_page_frontmatter.js.map +0 -1
  310. package/dist/services/docs/site_page_index_builder.d.ts +0 -49
  311. package/dist/services/docs/site_page_index_builder.d.ts.map +0 -1
  312. package/dist/services/docs/site_page_index_builder.js +0 -152
  313. package/dist/services/docs/site_page_index_builder.js.map +0 -1
  314. package/dist/services/docs/site_pages_route.d.ts +0 -33
  315. package/dist/services/docs/site_pages_route.d.ts.map +0 -1
  316. package/dist/services/docs/site_pages_route.js +0 -124
  317. package/dist/services/docs/site_pages_route.js.map +0 -1
  318. package/dist/services/docs_bundle/frontmatter.d.ts +0 -26
  319. package/dist/services/docs_bundle/frontmatter.d.ts.map +0 -1
  320. package/dist/services/docs_bundle/frontmatter.js +0 -50
  321. package/dist/services/docs_bundle/frontmatter.js.map +0 -1
  322. package/dist/services/docs_bundle/loader.d.ts +0 -28
  323. package/dist/services/docs_bundle/loader.d.ts.map +0 -1
  324. package/dist/services/docs_bundle/loader.js +0 -91
  325. package/dist/services/docs_bundle/loader.js.map +0 -1
  326. package/dist/services/docs_bundle/render_html.d.ts +0 -15
  327. package/dist/services/docs_bundle/render_html.d.ts.map +0 -1
  328. package/dist/services/docs_bundle/render_html.js +0 -48
  329. package/dist/services/docs_bundle/render_html.js.map +0 -1
  330. package/dist/services/docs_bundle/types.d.ts +0 -73
  331. package/dist/services/docs_bundle/types.d.ts.map +0 -1
  332. package/dist/services/docs_bundle/types.js +0 -50
  333. package/dist/services/docs_bundle/types.js.map +0 -1
  334. package/dist/services/docs_install/loader.d.ts +0 -25
  335. package/dist/services/docs_install/loader.d.ts.map +0 -1
  336. package/dist/services/docs_install/loader.js +0 -63
  337. package/dist/services/docs_install/loader.js.map +0 -1
  338. package/dist/services/docs_install/renderer.d.ts +0 -40
  339. package/dist/services/docs_install/renderer.d.ts.map +0 -1
  340. package/dist/services/docs_install/renderer.js +0 -323
  341. package/dist/services/docs_install/renderer.js.map +0 -1
  342. package/dist/services/docs_install/routes.d.ts +0 -20
  343. package/dist/services/docs_install/routes.d.ts.map +0 -1
  344. package/dist/services/docs_install/routes.js +0 -117
  345. package/dist/services/docs_install/routes.js.map +0 -1
  346. package/dist/services/entity_submission/seed_product_feedback_schema.d.ts +0 -11
  347. package/dist/services/entity_submission/seed_product_feedback_schema.d.ts.map +0 -1
  348. package/dist/services/entity_submission/seed_product_feedback_schema.js +0 -45
  349. package/dist/services/entity_submission/seed_product_feedback_schema.js.map +0 -1
  350. package/dist/services/feedback/activation.d.ts +0 -20
  351. package/dist/services/feedback/activation.d.ts.map +0 -1
  352. package/dist/services/feedback/activation.js +0 -66
  353. package/dist/services/feedback/activation.js.map +0 -1
  354. package/dist/services/feedback/admin_proxy.d.ts +0 -73
  355. package/dist/services/feedback/admin_proxy.d.ts.map +0 -1
  356. package/dist/services/feedback/admin_proxy.js +0 -292
  357. package/dist/services/feedback/admin_proxy.js.map +0 -1
  358. package/dist/services/feedback/admin_session.d.ts +0 -36
  359. package/dist/services/feedback/admin_session.d.ts.map +0 -1
  360. package/dist/services/feedback/admin_session.js +0 -147
  361. package/dist/services/feedback/admin_session.js.map +0 -1
  362. package/dist/services/feedback/local_store.d.ts +0 -72
  363. package/dist/services/feedback/local_store.d.ts.map +0 -1
  364. package/dist/services/feedback/local_store.js +0 -95
  365. package/dist/services/feedback/local_store.js.map +0 -1
  366. package/dist/services/feedback/mirror_local_to_entity.d.ts +0 -42
  367. package/dist/services/feedback/mirror_local_to_entity.d.ts.map +0 -1
  368. package/dist/services/feedback/mirror_local_to_entity.js +0 -71
  369. package/dist/services/feedback/mirror_local_to_entity.js.map +0 -1
  370. package/dist/services/feedback/neotoma_payload.d.ts +0 -108
  371. package/dist/services/feedback/neotoma_payload.d.ts.map +0 -1
  372. package/dist/services/feedback/neotoma_payload.js +0 -169
  373. package/dist/services/feedback/neotoma_payload.js.map +0 -1
  374. package/dist/services/feedback/next_check.d.ts +0 -4
  375. package/dist/services/feedback/next_check.d.ts.map +0 -1
  376. package/dist/services/feedback/next_check.js +0 -22
  377. package/dist/services/feedback/next_check.js.map +0 -1
  378. package/dist/services/feedback/seed_schema.d.ts +0 -52
  379. package/dist/services/feedback/seed_schema.d.ts.map +0 -1
  380. package/dist/services/feedback/seed_schema.js +0 -160
  381. package/dist/services/feedback/seed_schema.js.map +0 -1
  382. package/dist/services/feedback/types.d.ts +0 -134
  383. package/dist/services/feedback/types.d.ts.map +0 -1
  384. package/dist/services/feedback/types.js +0 -23
  385. package/dist/services/feedback/types.js.map +0 -1
  386. package/dist/services/feedback/upgrade_guidance_map.d.ts +0 -24
  387. package/dist/services/feedback/upgrade_guidance_map.d.ts.map +0 -1
  388. package/dist/services/feedback/upgrade_guidance_map.js +0 -39
  389. package/dist/services/feedback/upgrade_guidance_map.js.map +0 -1
  390. package/dist/services/feedback/verification_request.d.ts +0 -14
  391. package/dist/services/feedback/verification_request.d.ts.map +0 -1
  392. package/dist/services/feedback/verification_request.js +0 -33
  393. package/dist/services/feedback/verification_request.js.map +0 -1
  394. package/dist/services/feedback_transport.d.ts +0 -15
  395. package/dist/services/feedback_transport.d.ts.map +0 -1
  396. package/dist/services/feedback_transport.js +0 -31
  397. package/dist/services/feedback_transport.js.map +0 -1
  398. package/dist/services/feedback_transport_http.d.ts +0 -14
  399. package/dist/services/feedback_transport_http.d.ts.map +0 -1
  400. package/dist/services/feedback_transport_http.js +0 -40
  401. package/dist/services/feedback_transport_http.js.map +0 -1
  402. package/dist/services/feedback_transport_local.d.ts +0 -20
  403. package/dist/services/feedback_transport_local.d.ts.map +0 -1
  404. package/dist/services/feedback_transport_local.js +0 -152
  405. package/dist/services/feedback_transport_local.js.map +0 -1
  406. package/dist/services/issues/syncIssuesFromGitHub.d.ts +0 -35
  407. package/dist/services/issues/syncIssuesFromGitHub.d.ts.map +0 -1
  408. package/dist/services/issues/syncIssuesFromGitHub.js +0 -193
  409. package/dist/services/issues/syncIssuesFromGitHub.js.map +0 -1
  410. package/dist/services/oauth_pages/render.d.ts +0 -25
  411. package/dist/services/oauth_pages/render.d.ts.map +0 -1
  412. package/dist/services/oauth_pages/render.js +0 -235
  413. package/dist/services/oauth_pages/render.js.map +0 -1
  414. package/dist/services/root_landing/auth_overview.d.ts +0 -60
  415. package/dist/services/root_landing/auth_overview.d.ts.map +0 -1
  416. package/dist/services/root_landing/auth_overview.js +0 -86
  417. package/dist/services/root_landing/auth_overview.js.map +0 -1
  418. package/dist/services/root_landing/cli_overview.d.ts +0 -34
  419. package/dist/services/root_landing/cli_overview.d.ts.map +0 -1
  420. package/dist/services/root_landing/cli_overview.js +0 -123
  421. package/dist/services/root_landing/cli_overview.js.map +0 -1
  422. package/dist/services/root_landing/http_api_overview.d.ts +0 -34
  423. package/dist/services/root_landing/http_api_overview.d.ts.map +0 -1
  424. package/dist/services/root_landing/http_api_overview.js +0 -110
  425. package/dist/services/root_landing/http_api_overview.js.map +0 -1
  426. package/dist/services/root_landing/mcp_overview.d.ts +0 -34
  427. package/dist/services/root_landing/mcp_overview.d.ts.map +0 -1
  428. package/dist/services/root_landing/mcp_overview.js +0 -133
  429. package/dist/services/root_landing/mcp_overview.js.map +0 -1
  430. package/dist/services/sandbox/inspector_redirect.d.ts +0 -41
  431. package/dist/services/sandbox/inspector_redirect.d.ts.map +0 -1
  432. package/dist/services/sandbox/inspector_redirect.js +0 -59
  433. package/dist/services/sandbox/inspector_redirect.js.map +0 -1
  434. package/dist/services/timeline_user_query.d.ts +0 -22
  435. package/dist/services/timeline_user_query.d.ts.map +0 -1
  436. package/dist/services/timeline_user_query.js +0 -60
  437. package/dist/services/timeline_user_query.js.map +0 -1
  438. package/dist/services/usage_stats.d.ts +0 -18
  439. package/dist/services/usage_stats.d.ts.map +0 -1
  440. package/dist/services/usage_stats.js +0 -82
  441. package/dist/services/usage_stats.js.map +0 -1
  442. package/dist/services/verticals/baseline_metadata.d.ts +0 -39
  443. package/dist/services/verticals/baseline_metadata.d.ts.map +0 -1
  444. package/dist/services/verticals/baseline_metadata.js +0 -394
  445. package/dist/services/verticals/baseline_metadata.js.map +0 -1
  446. package/dist/services/verticals/entity_type_registry.d.ts +0 -29
  447. package/dist/services/verticals/entity_type_registry.d.ts.map +0 -1
  448. package/dist/services/verticals/entity_type_registry.js +0 -169
  449. package/dist/services/verticals/entity_type_registry.js.map +0 -1
  450. package/dist/services/verticals/install.d.ts +0 -64
  451. package/dist/services/verticals/install.d.ts.map +0 -1
  452. package/dist/services/verticals/install.js +0 -262
  453. package/dist/services/verticals/install.js.map +0 -1
  454. package/dist/services/verticals/registry.d.ts +0 -131
  455. package/dist/services/verticals/registry.d.ts.map +0 -1
  456. package/dist/services/verticals/registry.js +0 -457
  457. package/dist/services/verticals/registry.js.map +0 -1
  458. package/dist/shared/generated_design_tokens.d.ts +0 -2
  459. package/dist/shared/generated_design_tokens.d.ts.map +0 -1
  460. package/dist/shared/generated_design_tokens.js +0 -3
  461. package/dist/shared/generated_design_tokens.js.map +0 -1
package/dist/actions.d.ts CHANGED
@@ -161,6 +161,8 @@ export declare function storeStructuredForApi(params: {
161
161
  entity_id: string;
162
162
  entity_type: string;
163
163
  observation_id: string;
164
+ entity_snapshot_after: Record<string, unknown> | null;
165
+ deduplicated: boolean;
164
166
  }[];
165
167
  } | {
166
168
  conversation_message_count?: number | undefined;
@@ -178,6 +180,7 @@ export declare function storeStructuredForApi(params: {
178
180
  observation_index: number;
179
181
  entity_type: string;
180
182
  entity_id: string;
183
+ details?: Record<string, unknown>;
181
184
  }[] | undefined;
182
185
  warnings?: {
183
186
  code: string;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAsC9B,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,6BAA6B,C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,MAAM;;;kBAQf,MAAM;yBACC,MAAM;iCACE,MAAM;sCACD,MAAM;;+BA4Xb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;;;2BAwMlC,MAAM;0BACP,MAAM;0BACN,MAAM;;;;;;;;GA4e3B;AAygHD,wBAAsB,eAAe;;;eAmOpC"}
package/dist/actions.js CHANGED
@@ -53,6 +53,7 @@ import { resolveSandboxReportTransport } from "./services/sandbox/transport.js";
53
53
  import { getSqliteDb } from "./repositories/sqlite/sqlite_client.js";
54
54
  import { getMcpAuthToken } from "./crypto/mcp_auth_token.js";
55
55
  import { isOauthKeyCredentialValid, normalizeOauthNextPath, OAuthKeySessionStore, } from "./services/oauth_key_gate.js";
56
+ import { buildGoogleAuthorizeUrl, createGoogleSigninNonce, consumeGoogleSigninNonce, exchangeGoogleAuthorizationCode, getSharedGraphUserId, GoogleIdTokenError, isGoogleSigninEnabled, verifyGoogleIdToken, } from "./services/google_oidc.js";
56
57
  import { AnalyzeSchemaCandidatesRequestSchema, AuditUndeclaredFragmentsRequestSchema, CorrectEntityRequestSchema, CreateInterpretationRequestSchema, CreateRelationshipsRequestSchema, CreateRelationshipRequestSchema, DeleteEntityRequestSchema, DeleteRelationshipRequestSchema, IssuesBulkEntityIdsRequestSchema, IssuesAddMessageRequestSchema, IssuesGetStatusRequestSchema, IssuesSubmitRequestSchema, IssuesSyncRequestSchema, EntitiesQueryRequestSchema, EntitySnapshotRequestSchema, FieldProvenanceRequestSchema, GetSchemaRecommendationsRequestSchema, ListObservationsRequestSchema, ListRelationshipsRequestSchema, MergeEntitiesRequestSchema, SplitEntityRequestSchema, ObservationsQueryRequestSchema, RegisterSchemaRequestSchema, RelationshipSnapshotRequestSchema, RestoreEntityRequestSchema, RestoreRelationshipRequestSchema, RetrieveEntityByIdentifierSchema, RetrieveGraphNeighborhoodSchema, RetrieveRelatedEntitiesSchema, RELATIONSHIP_ENTITY_ID_FORMAT_HINT, RELATIONSHIP_ENTITY_ID_FORMAT_ISSUE_CODE, StoreRequestSchema, UpdateSchemaIncrementalRequestSchema, } from "./shared/action_schemas.js";
57
58
  import { getMimeTypeFromExtension } from "./services/file_text_extraction.js";
58
59
  import { queryEntitiesWithCount } from "./shared/action_handlers/entity_handlers.js";
@@ -1096,6 +1097,16 @@ export function isLocalRequest(req) {
1096
1097
  }
1097
1098
  const OAUTH_KEY_SESSION_COOKIE = "neotoma_oauth_key_session";
1098
1099
  const oauthKeySessions = new OAuthKeySessionStore();
1100
+ /**
1101
+ * Maps an OAuth key-session token to the user_id resolved via Google
1102
+ * sign-in for that browser session. Populated only by the
1103
+ * `/mcp/oauth/google/callback` route; every other credential path
1104
+ * (private key / mnemonic / bearer) never writes here, so
1105
+ * `/mcp/oauth/local-login` falls through to `ensureLocalDevUser()`
1106
+ * exactly as before when this map has no entry — behavior for every
1107
+ * existing deploy (Google flag off) is unchanged.
1108
+ */
1109
+ const googleVerifiedUserBySessionToken = new Map();
1099
1110
  function readCookie(req, name) {
1100
1111
  const header = (req.headers["cookie"] || req.headers["Cookie"] || "");
1101
1112
  if (!header)
@@ -1335,6 +1346,14 @@ function setOAuthKeySessionCookie(req, res) {
1335
1346
  path: "/mcp/oauth",
1336
1347
  maxAge: 15 * 60 * 1000,
1337
1348
  });
1349
+ return token;
1350
+ }
1351
+ /** Resolve the local-auth user_id a Google-verified session (if any) mapped to this request. */
1352
+ function getGoogleVerifiedUserId(req) {
1353
+ const token = readCookie(req, OAUTH_KEY_SESSION_COOKIE);
1354
+ if (!token || !oauthKeySessions.isValid(token))
1355
+ return undefined;
1356
+ return googleVerifiedUserBySessionToken.get(token);
1338
1357
  }
1339
1358
  /**
1340
1359
  * Derive the canonical `@authority` the AAuth profile requires (AAuth §10.3.1).
@@ -1631,11 +1650,11 @@ app.all("/mcp", async (req, res) => {
1631
1650
  const hadSessionHeader = typeof sessionId === "string" && sessionId.length > 0;
1632
1651
  if (hadSessionHeader) {
1633
1652
  logger.warn(`[MCP HTTP] Unknown or expired Mcp-Session-Id (first 8 chars): ${sessionId.slice(0, 8)}... often wrong replica behind a load balancer, API restart, or stale client state`);
1634
- return res.status(503).json({
1653
+ return res.status(404).json({
1635
1654
  jsonrpc: "2.0",
1636
1655
  error: {
1637
1656
  code: -32001,
1638
- message: "Service Unavailable: MCP session is unknown on this API instance. If you run multiple replicas, enable sticky sessions for POST /mcp (or route /mcp to a single instance). Otherwise restart the MCP client so initialize runs again after a server restart.",
1657
+ message: "Not Found: MCP session is unknown or expired on this API instance. The client should re-initialize by sending a new InitializeRequest without a session ID. If you run multiple replicas, enable sticky sessions for POST /mcp (or route /mcp to a single instance).",
1639
1658
  },
1640
1659
  id: rpcId,
1641
1660
  });
@@ -2104,10 +2123,19 @@ app.get("/mcp/oauth/key-auth", async (req, res) => {
2104
2123
  const nextPathEscaped = escapeHtml(nextPath);
2105
2124
  const hasBearerFallback = Boolean((process.env.NEOTOMA_BEARER_TOKEN || "").trim());
2106
2125
  const defaultCredentialMode = hasBearerFallback ? "bearer" : "private_key";
2126
+ const googleEnabled = isGoogleSigninEnabled();
2127
+ const googleStartHref = `/mcp/oauth/google/start?next=${encodeURIComponent(nextPath)}`;
2107
2128
  return res.send(renderOauthPage({
2108
2129
  title: "Authenticate OAuth preflight",
2109
2130
  subtitle: "Choose one credential path below, then continue to complete OAuth authorization.",
2110
2131
  contentHtml: `
2132
+ ${googleEnabled
2133
+ ? `<div class="actions" style="margin-bottom: 1rem;">
2134
+ <a class="btn-link" href="${escapeHtml(googleStartHref)}">Sign in with Google</a>
2135
+ </div>
2136
+ <div class="notice">Signs you in as your own Neotoma user if your Google account's verified email is on this server's approved list. Doesn't require a private key.</div>
2137
+ <hr style="margin: 1.5rem 0; border: none; border-top: 1px solid hsl(var(--border));" />`
2138
+ : ""}
2111
2139
  <form method="post" action="/mcp/oauth/key-auth" id="oauth-key-auth-form">
2112
2140
  <input type="hidden" name="next" value="${nextPathEscaped}" />
2113
2141
  <input type="hidden" name="credential_mode" id="credential_mode" value="${defaultCredentialMode}" />
@@ -2213,6 +2241,107 @@ app.post("/mcp/oauth/key-auth", express.urlencoded({ extended: true }), async (r
2213
2241
  setOAuthKeySessionCookie(req, res);
2214
2242
  return res.redirect(nextPath);
2215
2243
  });
2244
+ /**
2245
+ * "Sign in with Google" entry point. Additive to, and independent of, the
2246
+ * key/mnemonic/bearer credential form above — feature-flagged off unless
2247
+ * NEOTOMA_GOOGLE_CLIENT_ID + NEOTOMA_APPROVED_EMAILS are both configured.
2248
+ * AUTH-LAYER ONLY: this establishes who the person is (their own user_id
2249
+ * via the existing per-email primitive); it does not touch data-sharing or
2250
+ * read-scoping.
2251
+ */
2252
+ app.get("/mcp/oauth/google/start", async (req, res) => {
2253
+ if (!isGoogleSigninEnabled()) {
2254
+ return res.status(404).send("Not found");
2255
+ }
2256
+ const nextPath = normalizeOauthNextPath(req.query.next || undefined);
2257
+ const nonce = createGoogleSigninNonce(nextPath);
2258
+ const redirectUri = `${req.protocol}://${req.get("host") || ""}/mcp/oauth/google/callback`;
2259
+ try {
2260
+ const authorizeUrl = buildGoogleAuthorizeUrl({ redirectUri, nonce });
2261
+ return res.redirect(authorizeUrl);
2262
+ }
2263
+ catch (error) {
2264
+ logError("GoogleOAuthStart", req, error);
2265
+ return res.status(500).send(error?.message ?? "Failed to start Google sign-in");
2266
+ }
2267
+ });
2268
+ app.get("/mcp/oauth/google/callback", async (req, res) => {
2269
+ if (!isGoogleSigninEnabled()) {
2270
+ return res.status(404).send("Not found");
2271
+ }
2272
+ const errorParam = req.query.error?.trim();
2273
+ const code = req.query.code?.trim();
2274
+ const nonceParam = req.query.state?.trim();
2275
+ const failWith = (subtitle) => {
2276
+ res.setHeader("Content-Type", "text/html; charset=utf-8");
2277
+ return res.status(401).send(renderOauthPage({
2278
+ title: "Google sign-in failed",
2279
+ subtitle,
2280
+ contentHtml: `<div class="actions">
2281
+ <a class="btn-link secondary" href="/mcp/oauth/key-auth">Back to authentication</a>
2282
+ </div>`,
2283
+ }));
2284
+ };
2285
+ if (errorParam) {
2286
+ logger.warn("[Google OAuth] Callback returned an error", { error: errorParam });
2287
+ return failWith("Google sign-in was cancelled or denied.");
2288
+ }
2289
+ if (!code || !nonceParam) {
2290
+ return failWith("Missing code or state from Google callback.");
2291
+ }
2292
+ const nonceEntry = consumeGoogleSigninNonce(nonceParam);
2293
+ if (!nonceEntry) {
2294
+ return failWith("This sign-in link has expired or was already used. Please try again.");
2295
+ }
2296
+ // Same nextPath contract as the key/mnemonic/bearer path above: normalized
2297
+ // back to a /mcp/oauth/* path (typically /mcp/oauth/authorize?...), never
2298
+ // an external URL.
2299
+ const nextPath = normalizeOauthNextPath(nonceEntry.next);
2300
+ const redirectUri = `${req.protocol}://${req.get("host") || ""}/mcp/oauth/google/callback`;
2301
+ try {
2302
+ const { idToken } = await exchangeGoogleAuthorizationCode({ code, redirectUri });
2303
+ const { email } = await verifyGoogleIdToken(idToken);
2304
+ // Resolve the verified email to a stable user_id via the EXISTING per-email
2305
+ // primitive (local_auth.ts) — the same primitive createLocalAuthUser /
2306
+ // hashEmailToUserId already uses elsewhere. By default this person is
2307
+ // admitted as their own isolated user_id, same as any other local-auth user.
2308
+ const { createLocalAuthUser } = await import("./services/local_auth.js");
2309
+ const { randomBytes } = await import("node:crypto");
2310
+ // Password is unused for Google-authenticated users (they never log in
2311
+ // with it) — generate an unguessable throwaway so createLocalAuthUser's
2312
+ // shared code path is satisfied without weakening any other account.
2313
+ const throwawayPassword = randomBytes(32).toString("hex");
2314
+ const perEmailUser = createLocalAuthUser(email, throwawayPassword);
2315
+ // Shared-graph opt-in: when NEOTOMA_SHARED_GRAPH_USER_ID is set, an
2316
+ // approved teammate (the email already passed the allowlist inside
2317
+ // verifyGoogleIdToken) is bound to the shared graph's user_id instead of
2318
+ // their isolated per-email one — so the whole allowlisted team, plus the
2319
+ // bearer/MCP identity that owns the data, share one populated graph. Unset
2320
+ // → isolated per-email behavior (unchanged). See getSharedGraphUserId.
2321
+ const resolvedUserId = getSharedGraphUserId() ?? perEmailUser.id;
2322
+ // Mark this browser session as Google-verified and bound to the resolved
2323
+ // user_id, exactly the same OAuth key-session cookie the private-key/
2324
+ // mnemonic/bearer path sets. `/mcp/oauth/authorize` -> `/mcp/oauth/
2325
+ // local-login` then runs completely unmodified, except local-login now
2326
+ // resolves the user via this session instead of always ensureLocalDevUser().
2327
+ const sessionToken = setOAuthKeySessionCookie(req, res);
2328
+ googleVerifiedUserBySessionToken.set(sessionToken, resolvedUserId);
2329
+ return res.redirect(nextPath);
2330
+ }
2331
+ catch (error) {
2332
+ logError("GoogleOAuthCallback", req, error);
2333
+ if (error instanceof GoogleIdTokenError) {
2334
+ if (error.code === "EMAIL_NOT_APPROVED") {
2335
+ return failWith("Your Google account is not on the approved list for this server.");
2336
+ }
2337
+ if (error.code === "EMAIL_NOT_VERIFIED") {
2338
+ return failWith("Your Google account's email is not verified.");
2339
+ }
2340
+ return failWith("Google sign-in could not be verified.");
2341
+ }
2342
+ return failWith(error?.message ?? "Google sign-in failed.");
2343
+ }
2344
+ });
2216
2345
  // RFC 8414 authorization endpoint (GET) for Cursor and other OAuth clients
2217
2346
  app.get("/mcp/oauth/authorize", async (req, res) => {
2218
2347
  try {
@@ -2263,7 +2392,10 @@ app.get("/mcp/oauth/authorize", async (req, res) => {
2263
2392
  // When reached via tunnel, only allow redirect_uri to localhost, app schemes, or OpenAI Custom GPT
2264
2393
  if (!isLocalRequest(req)) {
2265
2394
  const { isRedirectUriAllowedForTunnel } = await import("./services/mcp_oauth.js");
2266
- if (!isRedirectUriAllowedForTunnel(redirect_uri)) {
2395
+ // Public host as seen from outside the tunnel (x-forwarded-host set by the
2396
+ // proxy) so an Inspector callback on this instance's own origin is allowed.
2397
+ const selfHost = req.header("x-forwarded-host")?.split(",")[0]?.trim() || req.get("host");
2398
+ if (!isRedirectUriAllowedForTunnel(redirect_uri, selfHost)) {
2267
2399
  logger.warn("[MCP OAuth] Authorize rejected: redirect_uri not allowed for tunnel", {
2268
2400
  redirect_uri: sanitizeRedirectUriForLog(redirect_uri),
2269
2401
  });
@@ -2378,9 +2510,15 @@ app.get("/mcp/oauth/local-login", async (req, res) => {
2378
2510
  }));
2379
2511
  }
2380
2512
  try {
2381
- const devUser = ensureLocalDevUser();
2513
+ // If this browser session was admitted via Google sign-in (see
2514
+ // /mcp/oauth/google/callback), complete authorization as THAT verified
2515
+ // user's own user_id instead of the shared dev user. Every other path
2516
+ // (no Google session on this cookie — the default, and the only
2517
+ // possibility when the Google feature flag is off) is unchanged.
2518
+ const googleUserId = getGoogleVerifiedUserId(req);
2519
+ const resolvedUserId = googleUserId ?? ensureLocalDevUser().id;
2382
2520
  const { completeLocalAuthorization } = await import("./services/mcp_oauth.js");
2383
- const { connectionId, redirectUri, clientState } = await completeLocalAuthorization(state, devUser.id);
2521
+ const { connectionId, redirectUri, clientState } = await completeLocalAuthorization(state, resolvedUserId);
2384
2522
  const frontendBase = process.env.NEOTOMA_FRONTEND_URL || process.env.FRONTEND_URL || "http://localhost:5195";
2385
2523
  const frontendOauth = `${frontendBase}/oauth`;
2386
2524
  if (redirectUri) {
@@ -5473,10 +5611,33 @@ export async function storeStructuredForApi(params) {
5473
5611
  }
5474
5612
  const { listObservationsForSource } = await import("./services/observation_storage.js");
5475
5613
  const existingObs = await listObservationsForSource(existingSource.id, userId);
5614
+ // Issue #1860 (mirrors the #1840 MCP-path fix in src/server.ts): on a
5615
+ // deduplicated (idempotency-replay) store, the early return must still
5616
+ // surface the current snapshot in `entity_snapshot_after` and mark each
5617
+ // entry `deduplicated: true` — matching the MCP transport. Previously the
5618
+ // offline/HTTP path omitted both, so callers validating writes by
5619
+ // inspecting the response saw a false empty snapshot even though
5620
+ // getSnapshot returned the real one. No new observation is written, so we
5621
+ // read the persisted snapshot directly.
5622
+ const { getSnapshot: getSnapshotForReplay } = await import("./services/snapshot_computation.js");
5623
+ const replaySnapshotByEntityId = new Map();
5624
+ for (const replayEntityId of new Set(existingObs.map((obs) => obs.entity_id))) {
5625
+ try {
5626
+ const snap = await getSnapshotForReplay(replayEntityId, userId);
5627
+ if (snap?.snapshot) {
5628
+ replaySnapshotByEntityId.set(replayEntityId, snap.snapshot);
5629
+ }
5630
+ }
5631
+ catch (snapErr) {
5632
+ logger.warn(`store replay: snapshot fetch failed for ${replayEntityId}: ${snapErr instanceof Error ? snapErr.message : String(snapErr)}`);
5633
+ }
5634
+ }
5476
5635
  const existingEntities = existingObs.map((obs) => ({
5477
5636
  entity_id: obs.entity_id,
5478
5637
  entity_type: obs.entity_type,
5479
5638
  observation_id: obs.id,
5639
+ entity_snapshot_after: replaySnapshotByEntityId.get(obs.entity_id) ?? null,
5640
+ deduplicated: true,
5480
5641
  }));
5481
5642
  // Idempotency replay: the source row already exists for
5482
5643
  // (user_id, idempotency_key) with identical content. No new observations
@@ -5811,6 +5972,12 @@ export async function storeStructuredForApi(params) {
5811
5972
  // entity_id.
5812
5973
  const priorSnapshotByEntityId = new Map();
5813
5974
  const newSnapshotByEntityId = new Map();
5975
+ // #1963: auto-link may retract a stale reference-field edge (e.g. a contact's
5976
+ // organization moved companies). A retraction *failure* must not be silent —
5977
+ // that would reproduce the very silent-drift bug this fix exists to close, one
5978
+ // layer up. Accumulate per-observation retraction outcomes here so the
5979
+ // schemaStoreWarnings pass below can surface them on the store response.
5980
+ const autoLinkRetractionByObsIndex = new Map();
5814
5981
  for (const r of resolved) {
5815
5982
  let observation_id = null;
5816
5983
  let snapshotAfter = null;
@@ -5894,14 +6061,25 @@ export async function storeStructuredForApi(params) {
5894
6061
  const schemaEntry = await schemaRegistry.loadActiveSchema(r.entity_type, userId);
5895
6062
  if (schemaEntry?.schema_definition?.reference_fields?.length) {
5896
6063
  const { autoLinkReferenceFields } = await import("./services/schema_reference_linking.js");
5897
- await autoLinkReferenceFields({
6064
+ const autoLinkResult = await autoLinkReferenceFields({
5898
6065
  entityId: r.entity_id,
5899
6066
  entityType: r.entity_type,
5900
6067
  fields: r.fields,
5901
6068
  schema: schemaEntry.schema_definition,
5902
6069
  userId,
5903
6070
  sourceId: observationSourceId,
6071
+ commit,
5904
6072
  });
6073
+ if (autoLinkResult.retracted > 0 || autoLinkResult.retraction_failures > 0) {
6074
+ autoLinkRetractionByObsIndex.set(r.observation_index, {
6075
+ entity_type: r.entity_type,
6076
+ entity_id: r.entity_id,
6077
+ retracted: autoLinkResult.retracted,
6078
+ retraction_failures: autoLinkResult.retraction_failures,
6079
+ failed_target_entity_ids: autoLinkResult.failed_retraction_target_entity_ids,
6080
+ failed_retractions: autoLinkResult.failed_retractions,
6081
+ });
6082
+ }
5905
6083
  }
5906
6084
  }
5907
6085
  catch (linkErr) {
@@ -6231,6 +6409,46 @@ export async function storeStructuredForApi(params) {
6231
6409
  }
6232
6410
  }
6233
6411
  }
6412
+ // #1963: surface auto-link edge retractions on the store response so a
6413
+ // retraction — and especially a retraction *failure* — is never silent. A
6414
+ // failure means a stale reference-field edge may still be live despite the
6415
+ // store reporting success, so it is emitted as its own actionable warning.
6416
+ for (const [obsIndex, rec] of autoLinkRetractionByObsIndex) {
6417
+ if (rec.retraction_failures > 0) {
6418
+ schemaStoreWarnings.push({
6419
+ code: "AUTO_LINK_RETRACTION_FAILED",
6420
+ message: `Auto-link retraction failed for ${rec.retraction_failures} stale ` +
6421
+ `reference-field edge(s) on ${rec.entity_type}/${rec.entity_id}. ` +
6422
+ `A superseded edge (e.g. a prior works_at) may still be live even though ` +
6423
+ `the store succeeded. To clean up, call delete_relationship for each ` +
6424
+ `stale edge in details.stale_edges, or re-run the store.`,
6425
+ observation_index: obsIndex,
6426
+ entity_type: rec.entity_type,
6427
+ entity_id: rec.entity_id,
6428
+ // Structured remediation: each entry is a ready-to-use delete_relationship
6429
+ // argument set, so the caller needs no knowledge of its own schema.
6430
+ details: {
6431
+ stale_edges: rec.failed_retractions.map((f) => ({
6432
+ source_entity_id: rec.entity_id,
6433
+ target_entity_id: f.target_entity_id,
6434
+ relationship_type: f.relationship_type,
6435
+ field_name: f.field,
6436
+ })),
6437
+ },
6438
+ });
6439
+ }
6440
+ else if (rec.retracted > 0) {
6441
+ schemaStoreWarnings.push({
6442
+ code: "AUTO_LINK_EDGE_RETRACTED",
6443
+ message: `Retracted ${rec.retracted} stale auto-linked reference-field edge(s) on ` +
6444
+ `${rec.entity_type}/${rec.entity_id} because the field's resolved target ` +
6445
+ `changed (#1963).`,
6446
+ observation_index: obsIndex,
6447
+ entity_type: rec.entity_type,
6448
+ entity_id: rec.entity_id,
6449
+ });
6450
+ }
6451
+ }
6234
6452
  const unknownFieldNames = Array.from(unknownFieldNamesSet).sort();
6235
6453
  // Conditional hint (#1549): update_schema_incremental requires the schema to
6236
6454
  // declare canonical_name_fields, else it dead-ends on
@@ -8505,6 +8723,14 @@ app.post("/get_authenticated_user", async (req, res) => {
8505
8723
  const storage = config.storageBackend === "local"
8506
8724
  ? {
8507
8725
  storage_backend: "local",
8726
+ // Surface the active environment + DB so an agent can confirm it is
8727
+ // on the intended graph before writing (#1905). On a fresh npm
8728
+ // install the CLI local transport defaults to production while the
8729
+ // server defaults to development; exposing `environment` here lets
8730
+ // a caller detect the split (e.g. writing to dev while an unflagged
8731
+ // CLI reads empty prod) instead of discovering it via silent-empty
8732
+ // results.
8733
+ environment: config.environment,
8508
8734
  data_dir: config.dataDir,
8509
8735
  sqlite_db: config.sqlitePath,
8510
8736
  }