@orquentra/codebuddy 2.6.2 → 2.7.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 (104) hide show
  1. package/dist/{chunk-IBLJOHJL.js → chunk-3QGW53GD.js} +2 -2
  2. package/dist/{chunk-NERKZSSE.js → chunk-5EDGAZQN.js} +438 -68
  3. package/dist/chunk-5EDGAZQN.js.map +1 -0
  4. package/dist/{chunk-JFDRBPYF.js → chunk-6JCKMIQY.js} +2 -2
  5. package/dist/{chunk-2XDPKFUW.js → chunk-AK2UAE32.js} +46 -20
  6. package/dist/chunk-AK2UAE32.js.map +1 -0
  7. package/dist/{chunk-GDJH7XJC.js → chunk-AL6VBTNA.js} +77 -3
  8. package/dist/chunk-AL6VBTNA.js.map +1 -0
  9. package/dist/{chunk-QBDJXGG5.js → chunk-AQHPEJR6.js} +93 -22
  10. package/dist/chunk-AQHPEJR6.js.map +1 -0
  11. package/dist/{chunk-OWWCDRXW.js → chunk-BQM7FJ7D.js} +6 -6
  12. package/dist/chunk-BQM7FJ7D.js.map +1 -0
  13. package/dist/{chunk-XBJQKCLU.js → chunk-CAEPHLHC.js} +13 -9
  14. package/dist/chunk-CAEPHLHC.js.map +1 -0
  15. package/dist/chunk-CG5B3LYG.js +66 -0
  16. package/dist/chunk-CG5B3LYG.js.map +1 -0
  17. package/dist/{chunk-IHQM2ZDV.js → chunk-DFV2SK6C.js} +1 -1
  18. package/dist/{chunk-IHQM2ZDV.js.map → chunk-DFV2SK6C.js.map} +1 -1
  19. package/dist/{chunk-IMFUYEZA.js → chunk-EEUFU7KV.js} +81 -54
  20. package/dist/chunk-EEUFU7KV.js.map +1 -0
  21. package/dist/{chunk-5MQOE4J6.js → chunk-ESZXCZIN.js} +3 -3
  22. package/dist/{chunk-J2EAZ4MA.js → chunk-GKNYMNFM.js} +22 -25
  23. package/dist/chunk-GKNYMNFM.js.map +1 -0
  24. package/dist/{chunk-JPHJBCZB.js → chunk-HPOR6YXA.js} +3 -2
  25. package/dist/chunk-HPOR6YXA.js.map +1 -0
  26. package/dist/{chunk-S6VEG4S2.js → chunk-JUAFCLRB.js} +28 -5
  27. package/dist/chunk-JUAFCLRB.js.map +1 -0
  28. package/dist/{chunk-5KZY6OTG.js → chunk-KNR2P2UY.js} +33 -83
  29. package/dist/chunk-KNR2P2UY.js.map +1 -0
  30. package/dist/{chunk-B6CO63SQ.js → chunk-LCSBL5TT.js} +21 -9
  31. package/dist/chunk-LCSBL5TT.js.map +1 -0
  32. package/dist/{chunk-5FW3PMNP.js → chunk-MSUAVR3R.js} +76 -11
  33. package/dist/chunk-MSUAVR3R.js.map +1 -0
  34. package/dist/{chunk-RAJJSCIP.js → chunk-SFMIMLXR.js} +2 -2
  35. package/dist/chunk-TGFTKWOR.js +16 -0
  36. package/dist/chunk-TGFTKWOR.js.map +1 -0
  37. package/dist/chunk-TUR6YKEE.js +55 -0
  38. package/dist/chunk-TUR6YKEE.js.map +1 -0
  39. package/dist/chunk-Y7D7PUBE.js +321 -0
  40. package/dist/chunk-Y7D7PUBE.js.map +1 -0
  41. package/dist/{chunk-R7CD6EXS.js → chunk-YJIA2MFL.js} +572 -377
  42. package/dist/chunk-YJIA2MFL.js.map +1 -0
  43. package/dist/cli/index.js +5 -5
  44. package/dist/cli/index.js.map +1 -1
  45. package/dist/{cloud-7WM3YLI4.js → cloud-LXZUR3U2.js} +3 -3
  46. package/dist/{codebuddy-B_pCaQrV.d.ts → codebuddy-DO7ZhoWn.d.ts} +15 -1
  47. package/dist/config-GEZFLXK6.js +12 -0
  48. package/dist/index.d.ts +46 -3
  49. package/dist/index.js +22 -19
  50. package/dist/langgraph/index.d.ts +1 -1
  51. package/dist/lean-command-CWJAVQ5G.js +18 -0
  52. package/dist/{local-5MZURLCZ.js → local-ST4WMRCG.js} +3 -3
  53. package/dist/{main-MTBQZGJV.js → main-AHNGHC4L.js} +213 -183
  54. package/dist/main-AHNGHC4L.js.map +1 -0
  55. package/dist/{memory-KIC5FJVW.js → memory-TGHVTBME.js} +9 -8
  56. package/dist/memory-TGHVTBME.js.map +1 -0
  57. package/dist/operations-7BTAAUHF.js +26 -0
  58. package/dist/pretool-command-3SXQSMAO.js +13 -0
  59. package/dist/{rerank-5QZ3PNUW.js → rerank-IQAEWLQR.js} +6 -5
  60. package/dist/rerank-IQAEWLQR.js.map +1 -0
  61. package/dist/{runtime-CUBOOPZO.js → runtime-E7JQZ2BZ.js} +14 -11
  62. package/dist/summaries-XV3JGGCC.js +20 -0
  63. package/dist/{zvec-MSRKT7IV.js → zvec-KP4KNB7Y.js} +10 -3
  64. package/package.json +1 -1
  65. package/src/db/migrations/0006_fact_idempotency_key.sql +2 -0
  66. package/src/db/migrations/meta/0006_snapshot.json +1258 -0
  67. package/src/db/migrations/meta/_journal.json +7 -0
  68. package/dist/chunk-2XDPKFUW.js.map +0 -1
  69. package/dist/chunk-5FW3PMNP.js.map +0 -1
  70. package/dist/chunk-5KZY6OTG.js.map +0 -1
  71. package/dist/chunk-B6CO63SQ.js.map +0 -1
  72. package/dist/chunk-GDJH7XJC.js.map +0 -1
  73. package/dist/chunk-IMFUYEZA.js.map +0 -1
  74. package/dist/chunk-J2EAZ4MA.js.map +0 -1
  75. package/dist/chunk-JPHJBCZB.js.map +0 -1
  76. package/dist/chunk-NERKZSSE.js.map +0 -1
  77. package/dist/chunk-OWWCDRXW.js.map +0 -1
  78. package/dist/chunk-PQK3GKZH.js +0 -98
  79. package/dist/chunk-PQK3GKZH.js.map +0 -1
  80. package/dist/chunk-QBDJXGG5.js.map +0 -1
  81. package/dist/chunk-R7CD6EXS.js.map +0 -1
  82. package/dist/chunk-S6VEG4S2.js.map +0 -1
  83. package/dist/chunk-XBJQKCLU.js.map +0 -1
  84. package/dist/config-DEVHUDIU.js +0 -11
  85. package/dist/lean-command-HTQCPH76.js +0 -15
  86. package/dist/main-MTBQZGJV.js.map +0 -1
  87. package/dist/memory-KIC5FJVW.js.map +0 -1
  88. package/dist/operations-POCHY3WR.js +0 -25
  89. package/dist/pretool-command-AX6JXP25.js +0 -10
  90. package/dist/rerank-5QZ3PNUW.js.map +0 -1
  91. package/dist/summaries-SB5L2TSW.js +0 -18
  92. /package/dist/{chunk-IBLJOHJL.js.map → chunk-3QGW53GD.js.map} +0 -0
  93. /package/dist/{chunk-JFDRBPYF.js.map → chunk-6JCKMIQY.js.map} +0 -0
  94. /package/dist/{chunk-5MQOE4J6.js.map → chunk-ESZXCZIN.js.map} +0 -0
  95. /package/dist/{chunk-RAJJSCIP.js.map → chunk-SFMIMLXR.js.map} +0 -0
  96. /package/dist/{cloud-7WM3YLI4.js.map → cloud-LXZUR3U2.js.map} +0 -0
  97. /package/dist/{config-DEVHUDIU.js.map → config-GEZFLXK6.js.map} +0 -0
  98. /package/dist/{lean-command-HTQCPH76.js.map → lean-command-CWJAVQ5G.js.map} +0 -0
  99. /package/dist/{local-5MZURLCZ.js.map → local-ST4WMRCG.js.map} +0 -0
  100. /package/dist/{operations-POCHY3WR.js.map → operations-7BTAAUHF.js.map} +0 -0
  101. /package/dist/{pretool-command-AX6JXP25.js.map → pretool-command-3SXQSMAO.js.map} +0 -0
  102. /package/dist/{runtime-CUBOOPZO.js.map → runtime-E7JQZ2BZ.js.map} +0 -0
  103. /package/dist/{summaries-SB5L2TSW.js.map → summaries-XV3JGGCC.js.map} +0 -0
  104. /package/dist/{zvec-MSRKT7IV.js.map → zvec-KP4KNB7Y.js.map} +0 -0
