trellis 2.0.7 → 2.0.10

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.
Files changed (52) hide show
  1. package/dist/cli/index.js +1031 -30
  2. package/dist/core/index.js +474 -2
  3. package/dist/decisions/index.js +5 -2
  4. package/dist/embeddings/index.js +5 -1
  5. package/dist/{index-3s0eak0p.js → index-3ejh8k6v.js} +26 -3
  6. package/dist/{index-1j1anhmr.js → index-5b01h414.js} +489 -335
  7. package/dist/index-5m0g9r0y.js +1100 -0
  8. package/dist/{index-8pce39mh.js → index-65z0xfjw.js} +17 -3
  9. package/dist/{index-zf6htvnm.js → index-7gvjxt27.js} +166 -2
  10. package/dist/index-hybgxe40.js +1174 -0
  11. package/dist/{index-gnw8d7d6.js → index-k5kf7sd0.js} +32 -3
  12. package/dist/{index-fd4e26s4.js → index-v9b4hqa7.js} +23 -15
  13. package/dist/index.js +20 -7
  14. package/dist/transformers.node-bx3q9d7k.js +33130 -0
  15. package/dist/ui/client.html +695 -0
  16. package/dist/vcs/index.js +3 -3
  17. package/package.json +5 -4
  18. package/src/cli/index.ts +1017 -1
  19. package/src/core/agents/harness.ts +336 -0
  20. package/src/core/agents/index.ts +18 -0
  21. package/src/core/agents/types.ts +90 -0
  22. package/src/core/index.ts +85 -2
  23. package/src/core/kernel/trellis-kernel.ts +593 -0
  24. package/src/core/ontology/builtins.ts +248 -0
  25. package/src/core/ontology/index.ts +34 -0
  26. package/src/core/ontology/registry.ts +209 -0
  27. package/src/core/ontology/types.ts +124 -0
  28. package/src/core/ontology/validator.ts +382 -0
  29. package/src/core/persist/backend.ts +10 -0
  30. package/src/core/persist/sqlite-backend.ts +298 -0
  31. package/src/core/plugins/index.ts +17 -0
  32. package/src/core/plugins/registry.ts +322 -0
  33. package/src/core/plugins/types.ts +126 -0
  34. package/src/core/query/datalog.ts +188 -0
  35. package/src/core/query/engine.ts +370 -0
  36. package/src/core/query/index.ts +34 -0
  37. package/src/core/query/parser.ts +481 -0
  38. package/src/core/query/types.ts +200 -0
  39. package/src/embeddings/auto-embed.ts +248 -0
  40. package/src/embeddings/index.ts +7 -0
  41. package/src/embeddings/model.ts +21 -4
  42. package/src/embeddings/types.ts +8 -1
  43. package/src/engine.ts +45 -3
  44. package/src/index.ts +9 -0
  45. package/src/sync/http-transport.ts +144 -0
  46. package/src/sync/index.ts +11 -0
  47. package/src/sync/multi-repo.ts +200 -0
  48. package/src/sync/ws-transport.ts +145 -0
  49. package/src/ui/client.html +695 -0
  50. package/src/ui/server.ts +419 -0
  51. package/src/watcher/fs-watcher.ts +41 -3
  52. package/dist/index-gkvhzm9f.js +0 -321
@@ -1,12 +1,484 @@
1
1
  // @bun
2
+ import {
3
+ DatalogRuntime,
4
+ OntologyRegistry,
5
+ agentOntology,
6
+ builtinOntologies,
7
+ createValidationMiddleware,
8
+ parseQuery,
9
+ parseRule,
10
+ parseSimple,
11
+ projectOntology,
12
+ teamOntology,
13
+ validateEntity,
14
+ validateStore
15
+ } from "../index-5m0g9r0y.js";
2
16
  import {
3
17
  EAVStore,
18
+ QueryEngine,
19
+ SqliteKernelBackend,
20
+ TrellisKernel,
4
21
  flatten,
22
+ init_eav_store,
5
23
  jsonEntityFacts
6
- } from "../index-gkvhzm9f.js";
24
+ } from "../index-hybgxe40.js";
7
25
  import"../index-a76rekgs.js";
