@astrale-os/sdk 0.6.0-beta.43 → 0.6.0-beta.45
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/README.md +6 -6
- package/dist/application/action/authoring.d.ts +1 -1
- package/dist/application/action/context.d.ts +9 -8
- package/dist/application/error/error.d.ts +7 -7
- package/dist/application/error/error.js +12 -12
- package/dist/application/error/index.d.ts +1 -1
- package/dist/application/error/index.js +1 -1
- package/dist/application/mutation/authoring/builder.d.ts +12 -12
- package/dist/application/mutation/authoring/builder.js +3 -3
- package/dist/application/mutation/authoring/guard.d.ts +2 -2
- package/dist/application/mutation/authoring/index.d.ts +1 -1
- package/dist/application/mutation/define.d.ts +8 -8
- package/dist/application/mutation/define.js +12 -12
- package/dist/application/mutation/execution/execute.d.ts +2 -2
- package/dist/application/mutation/execution/execute.js +10 -10
- package/dist/application/mutation/execution/executor.d.ts +2 -2
- package/dist/application/mutation/execution/executor.js +2 -2
- package/dist/application/mutation/index.d.ts +2 -2
- package/dist/application/mutation/legacy/v6/define.d.ts +1 -1
- package/dist/application/mutation/legacy/v6/mutation.d.ts +1 -1
- package/dist/application/mutation/mutation.d.ts +12 -12
- package/dist/application/query/composite/builder.js +1 -1
- package/dist/application/query/define.d.ts +1 -1
- package/dist/application/query/define.js +3 -3
- package/dist/application/query/defined/define.d.ts +45 -0
- package/dist/application/query/defined/define.js +96 -0
- package/dist/application/query/{recipe/recipe.d.ts → defined/query.d.ts} +21 -20
- package/dist/application/query/definition.d.ts +5 -5
- package/dist/application/query/definition.js +4 -4
- package/dist/application/query/execution/bounds.d.ts +5 -5
- package/dist/application/query/execution/bounds.js +2 -2
- package/dist/application/query/execution/client.d.ts +21 -0
- package/dist/application/query/execution/client.js +1 -0
- package/dist/application/query/execution/crossings.d.ts +3 -3
- package/dist/application/query/execution/crossings.js +23 -23
- package/dist/application/query/execution/error.d.ts +8 -8
- package/dist/application/query/execution/error.js +5 -5
- package/dist/application/query/execution/execute.d.ts +4 -4
- package/dist/application/query/execution/executor.d.ts +2 -2
- package/dist/application/query/execution/rows.d.ts +5 -5
- package/dist/application/query/execution/rows.js +42 -30
- package/dist/application/query/execution/{recipe.d.ts → run.d.ts} +21 -31
- package/dist/application/query/execution/{recipe.js → run.js} +49 -49
- package/dist/application/query/execution/split.d.ts +3 -3
- package/dist/application/query/execution/split.js +1 -1
- package/dist/application/query/handles/build.d.ts +1 -1
- package/dist/application/query/handles/domain.d.ts +1 -1
- package/dist/application/query/handles/handles.d.ts +14 -12
- package/dist/application/query/handles/plan.d.ts +10 -9
- package/dist/application/query/handles/plan.js +1 -1
- package/dist/application/query/handles/reads.js +4 -4
- package/dist/application/query/handles/rows.d.ts +1 -1
- package/dist/application/query/index.d.ts +9 -6
- package/dist/application/query/index.js +3 -3
- package/dist/application/query/language/index.d.ts +1 -1
- package/dist/application/query/language/query.d.ts +5 -5
- package/dist/application/query/legacy/v6/collection/union.d.ts +1 -1
- package/dist/application/query/legacy/v6/collection/union.js +3 -3
- package/dist/application/query/legacy/v6/define.d.ts +1 -1
- package/dist/application/query/legacy/v6/define.js +3 -3
- package/dist/application/query/legacy/v6/execution/execute.d.ts +6 -4
- package/dist/application/query/legacy/v6/index.d.ts +2 -1
- package/dist/application/query/legacy/v6/index.js +1 -1
- package/dist/application/query/query.d.ts +3 -3
- package/dist/application/routes/admission.d.ts +1 -1
- package/dist/application/routes/admission.js +2 -2
- package/dist/application/routes/index.d.ts +3 -2
- package/dist/application/routes/route.d.ts +1 -1
- package/dist/application/runtime/declarations.d.ts +6 -6
- package/dist/application/runtime/define.d.ts +5 -5
- package/dist/application/workflow/durable.d.ts +9 -9
- package/dist/execution/invocation/capabilities/bind.d.ts +1 -1
- package/dist/execution/invocation/capabilities/bind.js +8 -8
- package/dist/execution/invocation/dispatch/action.js +2 -2
- package/dist/execution/invocation/dispatch/workflow.js +2 -2
- package/dist/execution/invocation/result/index.d.ts +1 -1
- package/dist/execution/invocation/result/index.js +1 -1
- package/dist/execution/invocation/result/undeclared.d.ts +7 -0
- package/dist/execution/invocation/result/undeclared.js +18 -0
- package/dist/execution/workflows/failure.d.ts +7 -7
- package/dist/execution/workflows/failure.js +19 -18
- package/dist/execution/workflows/receiver.d.ts +1 -1
- package/dist/execution/workflows/run.js +2 -2
- package/dist/execution/workflows/steps.d.ts +1 -1
- package/dist/platform/schema/class-authoring.d.ts +2 -8
- package/dist/platform/schema/index.d.ts +1 -1
- package/dist/platform/schema/kernel-compiled.d.ts +1 -1
- package/dist/platform/schema/kernel-compiled.js +1 -1
- package/dist/platform/schema/kernel.d.ts +4 -2
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +1 -1
- package/dist/testing/{recipe.d.ts → query.d.ts} +5 -5
- package/dist/testing/{recipe.js → query.js} +9 -9
- package/dist/tooling/cli/orchestrate.js +7 -6
- package/dist/tooling/linter/adapters/typescript/{recipe-definitions.d.ts → definition-calls.d.ts} +10 -10
- package/dist/tooling/linter/adapters/typescript/{recipe-definitions.js → definition-calls.js} +10 -10
- package/dist/tooling/linter/adapters/typescript/index.d.ts +1 -1
- package/dist/tooling/linter/adapters/typescript/index.js +1 -1
- package/dist/tooling/linter/adapters/typescript/query-observation.js +6 -6
- package/dist/tooling/linter/implementations/source/definitions.d.ts +2 -0
- package/dist/tooling/linter/implementations/source/{recipes.js → definitions.js} +27 -27
- package/dist/tooling/linter/implementations/source/global.js +8 -6
- package/dist/tooling/linter/implementations/source/mutations.js +5 -5
- package/dist/tooling/linter/implementations/source/shared.d.ts +2 -2
- package/dist/tooling/linter/implementations/source/shared.js +7 -7
- package/dist/tooling/linter/implementations/source/verifiers.js +2 -2
- package/dist/tooling/linter/policy/generated.js +3 -3
- package/dist/tooling/linter/requirements/registry.js +4 -4
- package/docs/durable-workflows.md +8 -8
- package/docs/handler-dependencies.md +1 -1
- package/docs/legacy/query-v6.md +6 -6
- package/docs/queries.md +38 -38
- package/package.json +6 -6
- package/dist/application/query/recipe/define.d.ts +0 -44
- package/dist/application/query/recipe/define.js +0 -95
- package/dist/execution/invocation/result/recipe.d.ts +0 -6
- package/dist/execution/invocation/result/recipe.js +0 -17
- package/dist/tooling/linter/implementations/source/recipes.d.ts +0 -2
- /package/dist/application/query/{recipe/recipe.js → defined/query.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mutationSpecOf } from '../../../application/mutation/define.js';
|
|
2
2
|
import { executeMutation } from '../../../application/mutation/execution/execute.js';
|
|
3
3
|
import { bindMutation } from '../../../application/mutation/execution/executor.js';
|
|
4
|
+
import { querySpecOf } from '../../../application/query/defined/define.js';
|
|
4
5
|
import { bindQuery } from '../../../application/query/execution/executor.js';
|
|
5
|
-
import {
|
|
6
|
-
import { recipeSpecOf } from '../../../application/query/recipe/define.js';
|
|
6
|
+
import { runQuery } from '../../../application/query/execution/run.js';
|
|
7
7
|
import { bindDependencies } from '../dependency/index.js';
|
|
8
8
|
export function bindCapabilities(domain, sessions, declared) {
|
|
9
9
|
const graph = bindGraph(sessions, domain);
|
|
@@ -13,17 +13,17 @@ export function bindCapabilities(domain, sessions, declared) {
|
|
|
13
13
|
dependencies: bindDependencies(domain, sessions),
|
|
14
14
|
graph,
|
|
15
15
|
query: async (definition, input, options) => {
|
|
16
|
-
if (
|
|
16
|
+
if (mutationSpecOf(definition) !== undefined)
|
|
17
17
|
throw new TypeError(`Mutation ${definition.id} writes: call it with mutate, not query.`);
|
|
18
|
-
if (
|
|
18
|
+
if (querySpecOf(definition) === undefined)
|
|
19
19
|
return graphUnder(options).query(definition, input);
|
|
20
20
|
if (options === undefined)
|
|
21
|
-
throw new TypeError(`
|
|
21
|
+
throw new TypeError(`Query ${definition.id} is called with { as: 'executor' | 'caller' }.`);
|
|
22
22
|
const { size, after } = options;
|
|
23
|
-
return
|
|
23
|
+
return runQuery(sessions[authorityOf(sessions, options)], domain, definition, input, { ...(size === undefined ? {} : { size }), ...(after === undefined ? {} : { after }) }, declared);
|
|
24
24
|
},
|
|
25
25
|
mutate: async (definition, input, options) => {
|
|
26
|
-
if (
|
|
26
|
+
if (mutationSpecOf(definition) === undefined)
|
|
27
27
|
return graphUnder(options).mutate(definition, input);
|
|
28
28
|
if (options === undefined)
|
|
29
29
|
throw new TypeError(`Mutation ${definition.id} is called with { as: 'executor' | 'caller' }.`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { declaredErrorFactory, declaredErrorOf } from '../../../application/error/index.js';
|
|
2
|
-
import { protocolError,
|
|
2
|
+
import { protocolError, reportUndeclaredDefinedError } from '../result/index.js';
|
|
3
3
|
export async function action(selected, context) {
|
|
4
4
|
const complete = Object.freeze({
|
|
5
5
|
...context,
|
|
@@ -11,7 +11,7 @@ export async function action(selected, context) {
|
|
|
11
11
|
catch (cause) {
|
|
12
12
|
const declared = declaredErrorOf(cause, selected.definition);
|
|
13
13
|
if (declared === undefined) {
|
|
14
|
-
|
|
14
|
+
reportUndeclaredDefinedError(cause, selected.address);
|
|
15
15
|
throw cause;
|
|
16
16
|
}
|
|
17
17
|
throw protocolError(declared.family, declared.message, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { declaredErrorFactory, declaredErrorOf } from '../../../application/error/index.js';
|
|
2
|
-
import { protocolError,
|
|
2
|
+
import { protocolError, reportUndeclaredDefinedError } from '../result/index.js';
|
|
3
3
|
export async function workflow(selected, context, runner) {
|
|
4
4
|
const complete = Object.freeze({
|
|
5
5
|
...context,
|
|
@@ -11,7 +11,7 @@ export async function workflow(selected, context, runner) {
|
|
|
11
11
|
catch (cause) {
|
|
12
12
|
const declared = declaredErrorOf(cause, selected.definition);
|
|
13
13
|
if (declared === undefined) {
|
|
14
|
-
|
|
14
|
+
reportUndeclaredDefinedError(cause, selected.address);
|
|
15
15
|
throw cause;
|
|
16
16
|
}
|
|
17
17
|
throw protocolError(declared.family, declared.message, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { inputError, InvocationDefect, projectError, protocolError } from './errors.js';
|
|
2
2
|
export type { InvocationDefectCode } from './errors.js';
|
|
3
3
|
export { project } from './project.js';
|
|
4
|
-
export {
|
|
4
|
+
export { reportUndeclaredDefinedError } from './undeclared.js';
|
|
5
5
|
export { validateInput, validateOutput } from './validate.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { inputError, InvocationDefect, projectError, protocolError } from './errors.js';
|
|
2
2
|
export { project } from './project.js';
|
|
3
|
-
export {
|
|
3
|
+
export { reportUndeclaredDefinedError } from './undeclared.js';
|
|
4
4
|
export { validateInput, validateOutput } from './validate.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log a Query or Mutation's declared error that reaches a Function which does not re-declare it,
|
|
3
|
+
* before the Server redacts it as an internal error: its code, the id of the Query or Mutation and
|
|
4
|
+
* the Function, never its details, which a read as the executor may fill with what the caller may
|
|
5
|
+
* not read.
|
|
6
|
+
*/
|
|
7
|
+
export declare function reportUndeclaredDefinedError(cause: unknown, address: string): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { definedErrorOf } from '../../../application/error/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Log a Query or Mutation's declared error that reaches a Function which does not re-declare it,
|
|
4
|
+
* before the Server redacts it as an internal error: its code, the id of the Query or Mutation and
|
|
5
|
+
* the Function, never its details, which a read as the executor may fill with what the caller may
|
|
6
|
+
* not read.
|
|
7
|
+
*/
|
|
8
|
+
export function reportUndeclaredDefinedError(cause, address) {
|
|
9
|
+
const raised = definedErrorOf(cause);
|
|
10
|
+
if (raised === undefined)
|
|
11
|
+
return;
|
|
12
|
+
// oxlint-disable-next-line no-console
|
|
13
|
+
console.error('[sdk] Query or Mutation error not re-declared by its Function', {
|
|
14
|
+
code: raised.code,
|
|
15
|
+
id: raised.id,
|
|
16
|
+
function: address,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -26,30 +26,30 @@ export declare class StepRetryAfter extends Error {
|
|
|
26
26
|
constructor(delayMs: number, cause?: unknown);
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* Encode what a Workflow did not catch as the Execution's failure: a Step's
|
|
30
|
-
* with `STEP_EXHAUSTED`, naming the
|
|
29
|
+
* Encode what a Workflow did not catch as the Execution's failure: a Step's Query failure ends it
|
|
30
|
+
* with `STEP_EXHAUSTED`, naming the Query and a `QueryError`'s code, never its details, which a
|
|
31
31
|
* read as the executor may fill with what the Execution's reader may not read; an S12 refusal names
|
|
32
32
|
* only Classes, so its message says what to declare. Anything else is encoded as
|
|
33
|
-
* `terminalFailure` encodes it. Inside a Step, a
|
|
33
|
+
* `terminalFailure` encodes it. Inside a Step, a Query failure caught from an earlier Step and
|
|
34
34
|
* thrown again fails that Step, as `queryFailure` encodes it.
|
|
35
35
|
*/
|
|
36
36
|
export declare function uncaughtFailure(engine: DurableEngine, cause: unknown, definition: object): Error | undefined;
|
|
37
37
|
/**
|
|
38
|
-
* Encode a declared business error of `definition`, a
|
|
38
|
+
* Encode a declared business error of `definition`, a Query's it re-declares included, or a Step
|
|
39
39
|
* that spent its retry budget, as a terminal engine failure, or return undefined for any other
|
|
40
40
|
* error, which the engine retries.
|
|
41
41
|
*/
|
|
42
42
|
export declare function terminalFailure(engine: DurableEngine, cause: unknown, definition: object): Error | undefined;
|
|
43
43
|
/**
|
|
44
|
-
* Encode a
|
|
45
|
-
* error. A read that met data it cannot answer, a
|
|
44
|
+
* Encode a Query's failure as the Step's terminal failure, or return undefined for any other
|
|
45
|
+
* error. A read that met data it cannot answer, a document the Host cannot serve, or a Query S12
|
|
46
46
|
* refuses is not retried. A refused read is a failed attempt as any Kernel refusal: retried,
|
|
47
47
|
* unless the Kernel refused it for good.
|
|
48
48
|
*/
|
|
49
49
|
export declare function queryFailure(engine: DurableEngine, cause: unknown): Error | undefined;
|
|
50
50
|
/**
|
|
51
51
|
* What a journaled Step failed with, as the Workflow sees it: its declared business error, rebuilt
|
|
52
|
-
* through the definition's own factory, its
|
|
52
|
+
* through the definition's own factory, its Query's `QueryError` or S12 refusal, or
|
|
53
53
|
* `StepExhausted` once the engine spent its retry budget or the Step threw an exhaustion caught
|
|
54
54
|
* from an earlier Step. A replay throws what the live run threw.
|
|
55
55
|
*/
|
|
@@ -4,9 +4,9 @@ import { isQueryError, QueryError } from '../../application/query/execution/erro
|
|
|
4
4
|
import { ResponseError } from '../../platform/client/index.js';
|
|
5
5
|
/** Metadata key the Kernel reads a declared failure from (`backend/restate` outcome decoding). */
|
|
6
6
|
const FAILURE = 'astrale.failure';
|
|
7
|
-
/** Metadata key of a Step's
|
|
7
|
+
/** Metadata key of a Step's Query failure, which only the Workflow reads back. */
|
|
8
8
|
const QUERY_FAILURE = 'astrale.query';
|
|
9
|
-
/** The Step each
|
|
9
|
+
/** The Step each Query failure the Workflow sees failed: uncaught, it ends the Execution. */
|
|
10
10
|
const queryFailures = new WeakMap();
|
|
11
11
|
/** Failure code of an Execution whose Workflow did not catch a Step that failed for good. */
|
|
12
12
|
export const STEP_EXHAUSTED = 'STEP_EXHAUSTED';
|
|
@@ -91,11 +91,11 @@ const STATUS = {
|
|
|
91
91
|
UNSUPPORTED: 422,
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
94
|
-
* Encode what a Workflow did not catch as the Execution's failure: a Step's
|
|
95
|
-
* with `STEP_EXHAUSTED`, naming the
|
|
94
|
+
* Encode what a Workflow did not catch as the Execution's failure: a Step's Query failure ends it
|
|
95
|
+
* with `STEP_EXHAUSTED`, naming the Query and a `QueryError`'s code, never its details, which a
|
|
96
96
|
* read as the executor may fill with what the Execution's reader may not read; an S12 refusal names
|
|
97
97
|
* only Classes, so its message says what to declare. Anything else is encoded as
|
|
98
|
-
* `terminalFailure` encodes it. Inside a Step, a
|
|
98
|
+
* `terminalFailure` encodes it. Inside a Step, a Query failure caught from an earlier Step and
|
|
99
99
|
* thrown again fails that Step, as `queryFailure` encodes it.
|
|
100
100
|
*/
|
|
101
101
|
export function uncaughtFailure(engine, cause, definition) {
|
|
@@ -105,17 +105,17 @@ export function uncaughtFailure(engine, cause, definition) {
|
|
|
105
105
|
if (cause instanceof UndeclaredCrossing) {
|
|
106
106
|
return stepFailure(engine, `Workflow Step ${step} failed: ${cause.message}`, {
|
|
107
107
|
step,
|
|
108
|
-
query: {
|
|
108
|
+
query: { id: cause.query },
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
|
-
const { code,
|
|
112
|
-
return stepFailure(engine, `Workflow Step ${step} failed: ${code} from ${
|
|
111
|
+
const { code, query } = cause;
|
|
112
|
+
return stepFailure(engine, `Workflow Step ${step} failed: ${code} from ${query}.`, {
|
|
113
113
|
step,
|
|
114
|
-
query: { code,
|
|
114
|
+
query: { code, id: query },
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
117
|
/**
|
|
118
|
-
* Encode a declared business error of `definition`, a
|
|
118
|
+
* Encode a declared business error of `definition`, a Query's it re-declares included, or a Step
|
|
119
119
|
* that spent its retry budget, as a terminal engine failure, or return undefined for any other
|
|
120
120
|
* error, which the engine retries.
|
|
121
121
|
*/
|
|
@@ -147,18 +147,18 @@ function stepFailure(engine, message, details) {
|
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
|
-
* Encode a
|
|
151
|
-
* error. A read that met data it cannot answer, a
|
|
150
|
+
* Encode a Query's failure as the Step's terminal failure, or return undefined for any other
|
|
151
|
+
* error. A read that met data it cannot answer, a document the Host cannot serve, or a Query S12
|
|
152
152
|
* refuses is not retried. A refused read is a failed attempt as any Kernel refusal: retried,
|
|
153
153
|
* unless the Kernel refused it for good.
|
|
154
154
|
*/
|
|
155
155
|
export function queryFailure(engine, cause) {
|
|
156
156
|
let failure;
|
|
157
157
|
if (cause instanceof UndeclaredCrossing)
|
|
158
|
-
failure = {
|
|
158
|
+
failure = { query: cause.query, message: cause.message };
|
|
159
159
|
else if (isQueryError(cause) && cause.code !== 'REFUSED') {
|
|
160
|
-
const { code,
|
|
161
|
-
failure = { code,
|
|
160
|
+
const { code, query, message, details } = cause;
|
|
161
|
+
failure = { code, query, message, details };
|
|
162
162
|
}
|
|
163
163
|
else
|
|
164
164
|
return undefined;
|
|
@@ -168,7 +168,7 @@ export function queryFailure(engine, cause) {
|
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
170
170
|
* What a journaled Step failed with, as the Workflow sees it: its declared business error, rebuilt
|
|
171
|
-
* through the definition's own factory, its
|
|
171
|
+
* through the definition's own factory, its Query's `QueryError` or S12 refusal, or
|
|
172
172
|
* `StepExhausted` once the engine spent its retry budget or the Step threw an exhaustion caught
|
|
173
173
|
* from an earlier Step. A replay throws what the live run threw.
|
|
174
174
|
*/
|
|
@@ -180,10 +180,11 @@ export function replayedFailure(engine, cause, definition, step) {
|
|
|
180
180
|
const query = metadata?.[QUERY_FAILURE];
|
|
181
181
|
if (query !== undefined) {
|
|
182
182
|
const failure = JSON.parse(query);
|
|
183
|
+
const id = (failure.query ?? failure.recipe);
|
|
183
184
|
// Only a `QueryError` has a code.
|
|
184
185
|
const error = failure.code === undefined
|
|
185
|
-
? new UndeclaredCrossing(
|
|
186
|
-
: new QueryError(failure.code,
|
|
186
|
+
? new UndeclaredCrossing(id, failure.message)
|
|
187
|
+
: new QueryError(failure.code, id, failure.details);
|
|
187
188
|
error.message = failure.message;
|
|
188
189
|
queryFailures.set(error, step);
|
|
189
190
|
return error;
|
|
@@ -18,7 +18,7 @@ export interface DurableReceiver {
|
|
|
18
18
|
export declare function createDurableReceiver(input: {
|
|
19
19
|
readonly workflows: readonly RuntimeWorkflow[];
|
|
20
20
|
readonly domain: Domain;
|
|
21
|
-
/** The Class requirements the Domain's build declares, which a Step's
|
|
21
|
+
/** The Class requirements the Domain's build declares, which a Step's Query reads are checked against. */
|
|
22
22
|
readonly declared?: readonly DeclaredClass[];
|
|
23
23
|
readonly identity: Identity;
|
|
24
24
|
readonly serving: AdmittedDurableServing;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { declaredErrorFactory } from '../../application/error/index.js';
|
|
2
2
|
import { acceptStepId } from '../../application/workflow/step/index.js';
|
|
3
3
|
import { acceptStepOutput } from '../../application/workflow/step/output.js';
|
|
4
|
-
import {
|
|
4
|
+
import { reportUndeclaredDefinedError, validateOutput } from '../invocation/result/index.js';
|
|
5
5
|
import { BACKOFF, UNAVAILABLE, failedAttemptError, failedAttemptOf, nextAttempt, } from './attempts.js';
|
|
6
6
|
import { decodeEnvelope } from './envelope.js';
|
|
7
7
|
import { queryFailure, replayedFailure, StepExhausted, StepRetryAfter, terminalFailure, uncaughtFailure, } from './failure.js';
|
|
@@ -134,7 +134,7 @@ function durableContext(input, context, envelope) {
|
|
|
134
134
|
if (terminal !== undefined)
|
|
135
135
|
throw terminal;
|
|
136
136
|
// Retried as any failed attempt, and logged: the Workflow does not re-declare it.
|
|
137
|
-
|
|
137
|
+
reportUndeclaredDefinedError(cause, workflow.address);
|
|
138
138
|
throw failedAttemptError(engine, cause, startedAt, now(), step?.repeatsEffects() ?? false);
|
|
139
139
|
}
|
|
140
140
|
finally {
|
|
@@ -30,7 +30,7 @@ export type StepAuthorities = (attempt: StepAttempt) => StepAuthorityBinding;
|
|
|
30
30
|
export declare function sessionSteps(input: {
|
|
31
31
|
readonly executor: Executor;
|
|
32
32
|
readonly domain: Domain;
|
|
33
|
-
/** The Class requirements the Domain's build declares: a
|
|
33
|
+
/** The Class requirements the Domain's build declares: a Query's reads are checked against them. */
|
|
34
34
|
readonly declared: readonly DeclaredClass[];
|
|
35
35
|
readonly integrations: IntegrationClientFactory<Integrations>;
|
|
36
36
|
}): StepAuthorities;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { edgeClass as kernelEdgeClass, nodeClass as kernelNodeClass, type DirectedEdgeClass, type DirectedEdgeInput, type Lazy, type NodeClass, type NodeClassInput as KernelNodeClassInput, type NodeClassPolicyInput, type Policy, type UndirectedEdgeClass, type UndirectedEdgeInput } from '@astrale-os/kernel-dsl/v1/builder';
|
|
1
|
+
import { edgeClass as kernelEdgeClass, nodeClass as kernelNodeClass, type DirectedEdgeClass, type DirectedEdgeInput, type Lazy, type NodeClass, type NodeClassInput as KernelNodeClassInput, type NodeClassPolicyInput as NodeClassReadRule, type Policy, type UndirectedEdgeClass, type UndirectedEdgeInput } from '@astrale-os/kernel-dsl/v1/builder';
|
|
2
2
|
import { type ClassIcon } from './class-icon.js';
|
|
3
3
|
/**
|
|
4
4
|
* SDK Node Class input: every author must make an explicit, admitted icon choice, and every
|
|
@@ -9,12 +9,7 @@ export type NodeClassInput = Omit<KernelNodeClassInput, 'icon'> & {
|
|
|
9
9
|
};
|
|
10
10
|
/** Who may read or traverse an Edge Class: a named Policy, or the constant `true` or `false`. */
|
|
11
11
|
export type ClassReadRule = Lazy<Policy> | boolean;
|
|
12
|
-
|
|
13
|
-
* Who may read or traverse a Node Class: a named Policy, the constant `true` or `false`, or Policy
|
|
14
|
-
* checks over the observed Node (`self`) and fixed members (`ref(...)`), composed as the checks of
|
|
15
|
-
* an authorized callable.
|
|
16
|
-
*/
|
|
17
|
-
export type NodeClassReadRule = NodeClassPolicyInput;
|
|
12
|
+
export type { NodeClassReadRule };
|
|
18
13
|
/**
|
|
19
14
|
* The observation rules of a concrete Class. A Node stays traversable through either rule, so a
|
|
20
15
|
* read rule other than `true` leaves every caller able to reach it, and to select its reference,
|
|
@@ -84,4 +79,3 @@ export declare const edgeClass: Readonly<{
|
|
|
84
79
|
export declare function defineClass(config: NodeInput): NodeClass;
|
|
85
80
|
export declare function defineClass(config: DirectedInput): DirectedEdgeClass;
|
|
86
81
|
export declare function defineClass(config: UndirectedInput): UndirectedEdgeClass;
|
|
87
|
-
export {};
|
|
@@ -18,7 +18,7 @@ export type { ClassIcon } from './class-icon.js';
|
|
|
18
18
|
export type { StoredPropertyInputOf } from './property-input.js';
|
|
19
19
|
export type { CallablePolicyBuilder, CallablePolicyContext, ClassRuleBuilder, ClassRuleContext, PolicyCheckContext, CallableProjection, AuthoredMethodProjection, AuthoredPropertyProjection, ClassIdentityProjection, ClassOwnerProjection, CoreEdge, CoreEndpoint, CoreNode, DefinedSchema, DirectedEdgeClass, ClassReferenceProjection, ClassProjection, FunctionProjection, EdgeClass, Function, Method, MethodProjection, Lazy, NodeClass, Policy, PolicyExistsContext, PolicyNodeBinder, PolicyPatternContext, Property, PropertyProjection, ResolvedDomainOfInput, View, } from '@astrale-os/kernel-dsl/v1/builder';
|
|
20
20
|
export type { Array, Object, Value } from '@astrale-os/kernel-dsl/value';
|
|
21
|
-
export type { CallableAdmission, CallableExecution, ClassKind, DirectedEdgeContract, EdgeClassPolicies, NodeClassDefinition, PolicyCheckObject, PolicyObjectRef, PropertyFacet, PropertyImmutability, StateTopology, UndirectedEdgeContract, } from '@astrale-os/kernel-dsl/v1/language';
|
|
21
|
+
export type { CallableAdmission, CallableExecution, ClassKind, DirectedEdgeContract, EdgeClassPolicies, EdgePropertyDefinition, NodeClassDefinition, PolicyCheckObject, PolicyObjectRef, PropertyFacet, PropertyImmutability, ResolvedPropertyCollection, StateTopology, UndirectedEdgeContract, } from '@astrale-os/kernel-dsl/v1/language';
|
|
22
22
|
export type { DomainSchema } from '@astrale-os/kernel-dsl/v1/schema';
|
|
23
23
|
/** Kernel-owned Schema values used by authored product Schemas and graph operations. */
|
|
24
24
|
export { AuthorityOperationOrder, AuthorityOperations, AuthorityRelations, KernelRootFunctions, OperationCore, operationOf, } from '@astrale-os/kernel-core/schema';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** Generated from the Kernel Schema of @astrale-os/kernel-core 1.0.0-beta.
|
|
1
|
+
/** Generated from the Kernel Schema of @astrale-os/kernel-core 1.0.0-beta.26, reduced to its Classes. Regenerate with pnpm sync:kernel-schema. */
|
|
2
2
|
export declare const kernelCompiledSchema: string;
|