@clickraft/cli 0.8.8 → 0.9.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.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [0.8.8](https://github.com/clickraft/cli/compare/v0.8.7...v0.8.8) (2026-05-31)
1
+ ## [0.9.0](https://github.com/clickraft/cli/compare/v0.8.9...v0.9.0) (2026-06-01)
2
+
3
+ ### Features
4
+
5
+ * **mcp:** per-request bearer forwarding, 401 guard, and PRM endpoint ([15ab952](https://github.com/clickraft/cli/commit/15ab95204869273cb178516db6957b6b9d51f204))
2
6
 
3
7
  # Changelog
4
8
 
package/dist/cli.js CHANGED
@@ -10,10 +10,15 @@ import { z } from "zod";
10
10
  import { z as z2 } from "zod";
11
11
  import { z as z3 } from "zod";
12
12
  import { z as z4 } from "zod";
13
- import { request as undiciRequest } from "undici";
13
+ import { z as z5 } from "zod";
14
14
  import { z as z6 } from "zod";
15
+ import { z as z7 } from "zod";
16
+ import { z as z8 } from "zod";
17
+ import { z as z9 } from "zod";
18
+ import { request as undiciRequest } from "undici";
19
+ import { z as z11 } from "zod";
15
20
  import { createHash, randomUUID } from "crypto";
16
- import { z as z5 } from "zod";
21
+ import { z as z10 } from "zod";
17
22
  import { createHash as createHash2 } from "crypto";
18
23
  import { request as undiciRequest2 } from "undici";
19
24
  var TOKEN_FIELD_PATTERN = /"(access_token|refresh_token|device_code|user_code|code_verifier|client_secret)"\s*:\s*"[^"]*"/gi;
@@ -87,6 +92,165 @@ var TokenRowSchema = z4.object({
87
92
  createdAt: z4.string()
88
93
  }).strict();
89
94
  var TokensListResponseSchema = z4.array(TokenRowSchema);
95
+ var DeclaredParamSchema = z5.object({
96
+ name: z5.string(),
97
+ type: z5.string(),
98
+ required: z5.boolean(),
99
+ defaultValue: z5.string().nullable().optional(),
100
+ enumValues: z5.array(z5.string()).nullable().optional(),
101
+ description: z5.string().nullable().optional()
102
+ }).strict();
103
+ var TemplateSummarySchema = z5.object({
104
+ id: z5.string().uuid(),
105
+ source: z5.enum(["own", "system"]),
106
+ name: z5.string(),
107
+ description: z5.string().nullable(),
108
+ category: z5.string().nullable(),
109
+ thumbnailUrl: z5.string().nullable(),
110
+ tags: z5.array(z5.string()),
111
+ createdAt: z5.string()
112
+ }).strict();
113
+ var TemplateDetailSchema = TemplateSummarySchema.extend({
114
+ declaredParams: z5.array(DeclaredParamSchema),
115
+ timesUsed: z5.number()
116
+ }).strict();
117
+ var TemplatesListResponseSchema = z5.object({
118
+ templates: z5.array(TemplateSummarySchema),
119
+ cursor: z5.string().nullable(),
120
+ hasMore: z5.boolean()
121
+ }).strict();
122
+ var ProductReferenceSchema = z6.object({
123
+ id: z6.string().uuid(),
124
+ imageId: z6.string().uuid().optional()
125
+ }).strict();
126
+ var GenerateCreateRequestSchema = z6.object({
127
+ modelSlug: z6.string().min(1).max(100),
128
+ input: z6.object({
129
+ prompt: z6.string().max(1e4).optional(),
130
+ referenceImageUrl: z6.string().url().optional(),
131
+ referenceImages: z6.array(z6.string().url()).max(8).optional(),
132
+ aspectRatio: z6.string().regex(/^\d+:\d+$/).optional(),
133
+ resolution: z6.string().regex(/^\d+x\d+$/).optional(),
134
+ durationSeconds: z6.number().int().min(1).max(60).optional(),
135
+ providerParams: z6.record(z6.string(), z6.unknown()).optional()
136
+ }).strict(),
137
+ options: z6.object({
138
+ workflowId: z6.string().uuid().optional(),
139
+ nodeId: z6.string().optional()
140
+ }).strict().optional(),
141
+ products: z6.array(ProductReferenceSchema).min(1).max(10).optional()
142
+ }).strict();
143
+ var GenerateCreateResponseSchema = z6.object({
144
+ jobId: z6.string().uuid(),
145
+ status: z6.enum(["queued", "processing", "completed", "failed"]),
146
+ estimatedSeconds: z6.number().int().nonnegative().nullable(),
147
+ creditsCharged: z6.number().int().nonnegative()
148
+ }).strict();
149
+ var GenerationStatusSchema = z6.enum([
150
+ "queued",
151
+ "processing",
152
+ "uploading",
153
+ "completed",
154
+ "failed",
155
+ "cancelled"
156
+ ]);
157
+ var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
158
+ "completed",
159
+ "failed",
160
+ "cancelled"
161
+ ]);
162
+ function isTerminalStatus(status) {
163
+ return TERMINAL_STATUSES.has(status);
164
+ }
165
+ var GenerationResultSchema = z6.object({
166
+ jobId: z6.string().uuid(),
167
+ status: GenerationStatusSchema,
168
+ modelSlug: z6.string(),
169
+ resultUrl: z6.string().url().nullable(),
170
+ thumbnailUrl: z6.string().url().nullable(),
171
+ errorCode: z6.string().nullable(),
172
+ errorMessage: z6.string().nullable(),
173
+ creditsCharged: z6.number().int().nonnegative(),
174
+ creditsRefunded: z6.boolean(),
175
+ startedAt: z6.string().nullable(),
176
+ completedAt: z6.string().nullable()
177
+ }).strict();
178
+ var MAX_UPLOAD_SIZE_BYTES = 15 * 1024 * 1024;
179
+ var UploadRequestSchema = z7.object({
180
+ filename: z7.string().min(1).max(255),
181
+ contentType: z7.string().regex(/^[\w-]+\/[\w+.-]+$/),
182
+ sizeBytes: z7.number().int().positive().max(MAX_UPLOAD_SIZE_BYTES),
183
+ contentHash: z7.string().regex(/^sha256:[0-9a-f]{64}$/)
184
+ }).strict();
185
+ var UploadResponseSchema = z7.object({
186
+ assetId: z7.string().uuid(),
187
+ uploadUrl: z7.string().url(),
188
+ publicUrl: z7.string().url(),
189
+ deduplicated: z7.boolean()
190
+ }).strict();
191
+ var NodeTypeSummarySchema = z8.object({
192
+ type: z8.string(),
193
+ portCount: z8.number()
194
+ }).strict();
195
+ var NodeTypePortSchema = z8.object({
196
+ handleId: z8.string(),
197
+ direction: z8.enum(["input", "output"]),
198
+ dataType: z8.string()
199
+ }).strict();
200
+ var NodeTypeDetailSchema = z8.object({
201
+ type: z8.string(),
202
+ ports: z8.array(NodeTypePortSchema),
203
+ agentWritableFields: z8.array(z8.string())
204
+ }).strict();
205
+ var NodeTypesListResponseSchema = z8.object({
206
+ nodeTypes: z8.array(NodeTypeSummarySchema)
207
+ }).strict();
208
+ var WorkflowDeclaredParamSchema = z9.object({
209
+ name: z9.string(),
210
+ type: z9.string(),
211
+ required: z9.boolean().optional(),
212
+ defaultValue: z9.unknown().optional(),
213
+ description: z9.unknown().optional()
214
+ }).passthrough();
215
+ var WorkflowSummarySchema = z9.object({
216
+ id: z9.string().uuid(),
217
+ name: z9.string(),
218
+ tags: z9.array(z9.string()),
219
+ declared_params: z9.array(WorkflowDeclaredParamSchema).nullable().default([]),
220
+ canvas_rev: z9.number().int().nonnegative(),
221
+ updated_at: z9.string()
222
+ }).strict();
223
+ var WorkflowsListResponseSchema = z9.object({
224
+ items: z9.array(WorkflowSummarySchema),
225
+ nextCursor: z9.string().nullable()
226
+ }).strict();
227
+ var WorkflowDetailSchema = z9.object({
228
+ id: z9.string().uuid(),
229
+ name: z9.string(),
230
+ description: z9.string().nullable(),
231
+ tags: z9.array(z9.string()),
232
+ declared_params: z9.array(WorkflowDeclaredParamSchema).nullable().default([]),
233
+ canvas_rev: z9.number().int().nonnegative(),
234
+ nodes: z9.array(z9.unknown()),
235
+ edges: z9.array(z9.unknown()),
236
+ created_at: z9.string(),
237
+ updated_at: z9.string()
238
+ }).strict();
239
+ var WorkflowCreateResponseSchema = z9.object({
240
+ id: z9.string().uuid(),
241
+ name: z9.string(),
242
+ description: z9.string().nullable(),
243
+ tags: z9.array(z9.string()),
244
+ declared_params: z9.array(WorkflowDeclaredParamSchema).nullable().default([]),
245
+ canvas_rev: z9.number().int().nonnegative(),
246
+ created_at: z9.string(),
247
+ updated_at: z9.string()
248
+ }).strict();
249
+ var WorkflowMutateResponseSchema = z9.object({
250
+ canvas_rev: z9.number().int().nonnegative(),
251
+ applied: z9.number().int().nonnegative(),
252
+ workflow: WorkflowDetailSchema
253
+ }).strict();
90
254
  var SERVER_ERROR_CODES = [
91
255
  "AUTH_TOKEN_MISSING",
92
256
  "AUTH_TOKEN_INVALID",
@@ -304,14 +468,14 @@ function signalToAbortError(signal) {
304
468
  err.name = "AbortError";
305
469
  return err;
306
470
  }
307
- var ServerSuccessSchema = (payload) => z5.object({ data: payload }).strict();
308
- var ServerErrorBodySchema = z5.object({
309
- error: z5.object({
310
- code: z5.string().min(1),
311
- message: z5.string(),
312
- correlationId: z5.string().optional(),
313
- retryAfter: z5.number().int().nonnegative().optional(),
314
- details: z5.unknown().optional()
471
+ var ServerSuccessSchema = (payload) => z10.object({ data: payload }).strict();
472
+ var ServerErrorBodySchema = z10.object({
473
+ error: z10.object({
474
+ code: z10.string().min(1),
475
+ message: z10.string(),
476
+ correlationId: z10.string().optional(),
477
+ retryAfter: z10.number().int().nonnegative().optional(),
478
+ details: z10.unknown().optional()
315
479
  }).strict()
316
480
  }).strict();
317
481
  var REDACT_BODY_LIMIT = 1024;
@@ -485,7 +649,7 @@ function parseSuccessBody(args) {
485
649
  err
486
650
  );
487
651
  }
488
- const envelope = ServerSuccessSchema(args.responseSchema ?? z6.unknown()).safeParse(parsed);
652
+ const envelope = ServerSuccessSchema(args.responseSchema ?? z11.unknown()).safeParse(parsed);
489
653
  if (!envelope.success) {
490
654
  const issues = formatSchemaIssues(envelope.error);
491
655
  throw new ApiError(
@@ -1411,31 +1575,31 @@ function getCredentialsPath(ctx = {}) {
1411
1575
  }
1412
1576
 
1413
1577
  // src/auth/types.ts
1414
- import { z as z7 } from "zod";
1415
- var DeviceAuthorizationRequestSchema = z7.object({
1416
- client_id: z7.string(),
1417
- scope: z7.string()
1578
+ import { z as z12 } from "zod";
1579
+ var DeviceAuthorizationRequestSchema = z12.object({
1580
+ client_id: z12.string(),
1581
+ scope: z12.string()
1418
1582
  });
1419
- var DeviceAuthorizationResponseSchema = z7.object({
1420
- device_code: z7.string(),
1421
- user_code: z7.string().min(1),
1422
- verification_uri: z7.string().url(),
1423
- verification_uri_complete: z7.string().url().optional(),
1424
- expires_in: z7.number().int().positive(),
1425
- interval: z7.number().int().positive().default(5)
1583
+ var DeviceAuthorizationResponseSchema = z12.object({
1584
+ device_code: z12.string(),
1585
+ user_code: z12.string().min(1),
1586
+ verification_uri: z12.string().url(),
1587
+ verification_uri_complete: z12.string().url().optional(),
1588
+ expires_in: z12.number().int().positive(),
1589
+ interval: z12.number().int().positive().default(5)
1426
1590
  });
1427
- var DeviceTokenPollRequestSchema = z7.object({
1428
- client_id: z7.string(),
1429
- device_code: z7.string(),
1430
- grant_type: z7.literal("urn:ietf:params:oauth:grant-type:device_code")
1591
+ var DeviceTokenPollRequestSchema = z12.object({
1592
+ client_id: z12.string(),
1593
+ device_code: z12.string(),
1594
+ grant_type: z12.literal("urn:ietf:params:oauth:grant-type:device_code")
1431
1595
  });
1432
- var TokenResponseSchema = z7.object({
1433
- access_token: z7.string(),
1434
- token_type: z7.literal("Bearer"),
1435
- expires_in: z7.number().int().positive(),
1436
- scope: z7.string()
1596
+ var TokenResponseSchema = z12.object({
1597
+ access_token: z12.string(),
1598
+ token_type: z12.literal("Bearer"),
1599
+ expires_in: z12.number().int().positive(),
1600
+ scope: z12.string()
1437
1601
  });
1438
- var DeviceTokenPollErrorCodeSchema = z7.enum([
1602
+ var DeviceTokenPollErrorCodeSchema = z12.enum([
1439
1603
  "authorization_pending",
1440
1604
  "slow_down",
1441
1605
  "access_denied",
@@ -1446,27 +1610,27 @@ var DeviceTokenPollErrorCodeSchema = z7.enum([
1446
1610
  "unsupported_grant_type",
1447
1611
  "invalid_scope"
1448
1612
  ]);
1449
- var DeviceTokenPollErrorSchema = z7.object({
1613
+ var DeviceTokenPollErrorSchema = z12.object({
1450
1614
  error: DeviceTokenPollErrorCodeSchema,
1451
- error_description: z7.string().optional()
1615
+ error_description: z12.string().optional()
1452
1616
  });
1453
- var CredentialsProfileSchema = z7.object({
1454
- apiBaseUrl: z7.string().url(),
1455
- accessToken: z7.string(),
1456
- tokenType: z7.literal("Bearer"),
1457
- tokenPrefix: z7.string(),
1458
- organizationId: z7.string().uuid(),
1459
- organizationSlug: z7.string(),
1460
- userId: z7.string().uuid(),
1461
- scopes: z7.array(z7.string()),
1462
- expiresAt: z7.string().datetime(),
1463
- issuedAt: z7.string().datetime(),
1464
- clientId: z7.string()
1617
+ var CredentialsProfileSchema = z12.object({
1618
+ apiBaseUrl: z12.string().url(),
1619
+ accessToken: z12.string(),
1620
+ tokenType: z12.literal("Bearer"),
1621
+ tokenPrefix: z12.string(),
1622
+ organizationId: z12.string().uuid(),
1623
+ organizationSlug: z12.string(),
1624
+ userId: z12.string().uuid(),
1625
+ scopes: z12.array(z12.string()),
1626
+ expiresAt: z12.string().datetime(),
1627
+ issuedAt: z12.string().datetime(),
1628
+ clientId: z12.string()
1465
1629
  }).strict();
1466
- var CredentialsFileSchema = z7.object({
1467
- version: z7.literal(1),
1468
- defaultProfile: z7.string(),
1469
- profiles: z7.record(z7.string(), CredentialsProfileSchema)
1630
+ var CredentialsFileSchema = z12.object({
1631
+ version: z12.literal(1),
1632
+ defaultProfile: z12.string(),
1633
+ profiles: z12.record(z12.string(), CredentialsProfileSchema)
1470
1634
  }).strict();
1471
1635
 
1472
1636
  // src/auth/credentials.ts
@@ -1749,87 +1913,10 @@ async function listBrandModels(options) {
1749
1913
  return data.brandModels;
1750
1914
  }
1751
1915
 
1752
- // src/schemas/jobs.ts
1753
- import { z as z9 } from "zod";
1754
- var ProductReferenceSchema = z9.object({
1755
- id: z9.string().uuid(),
1756
- imageId: z9.string().uuid().optional()
1757
- }).strict();
1758
- var GenerateCreateRequestSchema = z9.object({
1759
- modelSlug: z9.string().min(1).max(100),
1760
- input: z9.object({
1761
- prompt: z9.string().max(1e4).optional(),
1762
- referenceImageUrl: z9.string().url().optional(),
1763
- referenceImages: z9.array(z9.string().url()).max(8).optional(),
1764
- aspectRatio: z9.string().regex(/^\d+:\d+$/).optional(),
1765
- resolution: z9.string().regex(/^\d+x\d+$/).optional(),
1766
- durationSeconds: z9.number().int().min(1).max(60).optional(),
1767
- providerParams: z9.record(z9.string(), z9.unknown()).optional()
1768
- }).strict(),
1769
- options: z9.object({
1770
- workflowId: z9.string().uuid().optional(),
1771
- nodeId: z9.string().optional()
1772
- }).strict().optional(),
1773
- products: z9.array(ProductReferenceSchema).min(1).max(10).optional()
1774
- }).strict();
1775
- var GenerateCreateResponseSchema = z9.object({
1776
- jobId: z9.string().uuid(),
1777
- status: z9.enum(["queued", "processing", "completed", "failed"]),
1778
- estimatedSeconds: z9.number().int().nonnegative().nullable(),
1779
- creditsCharged: z9.number().int().nonnegative()
1780
- }).strict();
1781
- var GenerationStatusSchema = z9.enum([
1782
- "queued",
1783
- "processing",
1784
- "uploading",
1785
- "completed",
1786
- "failed",
1787
- "cancelled"
1788
- ]);
1789
- var TERMINAL_STATUSES = /* @__PURE__ */ new Set([
1790
- "completed",
1791
- "failed",
1792
- "cancelled"
1793
- ]);
1794
- function isTerminalStatus(status) {
1795
- return TERMINAL_STATUSES.has(status);
1796
- }
1797
- var GenerationResultSchema = z9.object({
1798
- jobId: z9.string().uuid(),
1799
- status: GenerationStatusSchema,
1800
- modelSlug: z9.string(),
1801
- resultUrl: z9.string().url().nullable(),
1802
- thumbnailUrl: z9.string().url().nullable(),
1803
- errorCode: z9.string().nullable(),
1804
- errorMessage: z9.string().nullable(),
1805
- creditsCharged: z9.number().int().nonnegative(),
1806
- creditsRefunded: z9.boolean(),
1807
- startedAt: z9.string().nullable(),
1808
- completedAt: z9.string().nullable()
1809
- }).strict();
1810
-
1811
1916
  // src/commands/upload.ts
1812
1917
  import { readFile as readFile2, stat as stat2 } from "fs/promises";
1813
1918
  import { basename } from "path";
1814
1919
  import "undici";
1815
-
1816
- // src/schemas/assets.ts
1817
- import { z as z10 } from "zod";
1818
- var MAX_UPLOAD_SIZE_BYTES = 15 * 1024 * 1024;
1819
- var UploadRequestSchema = z10.object({
1820
- filename: z10.string().min(1).max(255),
1821
- contentType: z10.string().regex(/^[\w-]+\/[\w+.-]+$/),
1822
- sizeBytes: z10.number().int().positive().max(MAX_UPLOAD_SIZE_BYTES),
1823
- contentHash: z10.string().regex(/^sha256:[0-9a-f]{64}$/)
1824
- }).strict();
1825
- var UploadResponseSchema = z10.object({
1826
- assetId: z10.string().uuid(),
1827
- uploadUrl: z10.string().url(),
1828
- publicUrl: z10.string().url(),
1829
- deduplicated: z10.boolean()
1830
- }).strict();
1831
-
1832
- // src/commands/upload.ts
1833
1920
  var DEFAULT_UPLOAD_SCOPE = "user-uploads";
1834
1921
  async function uploadFile(opts) {
1835
1922
  const scope = opts.scope ?? DEFAULT_UPLOAD_SCOPE;
@@ -2725,48 +2812,48 @@ function formatRevokeFailure(err, token) {
2725
2812
  }
2726
2813
 
2727
2814
  // src/schemas/models.ts
2728
- import { z as z11 } from "zod";
2729
- var ModelSummarySchema = z11.object({
2730
- id: z11.string().uuid(),
2731
- slug: z11.string(),
2732
- displayName: z11.string(),
2733
- description: z11.string().nullable(),
2734
- shortDescription: z11.string().nullable(),
2735
- providerSlug: z11.string(),
2736
- providerName: z11.string(),
2737
- modelType: z11.string(),
2738
- category: z11.string(),
2739
- costTier: z11.string(),
2740
- creditCost: z11.number(),
2741
- pricingStrategy: z11.string(),
2742
- estimatedSeconds: z11.object({
2743
- typical: z11.number(),
2744
- range: z11.array(z11.number())
2815
+ import { z as z14 } from "zod";
2816
+ var ModelSummarySchema = z14.object({
2817
+ id: z14.string().uuid(),
2818
+ slug: z14.string(),
2819
+ displayName: z14.string(),
2820
+ description: z14.string().nullable(),
2821
+ shortDescription: z14.string().nullable(),
2822
+ providerSlug: z14.string(),
2823
+ providerName: z14.string(),
2824
+ modelType: z14.string(),
2825
+ category: z14.string(),
2826
+ costTier: z14.string(),
2827
+ creditCost: z14.number(),
2828
+ pricingStrategy: z14.string(),
2829
+ estimatedSeconds: z14.object({
2830
+ typical: z14.number(),
2831
+ range: z14.array(z14.number())
2745
2832
  }).passthrough().nullable(),
2746
- status: z11.string(),
2747
- modalities: z11.object({
2748
- input: z11.array(z11.string()),
2749
- output: z11.array(z11.string())
2833
+ status: z14.string(),
2834
+ modalities: z14.object({
2835
+ input: z14.array(z14.string()),
2836
+ output: z14.array(z14.string())
2750
2837
  }).passthrough().nullable(),
2751
- bestFor: z11.array(z11.string()),
2752
- badges: z11.array(
2753
- z11.object({
2754
- type: z11.string(),
2755
- label: z11.string(),
2756
- color: z11.string(),
2757
- expires_at: z11.string().nullable().optional()
2838
+ bestFor: z14.array(z14.string()),
2839
+ badges: z14.array(
2840
+ z14.object({
2841
+ type: z14.string(),
2842
+ label: z14.string(),
2843
+ color: z14.string(),
2844
+ expires_at: z14.string().nullable().optional()
2758
2845
  }).strict()
2759
2846
  ),
2760
- isFeatured: z11.boolean(),
2761
- isDefault: z11.boolean(),
2762
- docsUrl: z11.string().nullable(),
2763
- llmContext: z11.string().nullable(),
2764
- constraints: z11.record(z11.string(), z11.unknown()).nullable(),
2765
- modelFamily: z11.string().nullable(),
2766
- isFamilyPrimary: z11.boolean().nullable()
2847
+ isFeatured: z14.boolean(),
2848
+ isDefault: z14.boolean(),
2849
+ docsUrl: z14.string().nullable(),
2850
+ llmContext: z14.string().nullable(),
2851
+ constraints: z14.record(z14.string(), z14.unknown()).nullable(),
2852
+ modelFamily: z14.string().nullable(),
2853
+ isFamilyPrimary: z14.boolean().nullable()
2767
2854
  }).strict();
2768
- var ModelsListResponseSchema = z11.object({
2769
- models: z11.array(ModelSummarySchema)
2855
+ var ModelsListResponseSchema = z14.object({
2856
+ models: z14.array(ModelSummarySchema)
2770
2857
  }).strict();
2771
2858
 
2772
2859
  // src/commands/models/internal.ts
@@ -2802,26 +2889,6 @@ async function listModels(opts) {
2802
2889
  return data;
2803
2890
  }
2804
2891
 
2805
- // src/schemas/node-types.ts
2806
- import { z as z12 } from "zod";
2807
- var NodeTypeSummarySchema = z12.object({
2808
- type: z12.string(),
2809
- portCount: z12.number()
2810
- }).strict();
2811
- var NodeTypePortSchema = z12.object({
2812
- handleId: z12.string(),
2813
- direction: z12.enum(["input", "output"]),
2814
- dataType: z12.string()
2815
- }).strict();
2816
- var NodeTypeDetailSchema = z12.object({
2817
- type: z12.string(),
2818
- ports: z12.array(NodeTypePortSchema),
2819
- agentWritableFields: z12.array(z12.string())
2820
- }).strict();
2821
- var NodeTypesListResponseSchema = z12.object({
2822
- nodeTypes: z12.array(NodeTypeSummarySchema)
2823
- }).strict();
2824
-
2825
2892
  // src/commands/nodes/internal.ts
2826
2893
  async function buildNodesClient(opts) {
2827
2894
  const cfg = await loadConfig({
@@ -2990,36 +3057,6 @@ async function buildTemplateClient(opts) {
2990
3057
  });
2991
3058
  }
2992
3059
 
2993
- // src/schemas/templates.ts
2994
- import { z as z14 } from "zod";
2995
- var DeclaredParamSchema = z14.object({
2996
- name: z14.string(),
2997
- type: z14.string(),
2998
- required: z14.boolean(),
2999
- defaultValue: z14.string().nullable().optional(),
3000
- enumValues: z14.array(z14.string()).nullable().optional(),
3001
- description: z14.string().nullable().optional()
3002
- }).strict();
3003
- var TemplateSummarySchema = z14.object({
3004
- id: z14.string().uuid(),
3005
- source: z14.enum(["own", "system"]),
3006
- name: z14.string(),
3007
- description: z14.string().nullable(),
3008
- category: z14.string().nullable(),
3009
- thumbnailUrl: z14.string().nullable(),
3010
- tags: z14.array(z14.string()),
3011
- createdAt: z14.string()
3012
- }).strict();
3013
- var TemplateDetailSchema = TemplateSummarySchema.extend({
3014
- declaredParams: z14.array(DeclaredParamSchema),
3015
- timesUsed: z14.number()
3016
- }).strict();
3017
- var TemplatesListResponseSchema = z14.object({
3018
- templates: z14.array(TemplateSummarySchema),
3019
- cursor: z14.string().nullable(),
3020
- hasMore: z14.boolean()
3021
- }).strict();
3022
-
3023
3060
  // src/commands/template/list.ts
3024
3061
  async function listTemplates(opts) {
3025
3062
  const client = opts.client ?? await buildTemplateClient(opts);
@@ -3092,55 +3129,6 @@ async function listTokens(options) {
3092
3129
  return data;
3093
3130
  }
3094
3131
 
3095
- // src/schemas/workflows.ts
3096
- import { z as z16 } from "zod";
3097
- var WorkflowDeclaredParamSchema = z16.object({
3098
- name: z16.string(),
3099
- type: z16.string(),
3100
- required: z16.boolean().optional(),
3101
- defaultValue: z16.unknown().optional(),
3102
- description: z16.unknown().optional()
3103
- }).passthrough();
3104
- var WorkflowSummarySchema = z16.object({
3105
- id: z16.string().uuid(),
3106
- name: z16.string(),
3107
- tags: z16.array(z16.string()),
3108
- declared_params: z16.array(WorkflowDeclaredParamSchema).nullable().default([]),
3109
- canvas_rev: z16.number().int().nonnegative(),
3110
- updated_at: z16.string()
3111
- }).strict();
3112
- var WorkflowsListResponseSchema = z16.object({
3113
- items: z16.array(WorkflowSummarySchema),
3114
- nextCursor: z16.string().nullable()
3115
- }).strict();
3116
- var WorkflowDetailSchema = z16.object({
3117
- id: z16.string().uuid(),
3118
- name: z16.string(),
3119
- description: z16.string().nullable(),
3120
- tags: z16.array(z16.string()),
3121
- declared_params: z16.array(WorkflowDeclaredParamSchema).nullable().default([]),
3122
- canvas_rev: z16.number().int().nonnegative(),
3123
- nodes: z16.array(z16.unknown()),
3124
- edges: z16.array(z16.unknown()),
3125
- created_at: z16.string(),
3126
- updated_at: z16.string()
3127
- }).strict();
3128
- var WorkflowCreateResponseSchema = z16.object({
3129
- id: z16.string().uuid(),
3130
- name: z16.string(),
3131
- description: z16.string().nullable(),
3132
- tags: z16.array(z16.string()),
3133
- declared_params: z16.array(WorkflowDeclaredParamSchema).nullable().default([]),
3134
- canvas_rev: z16.number().int().nonnegative(),
3135
- created_at: z16.string(),
3136
- updated_at: z16.string()
3137
- }).strict();
3138
- var WorkflowMutateResponseSchema = z16.object({
3139
- canvas_rev: z16.number().int().nonnegative(),
3140
- applied: z16.number().int().nonnegative(),
3141
- workflow: WorkflowDetailSchema
3142
- }).strict();
3143
-
3144
3132
  // src/commands/workflow/internal.ts
3145
3133
  async function buildWorkflowClient(opts) {
3146
3134
  const cfg = await loadConfig({