omp-fabric 1.4.4 → 1.5.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 (60) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/chunks/{chunk-TR3LQHO7.js → chunk-2ZEMWIHZ.js} +2 -2
  3. package/dist/chunks/chunk-3XPR2AZL.js +74 -0
  4. package/dist/chunks/chunk-3XPR2AZL.js.map +7 -0
  5. package/dist/chunks/{chunk-SZWF6C4V.js → chunk-4MVTUMKO.js} +3 -3
  6. package/dist/chunks/{chunk-SG4GVSWX.js → chunk-EQSL47QL.js} +10 -66
  7. package/dist/chunks/chunk-EQSL47QL.js.map +7 -0
  8. package/dist/chunks/{chunk-OW2LSF5R.js → chunk-IGNMZZQH.js} +3 -3
  9. package/dist/chunks/{chunk-LB2EC7FZ.js → chunk-JMYHQUJQ.js} +9 -105
  10. package/dist/chunks/chunk-JMYHQUJQ.js.map +7 -0
  11. package/dist/chunks/{chunk-6JPXLXDS.js → chunk-KHQJKGBC.js} +2 -2
  12. package/dist/chunks/{chunk-6JPXLXDS.js.map → chunk-KHQJKGBC.js.map} +1 -1
  13. package/dist/chunks/chunk-KTB4R3E3.js +51 -0
  14. package/dist/chunks/chunk-KTB4R3E3.js.map +7 -0
  15. package/dist/chunks/chunk-TQQPXV3I.js +58 -0
  16. package/dist/chunks/chunk-TQQPXV3I.js.map +7 -0
  17. package/dist/chunks/{chunk-2J2GOB4A.js → chunk-VDLZAORG.js} +5 -3
  18. package/dist/chunks/chunk-VDLZAORG.js.map +7 -0
  19. package/dist/chunks/chunk-ZDWBTQB6.js +107 -0
  20. package/dist/chunks/chunk-ZDWBTQB6.js.map +7 -0
  21. package/dist/compaction/hook.js +2 -1
  22. package/dist/compaction/lcm-loader.d.ts +12 -0
  23. package/dist/compaction/lcm-loader.d.ts.map +1 -0
  24. package/dist/compaction/lcm-maintenance.d.ts +2 -1
  25. package/dist/compaction/lcm-maintenance.d.ts.map +1 -1
  26. package/dist/compaction/lcm-runtime.d.ts +1 -0
  27. package/dist/compaction/lcm-runtime.d.ts.map +1 -1
  28. package/dist/compaction/lcm-runtime.js +1169 -0
  29. package/dist/compaction/lcm-runtime.js.map +7 -0
  30. package/dist/config.d.ts +1 -0
  31. package/dist/config.d.ts.map +1 -1
  32. package/dist/fabric-runtime-state.js +9 -7
  33. package/dist/fabric-runtime-state.js.map +1 -1
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +135 -989
  36. package/dist/index.js.map +4 -4
  37. package/dist/memory/lcm-adapter.d.ts +1 -1
  38. package/dist/memory/lcm-adapter.d.ts.map +1 -1
  39. package/dist/providers/memory-provider.js +2 -2
  40. package/dist/residency/host.js +8 -6
  41. package/dist/residency/omp-entry.js +8 -6
  42. package/dist/residency/omp-entry.js.map +1 -1
  43. package/dist/storage/lcm-identity.d.ts +43 -0
  44. package/dist/storage/lcm-identity.d.ts.map +1 -0
  45. package/dist/storage/lcm-ledger.d.ts +7 -46
  46. package/dist/storage/lcm-ledger.d.ts.map +1 -1
  47. package/dist/storage/sqlite.d.ts +19 -0
  48. package/dist/storage/sqlite.d.ts.map +1 -0
  49. package/dist/ui/dashboard.js +3 -3
  50. package/dist/ui/settings.js +4 -4
  51. package/docs/compaction.md +8 -1
  52. package/package.json +1 -1
  53. package/dist/chunks/chunk-2J2GOB4A.js.map +0 -7
  54. package/dist/chunks/chunk-LB2EC7FZ.js.map +0 -7
  55. package/dist/chunks/chunk-MBOXJKF6.js +0 -311
  56. package/dist/chunks/chunk-MBOXJKF6.js.map +0 -7
  57. package/dist/chunks/chunk-SG4GVSWX.js.map +0 -7
  58. /package/dist/chunks/{chunk-TR3LQHO7.js.map → chunk-2ZEMWIHZ.js.map} +0 -0
  59. /package/dist/chunks/{chunk-SZWF6C4V.js.map → chunk-4MVTUMKO.js.map} +0 -0
  60. /package/dist/chunks/{chunk-OW2LSF5R.js.map → chunk-IGNMZZQH.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Added
6
+
7
+ - LCM runs on Bun's own SQLite. `src/storage/sqlite.ts` resolves `node:sqlite` first and falls back to `bun:sqlite`, so a runtime that ships only Bun's driver keeps durable ledger compaction rather than losing it. The ledger, maintenance, backup, checkpoint, rollback, and restart paths are covered against the Bun driver directly.
8
+
9
+ ### Fixed
10
+
11
+ - Installing or loading the extension failed outright on runtimes without `node:sqlite` (`Failed to load extension: Could not resolve: "node:sqlite"`), which took down every Fabric feature rather than only LCM. The entry bundle pulled the ledger in statically through `src/index.ts`, `src/agents/handoff.ts`, and the memory provider. The sqlite-free identity and payload helpers now live in `src/storage/lcm-identity.ts`, the LCM runtime loads from the stable lazy entry `dist/compaction/lcm-runtime.js` only when compaction needs it, and a runtime that cannot resolve `node:sqlite` keeps the extension running with compaction delegated to OMP core plus one warning. `bun run build` now fails when anything in the startup static graph imports `node:sqlite`.
12
+ - Windows CI failed on unrelated files with 5 s test timeouts that passed on rerun, and the v1.4.6 release was correctly withheld by the new Windows gate because of it. The suite now scales its test and hook deadlines on Windows runners, where it executes roughly three times slower, and keeps the tight defaults elsewhere.
13
+
14
+ ## 1.4.5
15
+
16
+ ### Added
17
+
18
+ - `compaction.lcmMaintenancePasses` (1-64, default 4) bounds how many leaf/condense passes one maintenance run makes. A run summarizes at most `lcmMaintenancePasses x lcmMaxLeafEntries` raw entries, so the knob trades model spend for frontier coverage on sessions that ingest faster than maintenance keeps up.
19
+
20
+ ### Fixed
21
+
22
+ - Maintenance used `lcmMaxCondenseChildren` as its work budget, so the condensation fan-in silently decided how much summarization ran per turn. The two are now separate: fan-in shapes the DAG, passes bound the work.
23
+ - Process-spawn tests in the actor and agent managers ran under the 5 s default timeout and timed out on Windows runners while passing on rerun. The six spawn-bound tests now carry the 30 s timeout their siblings already used; no assertion changed.
24
+
25
+ ### Changed
26
+
27
+ - Releases wait for a `windows-latest` check job before publishing. `prepack` already ran the full gate on Linux, but a tag could publish while the Windows matrix leg was red.
28
+
3
29
  ## 1.4.4
4
30
 
5
31
  ### Fixed
@@ -12,7 +12,7 @@ import {
12
12
  buildThinkingDigest,
13
13
  snapshotHandoffSession,
14
14
  thinkingTransferPolicy
15
- } from "./chunk-LB2EC7FZ.js";
15
+ } from "./chunk-JMYHQUJQ.js";
16
16
  import {
17
17
  isFabricThinking
18
18
  } from "./chunk-JSBTB3P6.js";
