@deepagents/experimental 7.10.0 → 7.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -4
- package/dist/index.js +878 -666
- 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 +861 -649
- 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 +144 -140
- 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 +143 -139
- 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-sandboxes.d.ts +2 -1
- package/dist/zukhruf/runtime/conversation-sandboxes.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
|
@@ -14,6 +14,6 @@ export declare class PgBossWakeScheduler<T extends object> extends WakeScheduler
|
|
|
14
14
|
initialize(): Promise<void>;
|
|
15
15
|
schedule(wake: Wake<T>): Promise<void>;
|
|
16
16
|
cancel(id: string): Promise<void>;
|
|
17
|
-
consume(handler: (wake: Wake<T>) => Promise<void
|
|
17
|
+
consume(handler: (wake: Wake<T>) => Promise<void>): Promise<AsyncDisposable>;
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=pg-boss.wake-scheduler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-boss.wake-scheduler.d.ts","sources":["../../../../src/zukhruf/plugins/conversation-scheduling/pg-boss.wake-scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,MAAM,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,8DAA8D;AAC9D,qBAAa,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;;IAOzE,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B,EAO5D;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAShC;IAEc,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAuCpD;IAEc,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/C;IAEc,OAAO,CACpB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"pg-boss.wake-scheduler.d.ts","sources":["../../../../src/zukhruf/plugins/conversation-scheduling/pg-boss.wake-scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,MAAM,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,EAAE,KAAK,IAAI,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,8DAA8D;AAC9D,qBAAa,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC;;IAOzE,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B,EAO5D;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAShC;IAEc,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAuCpD;IAEc,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/C;IAEc,OAAO,CACpB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GACxC,OAAO,CAAC,eAAe,CAAC,CAwB1B;CACF"}
|
|
@@ -7,6 +7,6 @@ export interface Wake<T extends object> {
|
|
|
7
7
|
export declare abstract class WakeScheduler<T extends object> {
|
|
8
8
|
abstract schedule(wake: Wake<T>): Promise<void>;
|
|
9
9
|
abstract cancel(id: string): Promise<void>;
|
|
10
|
-
abstract consume(handler: (wake: Wake<T>) => Promise<void
|
|
10
|
+
abstract consume(handler: (wake: Wake<T>) => Promise<void>): Promise<AsyncDisposable>;
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=wake-scheduler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wake-scheduler.d.ts","sources":["../../../../src/zukhruf/plugins/conversation-scheduling/wake-scheduler.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,MAAM;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,EAAE,CAAC,CAAC;CACT;AAED,gEAAgE;AAChE,8BAAsB,aAAa,CAAC,CAAC,SAAS,MAAM;IAClD,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,QAAQ,CAAC,OAAO,CACd,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"wake-scheduler.d.ts","sources":["../../../../src/zukhruf/plugins/conversation-scheduling/wake-scheduler.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,MAAM;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,IAAI,CAAC;IACZ,IAAI,EAAE,CAAC,CAAC;CACT;AAED,gEAAgE;AAChE,8BAAsB,aAAa,CAAC,CAAC,SAAS,MAAM;IAClD,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,QAAQ,CAAC,OAAO,CACd,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,GACxC,OAAO,CAAC,eAAe,CAAC,CAAC;CAC7B"}
|
|
@@ -7,6 +7,115 @@ import {
|
|
|
7
7
|
ContextEngine as ContextEngine6
|
|
8
8
|
} from "@deepagents/context";
|
|
9
9
|
|
|
10
|
+
// packages/experimental/src/zukhruf/collaboration/message-tools.ts
|
|
11
|
+
import { tool } from "ai";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
var agentMessageInputSchema = z.object({
|
|
14
|
+
target: z.string().trim().min(1).describe(
|
|
15
|
+
"The canonical /root/... path, or a descendant-relative target name."
|
|
16
|
+
),
|
|
17
|
+
message: z.string().trim().min(1).describe("The message or follow-up task.")
|
|
18
|
+
});
|
|
19
|
+
var sendMessageTool = tool({
|
|
20
|
+
description: "Queue a message for another agent. Address siblings with their canonical /root/... path.",
|
|
21
|
+
inputSchema: agentMessageInputSchema,
|
|
22
|
+
execute: async (input, { context }) => {
|
|
23
|
+
await context.controlPlane.sendMessage(context.actor, input);
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var followupTaskTool = tool({
|
|
28
|
+
description: "Send a follow-up task to an existing non-root agent and wake its thread.",
|
|
29
|
+
inputSchema: agentMessageInputSchema,
|
|
30
|
+
execute: async (input, { context }) => {
|
|
31
|
+
await context.controlPlane.followupTask(context.actor, input);
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// packages/experimental/src/zukhruf/collaboration/spawn-agent.ts
|
|
37
|
+
import { tool as tool2 } from "ai";
|
|
38
|
+
import { z as z2 } from "zod";
|
|
39
|
+
|
|
40
|
+
// packages/experimental/src/zukhruf/control-plane/fork-turns.ts
|
|
41
|
+
var forkTurnsError = "fork_turns must be `none` or `all`";
|
|
42
|
+
function parseForkTurns(value) {
|
|
43
|
+
const normalized = value?.trim().toLowerCase() || "all";
|
|
44
|
+
return normalized === "none" || normalized === "all" ? normalized : void 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// packages/experimental/src/zukhruf/collaboration/spawn-agent.ts
|
|
48
|
+
var spawnAgentInputSchema = z2.object({
|
|
49
|
+
agent_type: z2.string().trim().min(1).describe("The name of one available subagent declaration."),
|
|
50
|
+
task_name: z2.string().trim().min(1).refine(
|
|
51
|
+
(value) => value !== "." && value !== ".." && !value.includes("/"),
|
|
52
|
+
"task_name must be one non-empty path segment"
|
|
53
|
+
).describe("One path segment naming this independent agent task."),
|
|
54
|
+
message: z2.string().refine((value) => value.trim().length > 0, "message cannot be empty").describe("The initial task for the spawned agent."),
|
|
55
|
+
fork_turns: z2.string({ error: forkTurnsError }).optional().refine((value) => parseForkTurns(value) !== void 0, forkTurnsError).describe(
|
|
56
|
+
"Parent history to inherit. Defaults to `all`; use `none` to start without parent history. Only `all` and `none` are supported."
|
|
57
|
+
)
|
|
58
|
+
});
|
|
59
|
+
var spawnAgentOutputSchema = z2.object({ task_name: z2.string() }).strict();
|
|
60
|
+
|
|
61
|
+
// packages/experimental/src/zukhruf/collaboration/interrupt-agent.ts
|
|
62
|
+
import { tool as tool3 } from "ai";
|
|
63
|
+
import { z as z4 } from "zod";
|
|
64
|
+
|
|
65
|
+
// packages/experimental/src/zukhruf/control-plane/agent-status-projector.ts
|
|
66
|
+
import { isTextUIPart } from "ai";
|
|
67
|
+
import { z as z3 } from "zod";
|
|
68
|
+
import {
|
|
69
|
+
ContextEngine
|
|
70
|
+
} from "@deepagents/context";
|
|
71
|
+
var listedAgentStatusSchema = z3.union([
|
|
72
|
+
z3.enum(["pending_init", "running", "interrupted", "shutdown", "not_found"]),
|
|
73
|
+
z3.object({ completed: z3.string().nullable() }).strict(),
|
|
74
|
+
z3.object({ errored: z3.string() }).strict()
|
|
75
|
+
]);
|
|
76
|
+
var listedAgentSchema = z3.object({
|
|
77
|
+
agent_name: z3.string(),
|
|
78
|
+
agent_status: listedAgentStatusSchema
|
|
79
|
+
}).strict();
|
|
80
|
+
|
|
81
|
+
// packages/experimental/src/zukhruf/collaboration/interrupt-agent.ts
|
|
82
|
+
var interruptAgentInputSchema = z4.object({
|
|
83
|
+
target: z4.string().trim().min(1).describe(
|
|
84
|
+
"The canonical /root/... path, or a descendant-relative target name."
|
|
85
|
+
)
|
|
86
|
+
});
|
|
87
|
+
var interruptAgentOutputSchema = z4.object({ previous_status: listedAgentStatusSchema }).strict();
|
|
88
|
+
var interruptAgentTool = tool3({
|
|
89
|
+
description: "Interrupt an agent's current turn, if any, and return its previous status. The agent remains available for messages and follow-up tasks.",
|
|
90
|
+
inputSchema: interruptAgentInputSchema,
|
|
91
|
+
outputSchema: interruptAgentOutputSchema,
|
|
92
|
+
execute: async (input, { context }) => context.controlPlane.interruptAgent(context.actor, input)
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// packages/experimental/src/zukhruf/collaboration/list-agents.ts
|
|
96
|
+
import { tool as tool4 } from "ai";
|
|
97
|
+
import { z as z5 } from "zod";
|
|
98
|
+
var listAgentsInputSchema = z5.object({
|
|
99
|
+
path_prefix: z5.string().trim().min(1).describe(
|
|
100
|
+
"Task-path prefix without a trailing slash. Omit to list the whole tree."
|
|
101
|
+
).optional()
|
|
102
|
+
});
|
|
103
|
+
var listAgentsOutputSchema = z5.object({ agents: z5.array(listedAgentSchema) }).strict();
|
|
104
|
+
var listAgentsTool = tool4({
|
|
105
|
+
description: "List live agents in the current root thread tree. Optionally filter by task-path prefix.",
|
|
106
|
+
inputSchema: listAgentsInputSchema,
|
|
107
|
+
outputSchema: listAgentsOutputSchema,
|
|
108
|
+
execute: async ({ path_prefix }, { context }) => context.controlPlane.listAgents(context.actor, path_prefix)
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// packages/experimental/src/zukhruf/collaboration/wait-agent.ts
|
|
112
|
+
import { tool as tool5 } from "ai";
|
|
113
|
+
import { z as z6 } from "zod";
|
|
114
|
+
var waitAgentOutputSchema = z6.object({ message: z6.string(), timed_out: z6.boolean() }).strict();
|
|
115
|
+
|
|
116
|
+
// packages/experimental/src/zukhruf/collaboration/team.ts
|
|
117
|
+
var USE_CLAUSES = new Intl.ListFormat("en", { type: "conjunction" });
|
|
118
|
+
|
|
10
119
|
// packages/experimental/src/zukhruf/control-plane/agent-control-plane.ts
|
|
11
120
|
import { v5 as uuidv54 } from "uuid";
|
|
12
121
|
|
|
@@ -15,7 +124,7 @@ import { Future, Latch } from "@zukhruf/async";
|
|
|
15
124
|
import { Mutex } from "@zukhruf/mutex";
|
|
16
125
|
import { MemoryStore } from "@zukhruf/mutex/memory";
|
|
17
126
|
import {
|
|
18
|
-
ContextEngine as
|
|
127
|
+
ContextEngine as ContextEngine3
|
|
19
128
|
} from "@deepagents/context";
|
|
20
129
|
|
|
21
130
|
// packages/experimental/src/zukhruf/runtime/approval-controller.ts
|
|
@@ -24,26 +133,26 @@ import {
|
|
|
24
133
|
isToolUIPart
|
|
25
134
|
} from "ai";
|
|
26
135
|
import {
|
|
27
|
-
ContextEngine,
|
|
136
|
+
ContextEngine as ContextEngine2,
|
|
28
137
|
assistant
|
|
29
138
|
} from "@deepagents/context";
|
|
30
139
|
|
|
31
140
|
// packages/experimental/src/zukhruf/runtime/conversation-status/child-progress.ts
|
|
32
|
-
import { z } from "zod";
|
|
33
|
-
var childActivitySchema =
|
|
34
|
-
id:
|
|
35
|
-
type:
|
|
36
|
-
at:
|
|
37
|
-
actorPath:
|
|
38
|
-
targetPath:
|
|
39
|
-
streamId:
|
|
40
|
-
outcome:
|
|
141
|
+
import { z as z7 } from "zod";
|
|
142
|
+
var childActivitySchema = z7.object({
|
|
143
|
+
id: z7.string(),
|
|
144
|
+
type: z7.enum(["spawn", "message", "followup", "interrupt", "completion"]),
|
|
145
|
+
at: z7.number(),
|
|
146
|
+
actorPath: z7.string(),
|
|
147
|
+
targetPath: z7.string(),
|
|
148
|
+
streamId: z7.string(),
|
|
149
|
+
outcome: z7.enum(["completed", "failed", "cancelled"]).optional()
|
|
41
150
|
});
|
|
42
|
-
var childActivitiesSchema =
|
|
151
|
+
var childActivitiesSchema = z7.partialRecord(
|
|
43
152
|
childActivitySchema.shape.type,
|
|
44
153
|
childActivitySchema
|
|
45
154
|
);
|
|
46
|
-
var childActivityMetadataSchema =
|
|
155
|
+
var childActivityMetadataSchema = z7.looseObject({
|
|
47
156
|
childActivities: childActivitiesSchema.default({})
|
|
48
157
|
});
|
|
49
158
|
|
|
@@ -69,27 +178,11 @@ import {
|
|
|
69
178
|
isSyntheticReminderMessage
|
|
70
179
|
} from "@deepagents/context";
|
|
71
180
|
|
|
72
|
-
// packages/experimental/src/zukhruf/control-plane/agent-status-projector.ts
|
|
73
|
-
import { isTextUIPart } from "ai";
|
|
74
|
-
import { z as z2 } from "zod";
|
|
75
|
-
import {
|
|
76
|
-
ContextEngine as ContextEngine3
|
|
77
|
-
} from "@deepagents/context";
|
|
78
|
-
var listedAgentStatusSchema = z2.union([
|
|
79
|
-
z2.enum(["pending_init", "running", "interrupted", "shutdown", "not_found"]),
|
|
80
|
-
z2.object({ completed: z2.string().nullable() }).strict(),
|
|
81
|
-
z2.object({ errored: z2.string() }).strict()
|
|
82
|
-
]);
|
|
83
|
-
var listedAgentSchema = z2.object({
|
|
84
|
-
agent_name: z2.string(),
|
|
85
|
-
agent_status: listedAgentStatusSchema
|
|
86
|
-
}).strict();
|
|
87
|
-
|
|
88
181
|
// packages/experimental/src/zukhruf/control-plane/agent-turn-id.ts
|
|
89
182
|
import { v5 as uuidv53, validate as validateUuid } from "uuid";
|
|
90
|
-
import { z as
|
|
183
|
+
import { z as z8 } from "zod";
|
|
91
184
|
var prefix = "zukhruf-turn";
|
|
92
|
-
var agentTurnIdSchema =
|
|
185
|
+
var agentTurnIdSchema = z8.string().refine((value) => {
|
|
93
186
|
const [head, scope, turn, ...rest] = value.split(":");
|
|
94
187
|
return head === prefix && rest.length === 0 && validateUuid(scope) && validateUuid(turn);
|
|
95
188
|
});
|
|
@@ -103,10 +196,9 @@ import {
|
|
|
103
196
|
import pMemoize from "p-memoize";
|
|
104
197
|
|
|
105
198
|
// packages/experimental/src/zukhruf/runtime/agent-turn-executor.ts
|
|
106
|
-
import { experimental_codeModeTool } from "@ai-sdk/code-mode";
|
|
107
199
|
import {
|
|
108
200
|
jsonSchema,
|
|
109
|
-
tool
|
|
201
|
+
tool as tool6
|
|
110
202
|
} from "ai";
|
|
111
203
|
import {
|
|
112
204
|
ContextEngine as ContextEngine5,
|
|
@@ -128,7 +220,7 @@ import {
|
|
|
128
220
|
asSchema,
|
|
129
221
|
modelMessageSchema as modelMessageSchema2
|
|
130
222
|
} from "ai";
|
|
131
|
-
import { z as
|
|
223
|
+
import { z as z9 } from "zod";
|
|
132
224
|
|
|
133
225
|
// packages/compaction/dist/index.js
|
|
134
226
|
import {
|
|
@@ -140,21 +232,21 @@ import {
|
|
|
140
232
|
import {
|
|
141
233
|
isRecord as isRecord3
|
|
142
234
|
} from "@deepagents/context";
|
|
143
|
-
var checkpointSchema =
|
|
144
|
-
sourceCount:
|
|
145
|
-
sourceHash:
|
|
146
|
-
replacement:
|
|
235
|
+
var checkpointSchema = z9.object({
|
|
236
|
+
sourceCount: z9.number().int().positive(),
|
|
237
|
+
sourceHash: z9.string(),
|
|
238
|
+
replacement: z9.array(z9.unknown()).transform(
|
|
147
239
|
(messages) => messages.map((message) => modelMessageSchema2.parse(message))
|
|
148
240
|
)
|
|
149
241
|
});
|
|
150
|
-
var cacheObservationSchema =
|
|
151
|
-
scope:
|
|
152
|
-
prefixLength:
|
|
153
|
-
prefixHash:
|
|
154
|
-
startedAt:
|
|
155
|
-
retentionMs:
|
|
242
|
+
var cacheObservationSchema = z9.object({
|
|
243
|
+
scope: z9.string(),
|
|
244
|
+
prefixLength: z9.number().int().nonnegative(),
|
|
245
|
+
prefixHash: z9.string(),
|
|
246
|
+
startedAt: z9.number().int().nonnegative(),
|
|
247
|
+
retentionMs: z9.number().int().positive().optional()
|
|
156
248
|
});
|
|
157
|
-
var inputUsageSchema = cacheObservationSchema.pick({ scope: true, prefixLength: true, prefixHash: true }).extend({ inputTokens:
|
|
249
|
+
var inputUsageSchema = cacheObservationSchema.pick({ scope: true, prefixLength: true, prefixHash: true }).extend({ inputTokens: z9.number().int().nonnegative() });
|
|
158
250
|
|
|
159
251
|
// packages/experimental/src/zukhruf/runtime/plugin/agent-skills.ts
|
|
160
252
|
import {
|
|
@@ -162,96 +254,8 @@ import {
|
|
|
162
254
|
skills
|
|
163
255
|
} from "@deepagents/context";
|
|
164
256
|
|
|
165
|
-
// packages/experimental/src/zukhruf/
|
|
166
|
-
import {
|
|
167
|
-
import { z as z5 } from "zod";
|
|
168
|
-
var interruptAgentInputSchema = z5.object({
|
|
169
|
-
target: z5.string().trim().min(1).describe(
|
|
170
|
-
"The canonical /root/... path, or a descendant-relative target name."
|
|
171
|
-
)
|
|
172
|
-
});
|
|
173
|
-
var interruptAgentOutputSchema = z5.object({ previous_status: listedAgentStatusSchema }).strict();
|
|
174
|
-
var interruptAgentTool = tool2({
|
|
175
|
-
description: "Interrupt an agent's current turn, if any, and return its previous status. The agent remains available for messages and follow-up tasks.",
|
|
176
|
-
inputSchema: interruptAgentInputSchema,
|
|
177
|
-
outputSchema: interruptAgentOutputSchema,
|
|
178
|
-
execute: async (input, { context }) => context.controlPlane.interruptAgent(context.actor, input)
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
// packages/experimental/src/zukhruf/collaboration/list-agents.ts
|
|
182
|
-
import { tool as tool3 } from "ai";
|
|
183
|
-
import { z as z6 } from "zod";
|
|
184
|
-
var listAgentsInputSchema = z6.object({
|
|
185
|
-
path_prefix: z6.string().trim().min(1).describe(
|
|
186
|
-
"Task-path prefix without a trailing slash. Omit to list the whole tree."
|
|
187
|
-
).optional()
|
|
188
|
-
});
|
|
189
|
-
var listAgentsOutputSchema = z6.object({ agents: z6.array(listedAgentSchema) }).strict();
|
|
190
|
-
var listAgentsTool = tool3({
|
|
191
|
-
description: "List live agents in the current root thread tree. Optionally filter by task-path prefix.",
|
|
192
|
-
inputSchema: listAgentsInputSchema,
|
|
193
|
-
outputSchema: listAgentsOutputSchema,
|
|
194
|
-
execute: async ({ path_prefix }, { context }) => context.controlPlane.listAgents(context.actor, path_prefix)
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
// packages/experimental/src/zukhruf/collaboration/message-tools.ts
|
|
198
|
-
import { tool as tool4 } from "ai";
|
|
199
|
-
import { z as z7 } from "zod";
|
|
200
|
-
var agentMessageInputSchema = z7.object({
|
|
201
|
-
target: z7.string().trim().min(1).describe(
|
|
202
|
-
"The canonical /root/... path, or a descendant-relative target name."
|
|
203
|
-
),
|
|
204
|
-
message: z7.string().trim().min(1).describe("The message or follow-up task.")
|
|
205
|
-
});
|
|
206
|
-
var sendMessageTool = tool4({
|
|
207
|
-
description: "Queue a message for another agent. Address siblings with their canonical /root/... path.",
|
|
208
|
-
inputSchema: agentMessageInputSchema,
|
|
209
|
-
execute: async (input, { context }) => {
|
|
210
|
-
await context.controlPlane.sendMessage(context.actor, input);
|
|
211
|
-
return "";
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
var followupTaskTool = tool4({
|
|
215
|
-
description: "Send a follow-up task to an existing non-root agent and wake its thread.",
|
|
216
|
-
inputSchema: agentMessageInputSchema,
|
|
217
|
-
execute: async (input, { context }) => {
|
|
218
|
-
await context.controlPlane.followupTask(context.actor, input);
|
|
219
|
-
return "";
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
// packages/experimental/src/zukhruf/collaboration/spawn-agent.ts
|
|
224
|
-
import { tool as tool5 } from "ai";
|
|
225
|
-
import { z as z8 } from "zod";
|
|
226
|
-
|
|
227
|
-
// packages/experimental/src/zukhruf/control-plane/fork-turns.ts
|
|
228
|
-
var forkTurnsError = "fork_turns must be `none`, `all`, or a positive integer string";
|
|
229
|
-
function parseForkTurns(value) {
|
|
230
|
-
const normalized = value.trim().toLowerCase();
|
|
231
|
-
if (normalized === "none" || normalized === "all") return normalized;
|
|
232
|
-
if (!/^\d+$/.test(normalized)) return void 0;
|
|
233
|
-
const turns = Number(normalized);
|
|
234
|
-
return Number.isSafeInteger(turns) && turns > 0 ? turns : void 0;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// packages/experimental/src/zukhruf/collaboration/spawn-agent.ts
|
|
238
|
-
var spawnAgentInputSchema = z8.object({
|
|
239
|
-
agent_type: z8.string().trim().min(1).describe("The name of one available subagent declaration."),
|
|
240
|
-
task_name: z8.string().trim().min(1).refine(
|
|
241
|
-
(value) => value !== "." && value !== ".." && !value.includes("/"),
|
|
242
|
-
"task_name must be one non-empty path segment"
|
|
243
|
-
).describe("One path segment naming this independent agent task."),
|
|
244
|
-
message: z8.string().refine((value) => value.trim().length > 0, "message cannot be empty").describe("The initial task for the spawned agent."),
|
|
245
|
-
fork_turns: z8.string().trim().refine((value) => parseForkTurns(value) !== void 0, forkTurnsError).describe(
|
|
246
|
-
"Required number of parent turns to fork. Use `none`, `all`, or a positive integer string such as `3`."
|
|
247
|
-
)
|
|
248
|
-
});
|
|
249
|
-
var spawnAgentOutputSchema = z8.object({ task_name: z8.string() }).strict();
|
|
250
|
-
|
|
251
|
-
// packages/experimental/src/zukhruf/collaboration/wait-agent.ts
|
|
252
|
-
import { tool as tool6 } from "ai";
|
|
253
|
-
import { z as z9 } from "zod";
|
|
254
|
-
var waitAgentOutputSchema = z9.object({ message: z9.string(), timed_out: z9.boolean() }).strict();
|
|
257
|
+
// packages/experimental/src/zukhruf/runtime/conversation-sandboxes.ts
|
|
258
|
+
import { SandboxNotFoundError } from "@deepagents/context";
|
|
255
259
|
|
|
256
260
|
// packages/experimental/src/zukhruf/runtime/plugin/plugin-agents.ts
|
|
257
261
|
import { parseFrontmatter as parseFrontmatter2, role as role2 } from "@deepagents/context";
|
|
@@ -1009,7 +1013,7 @@ var ScheduledTasks = class {
|
|
|
1009
1013
|
async archiveRun(ownerId, runId) {
|
|
1010
1014
|
return this.#setReviewStatus(ownerId, runId, "archived");
|
|
1011
1015
|
}
|
|
1012
|
-
async work(options
|
|
1016
|
+
async work(options) {
|
|
1013
1017
|
const workOptions = { ...options, includeMetadata: true };
|
|
1014
1018
|
const workerId = await this.#boss.work(
|
|
1015
1019
|
this.#queue,
|
|
@@ -1019,7 +1023,7 @@ var ScheduledTasks = class {
|
|
|
1019
1023
|
}
|
|
1020
1024
|
);
|
|
1021
1025
|
return {
|
|
1022
|
-
[Symbol.asyncDispose]: () => this.#boss.offWork(this.#queue, { id: workerId, wait:
|
|
1026
|
+
[Symbol.asyncDispose]: () => this.#boss.offWork(this.#queue, { id: workerId, wait: true })
|
|
1023
1027
|
};
|
|
1024
1028
|
}
|
|
1025
1029
|
async #handle(job) {
|
|
@@ -1805,8 +1809,8 @@ var RunningSchedules = class _RunningSchedules {
|
|
|
1805
1809
|
}
|
|
1806
1810
|
});
|
|
1807
1811
|
}
|
|
1808
|
-
work(
|
|
1809
|
-
return this.#scheduled.work(this.#workerOptions
|
|
1812
|
+
work() {
|
|
1813
|
+
return this.#scheduled.work(this.#workerOptions);
|
|
1810
1814
|
}
|
|
1811
1815
|
async create(ownerId, input) {
|
|
1812
1816
|
const executionConfig = normalizeExecutionConfig(input.executionConfig);
|