package/dist/cli/index.js CHANGED
@@ -3,24 +3,24 @@
3
3
  // src/cli/index.ts
4
4
  var [command, subcommand] = process.argv.slice(2);
5
5
  if (command === "hooks" && subcommand === "lean") {
6
- const { runLeanHookCommand } = await import("../lean-command-HTQCPH76.js");
6
+ const { runLeanHookCommand } = await import("../lean-command-CWJAVQ5G.js");
7
7
  await runLeanHookCommand();
8
8
  } else if (command === "hooks" && subcommand === "pretool") {
9
- const { runPreToolHookCommand } = await import("../pretool-command-AX6JXP25.js");
9
+ const { runPreToolHookCommand } = await import("../pretool-command-3SXQSMAO.js");
10
10
  await runPreToolHookCommand();
11
11
  } else if (command === "hooks" && (subcommand === "context" || subcommand === "stage" || subcommand === "reset")) {
12
12
  const [{ failSoft, readHookInput, writeStdout }, runtime] = await Promise.all([
13
13
  import("../stdio-HOV4P3DQ.js"),
14
- import("../runtime-CUBOOPZO.js")
14
+ import("../runtime-E7JQZ2BZ.js")
15
15
  ]);
16
16
  await failSoft(async () => {
17
17
  const input = await readHookInput();
18
18
  if (subcommand === "context") await runtime.runContextHook(input, writeStdout);
19
19
  else if (subcommand === "stage") await runtime.runStageHook(input);
20
- else await runtime.runResetHook(input);
20
+ else await runtime.runResetHook(input, writeStdout);
21
21
  });
22
22
  } else {
23
- const { createCli } = await import("../main-MTBQZGJV.js");
23
+ const { createCli } = await import("../main-AHNGHC4L.js");
24
24
  await createCli().parseAsync();
25
25
  }