@@ -2803,4 +2803,4 @@ export {
2803
2803
  resolveFabricIdentity,
2804
2804
  MainAgentController
2805
2805
  };
2806
- //# sourceMappingURL=chunk-TR3LQHO7.js.map
2806
+ //# sourceMappingURL=chunk-2ZEMWIHZ.js.map
@@ -0,0 +1,74 @@
1
+ // src/compaction/bounds.ts
2
+ var MAX_SUMMARY_BYTES = 32 * 1024;
3
+ var MAX_REQUEST_SOURCE_BYTES = 8 * 1024;
4
+ var encoder = new TextEncoder();
5
+ var utf8Bytes = (text) => encoder.encode(text).byteLength;
6
+ var clipUtf8 = (text, maxBytes, suffix = "\u2026") => {
7
+ if (maxBytes <= 0) return "";
8
+ if (utf8Bytes(text) <= maxBytes) return text;
9
+ const suffixBytes = utf8Bytes(suffix);
10
+ if (suffixBytes >= maxBytes) return "";
11
+ let output = "";
12
+ let used = 0;
13
+ const available = maxBytes - suffixBytes;
14
+ for (const character of text) {
15
+ const bytes = utf8Bytes(character);
16
+ if (used + bytes > available) break;
17
+ output += character;
18
+ used += bytes;
19
+ }
20
+ return `${output}${suffix}`;
21
+ };
22
+ var canonicalizeText = (input, maxBytes = MAX_REQUEST_SOURCE_BYTES) => {
23
+ const canonical = input.trim().split(/\s+/u).filter(Boolean).join(" ");
24
+ const sourceBytes = utf8Bytes(canonical);
25
+ return {
26
+ text: clipUtf8(canonical, maxBytes),
27
+ truncated: sourceBytes > maxBytes,
28
+ sourceBytes
29
+ };
30
+ };
31
+ var sampleAddressedFrom = (source, maxValues) => {
32
+ const earliestLimit = Math.ceil(maxValues / 2);
33
+ const latestLimit = Math.floor(maxValues / 2);
34
+ const earliest = [];
35
+ const latest = [];
36
+ let omitted = 0;
37
+ let omittedFirstEntryId;
38
+ let omittedLastEntryId;
39
+ for (const value of source) {
40
+ if (earliest.length < earliestLimit) {
41
+ earliest.push(value);
42
+ continue;
43
+ }
44
+ latest.push(value);
45
+ if (latest.length <= latestLimit) continue;
46
+ const displaced = latest.shift();
47
+ omitted += 1;
48
+ omittedFirstEntryId ??= displaced.entryId;
49
+ omittedLastEntryId = displaced.entryId;
50
+ }
51
+ return {
52
+ values: [...earliest, ...latest],
53
+ omitted,
54
+ ...omittedFirstEntryId !== void 0 ? { omittedFirstEntryId } : {},
55
+ ...omittedLastEntryId !== void 0 ? { omittedLastEntryId } : {},
56
+ splitIndex: earliest.length
57
+ };
58
+ };
59
+ var sampleAddressed = (values, maxValues) => sampleAddressedFrom(values, maxValues);
60
+ var omissionLine = (count, firstEntryId, lastEntryId, noun) => {
61
+ const range = firstEntryId || lastEntryId ? `${firstEntryId || "(start)"} \u2192 ${lastEntryId || "(end)"}` : "(unknown range)";
62
+ return `\u2026 omitted ${count} ${noun}; source entries ${range}`;
63
+ };
64
+
65
+ export {
66
+ MAX_SUMMARY_BYTES,
67
+ utf8Bytes,
68
+ clipUtf8,
69
+ canonicalizeText,
70
+ sampleAddressedFrom,
71
+ sampleAddressed,
72
+ omissionLine
73
+ };
74
+ //# sourceMappingURL=chunk-3XPR2AZL.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/compaction/bounds.ts"],
4
+ "sourcesContent": ["export const MAX_SUMMARY_BYTES = 32 * 1024;\nconst MAX_REQUEST_SOURCE_BYTES = 8 * 1024;\n\nconst encoder = new TextEncoder();\n\nexport const utf8Bytes = (text: string): number => encoder.encode(text).byteLength;\n\nexport const clipUtf8 = (text: string, maxBytes: number, suffix = \"\u2026\"): string => {\n if (maxBytes <= 0) return \"\";\n if (utf8Bytes(text) <= maxBytes) return text;\n const suffixBytes = utf8Bytes(suffix);\n if (suffixBytes >= maxBytes) return \"\";\n let output = \"\";\n let used = 0;\n const available = maxBytes - suffixBytes;\n for (const character of text) {\n const bytes = utf8Bytes(character);\n if (used + bytes > available) break;\n output += character;\n used += bytes;\n }\n return `${output}${suffix}`;\n};\n\nexport interface CanonicalText {\n text: string;\n truncated: boolean;\n sourceBytes: number;\n}\n\nexport const canonicalizeText = (input: string, maxBytes = MAX_REQUEST_SOURCE_BYTES): CanonicalText => {\n const canonical = input.trim().split(/\\s+/u).filter(Boolean).join(\" \");\n const sourceBytes = utf8Bytes(canonical);\n return {\n text: clipUtf8(canonical, maxBytes),\n truncated: sourceBytes > maxBytes,\n sourceBytes,\n };\n};\n\nexport interface AddressedValue {\n entryId: string;\n}\n\nexport interface AddressedSample<T extends AddressedValue> {\n values: T[];\n omitted: number;\n omittedFirstEntryId?: string;\n omittedLastEntryId?: string;\n splitIndex: number;\n}\n\nexport const sampleAddressedFrom = <T extends AddressedValue>(\n source: Iterable<T>,\n maxValues: number,\n): AddressedSample<T> => {\n const earliestLimit = Math.ceil(maxValues / 2);\n const latestLimit = Math.floor(maxValues / 2);\n const earliest: T[] = [];\n const latest: T[] = [];\n let omitted = 0;\n let omittedFirstEntryId: string | undefined;\n let omittedLastEntryId: string | undefined;\n\n for (const value of source) {\n if (earliest.length < earliestLimit) {\n earliest.push(value);\n continue;\n }\n latest.push(value);\n if (latest.length <= latestLimit) continue;\n const displaced = latest.shift()!;\n omitted += 1;\n omittedFirstEntryId ??= displaced.entryId;\n omittedLastEntryId = displaced.entryId;\n }\n\n return {\n values: [...earliest, ...latest],\n omitted,\n ...(omittedFirstEntryId !== undefined ? { omittedFirstEntryId } : {}),\n ...(omittedLastEntryId !== undefined ? { omittedLastEntryId } : {}),\n splitIndex: earliest.length,\n };\n};\n\nexport const sampleAddressed = <T extends AddressedValue>(\n values: readonly T[],\n maxValues: number,\n): AddressedSample<T> => sampleAddressedFrom(values, maxValues);\n\nexport const omissionLine = (\n count: number,\n firstEntryId: string | undefined,\n lastEntryId: string | undefined,\n noun: string,\n): string => {\n const range = firstEntryId || lastEntryId\n ? `${firstEntryId || \"(start)\"} \u2192 ${lastEntryId || \"(end)\"}`\n : \"(unknown range)\";\n return `\u2026 omitted ${count} ${noun}; source entries ${range}`;\n};\n"],
5
+ "mappings": ";AAAO,IAAM,oBAAoB,KAAK;AACtC,IAAM,2BAA2B,IAAI;AAErC,IAAM,UAAU,IAAI,YAAY;AAEzB,IAAM,YAAY,CAAC,SAAyB,QAAQ,OAAO,IAAI,EAAE;AAEjE,IAAM,WAAW,CAAC,MAAc,UAAkB,SAAS,aAAgB;AAChF,MAAI,YAAY,EAAG,QAAO;AAC1B,MAAI,UAAU,IAAI,KAAK,SAAU,QAAO;AACxC,QAAM,cAAc,UAAU,MAAM;AACpC,MAAI,eAAe,SAAU,QAAO;AACpC,MAAI,SAAS;AACb,MAAI,OAAO;AACX,QAAM,YAAY,WAAW;AAC7B,aAAW,aAAa,MAAM;AAC5B,UAAM,QAAQ,UAAU,SAAS;AACjC,QAAI,OAAO,QAAQ,UAAW;AAC9B,cAAU;AACV,YAAQ;AAAA,EACV;AACA,SAAO,GAAG,MAAM,GAAG,MAAM;AAC3B;AAQO,IAAM,mBAAmB,CAAC,OAAe,WAAW,6BAA4C;AACrG,QAAM,YAAY,MAAM,KAAK,EAAE,MAAM,MAAM,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACrE,QAAM,cAAc,UAAU,SAAS;AACvC,SAAO;AAAA,IACL,MAAM,SAAS,WAAW,QAAQ;AAAA,IAClC,WAAW,cAAc;AAAA,IACzB;AAAA,EACF;AACF;AAcO,IAAM,sBAAsB,CACjC,QACA,cACuB;AACvB,QAAM,gBAAgB,KAAK,KAAK,YAAY,CAAC;AAC7C,QAAM,cAAc,KAAK,MAAM,YAAY,CAAC;AAC5C,QAAM,WAAgB,CAAC;AACvB,QAAM,SAAc,CAAC;AACrB,MAAI,UAAU;AACd,MAAI;AACJ,MAAI;AAEJ,aAAW,SAAS,QAAQ;AAC1B,QAAI,SAAS,SAAS,eAAe;AACnC,eAAS,KAAK,KAAK;AACnB;AAAA,IACF;AACA,WAAO,KAAK,KAAK;AACjB,QAAI,OAAO,UAAU,YAAa;AAClC,UAAM,YAAY,OAAO,MAAM;AAC/B,eAAW;AACX,4BAAwB,UAAU;AAClC,yBAAqB,UAAU;AAAA,EACjC;AAEA,SAAO;AAAA,IACL,QAAQ,CAAC,GAAG,UAAU,GAAG,MAAM;AAAA,IAC/B;AAAA,IACA,GAAI,wBAAwB,SAAY,EAAE,oBAAoB,IAAI,CAAC;AAAA,IACnE,GAAI,uBAAuB,SAAY,EAAE,mBAAmB,IAAI,CAAC;AAAA,IACjE,YAAY,SAAS;AAAA,EACvB;AACF;AAEO,IAAM,kBAAkB,CAC7B,QACA,cACuB,oBAAoB,QAAQ,SAAS;AAEvD,IAAM,eAAe,CAC1B,OACA,cACA,aACA,SACW;AACX,QAAM,QAAQ,gBAAgB,cAC1B,GAAG,gBAAgB,SAAS,WAAM,eAAe,OAAO,KACxD;AACJ,SAAO,kBAAa,KAAK,IAAI,IAAI,oBAAoB,KAAK;AAC5D;",
6
+ "names": []
7
+ }
@@ -10,11 +10,11 @@ import {
10
10
  lifecycleSourceIdentity,
11
11
  loadModelUsage,
12
12
  useBudgetLedger
13
- } from "./chunk-OW2LSF5R.js";
13
+ } from "./chunk-IGNMZZQH.js";
14
14
  import {
15
15
  normalizeModelAliases,
16
16
  resolveAvailableOmpModel
17
- } from "./chunk-2J2GOB4A.js";
17
+ } from "./chunk-VDLZAORG.js";
18
18
  import {
19
19
  parseFabricOwnedModelGuidance,
20
20
  resolveFabricModelGuidance
@@ -685,4 +685,4 @@ if (isMain) {
685
685
  export {
686
686
  runResidentHostFromConfigPath
687
687
  };
688
- //# sourceMappingURL=chunk-SZWF6C4V.js.map
688
+ //# sourceMappingURL=chunk-4MVTUMKO.js.map
@@ -1,6 +1,15 @@
1
1
  import {
2
2
  fabricExecTitleHint
3
3
  } from "./chunk-3J7BKUNG.js";
4
+ import {
5
+ MAX_SUMMARY_BYTES,
6
+ canonicalizeText,
7
+ clipUtf8,
8
+ omissionLine,
9
+ sampleAddressed,
10
+ sampleAddressedFrom,
11
+ utf8Bytes
12
+ } from "./chunk-3XPR2AZL.js";
4
13
  import {
5
14
  FABRIC_BRANCH_RUN_DESCRIPTION_MAX_BYTES,
6
15
  FABRIC_BRANCH_RUN_NAME_MAX_BYTES,
@@ -82,70 +91,6 @@ var sessionEntryToContextMessages = (entry) => buildOmpSessionContext([entry], e
82
91
  }).messages;
83
92
  var buildSessionContext = (entries, leafId, byId) => buildOmpSessionContext([...entries], leafId, byId);
84
93
 
85
- // src/compaction/bounds.ts
86
- var MAX_SUMMARY_BYTES = 32 * 1024;
87
- var MAX_REQUEST_SOURCE_BYTES = 8 * 1024;
88
- var encoder = new TextEncoder();
89
- var utf8Bytes = (text) => encoder.encode(text).byteLength;
90
- var clipUtf8 = (text, maxBytes, suffix = "\u2026") => {
91
- if (maxBytes <= 0) return "";
92
- if (utf8Bytes(text) <= maxBytes) return text;
93
- const suffixBytes = utf8Bytes(suffix);
94
- if (suffixBytes >= maxBytes) return "";
95
- let output = "";
96
- let used = 0;
97
- const available = maxBytes - suffixBytes;
98
- for (const character of text) {
99
- const bytes = utf8Bytes(character);
100
- if (used + bytes > available) break;
101
- output += character;
102
- used += bytes;
103
- }
104
- return `${output}${suffix}`;
105
- };
106
- var canonicalizeText = (input, maxBytes = MAX_REQUEST_SOURCE_BYTES) => {
107
- const canonical = input.trim().split(/\s+/u).filter(Boolean).join(" ");
108
- const sourceBytes = utf8Bytes(canonical);
109
- return {
110
- text: clipUtf8(canonical, maxBytes),
111
- truncated: sourceBytes > maxBytes,
112
- sourceBytes
113
- };
114
- };
115
- var sampleAddressedFrom = (source, maxValues) => {
116
- const earliestLimit = Math.ceil(maxValues / 2);
117
- const latestLimit = Math.floor(maxValues / 2);
118
- const earliest = [];
119
- const latest = [];
120
- let omitted = 0;
121
- let omittedFirstEntryId;
122
- let omittedLastEntryId;
123
- for (const value of source) {
124
- if (earliest.length < earliestLimit) {
125
- earliest.push(value);
126
- continue;
127
- }
128
- latest.push(value);
129
- if (latest.length <= latestLimit) continue;
130
- const displaced = latest.shift();
131
- omitted += 1;
132
- omittedFirstEntryId ??= displaced.entryId;
133
- omittedLastEntryId = displaced.entryId;
134
- }
135
- return {
136
- values: [...earliest, ...latest],
137
- omitted,
138
- ...omittedFirstEntryId !== void 0 ? { omittedFirstEntryId } : {},
139
- ...omittedLastEntryId !== void 0 ? { omittedLastEntryId } : {},
140
- splitIndex: earliest.length
141
- };
142
- };
143
- var sampleAddressed = (values, maxValues) => sampleAddressedFrom(values, maxValues);
144
- var omissionLine = (count, firstEntryId, lastEntryId, noun) => {
145
- const range = firstEntryId || lastEntryId ? `${firstEntryId || "(start)"} \u2192 ${lastEntryId || "(end)"}` : "(unknown range)";
146
- return `\u2026 omitted ${count} ${noun}; source entries ${range}`;
147
- };
148
-
149
94
  // src/compaction/threshold.ts
150
95
  var modelCompactionKey = (model) => model ? `${model.provider}/${model.id}` : void 0;
151
96
  var configuredCompactionTokenThreshold = (config, modelKey) => modelKey === void 0 ? void 0 : config.compaction.tokenThresholds[modelKey];
@@ -2214,7 +2159,6 @@ var registerCompactionHook = (omp, options) => {
2214
2159
 
2215
2160
  export {
2216
2161
  estimateTokens,
2217
- clipUtf8,
2218
2162
  compactAtConfiguredThreshold,
2219
2163
  MAX_COMPACTION_INSTRUCTIONS_CHARS,
2220
2164
  MAX_PRESERVE_ITEMS,
@@ -2229,4 +2173,4 @@ export {
2229
2173
  compileFabricSummary,
2230
2174
  registerCompactionHook
2231
2175
  };
2232
- //# sourceMappingURL=chunk-SG4GVSWX.js.map
2176
+ //# sourceMappingURL=chunk-EQSL47QL.js.map