@astrale-os/kernel-core 1.0.0-beta.4 → 1.0.0-beta.6

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 (25) hide show
  1. package/dist/callable/invocation/result.d.ts +8 -1
  2. package/dist/schema/callables/execution.d.ts +300 -0
  3. package/dist/schema/callables/function.js +2 -1
  4. package/dist/schema/kernel/schema.d.ts +435 -17
  5. package/dist/schema/kernel/syscalls/contracts/execution.d.ts +241 -1
  6. package/dist/schema/kernel/syscalls/contracts/execution.js +77 -7
  7. package/dist/schema/kernel/syscalls/contracts/index.d.ts +2 -2
  8. package/dist/schema/kernel/syscalls/contracts/index.js +2 -2
  9. package/dist/schema/kernel/syscalls/contracts/install.d.ts +160 -0
  10. package/dist/schema/kernel/syscalls/contracts/install.js +48 -2
  11. package/dist/schema/kernel/syscalls/contracts/installation.d.ts +5 -0
  12. package/dist/schema/kernel/syscalls/contracts/installation.js +1 -1
  13. package/dist/schema/kernel/syscalls/contracts/query.d.ts +7 -0
  14. package/dist/schema/kernel/syscalls/contracts/query.js +8 -1
  15. package/dist/schema/kernel/syscalls/contracts/uninstall.d.ts +1 -0
  16. package/dist/schema/kernel/syscalls/contracts/uninstall.js +1 -0
  17. package/dist/schema/kernel/syscalls/declarations/execution.d.ts +150 -0
  18. package/dist/schema/kernel/syscalls/declarations/index.d.ts +212 -3
  19. package/dist/schema/kernel/syscalls/declarations/install.d.ts +58 -2
  20. package/dist/schema/kernel/syscalls/declarations/install.js +6 -4
  21. package/dist/schema/kernel/syscalls/declarations/query.d.ts +1 -0
  22. package/dist/schema/kernel/syscalls/declarations/uninstall.d.ts +3 -1
  23. package/dist/schema/kernel/syscalls/declarations/uninstall.js +2 -0
  24. package/dist/schema/kernel/syscalls/descriptors/execution.d.ts +150 -0
  25. package/package.json +1 -1
@@ -1,5 +1,9 @@
1
+ import type { NodeId } from '@astrale-os/kernel-core/graph/node';
1
2
  import type { BinaryOutput } from '../contract/index.js';
