@remnic/core 9.3.665 → 9.3.666

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 (149) hide show
  1. package/dist/access-audit.js +2 -2
  2. package/dist/access-cli.js +41 -40
  3. package/dist/access-cli.js.map +1 -1
  4. package/dist/access-http.d.ts +3 -2
  5. package/dist/access-http.js +25 -25
  6. package/dist/access-mcp.d.ts +3 -2
  7. package/dist/access-mcp.js +22 -22
  8. package/dist/access-schema.d.ts +36 -36
  9. package/dist/access-schema.js +3 -3
  10. package/dist/{access-service-D0SLB4MH.d.ts → access-service-DsS-TatL.d.ts} +1 -1
  11. package/dist/access-service.d.ts +3 -2
  12. package/dist/access-service.js +21 -21
  13. package/dist/adapters/index.js +4 -4
  14. package/dist/adapters/registry.js +2 -2
  15. package/dist/bootstrap.d.ts +2 -1
  16. package/dist/briefing.js +4 -3
  17. package/dist/capabilities.d.ts +73 -0
  18. package/dist/capabilities.js +8 -0
  19. package/dist/capabilities.js.map +1 -0
  20. package/dist/causal-behavior.js +2 -2
  21. package/dist/causal-chain.js +2 -2
  22. package/dist/causal-consolidation.js +7 -6
  23. package/dist/causal-consolidation.js.map +1 -1
  24. package/dist/causal-retrieval.js +2 -2
  25. package/dist/causal-trajectory.js +1 -1
  26. package/dist/{chunk-ROHLEUTH.js → chunk-23EBQ27U.js} +5 -5
  27. package/dist/{chunk-YW52BQSU.js → chunk-2TCHDANJ.js} +2 -2
  28. package/dist/{chunk-IROWLAWG.js → chunk-46WUVFOD.js} +4 -4
  29. package/dist/{chunk-7C4MPEPE.js → chunk-4T7P2HLJ.js} +3 -3
  30. package/dist/{chunk-7XH7VJN4.js → chunk-6T4LTI2F.js} +4 -4
  31. package/dist/{chunk-TVVEYCNW.js → chunk-7K5Q6COX.js} +4 -4
  32. package/dist/{chunk-BZG2CWOQ.js → chunk-A5TEHAR4.js} +3 -3
  33. package/dist/{chunk-C7AF236A.js → chunk-AARDBQTA.js} +2 -2
  34. package/dist/{chunk-IHG6CC7T.js → chunk-BQJUPECT.js} +2 -2
  35. package/dist/{chunk-7OGJQP7T.js → chunk-CRO4LCQ6.js} +5 -5
  36. package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
  37. package/dist/{chunk-WH4SKYPX.js → chunk-GZ6QAYSH.js} +94 -74
  38. package/dist/chunk-GZ6QAYSH.js.map +1 -0
  39. package/dist/{chunk-UXA5L2DZ.js → chunk-HQCGRSRU.js} +2 -2
  40. package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
  41. package/dist/{chunk-XW3W4PV4.js → chunk-JTPXSXHC.js} +2 -2
  42. package/dist/{chunk-OHJFJ4HI.js → chunk-KOXGLQS7.js} +2 -2
  43. package/dist/{chunk-2OPARZ4B.js → chunk-MPXYHC35.js} +26 -26
  44. package/dist/{chunk-6JBKHTQD.js → chunk-MR4PJ277.js} +2 -2
  45. package/dist/{chunk-EXXBA5OM.js → chunk-OI4BXFSB.js} +4 -4
  46. package/dist/{chunk-SQZ42MKH.js → chunk-OQH5XUH3.js} +6 -3
  47. package/dist/chunk-OQH5XUH3.js.map +1 -0
  48. package/dist/{chunk-2HEZXPYU.js → chunk-Q2LQZYQ7.js} +3 -3
  49. package/dist/{chunk-XRSIGVTS.js → chunk-QHWJG5C5.js} +8 -8
  50. package/dist/{chunk-T2AN3BSP.js → chunk-QZ7ODIVL.js} +2 -2
  51. package/dist/chunk-RI5XBIZ6.js +23 -0
  52. package/dist/chunk-RI5XBIZ6.js.map +1 -0
  53. package/dist/{chunk-D7IXTY5E.js → chunk-TJ7HH5LB.js} +2 -2
  54. package/dist/{chunk-V25ZAOSB.js → chunk-UOBLE67F.js} +4 -4
  55. package/dist/{chunk-JIX3ZL2J.js → chunk-UVUTV7CM.js} +15 -15
  56. package/dist/{chunk-VH6EIKVS.js → chunk-WKMCC4NQ.js} +35 -16
  57. package/dist/chunk-WKMCC4NQ.js.map +1 -0
  58. package/dist/{chunk-SSOMTUCA.js → chunk-WXGTC424.js} +1 -1
  59. package/dist/{chunk-KHGE6PMF.js → chunk-WXXLSZHA.js} +2 -2
  60. package/dist/{chunk-DSLUOQDY.js → chunk-XMWF6AU3.js} +2 -2
  61. package/dist/{chunk-DQY7NJ5L.js → chunk-XS2CWEHZ.js} +2 -2
  62. package/dist/{cli-BQRqR9N-.d.ts → cli-BypxcNqq.d.ts} +2 -2
  63. package/dist/cli.d.ts +4 -3
  64. package/dist/cli.js +42 -42
  65. package/dist/compounding/engine.js +4 -3
  66. package/dist/connectors/codex-materialize-runner.js +4 -3
  67. package/dist/connectors/index.js +4 -3
  68. package/dist/consolidation-provenance-check.js +2 -2
  69. package/dist/conversation-index/backend.js +2 -2
  70. package/dist/dashboard-runtime.js +2 -2
  71. package/dist/direct-answer-wiring.d.ts +13 -3
  72. package/dist/direct-answer-wiring.js +1 -1
  73. package/dist/entity-retrieval.js +4 -3
  74. package/dist/explicit-capture.d.ts +2 -1
  75. package/dist/index.d.ts +5 -4
  76. package/dist/index.js +66 -65
  77. package/dist/index.js.map +1 -1
  78. package/dist/lcm/engine.js +2 -2
  79. package/dist/lcm/index.js +4 -4
  80. package/dist/maintenance/memory-governance.js +4 -4
  81. package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +4 -3
  82. package/dist/maintenance/rebuild-memory-projection.js +5 -5
  83. package/dist/mcp-memory-inspector-app.d.ts +3 -2
  84. package/dist/namespaces/migrate.js +11 -11
  85. package/dist/namespaces/search.js +7 -7
  86. package/dist/namespaces/storage.js +4 -3
  87. package/dist/operator-toolkit.js +15 -15
  88. package/dist/{orchestrator-Cg1UkvmO.d.ts → orchestrator-DZqPVoMI.d.ts} +8 -0
  89. package/dist/orchestrator.d.ts +2 -1
  90. package/dist/orchestrator.js +32 -31
  91. package/dist/recall-planner-llm.d.ts +2 -1
  92. package/dist/recall-planner-llm.js +3 -2
  93. package/dist/recall-planner-llm.js.map +1 -1
  94. package/dist/schemas.d.ts +42 -42
  95. package/dist/search/factory.js +6 -6
  96. package/dist/search/index.js +10 -10
  97. package/dist/search/lancedb-backend.js +1 -1
  98. package/dist/search/meilisearch-backend.js +1 -1
  99. package/dist/search/orama-backend.js +1 -1
  100. package/dist/semantic-consolidation.js +5 -4
  101. package/dist/semantic-rule-promotion.js +4 -3
  102. package/dist/semantic-rule-verifier.js +4 -3
  103. package/dist/shared-context/manager.d.ts +2 -2
  104. package/dist/storage.js +3 -2
  105. package/dist/transfer/backup.js +2 -2
  106. package/dist/transfer/capsule-export.js +2 -2
  107. package/dist/transfer/capsule-import.js +1 -1
  108. package/dist/verified-recall.js +4 -3
  109. package/package.json +1 -1
  110. package/src/capabilities.test.ts +97 -0
  111. package/src/capabilities.ts +86 -0
  112. package/src/direct-answer-wiring.test.ts +53 -2
  113. package/src/direct-answer-wiring.ts +18 -5
  114. package/src/orchestrator.ts +69 -19
  115. package/src/recall-planner-llm.test.ts +12 -11
  116. package/src/recall-planner-llm.ts +7 -1
  117. package/src/storage-fallback-category-dirs.test.ts +150 -1
  118. package/src/storage.ts +51 -14
  119. package/dist/chunk-SQZ42MKH.js.map +0 -1
  120. package/dist/chunk-VH6EIKVS.js.map +0 -1
  121. package/dist/chunk-WH4SKYPX.js.map +0 -1
  122. /package/dist/{chunk-ROHLEUTH.js.map → chunk-23EBQ27U.js.map} +0 -0
  123. /package/dist/{chunk-YW52BQSU.js.map → chunk-2TCHDANJ.js.map} +0 -0
  124. /package/dist/{chunk-IROWLAWG.js.map → chunk-46WUVFOD.js.map} +0 -0
  125. /package/dist/{chunk-7C4MPEPE.js.map → chunk-4T7P2HLJ.js.map} +0 -0
  126. /package/dist/{chunk-7XH7VJN4.js.map → chunk-6T4LTI2F.js.map} +0 -0
  127. /package/dist/{chunk-TVVEYCNW.js.map → chunk-7K5Q6COX.js.map} +0 -0
  128. /package/dist/{chunk-BZG2CWOQ.js.map → chunk-A5TEHAR4.js.map} +0 -0
  129. /package/dist/{chunk-C7AF236A.js.map → chunk-AARDBQTA.js.map} +0 -0
  130. /package/dist/{chunk-IHG6CC7T.js.map → chunk-BQJUPECT.js.map} +0 -0
  131. /package/dist/{chunk-7OGJQP7T.js.map → chunk-CRO4LCQ6.js.map} +0 -0
  132. /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
  133. /package/dist/{chunk-UXA5L2DZ.js.map → chunk-HQCGRSRU.js.map} +0 -0
  134. /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
  135. /package/dist/{chunk-XW3W4PV4.js.map → chunk-JTPXSXHC.js.map} +0 -0
  136. /package/dist/{chunk-OHJFJ4HI.js.map → chunk-KOXGLQS7.js.map} +0 -0
  137. /package/dist/{chunk-2OPARZ4B.js.map → chunk-MPXYHC35.js.map} +0 -0
  138. /package/dist/{chunk-6JBKHTQD.js.map → chunk-MR4PJ277.js.map} +0 -0
  139. /package/dist/{chunk-EXXBA5OM.js.map → chunk-OI4BXFSB.js.map} +0 -0
  140. /package/dist/{chunk-2HEZXPYU.js.map → chunk-Q2LQZYQ7.js.map} +0 -0
  141. /package/dist/{chunk-XRSIGVTS.js.map → chunk-QHWJG5C5.js.map} +0 -0
  142. /package/dist/{chunk-T2AN3BSP.js.map → chunk-QZ7ODIVL.js.map} +0 -0
  143. /package/dist/{chunk-D7IXTY5E.js.map → chunk-TJ7HH5LB.js.map} +0 -0
  144. /package/dist/{chunk-V25ZAOSB.js.map → chunk-UOBLE67F.js.map} +0 -0
  145. /package/dist/{chunk-JIX3ZL2J.js.map → chunk-UVUTV7CM.js.map} +0 -0
  146. /package/dist/{chunk-SSOMTUCA.js.map → chunk-WXGTC424.js.map} +0 -0
  147. /package/dist/{chunk-KHGE6PMF.js.map → chunk-WXXLSZHA.js.map} +0 -0
  148. /package/dist/{chunk-DSLUOQDY.js.map → chunk-XMWF6AU3.js.map} +0 -0
  149. /package/dist/{chunk-DQY7NJ5L.js.map → chunk-XS2CWEHZ.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/recall-planner-llm.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { PluginConfig, RecallPlanMode } from \"./types.js\";\nimport { planRecallMode } from \"./intent.js\";\nimport {\n FallbackLlmClient,\n fallbackLlmRuntimeContextFromConfig,\n gatewayTaskChainOptions,\n type FallbackLlmOptions,\n} from \"./fallback-llm.js\";\nimport { log } from \"./logger.js\";\n\n/**\n * LLM-based recall planning (issue #1367, Option C).\n *\n * Classifies an incoming prompt into a {@link RecallPlanMode} using an LLM\n * instead of (or alongside) the regex heuristic in {@link planRecallMode}.\n *\n * Provider-agnostic by construction: it routes through {@link FallbackLlmClient},\n * which resolves the model chain from gateway providers (OpenAI, Anthropic,\n * Ollama, Codex, …) or gateway agent personas / `taskModelChain`. Nothing here\n * is hard-coded to a single provider or to OpenAI's Responses API — the API\n * dialect is chosen per-provider by the client based on each provider's `api`\n * field. The configured `recallPlannerModel` is tried first, with the broader\n * task chain (and the gateway default) as resilient fallbacks.\n *\n * Invariants:\n * - Never throws to the caller (gotcha #13). Any LLM failure, timeout, empty\n * response, or unavailable backend falls back to the heuristic result and\n * sets `fallbackUsed: true` (gotcha #34 — failures are distinct from a valid\n * classification).\n * - When `recallPlannerLlmEnabled` is false the LLM is never contacted.\n */\n\nexport type RecallPlannerSource = \"llm\" | \"heuristic\" | \"heuristic-fallback\";\n\nexport interface RecallPlannerLlmResult {\n /** The mode to act on. */\n mode: RecallPlanMode;\n /** The heuristic mode, always computed (the fallback floor / shadow baseline). */\n heuristicMode: RecallPlanMode;\n /** Where `mode` came from. */\n source: RecallPlannerSource;\n /** Short human-readable rationale (LLM reason, or why we fell back). */\n reason: string;\n /** Model that actually served the classification, when an LLM was used. */\n modelUsed?: string;\n /** Wall-clock spent in the LLM call (0 when no call was made). */\n latencyMs: number;\n /** True when the LLM was enabled but we had to fall back to the heuristic. */\n fallbackUsed: boolean;\n}\n\nconst PLANNER_SCHEMA = z.object({\n // gotcha #2: optional fields use .optional().nullable()\n mode: z.enum([\"no_recall\", \"minimal\", \"full\", \"graph_mode\"]),\n reason: z.string().max(280).optional().nullable(),\n});\n\nconst SYSTEM_PROMPT = [\n \"You are a recall-planning classifier for a long-term memory system.\",\n \"Given the user's latest message, decide how much stored memory should be retrieved before the assistant responds.\",\n \"Reply with a single JSON object: {\\\"mode\\\": <one of no_recall|minimal|full|graph_mode>, \\\"reason\\\": <short string>}.\",\n \"\",\n \"Modes:\",\n '- \"no_recall\": low-information acknowledgements or chit-chat with nothing to look up (e.g. \"ok\", \"thanks\", \"sounds good\"). Retrieve nothing.',\n '- \"minimal\": short, self-contained operational directives that rarely need history (e.g. \"restart the service\", \"run the tests\", \"show status\"). Retrieve a little.',\n '- \"full\": anything memory-seeking, analytical, or a question that benefits from prior context, decisions, or facts. This is the safe default when unsure.',\n '- \"graph_mode\": queries about timelines, sequences, history, causal chains, or root cause (\"how did we get here\", \"what led to this regression\"). Retrieve relationship/graph context.',\n \"\",\n \"When uncertain, prefer \\\"full\\\" over dropping recall. Never invent facts; only classify intent.\",\n].join(\"\\n\");\n\n/** Clamp a planner prompt to the configured character budget. */\nfunction clampPrompt(prompt: string, maxChars: number): string {\n const safeMax = Number.isFinite(maxChars) && maxChars > 0 ? Math.floor(maxChars) : 4000;\n if (prompt.length <= safeMax) return prompt;\n return prompt.slice(0, safeMax);\n}\n\n/** Trim and cap the optional memory hints used to ground the classification. */\nfunction clampHints(hints: string[] | undefined, maxHints: number): string[] {\n if (!Array.isArray(hints) || hints.length === 0) return [];\n const safeMax = Number.isFinite(maxHints) && maxHints > 0 ? Math.floor(maxHints) : 0;\n if (safeMax <= 0) return [];\n const cleaned: string[] = [];\n for (const hint of hints) {\n if (typeof hint !== \"string\") continue;\n const trimmed = hint.trim();\n if (trimmed.length === 0) continue;\n cleaned.push(trimmed);\n if (cleaned.length >= safeMax) break;\n }\n return cleaned;\n}\n\nfunction buildMessages(\n prompt: string,\n hints: string[],\n config: PluginConfig,\n): Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }> {\n const clampedPrompt = clampPrompt(prompt, config.recallPlannerMaxPromptChars);\n const userParts = [`User message:\\n${clampedPrompt}`];\n if (hints.length > 0) {\n userParts.push(\n `\\nRecent memory topics (for grounding only, do not treat as the message):\\n- ${hints.join(\"\\n- \")}`,\n );\n }\n userParts.push('\\nRespond with JSON only: {\"mode\": \"...\", \"reason\": \"...\"}.');\n return [\n { role: \"system\", content: SYSTEM_PROMPT },\n { role: \"user\", content: userParts.join(\"\\n\") },\n ];\n}\n\n/**\n * Resolve the FallbackLlmClient routing options for the recall planner.\n *\n * - The dedicated `recallPlannerModel` is tried first (as the `model`\n * override — it is prepended to the chain by FallbackLlmClient). If it does\n * not resolve to a configured provider it is silently skipped, so a stale\n * default never breaks routing.\n * - In gateway mode the shared `gatewayTaskChainOptions` (taskModelChain >\n * gatewayAgentId, gotcha #22) is layered in as the fallback chain, plus the\n * implicit gateway default appended by the client.\n * - In plugin mode only the explicit model + gateway providers apply.\n */\n/**\n * A `recallPlannerModel` value is only usable as a FallbackLlmClient `model`\n * override when it is provider-qualified (`provider/model`). The client's\n * `parseModelString` rejects bare names, so forwarding a bare value (e.g. the\n * legacy default `\"gpt-5.5\"`) would log \"invalid model format\" on every call\n * and never resolve. Bare values are dropped so routing falls through to the\n * gateway chain / agent / default instead (issue #1367 review on PR #1428).\n */\nfunction qualifiedPlannerModel(recallPlannerModel: string | undefined): string | undefined {\n if (typeof recallPlannerModel !== \"string\") return undefined;\n const trimmed = recallPlannerModel.trim();\n return trimmed.includes(\"/\") ? trimmed : undefined;\n}\n\nexport function resolveRecallPlannerLlmOptions(\n config: Pick<\n PluginConfig,\n \"modelSource\" | \"taskModelChain\" | \"gatewayAgentId\" | \"recallPlannerModel\" | \"recallPlannerTimeoutMs\"\n >,\n): FallbackLlmOptions {\n const chainOptions =\n config.modelSource === \"gateway\" ? gatewayTaskChainOptions(config) : {};\n return {\n ...chainOptions,\n model: qualifiedPlannerModel(config.recallPlannerModel),\n temperature: 0,\n maxTokens: 64,\n timeoutMs:\n typeof config.recallPlannerTimeoutMs === \"number\" && config.recallPlannerTimeoutMs > 0\n ? config.recallPlannerTimeoutMs\n : 1500,\n };\n}\n\n// One-time warning per distinct routing signature so an opted-in operator with\n// no usable model learns why planning silently uses the heuristic, without\n// spamming a line on every recall.\nconst warnedNoRoutingSignatures = new Set<string>();\n\nfunction heuristicResult(\n heuristicMode: RecallPlanMode,\n source: RecallPlannerSource,\n reason: string,\n latencyMs: number,\n fallbackUsed: boolean,\n): RecallPlannerLlmResult {\n return { mode: heuristicMode, heuristicMode, source, reason, latencyMs, fallbackUsed };\n}\n\n/**\n * Plan the recall mode for `prompt`, optionally consulting an LLM.\n *\n * Always safe to call: returns the heuristic result when the LLM is disabled,\n * unavailable, or fails.\n *\n * @param llm injectable client (tests pass a stub); constructed from gateway\n * config when omitted.\n */\nexport async function planRecallModeLLM(\n prompt: string,\n hints: string[] | undefined,\n config: PluginConfig,\n llm?: FallbackLlmClient,\n signal?: AbortSignal,\n): Promise<RecallPlannerLlmResult> {\n const heuristicMode = planRecallMode(prompt);\n\n if (!config.recallPlannerLlmEnabled) {\n return heuristicResult(heuristicMode, \"heuristic\", \"llm-disabled\", 0, false);\n }\n\n // Participate in the recall cancellation contract: if the outer recall is\n // already aborted (outer timeout / reset / session abort), don't start an LLM\n // round-trip — fall back to the heuristic immediately (#1428 review).\n if (signal?.aborted) {\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"aborted\", 0, true);\n }\n\n const safePrompt = typeof prompt === \"string\" ? prompt.trim() : \"\";\n if (safePrompt.length === 0) {\n // Empty prompts never need an LLM round-trip.\n return heuristicResult(heuristicMode, \"heuristic\", \"empty-prompt\", 0, false);\n }\n\n const client =\n llm ??\n new FallbackLlmClient(\n config.gatewayConfig,\n fallbackLlmRuntimeContextFromConfig(config),\n );\n\n // Forward the recall abort signal so an aborted/timed-out outer recall can\n // cancel an in-flight planner call (FallbackLlmClient honors `signal`).\n const options = { ...resolveRecallPlannerLlmOptions(config), signal };\n\n // Availability check uses the same routing options so plugin-mode / empty\n // chains short-circuit to the heuristic without a network attempt. `model`\n // here is already provider-qualified (bare names were dropped), so a present\n // model means the override is genuinely routable.\n const availabilityProbe = {\n agentId: options.agentId,\n modelChain: options.modelChain,\n };\n if (!client.isAvailable(availabilityProbe) && !options.model) {\n // Opted-in but nothing routable resolves (e.g. plugin mode with the bare\n // default `recallPlannerModel` and no gateway chain). Warn once so it's not\n // a silent no-op, then fall back to the heuristic.\n const signature = `${config.modelSource}:${config.recallPlannerModel ?? \"\"}`;\n if (!warnedNoRoutingSignatures.has(signature)) {\n warnedNoRoutingSignatures.add(signature);\n log.warn(\n \"[recall-planner] recallPlannerLlmEnabled is on but no routable model resolves — \" +\n \"set recallPlannerModel to a 'provider/model' value or configure a gateway model chain. \" +\n \"Falling back to the heuristic planner.\",\n );\n }\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"llm-no-model\", 0, true);\n }\n\n const clampedHints = clampHints(hints, config.recallPlannerMaxMemoryHints);\n const messages = buildMessages(safePrompt, clampedHints, config);\n\n const start = Date.now();\n try {\n const detailed = await client.parseWithSchemaDetailed(messages, PLANNER_SCHEMA, options);\n const latencyMs = Date.now() - start;\n if (!detailed?.result) {\n // Distinguish failure from a valid empty (gotcha #34): a null here means\n // no parseable classification, so fall back to the heuristic.\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"llm-empty\", latencyMs, true);\n }\n const mode = detailed.result.mode;\n const reason =\n typeof detailed.result.reason === \"string\" && detailed.result.reason.trim().length > 0\n ? detailed.result.reason.trim()\n : \"llm-classified\";\n return {\n mode,\n heuristicMode,\n source: \"llm\",\n reason,\n modelUsed: detailed.modelUsed,\n latencyMs,\n fallbackUsed: false,\n };\n } catch (err) {\n const latencyMs = Date.now() - start;\n if (signal?.aborted) {\n // Cancelled by the outer recall — expected, not an error worth warning on.\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"aborted\", latencyMs, true);\n }\n const message = err instanceof Error ? err.message : String(err);\n log.warn(`[recall-planner] LLM failed, falling back to heuristic: ${message}`);\n return heuristicResult(\n heuristicMode,\n \"heuristic-fallback\",\n `llm-error:${message}`,\n latencyMs,\n true,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAqDlB,IAAM,iBAAiB,EAAE,OAAO;AAAA;AAAA,EAE9B,MAAM,EAAE,KAAK,CAAC,aAAa,WAAW,QAAQ,YAAY,CAAC;AAAA,EAC3D,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAClD,CAAC;AAED,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAGX,SAAS,YAAY,QAAgB,UAA0B;AAC7D,QAAM,UAAU,OAAO,SAAS,QAAQ,KAAK,WAAW,IAAI,KAAK,MAAM,QAAQ,IAAI;AACnF,MAAI,OAAO,UAAU,QAAS,QAAO;AACrC,SAAO,OAAO,MAAM,GAAG,OAAO;AAChC;AAGA,SAAS,WAAW,OAA6B,UAA4B;AAC3E,MAAI,CAAC,MAAM,QAAQ,KAAK,KAAK,MAAM,WAAW,EAAG,QAAO,CAAC;AACzD,QAAM,UAAU,OAAO,SAAS,QAAQ,KAAK,WAAW,IAAI,KAAK,MAAM,QAAQ,IAAI;AACnF,MAAI,WAAW,EAAG,QAAO,CAAC;AAC1B,QAAM,UAAoB,CAAC;AAC3B,aAAW,QAAQ,OAAO;AACxB,QAAI,OAAO,SAAS,SAAU;AAC9B,UAAM,UAAU,KAAK,KAAK;AAC1B,QAAI,QAAQ,WAAW,EAAG;AAC1B,YAAQ,KAAK,OAAO;AACpB,QAAI,QAAQ,UAAU,QAAS;AAAA,EACjC;AACA,SAAO;AACT;AAEA,SAAS,cACP,QACA,OACA,Q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A,WAAW,SAAS;AAAA,MACpB;AAAA,MACA,cAAc;AAAA,IAChB;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,YAAY,KAAK,IAAI,IAAI;AAC/B,QAAI,QAAQ,SAAS;AAEnB,aAAO,gBAAgB,eAAe,sBAAsB,WAAW,WAAW,IAAI;AAAA,IACxF;AACA,UAAM,UAAU,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAC/D,QAAI,KAAK,2DAA2D,OAAO,EAAE;AAC7E,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,aAAa,OAAO;AAAA,MACpB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/recall-planner-llm.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport type { PluginConfig, RecallPlanMode } from \"./types.js\";\nimport type { CapabilitySet } from \"./capabilities.js\";\nimport { planRecallMode } from \"./intent.js\";\nimport {\n FallbackLlmClient,\n fallbackLlmRuntimeContextFromConfig,\n gatewayTaskChainOptions,\n type FallbackLlmOptions,\n} from \"./fallback-llm.js\";\nimport { log } from \"./logger.js\";\n\n/**\n * LLM-based recall planning (issue #1367, Option C).\n *\n * Classifies an incoming prompt into a {@link RecallPlanMode} using an LLM\n * instead of (or alongside) the regex heuristic in {@link planRecallMode}.\n *\n * Provider-agnostic by construction: it routes through {@link FallbackLlmClient},\n * which resolves the model chain from gateway providers (OpenAI, Anthropic,\n * Ollama, Codex, …) or gateway agent personas / `taskModelChain`. Nothing here\n * is hard-coded to a single provider or to OpenAI's Responses API — the API\n * dialect is chosen per-provider by the client based on each provider's `api`\n * field. The configured `recallPlannerModel` is tried first, with the broader\n * task chain (and the gateway default) as resilient fallbacks.\n *\n * Invariants:\n * - Never throws to the caller (gotcha #13). Any LLM failure, timeout, empty\n * response, or unavailable backend falls back to the heuristic result and\n * sets `fallbackUsed: true` (gotcha #34 — failures are distinct from a valid\n * classification).\n * - When `recallPlannerLlmEnabled` is false the LLM is never contacted.\n */\n\nexport type RecallPlannerSource = \"llm\" | \"heuristic\" | \"heuristic-fallback\";\n\nexport interface RecallPlannerLlmResult {\n /** The mode to act on. */\n mode: RecallPlanMode;\n /** The heuristic mode, always computed (the fallback floor / shadow baseline). */\n heuristicMode: RecallPlanMode;\n /** Where `mode` came from. */\n source: RecallPlannerSource;\n /** Short human-readable rationale (LLM reason, or why we fell back). */\n reason: string;\n /** Model that actually served the classification, when an LLM was used. */\n modelUsed?: string;\n /** Wall-clock spent in the LLM call (0 when no call was made). */\n latencyMs: number;\n /** True when the LLM was enabled but we had to fall back to the heuristic. */\n fallbackUsed: boolean;\n}\n\nconst PLANNER_SCHEMA = z.object({\n // gotcha #2: optional fields use .optional().nullable()\n mode: z.enum([\"no_recall\", \"minimal\", \"full\", \"graph_mode\"]),\n reason: z.string().max(280).optional().nullable(),\n});\n\nconst SYSTEM_PROMPT = [\n \"You are a recall-planning classifier for a long-term memory system.\",\n \"Given the user's latest message, decide how much stored memory should be retrieved before the assistant responds.\",\n \"Reply with a single JSON object: {\\\"mode\\\": <one of no_recall|minimal|full|graph_mode>, \\\"reason\\\": <short string>}.\",\n \"\",\n \"Modes:\",\n '- \"no_recall\": low-information acknowledgements or chit-chat with nothing to look up (e.g. \"ok\", \"thanks\", \"sounds good\"). Retrieve nothing.',\n '- \"minimal\": short, self-contained operational directives that rarely need history (e.g. \"restart the service\", \"run the tests\", \"show status\"). Retrieve a little.',\n '- \"full\": anything memory-seeking, analytical, or a question that benefits from prior context, decisions, or facts. This is the safe default when unsure.',\n '- \"graph_mode\": queries about timelines, sequences, history, causal chains, or root cause (\"how did we get here\", \"what led to this regression\"). Retrieve relationship/graph context.',\n \"\",\n \"When uncertain, prefer \\\"full\\\" over dropping recall. Never invent facts; only classify intent.\",\n].join(\"\\n\");\n\n/** Clamp a planner prompt to the configured character budget. */\nfunction clampPrompt(prompt: string, maxChars: number): string {\n const safeMax = Number.isFinite(maxChars) && maxChars > 0 ? Math.floor(maxChars) : 4000;\n if (prompt.length <= safeMax) return prompt;\n return prompt.slice(0, safeMax);\n}\n\n/** Trim and cap the optional memory hints used to ground the classification. */\nfunction clampHints(hints: string[] | undefined, maxHints: number): string[] {\n if (!Array.isArray(hints) || hints.length === 0) return [];\n const safeMax = Number.isFinite(maxHints) && maxHints > 0 ? Math.floor(maxHints) : 0;\n if (safeMax <= 0) return [];\n const cleaned: string[] = [];\n for (const hint of hints) {\n if (typeof hint !== \"string\") continue;\n const trimmed = hint.trim();\n if (trimmed.length === 0) continue;\n cleaned.push(trimmed);\n if (cleaned.length >= safeMax) break;\n }\n return cleaned;\n}\n\nfunction buildMessages(\n prompt: string,\n hints: string[],\n config: PluginConfig,\n): Array<{ role: \"system\" | \"user\" | \"assistant\"; content: string }> {\n const clampedPrompt = clampPrompt(prompt, config.recallPlannerMaxPromptChars);\n const userParts = [`User message:\\n${clampedPrompt}`];\n if (hints.length > 0) {\n userParts.push(\n `\\nRecent memory topics (for grounding only, do not treat as the message):\\n- ${hints.join(\"\\n- \")}`,\n );\n }\n userParts.push('\\nRespond with JSON only: {\"mode\": \"...\", \"reason\": \"...\"}.');\n return [\n { role: \"system\", content: SYSTEM_PROMPT },\n { role: \"user\", content: userParts.join(\"\\n\") },\n ];\n}\n\n/**\n * Resolve the FallbackLlmClient routing options for the recall planner.\n *\n * - The dedicated `recallPlannerModel` is tried first (as the `model`\n * override — it is prepended to the chain by FallbackLlmClient). If it does\n * not resolve to a configured provider it is silently skipped, so a stale\n * default never breaks routing.\n * - In gateway mode the shared `gatewayTaskChainOptions` (taskModelChain >\n * gatewayAgentId, gotcha #22) is layered in as the fallback chain, plus the\n * implicit gateway default appended by the client.\n * - In plugin mode only the explicit model + gateway providers apply.\n */\n/**\n * A `recallPlannerModel` value is only usable as a FallbackLlmClient `model`\n * override when it is provider-qualified (`provider/model`). The client's\n * `parseModelString` rejects bare names, so forwarding a bare value (e.g. the\n * legacy default `\"gpt-5.5\"`) would log \"invalid model format\" on every call\n * and never resolve. Bare values are dropped so routing falls through to the\n * gateway chain / agent / default instead (issue #1367 review on PR #1428).\n */\nfunction qualifiedPlannerModel(recallPlannerModel: string | undefined): string | undefined {\n if (typeof recallPlannerModel !== \"string\") return undefined;\n const trimmed = recallPlannerModel.trim();\n return trimmed.includes(\"/\") ? trimmed : undefined;\n}\n\nexport function resolveRecallPlannerLlmOptions(\n config: Pick<\n PluginConfig,\n \"modelSource\" | \"taskModelChain\" | \"gatewayAgentId\" | \"recallPlannerModel\" | \"recallPlannerTimeoutMs\"\n >,\n): FallbackLlmOptions {\n const chainOptions =\n config.modelSource === \"gateway\" ? gatewayTaskChainOptions(config) : {};\n return {\n ...chainOptions,\n model: qualifiedPlannerModel(config.recallPlannerModel),\n temperature: 0,\n maxTokens: 64,\n timeoutMs:\n typeof config.recallPlannerTimeoutMs === \"number\" && config.recallPlannerTimeoutMs > 0\n ? config.recallPlannerTimeoutMs\n : 1500,\n };\n}\n\n// One-time warning per distinct routing signature so an opted-in operator with\n// no usable model learns why planning silently uses the heuristic, without\n// spamming a line on every recall.\nconst warnedNoRoutingSignatures = new Set<string>();\n\nfunction heuristicResult(\n heuristicMode: RecallPlanMode,\n source: RecallPlannerSource,\n reason: string,\n latencyMs: number,\n fallbackUsed: boolean,\n): RecallPlannerLlmResult {\n return { mode: heuristicMode, heuristicMode, source, reason, latencyMs, fallbackUsed };\n}\n\n/**\n * Plan the recall mode for `prompt`, optionally consulting an LLM.\n *\n * Always safe to call: returns the heuristic result when the LLM is disabled,\n * unavailable, or fails.\n *\n * @param llm injectable client (tests pass a stub); constructed from gateway\n * config when omitted.\n */\nexport async function planRecallModeLLM(\n prompt: string,\n hints: string[] | undefined,\n config: PluginConfig,\n llm?: FallbackLlmClient,\n signal?: AbortSignal,\n caps?: CapabilitySet,\n): Promise<RecallPlannerLlmResult> {\n const heuristicMode = planRecallMode(prompt);\n\n // `caps` is OPTIONAL and additive (issue #1523). Prefer the resolved\n // capability when supplied; fall back to the config flag so existing callers\n // that pass only `config` keep identical gating.\n const plannerLlmEnabled = caps?.recallPlannerLlm ?? config.recallPlannerLlmEnabled;\n if (!plannerLlmEnabled) {\n return heuristicResult(heuristicMode, \"heuristic\", \"llm-disabled\", 0, false);\n }\n\n // Participate in the recall cancellation contract: if the outer recall is\n // already aborted (outer timeout / reset / session abort), don't start an LLM\n // round-trip — fall back to the heuristic immediately (#1428 review).\n if (signal?.aborted) {\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"aborted\", 0, true);\n }\n\n const safePrompt = typeof prompt === \"string\" ? prompt.trim() : \"\";\n if (safePrompt.length === 0) {\n // Empty prompts never need an LLM round-trip.\n return heuristicResult(heuristicMode, \"heuristic\", \"empty-prompt\", 0, false);\n }\n\n const client =\n llm ??\n new FallbackLlmClient(\n config.gatewayConfig,\n fallbackLlmRuntimeContextFromConfig(config),\n );\n\n // Forward the recall abort signal so an aborted/timed-out outer recall can\n // cancel an in-flight planner call (FallbackLlmClient honors `signal`).\n const options = { ...resolveRecallPlannerLlmOptions(config), signal };\n\n // Availability check uses the same routing options so plugin-mode / empty\n // chains short-circuit to the heuristic without a network attempt. `model`\n // here is already provider-qualified (bare names were dropped), so a present\n // model means the override is genuinely routable.\n const availabilityProbe = {\n agentId: options.agentId,\n modelChain: options.modelChain,\n };\n if (!client.isAvailable(availabilityProbe) && !options.model) {\n // Opted-in but nothing routable resolves (e.g. plugin mode with the bare\n // default `recallPlannerModel` and no gateway chain). Warn once so it's not\n // a silent no-op, then fall back to the heuristic.\n const signature = `${config.modelSource}:${config.recallPlannerModel ?? \"\"}`;\n if (!warnedNoRoutingSignatures.has(signature)) {\n warnedNoRoutingSignatures.add(signature);\n log.warn(\n \"[recall-planner] recallPlannerLlmEnabled is on but no routable model resolves — \" +\n \"set recallPlannerModel to a 'provider/model' value or configure a gateway model chain. \" +\n \"Falling back to the heuristic planner.\",\n );\n }\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"llm-no-model\", 0, true);\n }\n\n const clampedHints = clampHints(hints, config.recallPlannerMaxMemoryHints);\n const messages = buildMessages(safePrompt, clampedHints, config);\n\n const start = Date.now();\n try {\n const detailed = await client.parseWithSchemaDetailed(messages, PLANNER_SCHEMA, options);\n const latencyMs = Date.now() - start;\n if (!detailed?.result) {\n // Distinguish failure from a valid empty (gotcha #34): a null here means\n // no parseable classification, so fall back to the heuristic.\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"llm-empty\", latencyMs, true);\n }\n const mode = detailed.result.mode;\n const reason =\n typeof detailed.result.reason === \"string\" && detailed.result.reason.trim().length > 0\n ? detailed.result.reason.trim()\n : \"llm-classified\";\n return {\n mode,\n heuristicMode,\n source: \"llm\",\n reason,\n modelUsed: detailed.modelUsed,\n latencyMs,\n fallbackUsed: false,\n };\n } catch (err) {\n const latencyMs = Date.now() - start;\n if (signal?.aborted) {\n // Cancelled by the outer recall — expected, not an error worth warning on.\n return heuristicResult(heuristicMode, \"heuristic-fallback\", \"aborted\", latencyMs, true);\n }\n const message = err instanceof Error ? err.message : String(err);\n log.warn(`[recall-planner] LLM failed, falling back to heuristic: ${message}`);\n return heuristicResult(\n heuristicMode,\n \"heuristic-fallback\",\n `llm-error:${message}`,\n latencyMs,\n true,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAsDlB,IAAM,iBAAiB,EAAE,OAAO;AAAA;AAAA,EAE9B,MAAM,EAAE,KAAK,CAAC,aAAa,WAAW,QAAQ,YAAY,CAAC;AAAA,EAC3D,QAAQ,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS;AAClD,CAAC;AAED,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAGX,SAAS,YAAY,QAAgB,UAA0B;AAC7D,QAAM,UAAU,OAAO,SAAS,QAAQ,KAAK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,QACF;AAAA,MAGF;AAAA,IACF;AACA,WAAO,gBAAgB,eAAe,sBAAsB,gBAAgB,GAAG,IAAI;AAAA,EACrF;AAEA,QAAM,eAAe,WAAW,OAAO,OAAO,2BAA2B;AACzE,QAAM,WAAW,cAAc,YAAY,cAAc,MAAM;AAE/D,QAAM,QAAQ,KAAK,IAAI;AACvB,MAAI;AACF,UAAM,WAAW,MAAM,OAAO,wBAAwB,UAAU,gBAAgB,OAAO;AACvF,UAAM,YAAY,KAAK,IAAI,IAAI;AAC/B,QAAI,CAAC,UAAU,QAAQ;AAGrB,aAAO,gBAAgB,eAAe,sBAAsB,aAAa,WAAW,IAAI;AAAA,IAC1F;AACA,UAAM,OAAO,SAAS,OAAO;AAC7B,UAAM,SACJ,OAAO,SAAS,OAAO,WAAW,YAAY,SAAS,OAAO,OAAO,KAAK,EAAE,SAAS,IACjF,SAAS,OAAO,OAAO,KAAK,IAC5B;AACN,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA,WAAW,SAAS;AAAA,MACpB;AAAA,MACA,cAAc;AAAA,IAChB;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,YAAY,KAAK,IAAI,IAAI;AAC/B,QAAI,QAAQ,SAAS;AAEnB,aAAO,gBAAgB,eAAe,sBAAsB,WAAW,WAAW,IAAI;AAAA,IACxF;AACA,UAAM,UAAU,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;AAC/D,QAAI,KAAK,2DAA2D,OAAO,EAAE;AAC7E,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,aAAa,OAAO;AAAA,MACpB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
package/dist/schemas.d.ts CHANGED
@@ -7,13 +7,13 @@ declare const MemoryActionEligibilityContextSchema: z.ZodObject<{
7
7
  importance: z.ZodNumber;
8
8
  source: z.ZodEnum<["extraction", "consolidation", "replay", "manual", "unknown"]>;
9
9
  }, "strict", z.ZodTypeAny, {
10
+ source: "manual" | "extraction" | "consolidation" | "replay" | "unknown";
10
11
  confidence: number;
11
- source: "unknown" | "manual" | "extraction" | "consolidation" | "replay";
12
12
  lifecycleState: "active" | "archived" | "candidate" | "validated" | "stale";
13
13
  importance: number;
14
14
  }, {
15
+ source: "manual" | "extraction" | "consolidation" | "replay" | "unknown";
15
16
  confidence: number;
16
- source: "unknown" | "manual" | "extraction" | "consolidation" | "replay";
17
17
  lifecycleState: "active" | "archived" | "candidate" | "validated" | "stale";
18
18
  importance: number;
19
19
  }>;
@@ -149,10 +149,10 @@ declare const ExtractedFactSchema: z.ZodEffects<z.ZodObject<{
149
149
  observed_outcome?: string | null | undefined;
150
150
  }>>>;
151
151
  }, "strip", z.ZodTypeAny, {
152
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
152
+ tags: string[];
153
153
  content: string;
154
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
154
155
  confidence: number;
155
- tags: string[];
156
156
  entityRef?: string | null | undefined;
157
157
  structuredAttributes?: Record<string, string> | null | undefined;
158
158
  promptedByQuestion?: string | null | undefined;
@@ -178,10 +178,10 @@ declare const ExtractedFactSchema: z.ZodEffects<z.ZodObject<{
178
178
  observed_outcome?: string | null | undefined;
179
179
  } | null | undefined;
180
180
  }, {
181
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
181
+ tags: string[];
182
182
  content: string;
183
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
183
184
  confidence: number;
184
- tags: string[];
185
185
  entityRef?: string | null | undefined;
186
186
  structuredAttributes?: Record<string, string> | null | undefined;
187
187
  promptedByQuestion?: string | null | undefined;
@@ -207,10 +207,10 @@ declare const ExtractedFactSchema: z.ZodEffects<z.ZodObject<{
207
207
  observed_outcome?: string | null | undefined;
208
208
  } | null | undefined;
209
209
  }>, {
210
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
210
+ tags: string[];
211
211
  content: string;
212
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
212
213
  confidence: number;
213
- tags: string[];
214
214
  entityRef?: string | null | undefined;
215
215
  structuredAttributes?: Record<string, string> | null | undefined;
216
216
  promptedByQuestion?: string | null | undefined;
@@ -236,10 +236,10 @@ declare const ExtractedFactSchema: z.ZodEffects<z.ZodObject<{
236
236
  observed_outcome?: string | null | undefined;
237
237
  } | null | undefined;
238
238
  }, {
239
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
239
+ tags: string[];
240
240
  content: string;
241
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
241
242
  confidence: number;
242
- tags: string[];
243
243
  entityRef?: string | null | undefined;
244
244
  structuredAttributes?: Record<string, string> | null | undefined;
245
245
  promptedByQuestion?: string | null | undefined;
@@ -457,10 +457,10 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
457
457
  observed_outcome?: string | null | undefined;
458
458
  }>>>;
