Skip to content

Commit 6ce2686

Browse files
G9Pedrocursoragent
andauthored
feat(kernel): add agent self-assembly orchestration flow (#27)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: G9Pedro <G9Pedro@users.noreply.github.com>
1 parent 4acc6a8 commit 6ce2686

File tree

4 files changed

+1056
-0
lines changed

4 files changed

+1056
-0
lines changed

packages/kernel/src/__snapshots__/schema-drift-regression.test.ts.snap

Lines changed: 355 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,361 @@ exports[`schema drift regression > locks CLI option signatures for critical comm
123123

124124
exports[`schema drift regression > locks MCP tool metadata and input schemas 1`] = `
125125
[
126+
{
127+
"annotations": {
128+
"destructiveHint": true,
129+
"idempotentHint": false,
130+
},
131+
"description": "Post a correlated question and optionally await/poll for a reply.",
132+
"inputSchema": {
133+
"$schema": "http://json-schema.org/draft-07/schema#",
134+
"properties": {
135+
"actor": {
136+
"description": "Actor identity for write attribution.",
137+
"type": "string",
138+
},
139+
"awaitReply": {
140+
"description": "Whether the tool should wait for a matching reply event.",
141+
"type": "boolean",
142+
},
143+
"conversationPath": {
144+
"description": "Optional existing conversation path.",
145+
"type": "string",
146+
},
147+
"correlationId": {
148+
"description": "Optional correlation ID (generated when omitted).",
149+
"type": "string",
150+
},
151+
"evidence": {
152+
"description": "Optional evidence attachments for ask context.",
153+
"items": {
154+
"properties": {
155+
"kind": {
156+
"description": "Evidence attachment kind.",
157+
"enum": [
158+
"link",
159+
"file",
160+
],
161+
"type": "string",
162+
},
163+
"mime_type": {
164+
"description": "MIME type for this attachment when known.",
165+
"type": "string",
166+
},
167+
"path": {
168+
"description": "Workspace-relative file path for file evidence.",
169+
"type": "string",
170+
},
171+
"sha256": {
172+
"description": "Optional sha256 digest for file integrity checks.",
173+
"type": "string",
174+
},
175+
"size_bytes": {
176+
"description": "Attachment size in bytes.",
177+
"maximum": 9007199254740991,
178+
"minimum": 0,
179+
"type": "integer",
180+
},
181+
"title": {
182+
"description": "Short human-readable evidence title.",
183+
"type": "string",
184+
},
185+
"url": {
186+
"description": "Evidence URL for link-based artifacts.",
187+
"type": "string",
188+
},
189+
},
190+
"required": [
191+
"kind",
192+
],
193+
"type": "object",
194+
},
195+
"type": "array",
196+
},
197+
"idempotencyKey": {
198+
"description": "Stable idempotency key for retry-safe asks.",
199+
"type": "string",
200+
},
201+
"metadata": {
202+
"additionalProperties": {},
203+
"description": "Arbitrary machine-readable metadata preserved with the event.",
204+
"propertyNames": {
205+
"type": "string",
206+
},
207+
"type": "object",
208+
},
209+
"pollIntervalMs": {
210+
"description": "Polling interval used while awaiting reply.",
211+
"maximum": 5000,
212+
"minimum": 25,
213+
"type": "integer",
214+
},
215+
"question": {
216+
"description": "Question text to post.",
217+
"minLength": 1,
218+
"type": "string",
219+
},
220+
"threadPath": {
221+
"description": "Target thread path (threads/<slug>.md).",
222+
"minLength": 1,
223+
"type": "string",
224+
},
225+
"timeoutMs": {
226+
"description": "Reply wait timeout when awaitReply=true.",
227+
"maximum": 120000,
228+
"minimum": 0,
229+
"type": "integer",
230+
},
231+
},
232+
"required": [
233+
"threadPath",
234+
"question",
235+
],
236+
"type": "object",
237+
},
238+
"name": "wg_ask",
239+
"title": "WorkGraph Ask",
240+
},
241+
{
242+
"annotations": {
243+
"destructiveHint": true,
244+
"idempotentHint": false,
245+
},
246+
"description": "Write agent liveness plus active-work claim heartbeat updates.",
247+
"inputSchema": {
248+
"$schema": "http://json-schema.org/draft-07/schema#",
249+
"properties": {
250+
"actor": {
251+
"description": "Actor identity to heartbeat.",
252+
"type": "string",
253+
},
254+
"capabilities": {
255+
"description": "Optional runtime capabilities snapshot for presence.",
256+
"items": {
257+
"type": "string",
258+
},
259+
"type": "array",
260+
},
261+
"currentWork": {
262+
"description": "Current work/thread marker for presence state.",
263+
"type": "string",
264+
},
265+
"status": {
266+
"description": "Presence status update for actor liveness.",
267+
"enum": [
268+
"online",
269+
"busy",
270+
"offline",
271+
],
272+
"type": "string",
273+
},
274+
"threadLeaseMinutes": {
275+
"description": "Thread lease extension window in minutes.",
276+
"maximum": 240,
277+
"minimum": 1,
278+
"type": "integer",
279+
},
280+
"threadPath": {
281+
"description": "Optional specific thread to heartbeat claim lease for.",
282+
"type": "string",
283+
},
284+
},
285+
"type": "object",
286+
},
287+
"name": "wg_heartbeat",
288+
"title": "WorkGraph Heartbeat",
289+
},
290+
{
291+
"annotations": {
292+
"destructiveHint": true,
293+
"idempotentHint": false,
294+
},
295+
"description": "Append a structured collaboration message event to a thread conversation.",
296+
"inputSchema": {
297+
"$schema": "http://json-schema.org/draft-07/schema#",
298+
"properties": {
299+
"actor": {
300+
"description": "Actor identity for write attribution.",
301+
"type": "string",
302+
},
303+
"body": {
304+
"description": "Message body text to append.",
305+
"minLength": 1,
306+
"type": "string",
307+
},
308+
"conversationPath": {
309+
"description": "Optional existing conversation path.",
310+
"type": "string",
311+
},
312+
"correlationId": {
313+
"description": "Correlation ID for ask/reply coordination.",
314+
"type": "string",
315+
},
316+
"evidence": {
317+
"description": "Optional evidence attachment descriptors.",
318+
"items": {
319+
"properties": {
320+
"kind": {
321+
"description": "Evidence attachment kind.",
322+
"enum": [
323+
"link",
324+
"file",
325+
],
326+
"type": "string",
327+
},
328+
"mime_type": {
329+
"description": "MIME type for this attachment when known.",
330+
"type": "string",
331+
},
332+
"path": {
333+
"description": "Workspace-relative file path for file evidence.",
334+
"type": "string",
335+
},
336+
"sha256": {
337+
"description": "Optional sha256 digest for file integrity checks.",
338+
"type": "string",
339+
},
340+
"size_bytes": {
341+
"description": "Attachment size in bytes.",
342+
"maximum": 9007199254740991,
343+
"minimum": 0,
344+
"type": "integer",
345+
},
346+
"title": {
347+
"description": "Short human-readable evidence title.",
348+
"type": "string",
349+
},
350+
"url": {
351+
"description": "Evidence URL for link-based artifacts.",
352+
"type": "string",
353+
},
354+
},
355+
"required": [
356+
"kind",
357+
],
358+
"type": "object",
359+
},
360+
"type": "array",
361+
},
362+
"idempotencyKey": {
363+
"description": "Stable idempotency key for retry-safe writes.",
364+
"type": "string",
365+
},
366+
"messageType": {
367+
"description": "Conversation event type/kind.",
368+
"enum": [
369+
"message",
370+
"note",
371+
"decision",
372+
"system",
373+
"ask",
374+
"reply",
375+
],
376+
"type": "string",
377+
},
378+
"metadata": {
379+
"additionalProperties": {},
380+
"description": "Arbitrary machine-readable metadata preserved with the event.",
381+
"propertyNames": {
382+
"type": "string",
383+
},
384+
"type": "object",
385+
},
386+
"replyToCorrelationId": {
387+
"description": "Correlation ID this reply responds to.",
388+
"type": "string",
389+
},
390+
"threadPath": {
391+
"description": "Target thread path (threads/<slug>.md).",
392+
"minLength": 1,
393+
"type": "string",
394+
},
395+
},
396+
"required": [
397+
"threadPath",
398+
"body",
399+
],
400+
"type": "object",
401+
},
402+
"name": "wg_post_message",
403+
"title": "WorkGraph Post Message",
404+
},
405+
{
406+
"annotations": {
407+
"destructiveHint": true,
408+
"idempotentHint": false,
409+
},
410+
"description": "Create a child thread with inherited context and optional idempotency key.",
411+
"inputSchema": {
412+
"$schema": "http://json-schema.org/draft-07/schema#",
413+
"properties": {
414+
"actor": {
415+
"description": "Actor identity for write attribution.",
416+
"type": "string",
417+
},
418+
"contextRefs": {
419+
"description": "Additional context refs inherited by child thread.",
420+
"items": {
421+
"type": "string",
422+
},
423+
"type": "array",
424+
},
425+
"conversationPath": {
426+
"description": "Optional conversation to attach spawned child thread.",
427+
"type": "string",
428+
},
429+
"deps": {
430+
"description": "Optional dependency thread refs.",
431+
"items": {
432+
"type": "string",
433+
},
434+
"type": "array",
435+
},
436+
"goal": {
437+
"description": "New child thread goal/body seed.",
438+
"minLength": 1,
439+
"type": "string",
440+
},
441+
"idempotencyKey": {
442+
"description": "Stable idempotency key for retry-safe spawn.",
443+
"type": "string",
444+
},
445+
"parentThreadPath": {
446+
"description": "Parent thread path for child spawn operation.",
447+
"minLength": 1,
448+
"type": "string",
449+
},
450+
"priority": {
451+
"description": "Optional child priority override.",
452+
"type": "string",
453+
},
454+
"space": {
455+
"description": "Optional space override for the spawned child thread.",
456+
"type": "string",
457+
},
458+
"tags": {
459+
"description": "Optional child tags.",
460+
"items": {
461+
"type": "string",
462+
},
463+
"type": "array",
464+
},
465+
"title": {
466+
"description": "New child thread title.",
467+
"minLength": 1,
468+
"type": "string",
469+
},
470+
},
471+
"required": [
472+
"parentThreadPath",
473+
"title",
474+
"goal",
475+
],
476+
"type": "object",
477+
},
478+
"name": "wg_spawn_thread",
479+
"title": "WorkGraph Spawn Thread",
480+
},
126481
{
127482
"annotations": {
128483
"destructiveHint": true,

0 commit comments

Comments
 (0)