@deepagents/experimental 4.3.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +9 -5
  2. package/dist/index.js +1716 -152
  3. package/dist/index.js.map +4 -4
  4. package/dist/zukhruf/agent-control-plane.d.ts +68 -0
  5. package/dist/zukhruf/agent-control-plane.d.ts.map +1 -0
  6. package/dist/zukhruf/agent-declaration-registry.d.ts +9 -0
  7. package/dist/zukhruf/agent-declaration-registry.d.ts.map +1 -0
  8. package/dist/zukhruf/agent-directory.d.ts +21 -0
  9. package/dist/zukhruf/agent-directory.d.ts.map +1 -0
  10. package/dist/zukhruf/agent-path.d.ts +15 -0
  11. package/dist/zukhruf/agent-path.d.ts.map +1 -0
  12. package/dist/zukhruf/agent-runtime.d.ts +53 -0
  13. package/dist/zukhruf/agent-runtime.d.ts.map +1 -0
  14. package/dist/zukhruf/agent-status-projector.d.ts +32 -0
  15. package/dist/zukhruf/agent-status-projector.d.ts.map +1 -0
  16. package/dist/zukhruf/agent-thread.d.ts +31 -0
  17. package/dist/zukhruf/agent-thread.d.ts.map +1 -0
  18. package/dist/zukhruf/agent-tool-context.d.ts +6 -0
  19. package/dist/zukhruf/agent-tool-context.d.ts.map +1 -0
  20. package/dist/zukhruf/agent-turn-executor.d.ts +19 -0
  21. package/dist/zukhruf/agent-turn-executor.d.ts.map +1 -0
  22. package/dist/zukhruf/agent-turn-id.d.ts +11 -0
  23. package/dist/zukhruf/agent-turn-id.d.ts.map +1 -0
  24. package/dist/zukhruf/agent.d.ts +13 -8
  25. package/dist/zukhruf/agent.d.ts.map +1 -1
  26. package/dist/zukhruf/approval-controller.d.ts +34 -0
  27. package/dist/zukhruf/approval-controller.d.ts.map +1 -0
  28. package/dist/zukhruf/approval-mutex.d.ts +5 -0
  29. package/dist/zukhruf/approval-mutex.d.ts.map +1 -0
  30. package/dist/zukhruf/index.d.ts +15 -11
  31. package/dist/zukhruf/index.d.ts.map +1 -1
  32. package/dist/zukhruf/index.js +1716 -152
  33. package/dist/zukhruf/index.js.map +4 -4
  34. package/dist/zukhruf/list-agents.d.ts +234 -0
  35. package/dist/zukhruf/list-agents.d.ts.map +1 -0
  36. package/dist/zukhruf/mailbox/coordinator.d.ts +22 -0
  37. package/dist/zukhruf/mailbox/coordinator.d.ts.map +1 -0
  38. package/dist/zukhruf/mailbox/sqlite.store.d.ts +16 -0
  39. package/dist/zukhruf/mailbox/sqlite.store.d.ts.map +1 -0
  40. package/dist/zukhruf/mailbox/store.d.ts +20 -0
  41. package/dist/zukhruf/mailbox/store.d.ts.map +1 -0
  42. package/dist/zukhruf/mailbox/types.d.ts +35 -0
  43. package/dist/zukhruf/mailbox/types.d.ts.map +1 -0
  44. package/dist/zukhruf/message-tools.d.ts +456 -0
  45. package/dist/zukhruf/message-tools.d.ts.map +1 -0
  46. package/dist/zukhruf/queue/pg-boss.turn-queue.d.ts +2 -1
  47. package/dist/zukhruf/queue/pg-boss.turn-queue.d.ts.map +1 -1
  48. package/dist/zukhruf/queue/turn-queue.d.ts +14 -0
  49. package/dist/zukhruf/queue/turn-queue.d.ts.map +1 -1
  50. package/dist/zukhruf/spawn-agent.d.ts +301 -0
  51. package/dist/zukhruf/spawn-agent.d.ts.map +1 -0
  52. package/dist/zukhruf/sqlite-approval-mutex.d.ts +17 -0
  53. package/dist/zukhruf/sqlite-approval-mutex.d.ts.map +1 -0
  54. package/package.json +8 -7
  55. package/dist/zukhruf/runtime.d.ts +0 -67
  56. package/dist/zukhruf/runtime.d.ts.map +0 -1