459
459
  }, "strip", z.ZodTypeAny, {
460
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
460
+ tags: string[];
461
461
  content: string;
462
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
462
463
  confidence: number;
463
- tags: string[];
464
464
  entityRef?: string | null | undefined;
465
465
  structuredAttributes?: Record<string, string> | null | undefined;
466
466
  promptedByQuestion?: string | null | undefined;
@@ -486,10 +486,10 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
486
486
  observed_outcome?: string | null | undefined;
487
487
  } | null | undefined;
488
488
  }, {
489
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
489
+ tags: string[];
490
490
  content: string;
491
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
491
492
  confidence: number;
492
- tags: string[];
493
493
  entityRef?: string | null | undefined;
494
494
  structuredAttributes?: Record<string, string> | null | undefined;
495
495
  promptedByQuestion?: string | null | undefined;
@@ -515,10 +515,10 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
515
515
  observed_outcome?: string | null | undefined;
516
516
  } | null | undefined;
517
517
  }>, {
518
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
518
+ tags: string[];
519
519
  content: string;
520
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
520
521
  confidence: number;
521
- tags: string[];
522
522
  entityRef?: string | null | undefined;
523
523
  structuredAttributes?: Record<string, string> | null | undefined;
524
524
  promptedByQuestion?: string | null | undefined;
@@ -544,10 +544,10 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
544
544
  observed_outcome?: string | null | undefined;
545
545
  } | null | undefined;