26
+
27
+ // src/core/index.ts
28
+ init_eav_store();
29
+
30
+ // src/core/agents/harness.ts
31
+ class AgentHarness {
32
+ kernel;
33
+ toolHandlers = new Map;
34
+ config;
35
+ constructor(kernel, config) {
36
+ this.kernel = kernel;
37
+ this.config = {
38
+ recordDecisions: true,
39
+ maxDecisionsPerRun: 100,
40
+ ...config
41
+ };
42
+ }
43
+ async createAgent(def) {
44
+ const id = def.id ?? `agent:${def.name.toLowerCase().replace(/\s+/g, "-")}`;
45
+ await this.kernel.createEntity(id, "Agent", {
46
+ name: def.name,
47
+ ...def.description ? { description: def.description } : {},
48
+ ...def.model ? { model: def.model } : {},
49
+ ...def.provider ? { provider: def.provider } : {},
50
+ ...def.systemPrompt ? { systemPrompt: def.systemPrompt } : {},
51
+ status: def.status ?? "active"
52
+ });
53
+ if (def.capabilities) {
54
+ for (const cap of def.capabilities) {
55
+ await this.kernel.addLink(id, "hasCapability", cap);
56
+ }
57
+ }
58
+ if (def.tools) {
59
+ for (const tool of def.tools) {
60
+ await this.kernel.addLink(id, "hasTool", tool);
61
+ }
62
+ }
63
+ return this.getAgent(id);
64
+ }
65
+ getAgent(id) {
66
+ const entity = this.kernel.getEntity(id);
67
+ if (!entity || entity.type !== "Agent")
68
+ return null;
69
+ const store = this.kernel.getStore();
70
+ const capLinks = store.getLinksByEntityAndAttribute(id, "hasCapability");
71
+ const toolLinks = store.getLinksByEntityAndAttribute(id, "hasTool");
72
+ return {
73
+ id: entity.id,
74
+ name: String(entity.facts.find((f) => f.a === "name")?.v ?? ""),
75
+ description: entity.facts.find((f) => f.a === "description")?.v,
76
+ model: entity.facts.find((f) => f.a === "model")?.v,
77
+ provider: entity.facts.find((f) => f.a === "provider")?.v,
78
+ systemPrompt: entity.facts.find((f) => f.a === "systemPrompt")?.v,
79
+ status: entity.facts.find((f) => f.a === "status")?.v ?? "active",
80
+ capabilities: capLinks.map((l) => l.e2),
81
+ tools: toolLinks.map((l) => l.e2)
82
+ };
83
+ }
84
+ listAgents(status) {
85
+ const entities = this.kernel.listEntities("Agent", status ? { status } : undefined);
86
+ return entities.map((e) => this.getAgent(e.id)).filter((a) => a !== null);
87
+ }
88
+ async registerTool(def, handler) {
89
+ const id = def.id ?? `tool:${def.name.toLowerCase().replace(/\s+/g, "-")}`;
90
+ if (!this.kernel.getEntity(id)) {
91
+ await this.kernel.createEntity(id, "Tool", {
92
+ name: def.name,
93
+ ...def.description ? { description: def.description } : {},
94
+ ...def.schema ? { schema: def.schema } : {},
95
+ ...def.endpoint ? { endpoint: def.endpoint } : {}
96
+ });
97
+ }
98
+ this.toolHandlers.set(id, handler);
99
+ return id;
100
+ }
101
+ getToolHandler(toolId) {
102
+ return this.toolHandlers.get(toolId);
103
+ }
104
+ listTools() {
105
+ return this.kernel.listEntities("Tool").map((e) => ({
106
+ id: e.id,
107
+ name: String(e.facts.find((f) => f.a === "name")?.v ?? ""),
108
+ description: e.facts.find((f) => f.a === "description")?.v,
109
+ schema: e.facts.find((f) => f.a === "schema")?.v,
110
+ endpoint: e.facts.find((f) => f.a === "endpoint")?.v
111
+ }));
112
+ }
113
+ async startRun(agentId, input) {
114
+ const agent = this.getAgent(agentId);
115
+ if (!agent)
116
+ throw new Error(`Agent "${agentId}" not found.`);
117
+ const runId = `run:${agentId.replace("agent:", "")}:${Date.now()}`;
118
+ await this.kernel.createEntity(runId, "AgentRun", {
119
+ startedAt: new Date().toISOString(),
120
+ status: "running",
121
+ ...input ? { input } : {}
122
+ });
123
+ await this.kernel.addLink(runId, "executedBy", agentId);
124
+ return runId;
125
+ }
126
+ async completeRun(runId, output, tokenCount) {
127
+ const updates = {
128
+ status: "completed",
129
+ completedAt: new Date().toISOString()
130
+ };
131
+ if (output)
132
+ updates.output = output;
133
+ if (tokenCount !== undefined)
134
+ updates.tokenCount = tokenCount;
135
+ await this.kernel.updateEntity(runId, updates);
136
+ }
137
+ async failRun(runId, error) {
138
+ await this.kernel.updateEntity(runId, {
139
+ status: "failed",
140
+ completedAt: new Date().toISOString(),
141
+ output: `Error: ${error}`
142
+ });
143
+ }
144
+ getRun(runId) {
145
+ const entity = this.kernel.getEntity(runId);
146
+ if (!entity || entity.type !== "AgentRun")
147
+ return null;
148
+ const store = this.kernel.getStore();
149
+ const agentLink = store.getLinksByEntityAndAttribute(runId, "executedBy");
150
+ const agentId = agentLink[0]?.e2 ?? "";
151
+ const decisionLinks = store.getLinksByAttribute("belongsToRun");
152
+ const decisionIds = decisionLinks.filter((l) => l.e2 === runId).map((l) => l.e1);
153
+ const decisions = decisionIds.map((did) => this._buildDecisionTrace(did)).filter(Boolean);
154
+ const get = (a) => entity.facts.find((f) => f.a === a)?.v;
155
+ return {
156
+ id: runId,
157
+ agentId,
158
+ startedAt: String(get("startedAt") ?? ""),
159
+ completedAt: get("completedAt"),
160
+ status: get("status") ?? "running",
161
+ input: get("input"),
162
+ output: get("output"),
163
+ tokenCount: get("tokenCount"),
164
+ decisions
165
+ };
166
+ }
167
+ listRuns(agentId) {
168
+ const runs = this.kernel.listEntities("AgentRun");
169
+ return runs.map((e) => this.getRun(e.id)).filter((r) => r !== null).filter((r) => !agentId || r.agentId === agentId).sort((a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime());
170
+ }
171
+ async recordDecision(runId, toolName, input, output, opts) {
172
+ const run = this.getRun(runId);
173
+ if (!run)
174
+ throw new Error(`Run "${runId}" not found.`);
175
+ const decId = `decision:${runId.replace("run:", "")}:${Date.now()}`;
176
+ await this.kernel.createEntity(decId, "DecisionTrace", {
177
+ toolName,
178
+ timestamp: new Date().toISOString(),
179
+ ...input ? { input: JSON.stringify(input) } : {},
180
+ ...output ? { output } : {},
181
+ ...opts?.rationale ? { rationale: opts.rationale } : {},
182
+ ...opts?.alternatives ? { alternatives: JSON.stringify(opts.alternatives) } : {}
183
+ });
184
+ await this.kernel.addLink(decId, "belongsToRun", runId);
185
+ await this.kernel.addLink(decId, "madeBy", run.agentId);
186
+ if (opts?.relatedEntities) {
187
+ for (const eid of opts.relatedEntities) {
188
+ await this.kernel.addLink(decId, "relatedTo", eid);
189
+ }
190
+ }
191
+ return decId;
192
+ }
193
+ async invokeTool(runId, toolId, input, opts) {
194
+ const handler = this.toolHandlers.get(toolId);
195
+ if (!handler)
196
+ throw new Error(`No handler registered for tool "${toolId}".`);
197
+ const result = await handler(input);
198
+ if (this.config.recordDecisions) {
199
+ const toolEntity = this.kernel.getEntity(toolId);
200
+ const toolName = toolEntity ? String(toolEntity.facts.find((f) => f.a === "name")?.v ?? toolId) : toolId;
201
+ await this.recordDecision(runId, toolName, input, result.success ? String(result.output ?? "") : `Error: ${result.error}`, opts);
202
+ }
203
+ return result;
204
+ }
205
+ getDecisionChain(entityId) {
206
+ const store = this.kernel.getStore();
207
+ const links = store.getLinksByAttribute("relatedTo");
208
+ const decisionIds = links.filter((l) => l.e2 === entityId).map((l) => l.e1);
209
+ return decisionIds.map((did) => this._buildDecisionTrace(did)).filter(Boolean);
210
+ }
211
+ _buildDecisionTrace(decId) {
212
+ const entity = this.kernel.getEntity(decId);
213
+ if (!entity)
214
+ return null;
215
+ const get = (a) => entity.facts.find((f) => f.a === a)?.v;
216
+ const store = this.kernel.getStore();
217
+ const runLink = store.getLinksByEntityAndAttribute(decId, "belongsToRun");
218
+ const agentLink = store.getLinksByEntityAndAttribute(decId, "madeBy");
219
+ const relatedLinks = store.getLinksByEntityAndAttribute(decId, "relatedTo");
220
+ let inputParsed;
221
+ const inputRaw = get("input");
222
+ if (inputRaw) {
223
+ try {
224
+ inputParsed = JSON.parse(inputRaw);
225
+ } catch {
226
+ inputParsed = { raw: inputRaw };
227
+ }
228
+ }
229
+ let alternatives;
230
+ const altRaw = get("alternatives");
231
+ if (altRaw) {
232
+ try {
233
+ alternatives = JSON.parse(altRaw);
234
+ } catch {
235
+ alternatives = [altRaw];
236
+ }
237
+ }
238
+ return {
239
+ id: decId,
240
+ runId: runLink[0]?.e2 ?? "",
241
+ agentId: agentLink[0]?.e2 ?? "",
242
+ toolName: String(get("toolName") ?? ""),
243
+ input: inputParsed,
244
+ output: get("output"),
245
+ rationale: get("rationale"),
246
+ alternatives,
247
+ timestamp: String(get("timestamp") ?? ""),
248
+ relatedEntities: relatedLinks.map((l) => l.e2)
249
+ };
250
+ }
251
+ }
252
+ // src/core/plugins/registry.ts
253
+ class EventBus {
254
+ handlers = new Map;
255
+ on(event, handler) {
256
+ const set = this.handlers.get(event) ?? new Set;
257
+ set.add(handler);
258
+ this.handlers.set(event, set);
259
+ }
260
+ off(event, handler) {
261
+ const set = this.handlers.get(event);
262
+ if (set) {
263
+ set.delete(handler);
264
+ if (set.size === 0)
265
+ this.handlers.delete(event);
266
+ }
267
+ }
268
+ async emit(event, data) {
269
+ const exact = this.handlers.get(event);
270
+ if (exact) {
271
+ for (const h of exact)
272
+ await h(data);
273
+ }
274
+ for (const [pattern, handlers] of this.handlers) {
275
+ if (pattern === event)
276
+ continue;
277
+ if (pattern.endsWith("*") && event.startsWith(pattern.slice(0, -1))) {
278
+ for (const h of handlers)
279
+ await h(data);
280
+ }
281
+ }
282
+ }
283
+ listEvents() {
284
+ return [...this.handlers.keys()];
285
+ }
286
+ clear() {
287
+ this.handlers.clear();
288
+ }
289
+ }
290
+
291
+ class PluginRegistry {
292
+ plugins = new Map;
293
+ eventBus = new EventBus;
294
+ workspaceConfig = {};
295
+ logs = [];
296
+ register(def) {
297
+ if (this.plugins.has(def.id)) {
298
+ throw new Error(`Plugin "${def.id}" is already registered.`);
299
+ }
300
+ this.plugins.set(def.id, { def, loaded: false });
301
+ }
302
+ async unregister(id) {
303
+ const entry = this.plugins.get(id);
304
+ if (!entry)
305
+ return;
306
+ if (entry.loaded)
307
+ await this.unload(id);
308
+ this.plugins.delete(id);
309
+ }
310
+ async load(id, kernel, ontologyRegistry, queryEngine) {
311
+ const entry = this.plugins.get(id);
312
+ if (!entry)
313
+ throw new Error(`Plugin "${id}" is not registered.`);
314
+ if (entry.loaded)
315
+ return;
316
+ if (entry.def.dependencies) {
317
+ for (const dep of entry.def.dependencies) {
318
+ const depEntry = this.plugins.get(dep);
319
+ if (!depEntry) {
320
+ throw new Error(`Plugin "${id}" depends on "${dep}" which is not registered.`);
321
+ }
322
+ if (!depEntry.loaded) {
323
+ await this.load(dep, kernel, ontologyRegistry, queryEngine);
324
+ }
325
+ }
326
+ }
327
+ if (entry.def.middleware && kernel) {
328
+ for (const mw of entry.def.middleware) {
329
+ kernel.addMiddleware(mw);
330
+ }
331
+ }
332
+ if (entry.def.ontologies && ontologyRegistry) {
333
+ for (const schema of entry.def.ontologies) {
334
+ try {
335
+ ontologyRegistry.register(schema);
336
+ } catch {}
337
+ }
338
+ }
339
+ if (entry.def.rules && queryEngine) {
340
+ for (const rule of entry.def.rules) {
341
+ queryEngine.addRule(rule);
342
+ }
343
+ }
344
+ if (entry.def.eventHandlers) {
345
+ for (const eh of entry.def.eventHandlers) {
346
+ this.eventBus.on(eh.event, eh.handler);
347
+ }
348
+ }
349
+ const ctx = this._buildContext(id);
350
+ if (entry.def.onLoad) {
351
+ await entry.def.onLoad(ctx);
352
+ }
353
+ entry.loaded = true;
354
+ await this.eventBus.emit("plugin:loaded", { pluginId: id });
355
+ }
356
+ async unload(id) {
357
+ const entry = this.plugins.get(id);
358
+ if (!entry || !entry.loaded)
359
+ return;
360
+ const ctx = this._buildContext(id);
361
+ if (entry.def.onUnload) {
362
+ await entry.def.onUnload(ctx);
363
+ }
364
+ if (entry.def.eventHandlers) {
365
+ for (const eh of entry.def.eventHandlers) {
366
+ this.eventBus.off(eh.event, eh.handler);
367
+ }
368
+ }
369
+ entry.loaded = false;
370
+ await this.eventBus.emit("plugin:unloaded", { pluginId: id });
371
+ }
372
+ async loadAll(kernel, ontologyRegistry, queryEngine) {
373
+ const order = this._resolveDependencyOrder();
374
+ for (const id of order) {
375
+ await this.load(id, kernel, ontologyRegistry, queryEngine);
376
+ }
377
+ }
378
+ async unloadAll() {
379
+ const order = this._resolveDependencyOrder().reverse();
380
+ for (const id of order) {
381
+ await this.unload(id);
382
+ }
383
+ }
384
+ get(id) {
385
+ return this.plugins.get(id)?.def;
386
+ }
387
+ isLoaded(id) {
388
+ return this.plugins.get(id)?.loaded ?? false;
389
+ }
390
+ list() {
391
+ return [...this.plugins.values()];
392
+ }
393
+ listLoaded() {
394
+ return [...this.plugins.values()].filter((e) => e.loaded).map((e) => e.def);
395
+ }
396
+ getEventBus() {
397
+ return this.eventBus;
398
+ }
399
+ async emit(event, data) {
400
+ await this.eventBus.emit(event, data);
401
+ }
402
+ on(event, handler) {
403
+ this.eventBus.on(event, handler);
404
+ }
405
+ getWorkspaceConfig() {
406
+ return this.workspaceConfig;
407
+ }
408
+ setWorkspaceConfig(config) {
409
+ this.workspaceConfig = config;
410
+ }
411
+ getConfigValue(key) {
412
+ return this.workspaceConfig.settings?.[key];
413
+ }
414
+ setConfigValue(key, value) {
415
+ if (!this.workspaceConfig.settings)
416
+ this.workspaceConfig.settings = {};
417
+ this.workspaceConfig.settings[key] = value;
418
+ }
419
+ getLogs(pluginId) {
420
+ if (pluginId)
421
+ return this.logs.filter((l) => l.pluginId === pluginId);
422
+ return [...this.logs];
423
+ }
424
+ _buildContext(pluginId) {
425
+ return {
426
+ pluginId,
427
+ on: (event, handler) => this.eventBus.on(event, handler),
428
+ emit: (event, data) => {
429
+ this.eventBus.emit(event, data);
430
+ },
431
+ getConfig: (key) => this.getConfigValue(key),
432
+ log: (message) => {
433
+ this.logs.push({ pluginId, message, timestamp: new Date().toISOString() });
434
+ }
435
+ };
436
+ }
437
+ _resolveDependencyOrder() {
438
+ const visited = new Set;
439
+ const order = [];
440
+ const visit = (id, stack) => {
441
+ if (visited.has(id))
442
+ return;
443
+ if (stack.has(id))
444
+ throw new Error(`Circular dependency detected: ${[...stack, id].join(" \u2192 ")}`);
445
+ stack.add(id);
446
+ const entry = this.plugins.get(id);
447
+ if (entry?.def.dependencies) {
448
+ for (const dep of entry.def.dependencies) {
449
+ visit(dep, stack);
450
+ }
451
+ }
452
+ stack.delete(id);
453
+ visited.add(id);
454
+ order.push(id);
455
+ };
456
+ for (const id of this.plugins.keys()) {
457
+ visit(id, new Set);
458
+ }
459
+ return order;
460
+ }
461
+ }
8
462
  export {
463
+ validateStore,
464
+ validateEntity,
465
+ teamOntology,
466
+ projectOntology,
467
+ parseSimple,
468
+ parseRule,
469
+ parseQuery,
9
470
  jsonEntityFacts,
10
471
  flatten,
11
- EAVStore
472
+ createValidationMiddleware,
473
+ builtinOntologies,
474
+ agentOntology,
475
+ TrellisKernel,
476
+ SqliteKernelBackend,
477
+ QueryEngine,
478
+ PluginRegistry,
479
+ OntologyRegistry,
480
+ EventBus,
481
+ EAVStore,
482
+ DatalogRuntime,
483
+ AgentHarness
12
484
  };
@@ -3,12 +3,15 @@ import {
3
3
  HookRegistry,
4
4
  getDecision,
5
5
  getDecisionChain,
6
+ init_decisions,
6
7
  queryDecisions,
7
8
  recordDecision,
8
9
  wrapToolHandler
9
- } from "../index-8pce39mh.js";
10
- import"../index-fd4e26s4.js";
10
+ } from "../index-65z0xfjw.js";
11
+ import"../index-v9b4hqa7.js";
11
12
  import"../index-a76rekgs.js";
