trellis 2.1.6 → 2.1.9
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 +100 -10
- package/dist/cli/index.d.ts +14 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +212 -12
- package/dist/client/config.d.ts +56 -0
- package/dist/client/config.d.ts.map +1 -0
- package/dist/client/index.d.ts +15 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +32 -0
- package/dist/client/sdk.d.ts +152 -0
- package/dist/client/sdk.d.ts.map +1 -0
- package/dist/config-8hczw0rs.js +20 -0
- package/dist/core/agents/harness.d.ts +49 -0
- package/dist/core/agents/harness.d.ts.map +1 -0
- package/dist/core/agents/index.d.ts +8 -0
- package/dist/core/agents/index.d.ts.map +1 -0
- package/dist/core/agents/types.d.ts +63 -0
- package/dist/core/agents/types.d.ts.map +1 -0
- package/dist/core/index.d.ts +25 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +15 -9
- package/dist/core/kernel/middleware.d.ts +28 -0
- package/dist/core/kernel/middleware.d.ts.map +1 -0
- package/dist/core/kernel/trellis-kernel.d.ts +162 -0
- package/dist/core/kernel/trellis-kernel.d.ts.map +1 -0
- package/dist/core/ontology/builtins.d.ts +16 -0
- package/dist/core/ontology/builtins.d.ts.map +1 -0
- package/dist/core/ontology/index.d.ts +10 -0
- package/dist/core/ontology/index.d.ts.map +1 -0
- package/dist/core/ontology/registry.d.ts +70 -0
- package/dist/core/ontology/registry.d.ts.map +1 -0
- package/dist/core/ontology/types.d.ts +97 -0
- package/dist/core/ontology/types.d.ts.map +1 -0
- package/dist/core/ontology/validator.d.ts +34 -0
- package/dist/core/ontology/validator.d.ts.map +1 -0
- package/dist/core/persist/backend.d.ts +60 -0
- package/dist/core/persist/backend.d.ts.map +1 -0
- package/dist/core/persist/sqlite-backend.d.ts +41 -0
- package/dist/core/persist/sqlite-backend.d.ts.map +1 -0
- package/dist/core/plugins/index.d.ts +8 -0
- package/dist/core/plugins/index.d.ts.map +1 -0
- package/dist/core/plugins/registry.d.ts +69 -0
- package/dist/core/plugins/registry.d.ts.map +1 -0
- package/dist/core/plugins/types.d.ts +87 -0
- package/dist/core/plugins/types.d.ts.map +1 -0
- package/dist/core/query/datalog.d.ts +52 -0
- package/dist/core/query/datalog.d.ts.map +1 -0
- package/dist/core/query/engine.d.ts +42 -0
- package/dist/core/query/engine.d.ts.map +1 -0
- package/dist/core/query/index.d.ts +12 -0
- package/dist/core/query/index.d.ts.map +1 -0
- package/dist/core/query/parser.d.ts +37 -0
- package/dist/core/query/parser.d.ts.map +1 -0
- package/dist/core/query/types.d.ts +135 -0
- package/dist/core/query/types.d.ts.map +1 -0
- package/dist/core/store/eav-store.d.ts +107 -0
- package/dist/core/store/eav-store.d.ts.map +1 -0
- package/dist/db/index.d.ts +18 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +83 -0
- package/dist/db/inspector.js +28 -0
- package/dist/db/trellis.css +1 -0
- package/dist/decisions/auto-capture.d.ts +31 -0
- package/dist/decisions/auto-capture.d.ts.map +1 -0
- package/dist/decisions/hooks.d.ts +48 -0
- package/dist/decisions/hooks.d.ts.map +1 -0
- package/dist/decisions/index.d.ts +36 -0
- package/dist/decisions/index.d.ts.map +1 -0
- package/dist/decisions/types.d.ts +73 -0
- package/dist/decisions/types.d.ts.map +1 -0
- package/dist/deploy-99j5dc9c.js +9 -0
- package/dist/embeddings/auto-embed.d.ts +52 -0
- package/dist/embeddings/auto-embed.d.ts.map +1 -0
- package/dist/embeddings/chunker.d.ts +73 -0
- package/dist/embeddings/chunker.d.ts.map +1 -0
- package/dist/embeddings/index.d.ts +18 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/model.d.ts +30 -0
- package/dist/embeddings/model.d.ts.map +1 -0
- package/dist/embeddings/search.d.ts +87 -0
- package/dist/embeddings/search.d.ts.map +1 -0
- package/dist/embeddings/store.d.ts +66 -0
- package/dist/embeddings/store.d.ts.map +1 -0
- package/dist/embeddings/types.d.ts +54 -0
- package/dist/embeddings/types.d.ts.map +1 -0
- package/dist/engine-y0724kjq.js +8 -0
- package/dist/engine.d.ts +216 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/garden/cluster.d.ts +57 -0
- package/dist/garden/cluster.d.ts.map +1 -0
- package/dist/garden/garden.d.ts +104 -0
- package/dist/garden/garden.d.ts.map +1 -0
- package/dist/garden/index.d.ts +15 -0
- package/dist/garden/index.d.ts.map +1 -0
- package/dist/git/git-exporter.d.ts +37 -0
- package/dist/git/git-exporter.d.ts.map +1 -0
- package/dist/git/git-importer.d.ts +36 -0
- package/dist/git/git-importer.d.ts.map +1 -0
- package/dist/git/git-reader.d.ts +63 -0
- package/dist/git/git-reader.d.ts.map +1 -0
- package/dist/git/index.d.ts +10 -0
- package/dist/git/index.d.ts.map +1 -0
- package/dist/identity/governance.d.ts +54 -0
- package/dist/identity/governance.d.ts.map +1 -0
- package/dist/identity/identity.d.ts +63 -0
- package/dist/identity/identity.d.ts.map +1 -0
- package/dist/identity/index.d.ts +10 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/signing-middleware.d.ts +38 -0
- package/dist/identity/signing-middleware.d.ts.map +1 -0
- package/dist/import-fyg5sgq4.js +11 -0
- package/dist/{index-5m0g9r0y.js → index-04sq3h27.js} +1 -496
- package/dist/index-2r4jxwnb.js +32 -0
- package/dist/index-4beszbgg.js +292 -0
- package/dist/index-5bhe57y9.js +326 -0
- package/dist/index-5p6zgspx.js +77 -0
- package/dist/index-7t92ej34.js +544 -0
- package/dist/index-8fjwnztt.js +155 -0
- package/dist/{index-5b01h414.js → index-czecrvvn.js} +9 -9
- package/dist/index-hgd30epa.js +149 -0
- package/dist/index-k5b0xskw.js +1 -0
- package/dist/index-kbnht9p8.js +1 -0
- package/dist/index-n9f2qyh5.js +495 -0
- package/dist/index-xr7rx360.js +814 -0
- package/dist/index-xzym9w0m.js +43 -0
- package/dist/index-yp88he8n.js +316 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -7
- package/dist/links/index.d.ts +16 -0
- package/dist/links/index.d.ts.map +1 -0
- package/dist/links/lifecycle.d.ts +112 -0
- package/dist/links/lifecycle.d.ts.map +1 -0
- package/dist/links/parser.d.ts +56 -0
- package/dist/links/parser.d.ts.map +1 -0
- package/dist/links/ref-index.d.ts +55 -0
- package/dist/links/ref-index.d.ts.map +1 -0
- package/dist/links/resolver.d.ts +90 -0
- package/dist/links/resolver.d.ts.map +1 -0
- package/dist/links/types.d.ts +70 -0
- package/dist/links/types.d.ts.map +1 -0
- package/dist/mcp/docs.d.ts +18 -0
- package/dist/mcp/docs.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +9 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/server.d.ts +26 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/react/index.js +189 -0
- package/dist/sdk-sj8rp0m7.js +15 -0
- package/dist/semantic/csharp-parser.d.ts +12 -0
- package/dist/semantic/csharp-parser.d.ts.map +1 -0
- package/dist/semantic/go-parser.d.ts +12 -0
- package/dist/semantic/go-parser.d.ts.map +1 -0
- package/dist/semantic/index.d.ts +22 -0
- package/dist/semantic/index.d.ts.map +1 -0
- package/dist/semantic/java-parser.d.ts +12 -0
- package/dist/semantic/java-parser.d.ts.map +1 -0
- package/dist/semantic/python-parser.d.ts +12 -0
- package/dist/semantic/python-parser.d.ts.map +1 -0
- package/dist/semantic/ruby-parser.d.ts +12 -0
- package/dist/semantic/ruby-parser.d.ts.map +1 -0
- package/dist/semantic/rust-parser.d.ts +12 -0
- package/dist/semantic/rust-parser.d.ts.map +1 -0
- package/dist/semantic/semantic-merge.d.ts +20 -0
- package/dist/semantic/semantic-merge.d.ts.map +1 -0
- package/dist/semantic/ts-parser.d.ts +13 -0
- package/dist/semantic/ts-parser.d.ts.map +1 -0
- package/dist/semantic/types.d.ts +130 -0
- package/dist/semantic/types.d.ts.map +1 -0
- package/dist/server/auth.d.ts +72 -0
- package/dist/server/auth.d.ts.map +1 -0
- package/dist/server/deploy.d.ts +44 -0
- package/dist/server/deploy.d.ts.map +1 -0
- package/dist/server/import.d.ts +40 -0
- package/dist/server/import.d.ts.map +1 -0
- package/dist/server/index.d.ts +24 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +60 -0
- package/dist/server/permissions.d.ts +84 -0
- package/dist/server/permissions.d.ts.map +1 -0
- package/dist/server/realtime.d.ts +78 -0
- package/dist/server/realtime.d.ts.map +1 -0
- package/dist/server/server.d.ts +43 -0
- package/dist/server/server.d.ts.map +1 -0
- package/dist/server/tenancy.d.ts +53 -0
- package/dist/server/tenancy.d.ts.map +1 -0
- package/dist/server-3vkpnpbz.js +11 -0
- package/dist/sync/http-transport.d.ts +47 -0
- package/dist/sync/http-transport.d.ts.map +1 -0
- package/dist/sync/index.d.ts +22 -0
- package/dist/sync/index.d.ts.map +1 -0
- package/dist/sync/memory-transport.d.ts +27 -0
- package/dist/sync/memory-transport.d.ts.map +1 -0
- package/dist/sync/multi-repo.d.ts +82 -0
- package/dist/sync/multi-repo.d.ts.map +1 -0
- package/dist/sync/reconciler.d.ts +48 -0
- package/dist/sync/reconciler.d.ts.map +1 -0
- package/dist/sync/sync-engine.d.ts +65 -0
- package/dist/sync/sync-engine.d.ts.map +1 -0
- package/dist/sync/types.d.ts +71 -0
- package/dist/sync/types.d.ts.map +1 -0
- package/dist/sync/ws-transport.d.ts +41 -0
- package/dist/sync/ws-transport.d.ts.map +1 -0
- package/dist/tenancy-tjr7kk2v.js +13 -0
- package/dist/ui/server.d.ts +38 -0
- package/dist/ui/server.d.ts.map +1 -0
- package/dist/vcs/blob-store.d.ts +49 -0
- package/dist/vcs/blob-store.d.ts.map +1 -0
- package/dist/vcs/branch.d.ts +35 -0
- package/dist/vcs/branch.d.ts.map +1 -0
- package/dist/vcs/checkpoint.d.ts +24 -0
- package/dist/vcs/checkpoint.d.ts.map +1 -0
- package/dist/vcs/decompose.d.ts +19 -0
- package/dist/vcs/decompose.d.ts.map +1 -0
- package/dist/vcs/diff.d.ts +65 -0
- package/dist/vcs/diff.d.ts.map +1 -0
- package/dist/vcs/engine-context.d.ts +21 -0
- package/dist/vcs/engine-context.d.ts.map +1 -0
- package/dist/vcs/index.d.ts +23 -0
- package/dist/vcs/index.d.ts.map +1 -0
- package/dist/vcs/issue.d.ts +159 -0
- package/dist/vcs/issue.d.ts.map +1 -0
- package/dist/vcs/merge.d.ts +55 -0
- package/dist/vcs/merge.d.ts.map +1 -0
- package/dist/vcs/milestone.d.ts +30 -0
- package/dist/vcs/milestone.d.ts.map +1 -0
- package/dist/vcs/ops.d.ts +27 -0
- package/dist/vcs/ops.d.ts.map +1 -0
- package/dist/vcs/types.d.ts +94 -0
- package/dist/vcs/types.d.ts.map +1 -0
- package/dist/vcs/vcs-middleware.d.ts +14 -0
- package/dist/vcs/vcs-middleware.d.ts.map +1 -0
- package/dist/watcher/fs-watcher.d.ts +51 -0
- package/dist/watcher/fs-watcher.d.ts.map +1 -0
- package/dist/watcher/index.d.ts +9 -0
- package/dist/watcher/index.d.ts.map +1 -0
- package/dist/watcher/ingestion.d.ts +28 -0
- package/dist/watcher/ingestion.d.ts.map +1 -0
- package/package.json +44 -4
- package/dist/index-hybgxe40.js +0 -1174
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trellis Client — TypeScript SDK
|
|
3
|
+
*
|
|
4
|
+
* Isomorphic client that works in two modes:
|
|
5
|
+
*
|
|
6
|
+
* Local — embeds TrellisKernel directly (Node/Bun only, zero network)
|
|
7
|
+
* Remote — calls the Trellis Server HTTP API (works anywhere, including browsers)
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* // Local (embeds SQLite kernel)
|
|
11
|
+
* const db = new TrellisClient({ path: './.trellis-db' });
|
|
12
|
+
*
|
|
13
|
+
* // Remote (hits HTTP server or Sprites deployment)
|
|
14
|
+
* const db = new TrellisClient({ url: 'https://myapp.sprites.app', apiKey: '...' });
|
|
15
|
+
*
|
|
16
|
+
* // Auto (reads .trellis-db.json from cwd)
|
|
17
|
+
* const db = await TrellisClient.fromConfig();
|
|
18
|
+
*
|
|
19
|
+
* @module trellis/client
|
|
20
|
+
*/
|
|
21
|
+
export interface EntityData {
|
|
22
|
+
id: string;
|
|
23
|
+
type: string;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface ListResult<T = EntityData> {
|
|
27
|
+
data: T[];
|
|
28
|
+
total: number;
|
|
29
|
+
limit: number;
|
|
30
|
+
offset: number;
|
|
31
|
+
}
|
|
32
|
+
export interface QueryResult {
|
|
33
|
+
bindings: Record<string, unknown>[];
|
|
34
|
+
executionTime: number;
|
|
35
|
+
}
|
|
36
|
+
export interface UploadResult {
|
|
37
|
+
hash: string;
|
|
38
|
+
size: number;
|
|
39
|
+
contentType: string;
|
|
40
|
+
}
|
|
41
|
+
export interface AuthResult {
|
|
42
|
+
token: string;
|
|
43
|
+
userId: string;
|
|
44
|
+
}
|
|
45
|
+
export interface Subscription<T = EntityData> {
|
|
46
|
+
unsubscribe(): void;
|
|
47
|
+
}
|
|
48
|
+
export type SubscriptionCallback<T = EntityData> = (result: T[], diff: {
|
|
49
|
+
added: T[];
|
|
50
|
+
updated: T[];
|
|
51
|
+
removed: T[];
|
|
52
|
+
}) => void;
|
|
53
|
+
export interface TrellisDbLocalOptions {
|
|
54
|
+
/** Path to the SQLite database directory. */
|
|
55
|
+
path: string;
|
|
56
|
+
/** Agent ID for attributing ops. Default: 'sdk'. */
|
|
57
|
+
agentId?: string;
|
|
58
|
+
/** Tenant ID (multi-tenant mode). */
|
|
59
|
+
tenantId?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface TrellisDbRemoteOptions {
|
|
62
|
+
/** Base URL of the Trellis DB server. */
|
|
63
|
+
url: string;
|
|
64
|
+
/** API key or JWT for authentication. */
|
|
65
|
+
apiKey?: string;
|
|
66
|
+
/** Tenant ID (passed as query param if not in JWT). */
|
|
67
|
+
tenantId?: string;
|
|
68
|
+
}
|
|
69
|
+
export type TrellisDbOptions = TrellisDbLocalOptions | TrellisDbRemoteOptions;
|
|
70
|
+
export declare class TrellisDb {
|
|
71
|
+
private opts;
|
|
72
|
+
private _pool;
|
|
73
|
+
private _ws;
|
|
74
|
+
private _subCallbacks;
|
|
75
|
+
constructor(opts: TrellisDbOptions);
|
|
76
|
+
/**
|
|
77
|
+
* Create a TrellisDb instance from `.trellis-db.json` in the given directory.
|
|
78
|
+
*/
|
|
79
|
+
static fromConfig(dir?: string): TrellisDb;
|
|
80
|
+
/**
|
|
81
|
+
* Create a new entity.
|
|
82
|
+
* Returns the generated entity ID.
|
|
83
|
+
*/
|
|
84
|
+
create(type: string, attributes?: Record<string, unknown>, links?: Array<{
|
|
85
|
+
attribute: string;
|
|
86
|
+
targetEntityId: string;
|
|
87
|
+
}>): Promise<string>;
|
|
88
|
+
/**
|
|
89
|
+
* Read an entity by ID.
|
|
90
|
+
* Returns null if not found.
|
|
91
|
+
*/
|
|
92
|
+
read<T extends EntityData = EntityData>(id: string): Promise<T | null>;
|
|
93
|
+
/**
|
|
94
|
+
* Update an entity's attributes (partial update).
|
|
95
|
+
*/
|
|
96
|
+
update(id: string, attributes: Record<string, unknown>): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Delete an entity by ID.
|
|
99
|
+
*/
|
|
100
|
+
delete(id: string): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* List entities of a given type.
|
|
103
|
+
*/
|
|
104
|
+
list<T extends EntityData = EntityData>(type?: string, opts?: {
|
|
105
|
+
limit?: number;
|
|
106
|
+
offset?: number;
|
|
107
|
+
filters?: Record<string, unknown>;
|
|
108
|
+
}): Promise<ListResult<T>>;
|
|
109
|
+
/**
|
|
110
|
+
* Run an EQL-S query string.
|
|
111
|
+
*/
|
|
112
|
+
query(eql: string): Promise<QueryResult>;
|
|
113
|
+
/**
|
|
114
|
+
* Upload a file to the blob store.
|
|
115
|
+
* Returns a content-addressed hash.
|
|
116
|
+
*/
|
|
117
|
+
upload(data: Uint8Array | ArrayBuffer, contentType?: string): Promise<UploadResult>;
|
|
118
|
+
/**
|
|
119
|
+
* Download a file by its blob hash.
|
|
120
|
+
*/
|
|
121
|
+
getFile(hash: string): Promise<Uint8Array | null>;
|
|
122
|
+
register(email: string, password: string, name?: string): Promise<AuthResult>;
|
|
123
|
+
login(email: string, password: string): Promise<AuthResult>;
|
|
124
|
+
/**
|
|
125
|
+
* Set the active API key / JWT token for subsequent requests.
|
|
126
|
+
*/
|
|
127
|
+
setToken(token: string): void;
|
|
128
|
+
/**
|
|
129
|
+
* Subscribe to a live EQL-S query.
|
|
130
|
+
* Callback is fired immediately with the initial result, then on every update.
|
|
131
|
+
*
|
|
132
|
+
* Requires remote mode (WebSocket to server).
|
|
133
|
+
*/
|
|
134
|
+
subscribe<T = EntityData>(eql: string, callback: SubscriptionCallback<T>): Subscription<T>;
|
|
135
|
+
/**
|
|
136
|
+
* Close the WebSocket connection.
|
|
137
|
+
*/
|
|
138
|
+
disconnect(): void;
|
|
139
|
+
/**
|
|
140
|
+
* Close local kernel pool connections.
|
|
141
|
+
*/
|
|
142
|
+
close(): void;
|
|
143
|
+
private _getPool;
|
|
144
|
+
private _fetch;
|
|
145
|
+
private _ensureWs;
|
|
146
|
+
}
|
|
147
|
+
export declare class FetchError extends Error {
|
|
148
|
+
status: number;
|
|
149
|
+
body?: unknown | undefined;
|
|
150
|
+
constructor(status: number, message: string, body?: unknown | undefined);
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/client/sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAUH,MAAM,WAAW,UAAU;IACzB,EAAE,E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ateConfig,
|
|
9
|
+
writeConfig
|
|
10
|
+
} from "./index-xzym9w0m.js";
|
|
11
|
+
import"./index-a76rekgs.js";
|
|
12
|
+
export {
|
|
13
|
+
writeConfig,
|
|
14
|
+
updateConfig,
|
|
15
|
+
readConfig,
|
|
16
|
+
hasConfig,
|
|
17
|
+
defaultLocalConfig,
|
|
18
|
+
configPath,
|
|
19
|
+
CONFIG_FILE
|
|
20
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Harness — Runtime for managing agent definitions, runs, and decisions.
|
|
3
|
+
*
|
|
4
|
+
* Loads agent definitions from the graph (TrellisKernel), manages tool
|
|
5
|
+
* registrations, executes runs, and records decision traces as kernel entities.
|
|
6
|
+
*
|
|
7
|
+
* @module trellis/core/agents
|
|
8
|
+
*/
|
|
9
|
+
import type { TrellisKernel } from '../kernel/trellis-kernel.js';
|
|
10
|
+
import type { AgentDef, ToolDef, ToolHandler, ToolResult, AgentRun, DecisionTrace, AgentHarnessConfig } from './types.js';
|
|
11
|
+
export declare class AgentHarness {
|
|
12
|
+
private kernel;
|
|
13
|
+
private toolHandlers;
|
|
14
|
+
private config;
|
|
15
|
+
private runCounter;
|
|
16
|
+
constructor(kernel: TrellisKernel, config?: AgentHarnessConfig);
|
|
17
|
+
createAgent(def: Omit<AgentDef, 'id' | 'capabilities' | 'tools'> & {
|
|
18
|
+
id?: string;
|
|
19
|
+
capabilities?: string[];
|
|
20
|
+
tools?: string[];
|
|
21
|
+
}): Promise<AgentDef>;
|
|
22
|
+
getAgent(id: string): AgentDef | null;
|
|
23
|
+
listAgents(status?: AgentDef['status']): AgentDef[];
|
|
24
|
+
registerTool(def: Omit<ToolDef, 'id'> & {
|
|
25
|
+
id?: string;
|
|
26
|
+
}, handler: ToolHandler): Promise<string>;
|
|
27
|
+
getToolHandler(toolId: string): ToolHandler | undefined;
|
|
28
|
+
listTools(): ToolDef[];
|
|
29
|
+
startRun(agentId: string, input?: string): Promise<string>;
|
|
30
|
+
completeRun(runId: string, output?: string, tokenCount?: number): Promise<void>;
|
|
31
|
+
failRun(runId: string, error: string): Promise<void>;
|
|
32
|
+
getRun(runId: string): AgentRun | null;
|
|
33
|
+
listRuns(agentId?: string): AgentRun[];
|
|
34
|
+
recordDecision(runId: string, toolName: string, input?: Record<string, unknown>, output?: string, opts?: {
|
|
35
|
+
rationale?: string;
|
|
36
|
+
alternatives?: string[];
|
|
37
|
+
relatedEntities?: string[];
|
|
38
|
+
}): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Invoke a registered tool within a run, auto-recording a decision trace.
|
|
41
|
+
*/
|
|
42
|
+
invokeTool(runId: string, toolId: string, input: Record<string, unknown>, opts?: {
|
|
43
|
+
rationale?: string;
|
|
44
|
+
relatedEntities?: string[];
|
|
45
|
+
}): Promise<ToolResult>;
|
|
46
|
+
getDecisionChain(entityId: string): DecisionTrace[];
|
|
47
|
+
private _buildDecisionTrace;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness.d.ts","sourceRoot":"","sources":["../../../src/core/agents/harness.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EACV,QAAQ,EACR,OAAO,EACP,WAAW,EACX,UAAU,EACV,QAAQ,EACR,aAAa,EAEb,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAMpB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,YAAY,CAAuC;IAC3D,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,UAAU,CAAa;gBAEnB,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,kBAAkB;IAaxD,WAAW,CACf,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,cAAc,G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AAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;KAC5B,GACA,OAAO,CAAC,MAAM,CAAC;IA8BlB;;OAEG;IACG,UAAU,CACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GACxD,OAAO,CAAC,UAAU,CAAC;IAyBtB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,aAAa,EAAE;IAanD,OAAO,CAAC,mBAAmB;CA4C5B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent System — Public API Surface
|
|
3
|
+
*
|
|
4
|
+
* @module trellis/core/agents
|
|
5
|
+
*/
|
|
6
|
+
export { AgentHarness } from './harness.js';
|
|
7
|
+
export type { AgentDef, ToolDef, ToolHandler, ToolResult, AgentRun, DecisionTrace, RunStatus, AgentHarnessConfig, } from './types.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/agents/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,YAAY,EACV,QAAQ,EACR,OAAO,EACP,WAAW,EACX,UAAU,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent System Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the generic agent harness that loads agent definitions
|
|
5
|
+
* from the graph, manages runs, and records decision traces.
|
|
6
|
+
*
|
|
7
|
+
* @module trellis/core/agents
|
|
8
|
+
*/
|
|
9
|
+
export interface AgentDef {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
model?: string;
|
|
14
|
+
provider?: string;
|
|
15
|
+
systemPrompt?: string;
|
|
16
|
+
status: 'active' | 'inactive' | 'deprecated';
|
|
17
|
+
capabilities: string[];
|
|
18
|
+
tools: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface ToolDef {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
schema?: string;
|
|
25
|
+
endpoint?: string;
|
|
26
|
+
}
|
|
27
|
+
export type ToolHandler = (input: Record<string, unknown>) => Promise<ToolResult>;
|
|
28
|
+
export interface ToolResult {
|
|
29
|
+
success: boolean;
|
|
30
|
+
output: unknown;
|
|
31
|
+
error?: string;
|
|
32
|
+
}
|
|
33
|
+
export type RunStatus = 'running' | 'completed' | 'failed' | 'cancelled';
|
|
34
|
+
export interface AgentRun {
|
|
35
|
+
id: string;
|
|
36
|
+
agentId: string;
|
|
37
|
+
startedAt: string;
|
|
38
|
+
completedAt?: string;
|
|
39
|
+
status: RunStatus;
|
|
40
|
+
input?: string;
|
|
41
|
+
output?: string;
|
|
42
|
+
tokenCount?: number;
|
|
43
|
+
decisions: DecisionTrace[];
|
|
44
|
+
}
|
|
45
|
+
export interface DecisionTrace {
|
|
46
|
+
id: string;
|
|
47
|
+
runId: string;
|
|
48
|
+
agentId: string;
|
|
49
|
+
toolName: string;
|
|
50
|
+
input?: Record<string, unknown>;
|
|
51
|
+
output?: string;
|
|
52
|
+
rationale?: string;
|
|
53
|
+
alternatives?: string[];
|
|
54
|
+
timestamp: string;
|
|
55
|
+
relatedEntities?: string[];
|
|
56
|
+
}
|
|
57
|
+
export interface AgentHarnessConfig {
|
|
58
|
+
/** Whether to auto-record decision traces on tool invocations. */
|
|
59
|
+
recordDecisions?: boolean;
|
|
60
|
+
/** Maximum decisions per run before auto-stopping. */
|
|
61
|
+
maxDecisionsPerRun?: number;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/agents/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAC;IAC7C,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAMD,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAElF,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEzE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,aAAa,EAAE,CAAC;CAC5B;AAMD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAMD,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TrellisVCS Core — EAV Store, Kernel, Persistence, Middleware
|
|
3
|
+
*
|
|
4
|
+
* Inlined from trellis-core for single-package publish.
|
|
5
|
+
* Consumers: `import { EAVStore, Fact, TrellisKernel } from 'trellis/core'`
|
|
6
|
+
*
|
|
7
|
+
* @module trellis/core
|
|
8
|
+
*/
|
|
9
|
+
export { EAVStore, flatten, jsonEntityFacts } from './store/eav-store.js';
|
|
10
|
+
export type { Atom, EntityRef, Fact, Link, CatalogEntry, QueryTraceEntry, QueryResult, } from './store/eav-store.js';
|
|
11
|
+
export type { KernelOp, KernelOpKind, KernelBackend, } from './persist/backend.js';
|
|
12
|
+
export type { KernelMiddleware, MiddlewareContext, OpMiddlewareNext, } from './kernel/middleware.js';
|
|
13
|
+
export { SqliteKernelBackend } from './persist/sqlite-backend.js';
|
|
14
|
+
export { QueryEngine, parseQuery, parseRule, parseSimple, DatalogRuntime, } from './query/index.js';
|
|
15
|
+
export type { Query, Pattern, FactPattern, LinkPattern, Term, Variable, Literal, Filter, FilterOp, Aggregate, OrderBy, Bindings, DatalogRule, } from './query/index.js';
|
|
16
|
+
export { OntologyRegistry, validateEntity, validateStore, createValidationMiddleware, } from './ontology/index.js';
|
|
17
|
+
export { projectOntology, teamOntology, agentOntology, builtinOntologies, } from './ontology/index.js';
|
|
18
|
+
export type { AttrType, AttributeDef, RelationDef, EntityDef, OntologySchema, ValidationError, ValidationResult, } from './ontology/index.js';
|
|
19
|
+
export { AgentHarness } from './agents/index.js';
|
|
20
|
+
export type { AgentDef, ToolDef, ToolHandler, ToolResult, AgentRun, DecisionTrace, RunStatus, AgentHarnessConfig, } from './agents/index.js';
|
|
21
|
+
export { PluginRegistry, EventBus } from './plugins/index.js';
|
|
22
|
+
export type { PluginDef, PluginContext, PluginManifest, EventCallback, EventHandler, WellKnownEvent, WorkspaceConfig, } from './plugins/index.js';
|
|
23
|
+
export { TrellisKernel } from './kernel/trellis-kernel.js';
|
|
24
|
+
export type { KernelConfig, MutateResult, EntityRecord, } from './kernel/trellis-kernel.js';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE1E,YAAY,EACV,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,eAAe,EACf,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EACV,QAAQ,EAC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BAA4B,CAAC"}
|
package/dist/core/index.js
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
DatalogRuntime,
|
|
4
3
|
OntologyRegistry,
|
|
5
4
|
agentOntology,
|
|
6
5
|
builtinOntologies,
|
|
7
6
|
createValidationMiddleware,
|
|
8
|
-
parseQuery,
|
|
9
|
-
parseRule,
|
|
10
|
-
parseSimple,
|
|
11
7
|
projectOntology,
|
|
12
8
|
teamOntology,
|
|
13
9
|
validateEntity,
|
|
14
10
|
validateStore
|
|
15
|
-
} from "../index-
|
|
11
|
+
} from "../index-04sq3h27.js";
|
|
12
|
+
import {
|
|
13
|
+
DatalogRuntime,
|
|
14
|
+
parseQuery,
|
|
15
|
+
parseRule,
|
|
16
|
+
parseSimple
|
|
17
|
+
} from "../index-n9f2qyh5.js";
|
|
16
18
|
import {
|
|
17
|
-
EAVStore,
|
|
18
|
-
QueryEngine,
|
|
19
19
|
SqliteKernelBackend,
|
|
20
|
-
TrellisKernel
|
|
20
|
+
TrellisKernel
|
|
21
|
+
} from "../index-7t92ej34.js";
|
|
22
|
+
import {
|
|
23
|
+
EAVStore,
|
|
21
24
|
flatten,
|
|
22
25
|
init_eav_store,
|
|
23
26
|
jsonEntityFacts
|
|
24
|
-
} from "../index-
|
|
27
|
+
} from "../index-5bhe57y9.js";
|
|
28
|
+
import {
|
|
29
|
+
QueryEngine
|
|
30
|
+
} from "../index-yp88he8n.js";
|
|
25
31
|
import"../index-a76rekgs.js";
|
|
26
32
|
|
|
27
33
|
// src/core/index.ts
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kernel middleware types.
|
|
3
|
+
* Slim version inlined from trellis-core — only includes the types
|
|
4
|
+
* used by the VCS layer (op middleware). Query middleware types are
|
|
5
|
+
* omitted to avoid pulling in the full query engine dependency chain.
|
|
6
|
+
*
|
|
7
|
+
* @module trellis/core
|
|
8
|
+
*/
|
|
9
|
+
import type { KernelOp } from '../persist/backend.js';
|
|
10
|
+
export type MiddlewareContext = {
|
|
11
|
+
agentId?: string;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
export type OpMiddlewareNext = (op: KernelOp, ctx: MiddlewareContext) => void | Promise<void>;
|
|
15
|
+
export interface KernelMiddleware {
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Hook into kernel operations (mutations).
|
|
19
|
+
* Can throw to block the operation (e.g. for security).
|
|
20
|
+
*/
|
|
21
|
+
handleOp?: (op: KernelOp, ctx: MiddlewareContext, next: OpMiddlewareNext) => void | Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Hook into kernel queries.
|
|
24
|
+
* Typed loosely here to avoid importing the full query engine.
|
|
25
|
+
*/
|
|
26
|
+
handleQuery?: (query: unknown, ctx: MiddlewareContext, next: (...args: any[]) => any) => any;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../../src/core/kernel/middleware.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAC7B,EAAE,EAAE,QAAQ,EACZ,GAAG,EAAE,iBAAiB,KACnB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,QAAQ,CAAC,EAAE,CACT,EAAE,EAAE,QAAQ,EACZ,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAE,gBAAgB,KACnB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;OAGG;IACH,WAAW,CAAC,EAAE,CACZ,KAAK,EAAE,OAAO,EACd,GAAG,EAAE,iBAAiB,EACtB,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,KAC1B,GAAG,CAAC;CACV"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TrellisKernel — Generic Graph Kernel
|
|
3
|
+
*
|
|
4
|
+
* The composition root for the Trellis semantic kernel. Orchestrates the
|
|
5
|
+
* EAV store, persistence backend, middleware chain, and snapshot lifecycle.
|
|
6
|
+
*
|
|
7
|
+
* The VCS engine (`TrellisVcsEngine`) sits on top of this generic kernel.
|
|
8
|
+
* Non-VCS consumers can use TrellisKernel directly for pure graph CRUD.
|
|
9
|
+
*
|
|
10
|
+
* @module trellis/core
|
|
11
|
+
*/
|
|
12
|
+
import { EAVStore } from '../store/eav-store.js';
|
|
13
|
+
import type { Fact, Link, Atom } from '../store/eav-store.js';
|
|
14
|
+
import type { KernelOp, KernelOpKind, KernelBackend } from '../persist/backend.js';
|
|
15
|
+
import type { KernelMiddleware, MiddlewareContext } from './middleware.js';
|
|
16
|
+
import { QueryEngine } from '../query/engine.js';
|
|
17
|
+
import type { Query } from '../query/types.js';
|
|
18
|
+
import type { QueryResult } from '../query/engine.js';
|
|
19
|
+
export interface KernelConfig {
|
|
20
|
+
/** Persistence backend (SQLite or in-memory). */
|
|
21
|
+
backend: KernelBackend;
|
|
22
|
+
/** Agent ID for attributing operations. */
|
|
23
|
+
agentId: string;
|
|
24
|
+
/** Middleware chain applied to every mutation. */
|
|
25
|
+
middleware?: KernelMiddleware[];
|
|
26
|
+
/** Auto-snapshot after this many ops (0 = disabled). */
|
|
27
|
+
snapshotThreshold?: number;
|
|
28
|
+
}
|
|
29
|
+
export interface MutateResult {
|
|
30
|
+
op: KernelOp;
|
|
31
|
+
factsDelta: {
|
|
32
|
+
added: number;
|
|
33
|
+
deleted: number;
|
|
34
|
+
};
|
|
35
|
+
linksDelta: {
|
|
36
|
+
added: number;
|
|
37
|
+
deleted: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface EntityRecord {
|
|
41
|
+
id: string;
|
|
42
|
+
type: string;
|
|
43
|
+
facts: Fact[];
|
|
44
|
+
links: Link[];
|
|
45
|
+
}
|
|
46
|
+
export declare class TrellisKernel {
|
|
47
|
+
private store;
|
|
48
|
+
private backend;
|
|
49
|
+
private middleware;
|
|
50
|
+
private agentId;
|
|
51
|
+
private snapshotThreshold;
|
|
52
|
+
private opsSinceSnapshot;
|
|
53
|
+
private _booted;
|
|
54
|
+
constructor(config: KernelConfig);
|
|
55
|
+
/**
|
|
56
|
+
* Initialize the backend and replay persisted state.
|
|
57
|
+
* Loads latest snapshot if available, then replays ops after it.
|
|
58
|
+
*/
|
|
59
|
+
boot(): {
|
|
60
|
+
opsReplayed: number;
|
|
61
|
+
fromSnapshot: boolean;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Close the backend connection.
|
|
65
|
+
*/
|
|
66
|
+
close(): void;
|
|
67
|
+
isBooted(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Apply a mutation to the graph. Creates an op, runs it through middleware,
|
|
70
|
+
* decomposes into EAV primitives, persists, and returns the result.
|
|
71
|
+
*/
|
|
72
|
+
mutate(kind: KernelOpKind | string, payload: {
|
|
73
|
+
facts?: Fact[];
|
|
74
|
+
links?: Link[];
|
|
75
|
+
deleteFacts?: Fact[];
|
|
76
|
+
deleteLinks?: Link[];
|
|
77
|
+
meta?: Record<string, unknown>;
|
|
78
|
+
}, ctx?: Partial<MiddlewareContext>): Promise<MutateResult>;
|
|
79
|
+
/**
|
|
80
|
+
* Create a snapshot of the current store state.
|
|
81
|
+
*/
|
|
82
|
+
checkpoint(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Get the underlying EAV store for direct queries.
|
|
85
|
+
*/
|
|
86
|
+
getStore(): EAVStore;
|
|
87
|
+
/**
|
|
88
|
+
* Get the persistence backend.
|
|
89
|
+
*/
|
|
90
|
+
getBackend(): KernelBackend;
|
|
91
|
+
/**
|
|
92
|
+
* Get the agent ID.
|
|
93
|
+
*/
|
|
94
|
+
getAgentId(): string;
|
|
95
|
+
/**
|
|
96
|
+
* Read all persisted ops.
|
|
97
|
+
*/
|
|
98
|
+
readAllOps(): KernelOp[];
|
|
99
|
+
/**
|
|
100
|
+
* Get the last persisted op.
|
|
101
|
+
*/
|
|
102
|
+
getLastOp(): KernelOp | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Create a QueryEngine bound to this kernel's store.
|
|
105
|
+
*/
|
|
106
|
+
createQueryEngine(): QueryEngine;
|
|
107
|
+
/**
|
|
108
|
+
* Execute an EQL-S query, routing through middleware handleQuery hooks.
|
|
109
|
+
* If no middleware intercepts, the query runs directly against the store.
|
|
110
|
+
*/
|
|
111
|
+
query(q: Query): Promise<QueryResult>;
|
|
112
|
+
/**
|
|
113
|
+
* Time-travel: reconstruct the store state at a specific op hash.
|
|
114
|
+
* Returns a new EAVStore with state replayed up to (and including) that op.
|
|
115
|
+
*/
|
|
116
|
+
timeTravel(opHash: string): EAVStore;
|
|
117
|
+
/**
|
|
118
|
+
* Create a new entity with the given type and attributes.
|
|
119
|
+
* Returns the entity ID.
|
|
120
|
+
*/
|
|
121
|
+
createEntity(entityId: string, type: string, attributes?: Record<string, Atom>, links?: Array<{
|
|
122
|
+
attribute: string;
|
|
123
|
+
targetEntityId: string;
|
|
124
|
+
}>): Promise<MutateResult>;
|
|
125
|
+
/**
|
|
126
|
+
* Get an entity by ID, returning all its facts and links.
|
|
127
|
+
*/
|
|
128
|
+
getEntity(entityId: string): EntityRecord | null;
|
|
129
|
+
/**
|
|
130
|
+
* Update an entity's attributes. Deletes old values and adds new ones.
|
|
131
|
+
*/
|
|
132
|
+
updateEntity(entityId: string, updates: Record<string, Atom>): Promise<MutateResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Delete an entity and all its facts and links.
|
|
135
|
+
*/
|
|
136
|
+
deleteEntity(entityId: string): Promise<MutateResult>;
|
|
137
|
+
/**
|
|
138
|
+
* List entities by type, with optional attribute filters.
|
|
139
|
+
*/
|
|
140
|
+
listEntities(type?: string, filters?: Record<string, Atom>): EntityRecord[];
|
|
141
|
+
/**
|
|
142
|
+
* Add a link between two entities.
|
|
143
|
+
*/
|
|
144
|
+
addLink(sourceId: string, attribute: string, targetId: string): Promise<MutateResult>;
|
|
145
|
+
/**
|
|
146
|
+
* Remove a link between two entities.
|
|
147
|
+
*/
|
|
148
|
+
removeLink(sourceId: string, attribute: string, targetId: string): Promise<MutateResult>;
|
|
149
|
+
/**
|
|
150
|
+
* Add a fact to an entity.
|
|
151
|
+
*/
|
|
152
|
+
addFact(entityId: string, attribute: string, value: Atom): Promise<MutateResult>;
|
|
153
|
+
/**
|
|
154
|
+
* Remove a fact from an entity.
|
|
155
|
+
*/
|
|
156
|
+
removeFact(entityId: string, attribute: string, value: Atom): Promise<MutateResult>;
|
|
157
|
+
addMiddleware(mw: KernelMiddleware): void;
|
|
158
|
+
removeMiddleware(name: string): void;
|
|
159
|
+
private _runMiddleware;
|
|
160
|
+
private _replayOp;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=trellis-kernel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trellis-kernel.d.ts","sourceRoot":"","sources":["../../../src/core/kernel/trellis-kernel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,gBAAg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ACG,YAAY,CAChB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAC5B,OAAO,CAAC,YAAY,CAAC;IAuBxB;;OAEG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAU3D;;OAEG;IACH,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,YAAY,EAAE;IA6B3E;;OAEG;IACG,OAAO,CACX,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC;IAMxB;;OAEG;IACG,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC;IAMxB;;OAEG;IACG,OAAO,CACX,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,IAAI,GACV,OAAO,CAAC,YAAY,CAAC;IAMxB;;OAEG;IACG,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,IAAI,GACV,OAAO,CAAC,YAAY,CAAC;IAUxB,aAAa,CAAC,EAAE,EAAE,gBAAgB,GAAG,IAAI;IAIzC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;YAQtB,cAAc;IAmB5B,OAAO,CAAC,SAAS;CAgBlB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in Ontology Definitions
|
|
3
|
+
*
|
|
4
|
+
* Pre-defined ontologies for common domain models:
|
|
5
|
+
* - Project: software project management entities
|
|
6
|
+
* - Team: team/developer organizational entities
|
|
7
|
+
* - Agent: AI agent entities for the agent harness
|
|
8
|
+
*
|
|
9
|
+
* @module trellis/core/ontology
|
|
10
|
+
*/
|
|
11
|
+
import type { OntologySchema } from './types.js';
|
|
12
|
+
export declare const projectOntology: OntologySchema;
|
|
13
|
+
export declare const teamOntology: OntologySchema;
|
|
14
|
+
export declare const agentOntology: OntologySchema;
|
|
15
|
+
export declare const builtinOntologies: OntologySchema[];
|
|
16
|
+
//# sourceMappingURL=builtins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../../src/core/ontology/builtins.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAMjD,eAAO,MAAM,eAAe,EAAE,cAwF7B,CAAC;AAMF,eAAO,MAAM,YAAY,EAAE,cAqD1B,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,cAmE3B,CAAC;AAMF,eAAO,MAAM,iBAAiB,EAAE,cAAc,EAI7C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ontology Module — Public API Surface
|
|
3
|
+
*
|
|
4
|
+
* @module trellis/core/ontology
|
|
5
|
+
*/
|
|
6
|
+
export type { AttrType, AttributeDef, RelationDef, EntityDef, OntologySchema, ValidationError, ValidationResult, } from './types.js';
|
|
7
|
+
export { OntologyRegistry } from './registry.js';
|
|
8
|
+
export { projectOntology, teamOntology, agentOntology, builtinOntologies, } from './builtins.js';
|
|
9
|
+
export { validateEntity, validateStore, createValidationMiddleware, } from './validator.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/ontology/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,SAAS,EACT,cAAc,EACd,eAAe,EACf,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,cAAc,EACd,aAAa,EACb,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC"}
|