2
- /** Successful callable output modes parameterized by the owner's stream capability. */
3
+ /**
4
+ * Successful result of invoking a callable: its output in the declared mode, or the Execution a
5
+ * durable callable started, whose outcome later carries that output.
6
+ */
3
7
  export type CallableResult<Output, Stream extends AsyncIterable<Output>> = {
4
8
  readonly kind: 'value';
5
9
  readonly value: Output;
@@ -9,4 +13,7 @@ export type CallableResult<Output, Stream extends AsyncIterable<Output>> = {
9
13
  } | {
10
14
  readonly kind: 'binary';
11
15
  readonly value: BinaryOutput;
16
+ } | {
17
+ readonly kind: 'execution';
18
+ readonly execution: NodeId;
12
19
  };
@@ -50,6 +50,39 @@ export declare const Execution: builder.NodeClass<{
50
50
  version: string;
51
51
  state: "cancelled" | "completed" | "expired" | "failed" | "paused" | "pending" | "running" | "waiting";
52
52
  createdAt: string;
53
+ detail?: {
54
+ phase: "activating" | "attempting" | "awaiting" | "cancelled" | "classifying" | "completed" | "draining" | "rejected" | "validating";
55
+ class?: "immediate" | "noop" | "revalidate" | undefined;
56
+ mode?: "maintenance" | "online" | undefined;
57
+ validation?: {
58
+ scope: "full" | "incremental";
59
+ counts: "exact" | "sample";
60
+ } | undefined;
61
+ progress?: {
62
+ pages: number;
63
+ interruptions: number;
64
+ } | undefined;
65
+ instance?: "attempt" | "draining" | "open" | "repair" | undefined;
66
+ command?: number | undefined;
67
+ expires?: number | undefined;
68
+ attempt?: {
69
+ number: number;
70
+ destination: "previous" | "target";
71
+ } | undefined;
72
+ report?: {
73
+ attempt: number;
74
+ destination: "previous" | "target";
75
+ result: "aborted" | "interrupted" | "migration-required";
76
+ reason?: string | undefined;
77
+ summary?: unknown;
78
+ } | undefined;
79
+ uncertified?: {
80
+ since: number;
81
+ session?: string | undefined;
82
+ operator?: string | undefined;
83
+ reason?: string | undefined;
84
+ } | undefined;
85
+ } | undefined;
53
86
  outcome?: {
54
87
  kind: "completed";
55
88
  value: unknown;
@@ -64,6 +97,23 @@ export declare const Execution: builder.NodeClass<{
64
97
  } | {
65
98
  kind: "cancelled";
66
99
  } | undefined;
100
+ } | {
101
+ id: string;
102
+ state: "deleted";
103
+ outcome: {
104
+ kind: "completed";
105
+ value: unknown;
106
+ } | {
107
+ kind: "failed";
108
+ error: {
109
+ code: string;
110
+ message: string;
111
+ family?: string | undefined;
112
+ details?: unknown;
113
+ };
114
+ } | {
115
+ kind: "cancelled";
116
+ };
67
117
  };
68
118
  }, "authenticated", false, false, undefined>>;
69
119
  result: builder.Method<builder.CallableProjection<{
@@ -95,6 +145,39 @@ export declare const Execution: builder.NodeClass<{
95
145
  version: string;
96
146
  state: "cancelled" | "completed" | "expired" | "failed" | "paused" | "pending" | "running" | "waiting";
97
147
  createdAt: string;
148
+ detail?: {
149
+ phase: "activating" | "attempting" | "awaiting" | "cancelled" | "classifying" | "completed" | "draining" | "rejected" | "validating";
150
+ class?: "immediate" | "noop" | "revalidate" | undefined;
151
+ mode?: "maintenance" | "online" | undefined;
152
+ validation?: {
153
+ scope: "full" | "incremental";
154
+ counts: "exact" | "sample";
155
+ } | undefined;
156
+ progress?: {
157
+ pages: number;
158
+ interruptions: number;
159
+ } | undefined;
160
+ instance?: "attempt" | "draining" | "open" | "repair" | undefined;
161
+ command?: number | undefined;
162
+ expires?: number | undefined;
163
+ attempt?: {
164
+ number: number;
165
+ destination: "previous" | "target";
166
+ } | undefined;
167
+ report?: {
168
+ attempt: number;
169
+ destination: "previous" | "target";
170
+ result: "aborted" | "interrupted" | "migration-required";
171
+ reason?: string | undefined;
172
+ summary?: unknown;
173
+ } | undefined;
174
+ uncertified?: {
175
+ since: number;
176
+ session?: string | undefined;
177
+ operator?: string | undefined;
178
+ reason?: string | undefined;
179
+ } | undefined;
180
+ } | undefined;
98
181
  outcome?: {
99
182
  kind: "completed";
100
183
  value: unknown;
@@ -109,6 +192,23 @@ export declare const Execution: builder.NodeClass<{
109
192
  } | {
110
193
  kind: "cancelled";
111
194
  } | undefined;
195
+ } | {
196
+ id: string;
197
+ state: "deleted";
198
+ outcome: {
199
+ kind: "completed";
200
+ value: unknown;
201
+ } | {
202
+ kind: "failed";
203
+ error: {
204
+ code: string;
205
+ message: string;
206
+ family?: string | undefined;
207
+ details?: unknown;
208
+ };
209
+ } | {
210
+ kind: "cancelled";
211
+ };
112
212
  };
113
213
  }, "authenticated", false, false, undefined>>;
114
214
  signal: builder.Method<builder.CallableProjection<{
@@ -126,6 +226,39 @@ export declare const Execution: builder.NodeClass<{
126
226
  version: string;
127
227
  state: "cancelled" | "completed" | "expired" | "failed" | "paused" | "pending" | "running" | "waiting";
128
228
  createdAt: string;
229
+ detail?: {
230
+ phase: "activating" | "attempting" | "awaiting" | "cancelled" | "classifying" | "completed" | "draining" | "rejected" | "validating";
231
+ class?: "immediate" | "noop" | "revalidate" | undefined;
232
+ mode?: "maintenance" | "online" | undefined;
233
+ validation?: {
234
+ scope: "full" | "incremental";
235
+ counts: "exact" | "sample";
236
+ } | undefined;
237
+ progress?: {
238
+ pages: number;
239
+ interruptions: number;
240
+ } | undefined;
241
+ instance?: "attempt" | "draining" | "open" | "repair" | undefined;
242
+ command?: number | undefined;
243
+ expires?: number | undefined;
244
+ attempt?: {
245
+ number: number;
246
+ destination: "previous" | "target";
247
+ } | undefined;
248
+ report?: {
249
+ attempt: number;
250
+ destination: "previous" | "target";
251
+ result: "aborted" | "interrupted" | "migration-required";
252
+ reason?: string | undefined;
253
+ summary?: unknown;
254
+ } | undefined;
255
+ uncertified?: {
256
+ since: number;
257
+ session?: string | undefined;
258
+ operator?: string | undefined;
259
+ reason?: string | undefined;
260
+ } | undefined;
261
+ } | undefined;
129
262
  outcome?: {
130
263
  kind: "completed";
131
264
  value: unknown;
@@ -140,6 +273,23 @@ export declare const Execution: builder.NodeClass<{
140
273
  } | {
141
274
  kind: "cancelled";
142
275
  } | undefined;
276
+ } | {
277
+ id: string;
278
+ state: "deleted";
279
+ outcome: {
280
+ kind: "completed";
281
+ value: unknown;
282
+ } | {
283
+ kind: "failed";
284
+ error: {
285
+ code: string;
286
+ message: string;
287
+ family?: string | undefined;
288
+ details?: unknown;
289
+ };
290
+ } | {
291
+ kind: "cancelled";
292
+ };
143
293
  };
144
294
  }, "authenticated", false, false, undefined>>;
145
295
  delete: builder.Method<builder.CallableProjection<Record<string, never>, {
@@ -177,6 +327,39 @@ export declare const Execution: builder.NodeClass<{
177
327
  version: string;
178
328
  state: "cancelled" | "completed" | "expired" | "failed" | "paused" | "pending" | "running" | "waiting";
179
329
  createdAt: string;
330
+ detail?: {
331
+ phase: "activating" | "attempting" | "awaiting" | "cancelled" | "classifying" | "completed" | "draining" | "rejected" | "validating";
332
+ class?: "immediate" | "noop" | "revalidate" | undefined;
333
+ mode?: "maintenance" | "online" | undefined;
334
+ validation?: {
335
+ scope: "full" | "incremental";
336
+ counts: "exact" | "sample";
337
+ } | undefined;
338
+ progress?: {
339
+ pages: number;
340
+ interruptions: number;
341
+ } | undefined;
342
+ instance?: "attempt" | "draining" | "open" | "repair" | undefined;
343
+ command?: number | undefined;
344
+ expires?: number | undefined;
345
+ attempt?: {
346
+ number: number;
347
+ destination: "previous" | "target";
348
+ } | undefined;
349
+ report?: {
350
+ attempt: number;
351
+ destination: "previous" | "target";
352
+ result: "aborted" | "interrupted" | "migration-required";
353
+ reason?: string | undefined;
354
+ summary?: unknown;
355
+ } | undefined;
356
+ uncertified?: {
357
+ since: number;
358
+ session?: string | undefined;
359
+ operator?: string | undefined;
360
+ reason?: string | undefined;
361
+ } | undefined;
362
+ } | undefined;
180
363
  outcome?: {
181
364
  kind: "completed";
182
365
  value: unknown;
@@ -191,6 +374,23 @@ export declare const Execution: builder.NodeClass<{
191
374
  } | {
192
375
  kind: "cancelled";
193
376
  } | undefined;
377
+ } | {
378
+ id: string;
379
+ state: "deleted";
380
+ outcome: {
381
+ kind: "completed";
382
+ value: unknown;
383
+ } | {
384
+ kind: "failed";
385
+ error: {
386
+ code: string;
387
+ message: string;
388
+ family?: string | undefined;
389
+ details?: unknown;
390
+ };
391
+ } | {
392
+ kind: "cancelled";
393
+ };
194
394
  };
195
395
  }, "authenticated", false, false, undefined>>, "resume", "self"> | builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<Record<string, never>, {
196
396
  readonly mode: 'value';
@@ -200,6 +400,39 @@ export declare const Execution: builder.NodeClass<{
200
400
  version: string;
201
401
  state: "cancelled" | "completed" | "expired" | "failed" | "paused" | "pending" | "running" | "waiting";
202
402
  createdAt: string;
403
+ detail?: {
404
+ phase: "activating" | "attempting" | "awaiting" | "cancelled" | "classifying" | "completed" | "draining" | "rejected" | "validating";
405
+ class?: "immediate" | "noop" | "revalidate" | undefined;
406
+ mode?: "maintenance" | "online" | undefined;
407
+ validation?: {
408
+ scope: "full" | "incremental";
409
+ counts: "exact" | "sample";
410
+ } | undefined;
411
+ progress?: {
412
+ pages: number;
413
+ interruptions: number;
414
+ } | undefined;
415
+ instance?: "attempt" | "draining" | "open" | "repair" | undefined;
416
+ command?: number | undefined;
417
+ expires?: number | undefined;
418
+ attempt?: {
419
+ number: number;
420
+ destination: "previous" | "target";
421
+ } | undefined;
422
+ report?: {
423
+ attempt: number;
424
+ destination: "previous" | "target";
425
+ result: "aborted" | "interrupted" | "migration-required";
426
+ reason?: string | undefined;
427
+ summary?: unknown;
428
+ } | undefined;
429
+ uncertified?: {
430
+ since: number;
431
+ session?: string | undefined;
432
+ operator?: string | undefined;
433
+ reason?: string | undefined;
434
+ } | undefined;
435
+ } | undefined;
203
436
  outcome?: {
204
437
  kind: "completed";
205
438
  value: unknown;
@@ -214,6 +447,23 @@ export declare const Execution: builder.NodeClass<{
214
447
  } | {
215
448
  kind: "cancelled";
216
449
  } | undefined;
450
+ } | {
451
+ id: string;
452
+ state: "deleted";
453
+ outcome: {
454
+ kind: "completed";
455
+ value: unknown;
456
+ } | {
457
+ kind: "failed";
458
+ error: {
459
+ code: string;
460
+ message: string;
461
+ family?: string | undefined;
462
+ details?: unknown;
463
+ };
464
+ } | {
465
+ kind: "cancelled";
466
+ };
217
467
  };
218
468
  }, "authenticated", false, false, undefined>>, "status", "self"> | builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<{
219
469
  waitMs?: number | undefined;
@@ -243,6 +493,39 @@ export declare const Execution: builder.NodeClass<{
243
493
  version: string;
244
494
  state: "cancelled" | "completed" | "expired" | "failed" | "paused" | "pending" | "running" | "waiting";
245
495
  createdAt: string;
496
+ detail?: {
497
+ phase: "activating" | "attempting" | "awaiting" | "cancelled" | "classifying" | "completed" | "draining" | "rejected" | "validating";
498
+ class?: "immediate" | "noop" | "revalidate" | undefined;
499
+ mode?: "maintenance" | "online" | undefined;
500
+ validation?: {
501
+ scope: "full" | "incremental";
502
+ counts: "exact" | "sample";
503
+ } | undefined;
504
+ progress?: {
505
+ pages: number;
506
+ interruptions: number;
507
+ } | undefined;
508
+ instance?: "attempt" | "draining" | "open" | "repair" | undefined;
509
+ command?: number | undefined;
510
+ expires?: number | undefined;
511
+ attempt?: {
512
+ number: number;
513
+ destination: "previous" | "target";
514
+ } | undefined;
515
+ report?: {
516
+ attempt: number;
517
+ destination: "previous" | "target";
518
+ result: "aborted" | "interrupted" | "migration-required";
519
+ reason?: string | undefined;
520
+ summary?: unknown;
521
+ } | undefined;
522
+ uncertified?: {
523
+ since: number;
524
+ session?: string | undefined;
525
+ operator?: string | undefined;
526
+ reason?: string | undefined;
527
+ } | undefined;
528
+ } | undefined;
246
529
  outcome?: {
247
530
  kind: "completed";
248
531
  value: unknown;
@@ -257,6 +540,23 @@ export declare const Execution: builder.NodeClass<{
257
540
  } | {
258
541
  kind: "cancelled";
259
542
  } | undefined;
543
+ } | {
544
+ id: string;
545
+ state: "deleted";
546
+ outcome: {
547
+ kind: "completed";
548
+ value: unknown;
549
+ } | {
550
+ kind: "failed";
551
+ error: {
552
+ code: string;
553
+ message: string;
554
+ family?: string | undefined;
555
+ details?: unknown;
556
+ };
557
+ } | {
558
+ kind: "cancelled";
559
+ };
260
560
  };
261
561
  }, "authenticated", false, false, undefined>>, "cancel", "self"> | builder.AuthoredMethodProjection<builder.Method<builder.CallableProjection<{
262
562
  name: string;
@@ -11,7 +11,8 @@ export const Function = nodeClass({
11
11
  input: {},
12
12
  output: { type: 'object' },
13
13
  auth: { enum: ['anonymous', 'authenticated', 'authorized'] },
14
- policy: property({ type: 'object' }, { required: false }),
14
+ // Policy checks, or `true`, the rule every caller satisfies. An absent Policy means `false`.
15
+ policy: property({ anyOf: [{ type: 'object' }, { const: true }] }, { required: false }),
15
16
  static: property({ type: 'boolean' }, { required: false }),
16
17
  abstract: property({ type: 'boolean' }, { required: false }),
17
18
  },