13
+ init_decisions();
14
+
12
15
  export {
13
16
  wrapToolHandler,
14
17
  recordDecision,
@@ -3,6 +3,7 @@ import {
3
3
  DEFAULT_MODEL_CONFIG,
4
4
  EmbeddingManager,
5
5
  VectorStore,
6
+ buildRAGContext,
6
7
  chunkCodeEntities,
7
8
  chunkDecision,
8
9
  chunkDocComments,
@@ -12,13 +13,14 @@ import {
12
13
  chunkMilestone,
13
14
  chunkSummary,
14
15
  cosineSimilarity,
16
+ createAutoEmbedMiddleware,
15
17
  embed,
16
18
  embedBatch,
17
19
  init_embeddings,
18
20
  loadModel,
19
21
  resetModel,
20
22
  slidingWindow
21
- } from "../index-zf6htvnm.js";
23
+ } from "../index-7gvjxt27.js";
22
24
  import"../index-a76rekgs.js";
23
25
  init_embeddings();
24
26
 
@@ -28,6 +30,7 @@ export {
28
30
  loadModel,
29
31
  embedBatch,
30
32
  embed,
33
+ createAutoEmbedMiddleware,
31
34
  cosineSimilarity,
32
35
  chunkSummary,
33
36
  chunkMilestone,
@@ -37,6 +40,7 @@ export {
37
40
  chunkDocComments,
38
41
  chunkDecision,
39
42
  chunkCodeEntities,
43
+ buildRAGContext,
40
44
  VectorStore,
41
45
  EmbeddingManager,
42
46
  DEFAULT_MODEL_CONFIG
@@ -5,9 +5,12 @@ import {
5
5
  decisionEntityId,
6
6
  dirEntityId,
7
7
  fileEntityId,
8
+ init_ops,
9
+ init_types,
8
10
  issueEntityId
9
- } from "./index-fd4e26s4.js";
11
+ } from "./index-v9b4hqa7.js";
10
12
  import {
13
+ __esm,
11
14
  __require
12
15
  } from "./index-a76rekgs.js";
13
16
 
@@ -377,6 +380,9 @@ function decompose(op) {
377
380
  }
378
381
  return result;
379
382
  }
383
+ var init_decompose = __esm(() => {
384
+ init_types();
385
+ });
380
386
 
381
387
  // src/vcs/blob-store.ts
382
388
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -452,6 +458,7 @@ class BlobStore {
452
458
  return Array.from(new Uint8Array(buffer)).map((b) => b.toString(16).padStart(2, "0")).join("");
453
459
  }
454
460
  }
