@usenaive-sdk/blueprints 0.10.0 → 0.11.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.
@@ -0,0 +1,846 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Blueprints and their templates.
5
+ *
6
+ * A **blueprint** is the machine: screens, `/api/*`, the store, build and deploy, the approval
7
+ * flow — or, for a data-only blueprint, none of those. It is one repository, and it is shared across
8
+ * its templates. A **template** is DATA — the crew and its prompts, the tool allow-lists and its
9
+ * schedules. What a blueprint's own screens print per template is the blueprint's business, and
10
+ * the engine never reads it (ADR-0903). One repo carries every template its blueprint has, so
11
+ * switching is an edit plus `naive up`: never a re-clone, never a new app.
12
+ *
13
+ * The pair is checked here and refused at define time (`define.ts`), in the author's own
14
+ * vocabulary, for the same reason every other refusal is: a wrong pair discovered at apply time is
15
+ * discovered against a half-provisioned organization.
16
+ */
17
+
18
+ /**
19
+ * The data module a blueprint repo exports, one per template it carries. Everything here is data:
20
+ * nothing in it is a function, a component or a route, because those are the blueprint's and are
21
+ * shared. `agents` is the config's own `agents` shape, so a template declares a crew exactly as a
22
+ * hand-written config would — prompts, tool allow-lists and schedules included.
23
+ */
24
+ interface Template {
25
+ /** Spelled exactly as `defineProject({ template })` and `naive template --template` name it. */
26
+ name: string;
27
+ /** One line for the operator: what this crew does. */
28
+ description: string;
29
+ agents: AgentDecl[];
30
+ }
31
+ /**
32
+ * Every blueprint and the templates it carries. `agency` defaults to `blank` — a working agency
33
+ * with no specialism is a safe thing to get by accident. `media` has NO default on purpose: its
34
+ * three crews spend money in different ways — a long-form piece renders a minute-plus of video
35
+ * where a clip only cuts one — so defaulting any of them is a bill the operator did not choose.
36
+ * `web` carries one crew today, so `publisher` is its default for the reason `blank` is
37
+ * `agency`'s: the only thing you can get is the thing you meant.
38
+ */
39
+ declare const BLUEPRINTS: Record<string, {
40
+ templates: readonly string[];
41
+ default?: string;
42
+ }>;
43
+ /** Resolved (a default may have filled it in), or the refusal's own words for the caller to raise. */
44
+ type TemplateChoice = {
45
+ ok: true;
46
+ template: string | undefined;
47
+ } | {
48
+ ok: false;
49
+ message: string;
50
+ };
51
+ /** The one place a `blueprint` / `template` pair is judged — `defineProject` and the CLI share it. */
52
+ declare function chooseTemplate(blueprint: string | undefined, template: string | undefined): TemplateChoice;
53
+
54
+ /**
55
+ * A config that loaded but refuses itself. A distinct class so the loader can tell "the author's
56
+ * declaration is wrong" apart from "the module could not be evaluated" — the two failure modes the
57
+ * old `naive up` collapsed into one, silently.
58
+ */
59
+ declare class BlueprintRefusal extends Error {
60
+ readonly name = "BlueprintRefusal";
61
+ }
62
+ declare const AppDeclSchema: z.ZodObject<{
63
+ name: z.ZodString;
64
+ type: z.ZodEnum<{
65
+ frontend_only: "frontend_only";
66
+ fullstack: "fullstack";
67
+ }>;
68
+ description: z.ZodOptional<z.ZodString>;
69
+ deploy_dir: z.ZodOptional<z.ZodString>;
70
+ mcp: z.ZodOptional<z.ZodString>;
71
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
72
+ from_env: z.ZodString;
73
+ }, z.core.$strip>, z.ZodObject<{
74
+ generate: z.ZodLiteral<true>;
75
+ }, z.core.$strip>]>>>;
76
+ required: z.ZodOptional<z.ZodBoolean>;
77
+ migrations: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
+ buckets: z.ZodOptional<z.ZodArray<z.ZodObject<{
79
+ name: z.ZodString;
80
+ public: z.ZodDefault<z.ZodBoolean>;
81
+ }, z.core.$strip>>>;
82
+ }, z.core.$strip>;
83
+ /**
84
+ * A cron on the agent — a platform deployment (§12) minus what `up` fills in: `agent_id`, and the
85
+ * `identity`, a declared persona *name* like the agent's own. `cron` is the key the reconciler
86
+ * matches live rows by (deployments have no name), so it must be unique within one agent.
87
+ * `budget_micro_usd` has no default on `POST /v1/deployments`, so it is required here for the
88
+ * same reason the agent's `budget` is.
89
+ */
90
+ declare const ScheduleDeclSchema: z.ZodObject<{
91
+ cron: z.ZodString;
92
+ timezone: z.ZodOptional<z.ZodString>;
93
+ input: z.ZodString;
94
+ summary: z.ZodOptional<z.ZodString>;
95
+ budget_micro_usd: z.ZodNumber;
96
+ identity: z.ZodOptional<z.ZodString>;
97
+ enabled: z.ZodOptional<z.ZodBoolean>;
98
+ }, z.core.$strip>;
99
+ /** Exactly the `POST /v1/agents` fields a blueprint declares — `model` and `budget` are required by that route, so requiring them here turns a guaranteed apply-time refusal into a define-time one. */
100
+ declare const AgentDeclSchema: z.ZodObject<{
101
+ name: z.ZodString;
102
+ model: z.ZodString;
103
+ budget: z.ZodObject<{
104
+ cap_micro_usd: z.ZodNumber;
105
+ max_task_micro_usd: z.ZodNumber;
106
+ period: z.ZodEnum<{
107
+ day: "day";
108
+ week: "week";
109
+ month: "month";
110
+ }>;
111
+ }, z.core.$strip>;
112
+ description: z.ZodOptional<z.ZodString>;
113
+ role: z.ZodOptional<z.ZodString>;
114
+ required: z.ZodOptional<z.ZodBoolean>;
115
+ system: z.ZodOptional<z.ZodString>;
116
+ tools: z.ZodOptional<z.ZodObject<{
117
+ default_config: z.ZodObject<{
118
+ permission: z.ZodEnum<{
119
+ allow: "allow";
120
+ ask: "ask";
121
+ deny: "deny";
122
+ }>;
123
+ }, z.core.$strip>;
124
+ configs: z.ZodRecord<z.ZodString, z.ZodObject<{
125
+ enabled: z.ZodBoolean;
126
+ permission: z.ZodEnum<{
127
+ allow: "allow";
128
+ ask: "ask";
129
+ deny: "deny";
130
+ }>;
131
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
132
+ }, z.core.$strip>>;
133
+ }, z.core.$strip>>;
134
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
135
+ mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
136
+ name: z.ZodString;
137
+ url: z.ZodURL;
138
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
139
+ }, z.core.$strip>>>;
140
+ window: z.ZodOptional<z.ZodEnum<{
141
+ immediate: "immediate";
142
+ priority: "priority";
143
+ loose: "loose";
144
+ }>>;
145
+ multiagent: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
146
+ agents: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<{
147
+ type: "agent";
148
+ name: string;
149
+ }, string>>, z.ZodObject<{
150
+ type: z.ZodLiteral<"agent">;
151
+ name: z.ZodString;
152
+ version: z.ZodOptional<z.ZodNumber>;
153
+ }, z.core.$strip>, z.ZodObject<{
154
+ type: z.ZodLiteral<"self">;
155
+ }, z.core.$strip>, z.ZodObject<{
156
+ type: z.ZodLiteral<"advisor">;
157
+ model: z.ZodString;
158
+ }, z.core.$strip>]>>;
159
+ type: z.ZodLiteral<"coordinator">;
160
+ board: z.ZodOptional<z.ZodBoolean>;
161
+ }, z.core.$strip>, z.ZodNull]>>;
162
+ output_schema: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
163
+ structured_output_required: z.ZodOptional<z.ZodBoolean>;
164
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
165
+ allowed_apps: z.ZodOptional<z.ZodArray<z.ZodString>>;
166
+ identity: z.ZodOptional<z.ZodString>;
167
+ handoffs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"team">, z.ZodArray<z.ZodString>]>>;
168
+ schedules: z.ZodOptional<z.ZodArray<z.ZodObject<{
169
+ cron: z.ZodString;
170
+ timezone: z.ZodOptional<z.ZodString>;
171
+ input: z.ZodString;
172
+ summary: z.ZodOptional<z.ZodString>;
173
+ budget_micro_usd: z.ZodNumber;
174
+ identity: z.ZodOptional<z.ZodString>;
175
+ enabled: z.ZodOptional<z.ZodBoolean>;
176
+ }, z.core.$strip>>>;
177
+ intake: z.ZodOptional<z.ZodObject<{
178
+ message: z.ZodString;
179
+ budget_micro_usd: z.ZodOptional<z.ZodNumber>;
180
+ }, z.core.$strip>>;
181
+ }, z.core.$strip>;
182
+ /**
183
+ * A vault credential (§23) minus what `up` fills in. `value` is a real third-party secret, so it is
184
+ * `{ from_env }` only — never a literal — and travels once, on create. Values are write-only and
185
+ * rows immutable, so `kind`, `key` and `host` / `mcp_server_url` are all the reconciler can match a
186
+ * live row by.
187
+ */
188
+ declare const CredentialDeclSchema: z.ZodObject<{
189
+ kind: z.ZodEnum<{
190
+ env_var: "env_var";
191
+ static_bearer: "static_bearer";
192
+ mcp_oauth: "mcp_oauth";
193
+ }>;
194
+ key: z.ZodString;
195
+ host: z.ZodOptional<z.ZodString>;
196
+ mcp_server_url: z.ZodOptional<z.ZodURL>;
197
+ value: z.ZodObject<{
198
+ from_env: z.ZodString;
199
+ }, z.core.$strip>;
200
+ }, z.core.$strip>;
201
+ /** `name` is the vault's `display_name`, the key it is found by; `identity` a declared persona *name*. */
202
+ declare const VaultDeclSchema: z.ZodObject<{
203
+ name: z.ZodString;
204
+ identity: z.ZodOptional<z.ZodString>;
205
+ credentials: z.ZodArray<z.ZodObject<{
206
+ kind: z.ZodEnum<{
207
+ env_var: "env_var";
208
+ static_bearer: "static_bearer";
209
+ mcp_oauth: "mcp_oauth";
210
+ }>;
211
+ key: z.ZodString;
212
+ host: z.ZodOptional<z.ZodString>;
213
+ mcp_server_url: z.ZodOptional<z.ZodURL>;
214
+ value: z.ZodObject<{
215
+ from_env: z.ZodString;
216
+ }, z.core.$strip>;
217
+ }, z.core.$strip>>;
218
+ }, z.core.$strip>;
219
+ /** `file` holds the skill body, resolved against the config's directory; the slug grammar is `POST /v1/skills`' (§13). */
220
+ declare const SkillDeclSchema: z.ZodObject<{
221
+ slug: z.ZodString;
222
+ file: z.ZodString;
223
+ }, z.core.$strip>;
224
+ declare const IdentityDeclSchema: z.ZodObject<{
225
+ name: z.ZodString;
226
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
227
+ legal: z.ZodOptional<z.ZodArray<z.ZodObject<{
228
+ description: z.ZodString;
229
+ state: z.ZodEnum<{
230
+ AL: "AL";
231
+ AK: "AK";
232
+ AZ: "AZ";
233
+ AR: "AR";
234
+ CA: "CA";
235
+ CO: "CO";
236
+ CT: "CT";
237
+ DE: "DE";
238
+ DC: "DC";
239
+ FL: "FL";
240
+ GA: "GA";
241
+ HI: "HI";
242
+ ID: "ID";
243
+ IL: "IL";
244
+ IN: "IN";
245
+ IA: "IA";
246
+ KS: "KS";
247
+ KY: "KY";
248
+ LA: "LA";
249
+ ME: "ME";
250
+ MD: "MD";
251
+ MA: "MA";
252
+ MI: "MI";
253
+ MN: "MN";
254
+ MS: "MS";
255
+ MO: "MO";
256
+ MT: "MT";
257
+ NE: "NE";
258
+ NV: "NV";
259
+ NH: "NH";
260
+ NJ: "NJ";
261
+ NM: "NM";
262
+ NY: "NY";
263
+ NC: "NC";
264
+ ND: "ND";
265
+ OH: "OH";
266
+ OK: "OK";
267
+ OR: "OR";
268
+ PA: "PA";
269
+ RI: "RI";
270
+ SC: "SC";
271
+ SD: "SD";
272
+ TN: "TN";
273
+ TX: "TX";
274
+ UT: "UT";
275
+ VT: "VT";
276
+ VA: "VA";
277
+ WA: "WA";
278
+ WV: "WV";
279
+ WI: "WI";
280
+ WY: "WY";
281
+ }>;
282
+ name_options: z.ZodArray<z.ZodString>;
283
+ naics_code: z.ZodString;
284
+ label: z.ZodString;
285
+ }, z.core.$strip>>>;
286
+ wallet: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
287
+ network: z.ZodOptional<z.ZodEnum<{
288
+ "eip155:84532": "eip155:84532";
289
+ "eip155:8453": "eip155:8453";
290
+ }>>;
291
+ policy: z.ZodOptional<z.ZodObject<{
292
+ per_tx_cap_micro_usd: z.ZodOptional<z.ZodNumber>;
293
+ daily_cap_micro_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
294
+ low_balance_micro_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
295
+ }, z.core.$strip>>;
296
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
297
+ network: z.ZodOptional<z.ZodEnum<{
298
+ "eip155:84532": "eip155:84532";
299
+ "eip155:8453": "eip155:8453";
300
+ }>>;
301
+ policy: z.ZodOptional<z.ZodObject<{
302
+ per_tx_cap_micro_usd: z.ZodOptional<z.ZodNumber>;
303
+ daily_cap_micro_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
304
+ low_balance_micro_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
305
+ }, z.core.$strip>>;
306
+ }, z.core.$strip>>]>>;
307
+ cards: z.ZodOptional<z.ZodArray<z.ZodObject<{
308
+ label: z.ZodString;
309
+ load_micro_usd: z.ZodNumber;
310
+ }, z.core.$strip>>>;
311
+ }, z.core.$strip>;
312
+ /**
313
+ * One card the apply seeds on the organization's board (`canonical-spec §31.11`). `key` is the
314
+ * card's idempotency handle — `<project>:<key>` on the wire — so a re-apply finds the card it wrote;
315
+ * `assignee` is an agent NAME, which is what a board card carries (§28.11); `blocked_by` names
316
+ * sibling tasks by key and becomes their `crd_` ids at apply time.
317
+ */
318
+ declare const TaskDeclSchema: z.ZodObject<{
319
+ key: z.ZodString;
320
+ title: z.ZodString;
321
+ body: z.ZodOptional<z.ZodString>;
322
+ assignee: z.ZodOptional<z.ZodString>;
323
+ blocked_by: z.ZodOptional<z.ZodArray<z.ZodString>>;
324
+ }, z.core.$strip>;
325
+ declare const ProjectSchema: z.ZodObject<{
326
+ name: z.ZodString;
327
+ blueprint: z.ZodOptional<z.ZodString>;
328
+ template: z.ZodOptional<z.ZodString>;
329
+ title: z.ZodOptional<z.ZodString>;
330
+ description: z.ZodOptional<z.ZodString>;
331
+ platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
332
+ bluesky: "bluesky";
333
+ facebook: "facebook";
334
+ instagram: "instagram";
335
+ linkedin: "linkedin";
336
+ mastodon: "mastodon";
337
+ pinterest: "pinterest";
338
+ reddit: "reddit";
339
+ threads: "threads";
340
+ tiktok: "tiktok";
341
+ x: "x";
342
+ youtube: "youtube";
343
+ }>>>;
344
+ roadmap: z.ZodOptional<z.ZodObject<{
345
+ day_one: z.ZodOptional<z.ZodString>;
346
+ every_day: z.ZodOptional<z.ZodString>;
347
+ after: z.ZodOptional<z.ZodString>;
348
+ }, z.core.$strip>>;
349
+ mini_apps: z.ZodOptional<z.ZodArray<z.ZodObject<{
350
+ slug: z.ZodString;
351
+ name: z.ZodString;
352
+ icon: z.ZodEnum<{
353
+ calendar: "calendar";
354
+ grid: "grid";
355
+ list: "list";
356
+ chart: "chart";
357
+ play: "play";
358
+ }>;
359
+ pages: z.ZodArray<z.ZodObject<{
360
+ slug: z.ZodString;
361
+ title: z.ZodString;
362
+ spec: z.ZodObject<{
363
+ root: z.ZodString;
364
+ elements: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
365
+ type: z.ZodLiteral<"Page">;
366
+ props: z.ZodObject<{}, z.core.$strict>;
367
+ children: z.ZodArray<z.ZodString>;
368
+ }, z.core.$strict>, z.ZodObject<{
369
+ type: z.ZodLiteral<"Section">;
370
+ props: z.ZodObject<{
371
+ title: z.ZodString;
372
+ to: z.ZodOptional<z.ZodString>;
373
+ hide_empty: z.ZodOptional<z.ZodBoolean>;
374
+ }, z.core.$strict>;
375
+ children: z.ZodArray<z.ZodString>;
376
+ }, z.core.$strict>, z.ZodObject<{
377
+ type: z.ZodLiteral<"Stack">;
378
+ props: z.ZodObject<{}, z.core.$strict>;
379
+ children: z.ZodArray<z.ZodString>;
380
+ }, z.core.$strict>, z.ZodObject<{
381
+ type: z.ZodLiteral<"Grid">;
382
+ props: z.ZodObject<{
383
+ columns: z.ZodLiteral<1 | 3 | 2>;
384
+ }, z.core.$strict>;
385
+ children: z.ZodArray<z.ZodString>;
386
+ }, z.core.$strict>, z.ZodObject<{
387
+ type: z.ZodLiteral<"Metric">;
388
+ props: z.ZodObject<{
389
+ label: z.ZodString;
390
+ value: z.ZodObject<{
391
+ $source: z.ZodEnum<{
392
+ views_total: "views_total";
393
+ spend_total: "spend_total";
394
+ }>;
395
+ days: z.ZodDefault<z.ZodNumber>;
396
+ }, z.core.$strict>;
397
+ delta: z.ZodOptional<z.ZodObject<{
398
+ $source: z.ZodEnum<{
399
+ views_change: "views_change";
400
+ }>;
401
+ }, z.core.$strict>>;
402
+ }, z.core.$strict>;
403
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
404
+ }, z.core.$strict>, z.ZodObject<{
405
+ type: z.ZodLiteral<"LineChart">;
406
+ props: z.ZodObject<{
407
+ label: z.ZodOptional<z.ZodString>;
408
+ series: z.ZodObject<{
409
+ $source: z.ZodEnum<{
410
+ spend_by_day: "spend_by_day";
411
+ }>;
412
+ days: z.ZodDefault<z.ZodNumber>;
413
+ }, z.core.$strict>;
414
+ }, z.core.$strict>;
415
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
416
+ }, z.core.$strict>, z.ZodObject<{
417
+ type: z.ZodLiteral<"BarList">;
418
+ props: z.ZodObject<{
419
+ label: z.ZodOptional<z.ZodString>;
420
+ bars: z.ZodObject<{
421
+ $source: z.ZodEnum<{
422
+ post_views: "post_views";
423
+ }>;
424
+ limit: z.ZodDefault<z.ZodNumber>;
425
+ }, z.core.$strict>;
426
+ }, z.core.$strict>;
427
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
428
+ }, z.core.$strict>, z.ZodObject<{
429
+ type: z.ZodLiteral<"Progress">;
430
+ props: z.ZodObject<{
431
+ label: z.ZodString;
432
+ progress: z.ZodObject<{
433
+ $source: z.ZodEnum<{
434
+ posts_this_week: "posts_this_week";
435
+ }>;
436
+ }, z.core.$strict>;
437
+ }, z.core.$strict>;
438
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
439
+ }, z.core.$strict>, z.ZodObject<{
440
+ type: z.ZodLiteral<"Roadmap">;
441
+ props: z.ZodObject<{
442
+ label: z.ZodOptional<z.ZodString>;
443
+ board: z.ZodObject<{
444
+ $source: z.ZodEnum<{
445
+ roadmap: "roadmap";
446
+ }>;
447
+ per_group: z.ZodDefault<z.ZodNumber>;
448
+ }, z.core.$strict>;
449
+ }, z.core.$strict>;
450
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
451
+ }, z.core.$strict>, z.ZodObject<{
452
+ type: z.ZodLiteral<"Schedule">;
453
+ props: z.ZodObject<{
454
+ label: z.ZodOptional<z.ZodString>;
455
+ week: z.ZodObject<{
456
+ $source: z.ZodEnum<{
457
+ schedule: "schedule";
458
+ }>;
459
+ }, z.core.$strict>;
460
+ }, z.core.$strict>;
461
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
462
+ }, z.core.$strict>, z.ZodObject<{
463
+ type: z.ZodLiteral<"Media">;
464
+ props: z.ZodObject<{
465
+ label: z.ZodOptional<z.ZodString>;
466
+ files: z.ZodObject<{
467
+ $source: z.ZodEnum<{
468
+ latest_media: "latest_media";
469
+ newest_media: "newest_media";
470
+ }>;
471
+ count: z.ZodDefault<z.ZodNumber>;
472
+ }, z.core.$strict>;
473
+ }, z.core.$strict>;
474
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
475
+ }, z.core.$strict>, z.ZodObject<{
476
+ type: z.ZodLiteral<"Text">;
477
+ props: z.ZodObject<{
478
+ text: z.ZodString;
479
+ }, z.core.$strict>;
480
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
481
+ }, z.core.$strict>, z.ZodObject<{
482
+ type: z.ZodLiteral<"Needs">;
483
+ props: z.ZodObject<{
484
+ label: z.ZodOptional<z.ZodString>;
485
+ needs: z.ZodObject<{
486
+ $source: z.ZodEnum<{
487
+ needs: "needs";
488
+ }>;
489
+ }, z.core.$strict>;
490
+ }, z.core.$strict>;
491
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
492
+ }, z.core.$strict>, z.ZodObject<{
493
+ type: z.ZodLiteral<"Activity">;
494
+ props: z.ZodObject<{
495
+ label: z.ZodOptional<z.ZodString>;
496
+ agents: z.ZodObject<{
497
+ $source: z.ZodEnum<{
498
+ agents_activity: "agents_activity";
499
+ }>;
500
+ }, z.core.$strict>;
501
+ }, z.core.$strict>;
502
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
503
+ }, z.core.$strict>, z.ZodObject<{
504
+ type: z.ZodLiteral<"Accounts">;
505
+ props: z.ZodObject<{
506
+ accounts: z.ZodObject<{
507
+ $source: z.ZodEnum<{
508
+ accounts: "accounts";
509
+ }>;
510
+ }, z.core.$strict>;
511
+ }, z.core.$strict>;
512
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
513
+ }, z.core.$strict>, z.ZodObject<{
514
+ type: z.ZodLiteral<"Posts">;
515
+ props: z.ZodObject<{
516
+ label: z.ZodOptional<z.ZodString>;
517
+ layout: z.ZodOptional<z.ZodEnum<{
518
+ grid: "grid";
519
+ list: "list";
520
+ row: "row";
521
+ }>>;
522
+ posts: z.ZodObject<{
523
+ $source: z.ZodEnum<{
524
+ posts: "posts";
525
+ }>;
526
+ status: z.ZodUnion<readonly [z.ZodEnum<{
527
+ scheduled: "scheduled";
528
+ posted: "posted";
529
+ waiting: "waiting";
530
+ }>, z.ZodArray<z.ZodEnum<{
531
+ scheduled: "scheduled";
532
+ posted: "posted";
533
+ waiting: "waiting";
534
+ }>>]>;
535
+ limit: z.ZodDefault<z.ZodNumber>;
536
+ }, z.core.$strict>;
537
+ }, z.core.$strict>;
538
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
539
+ }, z.core.$strict>, z.ZodObject<{
540
+ type: z.ZodLiteral<"Answers">;
541
+ props: z.ZodObject<{
542
+ answers: z.ZodObject<{
543
+ $source: z.ZodEnum<{
544
+ answers: "answers";
545
+ }>;
546
+ keys: z.ZodArray<z.ZodString>;
547
+ }, z.core.$strict>;
548
+ }, z.core.$strict>;
549
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
550
+ }, z.core.$strict>, z.ZodObject<{
551
+ type: z.ZodLiteral<"MediaLibrary">;
552
+ props: z.ZodObject<{}, z.core.$strict>;
553
+ children: z.ZodOptional<z.ZodArray<z.ZodString>>;
554
+ }, z.core.$strict>], "type">>;
555
+ }, z.core.$strict>;
556
+ }, z.core.$strict>>;
557
+ }, z.core.$strict>>>;
558
+ questions: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
559
+ type: z.ZodLiteral<"text">;
560
+ placeholder: z.ZodOptional<z.ZodString>;
561
+ key: z.ZodString;
562
+ label: z.ZodString;
563
+ help: z.ZodOptional<z.ZodString>;
564
+ optional: z.ZodOptional<z.ZodBoolean>;
565
+ }, z.core.$strip>, z.ZodObject<{
566
+ type: z.ZodLiteral<"choice">;
567
+ options: z.ZodArray<z.ZodString>;
568
+ multiple: z.ZodDefault<z.ZodBoolean>;
569
+ other: z.ZodDefault<z.ZodBoolean>;
570
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
571
+ option: z.ZodString;
572
+ note: z.ZodOptional<z.ZodString>;
573
+ image: z.ZodOptional<z.ZodString>;
574
+ }, z.core.$strip>>>;
575
+ key: z.ZodString;
576
+ label: z.ZodString;
577
+ help: z.ZodOptional<z.ZodString>;
578
+ optional: z.ZodOptional<z.ZodBoolean>;
579
+ }, z.core.$strip>, z.ZodObject<{
580
+ type: z.ZodLiteral<"media">;
581
+ placeholder: z.ZodOptional<z.ZodString>;
582
+ key: z.ZodString;
583
+ label: z.ZodString;
584
+ help: z.ZodOptional<z.ZodString>;
585
+ optional: z.ZodOptional<z.ZodBoolean>;
586
+ }, z.core.$strip>], "type">>>;
587
+ skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
588
+ slug: z.ZodString;
589
+ file: z.ZodString;
590
+ }, z.core.$strip>>>;
591
+ identities: z.ZodDefault<z.ZodArray<z.ZodObject<{
592
+ name: z.ZodString;
593
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
594
+ legal: z.ZodOptional<z.ZodArray<z.ZodObject<{
595
+ description: z.ZodString;
596
+ state: z.ZodEnum<{
597
+ AL: "AL";
598
+ AK: "AK";
599
+ AZ: "AZ";
600
+ AR: "AR";
601
+ CA: "CA";
602
+ CO: "CO";
603
+ CT: "CT";
604
+ DE: "DE";
605
+ DC: "DC";
606
+ FL: "FL";
607
+ GA: "GA";
608
+ HI: "HI";
609
+ ID: "ID";
610
+ IL: "IL";
611
+ IN: "IN";
612
+ IA: "IA";
613
+ KS: "KS";
614
+ KY: "KY";
615
+ LA: "LA";
616
+ ME: "ME";
617
+ MD: "MD";
618
+ MA: "MA";
619
+ MI: "MI";
620
+ MN: "MN";
621
+ MS: "MS";
622
+ MO: "MO";
623
+ MT: "MT";
624
+ NE: "NE";
625
+ NV: "NV";
626
+ NH: "NH";
627
+ NJ: "NJ";
628
+ NM: "NM";
629
+ NY: "NY";
630
+ NC: "NC";
631
+ ND: "ND";
632
+ OH: "OH";
633
+ OK: "OK";
634
+ OR: "OR";
635
+ PA: "PA";
636
+ RI: "RI";
637
+ SC: "SC";
638
+ SD: "SD";
639
+ TN: "TN";
640
+ TX: "TX";
641
+ UT: "UT";
642
+ VT: "VT";
643
+ VA: "VA";
644
+ WA: "WA";
645
+ WV: "WV";
646
+ WI: "WI";
647
+ WY: "WY";
648
+ }>;
649
+ name_options: z.ZodArray<z.ZodString>;
650
+ naics_code: z.ZodString;
651
+ label: z.ZodString;
652
+ }, z.core.$strip>>>;
653
+ wallet: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
654
+ network: z.ZodOptional<z.ZodEnum<{
655
+ "eip155:84532": "eip155:84532";
656
+ "eip155:8453": "eip155:8453";
657
+ }>>;
658
+ policy: z.ZodOptional<z.ZodObject<{
659
+ per_tx_cap_micro_usd: z.ZodOptional<z.ZodNumber>;
660
+ daily_cap_micro_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
661
+ low_balance_micro_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
662
+ }, z.core.$strip>>;
663
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
664
+ network: z.ZodOptional<z.ZodEnum<{
665
+ "eip155:84532": "eip155:84532";
666
+ "eip155:8453": "eip155:8453";
667
+ }>>;
668
+ policy: z.ZodOptional<z.ZodObject<{
669
+ per_tx_cap_micro_usd: z.ZodOptional<z.ZodNumber>;
670
+ daily_cap_micro_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
671
+ low_balance_micro_usd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
672
+ }, z.core.$strip>>;
673
+ }, z.core.$strip>>]>>;
674
+ cards: z.ZodOptional<z.ZodArray<z.ZodObject<{
675
+ label: z.ZodString;
676
+ load_micro_usd: z.ZodNumber;
677
+ }, z.core.$strip>>>;
678
+ }, z.core.$strip>>>;
679
+ vaults: z.ZodDefault<z.ZodArray<z.ZodObject<{
680
+ name: z.ZodString;
681
+ identity: z.ZodOptional<z.ZodString>;
682
+ credentials: z.ZodArray<z.ZodObject<{
683
+ kind: z.ZodEnum<{
684
+ env_var: "env_var";
685
+ static_bearer: "static_bearer";
686
+ mcp_oauth: "mcp_oauth";
687
+ }>;
688
+ key: z.ZodString;
689
+ host: z.ZodOptional<z.ZodString>;
690
+ mcp_server_url: z.ZodOptional<z.ZodURL>;
691
+ value: z.ZodObject<{
692
+ from_env: z.ZodString;
693
+ }, z.core.$strip>;
694
+ }, z.core.$strip>>;
695
+ }, z.core.$strip>>>;
696
+ apps: z.ZodDefault<z.ZodArray<z.ZodObject<{
697
+ name: z.ZodString;
698
+ type: z.ZodEnum<{
699
+ frontend_only: "frontend_only";
700
+ fullstack: "fullstack";
701
+ }>;
702
+ description: z.ZodOptional<z.ZodString>;
703
+ deploy_dir: z.ZodOptional<z.ZodString>;
704
+ mcp: z.ZodOptional<z.ZodString>;
705
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
706
+ from_env: z.ZodString;
707
+ }, z.core.$strip>, z.ZodObject<{
708
+ generate: z.ZodLiteral<true>;
709
+ }, z.core.$strip>]>>>;
710
+ required: z.ZodOptional<z.ZodBoolean>;
711
+ migrations: z.ZodOptional<z.ZodArray<z.ZodString>>;
712
+ buckets: z.ZodOptional<z.ZodArray<z.ZodObject<{
713
+ name: z.ZodString;
714
+ public: z.ZodDefault<z.ZodBoolean>;
715
+ }, z.core.$strip>>>;
716
+ }, z.core.$strip>>>;
717
+ agents: z.ZodDefault<z.ZodArray<z.ZodObject<{
718
+ name: z.ZodString;
719
+ model: z.ZodString;
720
+ budget: z.ZodObject<{
721
+ cap_micro_usd: z.ZodNumber;
722
+ max_task_micro_usd: z.ZodNumber;
723
+ period: z.ZodEnum<{
724
+ day: "day";
725
+ week: "week";
726
+ month: "month";
727
+ }>;
728
+ }, z.core.$strip>;
729
+ description: z.ZodOptional<z.ZodString>;
730
+ role: z.ZodOptional<z.ZodString>;
731
+ required: z.ZodOptional<z.ZodBoolean>;
732
+ system: z.ZodOptional<z.ZodString>;
733
+ tools: z.ZodOptional<z.ZodObject<{
734
+ default_config: z.ZodObject<{
735
+ permission: z.ZodEnum<{
736
+ allow: "allow";
737
+ ask: "ask";
738
+ deny: "deny";
739
+ }>;
740
+ }, z.core.$strip>;
741
+ configs: z.ZodRecord<z.ZodString, z.ZodObject<{
742
+ enabled: z.ZodBoolean;
743
+ permission: z.ZodEnum<{
744
+ allow: "allow";
745
+ ask: "ask";
746
+ deny: "deny";
747
+ }>;
748
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
749
+ }, z.core.$strip>>;
750
+ }, z.core.$strip>>;
751
+ skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
752
+ mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
753
+ name: z.ZodString;
754
+ url: z.ZodURL;
755
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
756
+ }, z.core.$strip>>>;
757
+ window: z.ZodOptional<z.ZodEnum<{
758
+ immediate: "immediate";
759
+ priority: "priority";
760
+ loose: "loose";
761
+ }>>;
762
+ multiagent: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
763
+ agents: z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<{
764
+ type: "agent";
765
+ name: string;
766
+ }, string>>, z.ZodObject<{
767
+ type: z.ZodLiteral<"agent">;
768
+ name: z.ZodString;
769
+ version: z.ZodOptional<z.ZodNumber>;
770
+ }, z.core.$strip>, z.ZodObject<{
771
+ type: z.ZodLiteral<"self">;
772
+ }, z.core.$strip>, z.ZodObject<{
773
+ type: z.ZodLiteral<"advisor">;
774
+ model: z.ZodString;
775
+ }, z.core.$strip>]>>;
776
+ type: z.ZodLiteral<"coordinator">;
777
+ board: z.ZodOptional<z.ZodBoolean>;
778
+ }, z.core.$strip>, z.ZodNull]>>;
779
+ output_schema: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
780
+ structured_output_required: z.ZodOptional<z.ZodBoolean>;
781
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
782
+ allowed_apps: z.ZodOptional<z.ZodArray<z.ZodString>>;
783
+ identity: z.ZodOptional<z.ZodString>;
784
+ handoffs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"team">, z.ZodArray<z.ZodString>]>>;
785
+ schedules: z.ZodOptional<z.ZodArray<z.ZodObject<{
786
+ cron: z.ZodString;
787
+ timezone: z.ZodOptional<z.ZodString>;
788
+ input: z.ZodString;
789
+ summary: z.ZodOptional<z.ZodString>;
790
+ budget_micro_usd: z.ZodNumber;
791
+ identity: z.ZodOptional<z.ZodString>;
792
+ enabled: z.ZodOptional<z.ZodBoolean>;
793
+ }, z.core.$strip>>>;
794
+ intake: z.ZodOptional<z.ZodObject<{
795
+ message: z.ZodString;
796
+ budget_micro_usd: z.ZodOptional<z.ZodNumber>;
797
+ }, z.core.$strip>>;
798
+ }, z.core.$strip>>>;
799
+ crew_per_client: z.ZodOptional<z.ZodArray<z.ZodObject<{
800
+ name: z.ZodString;
801
+ role: z.ZodOptional<z.ZodString>;
802
+ description: z.ZodOptional<z.ZodString>;
803
+ }, z.core.$strip>>>;
804
+ tasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
805
+ key: z.ZodString;
806
+ title: z.ZodString;
807
+ body: z.ZodOptional<z.ZodString>;
808
+ assignee: z.ZodOptional<z.ZodString>;
809
+ blocked_by: z.ZodOptional<z.ZodArray<z.ZodString>>;
810
+ }, z.core.$strip>>>;
811
+ removed: z.ZodDefault<z.ZodObject<{
812
+ apps: z.ZodDefault<z.ZodArray<z.ZodString>>;
813
+ agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
814
+ skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
815
+ identities: z.ZodDefault<z.ZodArray<z.ZodString>>;
816
+ vaults: z.ZodDefault<z.ZodArray<z.ZodString>>;
817
+ }, z.core.$strip>>;
818
+ kept: z.ZodDefault<z.ZodObject<{
819
+ agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
820
+ }, z.core.$strip>>;
821
+ }, z.core.$strip>;
822
+ type AppDecl = z.infer<typeof AppDeclSchema>;
823
+ type AgentDecl = z.infer<typeof AgentDeclSchema>;
824
+ type CrewPerClientDecl = NonNullable<ProjectConfig["crew_per_client"]>[number];
825
+ type ScheduleDecl = z.infer<typeof ScheduleDeclSchema>;
826
+ type SkillDecl = z.infer<typeof SkillDeclSchema>;
827
+ type IdentityDecl = z.infer<typeof IdentityDeclSchema>;
828
+ type VaultDecl = z.infer<typeof VaultDeclSchema>;
829
+ type CredentialDecl = z.infer<typeof CredentialDeclSchema>;
830
+ type TaskDecl = z.infer<typeof TaskDeclSchema>;
831
+ type ProjectConfig = z.infer<typeof ProjectSchema>;
832
+ /** Validate an untyped value (a loaded `.json`, an evaluated module) into a frozen project. */
833
+ declare function parseProject(input: unknown): Readonly<ProjectConfig>;
834
+ /** A config, plus the template data modules its blueprint repo carries (`template.ts`). */
835
+ interface DefineInput extends z.input<typeof ProjectSchema> {
836
+ /**
837
+ * Every template this blueprint has — all of them, not just the chosen one. The chosen one's
838
+ * agents become the project's crew; the others are what the switch rule keeps, which is why a
839
+ * repo that carries only some of them is refused: switching would silently narrow.
840
+ */
841
+ templates?: readonly Template[];
842
+ }
843
+ /** The one export a `naive.config.ts` calls. Identity plus validation; the object comes back frozen. */
844
+ declare function defineProject({ templates, ...input }: DefineInput): Readonly<ProjectConfig>;
845
+
846
+ export { type AppDecl as A, BLUEPRINTS as B, type CredentialDecl as C, type DefineInput as D, type IdentityDecl as I, type ProjectConfig as P, type ScheduleDecl as S, type TaskDecl as T, type VaultDecl as V, type AgentDecl as a, BlueprintRefusal as b, type CrewPerClientDecl as c, type SkillDecl as d, type Template as e, type TemplateChoice as f, chooseTemplate as g, defineProject as h, parseProject as p };