@remnic/core 9.3.689 → 9.3.690

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 (158) hide show
  1. package/dist/access-boundary.d.ts +5 -4
  2. package/dist/access-boundary.js +10 -9
  3. package/dist/access-cli.js +86 -22
  4. package/dist/access-cli.js.map +1 -1
  5. package/dist/access-http.d.ts +4 -3
  6. package/dist/access-http.js +13 -12
  7. package/dist/access-mcp.d.ts +11 -3
  8. package/dist/access-mcp.js +12 -11
  9. package/dist/access-operations.d.ts +11 -5
  10. package/dist/access-operations.js +13 -10
  11. package/dist/{access-service-DmCHJ4cH.d.ts → access-service-Dujr3MTm.d.ts} +62 -2
  12. package/dist/access-service.d.ts +4 -3
  13. package/dist/access-service.js +9 -8
  14. package/dist/access-surface-catalog.d.ts +4 -3
  15. package/dist/access-surface-catalog.js +2 -0
  16. package/dist/access-surface-catalog.js.map +1 -1
  17. package/dist/bootstrap.d.ts +3 -2
  18. package/dist/briefing.d.ts +1 -0
  19. package/dist/briefing.js +3 -2
  20. package/dist/buffer.d.ts +1 -0
  21. package/dist/{catalog-COqWZlZ6.d.ts → catalog-CKPtJ114.d.ts} +1 -1
  22. package/dist/causal-consolidation.js +4 -3
  23. package/dist/causal-consolidation.js.map +1 -1
  24. package/dist/{chunk-B4XVLHJA.js → chunk-2N6UNJSX.js} +2 -2
  25. package/dist/{chunk-OWFY6NGQ.js → chunk-46URPRE6.js} +2 -2
  26. package/dist/chunk-46URPRE6.js.map +1 -0
  27. package/dist/{chunk-4N3TFFPH.js → chunk-54PVJDO5.js} +2 -2
  28. package/dist/{chunk-PH3HOKYW.js → chunk-67MMWC74.js} +2 -2
  29. package/dist/{chunk-STOEE37X.js → chunk-BKAMHZYR.js} +2 -2
  30. package/dist/{chunk-JZBFL7RI.js → chunk-CE6CBRCV.js} +429 -2237
  31. package/dist/chunk-CE6CBRCV.js.map +1 -0
  32. package/dist/{chunk-UHUZXWDX.js → chunk-CP2NZQLT.js} +15 -4
  33. package/dist/chunk-CP2NZQLT.js.map +1 -0
  34. package/dist/{chunk-BLIWOONZ.js → chunk-CUNTLEJP.js} +4 -12
  35. package/dist/chunk-CUNTLEJP.js.map +1 -0
  36. package/dist/{chunk-W63OY3J7.js → chunk-CWE74HRG.js} +3 -3
  37. package/dist/{chunk-VX6OBUDW.js → chunk-GR77Z2BM.js} +2 -2
  38. package/dist/{chunk-SAEZIIID.js → chunk-LXIEXSHU.js} +2 -2
  39. package/dist/{chunk-Z2M6YTAJ.js → chunk-NSVXK7M5.js} +33 -4
  40. package/dist/chunk-NSVXK7M5.js.map +1 -0
  41. package/dist/{chunk-UXLZOVCN.js → chunk-OMKUJTVJ.js} +37 -5
  42. package/dist/chunk-OMKUJTVJ.js.map +1 -0
  43. package/dist/{chunk-GS55WYRL.js → chunk-PHZKALOE.js} +2 -2
  44. package/dist/{chunk-6O6A6YUO.js → chunk-RGNEARXW.js} +3 -3
  45. package/dist/{chunk-4FE2K57M.js → chunk-RTFAZOIR.js} +2 -2
  46. package/dist/{chunk-UTYBJR7M.js → chunk-SB6CQTKP.js} +2 -2
  47. package/dist/chunk-SVOZFLIQ.js +16 -0
  48. package/dist/chunk-SVOZFLIQ.js.map +1 -0
  49. package/dist/{chunk-JPETDXED.js → chunk-TYF3D4MS.js} +2 -2
  50. package/dist/{chunk-WIHPNY65.js → chunk-UD5OKH4J.js} +2 -2
  51. package/dist/{chunk-QANVLERJ.js → chunk-UPIBE2DK.js} +2 -2
  52. package/dist/{chunk-RHXFYIHA.js → chunk-WROKD3XC.js} +33 -18
  53. package/dist/chunk-WROKD3XC.js.map +1 -0
  54. package/dist/{chunk-2SNKUSQC.js → chunk-X5J3JZR3.js} +4 -4
  55. package/dist/{chunk-OV4D5T7V.js → chunk-X7RLU5CR.js} +2 -2
  56. package/dist/{chunk-QSQW54U5.js → chunk-XKUKJIOY.js} +30 -7
  57. package/dist/chunk-XKUKJIOY.js.map +1 -0
  58. package/dist/{chunk-XU7363OX.js → chunk-Z7KILAOU.js} +603 -9
  59. package/dist/chunk-Z7KILAOU.js.map +1 -0
  60. package/dist/chunk-ZU7N3S6V.js +2190 -0
  61. package/dist/chunk-ZU7N3S6V.js.map +1 -0
  62. package/dist/{chunk-T422SYM6.js → chunk-ZUDM75KG.js} +5 -5
  63. package/dist/{cli-D8nZ2MPH.d.ts → cli-BkDp6WNi.d.ts} +2 -2
  64. package/dist/cli.d.ts +5 -4
  65. package/dist/cli.js +25 -23
  66. package/dist/compounding/engine.d.ts +1 -0
  67. package/dist/compounding/engine.js +3 -2
  68. package/dist/connectors/codex-materialize-runner.js +3 -2
  69. package/dist/connectors/index.js +3 -2
  70. package/dist/consolidation-provenance-check.d.ts +1 -0
  71. package/dist/consolidation-undo.d.ts +1 -0
  72. package/dist/contradiction/index.d.ts +1 -0
  73. package/dist/conversation-index/backend.js +2 -2
  74. package/dist/entity-retrieval.d.ts +1 -0
  75. package/dist/entity-retrieval.js +3 -2
  76. package/dist/explicit-capture.d.ts +3 -2
  77. package/dist/index.d.ts +6 -5
  78. package/dist/index.js +34 -31
  79. package/dist/index.js.map +1 -1
  80. package/dist/lcm/engine.js +2 -2
  81. package/dist/lcm/index.js +2 -2
  82. package/dist/maintenance/memory-governance.js +3 -2
  83. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -2
  84. package/dist/maintenance/rebuild-memory-projection.js +4 -3
  85. package/dist/mcp-memory-inspector-app.d.ts +4 -3
  86. package/dist/memory-worth-outcomes.d.ts +1 -0
  87. package/dist/namespaces/migrate.d.ts +2 -1
  88. package/dist/namespaces/migrate.js +8 -7
  89. package/dist/namespaces/search.js +4 -4
  90. package/dist/namespaces/storage.d.ts +2 -1
  91. package/dist/namespaces/storage.js +3 -2
  92. package/dist/operator-toolkit.d.ts +1 -0
  93. package/dist/operator-toolkit.js +11 -9
  94. package/dist/{orchestrator-CA6ouzBn.d.ts → orchestrator-B7ixmUkP.d.ts} +145 -1
  95. package/dist/orchestrator.d.ts +3 -2
  96. package/dist/orchestrator.js +18 -16
  97. package/dist/schemas.d.ts +10 -10
  98. package/dist/search/factory.js +3 -3
  99. package/dist/search/index.js +3 -3
  100. package/dist/semantic-consolidation.js +4 -3
  101. package/dist/semantic-rule-promotion.js +3 -2
  102. package/dist/semantic-rule-verifier.js +3 -2
  103. package/dist/storage.d.ts +3 -27
  104. package/dist/storage.js +5 -3
  105. package/dist/structured-attributes.d.ts +29 -0
  106. package/dist/structured-attributes.js +8 -0
  107. package/dist/structured-attributes.js.map +1 -0
  108. package/dist/temporal-supersession.d.ts +1 -0
  109. package/dist/tier-migration.d.ts +1 -0
  110. package/dist/verified-recall.js +3 -2
  111. package/package.json +2 -2
  112. package/src/access-boundary.ts +2 -1
  113. package/src/access-cli.test.ts +40 -0
  114. package/src/access-cli.ts +90 -2
  115. package/src/access-http.ts +35 -6
  116. package/src/access-mcp.ts +34 -0
  117. package/src/access-operations.ts +45 -0
  118. package/src/access-service.ts +60 -0
  119. package/src/access-surface-catalog.test.ts +1 -1
  120. package/src/access-surface-catalog.ts +2 -0
  121. package/src/cli.ts +18 -0
  122. package/src/coding/architecture-card.test.ts +544 -0
  123. package/src/coding/architecture-card.ts +687 -0
  124. package/src/coding/architecture-surfaces.test.ts +579 -0
  125. package/src/coding/architecture-surfaces.ts +457 -0
  126. package/src/maintenance/namespace-maintenance-fanout.test.ts +595 -0
  127. package/src/maintenance/namespace-maintenance-fanout.ts +318 -0
  128. package/src/maintenance/namespace-planner.ts +74 -16
  129. package/src/operator-toolkit.ts +25 -0
  130. package/src/orchestrator.ts +144 -0
  131. package/src/storage.ts +6 -20
  132. package/src/structured-attributes.ts +39 -0
  133. package/dist/chunk-BLIWOONZ.js.map +0 -1
  134. package/dist/chunk-JZBFL7RI.js.map +0 -1
  135. package/dist/chunk-OWFY6NGQ.js.map +0 -1
  136. package/dist/chunk-QSQW54U5.js.map +0 -1
  137. package/dist/chunk-RHXFYIHA.js.map +0 -1
  138. package/dist/chunk-UHUZXWDX.js.map +0 -1
  139. package/dist/chunk-UXLZOVCN.js.map +0 -1
  140. package/dist/chunk-XU7363OX.js.map +0 -1
  141. package/dist/chunk-Z2M6YTAJ.js.map +0 -1
  142. /package/dist/{chunk-B4XVLHJA.js.map → chunk-2N6UNJSX.js.map} +0 -0
  143. /package/dist/{chunk-4N3TFFPH.js.map → chunk-54PVJDO5.js.map} +0 -0
  144. /package/dist/{chunk-PH3HOKYW.js.map → chunk-67MMWC74.js.map} +0 -0
  145. /package/dist/{chunk-STOEE37X.js.map → chunk-BKAMHZYR.js.map} +0 -0
  146. /package/dist/{chunk-W63OY3J7.js.map → chunk-CWE74HRG.js.map} +0 -0
  147. /package/dist/{chunk-VX6OBUDW.js.map → chunk-GR77Z2BM.js.map} +0 -0
  148. /package/dist/{chunk-SAEZIIID.js.map → chunk-LXIEXSHU.js.map} +0 -0
  149. /package/dist/{chunk-GS55WYRL.js.map → chunk-PHZKALOE.js.map} +0 -0
  150. /package/dist/{chunk-6O6A6YUO.js.map → chunk-RGNEARXW.js.map} +0 -0
  151. /package/dist/{chunk-4FE2K57M.js.map → chunk-RTFAZOIR.js.map} +0 -0
  152. /package/dist/{chunk-UTYBJR7M.js.map → chunk-SB6CQTKP.js.map} +0 -0
  153. /package/dist/{chunk-JPETDXED.js.map → chunk-TYF3D4MS.js.map} +0 -0
  154. /package/dist/{chunk-WIHPNY65.js.map → chunk-UD5OKH4J.js.map} +0 -0
  155. /package/dist/{chunk-QANVLERJ.js.map → chunk-UPIBE2DK.js.map} +0 -0
  156. /package/dist/{chunk-2SNKUSQC.js.map → chunk-X5J3JZR3.js.map} +0 -0
  157. /package/dist/{chunk-OV4D5T7V.js.map → chunk-X7RLU5CR.js.map} +0 -0
  158. /package/dist/{chunk-T422SYM6.js.map → chunk-ZUDM75KG.js.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  NamespaceStorageRouter
3
- } from "./chunk-WIHPNY65.js";
3
+ } from "./chunk-UD5OKH4J.js";
4
4
  import {
5
5
  namespaceCollectionName
6
- } from "./chunk-SAEZIIID.js";
6
+ } from "./chunk-LXIEXSHU.js";
7
7
  import {
8
8
  namespaceIdentityFromToken,
9
9
  namespaceIdentityToken
@@ -204,4 +204,4 @@ export {
204
204
  verifyNamespaces,
205
205
  runNamespaceMigration
206
206
  };
207
- //# sourceMappingURL=chunk-W63OY3J7.js.map
207
+ //# sourceMappingURL=chunk-CWE74HRG.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-SFQ6QNL7.js";
7
7
  import {
8
8
  StorageManager
9
- } from "./chunk-BLIWOONZ.js";
9
+ } from "./chunk-CUNTLEJP.js";
10
10
  import {
11
11
  buildLifecycleEventsForMemory,
12
12
  sortMemoryLifecycleEvents
@@ -74,4 +74,4 @@ export {
74
74
  backupExistingLedger,
75
75
  rebuildMemoryLifecycleLedger
76
76
  };
77
- //# sourceMappingURL=chunk-VX6OBUDW.js.map
77
+ //# sourceMappingURL=chunk-GR77Z2BM.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createSearchBackend
3
- } from "./chunk-JPETDXED.js";
3
+ } from "./chunk-TYF3D4MS.js";
4
4
  import {
5
5
  namespaceIdentityToken,
6
6
  normalizeNamespaceIdentity
@@ -401,4 +401,4 @@ export {
401
401
  namespaceCollectionName,
402
402
  NamespaceSearchRouter
403
403
  };
404
- //# sourceMappingURL=chunk-SAEZIIID.js.map
404
+ //# sourceMappingURL=chunk-LXIEXSHU.js.map
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-UDJLF3BO.js";
4
4
  import {
5
5
  defineOperation
6
- } from "./chunk-OWFY6NGQ.js";
6
+ } from "./chunk-46URPRE6.js";
7
7
  import {
8
8
  DECISION_SUBCOMMANDS
9
- } from "./chunk-XU7363OX.js";
9
+ } from "./chunk-Z7KILAOU.js";
10
10
 
