@feltdb/feltkit 0.3.11 → 0.3.12
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/app.d.ts +80 -3
- package/dist/app.js +41 -0
- package/dist/app.js.map +1 -1
- package/dist/appboundry/build.d.ts +39 -1
- package/dist/appboundry/build.js +47 -4
- package/dist/appboundry/build.js.map +1 -1
- package/dist/appboundry/guest.js +46 -5
- package/dist/appboundry/guest.js.map +1 -1
- package/dist/appboundry/host.d.ts +24 -5
- package/dist/appboundry/host.js +234 -141
- package/dist/appboundry/host.js.map +1 -1
- package/dist/appboundry/runtime.d.ts +44 -0
- package/dist/appboundry/runtime.js +99 -0
- package/dist/appboundry/runtime.js.map +1 -0
- package/dist/cli/entry.d.ts +1 -0
- package/dist/cli/entry.js +4 -0
- package/dist/cli/entry.js.map +1 -0
- package/dist/cli/main.js +445 -7
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/test-reporter.d.ts +9 -0
- package/dist/cli/test-reporter.js +26 -0
- package/dist/cli/test-reporter.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/platform/changes.d.ts +340 -0
- package/dist/platform/changes.js +353 -0
- package/dist/platform/changes.js.map +1 -0
- package/dist/platform/deployments.d.ts +653 -0
- package/dist/platform/deployments.js +530 -0
- package/dist/platform/deployments.js.map +1 -0
- package/dist/platform/operations.d.ts +74 -0
- package/dist/platform/operations.js +198 -0
- package/dist/platform/operations.js.map +1 -0
- package/dist/platform/platform.d.ts +78 -0
- package/dist/platform/platform.js +264 -0
- package/dist/platform/platform.js.map +1 -0
- package/dist/platform/server.d.ts +25 -0
- package/dist/platform/server.js +165 -0
- package/dist/platform/server.js.map +1 -0
- package/dist/platform/source.d.ts +27 -0
- package/dist/platform/source.js +142 -0
- package/dist/platform/source.js.map +1 -0
- package/dist/runtime/backup-environment.d.ts +25 -0
- package/dist/runtime/backup-environment.js +60 -0
- package/dist/runtime/backup-environment.js.map +1 -0
- package/dist/runtime/backup.d.ts +87 -0
- package/dist/runtime/backup.js +175 -0
- package/dist/runtime/backup.js.map +1 -0
- package/dist/runtime/contract.js +4 -3
- package/dist/runtime/contract.js.map +1 -1
- package/dist/runtime/data.d.ts +6 -2
- package/dist/runtime/data.js +29 -23
- package/dist/runtime/data.js.map +1 -1
- package/dist/runtime/instance.js +17 -0
- package/dist/runtime/instance.js.map +1 -1
- package/dist/runtime/loader.js +6 -2
- package/dist/runtime/loader.js.map +1 -1
- package/dist/runtime/migration-context.d.ts +25 -0
- package/dist/runtime/migration-context.js +69 -0
- package/dist/runtime/migration-context.js.map +1 -0
- package/dist/runtime/outbox.d.ts +6 -82
- package/dist/runtime/outbox.js +14 -59
- package/dist/runtime/outbox.js.map +1 -1
- package/dist/runtime/readiness.js +12 -0
- package/dist/runtime/readiness.js.map +1 -1
- package/dist/runtime/runtime.d.ts +60 -2
- package/dist/runtime/runtime.js +301 -116
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/services.d.ts +22 -0
- package/dist/runtime/services.js +35 -0
- package/dist/runtime/services.js.map +1 -1
- package/dist/runtime/state-contract.d.ts +167 -0
- package/dist/runtime/state-contract.js +438 -0
- package/dist/runtime/state-contract.js.map +1 -0
- package/dist/runtime/transactions.d.ts +199 -0
- package/dist/runtime/transactions.js +246 -0
- package/dist/runtime/transactions.js.map +1 -0
- package/dist/schema.d.ts +13 -1
- package/dist/schema.js +21 -2
- package/dist/schema.js.map +1 -1
- package/dist/server/admin.d.ts +1 -0
- package/dist/server/admin.js +27 -0
- package/dist/server/admin.js.map +1 -1
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +45 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/project.d.ts +5 -0
- package/dist/server/project.js +13 -2
- package/dist/server/project.js.map +1 -1
- package/dist/testing/index.d.ts +4 -1
- package/dist/testing/index.js +5 -3
- package/dist/testing/index.js.map +1 -1
- package/package.json +3 -3
- package/skills/.claude-plugin/marketplace.json +1 -1
- package/skills/.claude-plugin/plugin.json +1 -1
- package/skills/feltkit-build/SKILL.md +6 -3
- package/skills/feltkit-data/SKILL.md +11 -0
- package/skills/feltkit-services/SKILL.md +6 -4
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import type { StateFirstDB } from "@feltdb/core";
|
|
2
|
+
import type { Principal } from "../runtime/authority.js";
|
|
3
|
+
import { type SourceFile } from "./source.js";
|
|
4
|
+
export declare const CHANGES = "feltkit.platform.changes";
|
|
5
|
+
export declare const CHANGE_EVENTS = "feltkit.platform.change-events";
|
|
6
|
+
/** Environments a change set can target. Local production (the `container` deploy target) first. */
|
|
7
|
+
export declare const CHANGE_ENVIRONMENTS: readonly ["production"];
|
|
8
|
+
export type ChangeStatus = "proposed" | "verifying" | "verified" | "verification_failed" | "applying" | "applied" | "apply_failed";
|
|
9
|
+
export interface Caller {
|
|
10
|
+
principal: Principal;
|
|
11
|
+
decisionId: string;
|
|
12
|
+
requestId: string;
|
|
13
|
+
}
|
|
14
|
+
/** Deploys the project's source as it now is (deployments.ts); throws after rolling back. */
|
|
15
|
+
export type Deploy = (input: {
|
|
16
|
+
project: string;
|
|
17
|
+
projectDir: string;
|
|
18
|
+
environment: string;
|
|
19
|
+
kind: "change";
|
|
20
|
+
source: {
|
|
21
|
+
revision: string;
|
|
22
|
+
contentDigest: string;
|
|
23
|
+
changeId: string;
|
|
24
|
+
};
|
|
25
|
+
}, caller: Caller) => Promise<{
|
|
26
|
+
receipt: Record<string, unknown> & {
|
|
27
|
+
deploymentId: string;
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
30
|
+
type Cli = (cwd: string, args: string[]) => Promise<{
|
|
31
|
+
code: number;
|
|
32
|
+
json: unknown;
|
|
33
|
+
stderr: string;
|
|
34
|
+
stdout: string;
|
|
35
|
+
}>;
|
|
36
|
+
/** A test seam: called at named points; throwing `Interrupted` there simulates the process stopping. */
|
|
37
|
+
export type FaultHook = (point: "verify.started" | "apply.started" | "apply.written" | "apply.deployed") => void;
|
|
38
|
+
/** Thrown by a fault hook: the operation stops where it is, with no cleanup, as a crash would. */
|
|
39
|
+
export declare class Interrupted extends Error {
|
|
40
|
+
constructor(point: string);
|
|
41
|
+
}
|
|
42
|
+
interface Verification {
|
|
43
|
+
id: string;
|
|
44
|
+
attempt: number;
|
|
45
|
+
contentDigest: string;
|
|
46
|
+
baseRevision: string;
|
|
47
|
+
/** The workspace's source revision with the change written: what an apply must reproduce. */
|
|
48
|
+
resultRevision: string;
|
|
49
|
+
passed: boolean;
|
|
50
|
+
startedAt: string;
|
|
51
|
+
finishedAt: string;
|
|
52
|
+
build: {
|
|
53
|
+
ok: boolean;
|
|
54
|
+
bundleSha256?: string;
|
|
55
|
+
schemaHash?: string;
|
|
56
|
+
error?: string;
|
|
57
|
+
};
|
|
58
|
+
tests: {
|
|
59
|
+
ok: boolean;
|
|
60
|
+
passed: number;
|
|
61
|
+
failed: number;
|
|
62
|
+
skipped: number;
|
|
63
|
+
failures: unknown[];
|
|
64
|
+
error?: string;
|
|
65
|
+
} | {
|
|
66
|
+
ok: false;
|
|
67
|
+
skipped: true;
|
|
68
|
+
reason: string;
|
|
69
|
+
};
|
|
70
|
+
schema: {
|
|
71
|
+
ok: boolean;
|
|
72
|
+
status: string;
|
|
73
|
+
source: string;
|
|
74
|
+
changes: unknown[];
|
|
75
|
+
reason?: string;
|
|
76
|
+
error?: string;
|
|
77
|
+
};
|
|
78
|
+
by: string;
|
|
79
|
+
decisionId: string;
|
|
80
|
+
}
|
|
81
|
+
interface Receipt {
|
|
82
|
+
id: string;
|
|
83
|
+
changeId: string;
|
|
84
|
+
project: string;
|
|
85
|
+
environment: string;
|
|
86
|
+
baseRevision: string;
|
|
87
|
+
revision: string;
|
|
88
|
+
contentDigest: string;
|
|
89
|
+
verificationId: string;
|
|
90
|
+
/** The deployment's own receipt: artifact and live verification of the running process. */
|
|
91
|
+
deployment: Record<string, unknown> & {
|
|
92
|
+
deploymentId: string;
|
|
93
|
+
};
|
|
94
|
+
appliedBy: string;
|
|
95
|
+
delegatedBy: string | null;
|
|
96
|
+
decisionIds: string[];
|
|
97
|
+
appliedAt: string;
|
|
98
|
+
}
|
|
99
|
+
interface ChangeRecord {
|
|
100
|
+
id: string;
|
|
101
|
+
project: string;
|
|
102
|
+
environment: string;
|
|
103
|
+
baseRevision: string;
|
|
104
|
+
files: SourceFile[];
|
|
105
|
+
contentDigest: string;
|
|
106
|
+
summary: string;
|
|
107
|
+
status: ChangeStatus;
|
|
108
|
+
proposedBy: {
|
|
109
|
+
id: string;
|
|
110
|
+
type: string;
|
|
111
|
+
};
|
|
112
|
+
proposedAt: string;
|
|
113
|
+
updatedAt: string;
|
|
114
|
+
events: number;
|
|
115
|
+
verifications: number;
|
|
116
|
+
verification: Verification | null;
|
|
117
|
+
attempt: {
|
|
118
|
+
id: string;
|
|
119
|
+
previous: SourceFile[];
|
|
120
|
+
startedAt: string;
|
|
121
|
+
by: string;
|
|
122
|
+
decisionId: string;
|
|
123
|
+
} | null;
|
|
124
|
+
receipt: Receipt | null;
|
|
125
|
+
__version?: number;
|
|
126
|
+
}
|
|
127
|
+
export declare class ChangeSets {
|
|
128
|
+
#private;
|
|
129
|
+
/** Recovery of transitions interrupted by a previous stop; every operation waits for it. */
|
|
130
|
+
readonly ready: Promise<{
|
|
131
|
+
recovered: string[];
|
|
132
|
+
}>;
|
|
133
|
+
constructor(db: StateFirstDB, options: {
|
|
134
|
+
workspaces: string;
|
|
135
|
+
cli: Cli;
|
|
136
|
+
deploy: Deploy;
|
|
137
|
+
fault?: FaultHook;
|
|
138
|
+
projectDir: (project: string) => string;
|
|
139
|
+
});
|
|
140
|
+
view(record: ChangeRecord, options?: {
|
|
141
|
+
content?: boolean;
|
|
142
|
+
currentRevision?: string;
|
|
143
|
+
}): {
|
|
144
|
+
contentDigest: string;
|
|
145
|
+
files: {
|
|
146
|
+
content?: string | null | undefined;
|
|
147
|
+
bytes?: number | undefined;
|
|
148
|
+
sha256?: string | undefined;
|
|
149
|
+
path: string;
|
|
150
|
+
kind: string;
|
|
151
|
+
change: string;
|
|
152
|
+
}[];
|
|
153
|
+
affected: {
|
|
154
|
+
kinds: string[];
|
|
155
|
+
schema: {
|
|
156
|
+
status: string;
|
|
157
|
+
changes: unknown[];
|
|
158
|
+
} | null;
|
|
159
|
+
};
|
|
160
|
+
proposedBy: {
|
|
161
|
+
id: string;
|
|
162
|
+
type: string;
|
|
163
|
+
};
|
|
164
|
+
proposedAt: string;
|
|
165
|
+
updatedAt: string;
|
|
166
|
+
verification: Verification | null;
|
|
167
|
+
receipt: Receipt | null;
|
|
168
|
+
currentRevision?: string | undefined;
|
|
169
|
+
stale?: boolean | undefined;
|
|
170
|
+
id: string;
|
|
171
|
+
project: string;
|
|
172
|
+
environment: string;
|
|
173
|
+
status: ChangeStatus;
|
|
174
|
+
summary: string;
|
|
175
|
+
baseRevision: string;
|
|
176
|
+
};
|
|
177
|
+
propose(input: {
|
|
178
|
+
project: string;
|
|
179
|
+
projectDir: string;
|
|
180
|
+
environment: string;
|
|
181
|
+
files: unknown;
|
|
182
|
+
summary?: string;
|
|
183
|
+
idempotencyKey?: string;
|
|
184
|
+
}, caller: Caller): Promise<{
|
|
185
|
+
change: {
|
|
186
|
+
contentDigest: string;
|
|
187
|
+
files: {
|
|
188
|
+
content?: string | null | undefined;
|
|
189
|
+
bytes?: number | undefined;
|
|
190
|
+
sha256?: string | undefined;
|
|
191
|
+
path: string;
|
|
192
|
+
kind: string;
|
|
193
|
+
change: string;
|
|
194
|
+
}[];
|
|
195
|
+
affected: {
|
|
196
|
+
kinds: string[];
|
|
197
|
+
schema: {
|
|
198
|
+
status: string;
|
|
199
|
+
changes: unknown[];
|
|
200
|
+
} | null;
|
|
201
|
+
};
|
|
202
|
+
proposedBy: {
|
|
203
|
+
id: string;
|
|
204
|
+
type: string;
|
|
205
|
+
};
|
|
206
|
+
proposedAt: string;
|
|
207
|
+
updatedAt: string;
|
|
208
|
+
verification: Verification | null;
|
|
209
|
+
receipt: Receipt | null;
|
|
210
|
+
currentRevision?: string | undefined;
|
|
211
|
+
stale?: boolean | undefined;
|
|
212
|
+
id: string;
|
|
213
|
+
project: string;
|
|
214
|
+
environment: string;
|
|
215
|
+
status: ChangeStatus;
|
|
216
|
+
summary: string;
|
|
217
|
+
baseRevision: string;
|
|
218
|
+
};
|
|
219
|
+
replayed: boolean;
|
|
220
|
+
}>;
|
|
221
|
+
inspect(id: string, project: string, projectDir: string): Promise<{
|
|
222
|
+
change: {
|
|
223
|
+
contentDigest: string;
|
|
224
|
+
files: {
|
|
225
|
+
content?: string | null | undefined;
|
|
226
|
+
bytes?: number | undefined;
|
|
227
|
+
sha256?: string | undefined;
|
|
228
|
+
path: string;
|
|
229
|
+
kind: string;
|
|
230
|
+
change: string;
|
|
231
|
+
}[];
|
|
232
|
+
affected: {
|
|
233
|
+
kinds: string[];
|
|
234
|
+
schema: {
|
|
235
|
+
status: string;
|
|
236
|
+
changes: unknown[];
|
|
237
|
+
} | null;
|
|
238
|
+
};
|
|
239
|
+
proposedBy: {
|
|
240
|
+
id: string;
|
|
241
|
+
type: string;
|
|
242
|
+
};
|
|
243
|
+
proposedAt: string;
|
|
244
|
+
updatedAt: string;
|
|
245
|
+
verification: Verification | null;
|
|
246
|
+
receipt: Receipt | null;
|
|
247
|
+
currentRevision?: string | undefined;
|
|
248
|
+
stale?: boolean | undefined;
|
|
249
|
+
id: string;
|
|
250
|
+
project: string;
|
|
251
|
+
environment: string;
|
|
252
|
+
status: ChangeStatus;
|
|
253
|
+
summary: string;
|
|
254
|
+
baseRevision: string;
|
|
255
|
+
};
|
|
256
|
+
history: {
|
|
257
|
+
[k: string]: unknown;
|
|
258
|
+
}[];
|
|
259
|
+
}>;
|
|
260
|
+
verify(id: string, project: string, projectDir: string, caller: Caller): Promise<{
|
|
261
|
+
change: {
|
|
262
|
+
contentDigest: string;
|
|
263
|
+
files: {
|
|
264
|
+
content?: string | null | undefined;
|
|
265
|
+
bytes?: number | undefined;
|
|
266
|
+
sha256?: string | undefined;
|
|
267
|
+
path: string;
|
|
268
|
+
kind: string;
|
|
269
|
+
change: string;
|
|
270
|
+
}[];
|
|
271
|
+
affected: {
|
|
272
|
+
kinds: string[];
|
|
273
|
+
schema: {
|
|
274
|
+
status: string;
|
|
275
|
+
changes: unknown[];
|
|
276
|
+
} | null;
|
|
277
|
+
};
|
|
278
|
+
proposedBy: {
|
|
279
|
+
id: string;
|
|
280
|
+
type: string;
|
|
281
|
+
};
|
|
282
|
+
proposedAt: string;
|
|
283
|
+
updatedAt: string;
|
|
284
|
+
verification: Verification | null;
|
|
285
|
+
receipt: Receipt | null;
|
|
286
|
+
currentRevision?: string | undefined;
|
|
287
|
+
stale?: boolean | undefined;
|
|
288
|
+
id: string;
|
|
289
|
+
project: string;
|
|
290
|
+
environment: string;
|
|
291
|
+
status: ChangeStatus;
|
|
292
|
+
summary: string;
|
|
293
|
+
baseRevision: string;
|
|
294
|
+
};
|
|
295
|
+
verification: Verification;
|
|
296
|
+
}>;
|
|
297
|
+
apply(id: string, input: {
|
|
298
|
+
project: string;
|
|
299
|
+
environment: string;
|
|
300
|
+
expectedContentDigest?: string;
|
|
301
|
+
}, projectDir: string, caller: Caller): Promise<{
|
|
302
|
+
change: {
|
|
303
|
+
contentDigest: string;
|
|
304
|
+
files: {
|
|
305
|
+
content?: string | null | undefined;
|
|
306
|
+
bytes?: number | undefined;
|
|
307
|
+
sha256?: string | undefined;
|
|
308
|
+
path: string;
|
|
309
|
+
kind: string;
|
|
310
|
+
change: string;
|
|
311
|
+
}[];
|
|
312
|
+
affected: {
|
|
313
|
+
kinds: string[];
|
|
314
|
+
schema: {
|
|
315
|
+
status: string;
|
|
316
|
+
changes: unknown[];
|
|
317
|
+
} | null;
|
|
318
|
+
};
|
|
319
|
+
proposedBy: {
|
|
320
|
+
id: string;
|
|
321
|
+
type: string;
|
|
322
|
+
};
|
|
323
|
+
proposedAt: string;
|
|
324
|
+
updatedAt: string;
|
|
325
|
+
verification: Verification | null;
|
|
326
|
+
receipt: Receipt | null;
|
|
327
|
+
currentRevision?: string | undefined;
|
|
328
|
+
stale?: boolean | undefined;
|
|
329
|
+
id: string;
|
|
330
|
+
project: string;
|
|
331
|
+
environment: string;
|
|
332
|
+
status: ChangeStatus;
|
|
333
|
+
summary: string;
|
|
334
|
+
baseRevision: string;
|
|
335
|
+
};
|
|
336
|
+
receipt: Receipt;
|
|
337
|
+
replayed: boolean;
|
|
338
|
+
}>;
|
|
339
|
+
}
|
|
340
|
+
export {};
|