opencode-swarm-plugin 0.21.0 → 0.23.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 (131) hide show
  1. package/.turbo/turbo-build.log +9 -0
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +111 -166
  4. package/dist/agent-mail.d.ts +480 -0
  5. package/dist/agent-mail.d.ts.map +1 -0
  6. package/dist/anti-patterns.d.ts +257 -0
  7. package/dist/anti-patterns.d.ts.map +1 -0
  8. package/dist/beads.d.ts +377 -0
  9. package/dist/beads.d.ts.map +1 -0
  10. package/dist/eval-capture.d.ts +206 -0
  11. package/dist/eval-capture.d.ts.map +1 -0
  12. package/dist/index.d.ts +1299 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +776 -4387
  15. package/dist/learning.d.ts +670 -0
  16. package/dist/learning.d.ts.map +1 -0
  17. package/dist/mandate-promotion.d.ts +93 -0
  18. package/dist/mandate-promotion.d.ts.map +1 -0
  19. package/dist/mandate-storage.d.ts +209 -0
  20. package/dist/mandate-storage.d.ts.map +1 -0
  21. package/dist/mandates.d.ts +230 -0
  22. package/dist/mandates.d.ts.map +1 -0
  23. package/dist/output-guardrails.d.ts +125 -0
  24. package/dist/output-guardrails.d.ts.map +1 -0
  25. package/dist/pattern-maturity.d.ts +246 -0
  26. package/dist/pattern-maturity.d.ts.map +1 -0
  27. package/dist/plugin.d.ts +22 -0
  28. package/dist/plugin.d.ts.map +1 -0
  29. package/dist/plugin.js +755 -4375
  30. package/dist/rate-limiter.d.ts +218 -0
  31. package/dist/rate-limiter.d.ts.map +1 -0
  32. package/dist/repo-crawl.d.ts +146 -0
  33. package/dist/repo-crawl.d.ts.map +1 -0
  34. package/dist/schemas/bead.d.ts +255 -0
  35. package/dist/schemas/bead.d.ts.map +1 -0
  36. package/dist/schemas/evaluation.d.ts +161 -0
  37. package/dist/schemas/evaluation.d.ts.map +1 -0
  38. package/dist/schemas/index.d.ts +34 -0
  39. package/dist/schemas/index.d.ts.map +1 -0
  40. package/dist/schemas/mandate.d.ts +336 -0
  41. package/dist/schemas/mandate.d.ts.map +1 -0
  42. package/dist/schemas/swarm-context.d.ts +131 -0
  43. package/dist/schemas/swarm-context.d.ts.map +1 -0
  44. package/dist/schemas/task.d.ts +188 -0
  45. package/dist/schemas/task.d.ts.map +1 -0
  46. package/dist/skills.d.ts +471 -0
  47. package/dist/skills.d.ts.map +1 -0
  48. package/dist/storage.d.ts +260 -0
  49. package/dist/storage.d.ts.map +1 -0
  50. package/dist/structured.d.ts +196 -0
  51. package/dist/structured.d.ts.map +1 -0
  52. package/dist/swarm-decompose.d.ts +201 -0
  53. package/dist/swarm-decompose.d.ts.map +1 -0
  54. package/dist/swarm-mail.d.ts +240 -0
  55. package/dist/swarm-mail.d.ts.map +1 -0
  56. package/dist/swarm-orchestrate.d.ts +708 -0
  57. package/dist/swarm-orchestrate.d.ts.map +1 -0
  58. package/dist/swarm-prompts.d.ts +292 -0
  59. package/dist/swarm-prompts.d.ts.map +1 -0
  60. package/dist/swarm-strategies.d.ts +100 -0
  61. package/dist/swarm-strategies.d.ts.map +1 -0
  62. package/dist/swarm.d.ts +455 -0
  63. package/dist/swarm.d.ts.map +1 -0
  64. package/dist/tool-availability.d.ts +91 -0
  65. package/dist/tool-availability.d.ts.map +1 -0
  66. package/docs/planning/ADR-001-monorepo-structure.md +171 -0
  67. package/docs/planning/ADR-002-package-extraction.md +393 -0
  68. package/docs/planning/ADR-003-performance-improvements.md +451 -0
  69. package/docs/planning/ADR-004-message-queue-features.md +187 -0
  70. package/docs/planning/ADR-005-devtools-observability.md +202 -0
  71. package/docs/planning/ROADMAP.md +368 -0
  72. package/docs/semantic-memory-cli-syntax.md +123 -0
  73. package/docs/swarm-mail-architecture.md +1147 -0
  74. package/package.json +13 -24
  75. package/scripts/cleanup-test-memories.ts +346 -0
  76. package/src/agent-mail.ts +1 -1
  77. package/src/beads.ts +1 -2
  78. package/src/index.ts +2 -2
  79. package/src/learning.integration.test.ts +80 -10
  80. package/src/mandate-storage.test.ts +3 -3
  81. package/src/storage.ts +189 -9
  82. package/src/swarm-mail.ts +3 -3
  83. package/src/swarm-orchestrate.ts +399 -246
  84. package/src/swarm.integration.test.ts +124 -0
  85. package/src/tool-availability.ts +1 -1
  86. package/tsconfig.json +1 -1
  87. package/.beads/.local_version +0 -1
  88. package/.beads/README.md +0 -81
  89. package/.beads/analysis/skill-architecture-meta-skills.md +0 -1562
  90. package/.beads/config.yaml +0 -62
  91. package/.beads/issues.jsonl +0 -2186
  92. package/.beads/metadata.json +0 -4
  93. package/.gitattributes +0 -3
  94. package/.github/workflows/ci.yml +0 -30
  95. package/.github/workflows/opencode.yml +0 -31
  96. package/.opencode/skills/tdd/SKILL.md +0 -182
  97. package/INTEGRATION_EXAMPLE.md +0 -66
  98. package/VERIFICATION_QUALITY_PATTERNS.md +0 -565
  99. package/bun.lock +0 -286
  100. package/dist/pglite.data +0 -0
  101. package/dist/pglite.wasm +0 -0
  102. package/src/streams/agent-mail.test.ts +0 -777
  103. package/src/streams/agent-mail.ts +0 -535
  104. package/src/streams/debug.test.ts +0 -500
  105. package/src/streams/debug.ts +0 -727
  106. package/src/streams/effect/ask.integration.test.ts +0 -314
  107. package/src/streams/effect/ask.ts +0 -202
  108. package/src/streams/effect/cursor.integration.test.ts +0 -418
  109. package/src/streams/effect/cursor.ts +0 -288
  110. package/src/streams/effect/deferred.test.ts +0 -357
  111. package/src/streams/effect/deferred.ts +0 -445
  112. package/src/streams/effect/index.ts +0 -17
  113. package/src/streams/effect/layers.ts +0 -73
  114. package/src/streams/effect/lock.test.ts +0 -385
  115. package/src/streams/effect/lock.ts +0 -399
  116. package/src/streams/effect/mailbox.test.ts +0 -260
  117. package/src/streams/effect/mailbox.ts +0 -318
  118. package/src/streams/events.test.ts +0 -924
  119. package/src/streams/events.ts +0 -329
  120. package/src/streams/index.test.ts +0 -229
  121. package/src/streams/index.ts +0 -578
  122. package/src/streams/migrations.test.ts +0 -359
  123. package/src/streams/migrations.ts +0 -362
  124. package/src/streams/projections.test.ts +0 -611
  125. package/src/streams/projections.ts +0 -504
  126. package/src/streams/store.integration.test.ts +0 -658
  127. package/src/streams/store.ts +0 -1075
  128. package/src/streams/swarm-mail.ts +0 -552
  129. package/test-bug-fixes.ts +0 -86
  130. package/vitest.integration.config.ts +0 -13
  131. package/workflow-integration-analysis.md +0 -876