26
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Launcher. Hooks that fire on every prompt (context, lean), every edit\n * (stage), every Read/Grep (pretool) or on compaction (reset) load only their\n * own modules, skipping the database driver, MCP server and command tree\n * (~190 ms per process); every other command loads the full CLI. The\n * runtime calls match `codebuddy hooks <name>` in commands/hooks.ts.\n */\nconst [command, subcommand] = process.argv.slice(2);\nif (command === \"hooks\" && subcommand === \"lean\") {\n const { runLeanHookCommand } = await import(\"../hooks/lean-command.js\");\n await runLeanHookCommand();\n} else if (command === \"hooks\" && subcommand === \"pretool\") {\n const { runPreToolHookCommand } = await import(\"../hooks/pretool-command.js\");\n await runPreToolHookCommand();\n} else if (\n command === \"hooks\" &&\n (subcommand === \"context\" || subcommand === \"stage\" || subcommand === \"reset\")\n) {\n const [{ failSoft, readHookInput, writeStdout }, runtime] = await Promise.all([\n import(\"../hooks/stdio.js\"),\n import(\"../hooks/runtime.js\"),\n ]);\n await failSoft(async () => {\n const input = await readHookInput();\n if (subcommand === \"context\") await runtime.runContextHook(input, writeStdout);\n else if (subcommand === \"stage\") await runtime.runStageHook(input);\n else await runtime.runResetHook(input);\n });\n} else {\n const { createCli } = await import(\"./main.js\");\n await createCli().parseAsync();\n}\n"],"mappings":";;;AAQA,IAAM,CAAC,SAAS,UAAU,IAAI,QAAQ,KAAK,MAAM,CAAC;AAClD,IAAI,YAAY,WAAW,eAAe,QAAQ;AAChD,QAAM,EAAE,mBAAmB,IAAI,MAAM,OAAO,6BAA0B;AACtE,QAAM,mBAAmB;AAC3B,WAAW,YAAY,WAAW,eAAe,WAAW;AAC1D,QAAM,EAAE,sBAAsB,IAAI,MAAM,OAAO,gCAA6B;AAC5E,QAAM,sBAAsB;AAC9B,WACE,YAAY,YACX,eAAe,aAAa,eAAe,WAAW,eAAe,UACtE;AACA,QAAM,CAAC,EAAE,UAAU,eAAe,YAAY,GAAG,OAAO,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC5E,OAAO,sBAAmB;AAAA,IAC1B,OAAO,wBAAqB;AAAA,EAC9B,CAAC;AACD,QAAM,SAAS,YAAY;AACzB,UAAM,QAAQ,MAAM,cAAc;AAClC,QAAI,eAAe,UAAW,OAAM,QAAQ,eAAe,OAAO,WAAW;AAAA,aACpE,eAAe,QAAS,OAAM,QAAQ,aAAa,KAAK;AAAA,QAC5D,OAAM,QAAQ,aAAa,KAAK;AAAA,EACvC,CAAC;AACH,OAAO;AACL,QAAM,EAAE,UAAU,IAAI,MAAM,OAAO,qBAAW;AAC9C,QAAM,UAAU,EAAE,WAAW;AAC/B;","names":[]}
1
+ {"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Launcher. Hooks that fire on every prompt (context, lean), every edit\n * (stage), every Read/Grep (pretool) or on compaction (reset) load only their\n * own modules, skipping the database driver, MCP server and command tree\n * (~190 ms per process); every other command loads the full CLI. The\n * runtime calls match `codebuddy hooks <name>` in commands/hooks.ts.\n */\nconst [command, subcommand] = process.argv.slice(2);\nif (command === \"hooks\" && subcommand === \"lean\") {\n const { runLeanHookCommand } = await import(\"../hooks/lean-command.js\");\n await runLeanHookCommand();\n} else if (command === \"hooks\" && subcommand === \"pretool\") {\n const { runPreToolHookCommand } = await import(\"../hooks/pretool-command.js\");\n await runPreToolHookCommand();\n} else if (\n command === \"hooks\" &&\n (subcommand === \"context\" || subcommand === \"stage\" || subcommand === \"reset\")\n) {\n const [{ failSoft, readHookInput, writeStdout }, runtime] = await Promise.all([\n import(\"../hooks/stdio.js\"),\n import(\"../hooks/runtime.js\"),\n ]);\n await failSoft(async () => {\n const input = await readHookInput();\n if (subcommand === \"context\") await runtime.runContextHook(input, writeStdout);\n else if (subcommand === \"stage\") await runtime.runStageHook(input);\n else await runtime.runResetHook(input, writeStdout);\n });\n} else {\n const { createCli } = await import(\"./main.js\");\n await createCli().parseAsync();\n}\n"],"mappings":";;;AAQA,IAAM,CAAC,SAAS,UAAU,IAAI,QAAQ,KAAK,MAAM,CAAC;AAClD,IAAI,YAAY,WAAW,eAAe,QAAQ;AAChD,QAAM,EAAE,mBAAmB,IAAI,MAAM,OAAO,6BAA0B;AACtE,QAAM,mBAAmB;AAC3B,WAAW,YAAY,WAAW,eAAe,WAAW;AAC1D,QAAM,EAAE,sBAAsB,IAAI,MAAM,OAAO,gCAA6B;AAC5E,QAAM,sBAAsB;AAC9B,WACE,YAAY,YACX,eAAe,aAAa,eAAe,WAAW,eAAe,UACtE;AACA,QAAM,CAAC,EAAE,UAAU,eAAe,YAAY,GAAG,OAAO,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC5E,OAAO,sBAAmB;AAAA,IAC1B,OAAO,wBAAqB;AAAA,EAC9B,CAAC;AACD,QAAM,SAAS,YAAY;AACzB,UAAM,QAAQ,MAAM,cAAc;AAClC,QAAI,eAAe,UAAW,OAAM,QAAQ,eAAe,OAAO,WAAW;AAAA,aACpE,eAAe,QAAS,OAAM,QAAQ,aAAa,KAAK;AAAA,QAC5D,OAAM,QAAQ,aAAa,OAAO,WAAW;AAAA,EACpD,CAAC;AACH,OAAO;AACL,QAAM,EAAE,UAAU,IAAI,MAAM,OAAO,qBAAW;AAC9C,QAAM,UAAU,EAAE,WAAW;AAC/B;","names":[]}
@@ -4,8 +4,8 @@ import {
4
4
  OpenRouterEmbeddingProvider,
5
5
  rerankHuggingFace,
6
6
  rerankOpenRouter
7
- } from "./chunk-JFDRBPYF.js";
8
- import "./chunk-JPHJBCZB.js";
7
+ } from "./chunk-6JCKMIQY.js";
8
+ import "./chunk-HPOR6YXA.js";
9
9
  import "./chunk-PZ5AY32C.js";
