@fungi.computer/puffball 0.0.0-stage → 0.0.1
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/LICENSE +21 -0
- package/README.md +443 -2
- package/dist/app-api.d.ts +7 -0
- package/dist/app-api.js +61 -0
- package/dist/app-backend-binding-vocabulary.d.ts +299 -0
- package/dist/app-backend-binding-vocabulary.js +257 -0
- package/dist/app-backend-bindings.d.ts +21 -0
- package/dist/app-backend-bindings.js +47 -0
- package/dist/app-declaration.d.ts +46 -0
- package/dist/app-declaration.js +115 -0
- package/dist/app-event-facts.d.ts +40 -0
- package/dist/app-event-facts.js +28 -0
- package/dist/app-method-context.d.ts +109 -0
- package/dist/app-method-context.js +9 -0
- package/dist/app-method-runtime.d.ts +86 -0
- package/dist/app-method-runtime.js +122 -0
- package/dist/app-origin-paths.d.ts +6 -0
- package/dist/app-origin-paths.js +6 -0
- package/dist/app-vocabulary.d.ts +189 -0
- package/dist/app-vocabulary.js +103 -0
- package/dist/app.d.ts +379 -0
- package/dist/app.js +71 -0
- package/dist/artifact-dispositions.d.ts +115 -0
- package/dist/artifact-dispositions.js +234 -0
- package/dist/assets.d.ts +54 -0
- package/dist/assets.js +89 -0
- package/dist/backend.d.ts +41 -0
- package/dist/backend.js +29 -0
- package/dist/background-replay.d.ts +115 -0
- package/dist/background-replay.js +175 -0
- package/dist/buyer-references.d.ts +69 -0
- package/dist/buyer-references.js +154 -0
- package/dist/cloudflare-assets.d.ts +48 -0
- package/dist/cloudflare-assets.js +105 -0
- package/dist/cloudflare.d.ts +254 -0
- package/dist/cloudflare.js +1619 -0
- package/dist/effect.d.ts +73 -0
- package/dist/effect.js +325 -0
- package/dist/git-representation.d.ts +13 -0
- package/dist/git-representation.js +16 -0
- package/dist/inbox.d.ts +132 -0
- package/dist/inbox.js +81 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +85 -0
- package/dist/internal/app-description.d.ts +14 -0
- package/dist/internal/app-description.js +98 -0
- package/dist/internal/app-release-artifact-reader.d.ts +26 -0
- package/dist/internal/app-release-artifact-reader.js +1 -0
- package/dist/internal/app-release-contract.d.ts +540 -0
- package/dist/internal/app-release-contract.js +169 -0
- package/dist/internal/app-release-schema.d.ts +1676 -0
- package/dist/internal/app-release-schema.js +386 -0
- package/dist/internal/app-release-store.d.ts +47 -0
- package/dist/internal/app-release-store.js +1 -0
- package/dist/internal/background-sync.d.ts +7 -0
- package/dist/internal/background-sync.js +10 -0
- package/dist/internal/deterministic-memory-app-release-store.d.ts +14 -0
- package/dist/internal/deterministic-memory-app-release-store.js +319 -0
- package/dist/internal/failure.d.ts +2 -0
- package/dist/internal/failure.js +9 -0
- package/dist/internal/immutable-release-material.d.ts +3 -0
- package/dist/internal/immutable-release-material.js +13 -0
- package/dist/internal/promise-app-release-store-adapter.d.ts +9 -0
- package/dist/internal/promise-app-release-store-adapter.js +65 -0
- package/dist/internal/promise-artifact-reader-adapter.d.ts +9 -0
- package/dist/internal/promise-artifact-reader-adapter.js +18 -0
- package/dist/internal/public-route-sql.d.ts +10 -0
- package/dist/internal/public-route-sql.js +239 -0
- package/dist/internal/public-website-authority.d.ts +338 -0
- package/dist/internal/public-website-authority.js +50 -0
- package/dist/internal/public-website-delivery.d.ts +59 -0
- package/dist/internal/public-website-delivery.js +232 -0
- package/dist/internal/public-website-fetch.d.ts +8 -0
- package/dist/internal/public-website-fetch.js +54 -0
- package/dist/internal/release-transition-material.d.ts +3 -0
- package/dist/internal/release-transition-material.js +11 -0
- package/dist/internal/verified-artifact-snapshot.d.ts +41 -0
- package/dist/internal/verified-artifact-snapshot.js +91 -0
- package/dist/public-route-moderation.d.ts +83 -0
- package/dist/public-route-moderation.js +236 -0
- package/dist/public-route-policy.d.ts +51 -0
- package/dist/public-route-policy.js +88 -0
- package/dist/public-routes.d.ts +34 -0
- package/dist/public-routes.js +136 -0
- package/dist/publisher.d.ts +61 -0
- package/dist/publisher.js +16 -0
- package/dist/safety-takedown.d.ts +56 -0
- package/dist/safety-takedown.js +146 -0
- package/dist/seller-closure-notice.d.ts +14 -0
- package/dist/seller-closure-notice.js +14 -0
- package/dist/seller-closure.d.ts +15 -0
- package/dist/seller-closure.js +31 -0
- package/dist/testing.d.ts +8 -0
- package/dist/testing.js +47 -0
- package/docs/api/README.md +26 -0
- package/docs/api/app-backend-binding-vocabulary.md +276 -0
- package/docs/api/app-backend-bindings.md +141 -0
- package/docs/api/app-event-facts.md +110 -0
- package/docs/api/app-method-context.md +166 -0
- package/docs/api/app-method-runtime.md +330 -0
- package/docs/api/backend.md +108 -0
- package/docs/api/background-replay.md +516 -0
- package/docs/api/cloudflare.md +1044 -0
- package/docs/api/effect.md +2429 -0
- package/docs/api/git-representation.md +56 -0
- package/docs/api/inbox.md +289 -0
- package/docs/api/index.md +2868 -0
- package/docs/api/publisher.md +147 -0
- package/docs/api/testing.md +31 -0
- package/package.json +158 -3
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
<!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
|
|
2
|
+
|
|
3
|
+
[**@fungi.computer/puffball**](README.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
[@fungi.computer/puffball](README.md) / background-replay
|
|
8
|
+
|
|
9
|
+
# background-replay
|
|
10
|
+
|
|
11
|
+
## Type Aliases
|
|
12
|
+
|
|
13
|
+
### BackgroundOrigin
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type BackgroundOrigin = z.output<typeof backgroundOriginSchema>;
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Origin evidence, never a retained grant or credential.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
### ClaimedJobAdmission
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
type ClaimedJobAdmission = z.output<typeof claimedJobAdmissionSchema>;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
A claim either passes origin admission or refuses before binding effects.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### BackgroundBinding
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
type BackgroundBinding = Readonly<{
|
|
37
|
+
admit: (origin) => Promise<ClaimedJobAdmission>;
|
|
38
|
+
}>;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Host-minted replay port; an App cannot declare this binding.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
### BackgroundWake
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
type BackgroundWake = z.output<typeof backgroundWakeSchema>;
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
A host wake cannot confer authority without fresh directory and method
|
|
52
|
+
admission.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### BackgroundMember
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
type BackgroundMember = BackgroundWake["actor"];
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
A retained identity eligible for member-only replay.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### BackgroundSyncRefusal
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
type BackgroundSyncRefusal = z.output<typeof backgroundSyncRefusalSchema>;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
One available App's member-lane cleanup, delivered with zero binding grants.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### BackgroundRefusalCode
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
type BackgroundRefusalCode = z.output<typeof backgroundRefusalCodeSchema>;
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Closed, durable refusal reasons for the affected member lane.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### BackgroundAdmission
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
type BackgroundAdmission =
|
|
90
|
+
| Readonly<{
|
|
91
|
+
kind: "admitted";
|
|
92
|
+
context: AppMethodCallContext;
|
|
93
|
+
}>
|
|
94
|
+
| Readonly<{
|
|
95
|
+
kind: "refused";
|
|
96
|
+
code:
|
|
97
|
+
| "level_too_low"
|
|
98
|
+
| "requires_not_granted"
|
|
99
|
+
| "not_approved"
|
|
100
|
+
| "denied"
|
|
101
|
+
| "unavailable"
|
|
102
|
+
| "stale_authority";
|
|
103
|
+
}>;
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Existing method admission outcomes interpreted by the replay owner.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### BackgroundReplayPorts
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
type BackgroundReplayPorts<Principal> = Readonly<{
|
|
114
|
+
resolve: (actor) => Promise<Principal | null>;
|
|
115
|
+
admit: (principal, wake) => Promise<BackgroundAdmission>;
|
|
116
|
+
}>;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Directory resolution and fresh continuation admission remain host-owned.
|
|
120
|
+
|
|
121
|
+
#### Type Parameters
|
|
122
|
+
|
|
123
|
+
| Type Parameter |
|
|
124
|
+
| -------------- |
|
|
125
|
+
| `Principal` |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### BackgroundReplayDecision
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
type BackgroundReplayDecision =
|
|
133
|
+
| Readonly<{
|
|
134
|
+
kind: "admitted";
|
|
135
|
+
context: AppMethodCallContext;
|
|
136
|
+
}>
|
|
137
|
+
| Readonly<{
|
|
138
|
+
kind: "refused";
|
|
139
|
+
code: BackgroundRefusalCode;
|
|
140
|
+
}>
|
|
141
|
+
| Readonly<{
|
|
142
|
+
kind: "retry";
|
|
143
|
+
}>;
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
A refused wake settles its lane; retry uses the existing Carrier backoff.
|
|
147
|
+
|
|
148
|
+
## Variables
|
|
149
|
+
|
|
150
|
+
### backgroundOriginSchema
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
const backgroundOriginSchema: ZodMiniObject<
|
|
154
|
+
{
|
|
155
|
+
method: ZodMiniString<string>;
|
|
156
|
+
seal: ZodMiniString<string>;
|
|
157
|
+
},
|
|
158
|
+
$strict
|
|
159
|
+
> = appMethodCallerSchema.shape.backgroundOrigin.def.innerType;
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The caller's single lightweight grammar for a host-sealed enqueue origin.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
### claimedJobAdmissionSchema
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
const claimedJobAdmissionSchema: ZodUnion<
|
|
170
|
+
readonly [
|
|
171
|
+
ZodObject<
|
|
172
|
+
{
|
|
173
|
+
kind: ZodLiteral<"admitted">;
|
|
174
|
+
},
|
|
175
|
+
$strict
|
|
176
|
+
>,
|
|
177
|
+
ZodObject<
|
|
178
|
+
{
|
|
179
|
+
kind: ZodLiteral<"refused">;
|
|
180
|
+
code: ZodLiteral<"access_changed">;
|
|
181
|
+
},
|
|
182
|
+
$strict
|
|
183
|
+
>,
|
|
184
|
+
]
|
|
185
|
+
>;
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
The closed result of checking a claimed job's origin in a fresh replay frame.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### backgroundWakeSchema
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
const backgroundWakeSchema: ZodObject<
|
|
196
|
+
{
|
|
197
|
+
installationId: ZodString;
|
|
198
|
+
actor: ZodObject<
|
|
199
|
+
{
|
|
200
|
+
kind: ZodMiniLiteral<"member">;
|
|
201
|
+
memberId: ZodMiniString<string>;
|
|
202
|
+
},
|
|
203
|
+
$strict
|
|
204
|
+
>;
|
|
205
|
+
lane: ZodString;
|
|
206
|
+
originMethod: ZodString;
|
|
207
|
+
observed: ZodObject<
|
|
208
|
+
{
|
|
209
|
+
authorityVersion: ZodNumber;
|
|
210
|
+
artifactDigest: ZodCustom<Sha256Digest, Sha256Digest>;
|
|
211
|
+
membershipVersion: ZodOptional<ZodNumber>;
|
|
212
|
+
},
|
|
213
|
+
$strict
|
|
214
|
+
>;
|
|
215
|
+
epoch: ZodNumber;
|
|
216
|
+
},
|
|
217
|
+
$strict
|
|
218
|
+
>;
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Identity and observed revisions only. Unknown fields, including bearer material,
|
|
222
|
+
refuse.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
### backgroundRefusalCodeSchema
|
|
227
|
+
|
|
228
|
+
```ts
|
|
229
|
+
const backgroundRefusalCodeSchema: ZodEnum<{
|
|
230
|
+
access_changed: "access_changed";
|
|
231
|
+
installation_unavailable: "installation_unavailable";
|
|
232
|
+
}>;
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
The App can settle a refused lane without receiving any binding authority.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### backgroundSyncRefusalSchema
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
const backgroundSyncRefusalSchema: ZodObject<
|
|
243
|
+
{
|
|
244
|
+
lane: ZodString;
|
|
245
|
+
code: ZodEnum<{
|
|
246
|
+
access_changed: "access_changed";
|
|
247
|
+
installation_unavailable: "installation_unavailable";
|
|
248
|
+
}>;
|
|
249
|
+
},
|
|
250
|
+
$strict
|
|
251
|
+
>;
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Cleanup payload for one refused member lane; contains no actor or authority.
|
|
255
|
+
|
|
256
|
+
## Functions
|
|
257
|
+
|
|
258
|
+
### backgroundOriginKey()
|
|
259
|
+
|
|
260
|
+
```ts
|
|
261
|
+
function backgroundOriginKey(secret): Promise<CryptoKey>;
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
Derive a non-extractable host signing key; no secret is sent to an App.
|
|
265
|
+
|
|
266
|
+
#### Parameters
|
|
267
|
+
|
|
268
|
+
| Parameter | Type |
|
|
269
|
+
| --------- | -------- |
|
|
270
|
+
| `secret` | `string` |
|
|
271
|
+
|
|
272
|
+
#### Returns
|
|
273
|
+
|
|
274
|
+
`Promise`\<`CryptoKey`\>
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
### sealBackgroundOrigin()
|
|
279
|
+
|
|
280
|
+
```ts
|
|
281
|
+
function sealBackgroundOrigin(
|
|
282
|
+
key,
|
|
283
|
+
claims,
|
|
284
|
+
): Promise<{
|
|
285
|
+
method: string;
|
|
286
|
+
seal: string;
|
|
287
|
+
}>;
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Seal only host-verified Instance, member lane and foreground method attribution.
|
|
291
|
+
|
|
292
|
+
#### Parameters
|
|
293
|
+
|
|
294
|
+
| Parameter | Type |
|
|
295
|
+
| --------- | --------------------------------------------------------------------------------- |
|
|
296
|
+
| `key` | `CryptoKey` |
|
|
297
|
+
| `claims` | `Readonly`\<\{ `instanceId`: `string`; `lane`: `string`; `method`: `string`; \}\> |
|
|
298
|
+
|
|
299
|
+
#### Returns
|
|
300
|
+
|
|
301
|
+
`Promise`\<\{ `method`: `string`; `seal`: `string`; \}\>
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
### admitClaimedOrigin()
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
function admitClaimedOrigin(
|
|
309
|
+
key,
|
|
310
|
+
frame,
|
|
311
|
+
raw,
|
|
312
|
+
): Promise<
|
|
313
|
+
| {
|
|
314
|
+
kind: "admitted";
|
|
315
|
+
}
|
|
316
|
+
| {
|
|
317
|
+
kind: "refused";
|
|
318
|
+
code: "access_changed";
|
|
319
|
+
}
|
|
320
|
+
>;
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Verify origin evidence against this frame's fresh admission; guest input never
|
|
324
|
+
throws.
|
|
325
|
+
|
|
326
|
+
#### Parameters
|
|
327
|
+
|
|
328
|
+
| Parameter | Type |
|
|
329
|
+
| --------- | ---------------------------------------------------------------------------------------------- |
|
|
330
|
+
| `key` | `CryptoKey` |
|
|
331
|
+
| `frame` | `Readonly`\<\{ `instanceId`: `string`; `lane`: `string`; `admitted`: readonly `string`[]; \}\> |
|
|
332
|
+
| `raw` | `unknown` |
|
|
333
|
+
|
|
334
|
+
#### Returns
|
|
335
|
+
|
|
336
|
+
`Promise`\< \| \{ `kind`: `"admitted"`; \} \| \{ `kind`: `"refused"`; `code`:
|
|
337
|
+
`"access_changed"`; \}\>
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
### actorLane()
|
|
342
|
+
|
|
343
|
+
```ts
|
|
344
|
+
function actorLane(actor): string;
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
A queue lane is an actor identity, never a credential or grant.
|
|
348
|
+
|
|
349
|
+
#### Parameters
|
|
350
|
+
|
|
351
|
+
| Parameter | Type |
|
|
352
|
+
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
353
|
+
| `actor` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} |
|
|
354
|
+
|
|
355
|
+
#### Returns
|
|
356
|
+
|
|
357
|
+
`string`
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
### mayDefer()
|
|
362
|
+
|
|
363
|
+
```ts
|
|
364
|
+
function mayDefer(context, ancestry): boolean;
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
Only ordinary member calls may enqueue background work; ancestry is host-held.
|
|
368
|
+
|
|
369
|
+
#### Parameters
|
|
370
|
+
|
|
371
|
+
| Parameter | Type | Description |
|
|
372
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
373
|
+
| `context` | \{ `computerId`: `string` \| `null`; `actor`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; `backgroundLane?`: `string`; `backgroundOrigin?`: \{ `method`: `string`; `seal`: `string`; \}; `role?`: `"member"` \| `"owner"`; `soleMember?`: `true`; `workflow?`: \{ `workflowId`: `string`; `runId`: `string`; `nodeId`: `string`; `armedBy`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; \}; `idempotencyKey?`: `string`; \} | - |
|
|
374
|
+
| `context.computerId` | `string` \| `null` | - |
|
|
375
|
+
| `context.actor` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} | - |
|
|
376
|
+
| `context.backgroundLane?` | `string` | Host-attested enqueue eligibility for this ordinary write; absent otherwise. |
|
|
377
|
+
| `context.backgroundOrigin?` | \{ `method`: `string`; `seal`: `string`; \} | Host-sealed foreground method for durable jobs; paired with backgroundLane. |
|
|
378
|
+
| `context.backgroundOrigin.method` | `string` | - |
|
|
379
|
+
| `context.backgroundOrigin.seal` | `string` | - |
|
|
380
|
+
| `context.role?` | `"member"` \| `"owner"` | Team role attested by the host, never selected by App method input. |
|
|
381
|
+
| `context.soleMember?` | `true` | The host attests that this member is currently the Team's only member. Present only on a member's own call; never on an Agent, Team key or Workflow node, and never selected by App method input. |
|
|
382
|
+
| `context.workflow?` | \{ `workflowId`: `string`; `runId`: `string`; `nodeId`: `string`; `armedBy`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; \} | Present only on a Workflow node invocation admitted by its host. |
|
|
383
|
+
| `context.workflow.workflowId` | `string` | Published Workflow selected by the run owner. |
|
|
384
|
+
| `context.workflow.runId` | `string` | Run identity held by the run owner. |
|
|
385
|
+
| `context.workflow.nodeId` | `string` | Node selected by the stored published Workflow. |
|
|
386
|
+
| `context.workflow.armedBy` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} | Actor that armed the run, re-admitted by the host at dispatch. |
|
|
387
|
+
| `context.idempotencyKey?` | `string` | The host's stable key for this logical call (for example one Workflow node), the same on every retry. A method with side effects uses it to do its work at most once. Absent when the caller supplies its own request id. |
|
|
388
|
+
| `ancestry` | readonly `string`[] | - |
|
|
389
|
+
|
|
390
|
+
#### Returns
|
|
391
|
+
|
|
392
|
+
`boolean`
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
### backgroundContext()
|
|
397
|
+
|
|
398
|
+
```ts
|
|
399
|
+
function backgroundContext(context, ancestry, method, origin): object;
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Host-only projection: replace incoming eligibility with the verified write's
|
|
403
|
+
sealed origin.
|
|
404
|
+
|
|
405
|
+
#### Parameters
|
|
406
|
+
|
|
407
|
+
| Parameter | Type | Description |
|
|
408
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
409
|
+
| `context` | \{ `computerId`: `string` \| `null`; `actor`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; `backgroundLane?`: `string`; `backgroundOrigin?`: \{ `method`: `string`; `seal`: `string`; \}; `role?`: `"member"` \| `"owner"`; `soleMember?`: `true`; `workflow?`: \{ `workflowId`: `string`; `runId`: `string`; `nodeId`: `string`; `armedBy`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; \}; `idempotencyKey?`: `string`; \} | - |
|
|
410
|
+
| `context.computerId` | `string` \| `null` | - |
|
|
411
|
+
| `context.actor` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} | - |
|
|
412
|
+
| `context.backgroundLane?` | `string` | Host-attested enqueue eligibility for this ordinary write; absent otherwise. |
|
|
413
|
+
| `context.backgroundOrigin?` | \{ `method`: `string`; `seal`: `string`; \} | Host-sealed foreground method for durable jobs; paired with backgroundLane. |
|
|
414
|
+
| `context.backgroundOrigin.method` | `string` | - |
|
|
415
|
+
| `context.backgroundOrigin.seal` | `string` | - |
|
|
416
|
+
| `context.role?` | `"member"` \| `"owner"` | Team role attested by the host, never selected by App method input. |
|
|
417
|
+
| `context.soleMember?` | `true` | The host attests that this member is currently the Team's only member. Present only on a member's own call; never on an Agent, Team key or Workflow node, and never selected by App method input. |
|
|
418
|
+
| `context.workflow?` | \{ `workflowId`: `string`; `runId`: `string`; `nodeId`: `string`; `armedBy`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; \} | Present only on a Workflow node invocation admitted by its host. |
|
|
419
|
+
| `context.workflow.workflowId` | `string` | Published Workflow selected by the run owner. |
|
|
420
|
+
| `context.workflow.runId` | `string` | Run identity held by the run owner. |
|
|
421
|
+
| `context.workflow.nodeId` | `string` | Node selected by the stored published Workflow. |
|
|
422
|
+
| `context.workflow.armedBy` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} | Actor that armed the run, re-admitted by the host at dispatch. |
|
|
423
|
+
| `context.idempotencyKey?` | `string` | The host's stable key for this logical call (for example one Workflow node), the same on every retry. A method with side effects uses it to do its work at most once. Absent when the caller supplies its own request id. |
|
|
424
|
+
| `ancestry` | readonly `string`[] | - |
|
|
425
|
+
| `method` | `Readonly`\<\{ `name`: `string`; `effect`: [`AppApi`](index.md#appapi)\[`"methods"`\]\[`string`\]\[`"effect"`\]; \}\> | - |
|
|
426
|
+
| `origin` | \| \{ `method`: `string`; `seal`: `string`; \} \| `undefined` | - |
|
|
427
|
+
|
|
428
|
+
#### Returns
|
|
429
|
+
|
|
430
|
+
| Name | Type | Default value | Description |
|
|
431
|
+
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
432
|
+
| `computerId` | `string` \| `null` | - | - |
|
|
433
|
+
| `actor` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} | `hostActorSchema` | - |
|
|
434
|
+
| `backgroundLane?` | `string` | - | Host-attested enqueue eligibility for this ordinary write; absent otherwise. |
|
|
435
|
+
| `backgroundOrigin?` | `object` | - | Host-sealed foreground method for durable jobs; paired with backgroundLane. |
|
|
436
|
+
| `backgroundOrigin.method` | `string` | - | - |
|
|
437
|
+
| `backgroundOrigin.seal` | `string` | - | - |
|
|
438
|
+
| `role?` | `"member"` \| `"owner"` | - | Team role attested by the host, never selected by App method input. |
|
|
439
|
+
| `soleMember?` | `true` | - | The host attests that this member is currently the Team's only member. Present only on a member's own call; never on an Agent, Team key or Workflow node, and never selected by App method input. |
|
|
440
|
+
| `workflow?` | `object` | - | Present only on a Workflow node invocation admitted by its host. |
|
|
441
|
+
| `workflow.workflowId` | `string` | `identity` | Published Workflow selected by the run owner. |
|
|
442
|
+
| `workflow.runId` | `string` | `identity` | Run identity held by the run owner. |
|
|
443
|
+
| `workflow.nodeId` | `string` | `identity` | Node selected by the stored published Workflow. |
|
|
444
|
+
| `workflow.armedBy` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} | `hostActorSchema` | Actor that armed the run, re-admitted by the host at dispatch. |
|
|
445
|
+
| `idempotencyKey?` | `string` | - | The host's stable key for this logical call (for example one Workflow node), the same on every retry. A method with side effects uses it to do its work at most once. Absent when the caller supplies its own request id. |
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
### mayEnqueueBackground()
|
|
450
|
+
|
|
451
|
+
```ts
|
|
452
|
+
function mayEnqueueBackground(context): boolean;
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
App-side eligibility reads only the host-attested context; it never invents
|
|
456
|
+
ancestry.
|
|
457
|
+
|
|
458
|
+
#### Parameters
|
|
459
|
+
|
|
460
|
+
| Parameter | Type | Description |
|
|
461
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
462
|
+
| `context` | \{ `computerId`: `string` \| `null`; `actor`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; `backgroundLane?`: `string`; `backgroundOrigin?`: \{ `method`: `string`; `seal`: `string`; \}; `role?`: `"member"` \| `"owner"`; `soleMember?`: `true`; `workflow?`: \{ `workflowId`: `string`; `runId`: `string`; `nodeId`: `string`; `armedBy`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; \}; `idempotencyKey?`: `string`; \} | - |
|
|
463
|
+
| `context.computerId` | `string` \| `null` | - |
|
|
464
|
+
| `context.actor` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} | - |
|
|
465
|
+
| `context.backgroundLane?` | `string` | Host-attested enqueue eligibility for this ordinary write; absent otherwise. |
|
|
466
|
+
| `context.backgroundOrigin?` | \{ `method`: `string`; `seal`: `string`; \} | Host-sealed foreground method for durable jobs; paired with backgroundLane. |
|
|
467
|
+
| `context.backgroundOrigin.method` | `string` | - |
|
|
468
|
+
| `context.backgroundOrigin.seal` | `string` | - |
|
|
469
|
+
| `context.role?` | `"member"` \| `"owner"` | Team role attested by the host, never selected by App method input. |
|
|
470
|
+
| `context.soleMember?` | `true` | The host attests that this member is currently the Team's only member. Present only on a member's own call; never on an Agent, Team key or Workflow node, and never selected by App method input. |
|
|
471
|
+
| `context.workflow?` | \{ `workflowId`: `string`; `runId`: `string`; `nodeId`: `string`; `armedBy`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; \} | Present only on a Workflow node invocation admitted by its host. |
|
|
472
|
+
| `context.workflow.workflowId` | `string` | Published Workflow selected by the run owner. |
|
|
473
|
+
| `context.workflow.runId` | `string` | Run identity held by the run owner. |
|
|
474
|
+
| `context.workflow.nodeId` | `string` | Node selected by the stored published Workflow. |
|
|
475
|
+
| `context.workflow.armedBy` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} | Actor that armed the run, re-admitted by the host at dispatch. |
|
|
476
|
+
| `context.idempotencyKey?` | `string` | The host's stable key for this logical call (for example one Workflow node), the same on every retry. A method with side effects uses it to do its work at most once. Absent when the caller supplies its own request id. |
|
|
477
|
+
|
|
478
|
+
#### Returns
|
|
479
|
+
|
|
480
|
+
`boolean`
|
|
481
|
+
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
### readmitBackground()
|
|
485
|
+
|
|
486
|
+
```ts
|
|
487
|
+
function readmitBackground<Principal>(
|
|
488
|
+
input,
|
|
489
|
+
ports,
|
|
490
|
+
): Promise<BackgroundReplayDecision>;
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
Resolve then re-admit. Observed revisions are evidence, never equality pins.
|
|
494
|
+
|
|
495
|
+
#### Type Parameters
|
|
496
|
+
|
|
497
|
+
| Type Parameter |
|
|
498
|
+
| -------------- |
|
|
499
|
+
| `Principal` |
|
|
500
|
+
|
|
501
|
+
#### Parameters
|
|
502
|
+
|
|
503
|
+
| Parameter | Type |
|
|
504
|
+
| --------- | ---------------------------------------------------------------- |
|
|
505
|
+
| `input` | `unknown` |
|
|
506
|
+
| `ports` | [`BackgroundReplayPorts`](#backgroundreplayports)\<`Principal`\> |
|
|
507
|
+
|
|
508
|
+
#### Returns
|
|
509
|
+
|
|
510
|
+
`Promise`\<[`BackgroundReplayDecision`](#backgroundreplaydecision)\>
|
|
511
|
+
|
|
512
|
+
## References
|
|
513
|
+
|
|
514
|
+
### backgroundSyncAllowed
|
|
515
|
+
|
|
516
|
+
Re-exports [backgroundSyncAllowed](app-method-runtime.md#backgroundsyncallowed)
|