461
+ var init_blob_store = () => {};
455
462
 
456
463
  // src/vcs/branch.ts
457
464
  import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
@@ -525,6 +532,9 @@ function loadBranchState(rootPath) {
525
532
  }
526
533
  return { currentBranch: "main" };
527
534
  }
535
+ var init_branch = __esm(() => {
536
+ init_ops();
537
+ });
528
538
 
529
539
  // src/vcs/milestone.ts
530
540
  async function createMilestone(ctx, message, opts) {
@@ -585,6 +595,9 @@ function listMilestones(ctx) {
585
595
  };
586
596
  });
587
597
  }
598
+ var init_milestone = __esm(() => {
599
+ init_ops();
600
+ });
588
601
 
589
602
  // src/vcs/checkpoint.ts
590
603
  async function createCheckpoint(ctx, trigger = "manual") {
@@ -609,6 +622,9 @@ function listCheckpoints(ctx) {
609
622
  };
610
623
  });
611
624
  }
625
+ var init_checkpoint = __esm(() => {
626
+ init_ops();
627
+ });
612
628
 
613
629
  // src/vcs/diff.ts
614
630
  function diffFileStates(stateA, stateB, blobStore) {
@@ -849,6 +865,7 @@ function createHunk(edits, start, end) {
849
865
  edits: hunkEdits
850
866
  };
851
867
  }
