@treenity/mods 3.0.3 → 3.0.4
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/dist/agent/client.d.ts +3 -0
- package/dist/agent/client.d.ts.map +1 -0
- package/dist/agent/client.js +3 -0
- package/dist/agent/client.js.map +1 -0
- package/dist/agent/guardian.d.ts +47 -0
- package/dist/agent/guardian.d.ts.map +1 -0
- package/dist/agent/guardian.js +452 -0
- package/dist/agent/guardian.js.map +1 -0
- package/dist/agent/seed.d.ts +2 -0
- package/dist/agent/seed.d.ts.map +1 -0
- package/dist/agent/seed.js +68 -0
- package/dist/agent/seed.js.map +1 -0
- package/dist/agent/server.d.ts +5 -0
- package/dist/agent/server.d.ts.map +1 -0
- package/dist/agent/server.js +5 -0
- package/dist/agent/server.js.map +1 -0
- package/dist/agent/service.d.ts +2 -0
- package/dist/agent/service.d.ts.map +1 -0
- package/dist/agent/service.js +556 -0
- package/dist/agent/service.js.map +1 -0
- package/dist/agent/types.d.ts +115 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +168 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/agent/view.d.ts +2 -0
- package/dist/agent/view.d.ts.map +1 -0
- package/dist/agent/view.js +137 -0
- package/dist/agent/view.js.map +1 -0
- package/dist/mcp/mcp-server.d.ts +16 -0
- package/dist/mcp/mcp-server.d.ts.map +1 -0
- package/dist/mcp/mcp-server.js +344 -0
- package/dist/mcp/mcp-server.js.map +1 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +3 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/service.d.ts +2 -0
- package/dist/mcp/service.d.ts.map +1 -0
- package/dist/mcp/service.js +16 -0
- package/dist/mcp/service.js.map +1 -0
- package/dist/mcp/types.d.ts +4 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +6 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/metatron/claude.d.ts +30 -0
- package/dist/metatron/claude.d.ts.map +1 -0
- package/dist/metatron/claude.js +201 -0
- package/dist/metatron/claude.js.map +1 -0
- package/dist/metatron/client.d.ts +3 -0
- package/dist/metatron/client.d.ts.map +1 -0
- package/dist/metatron/client.js +3 -0
- package/dist/metatron/client.js.map +1 -0
- package/dist/metatron/mentions.d.ts +9 -0
- package/dist/metatron/mentions.d.ts.map +1 -0
- package/dist/metatron/mentions.js +21 -0
- package/dist/metatron/mentions.js.map +1 -0
- package/dist/metatron/permissions.d.ts +16 -0
- package/dist/metatron/permissions.d.ts.map +1 -0
- package/dist/metatron/permissions.js +52 -0
- package/dist/metatron/permissions.js.map +1 -0
- package/dist/metatron/seed.d.ts +2 -0
- package/dist/metatron/seed.d.ts.map +1 -0
- package/dist/metatron/seed.js +41 -0
- package/dist/metatron/seed.js.map +1 -0
- package/dist/metatron/server.d.ts +4 -0
- package/dist/metatron/server.d.ts.map +1 -0
- package/dist/metatron/server.js +4 -0
- package/dist/metatron/server.js.map +1 -0
- package/dist/metatron/service.d.ts +2 -0
- package/dist/metatron/service.d.ts.map +1 -0
- package/dist/metatron/service.js +361 -0
- package/dist/metatron/service.js.map +1 -0
- package/dist/metatron/types.d.ts +76 -0
- package/dist/metatron/types.d.ts.map +1 -0
- package/dist/metatron/types.js +112 -0
- package/dist/metatron/types.js.map +1 -0
- package/dist/metatron/view.d.ts +4 -0
- package/dist/metatron/view.d.ts.map +1 -0
- package/dist/metatron/view.js +5 -0
- package/dist/metatron/view.js.map +1 -0
- package/dist/metatron/views/config.d.ts +2 -0
- package/dist/metatron/views/config.d.ts.map +1 -0
- package/dist/metatron/views/config.js +116 -0
- package/dist/metatron/views/config.js.map +1 -0
- package/dist/metatron/views/log.d.ts +18 -0
- package/dist/metatron/views/log.d.ts.map +1 -0
- package/dist/metatron/views/log.js +224 -0
- package/dist/metatron/views/log.js.map +1 -0
- package/dist/metatron/views/shared.d.ts +13 -0
- package/dist/metatron/views/shared.d.ts.map +1 -0
- package/dist/metatron/views/shared.js +33 -0
- package/dist/metatron/views/shared.js.map +1 -0
- package/dist/metatron/views/task.d.ts +4 -0
- package/dist/metatron/views/task.d.ts.map +1 -0
- package/dist/metatron/views/task.js +106 -0
- package/dist/metatron/views/task.js.map +1 -0
- package/dist/metatron/views/workspace.d.ts +2 -0
- package/dist/metatron/views/workspace.d.ts.map +1 -0
- package/dist/metatron/views/workspace.js +138 -0
- package/dist/metatron/views/workspace.js.map +1 -0
- package/metatron/CLAUDE.md +22 -0
- package/metatron/claude.ts +258 -0
- package/metatron/client.ts +2 -0
- package/metatron/mentions.ts +31 -0
- package/metatron/permissions.ts +76 -0
- package/metatron/seed.ts +50 -0
- package/metatron/server.ts +3 -0
- package/metatron/service.ts +406 -0
- package/metatron/types.ts +120 -0
- package/metatron/view.tsx +4 -0
- package/metatron/views/config.tsx +408 -0
- package/metatron/views/log.tsx +412 -0
- package/metatron/views/shared.tsx +40 -0
- package/metatron/views/task.tsx +255 -0
- package/metatron/views/workspace.tsx +418 -0
- package/package.json +2 -1
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
// Metatron — AI task queue + Claude CLI service
|
|
2
|
+
// 1. action:task — creates task nodes in /metatron inbox
|
|
3
|
+
// 2. service — watches for pending tasks, auto-invokes Claude CLI via MCP
|
|
4
|
+
// Prompt lives in the node (systemPrompt). First run sends full prompt.
|
|
5
|
+
// Subsequent runs (with sessionId) send just "check inbox" — Claude already has context.
|
|
6
|
+
// Streaming: progress visible on running task nodes in real-time.
|
|
7
|
+
// Abort: user can stop a running task via task.stop() → abortQuery in claude.ts.
|
|
8
|
+
// Inject: user can queue messages via task.inject() → processed after current run.
|
|
9
|
+
import { createNode, register } from '@treenity/core';
|
|
10
|
+
import { buildClaims, withAcl } from '@treenity/core/server/auth';
|
|
11
|
+
import { debouncedWrite } from '@treenity/core/util/debounced-write';
|
|
12
|
+
import { findTranscriptsDir, getSessionText, listSessions as listSessionsFn, searchTranscripts, } from '@treenity/recall';
|
|
13
|
+
import { closeSession, invokeClaude } from './claude';
|
|
14
|
+
import { uniqueMentionPaths } from './mentions';
|
|
15
|
+
const log = (msg) => console.log(`[metatron] ${msg}`);
|
|
16
|
+
const CHECK_INBOX = 'Check your inbox at /metatron/inbox. Process all pending tasks.';
|
|
17
|
+
// ── Transcript actions (Claude Code session access) ──
|
|
18
|
+
/** @description List recent Claude Code sessions from disk */
|
|
19
|
+
register('metatron.config', 'action:listSessions', async (_ctx, data) => {
|
|
20
|
+
try {
|
|
21
|
+
const dir = findTranscriptsDir();
|
|
22
|
+
return listSessionsFn(dir, data?.lastN ?? 30);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
}, { description: 'List recent Claude Code sessions' });
|
|
28
|
+
/** @description Search Claude Code session transcripts */
|
|
29
|
+
register('metatron.config', 'action:searchSessions', async (_ctx, data) => {
|
|
30
|
+
try {
|
|
31
|
+
const dir = findTranscriptsDir();
|
|
32
|
+
return await searchTranscripts({ dir, query: data.query, maxResults: data.maxResults ?? 20 });
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
}, { description: 'Search session transcripts' });
|
|
38
|
+
/** @description Read a Claude Code session text by ID prefix */
|
|
39
|
+
register('metatron.config', 'action:readSession', async (_ctx, data) => {
|
|
40
|
+
try {
|
|
41
|
+
const dir = findTranscriptsDir();
|
|
42
|
+
return getSessionText(dir, data.sessionId, { maxLength: data.maxLength ?? 30000 });
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return 'Session not found';
|
|
46
|
+
}
|
|
47
|
+
}, { description: 'Read session text' });
|
|
48
|
+
// ── Load enabled skills from /metatron/skills/* ──
|
|
49
|
+
async function loadSkills(ctx, configPath) {
|
|
50
|
+
try {
|
|
51
|
+
const { items } = await ctx.tree.getChildren(`${configPath}/skills`);
|
|
52
|
+
const enabled = items.filter(s => s.$type === 'metatron.skill' && s.enabled && s.prompt);
|
|
53
|
+
if (!enabled.length)
|
|
54
|
+
return '';
|
|
55
|
+
const sections = enabled.map(s => {
|
|
56
|
+
const name = String(s.name || s.$path.split('/').at(-1));
|
|
57
|
+
return `### ${name}\n${String(s.prompt)}`;
|
|
58
|
+
});
|
|
59
|
+
log(` loaded ${enabled.length} skill(s)`);
|
|
60
|
+
return '\n\n## Active Skills\n\n' + sections.join('\n\n');
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// ── Load permission rules from /metatron/permissions/* ──
|
|
67
|
+
async function loadPermissions(ctx, configPath) {
|
|
68
|
+
try {
|
|
69
|
+
const { items } = await ctx.tree.getChildren(`${configPath}/permissions`);
|
|
70
|
+
const rules = items
|
|
71
|
+
.filter(n => n.$type === 'metatron.permission' && n.tool)
|
|
72
|
+
.map(n => ({
|
|
73
|
+
tool: String(n.tool),
|
|
74
|
+
pathPattern: String(n.pathPattern || ''),
|
|
75
|
+
policy: n.policy || 'allow',
|
|
76
|
+
}));
|
|
77
|
+
if (rules.length)
|
|
78
|
+
log(` loaded ${rules.length} permission rule(s)`);
|
|
79
|
+
return rules;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// ── Resolve @/path mentions in prompts → context section ──
|
|
86
|
+
// Uses ACL-wrapped tree scoped to the task creator's permissions.
|
|
87
|
+
// withAcl.get() returns undefined for denied paths — no existence leakage.
|
|
88
|
+
const SENSITIVE_RE = /(password|secret|token|key|hash|credentials|apiKey|api_key)/i;
|
|
89
|
+
export async function resolveContext(store, prompts, createdBy) {
|
|
90
|
+
const allPaths = new Set();
|
|
91
|
+
for (const p of prompts) {
|
|
92
|
+
for (const path of uniqueMentionPaths(p))
|
|
93
|
+
allPaths.add(path);
|
|
94
|
+
}
|
|
95
|
+
if (!allPaths.size)
|
|
96
|
+
return '';
|
|
97
|
+
// ACL-scoped tree for the task creator
|
|
98
|
+
const claims = createdBy ? await buildClaims(store, createdBy) : ['public'];
|
|
99
|
+
const userTree = withAcl(store, createdBy, claims);
|
|
100
|
+
const MAX_MENTIONS = 5;
|
|
101
|
+
const paths = [...allPaths].slice(0, MAX_MENTIONS);
|
|
102
|
+
const sections = [];
|
|
103
|
+
for (const path of paths) {
|
|
104
|
+
try {
|
|
105
|
+
const node = await userTree.get(path);
|
|
106
|
+
if (!node) {
|
|
107
|
+
sections.push(`### ${path}\n(not found or access denied)`);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
// Include type + top-level fields, strip system and sensitive fields
|
|
111
|
+
const summary = { $type: node.$type };
|
|
112
|
+
// use getComponents for this loop
|
|
113
|
+
for (const [k, v] of Object.entries(node)) {
|
|
114
|
+
if (k.startsWith('$'))
|
|
115
|
+
continue;
|
|
116
|
+
if (SENSITIVE_RE.test(k))
|
|
117
|
+
continue;
|
|
118
|
+
if (typeof v === 'object' && v && '$type' in v) {
|
|
119
|
+
// Named component — filter its keys too
|
|
120
|
+
const comp = { $type: v.$type };
|
|
121
|
+
for (const [ck, cv] of Object.entries(v)) {
|
|
122
|
+
if (ck.startsWith('$') || SENSITIVE_RE.test(ck))
|
|
123
|
+
continue;
|
|
124
|
+
comp[ck] = typeof cv === 'string' && cv.length > 500 ? cv.slice(0, 500) + '...' : cv;
|
|
125
|
+
}
|
|
126
|
+
summary[k] = comp;
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (typeof v === 'string' && v.length > 500) {
|
|
130
|
+
summary[k] = v.slice(0, 500) + '...';
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
summary[k] = v;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
sections.push(`### ${path}\n\`\`\`json\n${JSON.stringify(summary, null, 2)}\n\`\`\``);
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
sections.push(`### ${path}\n(error reading node)`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return '\n\n## Referenced Nodes\n\n' + sections.join('\n\n');
|
|
143
|
+
}
|
|
144
|
+
// ── Action: create a task ──
|
|
145
|
+
/** @description Create a task for AI processing in the Metatron inbox */
|
|
146
|
+
register('metatron.config', 'action:task', async (ctx, data) => {
|
|
147
|
+
if (!data.prompt)
|
|
148
|
+
throw new Error('prompt is required');
|
|
149
|
+
const id = `t-${Date.now()}`;
|
|
150
|
+
const taskPath = `${ctx.node.$path}/tasks/${id}`;
|
|
151
|
+
await ctx.tree.set(createNode(taskPath, 'metatron.task', {
|
|
152
|
+
prompt: data.prompt,
|
|
153
|
+
status: 'pending',
|
|
154
|
+
createdAt: Date.now(),
|
|
155
|
+
createdBy: ctx.userId ?? null,
|
|
156
|
+
}));
|
|
157
|
+
log(`task created: ${taskPath} — "${data.prompt.slice(0, 80)}"`);
|
|
158
|
+
return { taskPath };
|
|
159
|
+
}, { description: 'Create a task for AI', params: 'prompt' });
|
|
160
|
+
// ── Service: watch inbox, auto-invoke Claude ──
|
|
161
|
+
register('metatron.config', 'service', async (node, ctx) => {
|
|
162
|
+
let running = false;
|
|
163
|
+
let stopped = false;
|
|
164
|
+
let pendingRecheck = false;
|
|
165
|
+
let runCount = 0;
|
|
166
|
+
log(`service started at ${node.$path}`);
|
|
167
|
+
async function updateTask(path, fields) {
|
|
168
|
+
const task = await ctx.tree.get(path);
|
|
169
|
+
if (task)
|
|
170
|
+
await ctx.tree.set({ ...task, ...fields });
|
|
171
|
+
}
|
|
172
|
+
async function updateRunningTasks(paths, output) {
|
|
173
|
+
for (const p of paths) {
|
|
174
|
+
const task = await ctx.tree.get(p);
|
|
175
|
+
if (task && task.status === 'running') {
|
|
176
|
+
const { $rev: _, ...rest } = task;
|
|
177
|
+
await ctx.tree.set({ ...rest, log: output });
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// Check if any running tasks have queued inject messages
|
|
182
|
+
async function drainInjected(paths) {
|
|
183
|
+
for (const p of paths) {
|
|
184
|
+
const task = await ctx.tree.get(p);
|
|
185
|
+
const injected = task?.injected;
|
|
186
|
+
if (injected?.length) {
|
|
187
|
+
const messages = [...injected];
|
|
188
|
+
await ctx.tree.set({ ...task, injected: [] });
|
|
189
|
+
return messages.join('\n\n');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return null;
|
|
193
|
+
}
|
|
194
|
+
async function processInbox() {
|
|
195
|
+
if (running) {
|
|
196
|
+
log('already running, will recheck after');
|
|
197
|
+
pendingRecheck = true;
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (stopped)
|
|
201
|
+
return;
|
|
202
|
+
const tasksPath = `${node.$path}/tasks`;
|
|
203
|
+
const { items } = await ctx.tree.getChildren(tasksPath);
|
|
204
|
+
const tasks = items.filter(t => t.$type === 'metatron.task');
|
|
205
|
+
const pending = tasks.filter(t => t.status === 'pending');
|
|
206
|
+
// Recover tasks stuck in "running" from a previous crash
|
|
207
|
+
const stuck = tasks.filter(t => t.status === 'running');
|
|
208
|
+
for (const t of stuck) {
|
|
209
|
+
log(` recovering stuck task: ${t.$path} -> pending`);
|
|
210
|
+
await updateTask(t.$path, { status: 'pending', result: '' });
|
|
211
|
+
pending.push(t);
|
|
212
|
+
}
|
|
213
|
+
log(`inbox scan: ${pending.length} pending / ${tasks.length} total tasks`);
|
|
214
|
+
if (!pending.length)
|
|
215
|
+
return;
|
|
216
|
+
running = true;
|
|
217
|
+
runCount++;
|
|
218
|
+
const runId = runCount;
|
|
219
|
+
log(`run #${runId}: processing ${pending.length} task(s)...`);
|
|
220
|
+
const runningPaths = pending.map(t => t.$path);
|
|
221
|
+
// Mark all pending tasks as "running" with initial progress
|
|
222
|
+
for (const t of pending) {
|
|
223
|
+
log(` -> running: ${t.$path}`);
|
|
224
|
+
await updateTask(t.$path, { status: 'running', result: 'Waiting for Claude...' });
|
|
225
|
+
}
|
|
226
|
+
try {
|
|
227
|
+
const config = await ctx.tree.get(node.$path);
|
|
228
|
+
const sessionId = config.sessionId || '';
|
|
229
|
+
const systemPrompt = config.systemPrompt || '';
|
|
230
|
+
const isResume = !!sessionId;
|
|
231
|
+
const skillsSection = isResume ? '' : await loadSkills(ctx, node.$path);
|
|
232
|
+
const taskPrompts = pending.map(t => String(t.prompt || ''));
|
|
233
|
+
const createdBy = pending[0]?.createdBy ?? null;
|
|
234
|
+
const contextSection = isResume ? '' : await resolveContext(ctx.tree, taskPrompts, createdBy);
|
|
235
|
+
const prompt = isResume ? CHECK_INBOX : (systemPrompt + skillsSection + contextSection) || CHECK_INBOX;
|
|
236
|
+
const permissionRules = await loadPermissions(ctx, node.$path);
|
|
237
|
+
log(`run #${runId}: ${isResume ? 'RESUME session ' + sessionId.slice(0, 8) + '...' : 'NEW session (' + prompt.length + ' chars)'}`);
|
|
238
|
+
// Stream output — debounced progress updates
|
|
239
|
+
let tailBuf = '';
|
|
240
|
+
const progress = debouncedWrite(async () => {
|
|
241
|
+
await updateRunningTasks(runningPaths, tailBuf);
|
|
242
|
+
}, 2000, 'metatron.progress');
|
|
243
|
+
const onOutput = (chunk) => {
|
|
244
|
+
tailBuf += chunk;
|
|
245
|
+
progress.trigger();
|
|
246
|
+
};
|
|
247
|
+
let result;
|
|
248
|
+
try {
|
|
249
|
+
result = await invokeClaude(prompt, {
|
|
250
|
+
key: node.$path,
|
|
251
|
+
sessionId: sessionId || undefined,
|
|
252
|
+
model: config.model || undefined,
|
|
253
|
+
permissionRules,
|
|
254
|
+
onOutput,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
catch (sessionErr) {
|
|
258
|
+
if (isResume) {
|
|
259
|
+
const errMsg = sessionErr instanceof Error ? sessionErr.message : String(sessionErr);
|
|
260
|
+
log(` session resume failed: ${errMsg} — clearing session, retrying fresh`);
|
|
261
|
+
closeSession(node.$path);
|
|
262
|
+
const freshConfig = await ctx.tree.get(node.$path);
|
|
263
|
+
await ctx.tree.set({ ...freshConfig, sessionId: '' });
|
|
264
|
+
tailBuf = '';
|
|
265
|
+
const retrySkills = await loadSkills(ctx, node.$path);
|
|
266
|
+
result = await invokeClaude((systemPrompt + retrySkills) || CHECK_INBOX, {
|
|
267
|
+
key: node.$path,
|
|
268
|
+
model: config.model || undefined,
|
|
269
|
+
permissionRules,
|
|
270
|
+
onOutput,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
throw sessionErr;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
progress.cancel();
|
|
278
|
+
// Final update on config: session ID + last run
|
|
279
|
+
const fresh = await ctx.tree.get(node.$path);
|
|
280
|
+
await ctx.tree.set({
|
|
281
|
+
...fresh,
|
|
282
|
+
sessionId: result.sessionId ?? fresh.sessionId,
|
|
283
|
+
lastRun: Date.now(),
|
|
284
|
+
});
|
|
285
|
+
// Task status: aborted → done (with log preserved), error → error, else → done
|
|
286
|
+
const finalStatus = result.aborted ? 'done' : result.error ? 'error' : 'done';
|
|
287
|
+
for (const p of runningPaths) {
|
|
288
|
+
const task = await ctx.tree.get(p);
|
|
289
|
+
if (task) {
|
|
290
|
+
await ctx.tree.set({
|
|
291
|
+
...task,
|
|
292
|
+
status: finalStatus,
|
|
293
|
+
log: result.output,
|
|
294
|
+
result: result.aborted
|
|
295
|
+
? (result.text || '[interrupted by user]')
|
|
296
|
+
: (result.text || result.output),
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
log(`run #${runId}: ${result.aborted ? 'ABORTED' : 'done'}. session=${result.sessionId?.slice(0, 8) ?? 'none'} cost=$${result.costUsd ?? '?'}`);
|
|
301
|
+
// Check for injected follow-up messages — if found, process them immediately
|
|
302
|
+
if (!result.aborted && result.sessionId) {
|
|
303
|
+
const followUp = await drainInjected(runningPaths);
|
|
304
|
+
if (followUp) {
|
|
305
|
+
log(`run #${runId}: processing injected follow-up`);
|
|
306
|
+
running = false; // allow re-entry
|
|
307
|
+
// Re-set tasks to running for the follow-up
|
|
308
|
+
for (const p of runningPaths) {
|
|
309
|
+
await updateTask(p, { status: 'running', result: 'Processing follow-up...' });
|
|
310
|
+
}
|
|
311
|
+
// Recursive process with pending tasks will pick them up
|
|
312
|
+
pendingRecheck = true;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
catch (err) {
|
|
317
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
318
|
+
log(`run #${runId}: FAILED — ${msg}`);
|
|
319
|
+
// Revert running tasks back to pending so they can be retried
|
|
320
|
+
for (const p of runningPaths) {
|
|
321
|
+
const current = await ctx.tree.get(p);
|
|
322
|
+
if (current && current.status === 'running') {
|
|
323
|
+
log(` -> reverting to pending: ${p}`);
|
|
324
|
+
await ctx.tree.set({ ...current, status: 'pending', result: `Error: ${msg}` });
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
const fresh = await ctx.tree.get(node.$path);
|
|
328
|
+
await ctx.tree.set({
|
|
329
|
+
...fresh,
|
|
330
|
+
lastRun: Date.now(),
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
finally {
|
|
334
|
+
running = false;
|
|
335
|
+
}
|
|
336
|
+
if (!stopped && pendingRecheck) {
|
|
337
|
+
pendingRecheck = false;
|
|
338
|
+
log('recheck triggered (new tasks arrived during run)');
|
|
339
|
+
processInbox();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
const unsub = ctx.subscribe(`${node.$path}/tasks`, (event) => {
|
|
343
|
+
log(`event: ${event.type} ${event.path}`);
|
|
344
|
+
if (event.type === 'set' || event.type === 'patch') {
|
|
345
|
+
processInbox();
|
|
346
|
+
}
|
|
347
|
+
}, { children: true });
|
|
348
|
+
// Initial inbox check on startup
|
|
349
|
+
log('initial inbox check...');
|
|
350
|
+
processInbox();
|
|
351
|
+
return {
|
|
352
|
+
stop: async () => {
|
|
353
|
+
log('service stopping');
|
|
354
|
+
stopped = true;
|
|
355
|
+
unsub();
|
|
356
|
+
closeSession(node.$path);
|
|
357
|
+
log('service stopped');
|
|
358
|
+
},
|
|
359
|
+
};
|
|
360
|
+
});
|
|
361
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../metatron/service.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,yDAAyD;AACzD,0EAA0E;AAC1E,wEAAwE;AACxE,yFAAyF;AACzF,kEAAkE;AAClE,iFAAiF;AACjF,mFAAmF;AAEnF,OAAO,EAAE,UAAU,EAAiB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGrE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,YAAY,IAAI,cAAc,EAC9B,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,EAAE,CAAC,CAAC;AAE9D,MAAM,WAAW,GAAG,iEAAiE,CAAC;AAEtF,wDAAwD;AAExD,8DAA8D;AAC9D,QAAQ,CAAC,iBAAiB,EAAE,qBAAqB,EAAE,KAAK,EAAE,IAAe,EAAE,IAAwB,EAAE,EAAE;IACrG,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;QACjC,OAAO,cAAc,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC,E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CAAC;YACzD,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;gBACjB,GAAG,KAAK;gBACR,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE;aACpB,CAAC,CAAC;QACL,CAAC;gBAAS,CAAC;YACT,OAAO,GAAG,KAAK,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,OAAO,IAAI,cAAc,EAAE,CAAC;YAC/B,cAAc,GAAG,KAAK,CAAC;YACvB,GAAG,CAAC,kDAAkD,CAAC,CAAC;YACxD,YAAY,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,KAAK,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;QAC3D,GAAG,CAAC,UAAU,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1C,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACnD,YAAY,EAAE,CAAC;QACjB,CAAC;IACH,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAEvB,iCAAiC;IACjC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC9B,YAAY,EAAE,CAAC;IAEf,OAAO;QACL,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,GAAG,CAAC,kBAAkB,CAAC,CAAC;YACxB,OAAO,GAAG,IAAI,CAAC;YACf,KAAK,EAAE,CAAC;YACR,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACzB,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** AI orchestrator config — model, system prompt, session tracking */
|
|
2
|
+
export declare class MetatronConfig {
|
|
3
|
+
model: string;
|
|
4
|
+
/** @format textarea */
|
|
5
|
+
systemPrompt: string;
|
|
6
|
+
sessionId: string;
|
|
7
|
+
lastRun: number;
|
|
8
|
+
}
|
|
9
|
+
/** AI task — prompt with status and result of LLM execution */
|
|
10
|
+
export declare class MetatronTask {
|
|
11
|
+
/** @format textarea */
|
|
12
|
+
prompt: string;
|
|
13
|
+
status: 'pending' | 'running' | 'done' | 'error';
|
|
14
|
+
/** @format textarea */
|
|
15
|
+
result: string;
|
|
16
|
+
/** @format textarea */
|
|
17
|
+
log: string;
|
|
18
|
+
createdAt: number;
|
|
19
|
+
/** Queued user messages to process after current run */
|
|
20
|
+
injected: string[];
|
|
21
|
+
/** Source task path if forked */
|
|
22
|
+
forkedFrom: string;
|
|
23
|
+
/** Log position where the fork was made */
|
|
24
|
+
forkIndex: number;
|
|
25
|
+
/** @description Stop the running task */
|
|
26
|
+
stop(): Promise<void>;
|
|
27
|
+
/** @description Queue a follow-up message for the running task */
|
|
28
|
+
inject(data: {
|
|
29
|
+
text: string;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
/** @description Fork this conversation at a specific log position */
|
|
32
|
+
fork(data: {
|
|
33
|
+
atIndex: number;
|
|
34
|
+
}): Promise<{
|
|
35
|
+
taskPath: string;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
/** Permission rule — controls which tools Metatron is allowed to use */
|
|
39
|
+
export declare class MetatronPermission {
|
|
40
|
+
/** Tool name or glob pattern: 'mcp__treenity__*', '*' */
|
|
41
|
+
tool: string;
|
|
42
|
+
/** Optional input.path pattern */
|
|
43
|
+
pathPattern: string;
|
|
44
|
+
policy: 'allow' | 'deny';
|
|
45
|
+
createdAt: number;
|
|
46
|
+
}
|
|
47
|
+
/** Reusable prompt template for quick task creation */
|
|
48
|
+
export declare class MetatronTemplate {
|
|
49
|
+
name: string;
|
|
50
|
+
/** @format textarea */
|
|
51
|
+
prompt: string;
|
|
52
|
+
category: string;
|
|
53
|
+
}
|
|
54
|
+
/** Modular prompt fragment — learned skill or injected capability */
|
|
55
|
+
export declare class MetatronSkill {
|
|
56
|
+
name: string;
|
|
57
|
+
/** @format textarea */
|
|
58
|
+
prompt: string;
|
|
59
|
+
enabled: boolean;
|
|
60
|
+
category: string;
|
|
61
|
+
updatedAt: number;
|
|
62
|
+
}
|
|
63
|
+
/** Multi-task workspace — side-by-side columns of conversations */
|
|
64
|
+
export declare class MetatronWorkspace {
|
|
65
|
+
name: string;
|
|
66
|
+
columns: string[];
|
|
67
|
+
/** @description Add a task as a column */
|
|
68
|
+
addColumn(data: {
|
|
69
|
+
taskPath: string;
|
|
70
|
+
}): Promise<void>;
|
|
71
|
+
/** @description Remove a column by task path */
|
|
72
|
+
removeColumn(data: {
|
|
73
|
+
taskPath: string;
|
|
74
|
+
}): Promise<void>;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../metatron/types.ts"],"names":[],"mappings":"AAEA,sEAAsE;AACtE,qBAAa,cAAc;IACzB,KAAK,SAAqB;IAC1B,uBAAuB;IACvB,YAAY,SAAM;IAClB,SAAS,SAAM;IACf,OAAO,SAAK;CACb;AAED,+DAA+D;AAC/D,qBAAa,YAAY;IACvB,uBAAuB;IACvB,MAAM,SAAM;IACZ,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAa;IAC7D,uBAAuB;IACvB,MAAM,SAAM;IACZ,uBAAuB;IACvB,GAAG,SAAM;IACT,SAAS,SAAK;IACd,wDAAwD;IACxD,QAAQ,EAAE,MAAM,EAAE,CAAM;IACxB,iCAAiC;IACjC,UAAU,SAAM;IAChB,2CAA2C;IAC3C,SAAS,SAAK;IAEd,yCAAyC;IACnC,IAAI;IAQV,kEAAkE;IAC5D,MAAM,CAAC,IAAI,EAAE;QAAsB,IAAI,EAAE,MAAM,CAAA;KAAE;IAKvD,qEAAqE;IAC/D,IAAI,CAAC,IAAI,EAAE;QAA8C,OAAO,EAAE,MAAM,CAAA;KAAE;;;CAoBjF;AAED,wEAAwE;AACxE,qBAAa,kBAAkB;IAC7B,yDAAyD;IACzD,IAAI,SAAM;IACV,kCAAkC;IAClC,WAAW,SAAM;IACjB,MAAM,EAAE,OAAO,GAAG,MAAM,CAAW;IACnC,SAAS,SAAK;CACf;AAED,uDAAuD;AACvD,qBAAa,gBAAgB;IAC3B,IAAI,SAAM;IACV,uBAAuB;IACvB,MAAM,SAAM;IACZ,QAAQ,SAAM;CACf;AAED,qEAAqE;AACrE,qBAAa,aAAa;IACxB,IAAI,SAAM;IACV,uBAAuB;IACvB,MAAM,SAAM;IACZ,OAAO,UAAQ;IACf,QAAQ,SAAM;IACd,SAAS,SAAK;CACf;AAED,mEAAmE;AACnE,qBAAa,iBAAiB;IAC5B,IAAI,SAAM;IACV,OAAO,EAAE,MAAM,EAAE,CAAM;IAEvB,0CAA0C;IACpC,SAAS,CAAC,IAAI,EAAE;QAAmB,QAAQ,EAAE,MAAM,CAAA;KAAE;IAM3D,gDAAgD;IAC1C,YAAY,CAAC,IAAI,EAAE;QAAmB,QAAQ,EAAE,MAAM,CAAA;KAAE;CAK/D"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { getCtx, registerType } from '@treenity/core/comp';
|
|
2
|
+
/** AI orchestrator config — model, system prompt, session tracking */
|
|
3
|
+
export class MetatronConfig {
|
|
4
|
+
model = 'claude-opus-4-6';
|
|
5
|
+
/** @format textarea */
|
|
6
|
+
systemPrompt = '';
|
|
7
|
+
sessionId = '';
|
|
8
|
+
lastRun = 0;
|
|
9
|
+
}
|
|
10
|
+
/** AI task — prompt with status and result of LLM execution */
|
|
11
|
+
export class MetatronTask {
|
|
12
|
+
/** @format textarea */
|
|
13
|
+
prompt = '';
|
|
14
|
+
status = 'pending';
|
|
15
|
+
/** @format textarea */
|
|
16
|
+
result = '';
|
|
17
|
+
/** @format textarea */
|
|
18
|
+
log = '';
|
|
19
|
+
createdAt = 0;
|
|
20
|
+
/** Queued user messages to process after current run */
|
|
21
|
+
injected = [];
|
|
22
|
+
/** Source task path if forked */
|
|
23
|
+
forkedFrom = '';
|
|
24
|
+
/** Log position where the fork was made */
|
|
25
|
+
forkIndex = 0;
|
|
26
|
+
/** @description Stop the running task */
|
|
27
|
+
async stop() {
|
|
28
|
+
if (this.status !== 'running')
|
|
29
|
+
throw new Error('task is not running');
|
|
30
|
+
const { node } = getCtx();
|
|
31
|
+
const configPath = node.$path.replace(/\/tasks\/[^/]+$/, '');
|
|
32
|
+
const { abortQuery } = await import('./claude');
|
|
33
|
+
abortQuery(configPath);
|
|
34
|
+
}
|
|
35
|
+
/** @description Queue a follow-up message for the running task */
|
|
36
|
+
async inject(data) {
|
|
37
|
+
if (!data.text?.trim())
|
|
38
|
+
throw new Error('text is required');
|
|
39
|
+
this.injected.push(data.text.trim());
|
|
40
|
+
}
|
|
41
|
+
/** @description Fork this conversation at a specific log position */
|
|
42
|
+
async fork(data) {
|
|
43
|
+
const { tree, node } = getCtx();
|
|
44
|
+
const { createNode } = await import('@treenity/core');
|
|
45
|
+
const configPath = node.$path.replace(/\/tasks\/[^/]+$/, '');
|
|
46
|
+
const id = `t-${Date.now()}`;
|
|
47
|
+
const forkPath = `${configPath}/tasks/${id}`;
|
|
48
|
+
const logSlice = this.log.slice(0, data.atIndex);
|
|
49
|
+
await tree.set(createNode(forkPath, 'metatron.task', {
|
|
50
|
+
prompt: `[forked from ${node.$path.split('/').at(-1)}] ${this.prompt}`,
|
|
51
|
+
status: 'done',
|
|
52
|
+
result: logSlice,
|
|
53
|
+
log: logSlice,
|
|
54
|
+
createdAt: Date.now(),
|
|
55
|
+
forkedFrom: node.$path,
|
|
56
|
+
forkIndex: data.atIndex,
|
|
57
|
+
}));
|
|
58
|
+
return { taskPath: forkPath };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** Permission rule — controls which tools Metatron is allowed to use */
|
|
62
|
+
export class MetatronPermission {
|
|
63
|
+
/** Tool name or glob pattern: 'mcp__treenity__*', '*' */
|
|
64
|
+
tool = '';
|
|
65
|
+
/** Optional input.path pattern */
|
|
66
|
+
pathPattern = '';
|
|
67
|
+
policy = 'allow';
|
|
68
|
+
createdAt = 0;
|
|
69
|
+
}
|
|
70
|
+
/** Reusable prompt template for quick task creation */
|
|
71
|
+
export class MetatronTemplate {
|
|
72
|
+
name = '';
|
|
73
|
+
/** @format textarea */
|
|
74
|
+
prompt = '';
|
|
75
|
+
category = '';
|
|
76
|
+
}
|
|
77
|
+
/** Modular prompt fragment — learned skill or injected capability */
|
|
78
|
+
export class MetatronSkill {
|
|
79
|
+
name = '';
|
|
80
|
+
/** @format textarea */
|
|
81
|
+
prompt = '';
|
|
82
|
+
enabled = true;
|
|
83
|
+
category = '';
|
|
84
|
+
updatedAt = 0;
|
|
85
|
+
}
|
|
86
|
+
/** Multi-task workspace — side-by-side columns of conversations */
|
|
87
|
+
export class MetatronWorkspace {
|
|
88
|
+
name = '';
|
|
89
|
+
columns = [];
|
|
90
|
+
/** @description Add a task as a column */
|
|
91
|
+
async addColumn(data) {
|
|
92
|
+
if (!data.taskPath)
|
|
93
|
+
throw new Error('taskPath is required');
|
|
94
|
+
if (this.columns.includes(data.taskPath))
|
|
95
|
+
return;
|
|
96
|
+
this.columns.push(data.taskPath);
|
|
97
|
+
}
|
|
98
|
+
/** @description Remove a column by task path */
|
|
99
|
+
async removeColumn(data) {
|
|
100
|
+
const idx = this.columns.indexOf(data.taskPath);
|
|
101
|
+
if (idx === -1)
|
|
102
|
+
throw new Error('column not found');
|
|
103
|
+
this.columns.splice(idx, 1);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
registerType('metatron.config', MetatronConfig);
|
|
107
|
+
registerType('metatron.task', MetatronTask);
|
|
108
|
+
registerType('metatron.permission', MetatronPermission);
|
|
109
|
+
registerType('metatron.template', MetatronTemplate);
|
|
110
|
+
registerType('metatron.skill', MetatronSkill);
|
|
111
|
+
registerType('metatron.workspace', MetatronWorkspace);
|
|
112
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../metatron/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE3D,sEAAsE;AACtE,MAAM,OAAO,cAAc;IACzB,KAAK,GAAG,iBAAiB,CAAC;IAC1B,uBAAuB;IACvB,YAAY,GAAG,EAAE,CAAC;IAClB,SAAS,GAAG,EAAE,CAAC;IACf,OAAO,GAAG,CAAC,CAAC;CACb;AAED,+DAA+D;AAC/D,MAAM,OAAO,YAAY;IACvB,uBAAuB;IACvB,MAAM,GAAG,EAAE,CAAC;IACZ,MAAM,GAA6C,SAAS,CAAC;IAC7D,uBAAuB;IACvB,MAAM,GAAG,EAAE,CAAC;IACZ,uBAAuB;IACvB,GAAG,GAAG,EAAE,CAAC;IACT,SAAS,GAAG,CAAC,CAAC;IACd,wDAAwD;IACxD,QAAQ,GAAa,EAAE,CAAC;IACxB,iCAAiC;IACjC,UAAU,GAAG,EAAE,CAAC;IAChB,2CAA2C;IAC3C,SAAS,GAAG,CAAC,CAAC;IAEd,yCAAyC;IACzC,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACtE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC;QAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QAC7D,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;QAChD,UAAU,CAAC,UAAU,CAAC,CAAC;IACzB,CAAC;IAED,kEAAkE;IAClE,KAAK,CAAC,MAAM,CAAC,IAA0C;QACrD,IAAI,CAAC,IAAI,C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;IAC9B,CAAC;CACF;AAED,YAAY,CAAC,iBAAiB,EAAE,cAAc,CAAC,CAAC;AAChD,YAAY,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;AAC5C,YAAY,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;AACxD,YAAY,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;AACpD,YAAY,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;AAC9C,YAAY,CAAC,oBAAoB,EAAE,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../metatron/view.tsx"],"names":[],"mappings":"AACA,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../metatron/view.tsx"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,gBAAgB,CAAC;AACxB,OAAO,cAAc,CAAC;AACtB,OAAO,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../metatron/views/config.tsx"],"names":[],"mappings":""}
|