11
11
  // src/access-operations.ts
12
12
  import { z } from "zod";
@@ -107,11 +107,39 @@ var codingDecisionOperation = defineOperation({
107
107
  return { result };
108
108
  }
109
109
  });
110
+ var codingArchitectureSchema = z.preprocess(
111
+ (data) => {
112
+ if (data !== null && typeof data === "object" && !Array.isArray(data)) {
113
+ const obj = data;
114
+ const cleaned = {};
115
+ for (const [key, value] of Object.entries(obj)) {
116
+ if (value !== null) cleaned[key] = value;
117
+ }
118
+ return cleaned;
119
+ }
120
+ return data;
121
+ },
122
+ z.object({
123
+ subcommand: z.enum(["get", "refresh"]),
124
+ sessionKey: z.string().optional(),
125
+ namespace: z.string().optional()
126
+ })
127
+ );
128
+ var codingArchitectureOperation = defineOperation({
129
+ name: "coding_architecture",
130
+ description: "Get or refresh the architecture card for the session's coding namespace (issue #1548 Track A PR 3).",
131
+ schema: codingArchitectureSchema,
132
+ handler: async (input, ctx) => {
133
+ const result = await ctx.service.codingArchitecture(input, ctx.authenticatedPrincipal);
134
+ return { result };
135
+ }
136
+ });
110
137
  var REGISTERED_OPERATIONS = [
111
138
  memoryGetOperation.spec.name,
112
139
  memorySearchOperation.spec.name,
113
140
  memoryStoreOperation.spec.name,
114
- codingDecisionOperation.spec.name
141
+ codingDecisionOperation.spec.name,
142
+ codingArchitectureOperation.spec.name
115
143
  ];
