arborkit 1.0.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.
- package/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +134 -0
- package/dist/addressing.d.ts +22 -0
- package/dist/addressing.js +56 -0
- package/dist/addressing.js.map +1 -0
- package/dist/ag-ui.d.ts +45 -0
- package/dist/ag-ui.js +50 -0
- package/dist/ag-ui.js.map +1 -0
- package/dist/arbor.d.ts +73 -0
- package/dist/arbor.js +1542 -0
- package/dist/arbor.js.map +1 -0
- package/dist/artifact-tree.d.ts +66 -0
- package/dist/artifact-tree.js +285 -0
- package/dist/artifact-tree.js.map +1 -0
- package/dist/clock.d.ts +15 -0
- package/dist/clock.js +23 -0
- package/dist/clock.js.map +1 -0
- package/dist/decompose.d.ts +18 -0
- package/dist/decompose.js +22 -0
- package/dist/decompose.js.map +1 -0
- package/dist/delta-storage.d.ts +55 -0
- package/dist/delta-storage.js +106 -0
- package/dist/delta-storage.js.map +1 -0
- package/dist/delta.d.ts +55 -0
- package/dist/delta.js +740 -0
- package/dist/delta.js.map +1 -0
- package/dist/embedding-port.d.ts +17 -0
- package/dist/embedding-port.js +21 -0
- package/dist/embedding-port.js.map +1 -0
- package/dist/embedding-text.d.ts +14 -0
- package/dist/embedding-text.js +21 -0
- package/dist/embedding-text.js.map +1 -0
- package/dist/errors.d.ts +37 -0
- package/dist/errors.js +59 -0
- package/dist/errors.js.map +1 -0
- package/dist/event-log.d.ts +75 -0
- package/dist/event-log.js +82 -0
- package/dist/event-log.js.map +1 -0
- package/dist/file-storage.d.ts +22 -0
- package/dist/file-storage.js +42 -0
- package/dist/file-storage.js.map +1 -0
- package/dist/ids.d.ts +17 -0
- package/dist/ids.js +22 -0
- package/dist/ids.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +1826 -0
- package/dist/index.js.map +1 -0
- package/dist/json-edit.d.ts +18 -0
- package/dist/json-edit.js +85 -0
- package/dist/json-edit.js.map +1 -0
- package/dist/jsonpointer.d.ts +14 -0
- package/dist/jsonpointer.js +33 -0
- package/dist/jsonpointer.js.map +1 -0
- package/dist/mutator.d.ts +59 -0
- package/dist/mutator.js +244 -0
- package/dist/mutator.js.map +1 -0
- package/dist/navigator.d.ts +85 -0
- package/dist/navigator.js +192 -0
- package/dist/navigator.js.map +1 -0
- package/dist/path-glob.d.ts +13 -0
- package/dist/path-glob.js +40 -0
- package/dist/path-glob.js.map +1 -0
- package/dist/registry-validator.d.ts +15 -0
- package/dist/registry-validator.js +11 -0
- package/dist/registry-validator.js.map +1 -0
- package/dist/replay.d.ts +38 -0
- package/dist/replay.js +183 -0
- package/dist/replay.js.map +1 -0
- package/dist/semantic-index.d.ts +88 -0
- package/dist/semantic-index.js +226 -0
- package/dist/semantic-index.js.map +1 -0
- package/dist/storage.d.ts +39 -0
- package/dist/storage.js +378 -0
- package/dist/storage.js.map +1 -0
- package/dist/toolset.d.ts +78 -0
- package/dist/toolset.js +306 -0
- package/dist/toolset.js.map +1 -0
- package/dist/type-aware-decision.d.ts +8 -0
- package/dist/type-aware-decision.js +17 -0
- package/dist/type-aware-decision.js.map +1 -0
- package/dist/type-registry.d.ts +20 -0
- package/dist/type-registry.js +17 -0
- package/dist/type-registry.js.map +1 -0
- package/dist/types.d.ts +28 -0
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -0
- package/dist/vector-index-port.d.ts +34 -0
- package/dist/vector-index-port.js +49 -0
- package/dist/vector-index-port.js.map +1 -0
- package/dist/zod-adapter.d.ts +13 -0
- package/dist/zod-adapter.js +34 -0
- package/dist/zod-adapter.js.map +1 -0
- package/package.json +47 -0
package/dist/delta.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ArtifactTree, TreeDeps } from './artifact-tree.js';
|
|
2
|
+
import { MutationEvent, EventLog } from './event-log.js';
|
|
3
|
+
import { Mutator } from './mutator.js';
|
|
4
|
+
import { VectorIndexPort } from './vector-index-port.js';
|
|
5
|
+
import { DeltaStoragePort } from './delta-storage.js';
|
|
6
|
+
import './types.js';
|
|
7
|
+
import './ids.js';
|
|
8
|
+
import './clock.js';
|
|
9
|
+
import './decompose.js';
|
|
10
|
+
import './addressing.js';
|
|
11
|
+
import './errors.js';
|
|
12
|
+
import './storage.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Re-apply ONE recorded event FORWARD onto a live tree via the `Mutator`, addressed by
|
|
16
|
+
* the event's stable path(s). The inverse of replay's `reverseApplyValue`: set→`after`,
|
|
17
|
+
* insert→insert `after`, remove→remove, move→to. Goes through the Mutator so
|
|
18
|
+
* decomposition, typing (via `e.nodeType`), and the index hooks run exactly as in normal
|
|
19
|
+
* operation. Node ids for touched subtrees are regenerated; replay/revert are path-addressed and
|
|
20
|
+
* unaffected, but id-addressed views (e.g. toolset `history`, which filters by targetId)
|
|
21
|
+
* may not see a regenerated node's pre-restore history. Malformed/pre-M7 events (missing
|
|
22
|
+
* paths) are skipped.
|
|
23
|
+
*/
|
|
24
|
+
declare function applyEventForward(mutator: Mutator, e: MutationEvent): void;
|
|
25
|
+
/** Forward-apply a sequence of events, in order. */
|
|
26
|
+
declare function replayForward(mutator: Mutator, events: readonly MutationEvent[]): void;
|
|
27
|
+
/**
|
|
28
|
+
* Append every event newer than `sinceSeq` to the journal (the cheap, common save).
|
|
29
|
+
* Returns the new high-water seq to pass next time. No-op if nothing is new.
|
|
30
|
+
* Throws if events in `[sinceSeq, baseSeq)` were compacted away before being journaled
|
|
31
|
+
* (that history is unrecoverable) — compact only right before `persistCheckpoint`.
|
|
32
|
+
*/
|
|
33
|
+
declare function persistDelta(store: DeltaStoragePort, log: EventLog, sinceSeq: number): Promise<number>;
|
|
34
|
+
/**
|
|
35
|
+
* Write a full checkpoint (replacing the prior one and clearing the journal) and return
|
|
36
|
+
* its high-water seq. Pair with M12 `log.compactTo(...)` BEFORE calling to keep the
|
|
37
|
+
* checkpoint's embedded event window small.
|
|
38
|
+
*/
|
|
39
|
+
declare function persistCheckpoint(store: DeltaStoragePort, tree: ArtifactTree, log: EventLog, vectors: VectorIndexPort): Promise<number>;
|
|
40
|
+
/**
|
|
41
|
+
* Restore a tree + log from a checkpoint plus its journaled deltas. Returns null if no
|
|
42
|
+
* checkpoint has been written yet. Forward-replays the journal through a `Mutator` so node
|
|
43
|
+
* TYPES are preserved (via each event's `nodeType`) and UNCHANGED nodes keep their ids and
|
|
44
|
+
* checkpoint vectors; touched nodes are re-decomposed and marked `embedding.state: "stale"`
|
|
45
|
+
* for the consumer's `SemanticIndex` reindex, and removed/orphaned nodes' vectors are
|
|
46
|
+
* dropped. `vectors` should be a fresh index (the checkpoint's vectors are upserted into it).
|
|
47
|
+
* Restore must use the same `decompose` decision as the original run (journal-touched nodes
|
|
48
|
+
* are re-decomposed); replay does not re-validate.
|
|
49
|
+
*/
|
|
50
|
+
declare function restoreFromDelta(store: DeltaStoragePort, deps: TreeDeps, vectors: VectorIndexPort): Promise<{
|
|
51
|
+
tree: ArtifactTree;
|
|
52
|
+
log: EventLog;
|
|
53
|
+
} | null>;
|
|
54
|
+
|
|
55
|
+
export { applyEventForward, persistCheckpoint, persistDelta, replayForward, restoreFromDelta };
|