@astrale-os/kernel-core 0.9.0-beta.54 → 0.9.0-beta.56
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/auth/authority/admission/admission.d.ts +2 -0
- package/dist/auth/authority/admission/admission.js +4 -0
- package/dist/auth/authority/admission/index.d.ts +1 -1
- package/dist/auth/authority/admission/index.js +1 -1
- package/dist/auth/authority/index.d.ts +2 -0
- package/dist/auth/authority/index.js +2 -0
- package/dist/auth/authority/normalization/index.d.ts +1 -1
- package/dist/auth/authority/normalization/index.js +1 -1
- package/dist/auth/authority/normalization/normalize.d.ts +2 -0
- package/dist/auth/authority/normalization/normalize.js +4 -0
- package/dist/auth/authority/prepare-grant-body.d.ts +4 -0
- package/dist/auth/authority/prepare-grant-body.js +27 -0
- package/dist/callable/contract/body.d.ts +10 -0
- package/dist/callable/contract/body.js +7 -0
- package/dist/callable/contract/index.d.ts +2 -1
- package/dist/callable/contract/index.js +1 -1
- package/dist/callable/contract/output.d.ts +8 -0
- package/dist/callable/index.d.ts +2 -1
- package/dist/callable/index.js +1 -0
- package/dist/schema/callables/execution.d.ts +269 -0
- package/dist/schema/callables/execution.js +30 -0
- package/dist/schema/callables/function.d.ts +212 -212
- package/dist/schema/callables/index.d.ts +1 -0
- package/dist/schema/callables/index.js +1 -0
- package/dist/schema/callables/view.d.ts +2 -2
- package/dist/schema/domain/domain.d.ts +417 -417
- package/dist/schema/identity/identity.d.ts +14 -14
- package/dist/schema/kernel/schema.d.ts +1140 -782
- package/dist/schema/kernel/schema.js +6 -2
- package/dist/schema/kernel/syscalls/contracts/blob.d.ts +21 -0
- package/dist/schema/kernel/syscalls/contracts/blob.js +16 -0
- package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +1 -1
- package/dist/schema/kernel/syscalls/contracts/delegate.js +2 -1
- package/dist/schema/kernel/syscalls/contracts/execution.d.ts +60 -0
- package/dist/schema/kernel/syscalls/contracts/execution.js +46 -0
- package/dist/schema/kernel/syscalls/contracts/index.d.ts +2 -0
- package/dist/schema/kernel/syscalls/contracts/index.js +2 -0
- package/dist/schema/kernel/syscalls/declarations/admit.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/can.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +2 -2
- package/dist/schema/kernel/syscalls/declarations/download.d.ts +7 -0
- package/dist/schema/kernel/syscalls/declarations/download.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/execution.d.ts +105 -0
- package/dist/schema/kernel/syscalls/declarations/execution.js +52 -0
- package/dist/schema/kernel/syscalls/declarations/impersonate.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +165 -39
- package/dist/schema/kernel/syscalls/declarations/index.js +13 -0
- package/dist/schema/kernel/syscalls/declarations/install.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/introspect.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/journal.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/mint.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/query.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/register.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/uninstall.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/upload.d.ts +15 -0
- package/dist/schema/kernel/syscalls/declarations/upload.js +10 -0
- package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/whoami.d.ts +1 -1
- package/dist/schema/kernel/syscalls/declarations/whois.d.ts +1 -1
- package/dist/schema/kernel/syscalls/descriptors/execution.d.ts +153 -0
- package/dist/schema/kernel/syscalls/descriptors/execution.js +11 -0
- package/dist/schema/kernel/syscalls/descriptors/function.d.ts +1 -0
- package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +2 -0
- package/dist/schema/kernel/syscalls/descriptors/functions.js +2 -0
- package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +7 -1
- package/dist/schema/kernel/syscalls/descriptors/index.d.ts +2 -1
- package/dist/schema/kernel/syscalls/descriptors/index.js +2 -1
- package/dist/schema/kernel/syscalls/descriptors/view.d.ts +1 -0
- package/dist/schema/kernel/syscalls/index.d.ts +2 -2
- package/dist/schema/kernel/syscalls/index.js +2 -2
- package/dist/schema/kernel/syscalls/references/execution.d.ts +55 -0
- package/dist/schema/kernel/syscalls/references/execution.js +13 -0
- package/dist/schema/kernel/syscalls/references/functions.d.ts +10 -0
- package/dist/schema/kernel/syscalls/references/functions.js +2 -0
- package/dist/schema/kernel/syscalls/references/index.d.ts +2 -1
- package/dist/schema/kernel/syscalls/references/index.js +2 -1
- package/dist/schema/meta/created-by.d.ts +32 -0
- package/dist/schema/meta/created-by.js +17 -0
- package/dist/schema/meta/index.d.ts +1 -0
- package/dist/schema/meta/index.js +1 -0
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineSchema, schema } from '@astrale-os/kernel-dsl/v1';
|
|
2
2
|
import { AuthorityOperations, CanCreate, CanDelete, CanGrant, CanRead, CanRevoke, CanTraverse, CanUse, CanUpdate, GovernedBy, Operation, Policy, } from '../authority/index.js';
|
|
3
|
-
import { Function as FunctionClass, MethodOf, View, ViewFor } from '../callables/index.js';
|
|
3
|
+
import { Execution, Function as FunctionClass, MethodOf, View, ViewFor, } from '../callables/index.js';
|
|
4
4
|
import { OperationCore } from '../core/index.js';
|
|
5
5
|
import { Class, Extends, InstanceOf } from '../definitions/index.js';
|
|
6
6
|
import { Domain as DomainClass, OfDomain } from '../domain/index.js';
|
|
7
7
|
import { ConstrainedBy, ExcludedFrom, ExtendsWith, Identity } from '../identity/index.js';
|
|
8
|
-
import { Descriptable, Edge, Iconable, Named, Node, Remotable, Statused, Timestamped, } from '../meta/index.js';
|
|
8
|
+
import { CreatedBy, Descriptable, Edge, Iconable, Named, Node, Remotable, Statused, Timestamped, } from '../meta/index.js';
|
|
9
9
|
import { Functions, CanUseSyscall } from './syscalls/declarations/index.js';
|
|
10
10
|
const KernelDefinitions = {
|
|
11
11
|
classes: {
|
|
@@ -20,6 +20,7 @@ const KernelDefinitions = {
|
|
|
20
20
|
Timestamped,
|
|
21
21
|
Class,
|
|
22
22
|
Domain: DomainClass,
|
|
23
|
+
Execution,
|
|
23
24
|
Function: FunctionClass,
|
|
24
25
|
Operation,
|
|
25
26
|
Policy,
|
|
@@ -33,6 +34,7 @@ const KernelDefinitions = {
|
|
|
33
34
|
can_revoke: CanRevoke,
|
|
34
35
|
can_use: CanUse,
|
|
35
36
|
constrained_by: ConstrainedBy,
|
|
37
|
+
created_by: CreatedBy,
|
|
36
38
|
excluded_from: ExcludedFrom,
|
|
37
39
|
extends: Extends,
|
|
38
40
|
extends_with: ExtendsWith,
|
|
@@ -71,6 +73,8 @@ export const AuthorityRelations = Object.freeze({
|
|
|
71
73
|
export const KernelRootFunctions = Object.freeze([
|
|
72
74
|
K.functions.query,
|
|
73
75
|
K.functions.mutate,
|
|
76
|
+
K.functions.upload,
|
|
77
|
+
K.functions.download,
|
|
74
78
|
K.functions.register,
|
|
75
79
|
K.functions.install,
|
|
76
80
|
K.functions.uninstall,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const MAXIMUM_BLOB_BYTES = 104857600;
|
|
2
|
+
export declare const blobSlot: import("zod").ZodObject<{
|
|
3
|
+
node: import("zod").ZodString;
|
|
4
|
+
property: import("zod").ZodString;
|
|
5
|
+
}, import("zod/v4/core").$strict>;
|
|
6
|
+
export declare const uploadInput: import("zod").ZodObject<{
|
|
7
|
+
mediaType: import("zod").ZodString;
|
|
8
|
+
}, import("zod/v4/core").$strict>;
|
|
9
|
+
export declare const uploadOutput: import("zod").ZodObject<{
|
|
10
|
+
receipt: import("zod").ZodString;
|
|
11
|
+
ref: import("zod").ZodObject<{
|
|
12
|
+
digest: import("zod").ZodString;
|
|
13
|
+
mediaType: import("zod").ZodString;
|
|
14
|
+
size: import("zod").ZodNumber;
|
|
15
|
+
}, import("zod/v4/core").$strict>;
|
|
16
|
+
expiresAt: import("zod").ZodString;
|
|
17
|
+
}, import("zod/v4/core").$strict>;
|
|
18
|
+
export declare const downloadInput: import("zod").ZodObject<{
|
|
19
|
+
node: import("zod").ZodString;
|
|
20
|
+
property: import("zod").ZodString;
|
|
21
|
+
}, import("zod/v4/core").$strict>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import { fullMatch } from '@astrale-os/kernel-dsl/v1/value/full-match';
|
|
3
|
+
import { strictObject, string } from 'zod';
|
|
4
|
+
import { artifactRef } from './installation.js';
|
|
5
|
+
export const MAXIMUM_BLOB_BYTES = 104_857_600;
|
|
6
|
+
export const blobSlot = strictObject({
|
|
7
|
+
node: string().check(fullMatch('[A-Za-z0-9._-]{1,255}')),
|
|
8
|
+
property: string().check(fullMatch(patterns.propertyKeyFullMatch)),
|
|
9
|
+
});
|
|
10
|
+
export const uploadInput = strictObject({ mediaType: string().min(1) });
|
|
11
|
+
export const uploadOutput = strictObject({
|
|
12
|
+
receipt: string().min(1),
|
|
13
|
+
ref: artifactRef,
|
|
14
|
+
expiresAt: string().min(1),
|
|
15
|
+
});
|
|
16
|
+
export const downloadInput = blobSlot;
|
|
@@ -2,6 +2,6 @@ export declare const delegateInput: import("zod").ZodObject<{
|
|
|
2
2
|
principal: import("zod").ZodString;
|
|
3
3
|
audience: import("zod").ZodString;
|
|
4
4
|
ttlSeconds: import("zod").ZodNumber;
|
|
5
|
-
attenuation: import("zod").ZodUnknown
|
|
5
|
+
attenuation: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
6
6
|
}, import("zod/v4/core").$strict>;
|
|
7
7
|
export declare const delegateOutput: import("zod").ZodString;
|
|
@@ -4,6 +4,7 @@ export const delegateInput = strictObject({
|
|
|
4
4
|
principal: text,
|
|
5
5
|
audience: text,
|
|
6
6
|
ttlSeconds: number().int().min(1),
|
|
7
|
-
|
|
7
|
+
/** Optional; absence means the self expression. */
|
|
8
|
+
attenuation: unknownSchema().optional(),
|
|
8
9
|
});
|
|
9
10
|
export const delegateOutput = text;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** Terminal outcome of one durable call; a handler failure is an outcome, not a call error. */
|
|
2
|
+
export declare const executionOutcome: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
3
|
+
kind: import("zod").ZodLiteral<"completed">;
|
|
4
|
+
value: import("zod").ZodUnknown;
|
|
5
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
6
|
+
kind: import("zod").ZodLiteral<"failed">;
|
|
7
|
+
error: import("zod").ZodObject<{
|
|
8
|
+
code: import("zod").ZodString;
|
|
9
|
+
message: import("zod").ZodString;
|
|
10
|
+
family: import("zod").ZodOptional<import("zod").ZodString>;
|
|
11
|
+
details: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
12
|
+
}, import("zod/v4/core").$strict>;
|
|
13
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
14
|
+
kind: import("zod").ZodLiteral<"cancelled">;
|
|
15
|
+
}, import("zod/v4/core").$strict>]>;
|
|
16
|
+
export declare const executionStatus: import("zod").ZodObject<{
|
|
17
|
+
id: import("zod").ZodString;
|
|
18
|
+
function: import("zod").ZodString;
|
|
19
|
+
version: import("zod").ZodString;
|
|
20
|
+
state: import("zod").ZodEnum<{
|
|
21
|
+
cancelled: "cancelled";
|
|
22
|
+
completed: "completed";
|
|
23
|
+
expired: "expired";
|
|
24
|
+
failed: "failed";
|
|
25
|
+
paused: "paused";
|
|
26
|
+
pending: "pending";
|
|
27
|
+
running: "running";
|
|
28
|
+
waiting: "waiting";
|
|
29
|
+
}>;
|
|
30
|
+
createdAt: import("zod").ZodString;
|
|
31
|
+
outcome: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
32
|
+
kind: import("zod").ZodLiteral<"completed">;
|
|
33
|
+
value: import("zod").ZodUnknown;
|
|
34
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
35
|
+
kind: import("zod").ZodLiteral<"failed">;
|
|
36
|
+
error: import("zod").ZodObject<{
|
|
37
|
+
code: import("zod").ZodString;
|
|
38
|
+
message: import("zod").ZodString;
|
|
39
|
+
family: import("zod").ZodOptional<import("zod").ZodString>;
|
|
40
|
+
details: import("zod").ZodOptional<import("zod").ZodUnknown>;
|
|
41
|
+
}, import("zod/v4/core").$strict>;
|
|
42
|
+
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
43
|
+
kind: import("zod").ZodLiteral<"cancelled">;
|
|
44
|
+
}, import("zod/v4/core").$strict>]>>;
|
|
45
|
+
}, import("zod/v4/core").$strict>;
|
|
46
|
+
export declare const executionStatusInput: import("zod").ZodObject<{}, import("zod/v4/core").$strict>;
|
|
47
|
+
export declare const executionResultInput: import("zod").ZodObject<{
|
|
48
|
+
waitMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
49
|
+
}, import("zod/v4/core").$strict>;
|
|
50
|
+
export declare const executionCancelInput: import("zod").ZodObject<{
|
|
51
|
+
force: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
52
|
+
}, import("zod/v4/core").$strict>;
|
|
53
|
+
export declare const executionSignalInput: import("zod").ZodObject<{
|
|
54
|
+
name: import("zod").ZodString;
|
|
55
|
+
value: import("zod").ZodUnknown;
|
|
56
|
+
}, import("zod/v4/core").$strict>;
|
|
57
|
+
export declare const executionSignalOutput: import("zod").ZodObject<{}, import("zod/v4/core").$strict>;
|
|
58
|
+
export declare const executionResumeInput: import("zod").ZodObject<{}, import("zod/v4/core").$strict>;
|
|
59
|
+
export declare const executionDeleteInput: import("zod").ZodObject<{}, import("zod/v4/core").$strict>;
|
|
60
|
+
export declare const executionDeleteOutput: import("zod").ZodObject<{}, import("zod/v4/core").$strict>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { fullMatch } from '@astrale-os/kernel-dsl/v1/value/full-match';
|
|
2
|
+
import { boolean, enum as enumeration, literal, number, strictObject, string, union, unknown as unknownSchema, } from 'zod';
|
|
3
|
+
const nodeId = string().min(1).max(255).check(fullMatch('[A-Za-z0-9._-]+'));
|
|
4
|
+
const empty = strictObject({});
|
|
5
|
+
/** Engine-observed state; never persisted on the Execution. */
|
|
6
|
+
const state = enumeration([
|
|
7
|
+
'pending',
|
|
8
|
+
'running',
|
|
9
|
+
'waiting',
|
|
10
|
+
'paused',
|
|
11
|
+
'completed',
|
|
12
|
+
'failed',
|
|
13
|
+
'cancelled',
|
|
14
|
+
'expired',
|
|
15
|
+
]);
|
|
16
|
+
const failure = strictObject({
|
|
17
|
+
code: string(),
|
|
18
|
+
message: string(),
|
|
19
|
+
family: string().optional(),
|
|
20
|
+
details: unknownSchema().optional(),
|
|
21
|
+
});
|
|
22
|
+
/** Terminal outcome of one durable call; a handler failure is an outcome, not a call error. */
|
|
23
|
+
export const executionOutcome = union([
|
|
24
|
+
strictObject({ kind: literal('completed'), value: unknownSchema() }),
|
|
25
|
+
strictObject({ kind: literal('failed'), error: failure }),
|
|
26
|
+
strictObject({ kind: literal('cancelled') }),
|
|
27
|
+
]);
|
|
28
|
+
export const executionStatus = strictObject({
|
|
29
|
+
id: nodeId,
|
|
30
|
+
function: nodeId,
|
|
31
|
+
version: string().check(fullMatch('sha256:[0-9a-f]{64}')),
|
|
32
|
+
state,
|
|
33
|
+
createdAt: string().min(1),
|
|
34
|
+
outcome: executionOutcome.optional(),
|
|
35
|
+
});
|
|
36
|
+
export const executionStatusInput = empty;
|
|
37
|
+
export const executionResultInput = strictObject({ waitMs: number().int().min(0).optional() });
|
|
38
|
+
export const executionCancelInput = strictObject({ force: boolean().optional() });
|
|
39
|
+
export const executionSignalInput = strictObject({
|
|
40
|
+
name: string().min(1).max(128),
|
|
41
|
+
value: unknownSchema(),
|
|
42
|
+
});
|
|
43
|
+
export const executionSignalOutput = empty;
|
|
44
|
+
export const executionResumeInput = empty;
|
|
45
|
+
export const executionDeleteInput = empty;
|
|
46
|
+
export const executionDeleteOutput = empty;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { admitInput, admitOutput } from './admit.js';
|
|
2
|
+
export { blobSlot, downloadInput, MAXIMUM_BLOB_BYTES, uploadInput, uploadOutput } from './blob.js';
|
|
2
3
|
export { MAXIMUM_CHECKS, canInput, canOutput } from './can.js';
|
|
3
4
|
export { delegateInput, delegateOutput } from './delegate.js';
|
|
5
|
+
export { executionCancelInput, executionDeleteInput, executionDeleteOutput, executionOutcome, executionResultInput, executionResumeInput, executionSignalInput, executionSignalOutput, executionStatus, executionStatusInput, } from './execution.js';
|
|
4
6
|
export { installInput, installReceipt, type DomainRequest, type InstallInput, type InstallReceipt, } from './install.js';
|
|
5
7
|
export { introspectInput } from './introspect.js';
|
|
6
8
|
export { journalInput, journalOutput } from './journal.js';
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { admitInput, admitOutput } from './admit.js';
|
|
2
|
+
export { blobSlot, downloadInput, MAXIMUM_BLOB_BYTES, uploadInput, uploadOutput } from './blob.js';
|
|
2
3
|
export { MAXIMUM_CHECKS, canInput, canOutput } from './can.js';
|
|
3
4
|
export { delegateInput, delegateOutput } from './delegate.js';
|
|
5
|
+
export { executionCancelInput, executionDeleteInput, executionDeleteOutput, executionOutcome, executionResultInput, executionResumeInput, executionSignalInput, executionSignalOutput, executionStatus, executionStatusInput, } from './execution.js';
|
|
4
6
|
export { installInput, installReceipt, } from './install.js';
|
|
5
7
|
export { introspectInput } from './introspect.js';
|
|
6
8
|
export { journalInput, journalOutput } from './journal.js';
|
|
@@ -3,8 +3,8 @@ export declare const Delegate: builder.Method<builder.CallableProjection<{
|
|
|
3
3
|
principal: string;
|
|
4
4
|
audience: string;
|
|
5
5
|
ttlSeconds: number;
|
|
6
|
-
attenuation
|
|
6
|
+
attenuation?: unknown;
|
|
7
7
|
}, {
|
|
8
8
|
readonly mode: 'value';
|
|
9
9
|
readonly value: string;
|
|
10
|
-
}, "authenticated", true, false>>;
|
|
10
|
+
}, "authenticated", true, false, undefined>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { func, output } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
+
import { downloadInput } from '../contracts/index.js';
|
|
3
|
+
import { usePolicy } from './use-policy.js';
|
|
4
|
+
export const Download = func({
|
|
5
|
+
description: 'Stream an application blob from an authorized Node property.',
|
|
6
|
+
auth: 'authorized',
|
|
7
|
+
policy: usePolicy(() => Download),
|
|
8
|
+
input: downloadInput,
|
|
9
|
+
output: output.binary(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { type builder } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
+
export declare const ExecutionStatus: builder.Method<builder.CallableProjection<Record<string, never>, {
|
|
3
|
+
readonly mode: 'value';
|
|
4
|
+
readonly value: {
|
|
5
|
+
id: string;
|
|
6
|
+
function: string;
|
|
7
|
+
version: string;
|
|
8
|
+
state: "cancelled" | "completed" | "expired" | "failed" | "paused" | "pending" | "running" | "waiting";
|
|
9
|
+
createdAt: string;
|
|
10
|
+
outcome?: {
|
|
11
|
+
kind: "completed";
|
|
12
|
+
value: unknown;
|
|
13
|
+
} | {
|
|
14
|
+
kind: "failed";
|
|
15
|
+
error: {
|
|
16
|
+
code: string;
|
|
17
|
+
message: string;
|
|
18
|
+
family?: string | undefined;
|
|
19
|
+
details?: unknown;
|
|
20
|
+
};
|
|
21
|
+
} | {
|
|
22
|
+
kind: "cancelled";
|
|
23
|
+
} | undefined;
|
|
24
|
+
};
|
|
25
|
+
}, "authenticated", false, false, undefined>>;
|
|
26
|
+
export declare const ExecutionResult: builder.Method<builder.CallableProjection<{
|
|
27
|
+
waitMs?: number | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
readonly mode: 'value';
|
|
30
|
+
readonly value: {
|
|
31
|
+
kind: "completed";
|
|
32
|
+
value: unknown;
|
|
33
|
+
} | {
|
|
34
|
+
kind: "failed";
|
|
35
|
+
error: {
|
|
36
|
+
code: string;
|
|
37
|
+
message: string;
|
|
38
|
+
family?: string | undefined;
|
|
39
|
+
details?: unknown;
|
|
40
|
+
};
|
|
41
|
+
} | {
|
|
42
|
+
kind: "cancelled";
|
|
43
|
+
};
|
|
44
|
+
}, "authenticated", false, false, undefined>>;
|
|
45
|
+
export declare const ExecutionCancel: builder.Method<builder.CallableProjection<{
|
|
46
|
+
force?: boolean | undefined;
|
|
47
|
+
}, {
|
|
48
|
+
readonly mode: 'value';
|
|
49
|
+
readonly value: {
|
|
50
|
+
id: string;
|
|
51
|
+
function: string;
|
|
52
|
+
version: string;
|
|
53
|
+
state: "cancelled" | "completed" | "expired" | "failed" | "paused" | "pending" | "running" | "waiting";
|
|
54
|
+
createdAt: string;
|
|
55
|
+
outcome?: {
|
|
56
|
+
kind: "completed";
|
|
57
|
+
value: unknown;
|
|
58
|
+
} | {
|
|
59
|
+
kind: "failed";
|
|
60
|
+
error: {
|
|
61
|
+
code: string;
|
|
62
|
+
message: string;
|
|
63
|
+
family?: string | undefined;
|
|
64
|
+
details?: unknown;
|
|
65
|
+
};
|
|
66
|
+
} | {
|
|
67
|
+
kind: "cancelled";
|
|
68
|
+
} | undefined;
|
|
69
|
+
};
|
|
70
|
+
}, "authenticated", false, false, undefined>>;
|
|
71
|
+
export declare const ExecutionSignal: builder.Method<builder.CallableProjection<{
|
|
72
|
+
name: string;
|
|
73
|
+
value: unknown;
|
|
74
|
+
}, {
|
|
75
|
+
readonly mode: 'value';
|
|
76
|
+
readonly value: Record<string, never>;
|
|
77
|
+
}, "authenticated", false, false, undefined>>;
|
|
78
|
+
export declare const ExecutionResume: builder.Method<builder.CallableProjection<Record<string, never>, {
|
|
79
|
+
readonly mode: 'value';
|
|
80
|
+
readonly value: {
|
|
81
|
+
id: string;
|
|
82
|
+
function: string;
|
|
83
|
+
version: string;
|
|
84
|
+
state: "cancelled" | "completed" | "expired" | "failed" | "paused" | "pending" | "running" | "waiting";
|
|
85
|
+
createdAt: string;
|
|
86
|
+
outcome?: {
|
|
87
|
+
kind: "completed";
|
|
88
|
+
value: unknown;
|
|
89
|
+
} | {
|
|
90
|
+
kind: "failed";
|
|
91
|
+
error: {
|
|
92
|
+
code: string;
|
|
93
|
+
message: string;
|
|
94
|
+
family?: string | undefined;
|
|
95
|
+
details?: unknown;
|
|
96
|
+
};
|
|
97
|
+
} | {
|
|
98
|
+
kind: "cancelled";
|
|
99
|
+
} | undefined;
|
|
100
|
+
};
|
|
101
|
+
}, "authenticated", false, false, undefined>>;
|
|
102
|
+
export declare const ExecutionDelete: builder.Method<builder.CallableProjection<Record<string, never>, {
|
|
103
|
+
readonly mode: 'value';
|
|
104
|
+
readonly value: Record<string, never>;
|
|
105
|
+
}, "authenticated", false, false, undefined>>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { method } from '@astrale-os/kernel-dsl/v1';
|
|
2
|
+
import { executionCancelInput, executionDeleteInput, executionDeleteOutput, executionOutcome, executionResultInput, executionResumeInput, executionSignalInput, executionSignalOutput, executionStatus, executionStatusInput, } from '../contracts/index.js';
|
|
3
|
+
// Runtime admits every Execution method against its receiver's immutable facts: observe for
|
|
4
|
+
// status, result and cooperative cancel; administer for forced cancel, signal, resume and delete.
|
|
5
|
+
export const ExecutionStatus = method({
|
|
6
|
+
description: 'Read the engine state and, once terminal, the outcome of this Execution.',
|
|
7
|
+
auth: 'authenticated',
|
|
8
|
+
input: executionStatusInput,
|
|
9
|
+
output: executionStatus,
|
|
10
|
+
static: false,
|
|
11
|
+
abstract: false,
|
|
12
|
+
});
|
|
13
|
+
export const ExecutionResult = method({
|
|
14
|
+
description: 'Wait at most waitMs, bounded by the request deadline, for the terminal outcome.',
|
|
15
|
+
auth: 'authenticated',
|
|
16
|
+
input: executionResultInput,
|
|
17
|
+
output: executionOutcome,
|
|
18
|
+
static: false,
|
|
19
|
+
abstract: false,
|
|
20
|
+
});
|
|
21
|
+
export const ExecutionCancel = method({
|
|
22
|
+
description: 'Cancel this Execution cooperatively, or kill it without compensation when forced.',
|
|
23
|
+
auth: 'authenticated',
|
|
24
|
+
input: executionCancelInput,
|
|
25
|
+
output: executionStatus,
|
|
26
|
+
static: false,
|
|
27
|
+
abstract: false,
|
|
28
|
+
});
|
|
29
|
+
export const ExecutionSignal = method({
|
|
30
|
+
description: 'Resolve the named durable promise of this Execution once.',
|
|
31
|
+
auth: 'authenticated',
|
|
32
|
+
input: executionSignalInput,
|
|
33
|
+
output: executionSignalOutput,
|
|
34
|
+
static: false,
|
|
35
|
+
abstract: false,
|
|
36
|
+
});
|
|
37
|
+
export const ExecutionResume = method({
|
|
38
|
+
description: 'Resume this paused Execution; a running Execution is unchanged.',
|
|
39
|
+
auth: 'authenticated',
|
|
40
|
+
input: executionResumeInput,
|
|
41
|
+
output: executionStatus,
|
|
42
|
+
static: false,
|
|
43
|
+
abstract: false,
|
|
44
|
+
});
|
|
45
|
+
export const ExecutionDelete = method({
|
|
46
|
+
description: 'Delete the record of this Execution, then kill and purge its run.',
|
|
47
|
+
auth: 'authenticated',
|
|
48
|
+
input: executionDeleteInput,
|
|
49
|
+
output: executionDeleteOutput,
|
|
50
|
+
static: false,
|
|
51
|
+
abstract: false,
|
|
52
|
+
});
|