116
144
 
117
145
  export {
@@ -119,6 +147,7 @@ export {
119
147
  memorySearchOperation,
120
148
  memoryStoreOperation,
121
149
  codingDecisionOperation,
150
+ codingArchitectureOperation,
122
151
  REGISTERED_OPERATIONS
123
152
  };
124
- //# sourceMappingURL=chunk-Z2M6YTAJ.js.map
153
+ //# sourceMappingURL=chunk-NSVXK7M5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/access-operations.ts"],"sourcesContent":["/**\n * Pilot operation definitions for the access boundary (issue #1525).\n *\n * Three operations migrate through the registry in this PR — `memory_get`,\n * `memory_search`, and the `memory_store` write op — so the boundary's\n * normalization matrix (rules 17/28/36/48/51) and shared error mapping reach\n * MCP, HTTP, and CLI from one place. Domain-group migrations (memory ops →\n * connectors → namespaces …) land as follow-up PRs that add `defineOperation`\n * calls here and delete the surface-local validation they replace.\n *\n * Importing this module for its side effects registers the pilot operations;\n * surfaces then dispatch via {@link getOperation} from `./access-boundary.js`.\n */\n\nimport { z } from \"zod\";\n\nimport { defineOperation } from \"./access-boundary.js\";\nimport { memoryStoreRequestSchema, type MemoryStoreRequest } from \"./access-schema.js\";\nimport type {\n EngramAccessMemoryResponse,\n EngramAccessWriteResponse,\n} from \"./access-service.js\";\nimport {\n DECISION_SUBCOMMANDS,\n type DecisionSurfaceRequest,\n type DecisionSurfaceResponse,\n} from \"./coding/decision-surfaces.js\";\nimport {\n type ArchitectureSurfaceRequest,\n type ArchitectureSurfaceResponse,\n} from \"./coding/architecture-surfaces.js\";\n\n// ---------------------------------------------------------------------------\n// memory_get — fetch one memory by id\n// ---------------------------------------------------------------------------\n\n/**\n * `memoryId` is required and non-empty (rule 51: the MCP dispatcher previously\n * fell back to `typeof args.memoryId === \"string\" ? args.memoryId : \"\"`,\n * silently passing an empty id into the service). `namespace` is\n * `.nullable().optional()` because MCP clients send `null` (gotcha #2).\n * `namespace` has no `.min(1)` because the pre-boundary handlers forwarded\n * empty/whitespace strings, and `resolveNamespace` treats empty identically\n * to absent (both trim to falsy → default namespace). Rejecting empty would\n * break HTTP callers that send a bare `?namespace=` (Cursor review).\n */\nconst memoryGetSchema = z.object({\n memoryId: z.string().trim().min(1, \"memoryId is required\").max(512),\n namespace: z.string().trim().max(256).nullable().optional(),\n});\n\nexport interface MemoryGetInput {\n readonly memoryId: string;\n readonly namespace?: string | null;\n}\n\nexport interface MemoryGetOutput {\n readonly result: EngramAccessMemoryResponse;\n}\n\nexport const memoryGetOperation = defineOperation<MemoryGetInput, MemoryGetOutput>({\n name: \"memory_get\",\n description: \"Fetch one memory by id.\",\n schema: memoryGetSchema,\n handler: async (input, ctx) => {\n const result = await ctx.service.memoryGet(\n input.memoryId,\n input.namespace ?? undefined,\n ctx.authenticatedPrincipal,\n );\n return { result };\n },\n});\n\n// ---------------------------------------------------------------------------\n// memory_search — semantic search across memories\n// ---------------------------------------------------------------------------\n\nconst memorySearchSchema = z.object({\n query: z.string().trim().min(1, \"query is required\").max(2048),\n namespace: z.string().trim().max(256).nullable().optional(),\n // No upper cap: the pre-boundary MCP handler forwarded any finite number to\n // memorySearch, and the QMD/search backends honor large limits. Capping at\n // 100 would reject existing clients that request larger result sets.\n maxResults: z.number().int().min(1).nullable().optional(),\n collection: z.string().trim().min(1).max(256).nullable().optional(),\n});\n\nexport interface MemorySearchInput {\n readonly query: string;\n readonly namespace?: string | null;\n readonly maxResults?: number | null;\n readonly collection?: string | null;\n}\n\nexport interface MemorySearchOutput {\n readonly result: {\n readonly query: string;\n readonly results: ReadonlyArray<{ path: string; score: number; snippet: string }>;\n readonly count: number;\n };\n}\n\nexport const memorySearchOperation = defineOperation<MemorySearchInput, MemorySearchOutput>({\n name: \"memory_search\",\n description: \"Search memories across readable namespaces.\",\n schema: memorySearchSchema,\n handler: async (input, ctx) => {\n const result = await ctx.service.memorySearch({\n query: input.query,\n namespace: input.namespace ?? undefined,\n maxResults: input.maxResults ?? undefined,\n collection: input.collection ?? undefined,\n principal: ctx.authenticatedPrincipal,\n });\n return { result };\n },\n});\n\n// ---------------------------------------------------------------------------\n// memory_store — the pilot WRITE op\n// ---------------------------------------------------------------------------\n\nexport type MemoryStoreInput = MemoryStoreRequest;\n\nexport interface MemoryStoreOutput {\n readonly result: EngramAccessWriteResponse;\n}\n\nexport const memoryStoreOperation = defineOperation<MemoryStoreInput, MemoryStoreOutput>({\n name: \"memory_store\",\n description: \"Store an explicit memory through the access layer.\",\n // Reuse the existing schema verbatim — the migration is behavior-preserving;\n // the schema's external contract is NOT changing in this PR (per the issue's\n // pitfall note).\n schema: memoryStoreRequestSchema,\n handler: async (input, ctx) => {\n const result = await ctx.service.memoryStore(\n {\n ...input,\n authenticatedPrincipal: ctx.authenticatedPrincipal,\n },\n // Forward transport-level hooks (e.g. HTTP's atomic write-quota gate)\n // so the hook still fires inside the service's idempotent-write lock —\n // never before, never on a replay (#1434 invariant preserved by the\n // boundary migration).\n\n ctx.hooks,\n );\n return { result };\n },\n});\n\n// ---------------------------------------------------------------------------\n// coding_decision — decision-record surfaces (issue #1548 Track A PR 2)\n// ---------------------------------------------------------------------------\n\n/**\n * The subcommand field is required and MUST be one of the four valid values\n * (rule 51 — reject loudly, list the options, never silently default). The\n * remaining fields are optional because each subcommand uses a different\n * subset; the handler validates subcommand-specific requirements after\n * routing.\n */\n/**\n * MCP clients send `null` for absent optional fields. Zod `.optional()`\n * rejects `null`, so strip nulls at the object level before the inner\n * schema validates (review: cursor null-field thread).\n */\nconst codingDecisionSchema = z.preprocess(\n (data) => {\n if (data && typeof data === \"object\" && !Array.isArray(data)) {\n const out: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(data as Record<string, unknown>)) {\n if (v !== null) out[k] = v;\n }\n return out;\n }\n return data;\n },\n z.object({\n subcommand: z.enum(DECISION_SUBCOMMANDS),\n sessionKey: z.string().trim().max(512).optional(),\n namespace: z.string().trim().max(256).optional(),\n id: z.string().trim().max(512).optional(),\n title: z.string().trim().max(512).optional(),\n status: z.string().trim().max(64).optional(),\n context: z.string().trim().max(8192).optional(),\n decision: z.string().trim().max(8192).optional(),\n consequences: z.string().trim().max(8192).optional(),\n entityRefs: z.array(z.string().trim().min(1).max(256)).optional(),\n supersedesId: z.string().trim().max(512).optional(),\n }),\n);\n\nexport type CodingDecisionInput = DecisionSurfaceRequest;\nexport type CodingDecisionOutput = { result: DecisionSurfaceResponse };\n\nexport const codingDecisionOperation = defineOperation<\n CodingDecisionInput,\n CodingDecisionOutput\n>({\n name: \"coding_decision\",\n description:\n \"List, get, record, or supersede decision records in the session's coding namespace (issue #1548 Track A).\",\n schema: codingDecisionSchema as z.ZodType<CodingDecisionInput>,\n handler: async (input, ctx) => {\n const result = await ctx.service.codingDecision(input, ctx.authenticatedPrincipal);\n return { result };\n },\n});\n\n// ---------------------------------------------------------------------------\n// coding_architecture — architecture-card surfaces (issue #1548 Track A PR 3)\n// ---------------------------------------------------------------------------\n\nconst codingArchitectureSchema = z.preprocess(\n (data) => {\n if (data !== null && typeof data === \"object\" && !Array.isArray(data)) {\n const obj = data as Record<string, unknown>;\n const cleaned: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(obj)) {\n if (value !== null) cleaned[key] = value;\n }\n return cleaned;\n }\n return data;\n },\n z.object({\n subcommand: z.enum([\"get\", \"refresh\"]),\n sessionKey: z.string().optional(),\n namespace: z.string().optional(),\n }),\n);\n\nexport type CodingArchitectureInput = ArchitectureSurfaceRequest;\nexport type CodingArchitectureOutput = { result: ArchitectureSurfaceResponse };\n\nexport const codingArchitectureOperation = defineOperation<\n CodingArchitectureInput,\n CodingArchitectureOutput\n>({\n name: \"coding_architecture\",\n description:\n \"Get or refresh the architecture card for the session's coding namespace (issue #1548 Track A PR 3).\",\n schema: codingArchitectureSchema as z.ZodType<CodingArchitectureInput>,\n handler: async (input, ctx) => {\n const result = await ctx.service.codingArchitecture(input, ctx.authenticatedPrincipal);\n return { result };\n },\n});\n\n// ---------------------------------------------------------------------------\n// Surface registration map — what each transport calls the pilot ops\n// ---------------------------------------------------------------------------\n\n/**\n * The canonical short names (no `engram.`/`remnic.` prefix) of the operations\n * the boundary owns today. The fitness test treats this set as the migrated\n * set; everything else on a surface is unmigrated and counted by the ratchet.\n */\nexport const REGISTERED_OPERATIONS = [\n memoryGetOperation.spec.name,\n memorySearchOperation.spec.name,\n memoryStoreOperation.spec.name,\n codingDecisionOperation.spec.name,\n codingArchitectureOperation.spec.name,\n] as const;\n"],"mappings":";;;;;;;;;;;AAcA,SAAS,SAAS;AAgClB,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,sBAAsB,EAAE,IAAI,GAAG;AAAA,EAClE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAC5D,CAAC;AAWM,IAAM,qBAAqB,gBAAiD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 import {
14
14
  } from "./chunk-UDJLF3BO.js";