@@ -0,0 +1,480 @@
1
+ import { z } from "zod";
2
+ import type { MailSessionState } from "swarm-mail";
3
+ declare const AGENT_MAIL_URL = "http://127.0.0.1:8765";
4
+ declare const MAX_INBOX_LIMIT = 5;
5
+ /**
6
+ * Set the default project directory for Agent Mail operations
7
+ *
8
+ * Called during plugin initialization with the actual project directory.
9
+ * This ensures agentmail_init uses the correct project path by default.
10
+ */
11
+ export declare function setAgentMailProjectDirectory(directory: string): void;
12
+ /**
13
+ * Get the default project directory
14
+ *
15
+ * Returns the configured directory, or falls back to cwd if not set.
16
+ */
17
+ export declare function getAgentMailProjectDirectory(): string;
18
+ declare const RETRY_CONFIG: {
19
+ maxRetries: number;
20
+ baseDelayMs: number;
21
+ maxDelayMs: number;
22
+ timeoutMs: number;
23
+ jitterPercent: number;
24
+ };
25
+ declare const RECOVERY_CONFIG: {
26
+ /** Max consecutive failures before attempting restart (1 = restart on first "unexpected error") */
27
+ failureThreshold: number;
28
+ /** Cooldown between restart attempts (ms) - 10 seconds */
29
+ restartCooldownMs: number;
30
+ /** Whether auto-restart is enabled */
31
+ enabled: boolean;
32
+ };
33
+ /**
34
+ * Agent Mail session state
35
+ * @deprecated Use MailSessionState from streams/events.ts instead
36
+ * This is kept for backward compatibility and re-exported as an alias
37
+ */
38
+ export type AgentMailState = MailSessionState;
39
+ /**
40
+ * State storage keyed by sessionID.
41
+ * In-memory cache that also persists to disk for CLI usage.
42
+ */
43
+ declare const sessionStates: Map<string, MailSessionState>;
44
+ /**
45
+ * AgentMailError - Custom error for Agent Mail operations
46
+ *
47
+ * Note: Using a factory pattern to avoid "Cannot call a class constructor without |new|"
48
+ * errors in some bundled environments (OpenCode's plugin runtime).
49
+ */
50
+ export declare class AgentMailError extends Error {
51
+ readonly tool: string;
52
+ readonly code?: number;
53
+ readonly data?: unknown;
54
+ constructor(message: string, tool: string, code?: number, data?: unknown);
55
+ }
56
+ /**
57
+ * Factory function to create AgentMailError
58
+ * Use this instead of `new AgentMailError()` for compatibility
59
+ */
60
+ export declare function createAgentMailError(message: string, tool: string, code?: number, data?: unknown): AgentMailError;
61
+ export declare class AgentMailNotInitializedError extends Error {
62
+ constructor();
63
+ }
64
+ export declare class FileReservationConflictError extends Error {
65
+ readonly conflicts: Array<{
66
+ path: string;
67
+ holders: string[];
68
+ }>;
69
+ constructor(message: string, conflicts: Array<{
70
+ path: string;
71
+ holders: string[];
72
+ }>);
73
+ }
74
+ export declare class RateLimitExceededError extends Error {
75
+ readonly endpoint: string;
76
+ readonly remaining: number;
77
+ readonly resetAt: number;
78
+ constructor(endpoint: string, remaining: number, resetAt: number);
79
+ }
80
+ /**
81
+ * Check if the server is responding to health checks
82
+ */
83
+ declare function isServerHealthy(): Promise<boolean>;
84
+ /**
85
+ * Test if the server can handle a basic MCP call
86
+ * This catches cases where health is OK but MCP is broken
87
+ */
88
+ declare function isServerFunctional(): Promise<boolean>;
89
+ /**
90
+ * Attempt to restart the Agent Mail server
91
+ *
92
+ * Finds the running process, kills it, and starts a new one.
93
+ * Returns true if restart was successful.
94
+ */
95
+ declare function restartServer(): Promise<boolean>;
96
+ /**
97
+ * Reset recovery state (for testing)
98
+ */
99
+ export declare function resetRecoveryState(): void;
100
+ /**
101
+ * Check if an error indicates the project was not found
102
+ *
103
+ * This happens when Agent Mail server restarts and loses project registrations.
104
+ * The fix is to re-register the project and retry the operation.
105
+ */
106
+ export declare function isProjectNotFoundError(error: unknown): boolean;
107
+ /**
108
+ * Check if an error indicates the agent was not found
109
+ *
110
+ * Similar to project not found - server restart loses agent registrations.
111
+ */
112
+ export declare function isAgentNotFoundError(error: unknown): boolean;
113
+ /**
114
+ * Reset availability cache (for testing)
115
+ */
116
+ export declare function resetAgentMailCache(): void;
117
+ /**
118
+ * Reset rate limiter (for testing)
119
+ */
120
+ export declare function resetRateLimiterCache(): Promise<void>;
121
+ /**
122
+ * Call an Agent Mail MCP tool with retry and auto-restart
123
+ *
124
+ * Features:
125
+ * - Exponential backoff with jitter on retryable errors
126
+ * - Auto-restart server after consecutive failures
127
+ * - Timeout handling per request
128
+ *
129
+ * Handles both direct results (mock server) and wrapped results (real server).
130
+ * Real Agent Mail returns: { content: [...], structuredContent: {...} }
131
+ */
132
+ export declare function mcpCall<T>(toolName: string, args: Record<string, unknown>): Promise<T>;
133
+ /**
134
+ * MCP call with automatic project/agent re-registration on "not found" errors
135
+ *
136
+ * This is the self-healing wrapper that handles Agent Mail server restarts.
137
+ * When the server restarts, it loses all project and agent registrations.
138
+ * This wrapper detects those errors and automatically re-registers before retrying.
139
+ *
140
+ * Use this instead of raw mcpCall when you have project_key and agent_name context.
141
+ *
142
+ * @param toolName - The MCP tool to call
143
+ * @param args - Arguments including project_key and optionally agent_name
144
+ * @param options - Optional configuration for re-registration
145
+ * @returns The result of the MCP call
146
+ */
147
+ export declare function mcpCallWithAutoInit<T>(toolName: string, args: Record<string, unknown> & {
148
+ project_key: string;
149
+ agent_name?: string;
150
+ }, options?: {
151
+ /** Task description for agent re-registration */
152
+ taskDescription?: string;
153
+ /** Max re-registration attempts (default: 1) */
154
+ maxReregistrationAttempts?: number;
155
+ }): Promise<T>;
156
+ /**
157
+ * Get Agent Mail state for a session, or throw if not initialized
158
+ *
159
+ * Checks in-memory cache first, then falls back to disk storage.
160
+ * This allows CLI invocations to share state across calls.
161
+ */
162
+ declare function requireState(sessionID: string): AgentMailState;
163
+ /**
164
+ * Store Agent Mail state for a session
165
+ *
166
+ * Saves to both in-memory cache and disk for CLI persistence.
167
+ */
168
+ declare function setState(sessionID: string, state: AgentMailState): void;
169
+ /**
170
+ * Get state if exists (for cleanup hooks)
171
+ *
172
+ * Checks in-memory cache first, then falls back to disk storage.
173
+ */
174
+ declare function getState(sessionID: string): AgentMailState | undefined;
175
+ /**
176
+ * Clear state for a session
177
+ *
178
+ * Removes from both in-memory cache and disk.
179
+ */
180
+ declare function clearState(sessionID: string): void;
181
+ /**
182
+ * Initialize Agent Mail session
183
+ */
184
+ export declare const agentmail_init: {
185
+ description: string;
186
+ args: {
187
+ project_path: z.ZodOptional<z.ZodString>;
188
+ agent_name: z.ZodOptional<z.ZodString>;
189
+ task_description: z.ZodOptional<z.ZodString>;
190
+ };
191
+ execute(args: {
192
+ project_path?: string | undefined;
193
+ agent_name?: string | undefined;
194
+ task_description?: string | undefined;
195
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
196
+ };
197
+ /**
198
+ * Send a message to other agents
199
+ */
200
+ export declare const agentmail_send: {
201
+ description: string;
202
+ args: {
203
+ to: z.ZodArray<z.ZodString>;
204
+ subject: z.ZodString;
205
+ body: z.ZodString;
206
+ thread_id: z.ZodOptional<z.ZodString>;
207
+ importance: z.ZodOptional<z.ZodEnum<{
208
+ low: "low";
209
+ normal: "normal";
210
+ high: "high";
211
+ urgent: "urgent";
212
+ }>>;
213
+ ack_required: z.ZodOptional<z.ZodBoolean>;
214
+ };
215
+ execute(args: {
216
+ to: string[];
217
+ subject: string;
218
+ body: string;
219
+ thread_id?: string | undefined;
220
+ importance?: "low" | "normal" | "high" | "urgent" | undefined;
221
+ ack_required?: boolean | undefined;
222
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
223
+ };
224
+ /**
225
+ * Fetch inbox (CONTEXT-SAFE: bodies excluded, limit 5)
226
+ */
227
+ export declare const agentmail_inbox: {
228
+ description: string;
229
+ args: {
230
+ limit: z.ZodOptional<z.ZodNumber>;
231
+ urgent_only: z.ZodOptional<z.ZodBoolean>;
232
+ since_ts: z.ZodOptional<z.ZodString>;
233
+ };
234
+ execute(args: {
235
+ limit?: number | undefined;
236
+ urgent_only?: boolean | undefined;
237
+ since_ts?: string | undefined;
238
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
239
+ };
240
+ /**
241
+ * Read a single message body by ID
242
+ */
243
+ export declare const agentmail_read_message: {
244
+ description: string;
245
+ args: {
246
+ message_id: z.ZodNumber;
247
+ };
248
+ execute(args: {
249
+ message_id: number;
250
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
251
+ };
252
+ /**
253
+ * Summarize a thread (PREFERRED over fetching all messages)
254
+ */
255
+ export declare const agentmail_summarize_thread: {
256
+ description: string;
257
+ args: {
258
+ thread_id: z.ZodString;
259
+ include_examples: z.ZodOptional<z.ZodBoolean>;
260
+ };
261
+ execute(args: {
262
+ thread_id: string;
263
+ include_examples?: boolean | undefined;
264
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
265
+ };
266
+ /**
267
+ * Reserve file paths for exclusive editing
268
+ */
269
+ export declare const agentmail_reserve: {
270
+ description: string;
271
+ args: {
272
+ paths: z.ZodArray<z.ZodString>;
273
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
274
+ exclusive: z.ZodOptional<z.ZodBoolean>;
275
+ reason: z.ZodOptional<z.ZodString>;
276
+ };
277
+ execute(args: {
278
+ paths: string[];
279
+ ttl_seconds?: number | undefined;
280
+ exclusive?: boolean | undefined;
281
+ reason?: string | undefined;
282
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
283
+ };
284
+ /**
285
+ * Release file reservations
286
+ */
287
+ export declare const agentmail_release: {
288
+ description: string;
289
+ args: {
290
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
291
+ reservation_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
292
+ };
293
+ execute(args: {
294
+ paths?: string[] | undefined;
295
+ reservation_ids?: number[] | undefined;
296
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
297
+ };
298
+ /**
299
+ * Acknowledge a message
300
+ */
301
+ export declare const agentmail_ack: {
302
+ description: string;
303
+ args: {
304
+ message_id: z.ZodNumber;
305
+ };
306
+ execute(args: {
307
+ message_id: number;
308
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
309
+ };
310
+ /**
311
+ * Search messages
312
+ */
313
+ export declare const agentmail_search: {
314
+ description: string;
315
+ args: {
316
+ query: z.ZodString;
317
+ limit: z.ZodOptional<z.ZodNumber>;
318
+ };
319
+ execute(args: {
320
+ query: string;
321
+ limit?: number | undefined;
322
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
323
+ };
324
+ /**
325
+ * Check Agent Mail health
326
+ */
327
+ export declare const agentmail_health: {
328
+ description: string;
329
+ args: {};
330
+ execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
331
+ };
332
+ /**
333
+ * Manually restart Agent Mail server
334
+ *
335
+ * Use when server is in bad state (health OK but MCP failing).
336
+ * This kills the existing process and starts a fresh one.
337
+ */
338
+ export declare const agentmail_restart: {
339
+ description: string;
340
+ args: {
341
+ force: z.ZodOptional<z.ZodBoolean>;
342
+ };
343
+ execute(args: {
344
+ force?: boolean | undefined;
345
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
346
+ };
347
+ export declare const agentMailTools: {
348
+ agentmail_init: {
349
+ description: string;
350
+ args: {
351
+ project_path: z.ZodOptional<z.ZodString>;
352
+ agent_name: z.ZodOptional<z.ZodString>;
353
+ task_description: z.ZodOptional<z.ZodString>;
354
+ };
355
+ execute(args: {
356
+ project_path?: string | undefined;
357
+ agent_name?: string | undefined;
358
+ task_description?: string | undefined;
359
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
360
+ };
361
+ agentmail_send: {
362
+ description: string;
363
+ args: {
364
+ to: z.ZodArray<z.ZodString>;
365
+ subject: z.ZodString;
366
+ body: z.ZodString;
367
+ thread_id: z.ZodOptional<z.ZodString>;
368
+ importance: z.ZodOptional<z.ZodEnum<{
369
+ low: "low";
370
+ normal: "normal";
371
+ high: "high";
372
+ urgent: "urgent";
373
+ }>>;
374
+ ack_required: z.ZodOptional<z.ZodBoolean>;
375
+ };
376
+ execute(args: {
377
+ to: string[];
378
+ subject: string;
379
+ body: string;
380
+ thread_id?: string | undefined;
381
+ importance?: "low" | "normal" | "high" | "urgent" | undefined;
382
+ ack_required?: boolean | undefined;
383
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
384
+ };
385
+ agentmail_inbox: {
386
+ description: string;
387
+ args: {
388
+ limit: z.ZodOptional<z.ZodNumber>;
389
+ urgent_only: z.ZodOptional<z.ZodBoolean>;
390
+ since_ts: z.ZodOptional<z.ZodString>;
391
+ };
392
+ execute(args: {
393
+ limit?: number | undefined;
394
+ urgent_only?: boolean | undefined;
395
+ since_ts?: string | undefined;
396
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
397
+ };
398
+ agentmail_read_message: {
399
+ description: string;
400
+ args: {
401
+ message_id: z.ZodNumber;
402
+ };
403
+ execute(args: {
404
+ message_id: number;
405
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
406
+ };
407
+ agentmail_summarize_thread: {
408
+ description: string;
409
+ args: {
410
+ thread_id: z.ZodString;
411
+ include_examples: z.ZodOptional<z.ZodBoolean>;
412
+ };
413
+ execute(args: {
414
+ thread_id: string;
415
+ include_examples?: boolean | undefined;
416
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
417
+ };
418
+ agentmail_reserve: {
419
+ description: string;
420
+ args: {
421
+ paths: z.ZodArray<z.ZodString>;
422
+ ttl_seconds: z.ZodOptional<z.ZodNumber>;
423
+ exclusive: z.ZodOptional<z.ZodBoolean>;
424
+ reason: z.ZodOptional<z.ZodString>;
425
+ };
426
+ execute(args: {
427
+ paths: string[];
428
+ ttl_seconds?: number | undefined;
429
+ exclusive?: boolean | undefined;
430
+ reason?: string | undefined;
431
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
432
+ };
433
+ agentmail_release: {
434
+ description: string;
435
+ args: {
436
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
437
+ reservation_ids: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
438
+ };
439
+ execute(args: {
440
+ paths?: string[] | undefined;
441
+ reservation_ids?: number[] | undefined;
442
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
443
+ };
444
+ agentmail_ack: {
445
+ description: string;
446
+ args: {
447
+ message_id: z.ZodNumber;
448
+ };
449
+ execute(args: {
450
+ message_id: number;
451
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
452
+ };
453
+ agentmail_search: {
454
+ description: string;
455
+ args: {
456
+ query: z.ZodString;
457
+ limit: z.ZodOptional<z.ZodNumber>;
458
+ };
459
+ execute(args: {
460
+ query: string;
461
+ limit?: number | undefined;
462
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
463
+ };
464
+ agentmail_health: {
465
+ description: string;
466
+ args: {};
467
+ execute(args: Record<string, never>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
468
+ };
469
+ agentmail_restart: {
470
+ description: string;
471
+ args: {
472
+ force: z.ZodOptional<z.ZodBoolean>;
473
+ };
474
+ execute(args: {
475
+ force?: boolean | undefined;
476
+ }, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
477
+ };
478
+ };
479
+ export { requireState, setState, getState, clearState, sessionStates, AGENT_MAIL_URL, MAX_INBOX_LIMIT, isServerHealthy, isServerFunctional, restartServer, RETRY_CONFIG, RECOVERY_CONFIG, };
480
+ //# sourceMappingURL=agent-mail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-mail.d.ts","sourceRoot":"","sources":["../src/agent-mail.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMnD,QAAA,MAAM,cAAc,0BAA0B,CAAC;AAE/C,QAAA,MAAM,eAAe,IAAI,CAAC;AAY1B;;;;;GA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