@moxxy/cli 0.0.2 → 0.0.4

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.
@@ -0,0 +1,530 @@
1
+ // ../types/dist/index.mjs
2
+ import { z as z2 } from "zod";
3
+ import { z } from "zod";
4
+ import { z as z3 } from "zod";
5
+ import { z as z4 } from "zod";
6
+ import { z as z5 } from "zod";
7
+ import { z as z6 } from "zod";
8
+ import { z as z7 } from "zod";
9
+ import { z as z8 } from "zod";
10
+ import { z as z10 } from "zod";
11
+ import { z as z9 } from "zod";
12
+ import { z as z11 } from "zod";
13
+ var uuidSchema = z.string().uuid();
14
+ var timestampSchema = z.number().int().positive();
15
+ var paginationSchema = z.object({
16
+ page: z.number().int().positive().optional().default(1),
17
+ limit: z.number().int().positive().max(100).optional().default(20),
18
+ orderBy: z.string().optional(),
19
+ order: z.enum(["asc", "desc"]).optional().default("desc")
20
+ });
21
+ var activityTypeSchema = z2.enum([
22
+ "created",
23
+ "assigned",
24
+ "status_change",
25
+ "comment",
26
+ "commit",
27
+ "pr_created",
28
+ "pr_merged",
29
+ "pr_closed"
30
+ ]);
31
+ var taskActivitySchema = z2.object({
32
+ id: uuidSchema,
33
+ taskId: uuidSchema,
34
+ agentId: uuidSchema.nullable(),
35
+ activityType: activityTypeSchema,
36
+ description: z2.string().max(500),
37
+ metadata: z2.record(z2.any()),
38
+ createdAt: timestampSchema
39
+ });
40
+ var createActivitySchema = z2.object({
41
+ taskId: uuidSchema,
42
+ agentId: uuidSchema.nullable().optional(),
43
+ activityType: activityTypeSchema,
44
+ description: z2.string().max(500),
45
+ metadata: z2.record(z2.any()).optional().default({})
46
+ });
47
+ var agentStatusSchema = z3.enum(["available", "busy", "offline"]);
48
+ var agentTypeSchema = z3.enum([
49
+ "developer",
50
+ "prd",
51
+ "code-review",
52
+ "orchestrator",
53
+ "custom"
54
+ ]);
55
+ var agentCapabilitySchema = z3.enum([
56
+ "frontend",
57
+ "backend",
58
+ "fullstack",
59
+ "devops",
60
+ "testing",
61
+ "documentation"
62
+ ]);
63
+ var agentIdentitySchema = z3.object({
64
+ /** Display name for the agent (persona name) */
65
+ displayName: z3.string().max(100).optional(),
66
+ /** Theme/persona description */
67
+ theme: z3.string().max(500).optional(),
68
+ /** Emoji representation */
69
+ emoji: z3.string().max(10).optional(),
70
+ /** Avatar path or URL */
71
+ avatar: z3.string().url().optional().or(z3.string().max(0)),
72
+ /** Custom system prompt */
73
+ systemPrompt: z3.string().max(1e4).optional()
74
+ });
75
+ var agentModelConfigSchema = z3.object({
76
+ /** Primary model (provider/model format) */
77
+ primary: z3.string().optional(),
78
+ /** Fallback models in order of preference */
79
+ fallbacks: z3.array(z3.string()).optional()
80
+ });
81
+ var agentSchema = z3.object({
82
+ id: uuidSchema,
83
+ name: z3.string().min(1).max(100),
84
+ moltAgentId: z3.string().min(1),
85
+ githubToken: z3.string().min(1),
86
+ githubUsername: z3.string().min(1),
87
+ workspace: z3.string().min(1),
88
+ capabilities: z3.array(agentCapabilitySchema),
89
+ status: agentStatusSchema,
90
+ currentTaskId: uuidSchema.nullable(),
91
+ agentType: agentTypeSchema.optional(),
92
+ identity: agentIdentitySchema.optional(),
93
+ modelConfig: agentModelConfigSchema.optional(),
94
+ projectId: uuidSchema.optional(),
95
+ lastSyncAt: timestampSchema,
96
+ createdAt: timestampSchema,
97
+ updatedAt: timestampSchema
98
+ });
99
+ var createAgentSchema = z3.object({
100
+ name: z3.string().min(1).max(100),
101
+ githubToken: z3.string().min(1),
102
+ githubUsername: z3.string().min(1),
103
+ capabilities: z3.array(agentCapabilitySchema).min(1),
104
+ workspace: z3.string().min(1),
105
+ /** Agent type for specialized behaviors */
106
+ agentType: agentTypeSchema.optional(),
107
+ /** Agent identity/persona configuration */
108
+ identity: agentIdentitySchema.optional()
109
+ });
110
+ var updateAgentSchema = z3.object({
111
+ name: z3.string().min(1).max(100).optional(),
112
+ status: agentStatusSchema.optional(),
113
+ workspace: z3.string().min(1).optional(),
114
+ capabilities: z3.array(agentCapabilitySchema).optional(),
115
+ /** Agent type for specialized behaviors */
116
+ agentType: agentTypeSchema.optional(),
117
+ /** Agent identity/persona configuration */
118
+ identity: agentIdentitySchema.optional(),
119
+ /** Model configuration update */
120
+ modelConfig: agentModelConfigSchema.optional(),
121
+ /** Update GitHub PAT token */
122
+ githubToken: z3.string().min(1).optional(),
123
+ /** Update GitHub username */
124
+ githubUsername: z3.string().min(1).optional()
125
+ });
126
+ var taskFiltersSchema = z4.object({
127
+ projectId: z4.string().uuid().optional(),
128
+ status: z4.string().optional(),
129
+ type: z4.string().optional(),
130
+ priority: z4.string().optional(),
131
+ assignedAgentId: z4.string().uuid().optional()
132
+ });
133
+ var INTEGRATION_TYPES = ["slack", "discord", "email", "github"];
134
+ var NOTIFICATION_EVENTS = [
135
+ "task:created",
136
+ "task:completed",
137
+ "task:failed",
138
+ "task:assigned",
139
+ "task:status_changed",
140
+ "agent:status_changed",
141
+ "pr:created",
142
+ "pr:merged"
143
+ ];
144
+ var createIntegrationSchema = z5.object({
145
+ type: z5.enum(INTEGRATION_TYPES),
146
+ name: z5.string().min(1).max(100),
147
+ enabled: z5.boolean().optional().default(false),
148
+ config: z5.record(z5.unknown()),
149
+ enabledEvents: z5.array(z5.enum(NOTIFICATION_EVENTS)).optional().default([])
150
+ });
151
+ var updateIntegrationSchema = z5.object({
152
+ name: z5.string().min(1).max(100).optional(),
153
+ enabled: z5.boolean().optional(),
154
+ config: z5.record(z5.unknown()).optional(),
155
+ enabledEvents: z5.array(z5.enum(NOTIFICATION_EVENTS)).optional()
156
+ });
157
+ var projectStatusSchema = z6.enum(["active", "archived", "paused"]);
158
+ var workflowModeSchema = z6.enum(["manual", "automatic"]);
159
+ var validationSettingsSchema = z6.object({
160
+ runInstall: z6.boolean().optional(),
161
+ runTests: z6.boolean().optional(),
162
+ runBuild: z6.boolean().optional(),
163
+ runLint: z6.boolean().optional(),
164
+ blockOnFailure: z6.boolean().optional(),
165
+ installCommand: z6.string().max(500).optional(),
166
+ testCommand: z6.string().max(500).optional(),
167
+ buildCommand: z6.string().max(500).optional(),
168
+ lintCommand: z6.string().max(500).optional(),
169
+ maxRetries: z6.number().int().min(0).max(100).optional(),
170
+ preferSameAgent: z6.boolean().optional(),
171
+ timeout: z6.number().int().min(1e3).max(36e5).optional()
172
+ // 1s to 1h
173
+ });
174
+ var workflowSettingsSchema = z6.object({
175
+ mode: workflowModeSchema,
176
+ previewBranch: z6.string().min(1).max(100),
177
+ autoMerge: z6.boolean().optional(),
178
+ validation: validationSettingsSchema.optional()
179
+ });
180
+ var prdStatusSchema = z6.enum([
181
+ "idle",
182
+ "generating",
183
+ "completed",
184
+ "failed",
185
+ "tasks_generating",
186
+ "tasks_completed",
187
+ "tasks_failed"
188
+ ]);
189
+ var prdTemplateSchema = z6.enum(["mobile", "web", "api", "feature", "data-pipeline"]);
190
+ var prdTaskSchema = z6.object({
191
+ id: z6.string(),
192
+ prdId: z6.string(),
193
+ step: z6.number(),
194
+ title: z6.string(),
195
+ description: z6.string(),
196
+ status: z6.enum(["todo", "in_progress", "done", "blocked"]),
197
+ priority: z6.enum(["P0", "P1", "P2"]),
198
+ estimatedHours: z6.number().optional(),
199
+ phase: z6.enum(["discovery", "design", "development", "testing", "deployment"]).optional(),
200
+ createdAt: z6.string(),
201
+ updatedAt: z6.string(),
202
+ completedAt: z6.string().optional()
203
+ });
204
+ var projectSchema = z6.object({
205
+ id: uuidSchema,
206
+ name: z6.string().min(1).max(100),
207
+ description: z6.string().max(500),
208
+ githubRepoUrl: z6.string().url(),
209
+ githubOwner: z6.string().min(1),
210
+ githubRepo: z6.string().min(1),
211
+ status: projectStatusSchema,
212
+ defaultBranch: z6.string().min(1).max(100).optional(),
213
+ workflowSettings: workflowSettingsSchema.optional(),
214
+ assignedAgentIds: z6.array(uuidSchema).optional(),
215
+ prd: z6.string().optional(),
216
+ prdGeneratedAt: timestampSchema.optional(),
217
+ prdStatus: prdStatusSchema.optional(),
218
+ prdError: z6.string().optional(),
219
+ prdTemplate: prdTemplateSchema.optional(),
220
+ prdTasks: z6.array(prdTaskSchema).optional(),
221
+ createdAt: timestampSchema,
222
+ updatedAt: timestampSchema
223
+ });
224
+ var generatePRDInputSchema = z6.object({
225
+ template: prdTemplateSchema.optional().default("feature")
226
+ });
227
+ var importPRDTasksInputSchema = z6.object({
228
+ tasks: z6.array(
229
+ z6.object({
230
+ title: z6.string(),
231
+ description: z6.string(),
232
+ priority: z6.enum(["P0", "P1", "P2"]).optional(),
233
+ estimatedHours: z6.number().optional(),
234
+ phase: z6.string().optional()
235
+ })
236
+ ),
237
+ taskType: z6.enum(["feature", "bug", "research", "refactor", "documentation"])
238
+ });
239
+ var updatePRDInputSchema = z6.object({
240
+ prd: z6.string()
241
+ });
242
+ var createProjectSchema = z6.object({
243
+ name: z6.string().min(1).max(100),
244
+ description: z6.string().max(500),
245
+ githubRepoUrl: z6.string().url()
246
+ });
247
+ var updateProjectSchema = z6.object({
248
+ name: z6.string().min(1).max(100).optional(),
249
+ description: z6.string().max(500).optional(),
250
+ status: projectStatusSchema.optional(),
251
+ defaultBranch: z6.string().min(1).max(100).optional(),
252
+ workflowSettings: workflowSettingsSchema.optional()
253
+ });
254
+ var taskStatusSchema = z7.enum(["todo", "in_progress", "review", "done", "blocked"]);
255
+ var taskTypeSchema = z7.enum(["feature", "bug", "research", "refactor", "documentation"]);
256
+ var taskPrioritySchema = z7.enum(["low", "medium", "high", "urgent"]);
257
+ var agentNoteTypeSchema = z7.enum([
258
+ "progress",
259
+ "summary",
260
+ "error",
261
+ "completion",
262
+ "feedback"
263
+ ]);
264
+ var agentNoteSchema = z7.object({
265
+ id: uuidSchema,
266
+ agentId: uuidSchema,
267
+ agentName: z7.string(),
268
+ content: z7.string(),
269
+ type: agentNoteTypeSchema,
270
+ createdAt: timestampSchema,
271
+ isUserFeedback: z7.boolean().optional()
272
+ });
273
+ var taskSchema = z7.object({
274
+ id: uuidSchema,
275
+ projectId: uuidSchema,
276
+ title: z7.string().min(1).max(200),
277
+ description: z7.string().max(2e3),
278
+ type: taskTypeSchema,
279
+ status: taskStatusSchema,
280
+ priority: taskPrioritySchema,
281
+ position: z7.number().int().default(0),
282
+ // Manual ordering within status
283
+ assignedAgentId: uuidSchema.nullable(),
284
+ autoAssign: z7.boolean().default(true),
285
+ // Whether agents should auto-pick this task
286
+ agentNotes: z7.array(agentNoteSchema).default([]),
287
+ githubIssueNumber: z7.number().int().positive().nullable(),
288
+ githubPrNumber: z7.number().int().positive().nullable(),
289
+ metadata: z7.record(z7.any()),
290
+ blockedBy: z7.array(uuidSchema).default([]),
291
+ // Task IDs that must be completed before this task
292
+ blocking: z7.array(uuidSchema).default([]),
293
+ // Task IDs that depend on this task
294
+ createdAt: timestampSchema,
295
+ updatedAt: timestampSchema,
296
+ completedAt: timestampSchema.nullable()
297
+ });
298
+ var createTaskSchema = z7.object({
299
+ projectId: uuidSchema,
300
+ title: z7.string().min(1).max(200),
301
+ description: z7.string().max(2e3),
302
+ type: taskTypeSchema,
303
+ priority: taskPrioritySchema.optional().default("medium"),
304
+ assignedAgentId: uuidSchema.optional(),
305
+ // Optional agent to assign on creation
306
+ autoAssign: z7.boolean().optional().default(true),
307
+ // Auto-assign to agents (default: true)
308
+ blockedBy: z7.array(uuidSchema).optional()
309
+ // Task IDs that must be completed before this task
310
+ });
311
+ var updateTaskSchema = z7.object({
312
+ title: z7.string().min(1).max(200).optional(),
313
+ description: z7.string().max(2e3).optional(),
314
+ type: taskTypeSchema.optional(),
315
+ status: taskStatusSchema.optional(),
316
+ priority: taskPrioritySchema.optional(),
317
+ position: z7.number().int().optional(),
318
+ // Manual ordering within status
319
+ assignedAgentId: uuidSchema.nullable().optional(),
320
+ autoAssign: z7.boolean().optional(),
321
+ // Whether agents should auto-pick this task
322
+ githubIssueNumber: z7.number().int().positive().nullable().optional(),
323
+ githubPrNumber: z7.number().int().positive().nullable().optional(),
324
+ metadata: z7.record(z7.any()).optional(),
325
+ blockedBy: z7.array(uuidSchema).optional()
326
+ // Task IDs that must be completed before this task
327
+ });
328
+ var clientEventTypeSchema = z8.enum([
329
+ "subscribe:project",
330
+ "unsubscribe:project",
331
+ "subscribe:task",
332
+ "unsubscribe:task"
333
+ ]);
334
+ var serverEventTypeSchema = z8.enum([
335
+ "task:created",
336
+ "task:updated",
337
+ "task:status_changed",
338
+ "task:assigned",
339
+ "task:progress",
340
+ "task:stream",
341
+ "task:note_added",
342
+ "task:execution_cancelled",
343
+ "task:dependencies_updated",
344
+ "tasks:reordered",
345
+ "agent:created",
346
+ "agent:updated",
347
+ "agent:status_changed",
348
+ "agent:log",
349
+ "activity:created",
350
+ "project:updated",
351
+ "project:prd_status_changed",
352
+ "error"
353
+ ]);
354
+ var githubIssuePayloadSchema = z9.object({
355
+ action: z9.string(),
356
+ issueNumber: z9.number().int().positive(),
357
+ title: z9.string(),
358
+ body: z9.string().nullable(),
359
+ labels: z9.array(z9.string()),
360
+ author: z9.string(),
361
+ repo: z9.object({
362
+ owner: z9.string(),
363
+ name: z9.string(),
364
+ fullName: z9.string(),
365
+ defaultBranch: z9.string(),
366
+ cloneUrl: z9.string()
367
+ }),
368
+ url: z9.string().url(),
369
+ createdAt: z9.string()
370
+ });
371
+ var ISSUE_TYPES = ["feature", "bug", "refactor", "docs", "test", "chore"];
372
+ var ISSUE_PRIORITIES = ["low", "medium", "high", "urgent"];
373
+ var ISSUE_COMPLEXITIES = ["trivial", "small", "medium", "large", "epic"];
374
+ var issueClassificationSchema = z9.object({
375
+ type: z9.enum(ISSUE_TYPES),
376
+ priority: z9.enum(ISSUE_PRIORITIES),
377
+ complexity: z9.enum(ISSUE_COMPLEXITIES),
378
+ confidence: z9.number().min(0).max(1),
379
+ reasoning: z9.string()
380
+ });
381
+ var PIPELINE_STAGES = [
382
+ "triage",
383
+ "research",
384
+ "inspect",
385
+ "plan",
386
+ "implement"
387
+ ];
388
+ var PIPELINE_STATUSES = [
389
+ "pending",
390
+ "running",
391
+ "completed",
392
+ "failed",
393
+ "cancelled"
394
+ ];
395
+ var pipelineStageResultSchema = z9.object({
396
+ stage: z9.enum(PIPELINE_STAGES),
397
+ status: z9.enum(PIPELINE_STATUSES),
398
+ output: z9.unknown().optional(),
399
+ error: z9.string().optional(),
400
+ duration_ms: z9.number().optional()
401
+ });
402
+ var pipelineRunSchema = z9.object({
403
+ id: z9.string(),
404
+ issueNumber: z9.number().int().positive(),
405
+ repo: z9.object({
406
+ owner: z9.string(),
407
+ name: z9.string()
408
+ }),
409
+ stages: z9.array(pipelineStageResultSchema),
410
+ status: z9.enum(PIPELINE_STATUSES),
411
+ branchName: z9.string().optional(),
412
+ prNumber: z9.number().int().positive().optional(),
413
+ classification: issueClassificationSchema.optional(),
414
+ createdAt: z9.number(),
415
+ updatedAt: z9.number()
416
+ });
417
+ var gatewayConfigSchema = z10.object({
418
+ url: z10.string().url(),
419
+ authToken: z10.string().optional(),
420
+ deviceId: z10.string().optional(),
421
+ devicePrivateKey: z10.string().optional()
422
+ });
423
+ var githubAuthConfigSchema = z10.object({
424
+ token: z10.string(),
425
+ webhookSecret: z10.string().optional(),
426
+ appId: z10.string().optional(),
427
+ privateKey: z10.string().optional()
428
+ });
429
+ var webhookServerConfigSchema = z10.object({
430
+ port: z10.number().int().positive().default(3456),
431
+ host: z10.string().default("0.0.0.0"),
432
+ path: z10.string().default("/webhook/github")
433
+ });
434
+ var watchedRepoSchema = z10.object({
435
+ owner: z10.string(),
436
+ repo: z10.string(),
437
+ defaultBranch: z10.string().default("main"),
438
+ enabledEvents: z10.array(z10.string()).default(["issues.opened", "issues.labeled"]),
439
+ labels: z10.array(z10.string()).optional()
440
+ });
441
+ var agentRunConfigSchema = z10.object({
442
+ moltAgentId: z10.string().optional(),
443
+ maxConcurrentTasks: z10.number().int().positive().default(1)
444
+ });
445
+ var sdkProviderSchema = z10.enum(["molt", "claude"]).default("molt");
446
+ var claudeConfigSchema = z10.object({
447
+ apiKey: z10.string().optional(),
448
+ cliPath: z10.string().default("claude"),
449
+ model: z10.string().default("claude-sonnet-4-5"),
450
+ timeout: z10.number().int().positive().default(3e5),
451
+ permissionMode: z10.string().default("default")
452
+ });
453
+ var pipelineConfigSchema = z10.object({
454
+ enabledStages: z10.array(z10.enum(PIPELINE_STAGES)).default(["triage", "research", "inspect", "plan", "implement"])
455
+ });
456
+ var moxxyConfigSchema = z10.object({
457
+ version: z10.number().int().positive().default(1),
458
+ sdk: sdkProviderSchema,
459
+ gateway: gatewayConfigSchema.optional(),
460
+ github: githubAuthConfigSchema,
461
+ webhook: webhookServerConfigSchema.optional(),
462
+ repos: z10.array(watchedRepoSchema).default([]),
463
+ agent: agentRunConfigSchema.optional(),
464
+ pipeline: pipelineConfigSchema.optional(),
465
+ claude: claudeConfigSchema.optional()
466
+ });
467
+ var agentCommandResultSchema = z11.object({
468
+ success: z11.boolean(),
469
+ command: z11.string(),
470
+ data: z11.unknown().optional(),
471
+ error: z11.object({
472
+ code: z11.string(),
473
+ message: z11.string(),
474
+ details: z11.string().optional()
475
+ }).optional(),
476
+ duration_ms: z11.number()
477
+ });
478
+ var argDefSchema = z11.object({
479
+ name: z11.string(),
480
+ description: z11.string(),
481
+ required: z11.boolean().default(false),
482
+ type: z11.enum(["string", "number", "boolean"]).default("string")
483
+ });
484
+ var optionDefSchema = z11.object({
485
+ name: z11.string(),
486
+ short: z11.string().optional(),
487
+ description: z11.string(),
488
+ required: z11.boolean().default(false),
489
+ type: z11.enum(["string", "number", "boolean"]).default("string"),
490
+ defaultValue: z11.unknown().optional()
491
+ });
492
+ var agentCLICommandDefSchema = z11.object({
493
+ name: z11.string(),
494
+ description: z11.string(),
495
+ args: z11.array(argDefSchema),
496
+ options: z11.array(optionDefSchema),
497
+ examples: z11.array(z11.string())
498
+ });
499
+ var workflowStepSchema = z11.object({
500
+ id: z11.string(),
501
+ plugin: z11.string(),
502
+ command: z11.string(),
503
+ args: z11.record(z11.unknown()),
504
+ description: z11.string(),
505
+ dependsOn: z11.array(z11.string()).optional(),
506
+ optional: z11.boolean().optional()
507
+ });
508
+ var workflowSchema = z11.object({
509
+ id: z11.string(),
510
+ name: z11.string(),
511
+ description: z11.string(),
512
+ steps: z11.array(workflowStepSchema),
513
+ context: z11.record(z11.unknown())
514
+ });
515
+ var workflowStepResultSchema = z11.object({
516
+ stepId: z11.string(),
517
+ result: agentCommandResultSchema,
518
+ skipped: z11.boolean().default(false)
519
+ });
520
+ var workflowResultSchema = z11.object({
521
+ workflowId: z11.string(),
522
+ success: z11.boolean(),
523
+ stepResults: z11.array(workflowStepResultSchema),
524
+ duration_ms: z11.number()
525
+ });
526
+
527
+ export {
528
+ PIPELINE_STAGES,
529
+ moxxyConfigSchema
530
+ };