546
546
  }, {
547
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
547
+ tags: string[];
548
548
  content: string;
549
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
549
550
  confidence: number;
550
- tags: string[];
551
551
  entityRef?: string | null | undefined;
552
552
  structuredAttributes?: Record<string, string> | null | undefined;
553
553
  promptedByQuestion?: string | null | undefined;
@@ -631,10 +631,10 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
631
631
  }>, "many">>>;
632
632
  }, "strip", z.ZodTypeAny, {
633
633
  facts: {
634
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
634
+ tags: string[];
635
635
  content: string;
636
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
636
637
  confidence: number;
637
- tags: string[];
638
638
  entityRef?: string | null | undefined;
639
639
  structuredAttributes?: Record<string, string> | null | undefined;
640
640
  promptedByQuestion?: string | null | undefined;
@@ -680,10 +680,10 @@ declare const ProactiveExtractionResultSchema: z.ZodObject<{
680
680
  }[] | null | undefined;
681
681
  }, {
682
682
  facts: {
683
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
683
+ tags: string[];
684
684
  content: string;
685
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
685
686
  confidence: number;
686
- tags: string[];
687
687
  entityRef?: string | null | undefined;
688
688
  structuredAttributes?: Record<string, string> | null | undefined;
689
689
  promptedByQuestion?: string | null | undefined;
@@ -825,10 +825,10 @@ declare const ExtractionResultSchema: z.ZodObject<{
825
825
  observed_outcome?: string | null | undefined;
826
826
  }>>>;
827
827
  }, "strip", z.ZodTypeAny, {
828
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
828
+ tags: string[];
829
829
  content: string;
830
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
830
831
  confidence: number;
831
- tags: string[];
832
832
  entityRef?: string | null | undefined;
833
833
  structuredAttributes?: Record<string, string> | null | undefined;
834
834
  promptedByQuestion?: string | null | undefined;
@@ -854,10 +854,10 @@ declare const ExtractionResultSchema: z.ZodObject<{
854
854
  observed_outcome?: string | null | undefined;
855
855
  } | null | undefined;
856
856
  }, {
857
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
857
+ tags: string[];
858
858
  content: string;
859
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
859
860
  confidence: number;
860
- tags: string[];
861
861
  entityRef?: string | null | undefined;
862
862
  structuredAttributes?: Record<string, string> | null | undefined;
863
863
  promptedByQuestion?: string | null | undefined;
@@ -883,10 +883,10 @@ declare const ExtractionResultSchema: z.ZodObject<{
883
883
  observed_outcome?: string | null | undefined;
884
884
  } | null | undefined;
885
885
  }>, {
886
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
886
+ tags: string[];
887
887
  content: string;
888
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
888
889
  confidence: number;
889
- tags: string[];
890
890
  entityRef?: string | null | undefined;
891
891
  structuredAttributes?: Record<string, string> | null | undefined;
892
892
  promptedByQuestion?: string | null | undefined;
@@ -912,10 +912,10 @@ declare const ExtractionResultSchema: z.ZodObject<{
912
912
  observed_outcome?: string | null | undefined;
913
913
  } | null | undefined;
914
914
  }, {
915
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
915
+ tags: string[];
916
916
  content: string;
917
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
917
918
  confidence: number;
918
- tags: string[];
919
919
  entityRef?: string | null | undefined;
920
920
  structuredAttributes?: Record<string, string> | null | undefined;
921
921
  promptedByQuestion?: string | null | undefined;
@@ -1013,10 +1013,10 @@ declare const ExtractionResultSchema: z.ZodObject<{
1013
1013
  }>, "many">>>;
1014
1014
  }, "strip", z.ZodTypeAny, {
1015
1015
  facts: {
1016
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
1016
+ tags: string[];
1017
1017
  content: string;
1018
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
1018
1019
  confidence: number;
1019
- tags: string[];
1020
1020
  entityRef?: string | null | undefined;
1021
1021
  structuredAttributes?: Record<string, string> | null | undefined;
1022
1022
  promptedByQuestion?: string | null | undefined;
@@ -1068,10 +1068,10 @@ declare const ExtractionResultSchema: z.ZodObject<{
1068
1068
  identityReflection?: string | null | undefined;
1069
1069
  }, {
1070
1070
  facts: {
1071
- category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
1071
+ tags: string[];
1072
1072
  content: string;
1073
+ category: "fact" | "preference" | "correction" | "entity" | "decision" | "relationship" | "principle" | "commitment" | "moment" | "skill" | "rule" | "procedure" | "reasoning_trace";
1073
1074
  confidence: number;
1074
- tags: string[];
1075
1075
  entityRef?: string | null | undefined;
1076
1076
  structuredAttributes?: Record<string, string> | null | undefined;
1077
1077
  promptedByQuestion?: string | null | undefined;
@@ -1285,13 +1285,13 @@ declare const ContradictionVerificationSchema: z.ZodObject<{
1285
1285
  reasoning: z.ZodString;
1286
1286
  whichIsNewer: z.ZodEnum<["first", "second", "unclear"]>;
1287
1287
  }, "strip", z.ZodTypeAny, {
1288
- confidence: number;
1289
1288
  reasoning: string;
1289
+ confidence: number;
1290
1290
  isContradiction: boolean;
1291
1291
  whichIsNewer: "second" | "first" | "unclear";
1292
1292
  }, {
1293
- confidence: number;
1294
1293
  reasoning: string;
1294
+ confidence: number;
1295
1295
  isContradiction: boolean;
1296
1296
  whichIsNewer: "second" | "first" | "unclear";
1297
1297
  }>;
@@ -1386,8 +1386,8 @@ declare const BehaviorLoopAdjustmentSchema: z.ZodObject<{
1386
1386
  reason: z.ZodString;
1387
1387
  appliedAt: z.ZodString;
1388
1388
  }, "strip", z.ZodTypeAny, {
1389
- confidence: number;
1390
1389
  reason: string;
1390
+ confidence: number;
1391
1391
  parameter: string;
1392
1392
  previousValue: number;
1393
1393
  nextValue: number;
@@ -1395,8 +1395,8 @@ declare const BehaviorLoopAdjustmentSchema: z.ZodObject<{
1395
1395
  evidenceCount: number;
1396
1396
  appliedAt: string;
1397
1397
  }, {
1398
- confidence: number;
1399
1398
  reason: string;
1399
+ confidence: number;
1400
1400
  parameter: string;
1401
1401
  previousValue: number;
1402
1402
  nextValue: number;
@@ -1420,8 +1420,8 @@ declare const BehaviorLoopPolicyStateSchema: z.ZodObject<{
1420
1420
  reason: z.ZodString;
1421
1421
  appliedAt: z.ZodString;
1422
1422
  }, "strip", z.ZodTypeAny, {
1423
- confidence: number;
1424
1423
  reason: string;
1424
+ confidence: number;
1425
1425
  parameter: string;
1426
1426
  previousValue: number;
1427
1427
  nextValue: number;
@@ -1429,8 +1429,8 @@ declare const BehaviorLoopPolicyStateSchema: z.ZodObject<{
1429
1429
  evidenceCount: number;
1430
1430
  appliedAt: string;
1431
1431
  }, {
1432
- confidence: number;
1433
1432
  reason: string;
1433
+ confidence: number;
1434
1434
  parameter: string;
1435
1435
  previousValue: number;
1436
1436
  nextValue: number;
@@ -1447,8 +1447,8 @@ declare const BehaviorLoopPolicyStateSchema: z.ZodObject<{
1447
1447
  maxDeltaPerCycle: number;
1448
1448
  protectedParams: string[];
1449
1449
  adjustments: {
1450
- confidence: number;
1451
1450
  reason: string;
1451
+ confidence: number;
1452
1452
  parameter: string;
1453
1453
  previousValue: number;
1454
1454
  nextValue: number;
@@ -1464,8 +1464,8 @@ declare const BehaviorLoopPolicyStateSchema: z.ZodObject<{
1464
1464
  maxDeltaPerCycle: number;
1465
1465
  protectedParams: string[];
1466
1466
  adjustments: {
1467
- confidence: number;
1468
1467
  reason: string;
1468
+ confidence: number;
1469
1469
  parameter: string;
1470
1470
  previousValue: number;
1471
1471
  nextValue: number;
@@ -2,24 +2,24 @@ import {
2
2
  createConversationIndexRuntime,
3
3
  createConversationSearchBackend,
4
4
  createSearchBackend
5
- } from "../chunk-ROHLEUTH.js";
5
+ } from "../chunk-23EBQ27U.js";
6
+ import "../chunk-OUWAQVDJ.js";
6
7
  import "../chunk-DOCTITOP.js";
7
8
  import "../chunk-CYEPCZN5.js";
8
9
  import "../chunk-Q5ZU3RNY.js";
9
10
  import "../chunk-JOASJWQR.js";
10
- import "../chunk-RN7MUWON.js";
11
- import "../chunk-OUWAQVDJ.js";
12
11
  import "../chunk-AER6MT24.js";
12
+ import "../chunk-RN7MUWON.js";
13
13
  import "../chunk-CINZGPSJ.js";
14
- import "../chunk-5GPPACXK.js";
15
- import "../chunk-7OGJQP7T.js";
14
+ import "../chunk-CRO4LCQ6.js";
15
+ import "../chunk-7DTASS5T.js";
16
16
  import "../chunk-E6ZDCOHM.js";
17
17
  import "../chunk-OIF36KGD.js";
18
- import "../chunk-7DTASS5T.js";
19
18
  import "../chunk-6RHNCKHG.js";
20
19
  import "../chunk-YNQ6DFSV.js";
21
20
  import "../chunk-O75CRYGF.js";
22
21
  import "../chunk-3ONXXHQO.js";
22
+ import "../chunk-5GPPACXK.js";
23
23
  import "../chunk-AWJ2FHCF.js";
24
24
  import "../chunk-42JKGUFJ.js";
25
25
  import "../chunk-JUC24CTX.js";
@@ -2,7 +2,10 @@ import {
2
2
  createConversationIndexRuntime,
3
3
  createConversationSearchBackend,
4
4
  createSearchBackend
5
- } from "../chunk-ROHLEUTH.js";
5
+ } from "../chunk-23EBQ27U.js";
6
+ import {
7
+ LanceDbBackend
8
+ } from "../chunk-OUWAQVDJ.js";
6
9
  import {
7
10
  MeilisearchBackend
8
11
  } from "../chunk-DOCTITOP.js";
@@ -15,25 +18,22 @@ import {
15
18
  import {
16
19
  RemoteSearchBackend
17
20
  } from "../chunk-JOASJWQR.js";
18
- import {
19
- EmbedHelper
20
- } from "../chunk-RN7MUWON.js";
21
- import {
22
- LanceDbBackend
23
- } from "../chunk-OUWAQVDJ.js";
24
21
  import {
25
22
  scanMemoryDir
26
23
  } from "../chunk-AER6MT24.js";
24
+ import {
25
+ EmbedHelper
26
+ } from "../chunk-RN7MUWON.js";
27
27
  import "../chunk-CINZGPSJ.js";
28
- import "../chunk-5GPPACXK.js";
29
- import "../chunk-7OGJQP7T.js";
28
+ import "../chunk-CRO4LCQ6.js";
29
+ import "../chunk-7DTASS5T.js";
30
30
  import "../chunk-E6ZDCOHM.js";
31
31
  import "../chunk-OIF36KGD.js";
32
- import "../chunk-7DTASS5T.js";
33
32
  import "../chunk-6RHNCKHG.js";
34
33
  import "../chunk-YNQ6DFSV.js";
35
34
  import "../chunk-O75CRYGF.js";
36
35
  import "../chunk-3ONXXHQO.js";
36
+ import "../chunk-5GPPACXK.js";
37
37
  import "../chunk-AWJ2FHCF.js";
38
38
  import "../chunk-42JKGUFJ.js";
39
39
  import "../chunk-JUC24CTX.js";
@@ -3,8 +3,8 @@ import {
3
3
  } from "../chunk-OUWAQVDJ.js";
4
4
  import "../chunk-AER6MT24.js";
5
5
  import "../chunk-CINZGPSJ.js";
6
- import "../chunk-5GPPACXK.js";
7
6
  import "../chunk-YNQ6DFSV.js";
7
+ import "../chunk-5GPPACXK.js";
8
8
  import "../chunk-2ODBA7MQ.js";
9
9
  import "../chunk-PVGDJXVK.js";
10
10
  import "../chunk-VS2IYZRU.js";
@@ -3,8 +3,8 @@ import {
3
3
  } from "../chunk-DOCTITOP.js";
4
4
  import "../chunk-AER6MT24.js";
5
5
  import "../chunk-CINZGPSJ.js";
6
- import "../chunk-5GPPACXK.js";
7
6
  import "../chunk-YNQ6DFSV.js";
7
+ import "../chunk-5GPPACXK.js";
8
8
  import "../chunk-2ODBA7MQ.js";
9
9
  import "../chunk-PVGDJXVK.js";
10
10
  import "../chunk-VS2IYZRU.js";
@@ -4,8 +4,8 @@ import {
4
4
  } from "../chunk-Q5ZU3RNY.js";
5
5
  import "../chunk-AER6MT24.js";
6
6
  import "../chunk-CINZGPSJ.js";
7
- import "../chunk-5GPPACXK.js";
8
7
  import "../chunk-YNQ6DFSV.js";
8
+ import "../chunk-5GPPACXK.js";
9
9
  import "../chunk-2ODBA7MQ.js";
10
10
  import "../chunk-PVGDJXVK.js";
11
11
  import "../chunk-VS2IYZRU.js";
@@ -7,16 +7,17 @@ import {
7
7
  materializeAfterSemanticConsolidation,
8
8
  parseConsolidationResponse,
9
9
  parseOperatorAwareConsolidationResponse
10
- } from "./chunk-XW3W4PV4.js";
11
- import "./chunk-C7AF236A.js";
10
+ } from "./chunk-JTPXSXHC.js";
11
+ import "./chunk-AARDBQTA.js";
12
12
  import "./chunk-LN4YGHTM.js";
13
13
  import {
14
14
  resolveExtensionsRoot
15
15
  } from "./chunk-JLNBQWZ2.js";
16
16
  import "./chunk-3UXOZBHV.js";
17
- import "./chunk-VH6EIKVS.js";
17
+ import "./chunk-WKMCC4NQ.js";
18
18
  import "./chunk-M7XQSUBB.js";
19
19
  import "./chunk-5UZXUTVO.js";
20
+ import "./chunk-5GPPACXK.js";
20
21
  import "./chunk-J6A3CX5N.js";
21
22
  import "./chunk-AZBV4RRY.js";
22
23
  import "./chunk-AWJ2FHCF.js";
@@ -28,13 +29,13 @@ import "./chunk-6KYMPV2O.js";
28
29
  import "./chunk-DM2T26WE.js";
29
30
  import "./chunk-LDXUBPMO.js";
30
31
  import "./chunk-FVQJYWH7.js";
32
+ import "./chunk-VF4XKTX3.js";
31
33
  import {
32
34
  CONSOLIDATION_OPERATORS,
33
35
  isConsolidationOperator,
34
36
  isSemanticConsolidationLlmOperator,
35
37
  isValidDerivedFromEntry
36
38
  } from "./chunk-G7D6GZ5J.js";
37
- import "./chunk-VF4XKTX3.js";
38
39
  import "./chunk-U3PN77QT.js";
39
40
  import "./chunk-4DJQYKMN.js";
40
41
  import "./chunk-EYIEWJNI.js";
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  promoteSemanticRuleFromMemory,
3
3
  setSemanticRulePromotionTestHooks
4
- } from "./chunk-IHG6CC7T.js";
5
- import "./chunk-VH6EIKVS.js";
4
+ } from "./chunk-BQJUPECT.js";
5
+ import "./chunk-WKMCC4NQ.js";
6
6
  import "./chunk-M7XQSUBB.js";
7
7
  import "./chunk-5UZXUTVO.js";
8
+ import "./chunk-5GPPACXK.js";
8
9
  import "./chunk-J6A3CX5N.js";
9
10
  import "./chunk-AZBV4RRY.js";
10
11
  import "./chunk-AWJ2FHCF.js";
@@ -16,8 +17,8 @@ import "./chunk-6KYMPV2O.js";
16
17
  import "./chunk-DM2T26WE.js";
17
18
  import "./chunk-LDXUBPMO.js";
18
19
  import "./chunk-FVQJYWH7.js";
19
- import "./chunk-G7D6GZ5J.js";
20
20
  import "./chunk-VF4XKTX3.js";
21
+ import "./chunk-G7D6GZ5J.js";
21
22
  import "./chunk-4DJQYKMN.js";
22
23
  import "./chunk-2ODBA7MQ.js";
23
24
  import "./chunk-J2HSAU72.js";
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  compareVerifiedSemanticRuleResults,
3
3
  searchVerifiedSemanticRules
4
- } from "./chunk-DSLUOQDY.js";
5
- import "./chunk-VH6EIKVS.js";
4
+ } from "./chunk-XMWF6AU3.js";
5
+ import "./chunk-WKMCC4NQ.js";
6
6
  import "./chunk-M7XQSUBB.js";
7
7
  import "./chunk-5UZXUTVO.js";
8
+ import "./chunk-5GPPACXK.js";
8
9
  import "./chunk-J6A3CX5N.js";
9
10
  import "./chunk-AZBV4RRY.js";
10
11
  import "./chunk-AWJ2FHCF.js";
@@ -16,8 +17,8 @@ import "./chunk-6KYMPV2O.js";
16
17
  import "./chunk-DM2T26WE.js";
17
18
  import "./chunk-LDXUBPMO.js";
18
19
  import "./chunk-FVQJYWH7.js";
19
- import "./chunk-G7D6GZ5J.js";
20
20
  import "./chunk-VF4XKTX3.js";
21
+ import "./chunk-G7D6GZ5J.js";
21
22
  import "./chunk-4DJQYKMN.js";
22
23
  import "./chunk-ZBJMUXZH.js";
23
24
  import "./chunk-2ODBA7MQ.js";
@@ -22,9 +22,9 @@ declare const SharedFeedbackEntrySchema: z.ZodObject<{
22
22
  date: string;
23
23
  agent: string;
24
24
  reason: string;
25
- confidence?: number | undefined;
26
25
  workflow?: string | undefined;
27
26
  tags?: string[] | undefined;
27
+ confidence?: number | undefined;
28
28
  severity?: "high" | "low" | "medium" | undefined;
29
29
  outcome?: string | undefined;
30
30
  refs?: string[] | undefined;
@@ -36,9 +36,9 @@ declare const SharedFeedbackEntrySchema: z.ZodObject<{
36
36
  date: string;
37
37
  agent: string;
38
38
  reason: string;
39
- confidence?: number | undefined;
40
39
  workflow?: string | undefined;
41
40
  tags?: string[] | undefined;
41
+ confidence?: number | undefined;
42
42
  severity?: "high" | "low" | "medium" | undefined;
43
43
  outcome?: string | undefined;
44
44
  refs?: string[] | undefined;
package/dist/storage.js CHANGED
@@ -9,9 +9,10 @@ import {
9
9
  parseEntityFile,
10
10
  serializeEntityFile,
11
11
  stripAttributesSuffix
12
- } from "./chunk-VH6EIKVS.js";
12
+ } from "./chunk-WKMCC4NQ.js";
13
13
  import "./chunk-M7XQSUBB.js";
14
14
  import "./chunk-5UZXUTVO.js";
15
+ import "./chunk-5GPPACXK.js";
15
16
  import "./chunk-J6A3CX5N.js";
16
17
  import "./chunk-AZBV4RRY.js";
17
18
  import "./chunk-AWJ2FHCF.js";
@@ -23,8 +24,8 @@ import "./chunk-6KYMPV2O.js";
23
24
  import "./chunk-DM2T26WE.js";
24
25
  import "./chunk-LDXUBPMO.js";
25
26
  import "./chunk-FVQJYWH7.js";
26
- import "./chunk-G7D6GZ5J.js";
27
27
  import "./chunk-VF4XKTX3.js";
28
+ import "./chunk-G7D6GZ5J.js";
28
29
  import "./chunk-4DJQYKMN.js";
29
30
  import "./chunk-2ODBA7MQ.js";
30
31
  import "./chunk-J2HSAU72.js";
@@ -4,11 +4,11 @@ import {
4
4
  import "../chunk-765K3SAT.js";
5
5
  import "../chunk-X7Y7WX73.js";
6
6
  import "../chunk-J4EB7DNW.js";
7
+ import "../chunk-UI3NYK34.js";
8
+ import "../chunk-GCGJW34D.js";
7
9
  import "../chunk-BJMBJZ2Y.js";
8
10
  import "../chunk-UKJAGEXH.js";
9
11
  import "../chunk-FP2373TW.js";
10
- import "../chunk-UI3NYK34.js";
11
- import "../chunk-GCGJW34D.js";
12
12
  import "../chunk-A6XUJE5D.js";
13
13
  import "../chunk-PZ5AY32C.js";
14
14
  export {