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,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity Reference Resolver
|
|
3
|
+
*
|
|
4
|
+
* Resolves parsed EntityRefs to TrellisVCS entities by querying
|
|
5
|
+
* the EAV store, tracked files, semantic parser, milestones, and identities.
|
|
6
|
+
*
|
|
7
|
+
* @see TRL-12
|
|
8
|
+
*/
|
|
9
|
+
import type { EntityRef, ResolvedRef } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Abstract interface for the engine capabilities the resolver needs.
|
|
12
|
+
* This allows testing with mocks without a real TrellisVcsEngine.
|
|
13
|
+
*/
|
|
14
|
+
export interface ResolverContext {
|
|
15
|
+
/** Get a tracked file by path. Returns true if the file exists in the op stream. */
|
|
16
|
+
hasTrackedFile(path: string): boolean;
|
|
17
|
+
/** Look up an issue by ID (e.g. "TRL-5"). Returns title if found. */
|
|
18
|
+
getIssueTitle(id: string): string | undefined;
|
|
19
|
+
/** Look up a milestone by ID or message fragment. Returns message if found. */
|
|
20
|
+
getMilestoneTitle(idOrMessage: string): string | undefined;
|
|
21
|
+
/** Check if a symbol exists in a file. Returns true if found. */
|
|
22
|
+
hasSymbol(filePath: string, symbolName: string): boolean;
|
|
23
|
+
/** Check if an identity/agent ID exists. Returns true if known. */
|
|
24
|
+
hasIdentity(id: string): boolean;
|
|
25
|
+
/** List all known agent IDs (from ops). */
|
|
26
|
+
getKnownAgentIds(): string[];
|
|
27
|
+
/** List all tracked file paths. */
|
|
28
|
+
getTrackedFilePaths(): string[];
|
|
29
|
+
/** List all issue IDs. */
|
|
30
|
+
getIssueIds(): string[];
|
|
31
|
+
/** List all milestone IDs. */
|
|
32
|
+
getMilestoneIds(): string[];
|
|
33
|
+
/** Check if a decision exists by ID (e.g. "DEC-1"). */
|
|
34
|
+
hasDecision(id: string): boolean;
|
|
35
|
+
/** Get a decision's tool name as a human-readable title. */
|
|
36
|
+
getDecisionTitle(id: string): string | undefined;
|
|
37
|
+
/** Get all symbol names for a file. */
|
|
38
|
+
getSymbolNames(filePath: string): string[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Resolve a single EntityRef against the resolver context.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveRef(ref: EntityRef, ctx: ResolverContext): ResolvedRef;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve multiple EntityRefs in batch.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveRefs(refs: EntityRef[], ctx: ResolverContext): ResolvedRef[];
|
|
48
|
+
/**
|
|
49
|
+
* Minimal engine interface for building a ResolverContext.
|
|
50
|
+
* Accepts anything that quacks like TrellisVcsEngine.
|
|
51
|
+
*/
|
|
52
|
+
export interface Enginelike {
|
|
53
|
+
trackedFiles(): Array<{
|
|
54
|
+
path: string;
|
|
55
|
+
contentHash: string | undefined;
|
|
56
|
+
}>;
|
|
57
|
+
getIssue(id: string): {
|
|
58
|
+
title?: string;
|
|
59
|
+
} | null;
|
|
60
|
+
listIssues(filters?: any): Array<{
|
|
61
|
+
id: string;
|
|
62
|
+
}>;
|
|
63
|
+
listMilestones(): Array<{
|
|
64
|
+
id: string;
|
|
65
|
+
message?: string;
|
|
66
|
+
}>;
|
|
67
|
+
parseFile(content: string, filePath: string): {
|
|
68
|
+
declarations: Array<{
|
|
69
|
+
name: string;
|
|
70
|
+
}>;
|
|
71
|
+
} | null;
|
|
72
|
+
getOps(): Array<{
|
|
73
|
+
agentId: string;
|
|
74
|
+
}>;
|
|
75
|
+
getRootPath(): string;
|
|
76
|
+
getDecision?(id: string): {
|
|
77
|
+
id: string;
|
|
78
|
+
toolName: string;
|
|
79
|
+
} | null;
|
|
80
|
+
queryDecisions?(filter?: any): Array<{
|
|
81
|
+
id: string;
|
|
82
|
+
toolName: string;
|
|
83
|
+
}>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Build a ResolverContext from an engine-like object.
|
|
87
|
+
* The symbol resolution reads files from disk and parses them.
|
|
88
|
+
*/
|
|
89
|
+
export declare function createResolverContext(engine: Enginelike): ResolverContext;
|
|
90
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/links/resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAMvE;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAEtC,qEAAqE;IACrE,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAE9C,+EAA+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AE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,cAAc,IAAI,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1D,SAAS,CACP,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf;QAAE,YAAY,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC;IACpD,MAAM,IAAI,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrC,WAAW,IAAI,MAAM,CAAC;IACtB,WAAW,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAClE,cAAc,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,eAAe,CAiGzE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linked Markdown — Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Types for wiki-link parsing, entity reference resolution,
|
|
5
|
+
* and bidirectional reference indexing.
|
|
6
|
+
*
|
|
7
|
+
* @see TRL-11
|
|
8
|
+
*/
|
|
9
|
+
export type RefNamespace = 'issue' | 'file' | 'symbol' | 'identity' | 'milestone' | 'decision';
|
|
10
|
+
export interface EntityRef {
|
|
11
|
+
/** Full matched text inside [[ ]], e.g. "issue:TRL-5|the parser ticket" */
|
|
12
|
+
raw: string;
|
|
13
|
+
/** Resolved or inferred namespace */
|
|
14
|
+
namespace: RefNamespace;
|
|
15
|
+
/** Target identifier, e.g. "TRL-5", "src/engine.ts" */
|
|
16
|
+
target: string;
|
|
17
|
+
/** Optional anchor for symbol refs, e.g. "createIssue" in [[src/engine.ts#createIssue]] */
|
|
18
|
+
anchor?: string;
|
|
19
|
+
/** Optional display alias, e.g. "the parser ticket" in [[TRL-5|the parser ticket]] */
|
|
20
|
+
alias?: string;
|
|
21
|
+
/** Where this reference was found */
|
|
22
|
+
source: RefSource;
|
|
23
|
+
}
|
|
24
|
+
export interface RefSource {
|
|
25
|
+
/** File containing the reference */
|
|
26
|
+
filePath: string;
|
|
27
|
+
/** 1-indexed line number */
|
|
28
|
+
line: number;
|
|
29
|
+
/** 0-indexed column offset of the opening [[ */
|
|
30
|
+
col: number;
|
|
31
|
+
/** Context in which the ref was found */
|
|
32
|
+
context: RefContext;
|
|
33
|
+
}
|
|
34
|
+
export type RefContext = 'markdown' | 'jsdoc' | 'pydoc' | 'rustdoc' | 'godoc' | 'comment';
|
|
35
|
+
export type RefState = 'resolved' | 'stale' | 'broken';
|
|
36
|
+
export interface ResolvedRef extends EntityRef {
|
|
37
|
+
/** Whether the reference target was found */
|
|
38
|
+
state: RefState;
|
|
39
|
+
/** EAV entity ID if resolved (e.g. "issue:TRL-5", "file:src/engine.ts") */
|
|
40
|
+
entityId?: string;
|
|
41
|
+
/** Human-readable label from the resolved entity */
|
|
42
|
+
title?: string;
|
|
43
|
+
/** For stale refs: the op hash that caused the ref to become stale */
|
|
44
|
+
staleOpHash?: string;
|
|
45
|
+
/** For stale refs: reason it became stale */
|
|
46
|
+
staleReason?: 'renamed' | 'deleted';
|
|
47
|
+
}
|
|
48
|
+
export interface RefIndex {
|
|
49
|
+
/** Forward: source file → refs it contains */
|
|
50
|
+
outgoing: Map<string, EntityRef[]>;
|
|
51
|
+
/** Backward: target entity ID → sources that reference it */
|
|
52
|
+
incoming: Map<string, RefSource[]>;
|
|
53
|
+
}
|
|
54
|
+
export interface RefUpdateProposal {
|
|
55
|
+
/** The rename that triggered this proposal */
|
|
56
|
+
oldTarget: string;
|
|
57
|
+
newTarget: string;
|
|
58
|
+
/** Files that would be modified */
|
|
59
|
+
affectedFiles: string[];
|
|
60
|
+
/** Individual ref rewrites */
|
|
61
|
+
rewrites: RefRewrite[];
|
|
62
|
+
}
|
|
63
|
+
export interface RefRewrite {
|
|
64
|
+
filePath: string;
|
|
65
|
+
line: number;
|
|
66
|
+
col: number;
|
|
67
|
+
oldText: string;
|
|
68
|
+
newText: string;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/links/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,MAAM,GACN,QAAQ,GACR,UAAU,GACV,WAAW,GACX,UAAU,CAAC;AAMf,MAAM,WAAW,SAAS;IACxB,2EAA2E;IAC3E,GAAG,EAAE,MAAM,CAAC;IACZ,qCAAqC;IACrC,SAAS,EAAE,YAAY,CAAC;IACxB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,2FAA2F;IAC3F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,MAAM,EAAE,SAAS,CAAC;CACnB;AAMD,MAAM,WAAW,SAAS;IACxB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,yCAAyC;IACzC,OAAO,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAM1F,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,6CAA6C;IAC7C,KAAK,EAAE,QAAQ,CAAC;IAChB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,WAAW,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACrC;AAMD,MAAM,WAAW,QAAQ;IACvB,8CAA8C;IAC9C,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACnC,6DAA6D;IAC7D,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;CACpC;AAMD,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,8BAA8B;IAC9B,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base LLM Provider Implementation
|
|
3
|
+
*/
|
|
4
|
+
import { LLMProvider, LLMMessage, LLMCompletionOptions, LLMCompletionResponse, LLMCompletionChunk } from './types.js';
|
|
5
|
+
export declare abstract class BaseLLMProvider implements LLMProvider {
|
|
6
|
+
abstract id: string;
|
|
7
|
+
abstract name: string;
|
|
8
|
+
abstract complete(messages: LLMMessage[], options?: LLMCompletionOptions): Promise<LLMCompletionResponse>;
|
|
9
|
+
stream(messages: LLMMessage[], options?: LLMCompletionOptions): AsyncIterable<LLMCompletionChunk>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/llm/provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,WAAW,EACX,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,8BAAsB,eAAgB,YAAW,WAAW;IAC1D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAElG,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAAC,kBAAkB,CAAC;CAGzG"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Provider Interface and Types
|
|
3
|
+
*/
|
|
4
|
+
export interface LLMMessage {
|
|
5
|
+
role: 'system' | 'user' | 'assistant' | 'tool';
|
|
6
|
+
content: string | null;
|
|
7
|
+
name?: string;
|
|
8
|
+
tool_call_id?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LLMToolChoice {
|
|
11
|
+
type: 'function';
|
|
12
|
+
function: {
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface LLMToolDefinition {
|
|
17
|
+
type: 'function';
|
|
18
|
+
function: {
|
|
19
|
+
name: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
parameters: Record<string, unknown>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface LLMCompletionOptions {
|
|
25
|
+
model?: string;
|
|
26
|
+
temperature?: number;
|
|
27
|
+
max_tokens?: number;
|
|
28
|
+
stop?: string[];
|
|
29
|
+
tools?: LLMToolDefinition[];
|
|
30
|
+
tool_choice?: 'none' | 'auto' | 'required' | LLMToolChoice;
|
|
31
|
+
stream?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface LLMToolCall {
|
|
34
|
+
id: string;
|
|
35
|
+
type: 'function';
|
|
36
|
+
function: {
|
|
37
|
+
name: string;
|
|
38
|
+
arguments: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface LLMCompletionChunk {
|
|
42
|
+
id: string;
|
|
43
|
+
choices: {
|
|
44
|
+
delta: {
|
|
45
|
+
content?: string;
|
|
46
|
+
tool_calls?: LLMToolCall[];
|
|
47
|
+
};
|
|
48
|
+
finish_reason: string | null;
|
|
49
|
+
}[];
|
|
50
|
+
}
|
|
51
|
+
export interface LLMCompletionResponse {
|
|
52
|
+
id: string;
|
|
53
|
+
model: string;
|
|
54
|
+
choices: {
|
|
55
|
+
message: {
|
|
56
|
+
role: 'assistant';
|
|
57
|
+
content: string | null;
|
|
58
|
+
tool_calls?: LLMToolCall[];
|
|
59
|
+
};
|
|
60
|
+
finish_reason: string;
|
|
61
|
+
}[];
|
|
62
|
+
usage?: {
|
|
63
|
+
prompt_tokens: number;
|
|
64
|
+
completion_tokens: number;
|
|
65
|
+
total_tokens: number;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export interface LLMProvider {
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
complete(messages: LLMMessage[], options?: LLMCompletionOptions): Promise<LLMCompletionResponse>;
|
|
72
|
+
stream(messages: LLMMessage[], options?: LLMCompletionOptions): AsyncIterable<LLMCompletionChunk>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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AE,MAAM,CAAC;YACjB,UAAU,CAAC,EAAE,WAAW,EAAE,CAAC;SAC5B,CAAC;QACF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;KAC9B,EAAE,CAAC;CACL;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE;QACP,OAAO,EAAE;YACP,IAAI,EAAE,WAAW,CAAC;YAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;YACvB,UAAU,CAAC,EAAE,WAAW,EAAE,CAAC;SAC5B,CAAC;QACF,aAAa,EAAE,MAAM,CAAC;KACvB,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE;QACN,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACjG,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACnG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trellis Docs MCP Server
|
|
3
|
+
*
|
|
4
|
+
* Exposes TrellisVCS and TrellisDB documentation to any MCP-compatible
|
|
5
|
+
* AI agent, enabling context-aware assistance for developers using Trellis.
|
|
6
|
+
*
|
|
7
|
+
* Modeled after the SvelteMCP pattern:
|
|
8
|
+
* - list-sections → discover all doc sections
|
|
9
|
+
* - get-documentation → fetch full content for specific sections
|
|
10
|
+
* - trellis-check → lint/validate trellis code patterns
|
|
11
|
+
*
|
|
12
|
+
* Usage (local):
|
|
13
|
+
* bun run src/mcp/docs.ts
|
|
14
|
+
*
|
|
15
|
+
* @module mcp/docs
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/mcp/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* TrellisVCS MCP Server — stdio or HTTP/SSE entry point
|
|
4
|
+
*
|
|
5
|
+
* Run with: bun run src/mcp/index.ts
|
|
6
|
+
* Or via MCP config: { "command": "bun", "args": ["run", "src/mcp/index.ts"] }
|
|
7
|
+
*
|
|
8
|
+
* Flags:
|
|
9
|
+
* --quiet Suppress stderr startup message (for harness mode)
|
|
10
|
+
* --path Repository root path (defaults to cwd)
|
|
11
|
+
* --http Run HTTP/SSE server instead of stdio (for web clients)
|
|
12
|
+
* --port HTTP port (default: 3333)
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TrellisVCS MCP Server
|
|
3
|
+
*
|
|
4
|
+
* @module mcp
|
|
5
|
+
*
|
|
6
|
+
* Exposes TrellisVcsEngine as an MCP (Model Context Protocol) server,
|
|
7
|
+
* enabling any MCP-compatible AI agent to interact with TrellisVCS
|
|
8
|
+
* repositories through structured tool calls and resource queries.
|
|
9
|
+
*
|
|
10
|
+
* Tools provide write/query actions (status, log, milestone, branch, etc.).
|
|
11
|
+
* Resources provide read-only context (op stream, file list, garden clusters).
|
|
12
|
+
*/
|
|
13
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
14
|
+
import { HookRegistry } from '../decisions/index.js';
|
|
15
|
+
import type { DecisionRecorder } from '../decisions/auto-capture.js';
|
|
16
|
+
export declare function createTrellisMcpServer(): McpServer;
|
|
17
|
+
/**
|
|
18
|
+
* The shared hook registry for this MCP server instance.
|
|
19
|
+
* External agent harnesses can register pre/post hooks here.
|
|
20
|
+
*/
|
|
21
|
+
export declare const hookRegistry: HookRegistry;
|
|
22
|
+
/**
|
|
23
|
+
* Create a DecisionRecorder that persists to a given repo path.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createRecorder(repoPath: string): DecisionRecorder;
|
|
26
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAwBrE,wBAAgB,sBAAsB,IAAI,SAAS,CAqrClD;AAMD;;;GAGG;AACH,eAAO,MAAM,YAAY,cAAqB,CAAC;AAE/C;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAKjE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Orchestration Types
|
|
3
|
+
*
|
|
4
|
+
* Multi-agent coordination, routing, and handoffs.
|
|
5
|
+
*/
|
|
6
|
+
import { AgentHarness } from '../core/agents/harness.js';
|
|
7
|
+
import { LLMMessage } from '../llm/types.js';
|
|
8
|
+
export interface Route {
|
|
9
|
+
sourceAgentId: string;
|
|
10
|
+
targetAgentId: string;
|
|
11
|
+
condition?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SupervisorConfig {
|
|
14
|
+
agents: string[];
|
|
15
|
+
strategy: 'rule' | 'llm';
|
|
16
|
+
}
|
|
17
|
+
export interface Orchestrator {
|
|
18
|
+
harness: AgentHarness;
|
|
19
|
+
route(input: string, context?: LLMMessage[]): Promise<string>;
|
|
20
|
+
handoff(runId: string, fromAgentId: string, toAgentId: string): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/orchestration/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,WAAW,KAAK;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;CAC1B;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,YAAY,CAAC;IAGtB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAG9D,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/E"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graph Context Manager — Persists conversation history as entities in the Trellis graph.
|
|
3
|
+
*
|
|
4
|
+
* Implements the ContextManager interface but backs every message with a
|
|
5
|
+
* kernel entity, making conversations queryable via EQL-S and persistent
|
|
6
|
+
* across sessions and devices.
|
|
7
|
+
*
|
|
8
|
+
* @module trellis/plugins/agent-memory
|
|
9
|
+
*/
|
|
10
|
+
import type { LLMMessage } from '../../llm/types.js';
|
|
11
|
+
import type { ContextManager } from '../../context/types.js';
|
|
12
|
+
import type { TrellisKernel } from '../../core/kernel/trellis-kernel.js';
|
|
13
|
+
export interface ConversationOptions {
|
|
14
|
+
title: string;
|
|
15
|
+
agentId?: string;
|
|
16
|
+
model?: string;
|
|
17
|
+
createdBy?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class GraphContextManager implements ContextManager {
|
|
20
|
+
private kernel;
|
|
21
|
+
private conversationId;
|
|
22
|
+
private messageCounter;
|
|
23
|
+
/**
|
|
24
|
+
* In-memory cache of active messages for fast getHistory() reads.
|
|
25
|
+
* Always kept in sync with the graph via addMessage/prune/resume.
|
|
26
|
+
*/
|
|
27
|
+
private cache;
|
|
28
|
+
constructor(kernel: TrellisKernel);
|
|
29
|
+
/**
|
|
30
|
+
* Create a new conversation entity and set it as the active context.
|
|
31
|
+
* Returns the conversation entity ID.
|
|
32
|
+
*/
|
|
33
|
+
createConversation(opts: ConversationOptions): Promise<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Resume an existing conversation by loading its messages from the graph.
|
|
36
|
+
*/
|
|
37
|
+
resumeConversation(conversationId: string): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Get the active conversation ID, or null if none is set.
|
|
40
|
+
*/
|
|
41
|
+
getConversationId(): string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Archive the active conversation and clear local state.
|
|
44
|
+
*/
|
|
45
|
+
archiveConversation(): Promise<void>;
|
|
46
|
+
addMessage(message: LLMMessage): void;
|
|
47
|
+
getHistory(): LLMMessage[];
|
|
48
|
+
prune(targetTokenCount: number): Promise<void>;
|
|
49
|
+
summarize(): Promise<string>;
|
|
50
|
+
injectRagContext(query: string, limit?: number): Promise<void>;
|
|
51
|
+
calculateTokenCount(message: LLMMessage): number;
|
|
52
|
+
/**
|
|
53
|
+
* List all conversations, optionally filtered by status.
|
|
54
|
+
*/
|
|
55
|
+
listConversations(status?: 'active' | 'archived'): Array<{
|
|
56
|
+
id: string;
|
|
57
|
+
title: string;
|
|
58
|
+
status: string;
|
|
59
|
+
createdAt: string;
|
|
60
|
+
messageCount: number;
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Get the total message count for the active conversation.
|
|
64
|
+
*/
|
|
65
|
+
getMessageCount(): number;
|
|
66
|
+
/**
|
|
67
|
+
* Get the total estimated token count for the active conversation.
|
|
68
|
+
*/
|
|
69
|
+
getTotalTokenCount(): number;
|
|
70
|
+
/**
|
|
71
|
+
* Load messages from the graph for a given conversation, sorted by timestamp.
|
|
72
|
+
*/
|
|
73
|
+
private _loadMessagesFromGraph;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=graph-context-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph-context-manager.d.ts","sourceRoot":"","sources":["../../../src/plugins/agent-memory/graph-context-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAOzE,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmBD,qBAAa,mBAAoB,YAAW,cAAc;IACxD,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,cAAc,CAAK;IAE3B;;;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
7
|
+
* ```typescript
|
|
8
|
+
* import { createAgentMemoryPlugin, agentMemoryOntology, GraphContextManager } from 'trellis/plugins/agent-memory';
|
|
9
|
+
*
|
|
10
|
+
* // 1. Register the plugin
|
|
11
|
+
* const plugin = createAgentMemoryPlugin();
|
|
12
|
+
* pluginRegistry.register(plugin);
|
|
13
|
+
* await pluginRegistry.load('trellis:agent-memory', kernel, ontologyRegistry);
|
|
14
|
+
*
|
|
15
|
+
* // 2. Use graph-backed context manager with agent harness
|
|
16
|
+
* const contextManager = new GraphContextManager(kernel);
|
|
17
|
+
* const conversationId = await contextManager.createConversation({
|
|
18
|
+
* title: 'Design review',
|
|
19
|
+
* agentId: 'agent:trellis',
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* // Messages are auto-persisted as graph entities
|
|
23
|
+
* contextManager.addMessage({ role: 'user', content: 'Review the color tokens' });
|
|
24
|
+
* const history = contextManager.getHistory(); // reads from graph
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export { agentMemoryOntology } from './ontology.js';
|
|
28
|
+
export { createAgentMemoryPlugin } from './plugin.js';
|
|
29
|
+
export { GraphContextManager, type ConversationOptions } from './graph-context-manager.js';
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/agent-memory/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGtD,OAAO,EAAE,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Memory Ontology — Schema definitions for Conversation and Message entities.
|
|
3
|
+
*
|
|
4
|
+
* Two entity types, one relation:
|
|
5
|
+
* - Conversation: a thread of messages between user and agent
|
|
6
|
+
* - Message: a single message within a conversation
|
|
7
|
+
* - hasMessage: links a conversation to its messages
|
|
8
|
+
*
|
|
9
|
+
* @module trellis/plugins/agent-memory
|
|
10
|
+
*/
|
|
11
|
+
import type { OntologySchema } from '../../core/ontology/types.js';
|
|
12
|
+
export declare const agentMemoryOntology: OntologySchema;
|
|
13
|
+
//# sourceMappingURL=ontology.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontology.d.ts","sourceRoot":"","sources":["../../../src/plugins/agent-memory/ontology.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,eAAO,MAAM,mBAAmB,EAAE,cAyDjC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Memory Plugin — Trellis plugin for graph-persisted conversations.
|
|
3
|
+
*
|
|
4
|
+
* Registers the agent memory ontology and subscribes to entity events
|
|
5
|
+
* so consumers can react to conversation/message lifecycle changes.
|
|
6
|
+
*
|
|
7
|
+
* @module trellis/plugins/agent-memory
|
|
8
|
+
*/
|
|
9
|
+
import type { PluginDef } from '../../core/plugins/types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create the agent memory plugin instance.
|
|
12
|
+
*
|
|
13
|
+
* Returns a PluginDef that registers Conversation/Message schemas
|
|
14
|
+
* and emits well-known events on conversation lifecycle changes.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createAgentMemoryPlugin(): PluginDef;
|
|
17
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/agent-memory/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAG7D;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,CA+CnD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog Cache — Stores generated json-render catalogs keyed by BrandGuide ID.
|
|
3
|
+
*
|
|
4
|
+
* Invalidation is event-driven: the plugin clears the cache when
|
|
5
|
+
* DesignToken or BrandGuide entities are created, updated, or deleted.
|
|
6
|
+
*
|
|
7
|
+
* @module trellis/plugins/brand
|
|
8
|
+
*/
|
|
9
|
+
export declare class CatalogCache {
|
|
10
|
+
private store;
|
|
11
|
+
get(brandGuideId: string): unknown | undefined;
|
|
12
|
+
set(brandGuideId: string, catalog: unknown): void;
|
|
13
|
+
invalidate(brandGuideId: string): void;
|
|
14
|
+
invalidateAll(): void;
|
|
15
|
+
has(brandGuideId: string): boolean;
|
|
16
|
+
get size(): number;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/plugins/brand/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qBAAa,YAAY;IACvB,OAAO,CAAC,KAAK,CAAmC;IAEhD,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS;IAI9C,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAIjD,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAItC,aAAa,IAAI,IAAI;IAIrB,GAAG,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;IAIlC,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog Generator — Reads brand tokens from the Trellis graph and produces
|
|
3
|
+
* a json-render catalog with Zod-constrained component props.
|
|
4
|
+
*
|
|
5
|
+
* Pure function: no side effects, no caching (caching is handled by CatalogCache).
|
|
6
|
+
*
|
|
7
|
+
* @module trellis/plugins/brand
|
|
8
|
+
*/
|
|
9
|
+
import type { EntityRecord } from '../../core/kernel/trellis-kernel.js';
|
|
10
|
+
import { type VoiceToneConfig } from './voice-tone.js';
|
|
11
|
+
export interface CollectedTokens {
|
|
12
|
+
color: Array<{
|
|
13
|
+
role: string;
|
|
14
|
+
value: unknown;
|
|
15
|
+
lightMode?: unknown;
|
|
16
|
+
darkMode?: unknown;
|
|
17
|
+
}>;
|
|
18
|
+
typography: Array<{
|
|
19
|
+
role: string;
|
|
20
|
+
value: unknown;
|
|
21
|
+
}>;
|
|
22
|
+
spacing: Array<{
|
|
23
|
+
role: string;
|
|
24
|
+
value: unknown;
|
|
25
|
+
}>;
|
|
26
|
+
shadow: Array<{
|
|
27
|
+
role: string;
|
|
28
|
+
value: unknown;
|
|
29
|
+
}>;
|
|
30
|
+
motion: Array<{
|
|
31
|
+
role: string;
|
|
32
|
+
value: unknown;
|
|
33
|
+
}>;
|
|
34
|
+
radius: Array<{
|
|
35
|
+
role: string;
|
|
36
|
+
value: unknown;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
export interface BrandGuideData {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
status: string;
|
|
43
|
+
complianceMode: 'strict' | 'moderate' | 'permissive';
|
|
44
|
+
voiceTone: VoiceToneConfig | null;
|
|
45
|
+
}
|
|
46
|
+
export interface GenerateCatalogResult {
|
|
47
|
+
/** The constrained catalog (opaque — call .prompt() or .jsonSchema() on it) */
|
|
48
|
+
catalog: unknown;
|
|
49
|
+
/** Voice/tone rules derived from the brand guide */
|
|
50
|
+
voiceRules: string[];
|
|
51
|
+
/** The parsed brand guide data */
|
|
52
|
+
guide: BrandGuideData;
|
|
53
|
+
/** All collected tokens grouped by type */
|
|
54
|
+
tokens: CollectedTokens;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Minimal kernel interface — only the methods the generator needs.
|
|
58
|
+
* Avoids importing the full TrellisKernel class.
|
|
59
|
+
*/
|
|
60
|
+
export interface KernelReader {
|
|
61
|
+
getEntity(entityId: string): EntityRecord | null;
|
|
62
|
+
listEntities(type?: string, filters?: Record<string, unknown>): EntityRecord[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Collect all DesignTokens linked to a BrandGuide, grouped by tokenType.
|
|
66
|
+
*/
|
|
67
|
+
export declare function collectTokens(kernel: KernelReader, guideEntity: EntityRecord): CollectedTokens;
|
|
68
|
+
/**
|
|
69
|
+
* Parse a BrandGuide entity into structured data.
|
|
70
|
+
*/
|
|
71
|
+
export declare function parseBrandGuide(entity: EntityRecord): BrandGuideData;
|
|
72
|
+
/**
|
|
73
|
+
* Generate a brand-constrained json-render catalog.
|
|
74
|
+
*
|
|
75
|
+
* @param kernel - Trellis kernel (or anything implementing KernelReader)
|
|
76
|
+
* @param brandGuideId - Entity ID of the BrandGuide
|
|
77
|
+
* @param defineCatalog - The `defineCatalog` function from `@json-render/core`
|
|
78
|
+
* @param schema - The schema instance from `@json-render/react/schema` (or other renderer)
|
|
79
|
+
* @param baseComponents - Component definitions to constrain (defaults to shadcn if not provided)
|
|
80
|
+
* @returns Generated catalog, voice rules, guide data, and collected tokens
|
|
81
|
+
*/
|
|
82
|
+
export declare function generateBrandCatalog(kernel: KernelReader, brandGuideId: string, defineCatalog: (schema: unknown, input: {
|
|
83
|
+
components: Record<string, unknown>;
|
|
84
|
+
actions: Record<string, unknown>;
|
|
85
|
+
}) => unknown, schema: unknown, baseComponents: Record<string, {
|
|
86
|
+
props: unknown;
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
}>): GenerateCatalogResult;
|
|
89
|
+
//# sourceMappingURL=catalog-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-generator.d.ts","sourceRoot":"","sources":["../../../src/plugins/brand/catalog-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