868
+ var init_diff = () => {};
852
869
 
853
870
  // src/vcs/merge.ts
854
871
  function threeWayMerge(base, ours, theirs, blobStore) {
@@ -1122,13 +1139,13 @@ function lcsMatch(a, b) {
1122
1139
  }
1123
1140
  return matches;
1124
1141
  }
1142
+ var init_merge = () => {};
1125
1143
 
1126
1144
  // src/vcs/issue.ts
1127
1145
  import { exec } from "child_process";
1128
1146
  import { promisify } from "util";
1129
1147
  import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSync as mkdirSync2 } from "fs";
1130
1148
  import { join as join3, dirname as dirname2 } from "path";
1131
- var execAsync = promisify(exec);
1132
1149
  function getIssueCounterPath(rootPath) {
1133
1150
  return join3(rootPath, ".trellis", "issue-counter.json");
1134
1151
  }
@@ -1552,5 +1569,11 @@ function checkCompletionReadiness(ctx) {
1552
1569
  return { ready, queue, paused, inProgress, summary: parts.join(`
1553
1570
  `) };
1554
1571
  }
1572
+ var execAsync;
1573
+ var init_issue = __esm(() => {
1574
+ init_ops();
1575
+ init_types();
1576
+ execAsync = promisify(exec);
1577
+ });
1555
1578
 
