trellis 2.1.9 → 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 -796
- package/dist/cli/index.d.ts +3 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2948 -182
- package/dist/client/index.js +4 -4
- 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 +10 -1
- package/dist/core/agents/harness.d.ts.map +1 -1
- package/dist/core/agents/types.d.ts +18 -2
- package/dist/core/agents/types.d.ts.map +1 -1
- 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.js +93 -5
- 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/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 +55 -0
- package/dist/core/kernel/trellis-kernel.d.ts.map +1 -1
- package/dist/core/ontology/builtins.d.ts.map +1 -1
- 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 +3 -1
- package/dist/core/ontology/index.d.ts.map +1 -1
- package/dist/core/ontology/types.d.ts +138 -34
- package/dist/core/ontology/types.d.ts.map +1 -1
- package/dist/core/persist/backend.d.ts +2 -0
- package/dist/core/persist/backend.d.ts.map +1 -1
- 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 +2 -0
- package/dist/core/persist/sqlite-backend.d.ts.map +1 -1
- package/dist/core/store/eav-store.d.ts +4 -0
- package/dist/core/store/eav-store.d.ts.map +1 -1
- package/dist/db/index.js +10 -8
- package/dist/{deploy-99j5dc9c.js → deploy-999q207z.js} +2 -1
- package/dist/engine.d.ts +3 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/evals/types.d.ts +29 -0
- package/dist/evals/types.d.ts.map +1 -0
- package/dist/{import-fyg5sgq4.js → import-s2b8e0ft.js} +2 -2
- package/dist/{index-3ejh8k6v.js → index-0q7wbasy.js} +18 -4
- package/dist/{index-7t92ej34.js → index-0zk3fx2s.js} +467 -7
- package/dist/{index-xr7rx360.js → index-6n5dcebj.js} +33 -0
- package/dist/{index-4beszbgg.js → index-7e27kvvj.js} +1 -1
- package/dist/index-bmyt7k8n.js +90 -0
- package/dist/{index-k5kf7sd0.js → index-hmdbnd4n.js} +1 -1
- package/dist/{index-czecrvvn.js → index-q31hfjja.js} +858 -48
- package/dist/{index-8fjwnztt.js → index-skhn0agf.js} +1 -1
- package/dist/{index-04sq3h27.js → index-w7ng765c.js} +3 -1
- package/dist/{index-hgd30epa.js → index-wt8rz4gn.js} +4 -21
- package/dist/{index-5p6zgspx.js → index-y3d71wzd.js} +1 -1
- package/dist/index-y6a4kj0p.js +43 -0
- package/dist/{index-5bhe57y9.js → index-yhwjgfvj.js} +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -6
- 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/index.d.ts +7 -1
- package/dist/mcp/index.d.ts.map +1 -1
- 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 +4 -4
- 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-sj8rp0m7.js → sdk-snn5gad3.js} +4 -4
- package/dist/server/deploy.d.ts.map +1 -1
- package/dist/server/index.d.ts +5 -3
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +37 -7
- package/dist/server/sprites.d.ts +26 -0
- package/dist/server/sprites.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-3vkpnpbz.js → server-mrctdwzr.js} +2 -2
- 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/{tenancy-tjr7kk2v.js → tenancy-7d1g4ayp.js} +3 -3
- package/dist/ui/client.html +460 -664
- package/dist/ui/server.d.ts +6 -2
- package/dist/ui/server.d.ts.map +1 -1
- package/dist/vcs/decompose.d.ts.map +1 -1
- package/dist/vcs/index.js +2 -2
- package/dist/vcs/issue.d.ts.map +1 -1
- package/dist/vcs/types.d.ts +1 -0
- package/dist/vcs/types.d.ts.map +1 -1
- package/dist/vm-config-6xhsj6b3.js +22 -0
- package/package.json +14 -4
- /package/dist/{index-kbnht9p8.js → index-c9h37r6h.js} +0 -0
|
@@ -291,7 +291,9 @@ var agentOntology = {
|
|
|
291
291
|
{ name: "status", type: "string", enum: ["running", "completed", "failed", "cancelled"], default: "running" },
|
|
292
292
|
{ name: "input", type: "string" },
|
|
293
293
|
{ name: "output", type: "string" },
|
|
294
|
-
{ name: "
|
|
294
|
+
{ name: "totalTokens", type: "number" },
|
|
295
|
+
{ name: "promptTokens", type: "number" },
|
|
296
|
+
{ name: "completionTokens", type: "number" }
|
|
295
297
|
]
|
|
296
298
|
},
|
|
297
299
|
{
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
runSpriteCmd,
|
|
4
|
+
runSpriteCopy
|
|
5
|
+
} from "./index-y6a4kj0p.js";
|
|
2
6
|
import {
|
|
3
7
|
updateConfig
|
|
4
8
|
} from "./index-xzym9w0m.js";
|
|
@@ -97,27 +101,6 @@ async function runBun(args) {
|
|
|
97
101
|
throw new Error(`bun ${args[0]} failed (exit ${exitCode}): ${err}`);
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
|
-
async function runSpriteCmd(args) {
|
|
101
|
-
const proc = Bun.spawn(["sprite", ...args], {
|
|
102
|
-
stdout: "pipe",
|
|
103
|
-
stderr: "pipe"
|
|
104
|
-
});
|
|
105
|
-
const exitCode = await proc.exited;
|
|
106
|
-
const stdout = await new Response(proc.stdout).text();
|
|
107
|
-
if (exitCode !== 0) {
|
|
108
|
-
const err = await new Response(proc.stderr).text();
|
|
109
|
-
throw new Error(`sprite ${args[0]} failed (exit ${exitCode}): ${err}`);
|
|
110
|
-
}
|
|
111
|
-
return stdout.trim();
|
|
112
|
-
}
|
|
113
|
-
async function runSpriteCopy(localPath, spriteName, remotePath) {
|
|
114
|
-
const proc = Bun.spawn(["sprite", "cp", localPath, `${spriteName}:${remotePath}`], { stdout: "pipe", stderr: "pipe" });
|
|
115
|
-
const exitCode = await proc.exited;
|
|
116
|
-
if (exitCode !== 0) {
|
|
117
|
-
const err = await new Response(proc.stderr).text();
|
|
118
|
-
throw new Error(`sprite cp failed (exit ${exitCode}): ${err}`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
104
|
function generateServerEntrypoint(opts) {
|
|
122
105
|
return `
|
|
123
106
|
import { TenantPool, startServer } from 'trellis/server';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/server/sprites.ts
|
|
3
|
+
async function runSpriteCmd(args) {
|
|
4
|
+
const proc = Bun.spawn(["sprite", ...args], {
|
|
5
|
+
stdout: "pipe",
|
|
6
|
+
stderr: "pipe"
|
|
7
|
+
});
|
|
8
|
+
const exitCode = await proc.exited;
|
|
9
|
+
const stdout = await new Response(proc.stdout).text();
|
|
10
|
+
if (exitCode !== 0) {
|
|
11
|
+
const err = await new Response(proc.stderr).text();
|
|
12
|
+
throw new Error(`sprite ${args[0]} failed (exit ${exitCode}): ${err}`);
|
|
13
|
+
}
|
|
14
|
+
return stdout.trim();
|
|
15
|
+
}
|
|
16
|
+
async function runSpriteCopy(localPath, spriteName, remotePath) {
|
|
17
|
+
const proc = Bun.spawn(["sprite", "cp", localPath, `${spriteName}:${remotePath}`], { stdout: "pipe", stderr: "pipe" });
|
|
18
|
+
const exitCode = await proc.exited;
|
|
19
|
+
if (exitCode !== 0) {
|
|
20
|
+
const err = await new Response(proc.stderr).text();
|
|
21
|
+
throw new Error(`sprite cp failed (exit ${exitCode}): ${err}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function runSpriteInteractive(args) {
|
|
25
|
+
const proc = Bun.spawn(["sprite", ...args], { stdio: "inherit" });
|
|
26
|
+
const exitCode = await proc.exited;
|
|
27
|
+
if (exitCode !== 0) {
|
|
28
|
+
throw new Error(`sprite ${args[0]} failed (exit ${exitCode})`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function assertSpriteCli() {
|
|
32
|
+
await runSpriteCmd(["--version"]).catch(() => {
|
|
33
|
+
throw new Error("`sprite` CLI not found. Install it from https://docs.sprites.dev and authenticate.");
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function resolveSprite(explicitName) {
|
|
37
|
+
if (explicitName) {
|
|
38
|
+
return explicitName;
|
|
39
|
+
}
|
|
40
|
+
throw new Error("No sprite specified. Use --sprite <name> or set an active sprite with `trellis vm use <name>`");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { runSpriteCmd, runSpriteCopy, runSpriteInteractive, assertSpriteCli, resolveSprite };
|
|
@@ -48,12 +48,28 @@ class EAVStore {
|
|
|
48
48
|
for (let i = 0;i < facts.length; i++) {
|
|
49
49
|
const fact = facts[i];
|
|
50
50
|
if (fact) {
|
|
51
|
+
if (this.hasFact(fact.e, fact.a, fact.v)) {
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
51
54
|
this.facts.push(fact);
|
|
52
55
|
this.updateIndexes(fact, this.facts.length - 1);
|
|
53
56
|
this.updateCatalog(fact);
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
}
|
|
60
|
+
hasFact(entity, attribute, value) {
|
|
61
|
+
const valueKey = this.valueKey(value);
|
|
62
|
+
const indices = this.aveIndex.get(attribute)?.get(valueKey);
|
|
63
|
+
if (!indices)
|
|
64
|
+
return false;
|
|
65
|
+
for (const idx of indices) {
|
|
66
|
+
const fact = this.facts[idx];
|
|
67
|
+
if (fact && fact.e === entity && fact.a === attribute) {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
57
73
|
addLinks(links) {
|
|
58
74
|
for (const link of links) {
|
|
59
75
|
this.links.push(link);
|
package/dist/index.d.ts
CHANGED
|
@@ -20,4 +20,6 @@ export { Ingestion } from './watcher/ingestion.js';
|
|
|
20
20
|
export { TrellisKernel } from './core/kernel/trellis-kernel.js';
|
|
21
21
|
export { SqliteKernelBackend } from './core/persist/sqlite-backend.js';
|
|
22
22
|
export type { KernelConfig, MutateResult, EntityRecord, } from './core/kernel/trellis-kernel.js';
|
|
23
|
+
export { inferProjectContext, loadProfile, saveProfile, hasProfile, writeAgentScaffold, } from './scaffold/index.js';
|
|
24
|
+
export type { ProjectContext, InferenceConfidence, UserProfile, ScaffoldInput, } from './scaffold/index.js';
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGnD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,UAAU,EACV,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,aAAa,GACd,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,13 +3,18 @@ import {
|
|
|
3
3
|
FileWatcher,
|
|
4
4
|
Ingestion,
|
|
5
5
|
TrellisVcsEngine,
|
|
6
|
+
hasProfile,
|
|
7
|
+
inferProjectContext,
|
|
6
8
|
init_engine,
|
|
7
9
|
init_fs_watcher,
|
|
8
|
-
init_ingestion
|
|
9
|
-
|
|
10
|
+
init_ingestion,
|
|
11
|
+
loadProfile,
|
|
12
|
+
saveProfile,
|
|
13
|
+
writeAgentScaffold
|
|
14
|
+
} from "./index-q31hfjja.js";
|
|
10
15
|
import {
|
|
11
16
|
VcsMiddleware
|
|
12
|
-
} from "./index-
|
|
17
|
+
} from "./index-hmdbnd4n.js";
|
|
13
18
|
import {
|
|
14
19
|
BlobStore,
|
|
15
20
|
addCriterion,
|
|
@@ -48,7 +53,7 @@ import {
|
|
|
48
53
|
triageIssue,
|
|
49
54
|
unblockIssue,
|
|
50
55
|
updateIssue
|
|
51
|
-
} from "./index-
|
|
56
|
+
} from "./index-0q7wbasy.js";
|
|
52
57
|
import"./index-65z0xfjw.js";
|
|
53
58
|
import {
|
|
54
59
|
DEFAULT_CONFIG,
|
|
@@ -67,8 +72,8 @@ import {
|
|
|
67
72
|
import {
|
|
68
73
|
SqliteKernelBackend,
|
|
69
74
|
TrellisKernel
|
|
70
|
-
} from "./index-
|
|
71
|
-
import"./index-
|
|
75
|
+
} from "./index-0zk3fx2s.js";
|
|
76
|
+
import"./index-yhwjgfvj.js";
|
|
72
77
|
import"./index-yp88he8n.js";
|
|
73
78
|
import"./index-a76rekgs.js";
|
|
74
79
|
|
|
@@ -77,6 +82,7 @@ init_engine();
|
|
|
77
82
|
init_fs_watcher();
|
|
78
83
|
init_ingestion();
|
|
79
84
|
export {
|
|
85
|
+
writeAgentScaffold,
|
|
80
86
|
updateIssue,
|
|
81
87
|
unblockIssue,
|
|
82
88
|
triageIssue,
|
|
@@ -85,6 +91,7 @@ export {
|
|
|
85
91
|
switchBranch,
|
|
86
92
|
startIssue,
|
|
87
93
|
setCriterionStatus,
|
|
94
|
+
saveProfile,
|
|
88
95
|
saveBranchState,
|
|
89
96
|
runCriteria,
|
|
90
97
|
resumeIssue,
|
|
@@ -92,6 +99,7 @@ export {
|
|
|
92
99
|
pauseIssue,
|
|
93
100
|
myersDiff,
|
|
94
101
|
milestoneEntityId,
|
|
102
|
+
loadProfile,
|
|
95
103
|
loadBranchState,
|
|
96
104
|
listMilestones,
|
|
97
105
|
listIssues,
|
|
@@ -100,6 +108,8 @@ export {
|
|
|
100
108
|
issueEntityId,
|
|
101
109
|
isVcsOpKind,
|
|
102
110
|
isVcsOp,
|
|
111
|
+
inferProjectContext,
|
|
112
|
+
hasProfile,
|
|
103
113
|
getIssue,
|
|
104
114
|
getActiveIssues,
|
|
105
115
|
generateUnifiedDiff,
|
|
@@ -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":"types.d.ts","sourceRoot":"","sources":["../../src/llm/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC/C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACrC,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,aAAa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.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* TrellisVCS MCP Server — stdio entry point
|
|
3
|
+
* TrellisVCS MCP Server — stdio or HTTP/SSE entry point
|
|
4
4
|
*
|
|
5
5
|
* Run with: bun run src/mcp/index.ts
|
|
6
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)
|
|
7
13
|
*/
|
|
8
14
|
export {};
|
|
9
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/mcp/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG"}
|
|
@@ -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;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAuB;gBAExB,MAAM,EAAE,aAAa;IAQjC;;;OAGG;IACG,kBAAkB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBpE;;OAEG;IACG,kBAAkB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW/D;;OAEG;IACH,iBAAiB,IAAI,MAAM,GAAG,IAAI;IAIlC;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAW1C,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI;IA0CrC,UAAU,IAAI,UAAU,EAAE;IAMpB,KAAK,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA6B9C,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAO5B,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpE,mBAAmB,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM;IAQhD;;OAEG;IACH,iBAAiB,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAC;QACvD,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IAeF;;OAEG;IACH,eAAe,IAAI,MAAM;IAIzB;;OAEG;IACH,kBAAkB,IAAI,MAAM;IAU5B;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAiC/B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Memory — Trellis plugin for graph-persisted agent conversations.
|
|
3
|
+
*
|
|
4
|
+
* @module trellis/plugins/agent-memory
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
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-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAuB,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAM5E,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE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