agent-recall-core 3.4.47 → 3.4.48
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.
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/retrieval/candidates.d.ts +27 -2
- package/dist/retrieval/candidates.d.ts.map +1 -1
- package/dist/retrieval/candidates.js +153 -1
- package/dist/retrieval/candidates.js.map +1 -1
- package/dist/retrieval/contradiction.d.ts +65 -13
- package/dist/retrieval/contradiction.d.ts.map +1 -1
- package/dist/retrieval/contradiction.js +40 -17
- package/dist/retrieval/contradiction.js.map +1 -1
- package/dist/retrieval/query-memory.d.ts +47 -2
- package/dist/retrieval/query-memory.d.ts.map +1 -1
- package/dist/retrieval/query-memory.js +121 -0
- package/dist/retrieval/query-memory.js.map +1 -1
- package/dist/storage/corrections.d.ts +132 -1
- package/dist/storage/corrections.d.ts.map +1 -1
- package/dist/storage/corrections.js +113 -2
- package/dist/storage/corrections.js.map +1 -1
- package/dist/supabase/recall-backend.d.ts +1 -0
- package/dist/supabase/recall-backend.d.ts.map +1 -1
- package/dist/supabase/recall-backend.js +151 -6
- package/dist/supabase/recall-backend.js.map +1 -1
- package/dist/tools-logic/smart-recall.d.ts.map +1 -1
- package/dist/tools-logic/smart-recall.js +28 -2
- package/dist/tools-logic/smart-recall.js.map +1 -1
- package/dist/tools-logic/supersession.d.ts +63 -2
- package/dist/tools-logic/supersession.d.ts.map +1 -1
- package/dist/tools-logic/supersession.js +153 -48
- package/dist/tools-logic/supersession.js.map +1 -1
- package/dist/types.d.ts +12 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/package.json +1 -1
|
@@ -1,73 +1,111 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* supersession.ts — P2: detect when a NEW correction CONTRADICTS an existing
|
|
3
|
-
* active one on a versioned
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Reuses AgentRecall's existing conflict-token grammar (helpers/conflict-scan.ts)
|
|
7
|
-
* — pure, NO LLM, NO network, NO key. SCOPE LIMIT (honest): this catches
|
|
8
|
-
* contradictions expressed as a version bump ("X is 1.2.3" → "X is 1.3.0"), a
|
|
9
|
-
* status flip ("status: blocked" → "status: done"), or a key-value change
|
|
10
|
-
* ("env = prod" → "env = staging"). It does NOT catch arbitrary semantic
|
|
11
|
-
* substitutions ("use middleware.ts" → "use proxy.ts") with no key — that needs
|
|
12
|
-
* the optional semantic/LLM path and is intentionally out of scope here.
|
|
3
|
+
* active one on a versioned fact, and (suggest-default) supersede the stale
|
|
4
|
+
* one.
|
|
13
5
|
*
|
|
14
6
|
* Mutation policy: SUGGEST-ONLY by default. Set AR_CONSOLIDATE_AUTO=1 (or pass
|
|
15
7
|
* { auto: true }) to actually retract the contradicted records (with
|
|
16
8
|
* superseded_by set to the new correction's id). The default mutates NOTHING.
|
|
9
|
+
*
|
|
10
|
+
* v4 W5 (design memo §Q7 Wave 5, 2026-09-08) — this file gained its first
|
|
11
|
+
* caller: `ar corrections conflicts` / `ar corrections retract` (cli/src/
|
|
12
|
+
* index.ts). `listCorrectionConflicts` below is the store-wide listing that
|
|
13
|
+
* surface needs; it is ADDITIVE (detectCorrectionConflicts/reviewSupersessions
|
|
14
|
+
* and their suggest-only/auto contract are unchanged) and still NEVER
|
|
15
|
+
* mutates — only `ar corrections retract`'s explicit, human-typed id/
|
|
16
|
+
* --superseded-by pair reaches `retractCorrection`, never this listing path.
|
|
17
|
+
*
|
|
18
|
+
* v4 PRE-SHIP GATE FIX (2026-09-08, reports/2026-09-08-v4-gatefix-report.md,
|
|
19
|
+
* correctness red-team must-fix) — SCOPE LIMIT (honest, replaces the previous
|
|
20
|
+
* "version / status / key-value" claim below): `compareForConflicts` used to
|
|
21
|
+
* check version, status-category, and generic key-value tokens (all three
|
|
22
|
+
* of `helpers/conflict-scan.ts`'s extractors), inherited unmodified from
|
|
23
|
+
* before this file had any callers. That was harmless while true — this
|
|
24
|
+
* file's own header used to note it "had no callers" — but v4 W5 gave it
|
|
25
|
+
* its FIRST callers (`listCorrectionConflicts` / `ar corrections conflicts`,
|
|
26
|
+
* a human-facing suggestion surface), and a correctness red-team reproduced,
|
|
27
|
+
* on that new surface, the EXACT SAME two false-positive classes an
|
|
28
|
+
* independent review already proved and fixed on the sibling retrieval
|
|
29
|
+
* module `retrieval/contradiction.ts` (commit 79fc3e2, 2026-08-31, "W5a
|
|
30
|
+
* salvage" — see that file's own header for the full HIGH-1/HIGH-2
|
|
31
|
+
* analysis):
|
|
32
|
+
* - status/kv cross-branch defeat: "status: blocked" vs "status: stuck"
|
|
33
|
+
* (or the equivalent unstructured prose) — genuinely the SAME fact
|
|
34
|
+
* (`extractStatusTokens`' own category map treats both as "blocked"),
|
|
35
|
+
* but the separate kv branch's raw "status" KEY + differing raw VALUES
|
|
36
|
+
* ("blocked" vs "stuck") flagged it as a conflict anyway, defeating the
|
|
37
|
+
* category-equivalence safeguard the status branch was built to provide.
|
|
38
|
+
* - generic-key false positive: any two topically-unrelated corrections
|
|
39
|
+
* sharing a common one-word label ("priority", "status", "mode", "env",
|
|
40
|
+
* or even an un-marked version-shaped number like "deployed 1.2.3" vs
|
|
41
|
+
* "deployed 5.6.7") got flagged conflicting purely on key-string
|
|
42
|
+
* equality, with zero topical protection.
|
|
43
|
+
*
|
|
44
|
+
* FIX (this file, mirroring 79fc3e2's fix on the sibling module exactly):
|
|
45
|
+
* status and key-value detection are REMOVED from `compareForConflicts`
|
|
46
|
+
* ENTIRELY (not gated/pre-filtered) — this file no longer imports
|
|
47
|
+
* `extractStatusTokens`/`extractKVTokens` at all. The remaining version
|
|
48
|
+
* check is upgraded from the plain, unmarked-optional `extractVersionTokens`
|
|
49
|
+
* to `retrieval/contradiction.ts`'s exported `extractHighPrecisionVersionTokens`
|
|
50
|
+
* — a MANDATORY-marker (`v`/`@`/`ver`/`version`/`#`) semver extractor (see
|
|
51
|
+
* that file's own "HIGH-PRECISION GRAMMAR" header section for the full
|
|
52
|
+
* false-positive analysis) IMPORTED, not forked a third time: this module
|
|
53
|
+
* has zero imports of its own, so importing FROM it here creates no cycle.
|
|
54
|
+
* A shared, high-precision, explicitly-marked version bump ("X version
|
|
55
|
+
* 1.2.3" → "X version 1.3.0") remains the ONLY thing this module detects as
|
|
56
|
+
* a supersession trigger. It does NOT catch a status flip, a generic
|
|
57
|
+
* key-value change, or arbitrary semantic substitutions ("use middleware.ts"
|
|
58
|
+
* → "use proxy.ts") — those need the optional semantic/LLM path and are
|
|
59
|
+
* intentionally out of scope here, same as the sibling module's own
|
|
60
|
+
* documented scope limit.
|
|
61
|
+
*
|
|
62
|
+
* `helpers/conflict-scan.ts`'s `extractStatusTokens`/`extractKVTokens`
|
|
63
|
+
* remain exported and UNCHANGED there for their one remaining consumer:
|
|
64
|
+
* `scanForConflicts` (the smart-remember pre-save warning flow) — a soft,
|
|
65
|
+
* non-mutating notice shown at save time, not a supersession/retraction
|
|
66
|
+
* surface, so its wider recall / lower precision tradeoff is a deliberately
|
|
67
|
+
* different, unaffected risk profile and out of this gate fix's scope.
|
|
17
68
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import { readActiveCorrections, retractCorrection } from "../storage/corrections.js";
|
|
69
|
+
import { extractHighPrecisionVersionTokens } from "../retrieval/contradiction.js";
|
|
70
|
+
import { readActiveCorrections, retractCorrection, decayClassOf, effectiveConfidenceOf, } from "../storage/corrections.js";
|
|
20
71
|
/**
|
|
21
|
-
* Pairwise contradiction check
|
|
22
|
-
*
|
|
23
|
-
*
|
|
72
|
+
* Pairwise contradiction check — version tokens ONLY (v4 pre-ship gate fix,
|
|
73
|
+
* see this file's header for why the status/kv branches were removed and
|
|
74
|
+
* why the version check itself was upgraded to the high-precision,
|
|
75
|
+
* mandatory-marker extractor). No fork of the grammar: this is the exact
|
|
76
|
+
* same `extractHighPrecisionVersionTokens` function `retrieval/
|
|
77
|
+
* contradiction.ts`'s own `grammarConflict` uses, imported directly.
|
|
24
78
|
*/
|
|
25
79
|
function compareForConflicts(newText, existingText) {
|
|
26
80
|
const out = [];
|
|
27
|
-
|
|
28
|
-
const newV = extractVersionTokens(newText);
|
|
81
|
+
const newV = extractHighPrecisionVersionTokens(newText);
|
|
29
82
|
if (newV.size > 0) {
|
|
30
|
-
const exV =
|
|
83
|
+
const exV = extractHighPrecisionVersionTokens(existingText);
|
|
31
84
|
for (const [k, nv] of newV) {
|
|
32
85
|
const ev = exV.get(k);
|
|
33
86
|
if (ev && ev !== nv)
|
|
34
87
|
out.push({ existing: `${k} is ${ev}`, incoming: `${k} is ${nv}` });
|
|
35
88
|
}
|
|
36
89
|
}
|
|
37
|
-
// 2. Status category conflicts (existing has a category the new text lacks).
|
|
38
|
-
const newS = extractStatusTokens(newText);
|
|
39
|
-
if (newS.size > 0) {
|
|
40
|
-
const exS = extractStatusTokens(existingText);
|
|
41
|
-
const newCats = new Set(newS.values());
|
|
42
|
-
const exCats = new Set(exS.values());
|
|
43
|
-
for (const cat of exCats) {
|
|
44
|
-
if (!newCats.has(cat)) {
|
|
45
|
-
const exWord = [...exS.entries()].find(([, c]) => c === cat)?.[0] ?? cat;
|
|
46
|
-
const newCat = [...newCats][0];
|
|
47
|
-
if (newCat) {
|
|
48
|
-
const newWord = [...newS.entries()].find(([, c]) => c === newCat)?.[0] ?? newCat;
|
|
49
|
-
out.push({ existing: `status is ${exWord}`, incoming: `status is ${newWord}` });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// 3. Key-value conflicts (same key, different value).
|
|
55
|
-
const newKV = extractKVTokens(newText);
|
|
56
|
-
if (newKV.size > 0) {
|
|
57
|
-
const exKV = extractKVTokens(existingText);
|
|
58
|
-
for (const [k, nv] of newKV) {
|
|
59
|
-
const ev = exKV.get(k);
|
|
60
|
-
if (ev && ev !== nv)
|
|
61
|
-
out.push({ existing: `${k} is ${ev}`, incoming: `${k} is ${nv}` });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
90
|
return out;
|
|
65
91
|
}
|
|
66
|
-
/**
|
|
67
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Find active corrections that contradict the candidate on a version/status/kv
|
|
94
|
+
* fact.
|
|
95
|
+
*
|
|
96
|
+
* `preloaded` (v4 W5, additive/optional): an already-read `readActiveCorrections()`
|
|
97
|
+
* result, same contract as `readActiveCorrections`/`readP0Corrections`'s own
|
|
98
|
+
* `preloaded` param (corrections.ts, PERF 2026-07-27 doc) — a pure in-memory
|
|
99
|
+
* filter substitution, order/semantics byte-identical to omitting it. Exists so
|
|
100
|
+
* `listCorrectionConflicts` below can read the store ONCE and pass the same
|
|
101
|
+
* array into every pairwise call instead of re-scanning disk per candidate.
|
|
102
|
+
* Every existing caller (reviewSupersessions, the P2 supersession tests) omits
|
|
103
|
+
* it and is unaffected.
|
|
104
|
+
*/
|
|
105
|
+
export function detectCorrectionConflicts(project, candidate, preloaded) {
|
|
68
106
|
const newText = `${candidate.rule} ${candidate.context ?? ""}`.trim();
|
|
69
107
|
const matches = [];
|
|
70
|
-
for (const existing of readActiveCorrections(project)) {
|
|
108
|
+
for (const existing of readActiveCorrections(project, preloaded)) {
|
|
71
109
|
if (candidate.id && existing.id === candidate.id)
|
|
72
110
|
continue;
|
|
73
111
|
const existingText = `${existing.rule} ${existing.context ?? ""}`.trim();
|
|
@@ -82,6 +120,73 @@ export function detectCorrectionConflicts(project, candidate) {
|
|
|
82
120
|
}
|
|
83
121
|
return matches;
|
|
84
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* List suspected supersession pairs across ALL active corrections in a
|
|
125
|
+
* project — the store-wide counterpart to `detectCorrectionConflicts`'s
|
|
126
|
+
* one-candidate-vs-store shape, built for `ar corrections conflicts`
|
|
127
|
+
* (v4 W5, design memo Wave 5). READ-ONLY: never calls `retractCorrection`,
|
|
128
|
+
* never mutates anything — same guarantee as `detectCorrectionConflicts`.
|
|
129
|
+
*
|
|
130
|
+
* Shape decision (design memo CHALLENGE): `detectCorrectionConflicts` takes
|
|
131
|
+
* ONE candidate vs. the store, not "all conflicts in the store" — there is no
|
|
132
|
+
* existing all-pairs primitive to call. The minimal correct shape is pairwise:
|
|
133
|
+
* for each active correction as candidate, call `detectCorrectionConflicts`
|
|
134
|
+
* against the SAME preloaded snapshot (one disk read total, via the
|
|
135
|
+
* `preloaded` param above) — O(n) calls, each doing O(n) in-memory
|
|
136
|
+
* comparisons, so O(n²) comparisons overall. Corrections stores are small
|
|
137
|
+
* (P0-cap ~5-9 active typical per corrections.ts's own cap discussion), so
|
|
138
|
+
* O(n²) comparisons here is on the order of tens of comparisons in the
|
|
139
|
+
* realistic case, not a performance concern. This does NOT scale to a
|
|
140
|
+
* cross-project or unbounded-n use case — it is scoped, by design, to one
|
|
141
|
+
* project's active-corrections population, matching `detectCorrectionConflicts`'s
|
|
142
|
+
* own existing scope.
|
|
143
|
+
*
|
|
144
|
+
* Dedup: a contradiction between two records can be found from EITHER side
|
|
145
|
+
* (candidate=A finds existingId=B, and candidate=B finds existingId=A) since
|
|
146
|
+
* `compareForConflicts` doesn't track direction. Corrections are sorted
|
|
147
|
+
* chronologically once (date, then id as a tiebreak) and only pairs where the
|
|
148
|
+
* matched `existingId` is STRICTLY OLDER than the current candidate are kept
|
|
149
|
+
* — this reports each unordered pair exactly once, with `existing` always the
|
|
150
|
+
* older rule and `newer` the one that contradicts it (matching the CLI's
|
|
151
|
+
* "existing rule vs. newer conflicting rule" framing).
|
|
152
|
+
*/
|
|
153
|
+
export function listCorrectionConflicts(project, preloaded) {
|
|
154
|
+
const actives = readActiveCorrections(project, preloaded);
|
|
155
|
+
const sorted = [...actives].sort((a, b) => {
|
|
156
|
+
if (a.date !== b.date)
|
|
157
|
+
return a.date < b.date ? -1 : 1;
|
|
158
|
+
return a.id.localeCompare(b.id);
|
|
159
|
+
});
|
|
160
|
+
const indexOf = new Map(sorted.map((r, i) => [r.id, i]));
|
|
161
|
+
const seen = new Set();
|
|
162
|
+
const out = [];
|
|
163
|
+
for (const candidate of sorted) {
|
|
164
|
+
const candidateIdx = indexOf.get(candidate.id);
|
|
165
|
+
const matches = detectCorrectionConflicts(project, candidate, sorted);
|
|
166
|
+
for (const m of matches) {
|
|
167
|
+
const existingIdx = indexOf.get(m.existingId);
|
|
168
|
+
// Only keep the direction where the matched partner is strictly OLDER
|
|
169
|
+
// than `candidate` — the newer side reports the pair exactly once.
|
|
170
|
+
if (existingIdx === undefined || existingIdx >= candidateIdx)
|
|
171
|
+
continue;
|
|
172
|
+
const key = `${m.existingId}::${candidate.id}`;
|
|
173
|
+
if (seen.has(key))
|
|
174
|
+
continue;
|
|
175
|
+
seen.add(key);
|
|
176
|
+
const existingRecord = sorted[existingIdx];
|
|
177
|
+
out.push({
|
|
178
|
+
...m,
|
|
179
|
+
existingConfidence: effectiveConfidenceOf(existingRecord),
|
|
180
|
+
existingDecayClass: decayClassOf(existingRecord),
|
|
181
|
+
newerId: candidate.id,
|
|
182
|
+
newerRule: candidate.rule,
|
|
183
|
+
newerConfidence: effectiveConfidenceOf(candidate),
|
|
184
|
+
newerDecayClass: decayClassOf(candidate),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return out;
|
|
189
|
+
}
|
|
85
190
|
/**
|
|
86
191
|
* Review (and, under auto, apply) supersessions for a newly-written correction.
|
|
87
192
|
* SUGGEST-ONLY by default. With auto (or AR_CONSOLIDATE_AUTO=1) the contradicted
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supersession.js","sourceRoot":"","sources":["../../src/tools-logic/supersession.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"supersession.js","sourceRoot":"","sources":["../../src/tools-logic/supersession.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,OAAO,EAAE,iCAAiC,EAAE,MAAM,+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AyB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IACtE,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,IAAI,IAAI,EAAE,CAAC;QACT,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;YAC5B,MAAM,GAAG,GAAG,iBAAiB,CAC3B,OAAO,EACP,CAAC,CAAC,UAAU,EACZ,iBAAiB,aAAa,CAAC,EAAE,EAAE,EACnC,aAAa,CAAC,EAAE,CACjB,CAAC;YACF,IAAI,GAAG,CAAC,OAAO;gBAAE,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAC3C,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared types, interfaces, and constants for agent-recall-mcp.
|
|
3
3
|
*/
|
|
4
|
-
export declare const VERSION = "3.4.
|
|
4
|
+
export declare const VERSION = "3.4.48";
|
|
5
5
|
/**
|
|
6
6
|
* Set the storage root directory. This is process-global state —
|
|
7
7
|
* only one root is active at a time. Call before any other operations.
|
|
@@ -138,6 +138,17 @@ export interface PalaceGraph {
|
|
|
138
138
|
export type Importance = "high" | "medium" | "low";
|
|
139
139
|
export type Urgency = "today" | "this-week" | "eventual" | "none";
|
|
140
140
|
export type Confidence = "high" | "medium" | "low";
|
|
141
|
+
/**
|
|
142
|
+
* v4 W1 (2026-07-02 schema-infrastructure.md §5, field-design-options.md §A.5) —
|
|
143
|
+
* truth-decay classification. NEVER a stored field by default (Option 2, the
|
|
144
|
+
* proposal's recommendation): computed at read time from record-class-specific
|
|
145
|
+
* rules (e.g. corrections.ts's `decayClassOf`), with an optional per-record
|
|
146
|
+
* `*_override` escape hatch on record types that carry one. Shared here because
|
|
147
|
+
* the proposal frames `decay_class` as a cross-record-class concept (corrections,
|
|
148
|
+
* palace memories, insights) even though v4 Wave 1 wires it into CorrectionRecord
|
|
149
|
+
* only — see docs/proposals/2026-07-02-field-design-options.md §A.1/§A.5.
|
|
150
|
+
*/
|
|
151
|
+
export type DecayClass = "static" | "slow" | "volatile";
|
|
141
152
|
export type WalkDepth = "identity" | "active" | "relevant" | "full";
|
|
142
153
|
/** Category determines decay rate — architecture decisions decay slowly, daily blockers decay fast. */
|
|
143
154
|
export type MemoryCategory = "goal" | "architecture" | "decision" | "blocker" | "observation" | "lesson" | "general";
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AASH,eAAO,MAAM,OAAO,WAAW,CAAC;AAQhC;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWlD,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOvB,CAAC;AAMX,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,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B,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AACnD,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;AAClE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AACnD;;;;;;;;;GASG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AACxD,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpE,uGAAuG;AACvG,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErH,+EAA+E;AAC/E,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/types.js
CHANGED
|
@@ -6,7 +6,7 @@ import * as os from "node:os";
|
|
|
6
6
|
// ---------------------------------------------------------------------------
|
|
7
7
|
// Constants
|
|
8
8
|
// ---------------------------------------------------------------------------
|
|
9
|
-
export const VERSION = "3.4.
|
|
9
|
+
export const VERSION = "3.4.48";
|
|
10
10
|
// ---------------------------------------------------------------------------
|
|
11
11
|
// Root directory (configurable at runtime for SDK usage)
|
|
12
12
|
// ---------------------------------------------------------------------------
|