15
15
  import {
16
16
  getOperation
17
- } from "./chunk-OWFY6NGQ.js";
17
+ } from "./chunk-46URPRE6.js";
18
18
  import {
19
19
  EngramAccessInputError
20
- } from "./chunk-XU7363OX.js";
20
+ } from "./chunk-Z7KILAOU.js";
21
21
  import {
22
22
  projectTagProjectId
23
23
  } from "./chunk-7MOTEVAA.js";
24
24
  import {
25
25
  validateBriefingFormat
26
- } from "./chunk-OV4D5T7V.js";
26
+ } from "./chunk-X7RLU5CR.js";
27
27
  import {
28
28
  resolvePrincipal
29
29
  } from "./chunk-UZYLX7M6.js";
@@ -56,7 +56,8 @@ var MCP_MIGRATED_OPERATIONS = {
56
56
  "engram.memory_get": "memory_get",
57
57
  "engram.memory_search": "memory_search",
58
58
  "engram.memory_store": "memory_store",
59
- "engram.coding_decision": "coding_decision"
59
+ "engram.coding_decision": "coding_decision",
60
+ "engram.coding_architecture": "coding_architecture"
60
61
  };
61
62
  function resolveChatGptInspectorRecallSessionKey(explicitSessionKey, authenticatedPrincipal) {
62
63
  if (explicitSessionKey) return explicitSessionKey;
@@ -196,6 +197,7 @@ var EngramMcpServer = class {
196
197
  this.citationsAutoDetect = options.citationsAutoDetect !== false;
197
198
  this.emitLegacyTools = options.emitLegacyTools !== false;
198
199
  this.codingDecisionVisible = options.codingDecisionVisible === true;
200
+ this.architectureCardVisible = options.architectureCardVisible === true;
199
201
  this.authenticatedPrincipal = options.principal?.trim() || readEnvVar("OPENCLAW_ENGRAM_ACCESS_PRINCIPAL")?.trim() || void 0;
200
202
  this.resources = [
201
203
  {
@@ -1810,6 +1812,30 @@ var EngramMcpServer = class {
1810
1812
  );
1811
1813
  this.tools = [...this.tools, ...codingDecisionTools];
1812
1814
  }
1815
+ if (this.architectureCardVisible) {
1816
+ const architectureTools = withToolAliases(
1817
+ {
1818
+ name: "engram.coding_architecture",
1819
+ description: "Get or refresh the architecture card for the session's coding namespace (issue #1548 Track A PR 3). Subcommands: get, refresh.",
1820
+ inputSchema: {
1821
+ type: "object",
1822
+ properties: {
1823
+ subcommand: {
1824
+ type: "string",
1825
+ enum: ["get", "refresh"],
1826
+ description: "Which architecture-card operation to run."
1827
+ },
1828
+ sessionKey: { type: "string", description: "Session identifier whose coding context scopes the operation." },
1829
+ namespace: { type: "string", description: "Optional explicit namespace (overrides coding-context overlay)." }
1830
+ },
1831
+ required: ["subcommand"],
1832
+ additionalProperties: false
1833
+ }
1834
+ },
1835
+ this.emitLegacyTools
1836
+ );
1837
+ this.tools = [...this.tools, ...architectureTools];
1838
+ }
1813
1839
  }
1814
1840
  service;
1815
1841
  buffer = Buffer.alloc(0);
@@ -1851,6 +1877,12 @@ var EngramMcpServer = class {
1851
1877
  * pre-feature.
1852
1878
  */
1853
1879
  codingDecisionVisible;
1880
+ /**
1881
+ * Whether the `coding_architecture` tool should appear in `tools/list`.
1882
+ * Gated on `codingKnowledge.enabled && codingKnowledge.architectureCard`
1883
+ * (issue #1548 Track A PR 3, rule 39).
1884
+ */
1885
+ architectureCardVisible;
1854
1886
  /** Get clientInfo for a specific MCP session. Returns undefined for non-MCP requests. */
1855
1887
  getClientInfo(sessionId) {
1856
1888
  if (sessionId) {
@@ -3154,4 +3186,4 @@ ${body}`;
3154
3186
  export {
3155
3187
  EngramMcpServer
3156
3188
  };
3157
- //# sourceMappingURL=chunk-UXLZOVCN.js.map
3189
+ //# sourceMappingURL=chunk-OMKUJTVJ.js.map