pi-smart-compact 9.5.0 → 9.6.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.
@@ -25,7 +25,8 @@
25
25
  * `atomicWriteFile` for new async-friendly callers (background metrics).
26
26
  *
27
27
  * Lock acquisition is fail-closed: callers never continue an append/trim
28
- * without ownership. Locks older than 5s are reclaimed with an atomic rename.
28
+ * without ownership. Locks are never stolen on elapsed time because a live,
29
+ * slow owner must not overlap a successor.
29
30
  */
30
31
  /** Ensure a private directory exists and normalize an existing target. */
31
32
  export declare function ensureDir(dir: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/infra/fs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAYH,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAG3C;AAWD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAYnF;AAED,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAW9F;AAmCD,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,CAI1D;AAYD,+EAA+E;AAC/E,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CASrE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAoCtF;AAED,+EAA+E;AAC/E,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,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AE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAoCtF;AAED,+EAA+E;AAC/E,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwC1G;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAa,GAAG,CAAC,EAAE,CAoB1F;AAED,oEAAoE;AACpE,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBxF;AAGD,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CASxD;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAQ,GAAG,IAAI,CAElF"}
@@ -156,7 +156,7 @@ function formatProviderEvaluation(report) {
156
156
  import fs2 from "fs";
157
157
 
158
158
  // src/constants.ts
159
- var VERSION = "9.5.0";
159
+ var VERSION = "9.6.0";
160
160
  var SETTLED_TRIGGER_COOLDOWN_MS = 10 * 60000;
161
161
  var COMPACT_SYSTEM_PREFIX = "You are an expert conversation summarizer for a coding agent. " + "Produce structured markdown summaries. " + "Follow output format exactly. " + "Use EXACT names \u2014 never paraphrase code identifiers. " + "Trust deterministic extraction data over intuition.";
162
162
  var PROFILES = {
@@ -775,6 +775,38 @@ function warn(msg, err) {
775
775
  console.error(LOG_PREFIX + " " + msg + (detail ? ": " + detail : ""));
776
776
  }
777
777
 
778
+ // src/infra/fs.ts
779
+ import fs from "fs";
780
+ function readJsonlTail(target, limit, maxBytes = 512 * 1024) {
781
+ if (limit <= 0 || !fs.existsSync(target))
782
+ return [];
783
+ const stat = fs.statSync(target);
784
+ const length = Math.min(stat.size, maxBytes);
785
+ const buffer = Buffer.alloc(length);
786
+ const fd = fs.openSync(target, "r");
787
+ try {
788
+ fs.readSync(fd, buffer, 0, length, stat.size - length);
789
+ } finally {
790
+ fs.closeSync(fd);
791
+ }
792
+ let text = buffer.toString("utf8");
793
+ if (stat.size > length) {
794
+ const newline = text.indexOf(`
795
+ `);
796
+ text = newline >= 0 ? text.slice(newline + 1) : "";
797
+ }
798
+ const values = [];
799
+ for (const line of text.split(`
800
+ `)) {
801
+ if (!line)
802
+ continue;
803
+ try {
804
+ values.push(JSON.parse(line));
805
+ } catch {}
806
+ }
807
+ return values.slice(-limit);
808
+ }
809
+
778
810
  // src/infra/paths.ts
779
811
  import path from "path";
780
812
  import os from "os";
@@ -1083,38 +1115,6 @@ function isDiagnosticConstraintText(text) {
1083
1115
  return /^(?:\[[^\]]+\]\s*)?(?:npm\s+(?:error|warn|notice|audit|verbose|info)\b|(?:rg|grep):|command exited\b)/i.test(candidate);
1084
1116
  }
1085
1117
 
1086
- // src/infra/fs.ts
1087
- import fs from "fs";
1088
- function readJsonlTail(target, limit, maxBytes = 512 * 1024) {
1089
- if (limit <= 0 || !fs.existsSync(target))
1090
- return [];
1091
- const stat = fs.statSync(target);
1092
- const length = Math.min(stat.size, maxBytes);
1093
- const buffer = Buffer.alloc(length);
1094
- const fd = fs.openSync(target, "r");
1095
- try {
1096
- fs.readSync(fd, buffer, 0, length, stat.size - length);
1097
- } finally {
1098
- fs.closeSync(fd);
1099
- }
1100
- let text = buffer.toString("utf8");
1101
- if (stat.size > length) {
1102
- const newline = text.indexOf(`
1103
- `);
1104
- text = newline >= 0 ? text.slice(newline + 1) : "";
1105
- }
1106
- const values = [];
1107
- for (const line of text.split(`
1108
- `)) {
1109
- if (!line)
1110
- continue;
1111
- try {
1112
- values.push(JSON.parse(line));
1113
- } catch {}
1114
- }
1115
- return values.slice(-limit);
1116
- }
1117
-
1118
1118
  // src/infra/clock.ts
1119
1119
  var systemClock = {
1120
1120
  now: () => Date.now()
@@ -5,7 +5,7 @@ var __require = import.meta.require;
5
5
  import { ModelRegistry, ModelRuntime } from "@earendil-works/pi-coding-agent";
6
6
 
7
7
  // src/constants.ts
8
- var VERSION = "9.5.0";
8
+ var VERSION = "9.6.0";
9
9
  var SETTLED_TRIGGER_COOLDOWN_MS = 10 * 60000;
10
10
  var COMPACT_SYSTEM_PREFIX = "You are an expert conversation summarizer for a coding agent. " + "Produce structured markdown summaries. " + "Follow output format exactly. " + "Use EXACT names \u2014 never paraphrase code identifiers. " + "Trust deterministic extraction data over intuition.";
11
11
  var PROFILES = {
@@ -798,6 +798,38 @@ function warn(msg, err) {
798
798
  console.error(LOG_PREFIX + " " + msg + (detail ? ": " + detail : ""));
799
799
  }
800
800
 
801
+ // src/infra/fs.ts
802
+ import fs from "fs";
803
+ function readJsonlTail(target, limit, maxBytes = 512 * 1024) {
804
+ if (limit <= 0 || !fs.existsSync(target))
805
+ return [];
806
+ const stat = fs.statSync(target);
807
+ const length = Math.min(stat.size, maxBytes);
808
+ const buffer = Buffer.alloc(length);
809
+ const fd = fs.openSync(target, "r");
810
+ try {
811
+ fs.readSync(fd, buffer, 0, length, stat.size - length);
812
+ } finally {
813
+ fs.closeSync(fd);
814
+ }
815
+ let text = buffer.toString("utf8");
816
+ if (stat.size > length) {
817
+ const newline = text.indexOf(`
818
+ `);
819
+ text = newline >= 0 ? text.slice(newline + 1) : "";
820
+ }
821
+ const values = [];
822
+ for (const line of text.split(`
823
+ `)) {
824
+ if (!line)
825
+ continue;
826
+ try {
827
+ values.push(JSON.parse(line));
828
+ } catch {}
829
+ }
830
+ return values.slice(-limit);
831
+ }
832
+
801
833
  // src/infra/paths.ts
802
834
  import path from "path";
803
835
  import os from "os";
@@ -1106,38 +1138,6 @@ function isDiagnosticConstraintText(text) {
1106
1138
  return /^(?:\[[^\]]+\]\s*)?(?:npm\s+(?:error|warn|notice|audit|verbose|info)\b|(?:rg|grep):|command exited\b)/i.test(candidate);
1107
1139
  }
1108
1140
 
1109
- // src/infra/fs.ts
1110
- import fs from "fs";
1111
- function readJsonlTail(target, limit, maxBytes = 512 * 1024) {
1112
- if (limit <= 0 || !fs.existsSync(target))
1113
- return [];
1114
- const stat = fs.statSync(target);
1115
- const length = Math.min(stat.size, maxBytes);
1116
- const buffer = Buffer.alloc(length);
1117
- const fd = fs.openSync(target, "r");
1118
- try {
1119
- fs.readSync(fd, buffer, 0, length, stat.size - length);
1120
- } finally {
1121
- fs.closeSync(fd);
1122
- }
1123
- let text = buffer.toString("utf8");
1124
- if (stat.size > length) {
1125
- const newline = text.indexOf(`
1126
- `);
1127
- text = newline >= 0 ? text.slice(newline + 1) : "";
1128
- }
1129
- const values = [];
1130
- for (const line of text.split(`
1131
- `)) {
1132
- if (!line)
1133
- continue;
1134
- try {
1135
- values.push(JSON.parse(line));
1136
- } catch {}
1137
- }
1138
- return values.slice(-limit);
1139
- }
1140
-
1141
1141
  // src/infra/clock.ts
1142
1142
  var systemClock = {
1143
1143
  now: () => Date.now()
@@ -2,7 +2,7 @@
2
2
  var __require = import.meta.require;
3
3
 
4
4
  // src/constants.ts
5
- var VERSION = "9.5.0";
5
+ var VERSION = "9.6.0";
6
6
  var SETTLED_TRIGGER_COOLDOWN_MS = 10 * 60000;
7
7
  var COMPACT_SYSTEM_PREFIX = "You are an expert conversation summarizer for a coding agent. " + "Produce structured markdown summaries. " + "Follow output format exactly. " + "Use EXACT names \u2014 never paraphrase code identifiers. " + "Trust deterministic extraction data over intuition.";
8
8
  var PROFILES = {
@@ -0,0 +1,9 @@
1
+ import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
+ import { type SettingItem } from "@earendil-works/pi-tui";
3
+ import type { CompactConfig } from "../types.ts";
4
+ import { type GlobalConfigPath, type GlobalConfigValue } from "../utils/config.ts";
5
+ export type GlobalConfigWriter = (path: GlobalConfigPath, value: GlobalConfigValue) => Promise<CompactConfig>;
6
+ export declare function modelSettingsItems(ctx: ExtensionCommandContext, requestRender: () => void, writeConfig?: GlobalConfigWriter): SettingItem[];
7
+ export declare function complexSettingsCategories(ctx: ExtensionCommandContext, requestRender: () => void, writeConfig?: GlobalConfigWriter): SettingItem[];
8
+ export declare function complexConfigPaths(): GlobalConfigPath[];
9
+ //# sourceMappingURL=settings-complex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-complex.d.ts","sourceRoot":"","sources":["../../src/ui/settings-complex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,EAQL,KAAK,WAAW,EAGjB,MAAM,wBAAwB,CAAC;AAOhC,OAAO,KAAK,EAAE,aAAa,EAAsB,MAAM,aAAa,CAAC;AACrE,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAIvB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,MAAM,kBAAkB,GAAG,CAC/B,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,iBAAiB,KACrB,OAAO,CAAC,aAAa,CAAC,CAAC;AAgZ5B,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,uBAAuB,EAC5B,aAAa,EAAE,MAAM,IAAI,EACzB,WAAW,GAAE,kBAA2C,GACvD,WAAW,EAAE,CAgEf;AAED,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,uBAAuB,EAC5B,aAAa,EAAE,MAAM,IAAI,EACzB,WAAW,GAAE,kBAA2C,GACvD,WAAW,EAAE,CAuEf;AAED,wBAAgB,kBAAkB,IAAI,gBAAgB,EAAE,CASvD"}
@@ -1,5 +1,45 @@
1
1
  import { type ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
2
- import type { SmartCompactPolicy } from "../app/smart-compact-policy.ts";
3
- /** Session/branch-scoped policy editor. Manual `/smart-compact` always remains available. */
4
- export declare function showSmartCompactSettings(ctx: ExtensionCommandContext, policy: SmartCompactPolicy): Promise<void>;
2
+ import { type Component, type Focusable, SettingsList, type SettingItem } from "@earendil-works/pi-tui";
3
+ import { type GlobalConfigPath } from "../utils/config.ts";
4
+ import type { CompactConfig } from "../types.ts";
5
+ import { type GlobalConfigWriter } from "./settings-complex.ts";
6
+ import type { SmartCompactPolicy, SmartCompactPolicySnapshot } from "../app/smart-compact-policy.ts";
7
+ type GlobalChoiceGroup = "behavior" | "reasoning" | "safety" | "advanced";
8
+ type GlobalSettingWriter = typeof updateGlobalChoiceSetting;
9
+ export type GlobalSettingApplied = (path: GlobalConfigPath, config: CompactConfig) => void | Promise<void>;
10
+ interface GlobalSettingState {
11
+ display: string;
12
+ config?: CompactConfig;
13
+ }
14
+ export declare class GlobalSettingsCoordinator {
15
+ private readonly writer;
16
+ private queue;
17
+ private readonly confirmed;
18
+ private confirmedConfig;
19
+ private readonly pending;
20
+ private readonly listeners;
21
+ constructor(writer?: GlobalSettingWriter);
22
+ display(id: GlobalConfigPath): string;
23
+ subscribe(ids: readonly GlobalConfigPath[], listener: (id: GlobalConfigPath, state: GlobalSettingState) => void): () => void;
24
+ submit(group: GlobalChoiceGroup, id: GlobalConfigPath, display: string, onError: (message: string) => void, onApplied?: GlobalSettingApplied): void;
25
+ settled(): Promise<void>;
26
+ private emit;
27
+ }
28
+ export declare function globalChoiceSettingsItems(group: GlobalChoiceGroup, config: CompactConfig, coordinator?: GlobalSettingsCoordinator): SettingItem[];
29
+ export declare function updateGlobalChoiceSetting(group: GlobalChoiceGroup, id: string, display: string): Promise<CompactConfig>;
30
+ export declare function sessionSettingsItems(policy: SmartCompactPolicy): SettingItem[];
31
+ export declare function updateSessionSetting(policy: SmartCompactPolicy, ctx: ExtensionCommandContext, id: string, value: string): {
32
+ ok: true;
33
+ policy: SmartCompactPolicySnapshot;
34
+ } | {
35
+ ok: false;
36
+ policy: SmartCompactPolicySnapshot;
37
+ error: string;
38
+ };
39
+ export declare function settingsCategoryItems(policy: SmartCompactPolicy, ctx: ExtensionCommandContext, requestRender?: () => void, coordinator?: GlobalSettingsCoordinator, onApplied?: GlobalSettingApplied, writeConfig?: GlobalConfigWriter): SettingItem[];
40
+ export declare function createSettingsRoot(policy: SmartCompactPolicy, ctx: ExtensionCommandContext, onCancel: () => void, requestRender?: () => void, coordinator?: GlobalSettingsCoordinator, onApplied?: GlobalSettingApplied, writeConfig?: GlobalConfigWriter): SettingsList;
41
+ export declare function createSettingsController(root: SettingsList, display: Component, requestRender: () => void): Component & Focusable;
42
+ /** Open the unified Smart Compact settings panel. */
43
+ export declare function showSmartCompactSettings(ctx: ExtensionCommandContext, policy: SmartCompactPolicy, coordinator?: GlobalSettingsCoordinator, onApplied?: GlobalSettingApplied): Promise<void>;
44
+ export {};
5
45
  //# sourceMappingURL=settings-overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings-overlay.d.ts","sourceRoot":"","sources":["../../src/ui/settings-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAC;AAOzC,OAAO,KAAK,EACV,kBAAkB,EAEnB,MAAM,gCAAgC,CAAC;AAqDxC,6FAA6F;AAC7F,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,uBAAuB,EAC5B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,IAAI,CAAC,CAwDf"}
1
+ {"version":3,"file":"settings-overlay.d.ts","sourceRoot":"","sources":["../../src/ui/settings-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,SAAS,EACd,YAAY,EACZ,KAAK,WAAW,EAEjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,KAAK,gBAAgB,EAGtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KA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ig } from "../types.ts";
1
+ import type { CompactConfig, CompressionProfile, ProfileConfig } from "../types.ts";
2
+ declare const PROFILE_NUMERIC_KEYS: readonly ["summaryBudgetTokens", "keepRecentTokens", "minChunkTokens", "maxChunkTokens", "singlePassMaxTokens", "batchMaxTokens"];
3
+ type TopLevelConfigKey = Exclude<keyof CompactConfig, "profiles">;
4
+ type ProfileNumericKey = (typeof PROFILE_NUMERIC_KEYS)[number];
5
+ export type GlobalConfigPath = TopLevelConfigKey | `profiles.${CompressionProfile}.${ProfileNumericKey}`;
6
+ export type GlobalConfigValue = CompactConfig[TopLevelConfigKey] | ProfileConfig[ProfileNumericKey] | undefined;
7
+ export declare function readGlobalConfigValue(configPath: GlobalConfigPath): GlobalConfigValue;
2
8
  /** Remove invalid user values so the defaults merge remains authoritative. */
3
9
  export declare function validateSmartCompactConfig(sc: Record<string, unknown>): void;
10
+ /**
11
+ * Persist one extension-owned global setting without replacing other Pi or
12
+ * extension settings. Passing undefined removes the override so the built-in
13
+ * default becomes effective again.
14
+ */
15
+ export declare function writeGlobalConfigValue(configPath: GlobalConfigPath, value: GlobalConfigValue): Promise<CompactConfig>;
4
16
  /** Test helper — forces the next loadConfig() to re-read settings.json. */
5
17
  export declare function resetConfigCache(): void;
6
18
  export declare function loadConfig(): CompactConfig;
19
+ export {};
7
20
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,aAAa,EAGd,MAAM,aAAa,CAAC;AA8WrB,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAI5E;AAMD,2EAA2E;AAC3E,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC;AAED,wBAAgB,UAAU,IAAI,aAAa,CAuC1C"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,EACd,MAAM,aAAa,CAAC;AAqCrB,QAAA,MAAM,oBAAoB,YACxB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,CACR,CAAC;AACX,KAAK,iBAAiB,GAAG,OAAO,CAAC,MAAM,aAAa,EAAE,UAAU,CAAC,CAAC;AAClE,KAAK,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/D,MAAM,MAAM,gBAAgB,GACxB,iBAAiB,GACjB,YAAY,kBAAkB,IAAI,iBAAiB,EAAE,CAAC;AAC1D,MAAM,MAAM,iBAAiB,GACzB,aAAa,CAAC,iBAAiB,CAAC,GAChC,aAAa,CAAC,iBAAiB,CAAC,GAChC,SAAS,CAAC;AAEd,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,gBAAgB,GAC3B,iBAAiB,CASnB;AA6bD,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAI5E;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,gBAAgB,EAC5B,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,aAAa,CAAC,CAyBxB;AAMD,2EAA2E;AAC3E,wBAAgB,gBAAgB,IAAI,IAAI,CAIvC;AAED,wBAAgB,UAAU,IAAI,aAAa,CAoD1C"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "pi-smart-compact",
3
- "version": "9.5.0",
3
+ "version": "9.6.0",
4
4
  "description": "Verification-oriented smart compaction extension for Pi Coding Agent — deterministic extraction, exploration, synthesis, verification, metrics, and safety checks.",
5
- "packageManager": "bun@1.3.14",
5
+ "packageManager": "bun@1.4.0",
6
6
  "engines": {
7
7
  "node": ">=22.19.0"
8
8
  },