clawvault 3.2.1 → 3.4.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/README.md +56 -16
- package/bin/clawvault.js +0 -2
- package/bin/command-registration.test.js +15 -2
- package/bin/help-contract.test.js +16 -0
- package/bin/register-core-commands.js +88 -0
- package/bin/register-core-commands.test.js +80 -0
- package/bin/register-maintenance-commands.js +84 -7
- package/bin/register-query-commands.js +45 -28
- package/bin/register-query-commands.test.js +15 -0
- package/bin/test-helpers/cli-command-fixtures.js +1 -0
- package/dist/chunk-2PKBIKDH.js +130 -0
- package/dist/{chunk-U67V476Y.js → chunk-2ZDO52B4.js} +18 -1
- package/dist/{chunk-ZZA73MFY.js → chunk-33DOSHTA.js} +176 -36
- package/dist/chunk-35JCYSRR.js +158 -0
- package/dist/{chunk-AZYOKJYC.js → chunk-4PY655YM.js} +13 -1
- package/dist/{chunk-2JQ3O2YL.js → chunk-5EFSWZO6.js} +3 -3
- package/dist/{chunk-Y3TIJEBP.js → chunk-7SWP5FKU.js} +34 -613
- package/dist/{chunk-4VQTUVH7.js → chunk-7YZWHM36.js} +52 -26
- package/dist/{chunk-URXDAUVH.js → chunk-AXSJIFOJ.js} +174 -1
- package/dist/{chunk-4ITRXIVT.js → chunk-BLQXXX7Q.js} +6 -6
- package/dist/chunk-CSHO3PJB.js +684 -0
- package/dist/chunk-D5U3Q4N5.js +872 -0
- package/dist/chunk-DCF4KMFD.js +158 -0
- package/dist/{chunk-S5OJEGFG.js → chunk-DOIUYIXV.js} +2 -2
- package/dist/{chunk-YXQCA6B7.js → chunk-DVOUSOR3.js} +112 -7
- package/dist/{chunk-YDWHS4LJ.js → chunk-ECGJYWNA.js} +205 -33
- package/dist/{chunk-QMHPQYUV.js → chunk-EL6UBSX5.js} +7 -6
- package/dist/chunk-FZ5I2NF7.js +352 -0
- package/dist/{chunk-WJVWINEM.js → chunk-GFCHWMGD.js} +55 -6
- package/dist/{chunk-GNJL4YGR.js → chunk-GJO3CFUN.js} +30 -6
- package/dist/chunk-H3JZIB5O.js +322 -0
- package/dist/chunk-HEHO7SMV.js +51 -0
- package/dist/{chunk-UCQAOZHW.js → chunk-HGDDW24U.js} +3 -3
- package/dist/chunk-J3YUXVID.js +907 -0
- package/dist/{chunk-Y6VJKXGL.js → chunk-KCYWJDDW.js} +1 -1
- package/dist/{chunk-P5EPF6MB.js → chunk-MW5C6ZQA.js} +110 -13
- package/dist/chunk-NSXYM6EZ.js +255 -0
- package/dist/{chunk-YNIPYN4F.js → chunk-OFOCU2V4.js} +6 -5
- package/dist/{chunk-42MXU7A6.js → chunk-P62WHA27.js} +58 -47
- package/dist/chunk-PTWPPVC7.js +972 -0
- package/dist/{chunk-FAKNOB7Y.js → chunk-QFWERBDP.js} +2 -2
- package/dist/chunk-QYQAGBTM.js +2097 -0
- package/dist/chunk-RL2L6I6K.js +223 -0
- package/dist/{chunk-IIOU45CK.js → chunk-S7N7HI5E.js} +2 -2
- package/dist/{chunk-ECRZL5XR.js → chunk-T7E764W3.js} +23 -7
- package/dist/{chunk-MNPUYCHQ.js → chunk-TWMI3SNN.js} +6 -5
- package/dist/{chunk-2RAZ4ZFE.js → chunk-VBILES4B.js} +1 -1
- package/dist/{chunk-PI4WMLMG.js → chunk-VXAGOLDP.js} +1 -1
- package/dist/{chunk-SS4B7P7V.js → chunk-YIDV4VV2.js} +1 -1
- package/dist/chunk-YTRZNA64.js +37 -0
- package/dist/chunk-ZKWPCBYT.js +600 -0
- package/dist/cli/index.js +28 -21
- package/dist/commands/archive.js +3 -3
- package/dist/commands/backlog.js +1 -1
- package/dist/commands/benchmark.d.ts +12 -0
- package/dist/commands/benchmark.js +12 -0
- package/dist/commands/blocked.js +1 -1
- package/dist/commands/canvas.js +2 -2
- package/dist/commands/checkpoint.js +1 -1
- package/dist/commands/compat.js +1 -1
- package/dist/commands/context.js +8 -7
- package/dist/commands/doctor.d.ts +8 -3
- package/dist/commands/doctor.js +8 -22
- package/dist/commands/embed.js +6 -5
- package/dist/commands/entities.d.ts +8 -1
- package/dist/commands/entities.js +46 -3
- package/dist/commands/graph.js +4 -4
- package/dist/commands/inbox.d.ts +23 -0
- package/dist/commands/inbox.js +11 -0
- package/dist/commands/inject.d.ts +1 -1
- package/dist/commands/inject.js +5 -5
- package/dist/commands/kanban.js +1 -1
- package/dist/commands/link.js +5 -5
- package/dist/commands/maintain.d.ts +32 -0
- package/dist/commands/maintain.js +13 -0
- package/dist/commands/migrate-observations.js +3 -3
- package/dist/commands/observe.js +11 -10
- package/dist/commands/project.js +2 -2
- package/dist/commands/rebuild-embeddings.js +48 -17
- package/dist/commands/rebuild.js +9 -8
- package/dist/commands/recall.d.ts +14 -0
- package/dist/commands/recall.js +15 -0
- package/dist/commands/recover.js +1 -1
- package/dist/commands/reflect.js +6 -6
- package/dist/commands/repair-session.js +1 -1
- package/dist/commands/replay.js +10 -9
- package/dist/commands/session-recap.js +1 -1
- package/dist/commands/setup.js +4 -3
- package/dist/commands/shell-init.js +1 -1
- package/dist/commands/sleep.d.ts +1 -1
- package/dist/commands/sleep.js +20 -18
- package/dist/commands/status.js +40 -26
- package/dist/commands/sync-bd.js +3 -3
- package/dist/commands/tailscale.js +3 -3
- package/dist/commands/task.js +1 -1
- package/dist/commands/template.js +1 -1
- package/dist/commands/wake.d.ts +1 -1
- package/dist/commands/wake.js +10 -9
- package/dist/index.d.ts +233 -16
- package/dist/index.js +325 -111
- package/dist/{inject-DYUrDqQO.d.ts → inject-DEb_jpLi.d.ts} +3 -1
- package/dist/lib/auto-linker.js +2 -2
- package/dist/lib/canvas-layout.js +1 -1
- package/dist/lib/config.js +2 -2
- package/dist/lib/entity-index.js +1 -1
- package/dist/lib/project-utils.js +2 -2
- package/dist/lib/session-repair.js +1 -1
- package/dist/lib/session-utils.js +1 -1
- package/dist/lib/tailscale.js +1 -1
- package/dist/lib/task-utils.js +1 -1
- package/dist/lib/template-engine.js +1 -1
- package/dist/lib/webdav.js +1 -1
- package/dist/onnxruntime_binding-5QEF3SUC.node +0 -0
- package/dist/onnxruntime_binding-BKPKNEGC.node +0 -0
- package/dist/onnxruntime_binding-FMOXGIUT.node +0 -0
- package/dist/onnxruntime_binding-OI2KMXC5.node +0 -0
- package/dist/onnxruntime_binding-UX44MLAZ.node +0 -0
- package/dist/onnxruntime_binding-Y2W7N7WY.node +0 -0
- package/dist/openclaw-plugin--gqA2BZw.d.ts +267 -0
- package/dist/openclaw-plugin.d.ts +4 -0
- package/dist/openclaw-plugin.js +20 -0
- package/dist/transformers.node-A2ZRORSQ.js +46775 -0
- package/dist/types-CbL-wIKi.d.ts +36 -0
- package/dist/{types-BbWJoC1c.d.ts → types-DslKvCaj.d.ts} +51 -1
- package/hooks/clawvault/HOOK.md +25 -8
- package/hooks/clawvault/handler.js +215 -78
- package/hooks/clawvault/handler.test.js +109 -43
- package/hooks/clawvault/integrity.js +112 -0
- package/hooks/clawvault/integrity.test.js +32 -0
- package/hooks/clawvault/openclaw.plugin.json +133 -15
- package/openclaw.plugin.json +161 -194
- package/package.json +8 -5
- package/bin/register-workgraph-commands.js +0 -451
- package/dist/chunk-5PJ4STIC.js +0 -465
- package/dist/chunk-ERNE2FZ5.js +0 -189
- package/dist/chunk-HR4KN6S2.js +0 -152
- package/dist/chunk-IJBFGPCS.js +0 -33
- package/dist/chunk-K7PNYS45.js +0 -93
- package/dist/chunk-NTOPJI7W.js +0 -207
- package/dist/chunk-PG56HX5T.js +0 -154
- package/dist/chunk-QPDDIHXE.js +0 -501
- package/dist/chunk-WIOLLGAD.js +0 -190
- package/dist/chunk-WMGIIABP.js +0 -15
- package/dist/ledger-B7g7jhqG.d.ts +0 -44
- package/dist/plugin/index.d.ts +0 -352
- package/dist/plugin/index.js +0 -4264
- package/dist/registry-BR4326o0.d.ts +0 -30
- package/dist/store-CA-6sKCJ.d.ts +0 -34
- package/dist/thread-B9LhXNU0.d.ts +0 -41
- package/dist/workgraph/index.d.ts +0 -5
- package/dist/workgraph/index.js +0 -23
- package/dist/workgraph/ledger.d.ts +0 -2
- package/dist/workgraph/ledger.js +0 -25
- package/dist/workgraph/registry.d.ts +0 -2
- package/dist/workgraph/registry.js +0 -19
- package/dist/workgraph/store.d.ts +0 -2
- package/dist/workgraph/store.js +0 -25
- package/dist/workgraph/thread.d.ts +0 -2
- package/dist/workgraph/thread.js +0 -25
- package/dist/workgraph/types.d.ts +0 -54
- package/dist/workgraph/types.js +0 -7
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { FieldDefinition, PrimitiveTypeDefinition, Registry } from './workgraph/types.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Dynamic primitive type registry.
|
|
5
|
-
*
|
|
6
|
-
* Agents can define new primitive types at runtime. The registry is stored
|
|
7
|
-
* as `.clawvault/registry.json` in the vault. Built-in types are seeded on
|
|
8
|
-
* first access and cannot be deleted (but CAN be extended with new fields).
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
declare function registryPath(vaultPath: string): string;
|
|
12
|
-
declare function loadRegistry(vaultPath: string): Registry;
|
|
13
|
-
declare function saveRegistry(vaultPath: string, registry: Registry): void;
|
|
14
|
-
declare function defineType(vaultPath: string, name: string, description: string, fields: Record<string, FieldDefinition>, actor: string, directory?: string): PrimitiveTypeDefinition;
|
|
15
|
-
declare function getType(vaultPath: string, name: string): PrimitiveTypeDefinition | undefined;
|
|
16
|
-
declare function listTypes(vaultPath: string): PrimitiveTypeDefinition[];
|
|
17
|
-
declare function extendType(vaultPath: string, name: string, newFields: Record<string, FieldDefinition>, actor: string): PrimitiveTypeDefinition;
|
|
18
|
-
|
|
19
|
-
declare const registry_defineType: typeof defineType;
|
|
20
|
-
declare const registry_extendType: typeof extendType;
|
|
21
|
-
declare const registry_getType: typeof getType;
|
|
22
|
-
declare const registry_listTypes: typeof listTypes;
|
|
23
|
-
declare const registry_loadRegistry: typeof loadRegistry;
|
|
24
|
-
declare const registry_registryPath: typeof registryPath;
|
|
25
|
-
declare const registry_saveRegistry: typeof saveRegistry;
|
|
26
|
-
declare namespace registry {
|
|
27
|
-
export { registry_defineType as defineType, registry_extendType as extendType, registry_getType as getType, registry_listTypes as listTypes, registry_loadRegistry as loadRegistry, registry_registryPath as registryPath, registry_saveRegistry as saveRegistry };
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { loadRegistry as a, registryPath as b, defineType as d, extendType as e, getType as g, listTypes as l, registry as r, saveRegistry as s };
|
package/dist/store-CA-6sKCJ.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { PrimitiveInstance } from './workgraph/types.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Workgraph store — CRUD for primitive instances.
|
|
5
|
-
*
|
|
6
|
-
* Primitives are markdown files with YAML frontmatter. The store reads/writes
|
|
7
|
-
* them and logs every mutation to the ledger. Schemas are soft: unknown fields
|
|
8
|
-
* are preserved, missing optional fields get defaults.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
declare function create(vaultPath: string, typeName: string, fields: Record<string, unknown>, body: string, actor: string): PrimitiveInstance;
|
|
12
|
-
declare function read(vaultPath: string, relPath: string): PrimitiveInstance | null;
|
|
13
|
-
declare function list(vaultPath: string, typeName: string): PrimitiveInstance[];
|
|
14
|
-
declare function update(vaultPath: string, relPath: string, fieldUpdates: Record<string, unknown>, bodyUpdate: string | undefined, actor: string): PrimitiveInstance;
|
|
15
|
-
declare function remove(vaultPath: string, relPath: string, actor: string): void;
|
|
16
|
-
declare function findByField(vaultPath: string, typeName: string, field: string, value: unknown): PrimitiveInstance[];
|
|
17
|
-
declare function openThreads(vaultPath: string): PrimitiveInstance[];
|
|
18
|
-
declare function activeThreads(vaultPath: string): PrimitiveInstance[];
|
|
19
|
-
declare function blockedThreads(vaultPath: string): PrimitiveInstance[];
|
|
20
|
-
|
|
21
|
-
declare const store_activeThreads: typeof activeThreads;
|
|
22
|
-
declare const store_blockedThreads: typeof blockedThreads;
|
|
23
|
-
declare const store_create: typeof create;
|
|
24
|
-
declare const store_findByField: typeof findByField;
|
|
25
|
-
declare const store_list: typeof list;
|
|
26
|
-
declare const store_openThreads: typeof openThreads;
|
|
27
|
-
declare const store_read: typeof read;
|
|
28
|
-
declare const store_remove: typeof remove;
|
|
29
|
-
declare const store_update: typeof update;
|
|
30
|
-
declare namespace store {
|
|
31
|
-
export { store_activeThreads as activeThreads, store_blockedThreads as blockedThreads, store_create as create, store_findByField as findByField, store_list as list, store_openThreads as openThreads, store_read as read, store_remove as remove, store_update as update };
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export { activeThreads as a, blockedThreads as b, create as c, remove as d, findByField as f, list as l, openThreads as o, read as r, store as s, update as u };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { PrimitiveInstance } from './workgraph/types.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Thread lifecycle operations.
|
|
5
|
-
*
|
|
6
|
-
* Threads are the core coordination primitive. This module handles the
|
|
7
|
-
* claim/release/block/done lifecycle with ledger-backed exclusivity.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
declare function createThread(vaultPath: string, title: string, goal: string, actor: string, opts?: {
|
|
11
|
-
priority?: string;
|
|
12
|
-
deps?: string[];
|
|
13
|
-
parent?: string;
|
|
14
|
-
context_refs?: string[];
|
|
15
|
-
tags?: string[];
|
|
16
|
-
}): PrimitiveInstance;
|
|
17
|
-
declare function claim(vaultPath: string, threadPath: string, actor: string): PrimitiveInstance;
|
|
18
|
-
declare function release(vaultPath: string, threadPath: string, actor: string, reason?: string): PrimitiveInstance;
|
|
19
|
-
declare function block(vaultPath: string, threadPath: string, actor: string, blockedBy: string, reason?: string): PrimitiveInstance;
|
|
20
|
-
declare function unblock(vaultPath: string, threadPath: string, actor: string): PrimitiveInstance;
|
|
21
|
-
declare function done(vaultPath: string, threadPath: string, actor: string, output?: string): PrimitiveInstance;
|
|
22
|
-
declare function cancel(vaultPath: string, threadPath: string, actor: string, reason?: string): PrimitiveInstance;
|
|
23
|
-
declare function decompose(vaultPath: string, parentPath: string, subthreads: Array<{
|
|
24
|
-
title: string;
|
|
25
|
-
goal: string;
|
|
26
|
-
deps?: string[];
|
|
27
|
-
}>, actor: string): PrimitiveInstance[];
|
|
28
|
-
|
|
29
|
-
declare const thread_block: typeof block;
|
|
30
|
-
declare const thread_cancel: typeof cancel;
|
|
31
|
-
declare const thread_claim: typeof claim;
|
|
32
|
-
declare const thread_createThread: typeof createThread;
|
|
33
|
-
declare const thread_decompose: typeof decompose;
|
|
34
|
-
declare const thread_done: typeof done;
|
|
35
|
-
declare const thread_release: typeof release;
|
|
36
|
-
declare const thread_unblock: typeof unblock;
|
|
37
|
-
declare namespace thread {
|
|
38
|
-
export { thread_block as block, thread_cancel as cancel, thread_claim as claim, thread_createThread as createThread, thread_decompose as decompose, thread_done as done, thread_release as release, thread_unblock as unblock };
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export { claim as a, block as b, cancel as c, createThread as d, decompose as e, done as f, release as r, thread as t, unblock as u };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { FieldDefinition, LedgerEntry, LedgerOp, PrimitiveInstance, PrimitiveTypeDefinition, Registry, THREAD_STATUS_TRANSITIONS, ThreadStatus } from './types.js';
|
|
2
|
-
export { r as registry } from '../registry-BR4326o0.js';
|
|
3
|
-
export { l as ledger } from '../ledger-B7g7jhqG.js';
|
|
4
|
-
export { s as store } from '../store-CA-6sKCJ.js';
|
|
5
|
-
export { t as thread } from '../thread-B9LhXNU0.js';
|
package/dist/workgraph/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
thread_exports
|
|
3
|
-
} from "../chunk-ERNE2FZ5.js";
|
|
4
|
-
import {
|
|
5
|
-
store_exports
|
|
6
|
-
} from "../chunk-HR4KN6S2.js";
|
|
7
|
-
import {
|
|
8
|
-
ledger_exports
|
|
9
|
-
} from "../chunk-K7PNYS45.js";
|
|
10
|
-
import {
|
|
11
|
-
registry_exports
|
|
12
|
-
} from "../chunk-NTOPJI7W.js";
|
|
13
|
-
import {
|
|
14
|
-
THREAD_STATUS_TRANSITIONS
|
|
15
|
-
} from "../chunk-WMGIIABP.js";
|
|
16
|
-
import "../chunk-U67V476Y.js";
|
|
17
|
-
export {
|
|
18
|
-
THREAD_STATUS_TRANSITIONS,
|
|
19
|
-
ledger_exports as ledger,
|
|
20
|
-
registry_exports as registry,
|
|
21
|
-
store_exports as store,
|
|
22
|
-
thread_exports as thread
|
|
23
|
-
};
|
package/dist/workgraph/ledger.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
activityOf,
|
|
3
|
-
allClaims,
|
|
4
|
-
append,
|
|
5
|
-
currentOwner,
|
|
6
|
-
historyOf,
|
|
7
|
-
isClaimed,
|
|
8
|
-
ledgerPath,
|
|
9
|
-
readAll,
|
|
10
|
-
readSince,
|
|
11
|
-
recent
|
|
12
|
-
} from "../chunk-K7PNYS45.js";
|
|
13
|
-
import "../chunk-U67V476Y.js";
|
|
14
|
-
export {
|
|
15
|
-
activityOf,
|
|
16
|
-
allClaims,
|
|
17
|
-
append,
|
|
18
|
-
currentOwner,
|
|
19
|
-
historyOf,
|
|
20
|
-
isClaimed,
|
|
21
|
-
ledgerPath,
|
|
22
|
-
readAll,
|
|
23
|
-
readSince,
|
|
24
|
-
recent
|
|
25
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineType,
|
|
3
|
-
extendType,
|
|
4
|
-
getType,
|
|
5
|
-
listTypes,
|
|
6
|
-
loadRegistry,
|
|
7
|
-
registryPath,
|
|
8
|
-
saveRegistry
|
|
9
|
-
} from "../chunk-NTOPJI7W.js";
|
|
10
|
-
import "../chunk-U67V476Y.js";
|
|
11
|
-
export {
|
|
12
|
-
defineType,
|
|
13
|
-
extendType,
|
|
14
|
-
getType,
|
|
15
|
-
listTypes,
|
|
16
|
-
loadRegistry,
|
|
17
|
-
registryPath,
|
|
18
|
-
saveRegistry
|
|
19
|
-
};
|
package/dist/workgraph/store.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
activeThreads,
|
|
3
|
-
blockedThreads,
|
|
4
|
-
create,
|
|
5
|
-
findByField,
|
|
6
|
-
list,
|
|
7
|
-
openThreads,
|
|
8
|
-
read,
|
|
9
|
-
remove,
|
|
10
|
-
update
|
|
11
|
-
} from "../chunk-HR4KN6S2.js";
|
|
12
|
-
import "../chunk-K7PNYS45.js";
|
|
13
|
-
import "../chunk-NTOPJI7W.js";
|
|
14
|
-
import "../chunk-U67V476Y.js";
|
|
15
|
-
export {
|
|
16
|
-
activeThreads,
|
|
17
|
-
blockedThreads,
|
|
18
|
-
create,
|
|
19
|
-
findByField,
|
|
20
|
-
list,
|
|
21
|
-
openThreads,
|
|
22
|
-
read,
|
|
23
|
-
remove,
|
|
24
|
-
update
|
|
25
|
-
};
|
package/dist/workgraph/thread.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
block,
|
|
3
|
-
cancel,
|
|
4
|
-
claim,
|
|
5
|
-
createThread,
|
|
6
|
-
decompose,
|
|
7
|
-
done,
|
|
8
|
-
release,
|
|
9
|
-
unblock
|
|
10
|
-
} from "../chunk-ERNE2FZ5.js";
|
|
11
|
-
import "../chunk-HR4KN6S2.js";
|
|
12
|
-
import "../chunk-K7PNYS45.js";
|
|
13
|
-
import "../chunk-NTOPJI7W.js";
|
|
14
|
-
import "../chunk-WMGIIABP.js";
|
|
15
|
-
import "../chunk-U67V476Y.js";
|
|
16
|
-
export {
|
|
17
|
-
block,
|
|
18
|
-
cancel,
|
|
19
|
-
claim,
|
|
20
|
-
createThread,
|
|
21
|
-
decompose,
|
|
22
|
-
done,
|
|
23
|
-
release,
|
|
24
|
-
unblock
|
|
25
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workgraph type definitions.
|
|
3
|
-
*
|
|
4
|
-
* Three layers:
|
|
5
|
-
* 1. Registry — what primitive types exist (agent-extensible)
|
|
6
|
-
* 2. Ledger — what happened (append-only, source of truth for claims/state)
|
|
7
|
-
* 3. Store — the actual markdown files (the primitives themselves)
|
|
8
|
-
*/
|
|
9
|
-
interface FieldDefinition {
|
|
10
|
-
type: 'string' | 'number' | 'boolean' | 'list' | 'date' | 'ref' | 'any';
|
|
11
|
-
required?: boolean;
|
|
12
|
-
default?: unknown;
|
|
13
|
-
description?: string;
|
|
14
|
-
}
|
|
15
|
-
interface PrimitiveTypeDefinition {
|
|
16
|
-
name: string;
|
|
17
|
-
description: string;
|
|
18
|
-
fields: Record<string, FieldDefinition>;
|
|
19
|
-
/** Directory under vault root where instances live (default: `<name>s/`). */
|
|
20
|
-
directory: string;
|
|
21
|
-
/** Whether this type was defined by an agent at runtime vs built-in. */
|
|
22
|
-
builtIn: boolean;
|
|
23
|
-
/** ISO timestamp of when this type was registered. */
|
|
24
|
-
createdAt: string;
|
|
25
|
-
/** Who registered it (agent name or "system"). */
|
|
26
|
-
createdBy: string;
|
|
27
|
-
}
|
|
28
|
-
interface Registry {
|
|
29
|
-
version: number;
|
|
30
|
-
types: Record<string, PrimitiveTypeDefinition>;
|
|
31
|
-
}
|
|
32
|
-
type LedgerOp = 'create' | 'update' | 'delete' | 'claim' | 'release' | 'block' | 'unblock' | 'done' | 'cancel' | 'define' | 'decompose';
|
|
33
|
-
interface LedgerEntry {
|
|
34
|
-
ts: string;
|
|
35
|
-
actor: string;
|
|
36
|
-
op: LedgerOp;
|
|
37
|
-
target: string;
|
|
38
|
-
type?: string;
|
|
39
|
-
data?: Record<string, unknown>;
|
|
40
|
-
}
|
|
41
|
-
type ThreadStatus = 'open' | 'active' | 'blocked' | 'done' | 'cancelled';
|
|
42
|
-
declare const THREAD_STATUS_TRANSITIONS: Record<ThreadStatus, ThreadStatus[]>;
|
|
43
|
-
interface PrimitiveInstance {
|
|
44
|
-
/** File path relative to vault root. */
|
|
45
|
-
path: string;
|
|
46
|
-
/** Primitive type name. */
|
|
47
|
-
type: string;
|
|
48
|
-
/** Frontmatter fields. */
|
|
49
|
-
fields: Record<string, unknown>;
|
|
50
|
-
/** Markdown body content. */
|
|
51
|
-
body: string;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export { type FieldDefinition, type LedgerEntry, type LedgerOp, type PrimitiveInstance, type PrimitiveTypeDefinition, type Registry, THREAD_STATUS_TRANSITIONS, type ThreadStatus };
|