@feltdb/feltkit 0.3.10 → 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.
Files changed (110) hide show
  1. package/dist/app.d.ts +86 -3
  2. package/dist/app.js +63 -2
  3. package/dist/app.js.map +1 -1
  4. package/dist/appboundry/build.d.ts +39 -1
  5. package/dist/appboundry/build.js +77 -7
  6. package/dist/appboundry/build.js.map +1 -1
  7. package/dist/appboundry/guest.js +79 -2
  8. package/dist/appboundry/guest.js.map +1 -1
  9. package/dist/appboundry/host.d.ts +44 -0
  10. package/dist/appboundry/host.js +456 -0
  11. package/dist/appboundry/host.js.map +1 -0
  12. package/dist/appboundry/runtime.d.ts +44 -0
  13. package/dist/appboundry/runtime.js +99 -0
  14. package/dist/appboundry/runtime.js.map +1 -0
  15. package/dist/cli/entry.d.ts +1 -0
  16. package/dist/cli/entry.js +4 -0
  17. package/dist/cli/entry.js.map +1 -0
  18. package/dist/cli/main.js +459 -8
  19. package/dist/cli/main.js.map +1 -1
  20. package/dist/cli/skills.d.ts +8 -0
  21. package/dist/cli/skills.js +37 -0
  22. package/dist/cli/skills.js.map +1 -1
  23. package/dist/cli/test-reporter.d.ts +9 -0
  24. package/dist/cli/test-reporter.js +26 -0
  25. package/dist/cli/test-reporter.js.map +1 -0
  26. package/dist/errors.d.ts +7 -1
  27. package/dist/errors.js +1 -0
  28. package/dist/errors.js.map +1 -1
  29. package/dist/index.d.ts +2 -2
  30. package/dist/index.js.map +1 -1
  31. package/dist/platform/changes.d.ts +340 -0
  32. package/dist/platform/changes.js +353 -0
  33. package/dist/platform/changes.js.map +1 -0
  34. package/dist/platform/deployments.d.ts +653 -0
  35. package/dist/platform/deployments.js +530 -0
  36. package/dist/platform/deployments.js.map +1 -0
  37. package/dist/platform/operations.d.ts +74 -0
  38. package/dist/platform/operations.js +198 -0
  39. package/dist/platform/operations.js.map +1 -0
  40. package/dist/platform/platform.d.ts +78 -0
  41. package/dist/platform/platform.js +264 -0
  42. package/dist/platform/platform.js.map +1 -0
  43. package/dist/platform/server.d.ts +25 -0
  44. package/dist/platform/server.js +165 -0
  45. package/dist/platform/server.js.map +1 -0
  46. package/dist/platform/source.d.ts +27 -0
  47. package/dist/platform/source.js +142 -0
  48. package/dist/platform/source.js.map +1 -0
  49. package/dist/runtime/backup-environment.d.ts +25 -0
  50. package/dist/runtime/backup-environment.js +60 -0
  51. package/dist/runtime/backup-environment.js.map +1 -0
  52. package/dist/runtime/backup.d.ts +87 -0
  53. package/dist/runtime/backup.js +175 -0
  54. package/dist/runtime/backup.js.map +1 -0
  55. package/dist/runtime/capabilities.d.ts +1 -1
  56. package/dist/runtime/capabilities.js +19 -2
  57. package/dist/runtime/capabilities.js.map +1 -1
  58. package/dist/runtime/context.d.ts +7 -0
  59. package/dist/runtime/contract.js +5 -1
  60. package/dist/runtime/contract.js.map +1 -1
  61. package/dist/runtime/data.d.ts +28 -0
  62. package/dist/runtime/data.js +49 -1
  63. package/dist/runtime/data.js.map +1 -1
  64. package/dist/runtime/instance.js +17 -0
  65. package/dist/runtime/instance.js.map +1 -1
  66. package/dist/runtime/loader.js +6 -2
  67. package/dist/runtime/loader.js.map +1 -1
  68. package/dist/runtime/migration-context.d.ts +25 -0
  69. package/dist/runtime/migration-context.js +69 -0
  70. package/dist/runtime/migration-context.js.map +1 -0
  71. package/dist/runtime/outbox.d.ts +7 -0
  72. package/dist/runtime/outbox.js +47 -0
  73. package/dist/runtime/outbox.js.map +1 -0
  74. package/dist/runtime/readiness.js +12 -0
  75. package/dist/runtime/readiness.js.map +1 -1
  76. package/dist/runtime/runtime.d.ts +65 -1
  77. package/dist/runtime/runtime.js +380 -66
  78. package/dist/runtime/runtime.js.map +1 -1
  79. package/dist/runtime/services.d.ts +30 -0
  80. package/dist/runtime/services.js +82 -1
  81. package/dist/runtime/services.js.map +1 -1
  82. package/dist/runtime/state-contract.d.ts +167 -0
  83. package/dist/runtime/state-contract.js +438 -0
  84. package/dist/runtime/state-contract.js.map +1 -0
  85. package/dist/runtime/transactions.d.ts +199 -0
  86. package/dist/runtime/transactions.js +246 -0
  87. package/dist/runtime/transactions.js.map +1 -0
  88. package/dist/schema.d.ts +42 -2
  89. package/dist/schema.js +58 -2
  90. package/dist/schema.js.map +1 -1
  91. package/dist/server/admin.d.ts +1 -0
  92. package/dist/server/admin.js +27 -0
  93. package/dist/server/admin.js.map +1 -1
  94. package/dist/server/index.d.ts +4 -0
  95. package/dist/server/index.js +45 -1
  96. package/dist/server/index.js.map +1 -1
  97. package/dist/server/project.d.ts +5 -0
  98. package/dist/server/project.js +13 -2
  99. package/dist/server/project.js.map +1 -1
  100. package/dist/testing/index.d.ts +24 -0
  101. package/dist/testing/index.js +31 -0
  102. package/dist/testing/index.js.map +1 -1
  103. package/package.json +5 -5
  104. package/skills/.claude-plugin/marketplace.json +1 -1
  105. package/skills/.claude-plugin/plugin.json +1 -1
  106. package/skills/feltkit-agent/SKILL.md +1 -1
  107. package/skills/feltkit-build/SKILL.md +33 -2
  108. package/skills/feltkit-data/SKILL.md +12 -1
  109. package/skills/feltkit-operations/SKILL.md +1 -1
  110. package/skills/feltkit-services/SKILL.md +22 -2
@@ -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 {};