10
10
  export {
11
11
  HF_ROUTER_BASE_URL,
@@ -14,4 +14,4 @@ export {
14
14
  rerankHuggingFace,
15
15
  rerankOpenRouter
16
16
  };
17
- //# sourceMappingURL=cloud-7WM3YLI4.js.map
17
+ //# sourceMappingURL=cloud-LXZUR3U2.js.map
@@ -68,6 +68,8 @@ type ProviderConfig = {
68
68
  model?: string;
69
69
  /** Cosine floor for dense recall; overrides the built-in calibration (`models calibrate`). */
70
70
  relevanceFloor?: number;
71
+ /** Looser floor for an explicit `recall` (the agent asked); overrides the built-in one. */
72
+ recallFloor?: number;
71
73
  };
72
74
  type WorkerConfig = {
73
75
  pollIntervalMs?: number;
@@ -164,6 +166,8 @@ type FactInsert = {
164
166
  object: string;
165
167
  /** Explicit single-valued proposition identity; null/absent allows multiple values. */
166
168
  propositionKey?: string | null | undefined;
169
+ /** The caller's retry key; a write carrying a known key returns that fact. */
170
+ idempotencyKey?: string | null | undefined;
167
171
  /** Imported provenance/lifecycle from the Markdown source; defaults apply when absent. */
168
172
  confidence?: number | undefined;
169
173
  createdAt?: Date | undefined;
@@ -510,6 +514,12 @@ type PlanInput = {
510
514
  conflictMode: ConflictMode;
511
515
  queryEmbedding: QueryEmbedding | null;
512
516
  repository: MemoryRepository;
517
+ /**
518
+ * Calibrated cosine at or above which a vector match is relevant for this
519
+ * embedding model (the same floor the prompt hook uses). Without it, the
520
+ * policy's generic minimum applies.
521
+ */
522
+ relevanceFloor?: number | undefined;
513
523
  };
514
524
  /** Structured provenance for a recalled fact; `conflict` is set when its proposition key had rivals. */
515
525
  type FactProvenance = {
@@ -600,6 +610,7 @@ declare const codeBuddyConfigSchema: z.ZodObject<{
600
610
  apiKey: z.ZodOptional<z.ZodString>;
601
611
  model: z.ZodOptional<z.ZodString>;
602
612
  relevanceFloor: z.ZodOptional<z.ZodNumber>;
613
+ recallFloor: z.ZodOptional<z.ZodNumber>;
603
614
  }, z.core.$strip>;
604
615
  namespace: z.ZodString;
605
616
  projectRoot: z.ZodOptional<z.ZodString>;
@@ -629,6 +640,7 @@ declare const factFrontMatterSchema: z.ZodObject<{
629
640
  predicate: z.ZodString;
630
641
  object: z.ZodString;
631
642
  propositionKey: z.ZodDefault<z.ZodNullable<z.ZodString>>;
643
+ idempotencyKey: z.ZodDefault<z.ZodNullable<z.ZodString>>;
632
644
  confidence: z.ZodNumber;
633
645
  createdAt: z.ZodPreprocess<z.ZodString, unknown>;
634
646
  createdByAgent: z.ZodNullable<z.ZodString>;
@@ -669,7 +681,7 @@ type FactFile = z.infer<typeof factFrontMatterSchema> & {
669
681
  content: string;
670
682
  path: string;
671
683
  };
672
- type FactFileWrite = Omit<FactFile, "path" | "schemaVersion" | "type" | "category" | "paths" | "severity" | "introducedBy" | "resolvedBy" | "fingerprint" | "sourcePlanId" | "sourceSessionId" | "verification" | "supersededBy" | "sharedWith" | "propositionKey"> & Partial<Pick<FactFile, "category" | "paths" | "severity" | "introducedBy" | "resolvedBy" | "fingerprint" | "sourcePlanId" | "sourceSessionId" | "verification" | "supersededBy" | "sharedWith" | "propositionKey">>;
684
+ type FactFileWrite = Omit<FactFile, "path" | "schemaVersion" | "type" | "category" | "paths" | "severity" | "introducedBy" | "resolvedBy" | "fingerprint" | "sourcePlanId" | "sourceSessionId" | "verification" | "supersededBy" | "sharedWith" | "propositionKey" | "idempotencyKey"> & Partial<Pick<FactFile, "category" | "paths" | "severity" | "introducedBy" | "resolvedBy" | "fingerprint" | "sourcePlanId" | "sourceSessionId" | "verification" | "supersededBy" | "sharedWith" | "propositionKey" | "idempotencyKey">>;
673
685
  type IncidentFactFile = FactFile & {
674
686
  category: "incident";
675
687
  severity: IncidentSeverity;
@@ -823,6 +835,8 @@ declare class CodeBuddy {
823
835
  remember(input: RememberInput): Promise<RememberResult>;
824
836
  rememberBatch(items: RememberBatchItem[]): Promise<RememberResult[]>;
825
837
  recall(input: RecallInput): Promise<RecallResult>;
838
+ /** Cosine floor for an explicit `recall` of the query's embedding model. */
839
+ private recallFloor;
826
840
  /**
827
841
  * Dense evidence for file facts supplied by the context engine: the cosine of
828
842
  * each fact whose stored vector clears the embedding model's calibrated
@@ -0,0 +1,12 @@
1
+ import {
2
+ redactLlmKeys,
3
+ resolveLlmConfig
4
+ } from "./chunk-SFMIMLXR.js";
5
+ import "./chunk-KNR2P2UY.js";
6
+ import "./chunk-CG5B3LYG.js";
7
+ import "./chunk-PZ5AY32C.js";
8
+ export {
9
+ redactLlmKeys,
10
+ resolveLlmConfig
11
+ };
12
+ //# sourceMappingURL=config-GEZFLXK6.js.map
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as CodeBuddyConfig, M as MemoryRepository, b as MemoryFileStore, C as CodeBuddy, N as NamespaceSummary, A as AgentWriteBreakdown, L as ListedFact, c as ModelProvider, d as ContextPolicy, e as PlanInput, P as PlannedContext, E as EmbeddingSpace, f as ProviderDiagnosticsHook, g as EmbeddingRequest, h as EmbeddingResponse, T as TextGenerationRequest, i as TextGenerationResponse } from './codebuddy-B_pCaQrV.js';
2
- export { j as CodeBuddyDependencies, k as CodeBuddyStatus, l as ConflictMode, m as EmbeddingWorker, F as FACT_CATEGORIES, n as FactCategory, o as FactFile, p as FactFileWrite, q as ForgetResult, I as INCIDENT_SEVERITIES, r as IncidentFactFile, s as IncidentSeverity, t as MemoryWriteType, u as PlannedMessage, v as PlannerStats, Q as QueryEmbedding, R as RecallInput, w as RecallResult, x as RememberBatchItem, y as RememberInput, z as RememberResult, S as ShareInput, B as ShareResult, D as SkipReason, G as SummaryFile, H as SummaryFileWrite, J as TraceSpan, K as Tracer, U as UnshareInput, O as UnshareResult, W as WorkerConfig, V as WorkerState, X as createTracer, Y as isLangSmithTracingEnabled } from './codebuddy-B_pCaQrV.js';
1
+ import { a as CodeBuddyConfig, M as MemoryRepository, b as MemoryFileStore, C as CodeBuddy, N as NamespaceSummary, A as AgentWriteBreakdown, L as ListedFact, c as ModelProvider, d as ContextPolicy, e as PlanInput, P as PlannedContext, E as EmbeddingSpace, f as ProviderDiagnosticsHook, g as EmbeddingRequest, h as EmbeddingResponse, T as TextGenerationRequest, i as TextGenerationResponse } from './codebuddy-DO7ZhoWn.js';
2
+ export { j as CodeBuddyDependencies, k as CodeBuddyStatus, l as ConflictMode, m as EmbeddingWorker, F as FACT_CATEGORIES, n as FactCategory, o as FactFile, p as FactFileWrite, q as ForgetResult, I as INCIDENT_SEVERITIES, r as IncidentFactFile, s as IncidentSeverity, t as MemoryWriteType, u as PlannedMessage, v as PlannerStats, Q as QueryEmbedding, R as RecallInput, w as RecallResult, x as RememberBatchItem, y as RememberInput, z as RememberResult, S as ShareInput, B as ShareResult, D as SkipReason, G as SummaryFile, H as SummaryFileWrite, J as TraceSpan, K as Tracer, U as UnshareInput, O as UnshareResult, W as WorkerConfig, V as WorkerState, X as createTracer, Y as isLangSmithTracingEnabled } from './codebuddy-DO7ZhoWn.js';
3
3
  import { z } from 'zod';
4
4
  import * as drizzle_orm_postgres_js from 'drizzle-orm/postgres-js';
5
5
  import postgres from 'postgres';
@@ -388,6 +388,8 @@ declare class PlanLifecycle {
388
388
  complete(id: string, options?: CompleteOptions, now?: string): Promise<PlanSpec>;
389
389
  abandon(id: string, options?: AbandonOptions, now?: string): Promise<PlanSpec>;
390
390
  amend(id: string, patch: AmendPlanPatch): Promise<PlanSpec>;
391
+ /** Plan paths flow into risk, context and file reads; none may leave the repository. */
392
+ private assertPathsInside;
391
393
  current(namespace: string): Promise<PlanSpec | null>;
392
394
  private assertTransition;
393
395
  private require;
@@ -907,6 +909,23 @@ declare const facts: drizzle_orm_pg_core.PgTableWithColumns<{
907
909
  identity: undefined;
908
910
  generated: undefined;
909
911
  }, {}, {}>;
912
+ idempotencyKey: drizzle_orm_pg_core.PgColumn<{
913
+ name: "idempotency_key";
914
+ tableName: "facts";
915
+ dataType: "string";
916
+ columnType: "PgText";
917
+ data: string;
918
+ driverParam: string;
919
+ notNull: false;
920
+ hasDefault: false;
921
+ isPrimaryKey: false;
922
+ isAutoincrement: false;
923
+ hasRuntimeDefault: false;
924
+ enumValues: [string, ...string[]];
925
+ baseColumn: never;
926
+ identity: undefined;
927
+ generated: undefined;
928
+ }, {}, {}>;
910
929
  content: drizzle_orm_pg_core.PgColumn<{
911
930
  name: "content";
912
931
  tableName: "facts";
@@ -2011,7 +2030,7 @@ declare function createPostgresRepository(client: DatabaseClient): MemoryReposit
2011
2030
 
2012
2031
  type ModuleNode = {
2013
2032
  path: string;
2014
- language: "ts" | "js";
2033
+ language: "ts" | "js" | "py";
2015
2034
  imports: string[];
2016
2035
  };
2017
2036
  type ModuleEdge = {
@@ -2100,6 +2119,7 @@ declare const mcpToolInputSchemas: {
2100
2119
  latest: "latest";
2101
2120
  highest_confidence: "highest_confidence";
2102
2121
  }>>;
2122
+ compact: z.ZodOptional<z.ZodBoolean>;
2103
2123
  }, z.core.$strip>;
2104
2124
  readonly list_facts: z.ZodObject<{
2105
2125
  subject: z.ZodOptional<z.ZodString>;
@@ -2336,6 +2356,12 @@ type ModelDefinition = {
2336
2356
  * `npm run eval:semantic`; cosines are not comparable across models.
2337
2357
  */
2338
2358
  relevanceFloor?: number;
2359
+ /**
2360
+ * Floor for an explicit `recall`, where a miss costs more than an extra
2361
+ * fact: best F2 (recall-weighted) on the same calibration set. Without one,
2362
+ * `recall` uses `relevanceFloor`.
2363
+ */
2364
+ recallFloor?: number;
2339
2365
  };
2340
2366
 
2341
2367
  type ResilienceOptions = {
@@ -2498,11 +2524,28 @@ declare function resolveRiskPaths(input: {
2498
2524
  useGit?: boolean;
2499
2525
  }): Promise<string[]>;
2500
2526
 
2527
+ /**
2528
+ * `window` (default): commits, authors and reverts in the last `windowDays`.
2529
+ * `lifetime-size`: log-scaled commit count over all history plus log-scaled
2530
+ * line count. On a time-split benchmark (later bug-fix commits) the 30-day
2531
+ * window scored AUC 0.518, lifetime churn 0.791 and line count 0.834
2532
+ * (`scripts/eval-churn-split.mts` reproduces the comparison).
2533
+ */
2534
+ type ChurnMode = "window" | "lifetime-size";
2501
2535
  type ChurnSignalOptions = {
2502
2536
  repositoryRoot: string;
2503
2537
  enabled?: boolean;
2504
2538
  coefficient?: number;
2539
+ /** Explicit git `--since` value; overrides `windowDays`. */
2505
2540
  since?: string;
2541
+ /** Window for `window` mode, in days (default 30). */
2542
+ windowDays?: number;
2543
+ mode?: ChurnMode;
2544
+ /**
2545
+ * Score as of this date: only commits before it, and (lifetime-size) file
2546
+ * sizes at the last such commit. For time-split evaluation; default now.
2547
+ */
2548
+ asOf?: string | Date;
2506
2549
  };
2507
2550
  declare function createChurnSignal(options: ChurnSignalOptions): Signal;
2508
2551
 
package/dist/index.js CHANGED
@@ -3,7 +3,8 @@ import {
3
3
  migrateMemoryToFiles,
4
4
  registerCodeBuddyTools,
5
5
  startMcpServer
6
- } from "./chunk-IMFUYEZA.js";
6
+ } from "./chunk-EEUFU7KV.js";
7
+ import "./chunk-MSUAVR3R.js";
7
8
  import {
8
9
  ACTIVE_PLAN_STATUSES,
9
10
  ActivePlanExistsError,
@@ -21,15 +22,11 @@ import {
21
22
  createPolicySignal,
22
23
  readPolicyFile,
23
24
  resolveRiskPaths
24
- } from "./chunk-R7CD6EXS.js";
25
- import "./chunk-IHQM2ZDV.js";
26
- import "./chunk-J2EAZ4MA.js";
27
- import {
28
- buildArchitectureMap,
29
- neighbours,
30
- queryMap
31
- } from "./chunk-NERKZSSE.js";
32
- import "./chunk-PQK3GKZH.js";
25
+ } from "./chunk-YJIA2MFL.js";
26
+ import "./chunk-TUR6YKEE.js";
27
+ import "./chunk-DFV2SK6C.js";
28
+ import "./chunk-GKNYMNFM.js";
29
+ import "./chunk-TGFTKWOR.js";
33
30
  import {
34
31
  CodeBuddy,
35
32
  DefaultPolicy,
@@ -44,23 +41,28 @@ import {
44
41
  isLangSmithTracingEnabled,
45
42
  listFactsPage,
46
43
  runDoctor
47
- } from "./chunk-2XDPKFUW.js";
44
+ } from "./chunk-AK2UAE32.js";
48
45
  import {
49
46
  FACT_CATEGORIES,
50
47
  INCIDENT_SEVERITIES,
51
48
  MemoryFileStore
52
- } from "./chunk-S6VEG4S2.js";
53
- import "./chunk-GDJH7XJC.js";
49
+ } from "./chunk-JUAFCLRB.js";
54
50
  import {
55
51
  clampBudgetForCallerModel,
56
52
  countTokens
57
- } from "./chunk-XBJQKCLU.js";
58
- import "./chunk-JFDRBPYF.js";
53
+ } from "./chunk-CAEPHLHC.js";
54
+ import "./chunk-6JCKMIQY.js";
59
55
  import {
60
56
  LocalModelProvider
61
- } from "./chunk-IBLJOHJL.js";
62
- import "./chunk-JPHJBCZB.js";
63
- import "./chunk-5FW3PMNP.js";
57
+ } from "./chunk-3QGW53GD.js";
58
+ import {
59
+ buildArchitectureMap,
60
+ neighbours,
61
+ queryMap
62
+ } from "./chunk-5EDGAZQN.js";
63
+ import "./chunk-Y7D7PUBE.js";
64
+ import "./chunk-AL6VBTNA.js";
65
+ import "./chunk-HPOR6YXA.js";
64
66
  import {
65
67
  PLAN_POLICIES,
66
68
  checkConfigPermissions,
@@ -71,7 +73,8 @@ import {
71
73
  loadRuntimeConfig,
72
74
  redactSecrets,
73
75
  setPlanPolicy
74
- } from "./chunk-5KZY6OTG.js";
76
+ } from "./chunk-KNR2P2UY.js";
77
+ import "./chunk-CG5B3LYG.js";
75
78
  import "./chunk-PZ5AY32C.js";
76
79
  export {
77
80
  ACTIVE_PLAN_STATUSES,
@@ -1,4 +1,4 @@
1
- import { P as PlannedContext, C as CodeBuddy } from '../codebuddy-B_pCaQrV.js';
1
+ import { P as PlannedContext, C as CodeBuddy } from '../codebuddy-DO7ZhoWn.js';
2
2
  import 'zod';
3
3
 
4
4
  type CodeBuddyCheckpointerOptions = {
@@ -0,0 +1,18 @@
1
+ import {
2
+ runLeanHookCommand
3
+ } from "./chunk-LCSBL5TT.js";
4
+ import "./chunk-FJOTP632.js";
5
+ import "./chunk-GKNYMNFM.js";
6
+ import "./chunk-TGFTKWOR.js";
7
+ import "./chunk-CAEPHLHC.js";
8
+ import "./chunk-5EDGAZQN.js";
9
+ import "./chunk-Y7D7PUBE.js";
10
+ import "./chunk-AL6VBTNA.js";
11
+ import "./chunk-HPOR6YXA.js";
12
+ import "./chunk-KNR2P2UY.js";
13
+ import "./chunk-CG5B3LYG.js";
14
+ import "./chunk-PZ5AY32C.js";
15
+ export {
16
+ runLeanHookCommand
17
+ };
18
+ //# sourceMappingURL=lean-command-CWJAVQ5G.js.map
@@ -4,8 +4,8 @@ import {
4
4
  localRuntimeInstalled,
5
5
  modelCacheDir,
6
6
  rerankLocally
7
- } from "./chunk-IBLJOHJL.js";
8
- import "./chunk-JPHJBCZB.js";
7
+ } from "./chunk-3QGW53GD.js";
8
+ import "./chunk-HPOR6YXA.js";
9
9
  import "./chunk-PZ5AY32C.js";
10
10
  export {
11
11
  LocalModelProvider,
@@ -14,4 +14,4 @@ export {
14
14
  modelCacheDir,
15
15
  rerankLocally
16
16
  };
17
- //# sourceMappingURL=local-5MZURLCZ.js.map
17
+ //# sourceMappingURL=local-ST4WMRCG.js.map