@avantf/dsh-mem 0.6.0 → 0.6.2
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/lib/client.js +1 -0
- package/lib/engine/mem/db/dao/chunks.d.ts +60 -4
- package/lib/engine/mem/db/dao/shared.d.ts +153 -0
- package/lib/engine/mem/dispatch.d.ts +19 -1
- package/lib/engine/mem/eval/index.d.ts +4 -0
- package/lib/engine/mem/index.d.ts +2 -0
- package/lib/engine/mem/runtime.d.ts +2 -2
- package/lib/engine/mem/store/entity_sweep.d.ts +121 -0
- package/lib/engine/mem/store/hybrid.d.ts +50 -0
- package/lib/engine/mem/store/knowledge.d.ts +116 -12
- package/lib/engine/mem/store/legs.d.ts +171 -0
- package/lib/engine/mem/store/lexical.d.ts +8 -0
- package/lib/engine/mem/store/memory.d.ts +84 -72
- package/lib/engine/mem/store/vector_repair.d.ts +248 -0
- package/lib/engine/mem/trustHeartbeat.d.ts +47 -0
- package/lib/engine/mem-contract/tools.d.ts +4 -0
- package/lib/engine/mem-contract/types.d.ts +37 -6
- package/lib/engine/mem-retrieval/adapters/local_reranker.d.ts +52 -0
- package/lib/engine/mem-retrieval/adapters/none_reranker.d.ts +10 -0
- package/lib/engine/mem-retrieval/rerank.d.ts +13 -0
- package/lib/index.js +1653 -703
- package/lib/interface-version.json +1 -1
- package/lib/types/envinit-bootstrap.d.ts +1 -1
- package/lib/types/envinit.d.ts +0 -3
- package/lib/types/envinit.d.ts.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/interface_gate.d.ts +70 -0
- package/lib/types/interface_gate.d.ts.map +1 -1
- package/lib/types/provision.d.ts +6 -0
- package/lib/types/provision.d.ts.map +1 -1
- package/lib/types/remote.d.ts.map +1 -1
- package/lib/types/vectorMigration.d.ts +22 -18
- package/lib/types/vectorMigration.d.ts.map +1 -1
- package/package.json +5 -5
package/lib/types/envinit.d.ts
CHANGED
|
@@ -123,9 +123,6 @@ interface EnvinitLoadOptions {
|
|
|
123
123
|
* base still returns a runtime, with `compat: undefined`: the mount must continue, and the resource
|
|
124
124
|
* items are still worth dispatching.
|
|
125
125
|
*
|
|
126
|
-
* The result is cached per process; a FAILED load is not, so a profile reload retries instead of
|
|
127
|
-
* replaying the first failure for the whole process lifetime.
|
|
128
|
-
*
|
|
129
126
|
* @param options - logger, family root, download policy and the test seams.
|
|
130
127
|
* @returns the loaded runtime, or `undefined` when the framework itself is unavailable.
|
|
131
128
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envinit.d.ts","sourceRoot":"","sources":["../../src/envinit.ts"],"names":[],"mappings":"AAoDA,OAAO,KAAK,EAAiB,oBAAoB,EAAe,MAAM,yBAAyB,CAAA;AAG/F,OAAO,EAKL,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAA;AAKvB,4FAA4F;AAC5F,KAAK,aAAa,GAAG,cAAc,yBAAyB,CAAC,CAAA;AAK7D;;;GAGG;AACH,eAAO,MAAM,WAAW,eAAe,CAAA;AACvC,eAAO,MAAM,UAAU,cAAc,CAAA;AAmDrC,2EAA2E;AAC3E,UAAU,aAAa;IACrB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1C;;;;;;;;OAQG;IACH,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAA;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EACV;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CA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AA8ID;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAEjG"}
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AASlD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAExC,OAAO,EAAE,mBAAmB,EAAU,MAAM,kCAAkC,CAAA;AAE9E,OAAO,EASL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAEhB,KAAK,WAAW,EACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAaL,KAAK,aAAa,EAClB,KAAK,WAAW,EAEhB,KAAK,YAAY,EACjB,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAG1B,MAAM,sBAAsB,CAAA;AAqB7B,eAAO,MAAM,IAAI,eAAe,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAQ7E,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AACD,eAAO,MAAM,MAAM,EAAE,CAAC,CAA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OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAUpG;;;;;OAKG;IAEG,OAAO,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;CAiBpE;AAmHD,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyYvE"}
|
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
* `envinit.ts`, never here. `base/plugin-base/test/interface_consumers.spec.ts` pins the two copies
|
|
21
21
|
* against each other, so a divergence is a red test instead of two shims that drifted.
|
|
22
22
|
*
|
|
23
|
+
* The loader SKELETON the two startups share lives here too: the once-per-process cache
|
|
24
|
+
* ({@link createLoadCache}), the guard that turns any throw into one warning
|
|
25
|
+
* ({@link loadGuarded}), and the gate→decision step ({@link gateOrDegrade}). Those sentences are
|
|
26
|
+
* observably NOT the same in the two plugins, so every shared function takes them as
|
|
27
|
+
* {@link DegradeWords}: the shim owns the mechanism, the caller owns the wording, and the two trees'
|
|
28
|
+
* `envinit.spec.ts` pin each plugin's own text verbatim.
|
|
29
|
+
*
|
|
23
30
|
* @module @avantf/dsh-mem/interface_gate
|
|
24
31
|
*/
|
|
25
32
|
import type { InterfaceVerdict } from '@avantf/dsh-plugin-base';
|
|
@@ -48,4 +55,67 @@ export declare function baseIsUsable(verdict: InterfaceVerdict): boolean;
|
|
|
48
55
|
* never a throw.
|
|
49
56
|
*/
|
|
50
57
|
export declare function interfaceVerdict(module: unknown, bakedUrl?: URL | string): InterfaceVerdict;
|
|
58
|
+
/** The logging surface the shared loader helpers need; both plugins' loggers satisfy it. */
|
|
59
|
+
export interface GateLogger {
|
|
60
|
+
warn(message: string): void;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The two sentences the shared loader may NOT own, because the plugins word them differently: mem
|
|
64
|
+
* says the FRAMEWORK is skipped and names legacy provisioning among the withheld capabilities,
|
|
65
|
+
* mission says the COMPATIBILITY GATE is skipped and names none. Neither is drift — both are read by
|
|
66
|
+
* an operator — so the caller passes them in and the shared code interpolates them verbatim.
|
|
67
|
+
*/
|
|
68
|
+
export interface DegradeWords {
|
|
69
|
+
/** This module's warning token, so one grep finds every startup line: `envinit:` / `compat:`. */
|
|
70
|
+
readonly prefix: string;
|
|
71
|
+
/** The tail after "environment initialisation failed (...); " in the guarded-load failure line. */
|
|
72
|
+
readonly loadFailure: string;
|
|
73
|
+
/** The parenthetical after "the base's shared capabilities are NOT used (" in the incompatible line. */
|
|
74
|
+
readonly withheld: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Run the runtime interface gate and answer whether the loaded base's shared capabilities may be
|
|
78
|
+
* used.
|
|
79
|
+
*
|
|
80
|
+
* `false` is a DEGRADATION the caller answers by taking its own full-degradation route (no runtime,
|
|
81
|
+
* own prompt defaults, the compatibility gate skipped, legacy provisioning) — never a refused mount,
|
|
82
|
+
* and never a throw. `cannot-tell` warns and answers `true`: "cannot tell" is not a negative answer,
|
|
83
|
+
* so the base is used normally. The verdict's own reason is the base's; only the surrounding sentence
|
|
84
|
+
* is the caller's ({@link DegradeWords}).
|
|
85
|
+
*/
|
|
86
|
+
export declare function gateOrDegrade(module: unknown, log: GateLogger | undefined, words: DegradeWords): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* The guard that makes a loader's "never throws" true: every failure is one warning plus
|
|
89
|
+
* `undefined`. The caller owns the sentence's tail (`words`) and its own cache discipline — a
|
|
90
|
+
* FAILED load is not cached, so this must return `undefined` rather than reject (see
|
|
91
|
+
* {@link createLoadCache}).
|
|
92
|
+
*/
|
|
93
|
+
export declare function loadGuarded<O, T>(options: O, loadOnce: (options: O) => Promise<T | undefined>, log: GateLogger | undefined, words: DegradeWords): Promise<T | undefined>;
|
|
94
|
+
/** The per-process result of a guarded load: `load` is idempotent, `clear` is for disposal. */
|
|
95
|
+
export interface LoadCache<O, T> {
|
|
96
|
+
load(options: O): Promise<T | undefined>;
|
|
97
|
+
/** Drop the result and the in-flight promise, so the next `load` runs again (unmount/reload). */
|
|
98
|
+
clear(): void;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Wrap a guarded loader in the cache discipline both startups share: the first call runs it, every
|
|
102
|
+
* later and concurrent call shares its result, and a FAILED load is NOT cached. A failure is "cannot
|
|
103
|
+
* tell", not a verdict — and it may be transient (offline at boot, a half-written install) — so a
|
|
104
|
+
* profile reload, or a second instance in the same process, retries instead of replaying the first
|
|
105
|
+
* failure for the whole process lifetime.
|
|
106
|
+
*/
|
|
107
|
+
export declare function createLoadCache<O, T>(guarded: (options: O) => Promise<T | undefined>): LoadCache<O, T>;
|
|
108
|
+
/**
|
|
109
|
+
* Whether a Cordis context is still alive.
|
|
110
|
+
*
|
|
111
|
+
* Cordis clears `fiber.uid` on disposal, and every later context call then throws
|
|
112
|
+
* `INACTIVE_EFFECT`. `apply` awaits environment preparation, so a profile reload or unload can land
|
|
113
|
+
* inside that window and half-register a plugin (the Remote face cannot be rolled back). A fiberless
|
|
114
|
+
* stub counts as active: an unknown shape is "cannot tell", never "disposed".
|
|
115
|
+
*
|
|
116
|
+
* Generic Cordis liveness rather than interface-gate knowledge — but the two plugins' startup paths
|
|
117
|
+
* share it byte-for-byte, so it lives with their one shared shim, where the two readings of "is my
|
|
118
|
+
* context alive" cannot drift.
|
|
119
|
+
*/
|
|
120
|
+
export declare function stillActive(ctx: unknown): boolean;
|
|
51
121
|
//# sourceMappingURL=interface_gate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface_gate.d.ts","sourceRoot":"","sources":["../../src/interface_gate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"interface_gate.d.ts","sourceRoot":"","sources":["../../src/interface_gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO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F,MAAM,WAAW,SAAS,CAAC,CAAC,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAA;IACxC,iGAAiG;IACjG,KAAK,IAAI,IAAI,CAAA;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAyBtG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGjD"}
|
package/lib/types/provision.d.ts
CHANGED
|
@@ -84,6 +84,12 @@ export declare function runtimeFromCompat(module: CompatModule): CompatRuntime;
|
|
|
84
84
|
* Run the gate. Call this FIRST in `apply()`: on a refusal nothing has been registered yet, so
|
|
85
85
|
* "do not load" costs nothing to unwind. Never throws — not even with a throwing logger, because
|
|
86
86
|
* "cannot tell" is not "incompatible".
|
|
87
|
+
*
|
|
88
|
+
* The check itself is the BASE's `provision` (gather + verdict + logging, one call). The local
|
|
89
|
+
* fallback stays on purpose (option A): the interface-generation axis cannot gate this dependency
|
|
90
|
+
* (same-generation bases never read as `incompatible`), and raising the peer floor would degrade
|
|
91
|
+
* every host on a base that predates the fix — so a `provision` that cannot be performed still
|
|
92
|
+
* leaves the plugin loading.
|
|
87
93
|
* @param ctx - the plugin's context.
|
|
88
94
|
* @param log - the plugin's logger.
|
|
89
95
|
* @param compat - the loaded gate runtime (see `src/envinit.ts`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../src/provision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,YAAY,EACZ,UA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,aAAa,EAClB,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,aAAa,EACrB,IAAI,GAAE,UAAwB,GAC7B,SAAS,CAMX;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,aAAa,GACpB,IAAI,CAaN;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;CAC/B,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAQ1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/remote.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,oBAAoB,EAGpB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAGhF,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AA6E/D,eAAO,MAAM,WAAW,EAAE,SAAS,oBAAoB,
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/remote.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,oBAAoB,EAGpB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAGhF,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AA6E/D,eAAO,MAAM,WAAW,EAAE,SAAS,oBAAoB,EA4HtD,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,wBAGhC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,YAAY,IAAI,CAAA;AAE7B;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,SAAS,CAEnE;AA8BD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,EAAE,kBA0C9B,CAAA"}
|
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The plugin's
|
|
3
|
-
* current embedding space.
|
|
2
|
+
* The plugin's lifecycle for the bounded, resumable background migration of persisted vectors into
|
|
3
|
+
* the current embedding space.
|
|
4
4
|
*
|
|
5
|
-
* Changing the embedding space (default model, width, pooling, normalization
|
|
6
|
-
* not a config tweak: every persisted vector still decodes, but in another
|
|
7
|
-
* the semantic leg must not serve it. Measured on the real library after the
|
|
8
|
-
* swap, 78 of 80 ACTIVE facts fell out of the semantic leg and retrieval
|
|
9
|
-
* with no error anywhere — the
|
|
10
|
-
* repairs it without the operator having to know `vectors --fix` exists.
|
|
5
|
+
* Changing the embedding space (default model, width, pooling, normalization, input window, weights)
|
|
6
|
+
* is a DATA MIGRATION, not a config tweak: every persisted vector still decodes, but in another
|
|
7
|
+
* model's coordinates, so the semantic leg must not serve it. Measured on the real library after the
|
|
8
|
+
* 512→768 default-model swap, 78 of 80 ACTIVE facts fell out of the semantic leg and retrieval
|
|
9
|
+
* degraded to lexical+entity with no error anywhere — the stores' open-time warning now says so, and
|
|
10
|
+
* this module is what repairs it without the operator having to know `vectors --fix` exists.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* batch
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* (`shouldStop` = plugin disposed or runtime closed).
|
|
12
|
+
* The FLOW lives in the engine, once, for both stores (`@avantf/mem`'s `store/vector_repair.ts`:
|
|
13
|
+
* batch size, event-loop yield, stop / resume / no-progress rules, the `semantic.auto_migrate`
|
|
14
|
+
* decision and the four store-named log kinds). It is driven for BOTH stores — memory and knowledge
|
|
15
|
+
* — in one pass, because one embedding space is configured for the whole runtime: the knowledge
|
|
16
|
+
* store used to be left behind, silently, with only a manual `kb_reindex` able to fix it.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* This module owns only the process LIFECYCLE: one start, one stop, and "never an unhandled
|
|
19
|
+
* rejection". It sits BEHIND the startup gate (`awaitStartupGate`, see index.ts): the model warm and
|
|
20
|
+
* this first batch must not land in the boot window (DESIGN §20.14).
|
|
21
|
+
*
|
|
22
|
+
* Deliberately no state: what still needs migrating is derived from the databases on every pass —
|
|
23
|
+
* and the adapters are created ONCE so the shared flow's once-per-process `auto_migrate` warning is
|
|
24
|
+
* genuinely once per process, not once per heartbeat.
|
|
21
25
|
*/
|
|
22
26
|
import { type AvantfRuntime } from '../engine/mem/index.js';
|
|
23
27
|
import type { AvantfLogger } from '../engine/mem-contract/index.js';
|
|
24
28
|
export interface VectorMigrationHandle {
|
|
25
29
|
/**
|
|
26
|
-
* Run one migration pass. Quiet no-op when
|
|
30
|
+
* Run one migration pass. Quiet no-op when both stores are already current, when a pass is already
|
|
27
31
|
* running, or after {@link stop}. Failures never escape: they are logged and left for the next
|
|
28
32
|
* heartbeat to retry.
|
|
29
33
|
*/
|
|
@@ -38,7 +42,7 @@ export declare function createVectorMigration(opts: {
|
|
|
38
42
|
logger: AvantfLogger;
|
|
39
43
|
/** False once the plugin's fiber is disposed (profile reload / unload). */
|
|
40
44
|
isActive: () => boolean;
|
|
41
|
-
/** Rows per batch; the
|
|
45
|
+
/** Rows per batch; the engine's `DEFAULT_VECTOR_MIGRATION_BATCH` when omitted. */
|
|
42
46
|
batchSize?: number;
|
|
43
47
|
}): VectorMigrationHandle;
|
|
44
48
|
//# sourceMappingURL=vectorMigration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorMigration.d.ts","sourceRoot":"","sources":["../../src/vectorMigration.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vectorMigration.d.ts","sourceRoot":"","sources":["../../src/vectorMigration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAA;IACb,wFAAwF;IACxF,IAAI,IAAI,IAAI,CAAA;IACZ,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,EAAE,EAAE,aAAa,CAAA;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,OAAO,CAAA;IACvB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,qBAAqB,CAiCxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avantf/dsh-mem",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "avantf-mem DSH native Cordis plugin: host service + tools + RPC + client tabs 记忆/知识",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@avantf/dsh-plugin-base": ">=0.3.0 <1.0.0",
|
|
81
|
-
"@avantf/mem": "0.6.
|
|
82
|
-
"@avantf/mem-contract": "0.6.
|
|
83
|
-
"@avantf/mem-convert": "0.6.
|
|
84
|
-
"@avantf/mem-provision": "0.6.
|
|
81
|
+
"@avantf/mem": "0.6.2",
|
|
82
|
+
"@avantf/mem-contract": "0.6.2",
|
|
83
|
+
"@avantf/mem-convert": "0.6.2",
|
|
84
|
+
"@avantf/mem-provision": "0.6.2",
|
|
85
85
|
"@types/node": "^22.0.0",
|
|
86
86
|
"@types/react": "^18.3.0",
|
|
87
87
|
"lightningcss": "^1.32.0",
|