1556
- export { decompose, BlobStore, createBranch, switchBranch, listBranches, deleteBranch, saveBranchState, loadBranchState, createMilestone, listMilestones, createCheckpoint, listCheckpoints, diffFileStates, buildFileStateAtOp, diffOpRange, generateUnifiedDiff, myersDiff, threeWayMerge, threeWayTextMerge, createIssue, updateIssue, startIssue, pauseIssue, resumeIssue, closeIssue, triageIssue, reopenIssue, assignIssue, blockIssue, unblockIssue, addCriterion, setCriterionStatus, runCriteria, listIssues, getIssue, getActiveIssues, checkCompletionReadiness };
1579
+ export { decompose, init_decompose, BlobStore, init_blob_store, createBranch, switchBranch, listBranches, deleteBranch, saveBranchState, loadBranchState, init_branch, createMilestone, listMilestones, init_milestone, createCheckpoint, listCheckpoints, init_checkpoint, diffFileStates, buildFileStateAtOp, diffOpRange, generateUnifiedDiff, myersDiff, init_diff, threeWayMerge, threeWayTextMerge, init_merge, createIssue, updateIssue, startIssue, pauseIssue, resumeIssue, closeIssue, triageIssue, reopenIssue, assignIssue, blockIssue, unblockIssue, addCriterion, setCriterionStatus, runCriteria, listIssues, getIssue, getActiveIssues, checkCompletionReadiness, init_issue };