@proofoftech/flowsafe 0.19.0 → 0.20.0
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/CHANGELOG.md +25 -0
- package/README.md +15 -0
- package/deployment-identity-protocol.d.mts +45 -1
- package/deployment-identity-protocol.mjs +169 -5
- package/dist/agent-host/index.d.ts +1 -1
- package/dist/agent-host/index.d.ts.map +1 -1
- package/dist/agent-host/index.js.map +1 -1
- package/dist/agent-host/router.d.ts.map +1 -1
- package/dist/agent-host/router.js +6 -2
- package/dist/agent-host/router.js.map +1 -1
- package/dist/agent-host/thread-host.d.ts +11 -0
- package/dist/agent-host/thread-host.d.ts.map +1 -1
- package/dist/agent-host/thread-host.js +53 -1
- package/dist/agent-host/thread-host.js.map +1 -1
- package/dist/agent-host/thread-topology.d.ts +35 -1
- package/dist/agent-host/thread-topology.d.ts.map +1 -1
- package/dist/agent-host/thread-topology.js +103 -7
- package/dist/agent-host/thread-topology.js.map +1 -1
- package/dist/agent-runner/durable-agent-runner.d.ts +19 -4
- package/dist/agent-runner/durable-agent-runner.d.ts.map +1 -1
- package/dist/agent-runner/durable-agent-runner.js +58 -28
- package/dist/agent-runner/durable-agent-runner.js.map +1 -1
- package/dist/approval-api/d1-store.d.ts.map +1 -1
- package/dist/approval-api/d1-store.js +6 -3
- package/dist/approval-api/d1-store.js.map +1 -1
- package/dist/approval-api/principal-identity.d.ts +32 -0
- package/dist/approval-api/principal-identity.d.ts.map +1 -0
- package/dist/approval-api/principal-identity.js +69 -0
- package/dist/approval-api/principal-identity.js.map +1 -0
- package/dist/approval-api/principal.d.ts +9 -12
- package/dist/approval-api/principal.d.ts.map +1 -1
- package/dist/approval-api/principal.js +9 -45
- package/dist/approval-api/principal.js.map +1 -1
- package/dist/approval-api/router.d.ts.map +1 -1
- package/dist/approval-api/router.js +9 -1
- package/dist/approval-api/router.js.map +1 -1
- package/dist/approval-api/service.d.ts +19 -0
- package/dist/approval-api/service.d.ts.map +1 -1
- package/dist/approval-api/service.js +41 -10
- package/dist/approval-api/service.js.map +1 -1
- package/dist/approval-api/types.d.ts +12 -0
- package/dist/approval-api/types.d.ts.map +1 -1
- package/dist/approval-api/types.js +12 -0
- package/dist/approval-api/types.js.map +1 -1
- package/dist/background-tasks/host.d.ts +127 -14
- package/dist/background-tasks/host.d.ts.map +1 -1
- package/dist/background-tasks/host.js +579 -50
- package/dist/background-tasks/host.js.map +1 -1
- package/dist/background-tasks/index.d.ts +2 -2
- package/dist/background-tasks/index.d.ts.map +1 -1
- package/dist/background-tasks/index.js +11 -6
- package/dist/background-tasks/index.js.map +1 -1
- package/dist/background-tasks/routes.d.ts +19 -2
- package/dist/background-tasks/routes.d.ts.map +1 -1
- package/dist/background-tasks/routes.js +4 -4
- package/dist/background-tasks/routes.js.map +1 -1
- package/dist/deployment-identity-protocol.d.ts +2 -2
- package/dist/deployment-identity-protocol.d.ts.map +1 -1
- package/dist/deployment-identity-protocol.js +1 -1
- package/dist/deployment-identity-protocol.js.map +1 -1
- package/dist/do-runner/cause-chain.d.ts +53 -0
- package/dist/do-runner/cause-chain.d.ts.map +1 -0
- package/dist/do-runner/cause-chain.js +96 -0
- package/dist/do-runner/cause-chain.js.map +1 -0
- package/dist/do-runner/d1-storage.d.ts +109 -5
- package/dist/do-runner/d1-storage.d.ts.map +1 -1
- package/dist/do-runner/d1-storage.js +289 -44
- package/dist/do-runner/d1-storage.js.map +1 -1
- package/dist/do-runner/deployment-identity.d.ts +29 -5
- package/dist/do-runner/deployment-identity.d.ts.map +1 -1
- package/dist/do-runner/deployment-identity.js +23 -6
- package/dist/do-runner/deployment-identity.js.map +1 -1
- package/dist/do-runner/do-error-response.d.ts +4 -23
- package/dist/do-runner/do-error-response.d.ts.map +1 -1
- package/dist/do-runner/do-error-response.js +19 -24
- package/dist/do-runner/do-error-response.js.map +1 -1
- package/dist/do-runner/do-status-error.d.ts +37 -0
- package/dist/do-runner/do-status-error.d.ts.map +1 -0
- package/dist/do-runner/do-status-error.js +42 -0
- package/dist/do-runner/do-status-error.js.map +1 -0
- package/dist/do-runner/durable-object.d.ts +2 -1
- package/dist/do-runner/durable-object.d.ts.map +1 -1
- package/dist/do-runner/durable-object.js +205 -19
- package/dist/do-runner/durable-object.js.map +1 -1
- package/dist/do-runner/execution-fence.d.ts +335 -0
- package/dist/do-runner/execution-fence.d.ts.map +1 -0
- package/dist/do-runner/execution-fence.js +534 -0
- package/dist/do-runner/execution-fence.js.map +1 -0
- package/dist/do-runner/index.d.ts +10 -3
- package/dist/do-runner/index.d.ts.map +1 -1
- package/dist/do-runner/index.js +16 -3
- package/dist/do-runner/index.js.map +1 -1
- package/dist/do-runner/init.d.ts +82 -1
- package/dist/do-runner/init.d.ts.map +1 -1
- package/dist/do-runner/init.js +58 -3
- package/dist/do-runner/init.js.map +1 -1
- package/dist/do-runner/inventory.d.ts +294 -0
- package/dist/do-runner/inventory.d.ts.map +1 -0
- package/dist/do-runner/inventory.js +811 -0
- package/dist/do-runner/inventory.js.map +1 -0
- package/dist/do-runner/notification-predicate.d.ts +8 -0
- package/dist/do-runner/notification-predicate.d.ts.map +1 -0
- package/dist/do-runner/notification-predicate.js +9 -0
- package/dist/do-runner/notification-predicate.js.map +1 -0
- package/dist/do-runner/runtime.d.ts +83 -0
- package/dist/do-runner/runtime.d.ts.map +1 -1
- package/dist/do-runner/runtime.js +131 -4
- package/dist/do-runner/runtime.js.map +1 -1
- package/dist/do-runner/start-idempotency.d.ts +508 -0
- package/dist/do-runner/start-idempotency.d.ts.map +1 -0
- package/dist/do-runner/start-idempotency.js +886 -0
- package/dist/do-runner/start-idempotency.js.map +1 -0
- package/dist/goals/objective-routes.d.ts +14 -0
- package/dist/goals/objective-routes.d.ts.map +1 -1
- package/dist/goals/objective-routes.js +45 -24
- package/dist/goals/objective-routes.js.map +1 -1
- package/dist/host-kit/do-run-topology.d.ts +15 -0
- package/dist/host-kit/do-run-topology.d.ts.map +1 -1
- package/dist/host-kit/do-run-topology.js +22 -1
- package/dist/host-kit/do-run-topology.js.map +1 -1
- package/dist/host-kit/flowsafe-worker.d.ts +11 -0
- package/dist/host-kit/flowsafe-worker.d.ts.map +1 -1
- package/dist/host-kit/flowsafe-worker.js +343 -62
- package/dist/host-kit/flowsafe-worker.js.map +1 -1
- package/dist/host-kit/host-approval-service.d.ts +20 -0
- package/dist/host-kit/host-approval-service.d.ts.map +1 -1
- package/dist/host-kit/host-approval-service.js +6 -0
- package/dist/host-kit/host-approval-service.js.map +1 -1
- package/dist/host-kit/index.d.ts +2 -2
- package/dist/host-kit/index.d.ts.map +1 -1
- package/dist/host-kit/index.js +1 -1
- package/dist/host-kit/index.js.map +1 -1
- package/dist/host-kit/run-route-error.d.ts +18 -0
- package/dist/host-kit/run-route-error.d.ts.map +1 -1
- package/dist/host-kit/run-route-error.js +23 -0
- package/dist/host-kit/run-route-error.js.map +1 -1
- package/dist/host-kit/run-router.d.ts +58 -1
- package/dist/host-kit/run-router.d.ts.map +1 -1
- package/dist/host-kit/run-router.js +120 -11
- package/dist/host-kit/run-router.js.map +1 -1
- package/dist/host-kit/stream-router.d.ts.map +1 -1
- package/dist/host-kit/stream-router.js +18 -9
- package/dist/host-kit/stream-router.js.map +1 -1
- package/dist/schedules/router.d.ts +15 -0
- package/dist/schedules/router.d.ts.map +1 -1
- package/dist/schedules/router.js +47 -17
- package/dist/schedules/router.js.map +1 -1
- package/dist/schedules/tick.d.ts +13 -0
- package/dist/schedules/tick.d.ts.map +1 -1
- package/dist/schedules/tick.js +59 -39
- package/dist/schedules/tick.js.map +1 -1
- package/dist/signal-providers/host-do.d.ts +12 -1
- package/dist/signal-providers/host-do.d.ts.map +1 -1
- package/dist/signal-providers/host-do.js +28 -3
- package/dist/signal-providers/host-do.js.map +1 -1
- package/dist/signal-providers/webhook-route.d.ts +14 -0
- package/dist/signal-providers/webhook-route.d.ts.map +1 -1
- package/dist/signal-providers/webhook-route.js +28 -5
- package/dist/signal-providers/webhook-route.js.map +1 -1
- package/dist/signals/notification-dispatch.d.ts +13 -0
- package/dist/signals/notification-dispatch.d.ts.map +1 -1
- package/dist/signals/notification-dispatch.js +20 -1
- package/dist/signals/notification-dispatch.js.map +1 -1
- package/dist/signals/notifications-d1.d.ts +8 -0
- package/dist/signals/notifications-d1.d.ts.map +1 -1
- package/dist/signals/notifications-d1.js +15 -9
- package/dist/signals/notifications-d1.js.map +1 -1
- package/dist/signals/thread-do-routes.d.ts.map +1 -1
- package/dist/signals/thread-do-routes.js +86 -18
- package/dist/signals/thread-do-routes.js.map +1 -1
- package/package.json +1 -1
- package/scripts/seed-deployment-identity.mjs +22 -4
|
@@ -36,7 +36,18 @@ export { assertDeploymentIdentitySecret, DEPLOYMENT_IDENTITY_HEADER, deploymentI
|
|
|
36
36
|
function assertValidTag(tag, caller) {
|
|
37
37
|
assertValidDeploymentTag(tag, caller);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Whether a binding is a D1 database rather than something else bound under the
|
|
41
|
+
* same name.
|
|
42
|
+
*
|
|
43
|
+
* Exported for this package's own modules and deliberately NOT re-exported from
|
|
44
|
+
* `./index.js` — the same posture `safeDecodeSegment` has. It is internal
|
|
45
|
+
* plumbing two files must agree on (durable-object.ts asks the same question of
|
|
46
|
+
* `env.DB` before it insists on a fence), not a contract a consumer should be
|
|
47
|
+
* able to pin; barrel-exporting it would inflate the semver surface of a
|
|
48
|
+
* predicate that exists to describe Cloudflare's binding shapes.
|
|
49
|
+
*/
|
|
50
|
+
export function isDatabaseBinding(db) {
|
|
40
51
|
if ((typeof db !== 'object' && typeof db !== 'function') || db === null) {
|
|
41
52
|
return false;
|
|
42
53
|
}
|
|
@@ -93,13 +104,19 @@ function deploymentIdentityProtocolExecutor(db) {
|
|
|
93
104
|
}
|
|
94
105
|
/**
|
|
95
106
|
* Provisioning-time seeding: stamp the database with its owning deployment's
|
|
96
|
-
* tag. Idempotent for the SAME tag
|
|
97
|
-
* for a DIFFERENT tag — a database is
|
|
98
|
-
* decommissioning deletes it instead.
|
|
107
|
+
* tag, and write its initial execution-fence row. Idempotent for the SAME tag
|
|
108
|
+
* (re-running provisioning is safe); throws for a DIFFERENT tag — a database is
|
|
109
|
+
* never silently re-homed; deployment decommissioning deletes it instead.
|
|
110
|
+
*
|
|
111
|
+
* `initialExecutionFenceState` is REQUIRED and has no default: a host that
|
|
112
|
+
* means to bring a deployment up already locked for a migration must say so,
|
|
113
|
+
* and one that forgets must not silently get an executing deployment. The fence
|
|
114
|
+
* row is INSERT-if-absent, so re-seeding never reopens a fence an operator
|
|
115
|
+
* closed.
|
|
99
116
|
*/
|
|
100
|
-
export async function seedDeploymentIdentity(db, tag) {
|
|
117
|
+
export async function seedDeploymentIdentity(db, tag, initialExecutionFenceState) {
|
|
101
118
|
databaseBinding(db, 'seedDeploymentIdentity');
|
|
102
|
-
await provisionDeploymentIdentityProtocol(deploymentIdentityProtocolExecutor(db), tag);
|
|
119
|
+
await provisionDeploymentIdentityProtocol(deploymentIdentityProtocolExecutor(db), tag, { initialExecutionFenceState });
|
|
103
120
|
}
|
|
104
121
|
/**
|
|
105
122
|
* Read the database's sentinel tag, or undefined when seeding has not completed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment-identity.js","sourceRoot":"","sources":["../../src/do-runner/deployment-identity.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,yGAAyG;AACzG,6EAA6E;AAC7E,+EAA+E;AAC/E,2EAA2E;AAC3E,mEAAmE;AACnE,0EAA0E;AAC1E,+EAA+E;AAC/E,oBAAoB;AACpB,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,kEAAkE;AAClE,2EAA2E;AAC3E,+EAA+E;AAC/E,+EAA+E;AAC/E,iBAAiB;AAEjB,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"deployment-identity.js","sourceRoot":"","sources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;QACf,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAChB,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,wBAAwB,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC,CACjE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,oCAAoC,CACxD,OAAgB,EAChB,KAA6C,EAC7C,GAAY;IAEZ,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,qCAAqC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,QAAQ,GAAI,GAA6B,CAAC,0BAA0B,CAAC;IAC3E,8BAA8B,CAC5B,QAAQ,EACR,sCAAsC,CACvC,CAAC;IACF,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IAC/D,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,CAAC,MAAM,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;QACnE,MAAM,IAAI,uBAAuB,CAC/B,4GAA4G,CAC7G,CAAC;IACJ,CAAC;IACD,OAAO,qCAAqC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC3D,CAAC"}
|
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* ```ts
|
|
7
|
-
* class UnknownSignalError extends DoStatusError {
|
|
8
|
-
* readonly status = 404;
|
|
9
|
-
* }
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
* A CLASS, so opting in is `instanceof` — deliberate and nominal, the posture
|
|
13
|
-
* AuditLogger takes. The structural alternative (any thrown
|
|
14
|
-
* value with a numeric `status`) cannot tell a refusal this DO authored from the
|
|
15
|
-
* arbitrary values its routes throw: an upstream client's `{status: 429}` would
|
|
16
|
-
* become this API's 429, and `{status: 0}` — routine on HTTP-client error
|
|
17
|
-
* objects — would make `new Response` raise inside the very catch whose job is
|
|
18
|
-
* to never throw. Everything unrecognized stays a 500.
|
|
19
|
-
*/
|
|
20
|
-
export declare abstract class DoStatusError extends Error {
|
|
21
|
-
/** The response status. 4xx/5xx only — see doErrorResponse. */
|
|
22
|
-
abstract readonly status: number;
|
|
23
|
-
}
|
|
1
|
+
import type { DoRefusalReason } from './do-status-error.js';
|
|
2
|
+
import { DoStatusError } from './do-status-error.js';
|
|
3
|
+
export type { DoRefusalReason };
|
|
4
|
+
export { DoStatusError };
|
|
24
5
|
/**
|
|
25
6
|
* Map a thrown error to the DO's HTTP response. Anything unrecognized is a 500
|
|
26
7
|
* with its message — the honest answer for a fault this layer did not classify.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"do-error-response.d.ts","sourceRoot":"","sources":["../../src/do-runner/do-error-response.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"do-error-response.d.ts","sourceRoot":"","sources":["../../src/do-runner/do-error-response.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAerD,YAAY,EAAE,eAAe,EAAE,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,CAAC;AA2DzB;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAaxD"}
|
|
@@ -12,28 +12,9 @@
|
|
|
12
12
|
// asked for a run that does not exist" into "I am broken", and the router's
|
|
13
13
|
// RunRouteError passthrough has nothing to pass through.
|
|
14
14
|
import { DeploymentIdentityError } from './deployment-identity.js';
|
|
15
|
+
import { DoStatusError } from './do-status-error.js';
|
|
15
16
|
import { InvalidRunRequestError, RunAlreadyExistsError, RunLifecycleBlockedError, RunNotSuspendedError, RunStateUnreadableError, RunTerminalConflictError, UnknownRunError, UnknownWorkflowError, } from './runtime.js';
|
|
16
|
-
|
|
17
|
-
* The base for a DO's OWN refusal — the taxonomy's extension point, for the
|
|
18
|
-
* statuses the runtime errors above do not cover. A shell declares one
|
|
19
|
-
* (ThreadIdentityError's 403) and so does a host route:
|
|
20
|
-
*
|
|
21
|
-
* ```ts
|
|
22
|
-
* class UnknownSignalError extends DoStatusError {
|
|
23
|
-
* readonly status = 404;
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* A CLASS, so opting in is `instanceof` — deliberate and nominal, the posture
|
|
28
|
-
* AuditLogger takes. The structural alternative (any thrown
|
|
29
|
-
* value with a numeric `status`) cannot tell a refusal this DO authored from the
|
|
30
|
-
* arbitrary values its routes throw: an upstream client's `{status: 429}` would
|
|
31
|
-
* become this API's 429, and `{status: 0}` — routine on HTTP-client error
|
|
32
|
-
* objects — would make `new Response` raise inside the very catch whose job is
|
|
33
|
-
* to never throw. Everything unrecognized stays a 500.
|
|
34
|
-
*/
|
|
35
|
-
export class DoStatusError extends Error {
|
|
36
|
-
}
|
|
17
|
+
export { DoStatusError };
|
|
37
18
|
function statusOf(error) {
|
|
38
19
|
// Mis-provisioned deployment (env tag vs D1 sentinel): the operator's
|
|
39
20
|
// problem, not the caller's — 503 so monitors separate a wiring fault from
|
|
@@ -75,17 +56,31 @@ function statusOf(error) {
|
|
|
75
56
|
}
|
|
76
57
|
return undefined;
|
|
77
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* The structured reason a refusal publishes, or undefined. Two channels, one
|
|
61
|
+
* renderer: RunLifecycleBlockedError predates DoStatusError and is a plain
|
|
62
|
+
* Error, while every refusal authored since carries its reason on the
|
|
63
|
+
* taxonomy's own base (ExecutionFencedError's EXECUTION_FENCED among them).
|
|
64
|
+
* Anything else has no reason to publish — an unclassified fault must not
|
|
65
|
+
* grow a machine-readable code it never defined.
|
|
66
|
+
*/
|
|
67
|
+
function reasonOf(error) {
|
|
68
|
+
if (error instanceof RunLifecycleBlockedError)
|
|
69
|
+
return error.reason;
|
|
70
|
+
if (error instanceof DoStatusError)
|
|
71
|
+
return error.reason;
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
78
74
|
/**
|
|
79
75
|
* Map a thrown error to the DO's HTTP response. Anything unrecognized is a 500
|
|
80
76
|
* with its message — the honest answer for a fault this layer did not classify.
|
|
81
77
|
*/
|
|
82
78
|
export function doErrorResponse(error) {
|
|
83
79
|
const message = error instanceof Error ? error.message : String(error);
|
|
80
|
+
const reason = reasonOf(error);
|
|
84
81
|
return new Response(JSON.stringify({
|
|
85
82
|
error: message,
|
|
86
|
-
...(
|
|
87
|
-
? { reason: error.reason }
|
|
88
|
-
: {}),
|
|
83
|
+
...(reason === undefined ? {} : { reason }),
|
|
89
84
|
}), {
|
|
90
85
|
status: statusOf(error) ?? 500,
|
|
91
86
|
headers: { 'content-type': 'application/json' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"do-error-response.js","sourceRoot":"","sources":["../../src/do-runner/do-error-response.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,wDAAwD;AACxD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,mEAAmE;AACnE,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,2EAA2E;AAC3E,4EAA4E;AAC5E,yDAAyD;AAEzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"do-error-response.js","sourceRoot":"","sources":["../../src/do-runner/do-error-response.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,wDAAwD;AACxD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,8EAA8E;AAC9E,mEAAmE;AACnE,EAAE;AACF,+EAA+E;AAC/E,4EAA4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,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,YAAY,wBAAwB;QAAE,OAAO,KAAK,CAAC,MAAM,CAAC;IACnE,IAAI,KAAK,YAAY,aAAa;QAAE,OAAO,KAAK,CAAC,MAAM,CAAC;IACxD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,OAAO,IAAI,QAAQ,CACjB,IAAI,CAAC,SAAS,CAAC;QACb,KAAK,EAAE,OAAO;QACd,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC;KAC5C,CAAC,EACF;QACE,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG;QAC9B,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;KAChD,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** A structured refusal code doErrorResponse renders into the body. */
|
|
2
|
+
export interface DoRefusalReason {
|
|
3
|
+
/** SCREAMING_SNAKE, per the taxonomy — see do-error-response.ts. */
|
|
4
|
+
readonly code: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The base for a DO's OWN refusal — the taxonomy's extension point, for the
|
|
8
|
+
* statuses the runtime errors do not cover. A shell declares one
|
|
9
|
+
* (ThreadIdentityError's 403) and so does a host route:
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* class UnknownSignalError extends DoStatusError {
|
|
13
|
+
* readonly status = 404;
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* A CLASS, so opting in is `instanceof` — deliberate and nominal, the posture
|
|
18
|
+
* AuditLogger takes. The structural alternative (any thrown
|
|
19
|
+
* value with a numeric `status`) cannot tell a refusal this DO authored from the
|
|
20
|
+
* arbitrary values its routes throw: an upstream client's `{status: 429}` would
|
|
21
|
+
* become this API's 429, and `{status: 0}` — routine on HTTP-client error
|
|
22
|
+
* objects — would make `new Response` raise inside the very catch whose job is
|
|
23
|
+
* to never throw. Everything unrecognized stays a 500.
|
|
24
|
+
*/
|
|
25
|
+
export declare abstract class DoStatusError extends Error {
|
|
26
|
+
/** The response status. 4xx/5xx only — see doErrorResponse. */
|
|
27
|
+
abstract readonly status: number;
|
|
28
|
+
/**
|
|
29
|
+
* An optional machine-readable reason, rendered into the response body
|
|
30
|
+
* alongside the message. DECLARED HERE rather than sniffed structurally at
|
|
31
|
+
* the mapper so the channel is part of the contract a subclass opts into,
|
|
32
|
+
* and so the mapper needs no import of any subclass to render it (see the
|
|
33
|
+
* header for why that import must not exist).
|
|
34
|
+
*/
|
|
35
|
+
readonly reason?: DoRefusalReason;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=do-status-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"do-status-error.d.ts","sourceRoot":"","sources":["../../src/do-runner/do-status-error.ts"],"names":[],"mappings":"AAaA,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,8BAAsB,aAAc,SAAQ,KAAK;IAC/C,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAEjC;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CACnC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// The taxonomy's extension point, on its own leaf.
|
|
3
|
+
//
|
|
4
|
+
// It lives apart from doErrorResponse (which imports it, and re-exports it as
|
|
5
|
+
// the public name) for one structural reason: every module that declares a
|
|
6
|
+
// refusal must `extends` this class at module-evaluation time, and
|
|
7
|
+
// doErrorResponse's own imports reach the runtime and the deployment identity
|
|
8
|
+
// guard. A refusal module importing the mapper would therefore close an import
|
|
9
|
+
// cycle whose failure mode is a temporal-dead-zone ReferenceError at
|
|
10
|
+
// `class X extends DoStatusError` — order-dependent, and invisible until some
|
|
11
|
+
// unrelated import order changes. A leaf with no imports of its own cannot be
|
|
12
|
+
// half-evaluated when a subclass needs it.
|
|
13
|
+
/**
|
|
14
|
+
* The base for a DO's OWN refusal — the taxonomy's extension point, for the
|
|
15
|
+
* statuses the runtime errors do not cover. A shell declares one
|
|
16
|
+
* (ThreadIdentityError's 403) and so does a host route:
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* class UnknownSignalError extends DoStatusError {
|
|
20
|
+
* readonly status = 404;
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* A CLASS, so opting in is `instanceof` — deliberate and nominal, the posture
|
|
25
|
+
* AuditLogger takes. The structural alternative (any thrown
|
|
26
|
+
* value with a numeric `status`) cannot tell a refusal this DO authored from the
|
|
27
|
+
* arbitrary values its routes throw: an upstream client's `{status: 429}` would
|
|
28
|
+
* become this API's 429, and `{status: 0}` — routine on HTTP-client error
|
|
29
|
+
* objects — would make `new Response` raise inside the very catch whose job is
|
|
30
|
+
* to never throw. Everything unrecognized stays a 500.
|
|
31
|
+
*/
|
|
32
|
+
export class DoStatusError extends Error {
|
|
33
|
+
/**
|
|
34
|
+
* An optional machine-readable reason, rendered into the response body
|
|
35
|
+
* alongside the message. DECLARED HERE rather than sniffed structurally at
|
|
36
|
+
* the mapper so the channel is part of the contract a subclass opts into,
|
|
37
|
+
* and so the mapper needs no import of any subclass to render it (see the
|
|
38
|
+
* header for why that import must not exist).
|
|
39
|
+
*/
|
|
40
|
+
reason;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=do-status-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"do-status-error.js","sourceRoot":"","sources":["../../src/do-runner/do-status-error.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,mDAAmD;AACnD,EAAE;AACF,8EAA8E;AAC9E,2EAA2E;AAC3E,mEAAmE;AACnE,8EAA8E;AAC9E,+EAA+E;AAC/E,qEAAqE;AACrE,8EAA8E;AAC9E,8EAA8E;AAC9E,2CAA2C;AAQ3C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAgB,aAAc,SAAQ,KAAK;IAI/C;;;;;;OAMG;IACM,MAAM,CAAmB;CACnC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ExecutionPrincipalKind } from '../approval-api/principal.js';
|
|
2
2
|
import type { DurableObjectRunnerState, WebSocketLike } from './cf-types.js';
|
|
3
|
-
import {
|
|
3
|
+
import { RunnerRuntime } from './runtime.js';
|
|
4
4
|
import { type ScheduleSourceStore } from './schedule-source.js';
|
|
5
5
|
export interface DurableObjectRunOwner {
|
|
6
6
|
readonly kind: ExecutionPrincipalKind;
|
|
@@ -22,6 +22,7 @@ export interface DurableObjectRunLifecycleHooks {
|
|
|
22
22
|
abandonApprovals(workflowId: string, runId: string, status: 'cancelled' | 'timed_out'): Promise<void>;
|
|
23
23
|
discardScheduleDispatch?(scheduleId: string, dispatchId: string, runId: string): Promise<void>;
|
|
24
24
|
}
|
|
25
|
+
export declare const RUN_OWNER_RECOVERY_DELAY_MS = 60000;
|
|
25
26
|
export declare abstract class DurableObjectRunner<TEnv = unknown> {
|
|
26
27
|
#private;
|
|
27
28
|
protected readonly env: TEnv;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durable-object.d.ts","sourceRoot":"","sources":["../../src/do-runner/durable-object.ts"],"names":[],"mappings":"AAcA,OAAO,EAGL,KAAK,sBAAsB,EAG5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"durable-object.d.ts","sourceRoot":"","sources":["../../src/do-runner/durable-object.ts"],"names":[],"mappings":"AAcA,OAAO,EAGL,KAAK,sBAAsB,EAG5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAkB7E,OAAO,EAKL,aAAa,EAId,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,sBAAsB,CAAC;AAqB9B,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,8BAA8B;IAC7C,KAAK,CACH,IAAI,EAAE,KAAK,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,EAChD,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;IAC9C,UAAU,CACR,MAAM,EAAE,SAAS;QAAE,IAAI,EAAE,KAAK,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,EACtD,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,iBAAiB,CACf,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,SAAS;QAAE,IAAI,EAAE,KAAK,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EAAE,GACtD,OAAO,CAAC,IAAI,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