@deepagents/experimental 7.10.0 → 7.10.1
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 +16 -4
- package/dist/index.js +862 -671
- package/dist/index.js.map +4 -4
- package/dist/zukhruf/collaboration/capability.d.ts +22 -0
- package/dist/zukhruf/collaboration/capability.d.ts.map +1 -0
- package/dist/zukhruf/collaboration/code-mode-tools.d.ts +13 -0
- package/dist/zukhruf/collaboration/code-mode-tools.d.ts.map +1 -0
- package/dist/zukhruf/collaboration/direct-messaging.d.ts +466 -0
- package/dist/zukhruf/collaboration/direct-messaging.d.ts.map +1 -0
- package/dist/zukhruf/collaboration/direct-tools.d.ts +14 -0
- package/dist/zukhruf/collaboration/direct-tools.d.ts.map +1 -0
- package/dist/zukhruf/collaboration/spawn-agent.d.ts +26 -26
- package/dist/zukhruf/collaboration/spawning.d.ts +325 -0
- package/dist/zukhruf/collaboration/spawning.d.ts.map +1 -0
- package/dist/zukhruf/collaboration/supervision.d.ts +478 -0
- package/dist/zukhruf/collaboration/supervision.d.ts.map +1 -0
- package/dist/zukhruf/collaboration/team.d.ts +1549 -0
- package/dist/zukhruf/collaboration/team.d.ts.map +1 -0
- package/dist/zukhruf/collaboration/tool-exposure.d.ts +29 -0
- package/dist/zukhruf/collaboration/tool-exposure.d.ts.map +1 -0
- package/dist/zukhruf/collaboration/tool-namespace.d.ts +7 -0
- package/dist/zukhruf/collaboration/tool-namespace.d.ts.map +1 -0
- package/dist/zukhruf/collaboration/wait-bounds.d.ts +12 -0
- package/dist/zukhruf/collaboration/wait-bounds.d.ts.map +1 -0
- package/dist/zukhruf/collaboration/waiting.d.ts +262 -0
- package/dist/zukhruf/collaboration/waiting.d.ts.map +1 -0
- package/dist/zukhruf/control-plane/agent-history-forker.d.ts.map +1 -1
- package/dist/zukhruf/control-plane/fork-turns.d.ts +4 -3
- package/dist/zukhruf/control-plane/fork-turns.d.ts.map +1 -1
- package/dist/zukhruf/index.d.ts +11 -1
- package/dist/zukhruf/index.d.ts.map +1 -1
- package/dist/zukhruf/index.js +863 -672
- package/dist/zukhruf/index.js.map +4 -4
- package/dist/zukhruf/plugins/conversation-scheduling/conversation-scheduler.d.ts +1 -1
- package/dist/zukhruf/plugins/conversation-scheduling/conversation-scheduler.d.ts.map +1 -1
- package/dist/zukhruf/plugins/conversation-scheduling/index.js +142 -141
- package/dist/zukhruf/plugins/conversation-scheduling/index.js.map +4 -4
- package/dist/zukhruf/plugins/conversation-scheduling/pg-boss.wake-scheduler.d.ts +1 -1
- package/dist/zukhruf/plugins/conversation-scheduling/pg-boss.wake-scheduler.d.ts.map +1 -1
- package/dist/zukhruf/plugins/conversation-scheduling/wake-scheduler.d.ts +1 -1
- package/dist/zukhruf/plugins/conversation-scheduling/wake-scheduler.d.ts.map +1 -1
- package/dist/zukhruf/plugins/schedules/index.js +141 -140
- package/dist/zukhruf/plugins/schedules/index.js.map +4 -4
- package/dist/zukhruf/plugins/schedules/scheduled-tasks.d.ts +1 -1
- package/dist/zukhruf/plugins/schedules/scheduled-tasks.d.ts.map +1 -1
- package/dist/zukhruf/plugins/uploads/http.js +2 -9
- package/dist/zukhruf/plugins/uploads/http.js.map +2 -2
- package/dist/zukhruf/queue/turn-queue.d.ts +2 -2
- package/dist/zukhruf/queue/turn-queue.d.ts.map +1 -1
- package/dist/zukhruf/runtime/agent-runtime.d.ts +5 -4
- package/dist/zukhruf/runtime/agent-runtime.d.ts.map +1 -1
- package/dist/zukhruf/runtime/agent-turn-executor.d.ts +3 -3
- package/dist/zukhruf/runtime/agent-turn-executor.d.ts.map +1 -1
- package/dist/zukhruf/runtime/approval-controller.d.ts +3 -3
- package/dist/zukhruf/runtime/approval-controller.d.ts.map +1 -1
- package/dist/zukhruf/runtime/conversation-status/projector.d.ts.map +1 -1
- package/dist/zukhruf/runtime/plugin/plugin-manager.d.ts +3 -5
- package/dist/zukhruf/runtime/plugin/plugin-manager.d.ts.map +1 -1
- package/package.json +5 -4
- package/dist/zukhruf/collaboration/collaboration-tools.d.ts +0 -1832
- package/dist/zukhruf/collaboration/collaboration-tools.d.ts.map +0 -1
- package/dist/zukhruf/multi-agent-config.d.ts +0 -37
- package/dist/zukhruf/multi-agent-config.d.ts.map +0 -1
|
@@ -74,7 +74,7 @@ export declare class ConversationScheduler {
|
|
|
74
74
|
wasClamped: boolean;
|
|
75
75
|
}>;
|
|
76
76
|
stopDynamic(conversation: ConversationId): Promise<number>;
|
|
77
|
-
work(
|
|
77
|
+
work(): Promise<AsyncDisposable>;
|
|
78
78
|
materializeDueIfEligible(conversation: ConversationId): Promise<void>;
|
|
79
79
|
}
|
|
80
80
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-scheduler.d.ts","sources":["../../../../src/zukhruf/plugins/conversation-scheduling/conversation-scheduler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAQ,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA0C/D,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BvB,CAAC;AAEL,KAAK,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC7D,KAAK,cAAc,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAGtD,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,cAAc,CAAC;IAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAsBD,UAAU,4BAA4B;IACpC,SAAS,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACzC,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE;QAAE,IAAI,EAAE;YAAE,GAAG,IAAI,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CACpC;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,sEAAsE;AACtE,qBAAa,qBAAqB;;IAIhC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,YAAY,OAAO,EAAE,4BAA4B,EAKhD;IAEK,UAAU,CACd,YAAY,EAAE,cAAc,EAC5B,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,cAAc,CAAC,CA0DzB;IAEK,QAAQ,CAAC,YAAY,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAKtE;IAEK,UAAU,CAAC,YAAY,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAexE;IAEK,eAAe,CACnB,YAAY,EAAE,cAAc,EAC5B,KAAK,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAC9D,OAAO,CAAC;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC,CAiCD;IAEK,WAAW,CAAC,YAAY,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB/D;IAEK,IAAI,
|
|
1
|
+
{"version":3,"file":"conversation-scheduler.d.ts","sources":["../../../../src/zukhruf/plugins/conversation-scheduling/conversation-scheduler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAQ,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA0C/D,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BvB,CAAC;AAEL,KAAK,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAC7D,KAAK,cAAc,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;AAGtD,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,cAAc,CAAC;IAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAsBD,UAAU,4BAA4B;IACpC,SAAS,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACzC,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE;QAAE,IAAI,EAAE;YAAE,GAAG,IAAI,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CACpC;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,sEAAsE;AACtE,qBAAa,qBAAqB;;IAIhC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,YAAY,OAAO,EAAE,4BAA4B,EAKhD;IAEK,UAAU,CACd,YAAY,EAAE,cAAc,EAC5B,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,cAAc,CAAC,CA0DzB;IAEK,QAAQ,CAAC,YAAY,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAKtE;IAEK,UAAU,CAAC,YAAY,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAexE;IAEK,eAAe,CACnB,YAAY,EAAE,cAAc,EAC5B,KAAK,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAC9D,OAAO,CAAC;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC,CAiCD;IAEK,WAAW,CAAC,YAAY,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAgB/D;IAEK,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC,CAErC;IAEK,wBAAwB,CAAC,YAAY,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B1E;CAwUF"}
|
|
@@ -3,6 +3,115 @@ import {
|
|
|
3
3
|
ContextEngine as ContextEngine6
|
|
4
4
|
} from "@deepagents/context";
|
|
5
5
|
|
|
6
|
+
// packages/experimental/src/zukhruf/collaboration/message-tools.ts
|
|
7
|
+
import { tool } from "ai";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
var agentMessageInputSchema = z.object({
|
|
10
|
+
target: z.string().trim().min(1).describe(
|
|
11
|
+
"The canonical /root/... path, or a descendant-relative target name."
|
|
12
|
+
),
|
|
13
|
+
message: z.string().trim().min(1).describe("The message or follow-up task.")
|
|
14
|
+
});
|
|
15
|
+
var sendMessageTool = tool({
|
|
16
|
+
description: "Queue a message for another agent. Address siblings with their canonical /root/... path.",
|
|
17
|
+
inputSchema: agentMessageInputSchema,
|
|
18
|
+
execute: async (input, { context }) => {
|
|
19
|
+
await context.controlPlane.sendMessage(context.actor, input);
|
|
20
|
+
return "";
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
var followupTaskTool = tool({
|
|
24
|
+
description: "Send a follow-up task to an existing non-root agent and wake its thread.",
|
|
25
|
+
inputSchema: agentMessageInputSchema,
|
|
26
|
+
execute: async (input, { context }) => {
|
|
27
|
+
await context.controlPlane.followupTask(context.actor, input);
|
|
28
|
+
return "";
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// packages/experimental/src/zukhruf/collaboration/spawn-agent.ts
|
|
33
|
+
import { tool as tool2 } from "ai";
|
|
34
|
+
import { z as z2 } from "zod";
|
|
35
|
+
|
|
36
|
+
// packages/experimental/src/zukhruf/control-plane/fork-turns.ts
|
|
37
|
+
var forkTurnsError = "fork_turns must be `none` or `all`";
|
|
38
|
+
function parseForkTurns(value) {
|
|
39
|
+
const normalized = value?.trim().toLowerCase() || "all";
|
|
40
|
+
return normalized === "none" || normalized === "all" ? normalized : void 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// packages/experimental/src/zukhruf/collaboration/spawn-agent.ts
|
|
44
|
+
var spawnAgentInputSchema = z2.object({
|
|
45
|
+
agent_type: z2.string().trim().min(1).describe("The name of one available subagent declaration."),
|
|
46
|
+
task_name: z2.string().trim().min(1).refine(
|
|
47
|
+
(value) => value !== "." && value !== ".." && !value.includes("/"),
|
|
48
|
+
"task_name must be one non-empty path segment"
|
|
49
|
+
).describe("One path segment naming this independent agent task."),
|
|
50
|
+
message: z2.string().refine((value) => value.trim().length > 0, "message cannot be empty").describe("The initial task for the spawned agent."),
|
|
51
|
+
fork_turns: z2.string({ error: forkTurnsError }).optional().refine((value) => parseForkTurns(value) !== void 0, forkTurnsError).describe(
|
|
52
|
+
"Parent history to inherit. Defaults to `all`; use `none` to start without parent history. Only `all` and `none` are supported."
|
|
53
|
+
)
|
|
54
|
+
});
|
|
55
|
+
var spawnAgentOutputSchema = z2.object({ task_name: z2.string() }).strict();
|
|
56
|
+
|
|
57
|
+
// packages/experimental/src/zukhruf/collaboration/interrupt-agent.ts
|
|
58
|
+
import { tool as tool3 } from "ai";
|
|
59
|
+
import { z as z4 } from "zod";
|
|
60
|
+
|
|
61
|
+
// packages/experimental/src/zukhruf/control-plane/agent-status-projector.ts
|
|
62
|
+
import { isTextUIPart } from "ai";
|
|
63
|
+
import { z as z3 } from "zod";
|
|
64
|
+
import {
|
|
65
|
+
ContextEngine
|
|
66
|
+
} from "@deepagents/context";
|
|
67
|
+
var listedAgentStatusSchema = z3.union([
|
|
68
|
+
z3.enum(["pending_init", "running", "interrupted", "shutdown", "not_found"]),
|
|
69
|
+
z3.object({ completed: z3.string().nullable() }).strict(),
|
|
70
|
+
z3.object({ errored: z3.string() }).strict()
|
|
71
|
+
]);
|
|
72
|
+
var listedAgentSchema = z3.object({
|
|
73
|
+
agent_name: z3.string(),
|
|
74
|
+
agent_status: listedAgentStatusSchema
|
|
75
|
+
}).strict();
|
|
76
|
+
|
|
77
|
+
// packages/experimental/src/zukhruf/collaboration/interrupt-agent.ts
|
|
78
|
+
var interruptAgentInputSchema = z4.object({
|
|
79
|
+
target: z4.string().trim().min(1).describe(
|
|
80
|
+
"The canonical /root/... path, or a descendant-relative target name."
|
|
81
|
+
)
|
|
82
|
+
});
|
|
83
|
+
var interruptAgentOutputSchema = z4.object({ previous_status: listedAgentStatusSchema }).strict();
|
|
84
|
+
var interruptAgentTool = tool3({
|
|
85
|
+
description: "Interrupt an agent's current turn, if any, and return its previous status. The agent remains available for messages and follow-up tasks.",
|
|
86
|
+
inputSchema: interruptAgentInputSchema,
|
|
87
|
+
outputSchema: interruptAgentOutputSchema,
|
|
88
|
+
execute: async (input, { context }) => context.controlPlane.interruptAgent(context.actor, input)
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// packages/experimental/src/zukhruf/collaboration/list-agents.ts
|
|
92
|
+
import { tool as tool4 } from "ai";
|
|
93
|
+
import { z as z5 } from "zod";
|
|
94
|
+
var listAgentsInputSchema = z5.object({
|
|
95
|
+
path_prefix: z5.string().trim().min(1).describe(
|
|
96
|
+
"Task-path prefix without a trailing slash. Omit to list the whole tree."
|
|
97
|
+
).optional()
|
|
98
|
+
});
|
|
99
|
+
var listAgentsOutputSchema = z5.object({ agents: z5.array(listedAgentSchema) }).strict();
|
|
100
|
+
var listAgentsTool = tool4({
|
|
101
|
+
description: "List live agents in the current root thread tree. Optionally filter by task-path prefix.",
|
|
102
|
+
inputSchema: listAgentsInputSchema,
|
|
103
|
+
outputSchema: listAgentsOutputSchema,
|
|
104
|
+
execute: async ({ path_prefix }, { context }) => context.controlPlane.listAgents(context.actor, path_prefix)
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// packages/experimental/src/zukhruf/collaboration/wait-agent.ts
|
|
108
|
+
import { tool as tool5 } from "ai";
|
|
109
|
+
import { z as z6 } from "zod";
|
|
110
|
+
var waitAgentOutputSchema = z6.object({ message: z6.string(), timed_out: z6.boolean() }).strict();
|
|
111
|
+
|
|
112
|
+
// packages/experimental/src/zukhruf/collaboration/team.ts
|
|
113
|
+
var USE_CLAUSES = new Intl.ListFormat("en", { type: "conjunction" });
|
|
114
|
+
|
|
6
115
|
// packages/experimental/src/zukhruf/control-plane/agent-control-plane.ts
|
|
7
116
|
import { v5 as uuidv54 } from "uuid";
|
|
8
117
|
|
|
@@ -11,7 +120,7 @@ import { Future, Latch } from "@zukhruf/async";
|
|
|
11
120
|
import { Mutex } from "@zukhruf/mutex";
|
|
12
121
|
import { MemoryStore } from "@zukhruf/mutex/memory";
|
|
13
122
|
import {
|
|
14
|
-
ContextEngine as
|
|
123
|
+
ContextEngine as ContextEngine3
|
|
15
124
|
} from "@deepagents/context";
|
|
16
125
|
|
|
17
126
|
// packages/experimental/src/zukhruf/runtime/approval-controller.ts
|
|
@@ -20,26 +129,26 @@ import {
|
|
|
20
129
|
isToolUIPart
|
|
21
130
|
} from "ai";
|
|
22
131
|
import {
|
|
23
|
-
ContextEngine,
|
|
132
|
+
ContextEngine as ContextEngine2,
|
|
24
133
|
assistant
|
|
25
134
|
} from "@deepagents/context";
|
|
26
135
|
|
|
27
136
|
// packages/experimental/src/zukhruf/runtime/conversation-status/child-progress.ts
|
|
28
|
-
import { z } from "zod";
|
|
29
|
-
var childActivitySchema =
|
|
30
|
-
id:
|
|
31
|
-
type:
|
|
32
|
-
at:
|
|
33
|
-
actorPath:
|
|
34
|
-
targetPath:
|
|
35
|
-
streamId:
|
|
36
|
-
outcome:
|
|
137
|
+
import { z as z7 } from "zod";
|
|
138
|
+
var childActivitySchema = z7.object({
|
|
139
|
+
id: z7.string(),
|
|
140
|
+
type: z7.enum(["spawn", "message", "followup", "interrupt", "completion"]),
|
|
141
|
+
at: z7.number(),
|
|
142
|
+
actorPath: z7.string(),
|
|
143
|
+
targetPath: z7.string(),
|
|
144
|
+
streamId: z7.string(),
|
|
145
|
+
outcome: z7.enum(["completed", "failed", "cancelled"]).optional()
|
|
37
146
|
});
|
|
38
|
-
var childActivitiesSchema =
|
|
147
|
+
var childActivitiesSchema = z7.partialRecord(
|
|
39
148
|
childActivitySchema.shape.type,
|
|
40
149
|
childActivitySchema
|
|
41
150
|
);
|
|
42
|
-
var childActivityMetadataSchema =
|
|
151
|
+
var childActivityMetadataSchema = z7.looseObject({
|
|
43
152
|
childActivities: childActivitiesSchema.default({})
|
|
44
153
|
});
|
|
45
154
|
|
|
@@ -65,27 +174,11 @@ import {
|
|
|
65
174
|
isSyntheticReminderMessage
|
|
66
175
|
} from "@deepagents/context";
|
|
67
176
|
|
|
68
|
-
// packages/experimental/src/zukhruf/control-plane/agent-status-projector.ts
|
|
69
|
-
import { isTextUIPart } from "ai";
|
|
70
|
-
import { z as z2 } from "zod";
|
|
71
|
-
import {
|
|
72
|
-
ContextEngine as ContextEngine3
|
|
73
|
-
} from "@deepagents/context";
|
|
74
|
-
var listedAgentStatusSchema = z2.union([
|
|
75
|
-
z2.enum(["pending_init", "running", "interrupted", "shutdown", "not_found"]),
|
|
76
|
-
z2.object({ completed: z2.string().nullable() }).strict(),
|
|
77
|
-
z2.object({ errored: z2.string() }).strict()
|
|
78
|
-
]);
|
|
79
|
-
var listedAgentSchema = z2.object({
|
|
80
|
-
agent_name: z2.string(),
|
|
81
|
-
agent_status: listedAgentStatusSchema
|
|
82
|
-
}).strict();
|
|
83
|
-
|
|
84
177
|
// packages/experimental/src/zukhruf/control-plane/agent-turn-id.ts
|
|
85
178
|
import { v5 as uuidv53, validate as validateUuid } from "uuid";
|
|
86
|
-
import { z as
|
|
179
|
+
import { z as z8 } from "zod";
|
|
87
180
|
var prefix = "zukhruf-turn";
|
|
88
|
-
var agentTurnIdSchema =
|
|
181
|
+
var agentTurnIdSchema = z8.string().refine((value) => {
|
|
89
182
|
const [head, scope, turn, ...rest] = value.split(":");
|
|
90
183
|
return head === prefix && rest.length === 0 && validateUuid(scope) && validateUuid(turn);
|
|
91
184
|
});
|
|
@@ -108,10 +201,9 @@ import {
|
|
|
108
201
|
import pMemoize from "p-memoize";
|
|
109
202
|
|
|
110
203
|
// packages/experimental/src/zukhruf/runtime/agent-turn-executor.ts
|
|
111
|
-
import { experimental_codeModeTool } from "@ai-sdk/code-mode";
|
|
112
204
|
import {
|
|
113
205
|
jsonSchema,
|
|
114
|
-
tool
|
|
206
|
+
tool as tool6
|
|
115
207
|
} from "ai";
|
|
116
208
|
import {
|
|
117
209
|
ContextEngine as ContextEngine5,
|
|
@@ -133,7 +225,7 @@ import {
|
|
|
133
225
|
asSchema,
|
|
134
226
|
modelMessageSchema as modelMessageSchema2
|
|
135
227
|
} from "ai";
|
|
136
|
-
import { z as
|
|
228
|
+
import { z as z9 } from "zod";
|
|
137
229
|
|
|
138
230
|
// packages/compaction/dist/index.js
|
|
139
231
|
import {
|
|
@@ -145,21 +237,21 @@ import {
|
|
|
145
237
|
import {
|
|
146
238
|
isRecord as isRecord3
|
|
147
239
|
} from "@deepagents/context";
|
|
148
|
-
var checkpointSchema =
|
|
149
|
-
sourceCount:
|
|
150
|
-
sourceHash:
|
|
151
|
-
replacement:
|
|
240
|
+
var checkpointSchema = z9.object({
|
|
241
|
+
sourceCount: z9.number().int().positive(),
|
|
242
|
+
sourceHash: z9.string(),
|
|
243
|
+
replacement: z9.array(z9.unknown()).transform(
|
|
152
244
|
(messages) => messages.map((message) => modelMessageSchema2.parse(message))
|
|
153
245
|
)
|
|
154
246
|
});
|
|
155
|
-
var cacheObservationSchema =
|
|
156
|
-
scope:
|
|
157
|
-
prefixLength:
|
|
158
|
-
prefixHash:
|
|
159
|
-
startedAt:
|
|
160
|
-
retentionMs:
|
|
247
|
+
var cacheObservationSchema = z9.object({
|
|
248
|
+
scope: z9.string(),
|
|
249
|
+
prefixLength: z9.number().int().nonnegative(),
|
|
250
|
+
prefixHash: z9.string(),
|
|
251
|
+
startedAt: z9.number().int().nonnegative(),
|
|
252
|
+
retentionMs: z9.number().int().positive().optional()
|
|
161
253
|
});
|
|
162
|
-
var inputUsageSchema = cacheObservationSchema.pick({ scope: true, prefixLength: true, prefixHash: true }).extend({ inputTokens:
|
|
254
|
+
var inputUsageSchema = cacheObservationSchema.pick({ scope: true, prefixLength: true, prefixHash: true }).extend({ inputTokens: z9.number().int().nonnegative() });
|
|
163
255
|
|
|
164
256
|
// packages/experimental/src/zukhruf/runtime/plugin/agent-skills.ts
|
|
165
257
|
import {
|
|
@@ -167,97 +259,6 @@ import {
|
|
|
167
259
|
skills
|
|
168
260
|
} from "@deepagents/context";
|
|
169
261
|
|
|
170
|
-
// packages/experimental/src/zukhruf/collaboration/interrupt-agent.ts
|
|
171
|
-
import { tool as tool2 } from "ai";
|
|
172
|
-
import { z as z5 } from "zod";
|
|
173
|
-
var interruptAgentInputSchema = z5.object({
|
|
174
|
-
target: z5.string().trim().min(1).describe(
|
|
175
|
-
"The canonical /root/... path, or a descendant-relative target name."
|
|
176
|
-
)
|
|
177
|
-
});
|
|
178
|
-
var interruptAgentOutputSchema = z5.object({ previous_status: listedAgentStatusSchema }).strict();
|
|
179
|
-
var interruptAgentTool = tool2({
|
|
180
|
-
description: "Interrupt an agent's current turn, if any, and return its previous status. The agent remains available for messages and follow-up tasks.",
|
|
181
|
-
inputSchema: interruptAgentInputSchema,
|
|
182
|
-
outputSchema: interruptAgentOutputSchema,
|
|
183
|
-
execute: async (input, { context }) => context.controlPlane.interruptAgent(context.actor, input)
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
// packages/experimental/src/zukhruf/collaboration/list-agents.ts
|
|
187
|
-
import { tool as tool3 } from "ai";
|
|
188
|
-
import { z as z6 } from "zod";
|
|
189
|
-
var listAgentsInputSchema = z6.object({
|
|
190
|
-
path_prefix: z6.string().trim().min(1).describe(
|
|
191
|
-
"Task-path prefix without a trailing slash. Omit to list the whole tree."
|
|
192
|
-
).optional()
|
|
193
|
-
});
|
|
194
|
-
var listAgentsOutputSchema = z6.object({ agents: z6.array(listedAgentSchema) }).strict();
|
|
195
|
-
var listAgentsTool = tool3({
|
|
196
|
-
description: "List live agents in the current root thread tree. Optionally filter by task-path prefix.",
|
|
197
|
-
inputSchema: listAgentsInputSchema,
|
|
198
|
-
outputSchema: listAgentsOutputSchema,
|
|
199
|
-
execute: async ({ path_prefix }, { context }) => context.controlPlane.listAgents(context.actor, path_prefix)
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
// packages/experimental/src/zukhruf/collaboration/message-tools.ts
|
|
203
|
-
import { tool as tool4 } from "ai";
|
|
204
|
-
import { z as z7 } from "zod";
|
|
205
|
-
var agentMessageInputSchema = z7.object({
|
|
206
|
-
target: z7.string().trim().min(1).describe(
|
|
207
|
-
"The canonical /root/... path, or a descendant-relative target name."
|
|
208
|
-
),
|
|
209
|
-
message: z7.string().trim().min(1).describe("The message or follow-up task.")
|
|
210
|
-
});
|
|
211
|
-
var sendMessageTool = tool4({
|
|
212
|
-
description: "Queue a message for another agent. Address siblings with their canonical /root/... path.",
|
|
213
|
-
inputSchema: agentMessageInputSchema,
|
|
214
|
-
execute: async (input, { context }) => {
|
|
215
|
-
await context.controlPlane.sendMessage(context.actor, input);
|
|
216
|
-
return "";
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
var followupTaskTool = tool4({
|
|
220
|
-
description: "Send a follow-up task to an existing non-root agent and wake its thread.",
|
|
221
|
-
inputSchema: agentMessageInputSchema,
|
|
222
|
-
execute: async (input, { context }) => {
|
|
223
|
-
await context.controlPlane.followupTask(context.actor, input);
|
|
224
|
-
return "";
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
// packages/experimental/src/zukhruf/collaboration/spawn-agent.ts
|
|
229
|
-
import { tool as tool5 } from "ai";
|
|
230
|
-
import { z as z8 } from "zod";
|
|
231
|
-
|
|
232
|
-
// packages/experimental/src/zukhruf/control-plane/fork-turns.ts
|
|
233
|
-
var forkTurnsError = "fork_turns must be `none`, `all`, or a positive integer string";
|
|
234
|
-
function parseForkTurns(value) {
|
|
235
|
-
const normalized = value.trim().toLowerCase();
|
|
236
|
-
if (normalized === "none" || normalized === "all") return normalized;
|
|
237
|
-
if (!/^\d+$/.test(normalized)) return void 0;
|
|
238
|
-
const turns = Number(normalized);
|
|
239
|
-
return Number.isSafeInteger(turns) && turns > 0 ? turns : void 0;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// packages/experimental/src/zukhruf/collaboration/spawn-agent.ts
|
|
243
|
-
var spawnAgentInputSchema = z8.object({
|
|
244
|
-
agent_type: z8.string().trim().min(1).describe("The name of one available subagent declaration."),
|
|
245
|
-
task_name: z8.string().trim().min(1).refine(
|
|
246
|
-
(value) => value !== "." && value !== ".." && !value.includes("/"),
|
|
247
|
-
"task_name must be one non-empty path segment"
|
|
248
|
-
).describe("One path segment naming this independent agent task."),
|
|
249
|
-
message: z8.string().refine((value) => value.trim().length > 0, "message cannot be empty").describe("The initial task for the spawned agent."),
|
|
250
|
-
fork_turns: z8.string().trim().refine((value) => parseForkTurns(value) !== void 0, forkTurnsError).describe(
|
|
251
|
-
"Required number of parent turns to fork. Use `none`, `all`, or a positive integer string such as `3`."
|
|
252
|
-
)
|
|
253
|
-
});
|
|
254
|
-
var spawnAgentOutputSchema = z8.object({ task_name: z8.string() }).strict();
|
|
255
|
-
|
|
256
|
-
// packages/experimental/src/zukhruf/collaboration/wait-agent.ts
|
|
257
|
-
import { tool as tool6 } from "ai";
|
|
258
|
-
import { z as z9 } from "zod";
|
|
259
|
-
var waitAgentOutputSchema = z9.object({ message: z9.string(), timed_out: z9.boolean() }).strict();
|
|
260
|
-
|
|
261
262
|
// packages/experimental/src/zukhruf/runtime/plugin/plugin-agents.ts
|
|
262
263
|
import { parseFrontmatter as parseFrontmatter2, role as role2 } from "@deepagents/context";
|
|
263
264
|
|
|
@@ -488,8 +489,8 @@ var ConversationScheduler = class _ConversationScheduler {
|
|
|
488
489
|
}
|
|
489
490
|
return 1;
|
|
490
491
|
}
|
|
491
|
-
async work(
|
|
492
|
-
return this.#scheduler.consume((wake) => this.#handle(wake)
|
|
492
|
+
async work() {
|
|
493
|
+
return this.#scheduler.consume((wake) => this.#handle(wake));
|
|
493
494
|
}
|
|
494
495
|
async materializeDueIfEligible(conversation) {
|
|
495
496
|
if (!await this.#host.isConversationAvailable(conversation)) return;
|
|
@@ -974,7 +975,7 @@ var PgBossWakeScheduler = class extends WakeScheduler {
|
|
|
974
975
|
if (!id.trim()) throw new Error("WakeScheduler wake id cannot be empty");
|
|
975
976
|
await this.#boss.cancel(this.#queue, id);
|
|
976
977
|
}
|
|
977
|
-
async consume(handler
|
|
978
|
+
async consume(handler) {
|
|
978
979
|
const workerId = await this.#boss.work(
|
|
979
980
|
this.#queue,
|
|
980
981
|
{
|
|
@@ -991,7 +992,7 @@ var PgBossWakeScheduler = class extends WakeScheduler {
|
|
|
991
992
|
}
|
|
992
993
|
);
|
|
993
994
|
return {
|
|
994
|
-
[Symbol.asyncDispose]: () => this.#boss.offWork(this.#queue, { id: workerId, wait:
|
|
995
|
+
[Symbol.asyncDispose]: () => this.#boss.offWork(this.#queue, { id: workerId, wait: true })
|
|
995
996
|
};
|
|
996
997
|
}
|
|
997
998
|
};
|
|
@@ -1035,7 +1036,7 @@ function conversationScheduling() {
|
|
|
1035
1036
|
});
|
|
1036
1037
|
return {
|
|
1037
1038
|
tools: createSchedulingTools(conversationScheduler),
|
|
1038
|
-
work: (
|
|
1039
|
+
work: () => conversationScheduler.work(),
|
|
1039
1040
|
conversationAvailable: (conversation) => conversationScheduler.materializeDueIfEligible(conversation)
|
|
1040
1041
|
};
|
|
1041
1042
|
}
|