@usenaive-sdk/blueprints 0.1.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/dist/index.d.ts +408 -0
- package/dist/index.js +1674 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { VettaClient } from '@usenaive-sdk/vetta';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Blueprints and their templates.
|
|
6
|
+
*
|
|
7
|
+
* A **blueprint** is the machine: screens, `/api/*`, the store, build and deploy, the approval
|
|
8
|
+
* flow. It is one repository, and it is shared across its templates. A **template** is DATA — the
|
|
9
|
+
* crew and its prompts, the tool allow-lists, the kinds of work it files, its schedules, the demo
|
|
10
|
+
* seed and the words its screens print. 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
|
+
/** One kind of work a template files — a deliverable kind, a post kind. `id` is what rows carry. */
|
|
19
|
+
interface TemplateKind {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The data module a blueprint repo exports, one per template it carries. Everything here is data:
|
|
26
|
+
* nothing in it is a function, a component or a route, because those are the blueprint's and are
|
|
27
|
+
* shared. `agents` is the config's own `agents` shape, so a template declares a crew exactly as a
|
|
28
|
+
* hand-written config would — prompts, tool allow-lists and schedules included.
|
|
29
|
+
*/
|
|
30
|
+
interface Template {
|
|
31
|
+
/** Spelled exactly as `defineProject({ template })` and `naive template --template` name it. */
|
|
32
|
+
name: string;
|
|
33
|
+
/** One line for the operator: what this crew does. */
|
|
34
|
+
description: string;
|
|
35
|
+
agents: AgentDecl[];
|
|
36
|
+
/** The kinds this template's queue holds; the screens list them in this order. */
|
|
37
|
+
kinds: TemplateKind[];
|
|
38
|
+
/** The demo rows the store seeds on first run, keyed by collection (`clients`, `posts`, …). */
|
|
39
|
+
seed: Record<string, unknown>;
|
|
40
|
+
/** Every word a screen prints that changes with the template — headings, labels, onboarding copy. */
|
|
41
|
+
words: Record<string, string>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Every blueprint and the templates it carries. `agency` defaults to `blank` — a working agency
|
|
45
|
+
* with no specialism is a safe thing to get by accident. `media` has NO default on purpose: its
|
|
46
|
+
* two crews spend money in different ways, so defaulting one of them is a bill the operator did
|
|
47
|
+
* not choose.
|
|
48
|
+
*/
|
|
49
|
+
declare const BLUEPRINTS: Record<string, {
|
|
50
|
+
templates: readonly string[];
|
|
51
|
+
default?: string;
|
|
52
|
+
}>;
|
|
53
|
+
/** Resolved (a default may have filled it in), or the refusal's own words for the caller to raise. */
|
|
54
|
+
type TemplateChoice = {
|
|
55
|
+
ok: true;
|
|
56
|
+
template: string | undefined;
|
|
57
|
+
} | {
|
|
58
|
+
ok: false;
|
|
59
|
+
message: string;
|
|
60
|
+
};
|
|
61
|
+
/** The one place a `blueprint` / `template` pair is judged — `defineProject` and the CLI share it. */
|
|
62
|
+
declare function chooseTemplate(blueprint: string | undefined, template: string | undefined): TemplateChoice;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* A config that loaded but refuses itself. A distinct class so the loader can tell "the author's
|
|
66
|
+
* declaration is wrong" apart from "the module could not be evaluated" — the two failure modes the
|
|
67
|
+
* old `naive up` collapsed into one, silently.
|
|
68
|
+
*/
|
|
69
|
+
declare class BlueprintRefusal extends Error {
|
|
70
|
+
readonly name = "BlueprintRefusal";
|
|
71
|
+
}
|
|
72
|
+
declare const AppDeclSchema: z.ZodObject<{
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
type: z.ZodEnum<{
|
|
75
|
+
frontend_only: "frontend_only";
|
|
76
|
+
fullstack: "fullstack";
|
|
77
|
+
}>;
|
|
78
|
+
description: z.ZodOptional<z.ZodString>;
|
|
79
|
+
deploy_dir: z.ZodOptional<z.ZodString>;
|
|
80
|
+
mcp: z.ZodOptional<z.ZodString>;
|
|
81
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
82
|
+
from_env: z.ZodString;
|
|
83
|
+
}, z.core.$strip>]>>>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
/**
|
|
86
|
+
* A cron on the agent — a platform deployment (§12) minus what `up` fills in: `agent_id`, and the
|
|
87
|
+
* `identity`, a declared persona *name* like the agent's own. `cron` is the key the reconciler
|
|
88
|
+
* matches live rows by (deployments have no name), so it must be unique within one agent.
|
|
89
|
+
* `budget_micro_usd` has no default on `POST /v1/deployments`, so it is required here for the
|
|
90
|
+
* same reason the agent's `budget` is.
|
|
91
|
+
*/
|
|
92
|
+
declare const ScheduleDeclSchema: z.ZodObject<{
|
|
93
|
+
cron: z.ZodString;
|
|
94
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
95
|
+
input: z.ZodString;
|
|
96
|
+
budget_micro_usd: z.ZodNumber;
|
|
97
|
+
identity: z.ZodOptional<z.ZodString>;
|
|
98
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
/** 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. */
|
|
101
|
+
declare const AgentDeclSchema: z.ZodObject<{
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
model: z.ZodString;
|
|
104
|
+
budget: z.ZodObject<{
|
|
105
|
+
cap_micro_usd: z.ZodNumber;
|
|
106
|
+
max_task_micro_usd: z.ZodNumber;
|
|
107
|
+
period: z.ZodEnum<{
|
|
108
|
+
day: "day";
|
|
109
|
+
week: "week";
|
|
110
|
+
month: "month";
|
|
111
|
+
}>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
description: z.ZodOptional<z.ZodString>;
|
|
114
|
+
system: z.ZodOptional<z.ZodString>;
|
|
115
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
default_config: z.ZodObject<{
|
|
117
|
+
permission: z.ZodEnum<{
|
|
118
|
+
allow: "allow";
|
|
119
|
+
ask: "ask";
|
|
120
|
+
deny: "deny";
|
|
121
|
+
}>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
configs: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
124
|
+
enabled: z.ZodBoolean;
|
|
125
|
+
permission: z.ZodEnum<{
|
|
126
|
+
allow: "allow";
|
|
127
|
+
ask: "ask";
|
|
128
|
+
deny: "deny";
|
|
129
|
+
}>;
|
|
130
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
}, z.core.$strip>>;
|
|
133
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
134
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
135
|
+
name: z.ZodString;
|
|
136
|
+
url: z.ZodURL;
|
|
137
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
138
|
+
}, z.core.$strip>>>;
|
|
139
|
+
allowed_apps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
140
|
+
identity: z.ZodOptional<z.ZodString>;
|
|
141
|
+
schedules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
142
|
+
cron: z.ZodString;
|
|
143
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
144
|
+
input: z.ZodString;
|
|
145
|
+
budget_micro_usd: z.ZodNumber;
|
|
146
|
+
identity: z.ZodOptional<z.ZodString>;
|
|
147
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
}, z.core.$strip>>>;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
/**
|
|
151
|
+
* A vault credential (§23) minus what `up` fills in. `value` is a real third-party secret, so it is
|
|
152
|
+
* `{ from_env }` only — never a literal — and travels once, on create. Values are write-only and
|
|
153
|
+
* rows immutable, so `kind`, `key` and `host` / `mcp_server_url` are all the reconciler can match a
|
|
154
|
+
* live row by.
|
|
155
|
+
*/
|
|
156
|
+
declare const CredentialDeclSchema: z.ZodObject<{
|
|
157
|
+
kind: z.ZodEnum<{
|
|
158
|
+
env_var: "env_var";
|
|
159
|
+
static_bearer: "static_bearer";
|
|
160
|
+
mcp_oauth: "mcp_oauth";
|
|
161
|
+
}>;
|
|
162
|
+
key: z.ZodString;
|
|
163
|
+
host: z.ZodOptional<z.ZodString>;
|
|
164
|
+
mcp_server_url: z.ZodOptional<z.ZodURL>;
|
|
165
|
+
value: z.ZodObject<{
|
|
166
|
+
from_env: z.ZodString;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
/** `name` is the vault's `display_name`, the key it is found by; `identity` a declared persona *name*. */
|
|
170
|
+
declare const VaultDeclSchema: z.ZodObject<{
|
|
171
|
+
name: z.ZodString;
|
|
172
|
+
identity: z.ZodOptional<z.ZodString>;
|
|
173
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
174
|
+
kind: z.ZodEnum<{
|
|
175
|
+
env_var: "env_var";
|
|
176
|
+
static_bearer: "static_bearer";
|
|
177
|
+
mcp_oauth: "mcp_oauth";
|
|
178
|
+
}>;
|
|
179
|
+
key: z.ZodString;
|
|
180
|
+
host: z.ZodOptional<z.ZodString>;
|
|
181
|
+
mcp_server_url: z.ZodOptional<z.ZodURL>;
|
|
182
|
+
value: z.ZodObject<{
|
|
183
|
+
from_env: z.ZodString;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
}, z.core.$strip>;
|
|
187
|
+
/** `file` holds the skill body, resolved against the config's directory; the slug grammar is `POST /v1/skills`' (§13). */
|
|
188
|
+
declare const SkillDeclSchema: z.ZodObject<{
|
|
189
|
+
slug: z.ZodString;
|
|
190
|
+
file: z.ZodString;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
declare const IdentityDeclSchema: z.ZodObject<{
|
|
193
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
194
|
+
name: z.ZodString;
|
|
195
|
+
}, z.core.$strip>;
|
|
196
|
+
declare const ProjectSchema: z.ZodObject<{
|
|
197
|
+
name: z.ZodString;
|
|
198
|
+
blueprint: z.ZodOptional<z.ZodString>;
|
|
199
|
+
template: z.ZodOptional<z.ZodString>;
|
|
200
|
+
skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
201
|
+
slug: z.ZodString;
|
|
202
|
+
file: z.ZodString;
|
|
203
|
+
}, z.core.$strip>>>;
|
|
204
|
+
identities: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
205
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
|
+
name: z.ZodString;
|
|
207
|
+
}, z.core.$strip>>>;
|
|
208
|
+
vaults: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
209
|
+
name: z.ZodString;
|
|
210
|
+
identity: z.ZodOptional<z.ZodString>;
|
|
211
|
+
credentials: z.ZodArray<z.ZodObject<{
|
|
212
|
+
kind: z.ZodEnum<{
|
|
213
|
+
env_var: "env_var";
|
|
214
|
+
static_bearer: "static_bearer";
|
|
215
|
+
mcp_oauth: "mcp_oauth";
|
|
216
|
+
}>;
|
|
217
|
+
key: z.ZodString;
|
|
218
|
+
host: z.ZodOptional<z.ZodString>;
|
|
219
|
+
mcp_server_url: z.ZodOptional<z.ZodURL>;
|
|
220
|
+
value: z.ZodObject<{
|
|
221
|
+
from_env: z.ZodString;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
}, z.core.$strip>>;
|
|
224
|
+
}, z.core.$strip>>>;
|
|
225
|
+
apps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
226
|
+
name: z.ZodString;
|
|
227
|
+
type: z.ZodEnum<{
|
|
228
|
+
frontend_only: "frontend_only";
|
|
229
|
+
fullstack: "fullstack";
|
|
230
|
+
}>;
|
|
231
|
+
description: z.ZodOptional<z.ZodString>;
|
|
232
|
+
deploy_dir: z.ZodOptional<z.ZodString>;
|
|
233
|
+
mcp: z.ZodOptional<z.ZodString>;
|
|
234
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
235
|
+
from_env: z.ZodString;
|
|
236
|
+
}, z.core.$strip>]>>>;
|
|
237
|
+
}, z.core.$strip>>>;
|
|
238
|
+
agents: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
239
|
+
name: z.ZodString;
|
|
240
|
+
model: z.ZodString;
|
|
241
|
+
budget: z.ZodObject<{
|
|
242
|
+
cap_micro_usd: z.ZodNumber;
|
|
243
|
+
max_task_micro_usd: z.ZodNumber;
|
|
244
|
+
period: z.ZodEnum<{
|
|
245
|
+
day: "day";
|
|
246
|
+
week: "week";
|
|
247
|
+
month: "month";
|
|
248
|
+
}>;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
description: z.ZodOptional<z.ZodString>;
|
|
251
|
+
system: z.ZodOptional<z.ZodString>;
|
|
252
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
253
|
+
default_config: z.ZodObject<{
|
|
254
|
+
permission: z.ZodEnum<{
|
|
255
|
+
allow: "allow";
|
|
256
|
+
ask: "ask";
|
|
257
|
+
deny: "deny";
|
|
258
|
+
}>;
|
|
259
|
+
}, z.core.$strip>;
|
|
260
|
+
configs: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
261
|
+
enabled: z.ZodBoolean;
|
|
262
|
+
permission: z.ZodEnum<{
|
|
263
|
+
allow: "allow";
|
|
264
|
+
ask: "ask";
|
|
265
|
+
deny: "deny";
|
|
266
|
+
}>;
|
|
267
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
268
|
+
}, z.core.$strip>>;
|
|
269
|
+
}, z.core.$strip>>;
|
|
270
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
271
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
272
|
+
name: z.ZodString;
|
|
273
|
+
url: z.ZodURL;
|
|
274
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
275
|
+
}, z.core.$strip>>>;
|
|
276
|
+
allowed_apps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
277
|
+
identity: z.ZodOptional<z.ZodString>;
|
|
278
|
+
schedules: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
279
|
+
cron: z.ZodString;
|
|
280
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
281
|
+
input: z.ZodString;
|
|
282
|
+
budget_micro_usd: z.ZodNumber;
|
|
283
|
+
identity: z.ZodOptional<z.ZodString>;
|
|
284
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
285
|
+
}, z.core.$strip>>>;
|
|
286
|
+
}, z.core.$strip>>>;
|
|
287
|
+
removed: z.ZodDefault<z.ZodObject<{
|
|
288
|
+
apps: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
289
|
+
agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
290
|
+
skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
291
|
+
identities: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
292
|
+
vaults: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
kept: z.ZodDefault<z.ZodObject<{
|
|
295
|
+
agents: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
296
|
+
}, z.core.$strip>>;
|
|
297
|
+
}, z.core.$strip>;
|
|
298
|
+
type AppDecl = z.infer<typeof AppDeclSchema>;
|
|
299
|
+
type AgentDecl = z.infer<typeof AgentDeclSchema>;
|
|
300
|
+
type ScheduleDecl = z.infer<typeof ScheduleDeclSchema>;
|
|
301
|
+
type SkillDecl = z.infer<typeof SkillDeclSchema>;
|
|
302
|
+
type IdentityDecl = z.infer<typeof IdentityDeclSchema>;
|
|
303
|
+
type VaultDecl = z.infer<typeof VaultDeclSchema>;
|
|
304
|
+
type CredentialDecl = z.infer<typeof CredentialDeclSchema>;
|
|
305
|
+
type ProjectConfig = z.infer<typeof ProjectSchema>;
|
|
306
|
+
/** Validate an untyped value (a loaded `.json`, an evaluated module) into a frozen project. */
|
|
307
|
+
declare function parseProject(input: unknown): Readonly<ProjectConfig>;
|
|
308
|
+
/** A config, plus the template data modules its blueprint repo carries (`template.ts`). */
|
|
309
|
+
interface DefineInput extends z.input<typeof ProjectSchema> {
|
|
310
|
+
/**
|
|
311
|
+
* Every template this blueprint has — all of them, not just the chosen one. The chosen one's
|
|
312
|
+
* agents become the project's crew; the others are what the switch rule keeps, which is why a
|
|
313
|
+
* repo that carries only some of them is refused: switching would silently narrow.
|
|
314
|
+
*/
|
|
315
|
+
templates?: readonly Template[];
|
|
316
|
+
}
|
|
317
|
+
/** The one export a `naive.config.ts` calls. Identity plus validation; the object comes back frozen. */
|
|
318
|
+
declare function defineProject({ templates, ...input }: DefineInput): Readonly<ProjectConfig>;
|
|
319
|
+
|
|
320
|
+
declare const CONFIG_CANDIDATES: readonly ["naive.config.ts", "naive.config.js", "naive.config.mjs", "naive.config.json"];
|
|
321
|
+
type ConfigLoad = {
|
|
322
|
+
ok: true;
|
|
323
|
+
path: string;
|
|
324
|
+
config: Readonly<ProjectConfig>;
|
|
325
|
+
}
|
|
326
|
+
/** No candidate file exists in the directory. */
|
|
327
|
+
| {
|
|
328
|
+
ok: false;
|
|
329
|
+
reason: "not_found";
|
|
330
|
+
message: string;
|
|
331
|
+
}
|
|
332
|
+
/** The module system could not evaluate the file: the toolchain/deps are missing. */
|
|
333
|
+
| {
|
|
334
|
+
ok: false;
|
|
335
|
+
reason: "unloadable";
|
|
336
|
+
message: string;
|
|
337
|
+
}
|
|
338
|
+
/** The file loaded and its config is wrong — a refusal or a bad shape. Fix the config. */
|
|
339
|
+
| {
|
|
340
|
+
ok: false;
|
|
341
|
+
reason: "invalid";
|
|
342
|
+
message: string;
|
|
343
|
+
};
|
|
344
|
+
declare function loadConfig(dir: string): Promise<ConfigLoad>;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* The report vocabulary `up` speaks (`workstreams/10-blueprints.md §2` item 4) and the handful of
|
|
348
|
+
* client-side moves every resource kind shares: one line per attempt with refusals caught into
|
|
349
|
+
* the report, drift as "a declared field whose live value differs", 404 as "not yet", full
|
|
350
|
+
* cursor pagination, and the by-name tombstone behind `removed`.
|
|
351
|
+
*/
|
|
352
|
+
|
|
353
|
+
type ResourceAction = "created" | "updated" | "unchanged" | "deleted" | "refused";
|
|
354
|
+
interface ResourceReport {
|
|
355
|
+
name: string;
|
|
356
|
+
action: ResourceAction;
|
|
357
|
+
id?: string;
|
|
358
|
+
url?: string | null;
|
|
359
|
+
/** Why, for `refused`; what would happen, for a dry-run line that needs explaining. */
|
|
360
|
+
reason?: string;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* The reconciler behind `naive up` (`workstreams/10-blueprints.md §2`): a pure client of the
|
|
365
|
+
* public REST API through the SDK — upsert-by-name over routes that are already idempotent. No
|
|
366
|
+
* server-side diff engine, no manifest store; re-running is always safe because every resource is
|
|
367
|
+
* keyed by its config name.
|
|
368
|
+
*
|
|
369
|
+
* Nothing is deleted by omission (ADR-0352): `removed` names are the only tombstones, with one
|
|
370
|
+
* bounded exception — a declared agent's `schedules` are owned as a complete set (`agents.ts`).
|
|
371
|
+
* Skills and identities live here; apps, agents and vaults each have their own module, sharing the
|
|
372
|
+
* report vocabulary in `report.ts`.
|
|
373
|
+
*/
|
|
374
|
+
|
|
375
|
+
interface UpReport {
|
|
376
|
+
dry_run: boolean;
|
|
377
|
+
/** The machine, and the template within it whose crew this apply provisioned (`template.ts`). */
|
|
378
|
+
blueprint?: string;
|
|
379
|
+
template?: string;
|
|
380
|
+
skills: ResourceReport[];
|
|
381
|
+
identities: ResourceReport[];
|
|
382
|
+
/** One line per vault, then one per declared credential named `<vault> / <key>`. */
|
|
383
|
+
vaults: ResourceReport[];
|
|
384
|
+
apps: ResourceReport[];
|
|
385
|
+
agents: ResourceReport[];
|
|
386
|
+
/** One line per declared cron and per pruned live row, named `<agent> @ <cron>`. */
|
|
387
|
+
schedules: ResourceReport[];
|
|
388
|
+
/**
|
|
389
|
+
* Live rows this client could not parse, named and stepped over (`report.ts`). One legacy row
|
|
390
|
+
* used to abort the whole apply before any write; it is now a line here and nothing else.
|
|
391
|
+
*/
|
|
392
|
+
skipped: string[];
|
|
393
|
+
}
|
|
394
|
+
interface UpOptions {
|
|
395
|
+
/** Plan only: reads happen, writes do not, and the report says what apply would do. */
|
|
396
|
+
dry_run?: boolean;
|
|
397
|
+
/** Base directory `deploy_dir` is resolved against — the config file's directory. */
|
|
398
|
+
dir?: string;
|
|
399
|
+
/**
|
|
400
|
+
* `naive up --adopt`: take every app this run touches whose row names another project, or none
|
|
401
|
+
* (ADR-0375). Off by default — adopting by default is what overwrote a live deployment.
|
|
402
|
+
*/
|
|
403
|
+
adopt?: boolean;
|
|
404
|
+
}
|
|
405
|
+
/** Plan → apply → report. Every refusal is one line in the report, never a thrown escape. */
|
|
406
|
+
declare function up(config: Readonly<ProjectConfig>, client: VettaClient, opts?: UpOptions): Promise<UpReport>;
|
|
407
|
+
|
|
408
|
+
export { type AgentDecl, type AppDecl, BLUEPRINTS, BlueprintRefusal, CONFIG_CANDIDATES, type ConfigLoad, type CredentialDecl, type DefineInput, type IdentityDecl, type ProjectConfig, type ResourceAction, type ResourceReport, type ScheduleDecl, type SkillDecl, type Template, type TemplateChoice, type TemplateKind, type UpOptions, type UpReport, type VaultDecl, chooseTemplate, defineProject, loadConfig, parseProject, up };
|