trellis 2.1.7 → 3.0.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/README.md +65 -706
- package/dist/cli/index.d.ts +16 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +3188 -232
- 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/context/heat-map-manager.d.ts +100 -0
- package/dist/context/heat-map-manager.d.ts.map +1 -0
- package/dist/context/manager.d.ts +16 -0
- package/dist/context/manager.d.ts.map +1 -0
- package/dist/context/types.d.ts +20 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/core/agents/harness.d.ts +58 -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 +79 -0
- package/dist/core/agents/types.d.ts.map +1 -0
- package/dist/core/computation/expr-evaluator.d.ts +52 -0
- package/dist/core/computation/expr-evaluator.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 +105 -11
- package/dist/core/kernel/logic-middleware.d.ts +19 -0
- package/dist/core/kernel/logic-middleware.d.ts.map +1 -0
- package/dist/core/kernel/middleware.d.ts +28 -0
- package/dist/core/kernel/middleware.d.ts.map +1 -0
- package/dist/core/kernel/schema-middleware.d.ts +15 -0
- package/dist/core/kernel/schema-middleware.d.ts.map +1 -0
- package/dist/core/kernel/security-middleware.d.ts +24 -0
- package/dist/core/kernel/security-middleware.d.ts.map +1 -0
- package/dist/core/kernel/sync-provider.d.ts +59 -0
- package/dist/core/kernel/sync-provider.d.ts.map +1 -0
- package/dist/core/kernel/trellis-kernel.d.ts +217 -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/core-ontology.d.ts +20 -0
- package/dist/core/ontology/core-ontology.d.ts.map +1 -0
- package/dist/core/ontology/index.d.ts +12 -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 +201 -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 +62 -0
- package/dist/core/persist/backend.d.ts.map +1 -0
- package/dist/core/persist/better-sqlite-backend.d.ts +33 -0
- package/dist/core/persist/better-sqlite-backend.d.ts.map +1 -0
- package/dist/core/persist/sqlite-backend.d.ts +43 -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 +111 -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 +85 -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-999q207z.js +10 -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 +218 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/evals/types.d.ts +29 -0
- package/dist/evals/types.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-s2b8e0ft.js +11 -0
- package/dist/{index-3ejh8k6v.js → index-0q7wbasy.js} +18 -4
- package/dist/index-0zk3fx2s.js +1004 -0
- package/dist/index-2r4jxwnb.js +32 -0
- package/dist/index-6n5dcebj.js +847 -0
- package/dist/index-7e27kvvj.js +292 -0
- package/dist/index-bmyt7k8n.js +90 -0
- package/dist/index-c9h37r6h.js +1 -0
- package/dist/{index-k5kf7sd0.js → index-hmdbnd4n.js} +1 -1
- package/dist/index-k5b0xskw.js +1 -0
- package/dist/index-n9f2qyh5.js +495 -0
- package/dist/{index-22jx9qsz.js → index-q31hfjja.js} +861 -51
- package/dist/index-skhn0agf.js +155 -0
- package/dist/{index-5m0g9r0y.js → index-w7ng765c.js} +4 -497
- package/dist/index-wt8rz4gn.js +132 -0
- package/dist/index-xzym9w0m.js +43 -0
- package/dist/index-y3d71wzd.js +77 -0
- package/dist/index-y6a4kj0p.js +43 -0
- package/dist/index-yhwjgfvj.js +342 -0
- package/dist/index-yp88he8n.js +316 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -9
- 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/llm/provider.d.ts +11 -0
- package/dist/llm/provider.d.ts.map +1 -0
- package/dist/llm/types.d.ts +74 -0
- package/dist/llm/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 +15 -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/orchestration/types.d.ts +22 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/plugins/agent-memory/graph-context-manager.d.ts +75 -0
- package/dist/plugins/agent-memory/graph-context-manager.d.ts.map +1 -0
- package/dist/plugins/agent-memory/index.d.ts +30 -0
- package/dist/plugins/agent-memory/index.d.ts.map +1 -0
- package/dist/plugins/agent-memory/ontology.d.ts +13 -0
- package/dist/plugins/agent-memory/ontology.d.ts.map +1 -0
- package/dist/plugins/agent-memory/plugin.d.ts +17 -0
- package/dist/plugins/agent-memory/plugin.d.ts.map +1 -0
- package/dist/plugins/brand/cache.d.ts +18 -0
- package/dist/plugins/brand/cache.d.ts.map +1 -0
- package/dist/plugins/brand/catalog-generator.d.ts +89 -0
- package/dist/plugins/brand/catalog-generator.d.ts.map +1 -0
- package/dist/plugins/brand/constraints.d.ts +55 -0
- package/dist/plugins/brand/constraints.d.ts.map +1 -0
- package/dist/plugins/brand/index.d.ts +44 -0
- package/dist/plugins/brand/index.d.ts.map +1 -0
- package/dist/plugins/brand/mcp-tools.d.ts +101 -0
- package/dist/plugins/brand/mcp-tools.d.ts.map +1 -0
- package/dist/plugins/brand/ontology.d.ts +13 -0
- package/dist/plugins/brand/ontology.d.ts.map +1 -0
- package/dist/plugins/brand/plugin.d.ts +21 -0
- package/dist/plugins/brand/plugin.d.ts.map +1 -0
- package/dist/plugins/brand/voice-tone.d.ts +24 -0
- package/dist/plugins/brand/voice-tone.d.ts.map +1 -0
- package/dist/plugins/idea-garden/api.d.ts +26 -0
- package/dist/plugins/idea-garden/api.d.ts.map +1 -0
- package/dist/plugins/idea-garden/index.d.ts +12 -0
- package/dist/plugins/idea-garden/index.d.ts.map +1 -0
- package/dist/plugins/idea-garden/plugin.d.ts +16 -0
- package/dist/plugins/idea-garden/plugin.d.ts.map +1 -0
- package/dist/plugins/idea-garden/types.d.ts +22 -0
- package/dist/plugins/idea-garden/types.d.ts.map +1 -0
- package/dist/plugins/plan-approval/index.d.ts +36 -0
- package/dist/plugins/plan-approval/index.d.ts.map +1 -0
- package/dist/plugins/plan-approval/ontology.d.ts +11 -0
- package/dist/plugins/plan-approval/ontology.d.ts.map +1 -0
- package/dist/plugins/plan-approval/plan-manager.d.ts +104 -0
- package/dist/plugins/plan-approval/plan-manager.d.ts.map +1 -0
- package/dist/plugins/plan-approval/plugin.d.ts +110 -0
- package/dist/plugins/plan-approval/plugin.d.ts.map +1 -0
- package/dist/plugins/proactive-watcher/index.d.ts +28 -0
- package/dist/plugins/proactive-watcher/index.d.ts.map +1 -0
- package/dist/plugins/proactive-watcher/ontology.d.ts +8 -0
- package/dist/plugins/proactive-watcher/ontology.d.ts.map +1 -0
- package/dist/plugins/proactive-watcher/plugin.d.ts +20 -0
- package/dist/plugins/proactive-watcher/plugin.d.ts.map +1 -0
- package/dist/plugins/proactive-watcher/watcher-manager.d.ts +36 -0
- package/dist/plugins/proactive-watcher/watcher-manager.d.ts.map +1 -0
- package/dist/plugins/sprite-tools/checkpoint-middleware.d.ts +43 -0
- package/dist/plugins/sprite-tools/checkpoint-middleware.d.ts.map +1 -0
- package/dist/plugins/sprite-tools/index.d.ts +40 -0
- package/dist/plugins/sprite-tools/index.d.ts.map +1 -0
- package/dist/plugins/sprite-tools/plugin.d.ts +69 -0
- package/dist/plugins/sprite-tools/plugin.d.ts.map +1 -0
- package/dist/react/index.js +189 -0
- package/dist/scaffold/index.d.ts +13 -0
- package/dist/scaffold/index.d.ts.map +1 -0
- package/dist/scaffold/infer.d.ts +42 -0
- package/dist/scaffold/infer.d.ts.map +1 -0
- package/dist/scaffold/profile.d.ts +51 -0
- package/dist/scaffold/profile.d.ts.map +1 -0
- package/dist/scaffold/seed.d.ts +27 -0
- package/dist/scaffold/seed.d.ts.map +1 -0
- package/dist/scaffold/write.d.ts +53 -0
- package/dist/scaffold/write.d.ts.map +1 -0
- package/dist/sdk-snn5gad3.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 +26 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +90 -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/sprites.d.ts +26 -0
- package/dist/server/sprites.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/vm-config.d.ts +60 -0
- package/dist/server/vm-config.d.ts.map +1 -0
- package/dist/server-mrctdwzr.js +11 -0
- package/dist/sprites-vc4qbrp1.js +16 -0
- package/dist/streaming/types.d.ts +43 -0
- package/dist/streaming/types.d.ts.map +1 -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-7d1g4ayp.js +13 -0
- package/dist/ui/client.html +460 -664
- package/dist/ui/server.d.ts +42 -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/index.js +2 -2
- 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 +95 -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/vm-config-6xhsj6b3.js +22 -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 +57 -7
- package/dist/index-hybgxe40.js +0 -1174
|
@@ -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,EACR,YA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B,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-w7ng765c.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-0zk3fx2s.js";
|
|
22
|
+
import {
|
|
23
|
+
EAVStore,
|
|
21
24
|
flatten,
|
|
22
25
|
init_eav_store,
|
|
23
26
|
jsonEntityFacts
|
|
24
|
-
} from "../index-
|
|
27
|
+
} from "../index-yhwjgfvj.js";
|
|
28
|
+
import {
|
|
29
|
+
QueryEngine
|
|
30
|
+
} from "../index-yp88he8n.js";
|
|
25
31
|
import"../index-a76rekgs.js";
|
|
26
32
|
|
|
27
33
|
// src/core/index.ts
|
|
@@ -41,6 +47,92 @@ class AgentHarness {
|
|
|
41
47
|
...config
|
|
42
48
|
};
|
|
43
49
|
}
|
|
50
|
+
async runAgentTask(agentId, input, opts) {
|
|
51
|
+
if (!this.config.llmProvider) {
|
|
52
|
+
throw new Error("AgentHarness: No llmProvider configured for autonomous tasks.");
|
|
53
|
+
}
|
|
54
|
+
const agent = this.getAgent(agentId);
|
|
55
|
+
if (!agent)
|
|
56
|
+
throw new Error(`Agent "${agentId}" not found.`);
|
|
57
|
+
const runId = await this.startRun(agentId, input);
|
|
58
|
+
const context = this.config.contextManager;
|
|
59
|
+
if (context && typeof context.createConversation === "function") {
|
|
60
|
+
const gcm = context;
|
|
61
|
+
if (opts?.conversationId) {
|
|
62
|
+
await gcm.resumeConversation(opts.conversationId);
|
|
63
|
+
} else {
|
|
64
|
+
const convId = await gcm.createConversation({
|
|
65
|
+
title: opts?.conversationTitle ?? input.slice(0, 80),
|
|
66
|
+
agentId,
|
|
67
|
+
model: agent.model
|
|
68
|
+
});
|
|
69
|
+
await this.kernel.addLink(runId, "hasConversation", convId);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (context && agent.systemPrompt) {
|
|
73
|
+
context.addMessage({ role: "system", content: agent.systemPrompt });
|
|
74
|
+
}
|
|
75
|
+
if (context) {
|
|
76
|
+
context.addMessage({ role: "user", content: input });
|
|
77
|
+
}
|
|
78
|
+
let turnCount = 0;
|
|
79
|
+
const maxTurns = agent.maxTokens ?? 10;
|
|
80
|
+
try {
|
|
81
|
+
while (turnCount < maxTurns) {
|
|
82
|
+
turnCount++;
|
|
83
|
+
const messages = context ? context.getHistory() : [
|
|
84
|
+
...agent.systemPrompt ? [{ role: "system", content: agent.systemPrompt }] : [],
|
|
85
|
+
{ role: "user", content: input }
|
|
86
|
+
];
|
|
87
|
+
const response = await this.config.llmProvider.complete(messages, {
|
|
88
|
+
model: agent.model,
|
|
89
|
+
temperature: agent.temperature,
|
|
90
|
+
tools: this._getAvailableTools(agent.tools)
|
|
91
|
+
});
|
|
92
|
+
const message = response.choices[0].message;
|
|
93
|
+
if (context)
|
|
94
|
+
context.addMessage(message);
|
|
95
|
+
if (message.tool_calls && message.tool_calls.length > 0) {
|
|
96
|
+
let planPending = false;
|
|
97
|
+
for (const call of message.tool_calls) {
|
|
98
|
+
const result = await this.invokeTool(runId, call.function.name, JSON.parse(call.function.arguments));
|
|
99
|
+
if (context) {
|
|
100
|
+
context.addMessage({
|
|
101
|
+
role: "tool",
|
|
102
|
+
tool_call_id: call.id,
|
|
103
|
+
name: call.function.name,
|
|
104
|
+
content: result.success ? JSON.stringify(result.output) : result.error ?? "Unknown error"
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (result.success && result.output && typeof result.output === "object" && result.output._planPending) {
|
|
108
|
+
planPending = true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (planPending) {
|
|
112
|
+
await this.kernel.updateEntity(runId, { status: "plan_pending" });
|
|
113
|
+
return runId;
|
|
114
|
+
}
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
await this.completeRun(runId, message.content ?? "", response.usage?.total_tokens);
|
|
118
|
+
return runId;
|
|
119
|
+
}
|
|
120
|
+
throw new Error(`Agent run exceeded maximum turns (${maxTurns}).`);
|
|
121
|
+
} catch (err) {
|
|
122
|
+
await this.failRun(runId, err.message);
|
|
123
|
+
throw err;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
_getAvailableTools(toolIds) {
|
|
127
|
+
return this.listTools().filter((t) => toolIds.includes(t.id)).map((t) => ({
|
|
128
|
+
type: "function",
|
|
129
|
+
function: {
|
|
130
|
+
name: t.id,
|
|
131
|
+
description: t.description,
|
|
132
|
+
parameters: t.schema ? JSON.parse(t.schema) : { type: "object", properties: {} }
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
44
136
|
async createAgent(def) {
|
|
45
137
|
const id = def.id ?? `agent:${def.name.toLowerCase().replace(/\s+/g, "-")}`;
|
|
46
138
|
await this.kernel.createEntity(id, "Agent", {
|
|
@@ -132,7 +224,7 @@ class AgentHarness {
|
|
|
132
224
|
if (output)
|
|
133
225
|
updates.output = output;
|
|
134
226
|
if (tokenCount !== undefined)
|
|
135
|
-
updates.
|
|
227
|
+
updates.totalTokens = tokenCount;
|
|
136
228
|
await this.kernel.updateEntity(runId, updates);
|
|
137
229
|
}
|
|
138
230
|
async failRun(runId, error) {
|
|
@@ -161,7 +253,9 @@ class AgentHarness {
|
|
|
161
253
|
status: get("status") ?? "running",
|
|
162
254
|
input: get("input"),
|
|
163
255
|
output: get("output"),
|
|
164
|
-
|
|
256
|
+
totalTokens: get("totalTokens"),
|
|
257
|
+
promptTokens: get("promptTokens"),
|
|
258
|
+
completionTokens: get("completionTokens"),
|
|
165
259
|
decisions
|
|
166
260
|
};
|
|
167
261
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logic Middleware
|
|
3
|
+
*
|
|
4
|
+
* Evaluates computed fields (formula, rollup, ai_generated) after queries.
|
|
5
|
+
* Runs post-query to enrich results with computed values.
|
|
6
|
+
*/
|
|
7
|
+
import type { KernelMiddleware } from './middleware.js';
|
|
8
|
+
import type { SchemaDefinition } from '../ontology/types.js';
|
|
9
|
+
export interface LogicMiddlewareConfig {
|
|
10
|
+
ontologies: Map<string, SchemaDefinition>;
|
|
11
|
+
/** Optional AI function for ai_generated fields */
|
|
12
|
+
generateAiField?: (prompt: string, context: Record<string, unknown>) => Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates a logic middleware that enriches query results with computed fields.
|
|
16
|
+
* This middleware hooks into queries, not mutations.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createLogicMiddleware(config: LogicMiddlewareConfig): KernelMiddleware;
|
|
19
|
+
//# sourceMappingURL=logic-middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logic-middleware.d.ts","sourceRoot":"","sources":["../../../src/core/kernel/logic-middleware.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,mDAAmD;IACnD,eAAe,CAAC,EAAE,CAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC7B,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,qBAAqB,GAC5B,gBAAgB,CA0BlB"}
|
|
@@ -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,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema Validation Middleware
|
|
3
|
+
*
|
|
4
|
+
* Validates mutations against ontology schemas. Blocks operations that
|
|
5
|
+
* violate schema constraints (required fields, type mismatches, etc.).
|
|
6
|
+
*/
|
|
7
|
+
import type { KernelMiddleware } from './middleware.js';
|
|
8
|
+
import type { SchemaDefinition } from '../ontology/types.js';
|
|
9
|
+
export interface SchemaMiddlewareConfig {
|
|
10
|
+
ontologies: Map<string, SchemaDefinition>;
|
|
11
|
+
/** Whether to block on validation errors (default: true) */
|
|
12
|
+
strict?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function createSchemaMiddleware(config: SchemaMiddlewareConfig): KernelMiddleware;
|
|
15
|
+
//# sourceMappingURL=schema-middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-middleware.d.ts","sourceRoot":"","sources":["../../../src/core/kernel/schema-middleware.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAC7B,gBAAgB,CAmElB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Middleware
|
|
3
|
+
*
|
|
4
|
+
* Capability-based access control. Validates that the agent has permission
|
|
5
|
+
* to perform the requested operation on the target entity.
|
|
6
|
+
*/
|
|
7
|
+
import type { KernelMiddleware } from './middleware.js';
|
|
8
|
+
export type Permission = 'read' | 'create' | 'update' | 'delete' | 'link' | 'unlink' | 'admin';
|
|
9
|
+
export interface Capability {
|
|
10
|
+
/** What the capability applies to (entity ID, type, or '*' for all) */
|
|
11
|
+
resource: string;
|
|
12
|
+
/** Permissions granted */
|
|
13
|
+
permissions: Permission[];
|
|
14
|
+
}
|
|
15
|
+
export interface SecurityMiddlewareConfig {
|
|
16
|
+
/** Agent ID to capabilities map */
|
|
17
|
+
capabilities: Map<string, Capability[]>;
|
|
18
|
+
/** Default capabilities for agents not in the map */
|
|
19
|
+
defaultCapabilities?: Capability[];
|
|
20
|
+
/** If true, blocks operations without explicit grants. If false, allows by default. */
|
|
21
|
+
strict?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function createSecurityMiddleware(config: SecurityMiddlewareConfig): KernelMiddleware;
|
|
24
|
+
//# sourceMappingURL=security-middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-middleware.d.ts","sourceRoot":"","sources":["../../../src/core/kernel/security-middleware.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAGjB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,UAAU,GAClB,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,OAAO,CAAC;AAEZ,MAAM,WAAW,UAAU;IACzB,uEAAuE;IACvE,QAAQ,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,mCAAmC;IACnC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IACxC,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC;IACnC,uFAAuF;IACvF,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,wBAAwB,GAC/B,gBAAgB,CAoElB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync Provider Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract for real-time sync and federation.
|
|
5
|
+
* Implementations handle applying remote operations and broadcasting local changes.
|
|
6
|
+
*/
|
|
7
|
+
import type { KernelOp } from '../persist/backend.js';
|
|
8
|
+
/**
|
|
9
|
+
* Incoming remote operation from another peer.
|
|
10
|
+
*/
|
|
11
|
+
export interface RemoteOp {
|
|
12
|
+
op: KernelOp;
|
|
13
|
+
sourcePeerId: string;
|
|
14
|
+
timestamp: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Sync provider interface.
|
|
18
|
+
* Implement this to enable real-time sync between peers.
|
|
19
|
+
*/
|
|
20
|
+
export interface SyncProvider {
|
|
21
|
+
/**
|
|
22
|
+
* Initialize the sync provider.
|
|
23
|
+
*/
|
|
24
|
+
connect(): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Disconnect from the sync network.
|
|
27
|
+
*/
|
|
28
|
+
disconnect(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Check if connected.
|
|
31
|
+
*/
|
|
32
|
+
isConnected(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Apply a remote operation from another peer.
|
|
35
|
+
* The kernel should apply this to its local store.
|
|
36
|
+
*/
|
|
37
|
+
applyRemoteOperation(op: RemoteOp): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Broadcast a local operation to other peers.
|
|
40
|
+
*/
|
|
41
|
+
broadcast(op: KernelOp): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Get the peer ID for this node.
|
|
44
|
+
*/
|
|
45
|
+
getPeerId(): string;
|
|
46
|
+
/**
|
|
47
|
+
* Get list of connected peers.
|
|
48
|
+
*/
|
|
49
|
+
getPeers(): string[];
|
|
50
|
+
/**
|
|
51
|
+
* Handle incoming operations (register callback).
|
|
52
|
+
*/
|
|
53
|
+
onRemoteOp(callback: (op: RemoteOp) => void | Promise<void>): void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Create a no-op sync provider for local-only mode.
|
|
57
|
+
*/
|
|
58
|
+
export declare function createLocalSyncProvider(): SyncProvider;
|
|
59
|
+
//# sourceMappingURL=sync-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-provider.d.ts","sourceRoot":"","sources":["../../../src/core/kernel/sync-provider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,QAAQ,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5B;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC;IAEvB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElD;;OAEG;IACH,SAAS,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvC;;OAEG;IACH,SAAS,IAAI,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,IAAI,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACpE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,YAAY,CAWtD"}
|
|
@@ -0,0 +1,217 @@
|
|
|
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
|
+
import type { SchemaDefinition, WorkspaceConfig } from '../ontology/types.js';
|
|
20
|
+
export interface KernelConfig {
|
|
21
|
+
/** Persistence backend (SQLite or in-memory). */
|
|
22
|
+
backend: KernelBackend;
|
|
23
|
+
/** Agent ID for attributing operations. */
|
|
24
|
+
agentId: string;
|
|
25
|
+
/** Middleware chain applied to every mutation. */
|
|
26
|
+
middleware?: KernelMiddleware[];
|
|
27
|
+
/** Auto-snapshot after this many ops (0 = disabled). */
|
|
28
|
+
snapshotThreshold?: number;
|
|
29
|
+
/** Auto-replay ops from backend on boot (default: true). */
|
|
30
|
+
autoReplay?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface MutateResult {
|
|
33
|
+
op: KernelOp;
|
|
34
|
+
factsDelta: {
|
|
35
|
+
added: number;
|
|
36
|
+
deleted: number;
|
|
37
|
+
};
|
|
38
|
+
linksDelta: {
|
|
39
|
+
added: number;
|
|
40
|
+
deleted: number;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface EntityRecord {
|
|
44
|
+
id: string;
|
|
45
|
+
type: string;
|
|
46
|
+
facts: Fact[];
|
|
47
|
+
links: Link[];
|
|
48
|
+
}
|
|
49
|
+
export declare class TrellisKernel {
|
|
50
|
+
private store;
|
|
51
|
+
private backend;
|
|
52
|
+
private middleware;
|
|
53
|
+
private agentId;
|
|
54
|
+
private snapshotThreshold;
|
|
55
|
+
private opsSinceSnapshot;
|
|
56
|
+
private _booted;
|
|
57
|
+
private ontologies;
|
|
58
|
+
private workspaceConfig;
|
|
59
|
+
private autoReplay;
|
|
60
|
+
constructor(config: KernelConfig);
|
|
61
|
+
/**
|
|
62
|
+
* Initialize the backend and replay persisted state.
|
|
63
|
+
* Loads latest snapshot if available, then replays ops after it.
|
|
64
|
+
*/
|
|
65
|
+
boot(): {
|
|
66
|
+
opsReplayed: number;
|
|
67
|
+
fromSnapshot: boolean;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Close the backend connection.
|
|
71
|
+
*/
|
|
72
|
+
close(): void;
|
|
73
|
+
isBooted(): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Apply a mutation to the graph. Creates an op, runs it through middleware,
|
|
76
|
+
* decomposes into EAV primitives, persists, and returns the result.
|
|
77
|
+
*/
|
|
78
|
+
mutate(kind: KernelOpKind | string, payload: {
|
|
79
|
+
facts?: Fact[];
|
|
80
|
+
links?: Link[];
|
|
81
|
+
deleteFacts?: Fact[];
|
|
82
|
+
deleteLinks?: Link[];
|
|
83
|
+
meta?: Record<string, unknown>;
|
|
84
|
+
}, ctx?: Partial<MiddlewareContext>): Promise<MutateResult>;
|
|
85
|
+
/**
|
|
86
|
+
* Create a snapshot of the current store state.
|
|
87
|
+
*/
|
|
88
|
+
checkpoint(): void;
|
|
89
|
+
/**
|
|
90
|
+
* Get the underlying EAV store for direct queries.
|
|
91
|
+
*/
|
|
92
|
+
getStore(): EAVStore;
|
|
93
|
+
/**
|
|
94
|
+
* Get the persistence backend.
|
|
95
|
+
*/
|
|
96
|
+
getBackend(): KernelBackend;
|
|
97
|
+
/**
|
|
98
|
+
* Get the agent ID.
|
|
99
|
+
*/
|
|
100
|
+
getAgentId(): string;
|
|
101
|
+
/**
|
|
102
|
+
* Read all persisted ops.
|
|
103
|
+
*/
|
|
104
|
+
readAllOps(): KernelOp[];
|
|
105
|
+
/**
|
|
106
|
+
* Get the last persisted op.
|
|
107
|
+
*/
|
|
108
|
+
getLastOp(): KernelOp | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* Create a QueryEngine bound to this kernel's store.
|
|
111
|
+
*/
|
|
112
|
+
createQueryEngine(): QueryEngine;
|
|
113
|
+
/**
|
|
114
|
+
* Execute an EQL-S query, routing through middleware handleQuery hooks.
|
|
115
|
+
* If no middleware intercepts, the query runs directly against the store.
|
|
116
|
+
*/
|
|
117
|
+
query(q: Query): Promise<QueryResult>;
|
|
118
|
+
/**
|
|
119
|
+
* Time-travel: reconstruct the store state at a specific op hash.
|
|
120
|
+
* Returns a new EAVStore with state replayed up to (and including) that op.
|
|
121
|
+
*/
|
|
122
|
+
timeTravel(opHash: string): EAVStore;
|
|
123
|
+
/**
|
|
124
|
+
* Create a new entity with the given type and attributes.
|
|
125
|
+
* Returns the entity ID.
|
|
126
|
+
*/
|
|
127
|
+
createEntity(entityId: string, type: string, attributes?: Record<string, Atom>, links?: Array<{
|
|
128
|
+
attribute: string;
|
|
129
|
+
targetEntityId: string;
|
|
130
|
+
}>): Promise<MutateResult>;
|
|
131
|
+
/**
|
|
132
|
+
* Get an entity by ID, returning all its facts and links.
|
|
133
|
+
*/
|
|
134
|
+
getEntity(entityId: string): EntityRecord | null;
|
|
135
|
+
/**
|
|
136
|
+
* Update an entity's attributes. Deletes old values and adds new ones.
|
|
137
|
+
*/
|
|
138
|
+
updateEntity(entityId: string, updates: Record<string, Atom>): Promise<MutateResult>;
|
|
139
|
+
/**
|
|
140
|
+
* Delete an entity and all its facts and links.
|
|
141
|
+
*/
|
|
142
|
+
deleteEntity(entityId: string): Promise<MutateResult>;
|
|
143
|
+
/**
|
|
144
|
+
* List entities by type, with optional attribute filters.
|
|
145
|
+
*/
|
|
146
|
+
listEntities(type?: string, filters?: Record<string, Atom>): EntityRecord[];
|
|
147
|
+
/**
|
|
148
|
+
* Add a link between two entities.
|
|
149
|
+
*/
|
|
150
|
+
addLink(sourceId: string, attribute: string, targetId: string): Promise<MutateResult>;
|
|
151
|
+
/**
|
|
152
|
+
* Remove a link between two entities.
|
|
153
|
+
*/
|
|
154
|
+
removeLink(sourceId: string, attribute: string, targetId: string): Promise<MutateResult>;
|
|
155
|
+
/**
|
|
156
|
+
* Add a fact to an entity.
|
|
157
|
+
*/
|
|
158
|
+
addFact(entityId: string, attribute: string, value: Atom): Promise<MutateResult>;
|
|
159
|
+
/**
|
|
160
|
+
* Remove a fact from an entity.
|
|
161
|
+
*/
|
|
162
|
+
removeFact(entityId: string, attribute: string, value: Atom): Promise<MutateResult>;
|
|
163
|
+
/**
|
|
164
|
+
* Get an ontology schema by ID.
|
|
165
|
+
*/
|
|
166
|
+
getOntology(id: string): SchemaDefinition | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* List all ontologies.
|
|
169
|
+
*/
|
|
170
|
+
listOntologies(): SchemaDefinition[];
|
|
171
|
+
/**
|
|
172
|
+
* Create a new ontology schema.
|
|
173
|
+
*/
|
|
174
|
+
createOntology(schema: SchemaDefinition): void;
|
|
175
|
+
/**
|
|
176
|
+
* Update an existing ontology schema.
|
|
177
|
+
*/
|
|
178
|
+
updateOntology(id: string, updates: Partial<SchemaDefinition>): void;
|
|
179
|
+
/**
|
|
180
|
+
* Delete an ontology schema.
|
|
181
|
+
*/
|
|
182
|
+
deleteOntology(id: string): void;
|
|
183
|
+
/**
|
|
184
|
+
* Boot the kernel with a workspace configuration.
|
|
185
|
+
* Loads ontologies, projections, and seed data.
|
|
186
|
+
*/
|
|
187
|
+
bootWorkspace(config: WorkspaceConfig): void;
|
|
188
|
+
/**
|
|
189
|
+
* Export the current workspace configuration.
|
|
190
|
+
*/
|
|
191
|
+
exportWorkspace(): WorkspaceConfig;
|
|
192
|
+
/**
|
|
193
|
+
* Create a node (alias for createEntity with schema validation).
|
|
194
|
+
*/
|
|
195
|
+
createNode(id: string, data: Record<string, Atom>, type: string, _ctx?: Partial<MiddlewareContext>): Promise<MutateResult>;
|
|
196
|
+
/**
|
|
197
|
+
* Update a node (alias for updateEntity with schema validation).
|
|
198
|
+
*/
|
|
199
|
+
updateNode(id: string, data: Record<string, Atom>, type: string, _ctx?: Partial<MiddlewareContext>): Promise<MutateResult>;
|
|
200
|
+
/**
|
|
201
|
+
* Delete a node (alias for deleteEntity).
|
|
202
|
+
*/
|
|
203
|
+
deleteNode(id: string, _ctx?: Partial<MiddlewareContext>): Promise<MutateResult>;
|
|
204
|
+
/**
|
|
205
|
+
* Link two nodes (alias for addLink).
|
|
206
|
+
*/
|
|
207
|
+
link(e1: string, a: string, e2: string, _ctx?: Partial<MiddlewareContext>): Promise<MutateResult>;
|
|
208
|
+
/**
|
|
209
|
+
* Unlink two nodes (alias for removeLink).
|
|
210
|
+
*/
|
|
211
|
+
unlink(e1: string, a: string, e2: string, _ctx?: Partial<MiddlewareContext>): Promise<MutateResult>;
|
|
212
|
+
addMiddleware(mw: KernelMiddleware): void;
|
|
213
|
+
removeMiddleware(name: string): void;
|
|
214
|
+
private _runMiddleware;
|
|
215
|
+
private _replayOp;
|
|
216
|
+
}
|
|
217
|
+
//# 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,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EAEhB,MAAM,sBAAsB,CAAC;AAO9B,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,OAAO,EAAE,aAAa,CAAC;IACvB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB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AAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAChC,OAAO,CAAC,YAAY,CAAC;IAIxB;;OAEG;IACG,UAAU,CACd,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAChC,OAAO,CAAC,YAAY,CAAC;IAIxB;;OAEG;IACG,UAAU,CACd,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAChC,OAAO,CAAC,YAAY,CAAC;IAIxB;;OAEG;IACG,IAAI,CACR,EAAE,EAAE,MAAM,EACV,CAAC,EAAE,MAAM,EACT,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAChC,OAAO,CAAC,YAAY,CAAC;IAIxB;;OAEG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,EACV,CAAC,EAAE,MAAM,EACT,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAChC,OAAO,CAAC,YAAY,CAAC;IAQxB,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,cAqE3B,CAAC;AAMF,eAAO,MAAM,iBAAiB,EAAE,cAAc,EAI7C,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Ontology — Built-in structural type hierarchy
|
|
3
|
+
*
|
|
4
|
+
* These types are immutable and ship with the Trellis kernel.
|
|
5
|
+
* They define the foundational type system that all system
|
|
6
|
+
* and user ontologies extend.
|
|
7
|
+
*
|
|
8
|
+
* tier: 'core' — kernel rejects mutations to these schemas.
|
|
9
|
+
*/
|
|
10
|
+
import type { SchemaDefinition } from './types.js';
|
|
11
|
+
/**
|
|
12
|
+
* All core structural type schemas.
|
|
13
|
+
* Auto-loaded into the kernel at construction time.
|
|
14
|
+
*/
|
|
15
|
+
export declare const CORE_ONTOLOGY: SchemaDefinition[];
|
|
16
|
+
/**
|
|
17
|
+
* Core ontology version.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CORE_VERSION = "1.0.0";
|
|
20
|
+
//# sourceMappingURL=core-ontology.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-ontology.d.ts","sourceRoot":"","sources":["../../../src/core/ontology/core-ontology.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAA8B,MAAM,YAAY,CAAC;AAwU/E;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,gBAAgB,EAc3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ontology Module — Public API Surface
|
|
3
|
+
*
|
|
4
|
+
* @module trellis/core/ontology
|
|
5
|
+
*/
|
|
6
|
+
export type { PropertyType, OntologyTier, PropertyValueSpecification, RelationConfig, RollupConfig, AiGeneratedConfig, EntityClass, SchemaDefinition, ProjectionDefinition, RouteDefinition, WorkspaceConfig, AttrType, AttributeDef, RelationDef, EntityDef, OntologySchema, ValidationError, ValidationResult, } from './types.js';
|
|
7
|
+
export type { Atom } from '../store/eav-store.js';
|
|
8
|
+
export { CORE_ONTOLOGY, CORE_VERSION } from './core-ontology.js';
|
|
9
|
+
export { OntologyRegistry } from './registry.js';
|
|
10
|
+
export { projectOntology, teamOntology, agentOntology, builtinOntologies, } from './builtins.js';
|
|
11
|
+
export { validateEntity, validateStore, createValidationMiddleware, } from './validator.js';
|
|
12
|
+
//# 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,YAAY,EACZ,YAAY,EACZ,0BAA0B,EAC1B,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,SAAS,EACT,cAAc,EACd,eAAe,EACf,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAGlD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGjE,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"}
|