@@ -0,0 +1,234 @@
1
+ import type { ListedAgent } from './agent-control-plane.ts';
2
+ import type { AgentToolContext } from './agent-tool-context.ts';
3
+ export declare const listAgentsTool: ({
4
+ title?: string;
5
+ providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
6
+ metadata?: import("@ai-sdk/provider").JSONObject;
7
+ inputSchema: import("ai").FlexibleSchema<{
8
+ path_prefix?: string | undefined;
9
+ }>;
10
+ contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
11
+ needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
12
+ path_prefix?: string | undefined;
13
+ }, NoInfer<AgentToolContext>> | undefined;
14
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
15
+ onInputDelta?: ((options: {
16
+ inputTextDelta: string;
17
+ } & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
18
+ onInputAvailable?: ((options: {
19
+ input: {
20
+ path_prefix?: string | undefined;
21
+ };
22
+ } & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
23
+ toModelOutput?: ((options: {
24
+ toolCallId: string;
25
+ input: {
26
+ path_prefix?: string | undefined;
27
+ };
28
+ output: NoInfer<{
29
+ agents: ListedAgent[];
30
+ }>;
31
+ }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
32
+ } & {
33
+ outputSchema?: import("ai").FlexibleSchema<{
34
+ agents: ListedAgent[];
35
+ }> | undefined;
36
+ execute: import("ai").ToolExecuteFunction<{
37
+ path_prefix?: string | undefined;
38
+ }, {
39
+ agents: ListedAgent[];
40
+ }, NoInfer<AgentToolContext>>;
41
+ } & {
42
+ description?: string | ((options: {
43
+ context: NoInfer<AgentToolContext>;
44
+ experimental_sandbox?: import("ai").Experimental_SandboxSession;
45
+ }) => string) | undefined;
46
+ strict?: boolean;
47
+ inputExamples?: {
48
+ input: NoInfer<{
49
+ path_prefix?: string | undefined;
50
+ }>;
51
+ }[] | undefined;
52
+ id?: never;
53
+ isProviderExecuted?: never;
54
+ args?: never;
55
+ supportsDeferredResults?: never;
56
+ } & {
57
+ type?: undefined | "function";
58
+ } & {
59
+ execute: import("ai").ToolExecuteFunction<{
60
+ path_prefix?: string | undefined;
61
+ }, {
62
+ agents: ListedAgent[];
63
+ }, NoInfer<AgentToolContext>>;
64
+ }) | ({
65
+ title?: string;
66
+ providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
67
+ metadata?: import("@ai-sdk/provider").JSONObject;
68
+ inputSchema: import("ai").FlexibleSchema<{
69
+ path_prefix?: string | undefined;
70
+ }>;
71
+ contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
72
+ needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
73
+ path_prefix?: string | undefined;
74
+ }, NoInfer<AgentToolContext>> | undefined;
75
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
76
+ onInputDelta?: ((options: {
77
+ inputTextDelta: string;
78
+ } & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
79
+ onInputAvailable?: ((options: {
80
+ input: {
81
+ path_prefix?: string | undefined;
82
+ };
83
+ } & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
84
+ toModelOutput?: ((options: {
85
+ toolCallId: string;
86
+ input: {
87
+ path_prefix?: string | undefined;
88
+ };
89
+ output: NoInfer<{
90
+ agents: ListedAgent[];
91
+ }>;
92
+ }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
93
+ } & {
94
+ outputSchema?: import("ai").FlexibleSchema<{
95
+ agents: ListedAgent[];
96
+ }> | undefined;
97
+ execute: import("ai").ToolExecuteFunction<{
98
+ path_prefix?: string | undefined;
99
+ }, {
100
+ agents: ListedAgent[];
101
+ }, NoInfer<AgentToolContext>>;
102
+ } & {
103
+ description?: string | ((options: {
104
+ context: NoInfer<AgentToolContext>;
105
+ experimental_sandbox?: import("ai").Experimental_SandboxSession;
106
+ }) => string) | undefined;
107
+ strict?: boolean;
108
+ inputExamples?: {
109
+ input: NoInfer<{
110
+ path_prefix?: string | undefined;
111
+ }>;
112
+ }[] | undefined;
113
+ id?: never;
114
+ isProviderExecuted?: never;
115
+ args?: never;
116
+ supportsDeferredResults?: never;
117
+ } & {
118
+ type: "dynamic";
119
+ } & {
120
+ execute: import("ai").ToolExecuteFunction<{
121
+ path_prefix?: string | undefined;
122
+ }, {
123
+ agents: ListedAgent[];
124
+ }, NoInfer<AgentToolContext>>;
125
+ }) | ({
126
+ title?: string;
127
+ providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
128
+ metadata?: import("@ai-sdk/provider").JSONObject;
129
+ inputSchema: import("ai").FlexibleSchema<{
130
+ path_prefix?: string | undefined;
131
+ }>;
132
+ contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
133
+ needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
134
+ path_prefix?: string | undefined;
135
+ }, NoInfer<AgentToolContext>> | undefined;
136
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
137
+ onInputDelta?: ((options: {
138
+ inputTextDelta: string;
139
+ } & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
140
+ onInputAvailable?: ((options: {
141
+ input: {
142
+ path_prefix?: string | undefined;
143
+ };
144
+ } & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
145
+ toModelOutput?: ((options: {
146
+ toolCallId: string;
147
+ input: {
148
+ path_prefix?: string | undefined;
149
+ };
150
+ output: NoInfer<{
151
+ agents: ListedAgent[];
152
+ }>;
153
+ }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
154
+ } & {
155
+ outputSchema?: import("ai").FlexibleSchema<{
156
+ agents: ListedAgent[];
157
+ }> | undefined;
158
+ execute: import("ai").ToolExecuteFunction<{
159
+ path_prefix?: string | undefined;
160
+ }, {
161
+ agents: ListedAgent[];
162
+ }, NoInfer<AgentToolContext>>;
163
+ } & {
164
+ type: "provider";
165
+ id: `${string}.${string}`;
166
+ args: Record<string, unknown>;
167
+ description?: never;
168
+ strict?: never;
169
+ inputExamples?: never;
170
+ } & {
171
+ isProviderExecuted: false;
172
+ supportsDeferredResults?: never;
173
+ } & {
174
+ execute: import("ai").ToolExecuteFunction<{
175
+ path_prefix?: string | undefined;
176
+ }, {
177
+ agents: ListedAgent[];
178
+ }, NoInfer<AgentToolContext>>;
179
+ }) | ({
180
+ title?: string;
181
+ providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
182
+ metadata?: import("@ai-sdk/provider").JSONObject;
183
+ inputSchema: import("ai").FlexibleSchema<{
184
+ path_prefix?: string | undefined;
185
+ }>;
186
+ contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
187
+ needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
188
+ path_prefix?: string | undefined;
189
+ }, NoInfer<AgentToolContext>> | undefined;
190
+ onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
191
+ onInputDelta?: ((options: {
192
+ inputTextDelta: string;
193
+ } & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
194
+ onInputAvailable?: ((options: {
195
+ input: {
196
+ path_prefix?: string | undefined;
197
+ };
198
+ } & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
199
+ toModelOutput?: ((options: {
200
+ toolCallId: string;
201
+ input: {
202
+ path_prefix?: string | undefined;
203
+ };
204
+ output: NoInfer<{
205
+ agents: ListedAgent[];
206
+ }>;
207
+ }) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
208
+ } & {
209
+ outputSchema?: import("ai").FlexibleSchema<{
210
+ agents: ListedAgent[];
211
+ }> | undefined;
212
+ execute: import("ai").ToolExecuteFunction<{
213
+ path_prefix?: string | undefined;
214
+ }, {
215
+ agents: ListedAgent[];
216
+ }, NoInfer<AgentToolContext>>;
217
+ } & {
218
+ type: "provider";
219
+ id: `${string}.${string}`;
220
+ args: Record<string, unknown>;
221
+ description?: never;
222
+ strict?: never;
223
+ inputExamples?: never;
224
+ } & {
225
+ isProviderExecuted: true;
226
+ supportsDeferredResults?: boolean;
227
+ } & {
228
+ execute: import("ai").ToolExecuteFunction<{
229
+ path_prefix?: string | undefined;
230
+ }, {
231
+ agents: ListedAgent[];
232
+ }, NoInfer<AgentToolContext>>;
233
+ });
234
+ //# sourceMappingURL=list-agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-agents.d.ts","sourceRoot":"","sources":["../../src/zukhruf/list-agents.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAehE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;oBAEf,WAAW,EAAE;;;;;gBAAb,WAAW,EAAE;;;;;gBAAb,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;gBAAb,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAb,WAAW,EAAE;;;;;gBAAb,WAAW,EAAE;;;;;gBAAb,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;gBAAb,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAb,WAAW,EAAE;;;;;gBAAb,WAAW,EAAE;;;;;gBAAb,WAAW,EAAE;;;;;;;;;;;;;;;;gBAAb,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAb,WAAW,EAAE;;;;;gBAAb,WAAW,EAAE;;;;;gBAAb,WAAW,EAAE;;;;;;;;;;;;;;;;gBAAb,WAAW,EAAE;;EAQvB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { StreamManager } from '@deepagents/context';
2
+ import type { TurnQueue, TurnRef } from '../queue/turn-queue.ts';
3
+ import type { MailboxStore } from './store.ts';
4
+ import { type ConversationId, type InterAgentCommunication, type MessageDeliveryMode } from './types.ts';
5
+ export interface MailboxCoordinatorOptions {
6
+ store: MailboxStore;
7
+ queue: Pick<TurnQueue, 'push'>;
8
+ streams: StreamManager;
9
+ }
10
+ /** Owns durable mail delivery and the serialized turns that wake recipients. */
11
+ export declare class MailboxCoordinator {
12
+ #private;
13
+ constructor(options: MailboxCoordinatorOptions);
14
+ deliver(communication: InterAgentCommunication, mode: MessageDeliveryMode): Promise<void>;
15
+ beginTurn(turn: TurnRef): Promise<void>;
16
+ endTurn(turn: TurnRef, options?: {
17
+ parked?: boolean;
18
+ }): Promise<void>;
19
+ drainLeadingQueueOnly(recipient: ConversationId): Promise<InterAgentCommunication[]>;
20
+ drain(recipient: ConversationId): Promise<InterAgentCommunication[]>;
21
+ }
22
+ //# sourceMappingURL=coordinator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../../src/zukhruf/mailbox/coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,uBAAuB,EAE5B,KAAK,mBAAmB,EAEzB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC/B,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,gFAAgF;AAChF,qBAAa,kBAAkB;;gBAMjB,OAAO,EAAE,yBAAyB;IAMxC,OAAO,CACX,aAAa,EAAE,uBAAuB,EACtC,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,IAAI,CAAC;IAmBhB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjC,OAAO,CACX,IAAI,EAAE,OAAO,EACb,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAO,GACjC,OAAO,CAAC,IAAI,CAAC;IAUhB,qBAAqB,CACnB,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAIrC,KAAK,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;CA0CrE"}
@@ -0,0 +1,16 @@
1
+ import { type MailboxEndTurnResult, type MailboxEnqueueResult, MailboxStore } from './store.ts';
2
+ import { type ConversationId, type InterAgentCommunication } from './types.ts';
3
+ /** SQLite-backed mailbox for durable cross-process delivery. */
4
+ export declare class SqliteMailboxStore extends MailboxStore implements Disposable {
5
+ #private;
6
+ constructor(path: string);
7
+ beginTurn(recipient: ConversationId, turnId: string): Promise<void>;
8
+ enqueue(communication: InterAgentCommunication): Promise<MailboxEnqueueResult>;
9
+ endTurn(recipient: ConversationId, turnId: string): Promise<MailboxEndTurnResult>;
10
+ hasPending(recipient: ConversationId): Promise<boolean>;
11
+ drain(recipient: ConversationId): Promise<InterAgentCommunication[]>;
12
+ drainLeadingQueueOnly(recipient: ConversationId): Promise<InterAgentCommunication[]>;
13
+ close(): void;
14
+ [Symbol.dispose](): void;
15
+ }
16
+ //# sourceMappingURL=sqlite.store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite.store.d.ts","sourceRoot":"","sources":["../../../src/zukhruf/mailbox/sqlite.store.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,YAAY,EACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAE7B,MAAM,YAAY,CAAC;AAuCpB,gEAAgE;AAChE,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,UAAU;;gBAI5D,IAAI,EAAE,MAAM;IAMT,SAAS,CACtB,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAgBD,OAAO,CACpB,aAAa,EAAE,uBAAuB,GACrC,OAAO,CAAC,oBAAoB,CAAC;IA0BjB,OAAO,CACpB,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,oBAAoB,CAAC;IAiBjB,UAAU,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IA0CvD,KAAK,CAClB,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAItB,qBAAqB,CAClC,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAyErC,KAAK,IAAI,IAAI;IAMb,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGzB"}
@@ -0,0 +1,20 @@
1
+ import type { ConversationId, InterAgentCommunication } from './types.ts';
2
+ export interface MailboxEnqueueResult {
3
+ recipientActive: boolean;
4
+ }
5
+ export interface MailboxEndTurnResult {
6
+ hasPending: boolean;
7
+ turnEnded: boolean;
8
+ }
9
+ /** Durable pending-mail storage. This is deliberately not an execution queue. */
10
+ export declare abstract class MailboxStore {
11
+ abstract beginTurn(recipient: ConversationId, turnId: string): Promise<void>;
12
+ abstract enqueue(communication: InterAgentCommunication): Promise<MailboxEnqueueResult>;
13
+ abstract endTurn(recipient: ConversationId, turnId: string): Promise<MailboxEndTurnResult>;
14
+ abstract hasPending(recipient: ConversationId): Promise<boolean>;
15
+ /** Consumes the contiguous queue-only prefix, stopping before the first trigger. */
16
+ abstract drainLeadingQueueOnly(recipient: ConversationId): Promise<InterAgentCommunication[]>;
17
+ /** Draining is consumption: removes and returns all pending mail in FIFO order. */
18
+ abstract drain(recipient: ConversationId): Promise<InterAgentCommunication[]>;
19
+ }
20
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/zukhruf/mailbox/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,iFAAiF;AACjF,8BAAsB,YAAY;IAChC,QAAQ,CAAC,SAAS,CAAC,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAE5E,QAAQ,CAAC,OAAO,CACd,aAAa,EAAE,uBAAuB,GACrC,OAAO,CAAC,oBAAoB,CAAC;IAEhC,QAAQ,CAAC,OAAO,CACd,SAAS,EAAE,cAAc,EACzB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,oBAAoB,CAAC;IAEhC,QAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IAEhE,oFAAoF;IACpF,QAAQ,CAAC,qBAAqB,CAC5B,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAErC,mFAAmF;IACnF,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;CAC9E"}
@@ -0,0 +1,35 @@
1
+ /** Durable thread identity; AgentPath is its model-facing address. */
2
+ export interface ConversationId {
3
+ chatId: string;
4
+ userId: string;
5
+ }
6
+ export declare const MessageDeliveryMode: {
7
+ readonly QueueOnly: "queue-only";
8
+ readonly TriggerTurn: "trigger-turn";
9
+ };
10
+ export type MessageDeliveryMode = (typeof MessageDeliveryMode)[keyof typeof MessageDeliveryMode];
11
+ export declare const InterAgentCommunicationType: {
12
+ readonly Message: "MESSAGE";
13
+ readonly NewTask: "NEW_TASK";
14
+ readonly FinalAnswer: "FINAL_ANSWER";
15
+ };
16
+ export type InterAgentCommunicationType = (typeof InterAgentCommunicationType)[keyof typeof InterAgentCommunicationType];
17
+ /** A model-visible message sent from one independent agent thread to another. */
18
+ export interface InterAgentCommunication {
19
+ id: string;
20
+ type: InterAgentCommunicationType;
21
+ author: ConversationId;
22
+ recipient: ConversationId;
23
+ otherRecipients: ConversationId[];
24
+ content: string;
25
+ metadata?: Record<string, unknown>;
26
+ triggerTurn: boolean;
27
+ }
28
+ export type NewInterAgentCommunication = Omit<InterAgentCommunication, 'id' | 'otherRecipients' | 'triggerTurn' | 'type'> & {
29
+ id?: string;
30
+ otherRecipients?: ConversationId[];
31
+ type?: InterAgentCommunicationType;
32
+ };
33
+ export declare function createInterAgentCommunication(communication: NewInterAgentCommunication): InterAgentCommunication;
34
+ export declare function assertCommunication(communication: InterAgentCommunication): void;
35
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/zukhruf/mailbox/types.ts"],"names":[],"mappings":"AAEA,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAC7B,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,eAAO,MAAM,2BAA2B;;;;CAI9B,CAAC;AAEX,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,OAAO,2BAA2B,CAAC,CAAC;AAEjF,iFAAiF;AACjF,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,2BAA2B,CAAC;IAClC,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,cAAc,CAAC;IAC1B,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAC3C,uBAAuB,EACvB,IAAI,GAAG,iBAAiB,GAAG,aAAa,GAAG,MAAM,CAClD,GAAG;IACF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;IACnC,IAAI,CAAC,EAAE,2BAA2B,CAAC;CACpC,CAAC;AAEF,wBAAgB,6BAA6B,CAC3C,aAAa,EAAE,0BAA0B,GACxC,uBAAuB,CAUzB;AAED,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,uBAAuB,GACrC,IAAI,CAiBN"}