@fungi.computer/oyster 0.37.2 → 0.38.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.
Files changed (86) hide show
  1. package/README.md +5 -4
  2. package/dist/agents.js +9 -2
  3. package/dist/app-builds.d.ts +1 -1
  4. package/dist/app-region.d.ts +94 -0
  5. package/dist/app-region.js +316 -0
  6. package/dist/authorization.d.ts +58 -9
  7. package/dist/authorization.js +56 -11
  8. package/dist/boot-host-script.js +1 -1
  9. package/dist/build/candidate-builder.d.ts +1 -1
  10. package/dist/build/candidate-cli.mjs +284 -17
  11. package/dist/build/effect.d.ts +3 -3
  12. package/dist/build/submission-contract.d.ts +1 -1
  13. package/dist/build/workspace-build.d.ts +2 -2
  14. package/dist/channels/discord-replies.d.ts +8 -1
  15. package/dist/channels/discord-replies.js +80 -29
  16. package/dist/cloudflare.d.ts +1 -0
  17. package/dist/cloudflare.js +11 -0
  18. package/dist/credential-migration-001.d.ts +14 -0
  19. package/dist/credential-migration-001.js +13 -0
  20. package/dist/credential-migration-002.d.ts +38 -0
  21. package/dist/credential-migration-002.js +74 -0
  22. package/dist/embed-metafiles.js +2 -2
  23. package/dist/embed-scripts.js +1 -1
  24. package/dist/host.d.ts +2 -0
  25. package/dist/host.js +20 -1
  26. package/dist/index.d.ts +15 -1
  27. package/dist/index.js +19 -0
  28. package/dist/invocation.d.ts +165 -0
  29. package/dist/invocation.js +67 -0
  30. package/dist/keys.d.ts +4 -3
  31. package/dist/keys.js +5 -4
  32. package/dist/mcp-owner.d.ts +4 -3
  33. package/dist/mcp-owner.js +3 -2
  34. package/dist/page/mount.js +5 -1
  35. package/dist/page/region.d.ts +6 -0
  36. package/dist/page/region.js +12 -0
  37. package/dist/page-config.d.ts +2 -0
  38. package/dist/page-config.js +2 -0
  39. package/dist/page-script.js +2 -2
  40. package/dist/source/seed-receipt.d.ts +1 -1
  41. package/dist/source/template-seed.d.ts +1 -1
  42. package/dist/standalone/agent-connections.d.ts +49 -1
  43. package/dist/standalone/agent-connections.js +101 -12
  44. package/dist/standalone/agent-self.js +2 -1
  45. package/dist/standalone/agents.d.ts +7 -3
  46. package/dist/standalone/agents.js +42 -19
  47. package/dist/standalone/computer-fleet.d.ts +12 -6
  48. package/dist/standalone/computer-fleet.js +70 -29
  49. package/dist/standalone/computer.js +39 -14
  50. package/dist/standalone/instance.d.ts +3 -1
  51. package/dist/standalone/instance.js +8 -0
  52. package/dist/standalone/model-key-vault.d.ts +33 -4
  53. package/dist/standalone/model-key-vault.js +74 -17
  54. package/dist/standalone/preview.js +11 -10
  55. package/dist/standalone/try-cli.d.ts +12 -2
  56. package/dist/standalone/try-cli.js +170 -32
  57. package/dist/standalone/try-worker.d.ts +2 -0
  58. package/dist/standalone/try-worker.js +15 -0
  59. package/dist/standalone/worker.js +3 -3
  60. package/dist/standalone/workflow-host.d.ts +1 -1
  61. package/dist/standalone/workflows.d.ts +3 -3
  62. package/dist/standalone/workflows.js +7 -0
  63. package/dist/testing/capabilities.d.ts +2 -0
  64. package/dist/testing/capabilities.js +2 -0
  65. package/dist/webhook-custody.d.ts +14 -3
  66. package/dist/webhook-custody.js +165 -43
  67. package/dist/webhooks.d.ts +1 -1
  68. package/dist/webhooks.js +15 -3
  69. package/dist/workers-git.d.ts +24 -8
  70. package/dist/workers-git.js +105 -15
  71. package/dist/workers.d.ts +16 -0
  72. package/dist/workers.js +95 -5
  73. package/docs/api/apps.md +31 -31
  74. package/docs/api/authorization.md +119 -17
  75. package/docs/api/build-contract.md +8 -8
  76. package/docs/api/build.md +163 -174
  77. package/docs/api/cloudflare.md +171 -0
  78. package/docs/api/host.md +1 -0
  79. package/docs/api/index.md +23 -0
  80. package/docs/api/invocation.md +623 -23
  81. package/docs/api/keys.md +6 -6
  82. package/docs/api/pack.md +3 -3
  83. package/docs/api/page/mount.md +22 -20
  84. package/docs/api/workers-git.md +273 -157
  85. package/docs/api/workers.md +257 -175
  86. package/package.json +19 -18
@@ -10,6 +10,16 @@
10
10
 
11
11
  ## Type Aliases
12
12
 
13
+ ### AppRegionEventKind
14
+
15
+ ```ts
16
+ type AppRegionEventKind = AppRegionEvent["kind"];
17
+ ```
18
+
19
+ One kind of supervisor-delivered Region event.
20
+
21
+ ---
22
+
13
23
  ### InvocationFacts
14
24
 
15
25
  ```ts
@@ -316,6 +326,119 @@ const invocationFactsSchema: Struct<{
316
326
  kind: Literal<"lifecycle">;
317
327
  name: Literal<"onGitPush">;
318
328
  eventId: NonEmptyString;
329
+ }>, Struct<{
330
+ kind: Literal<"lifecycle">;
331
+ name: Literal<"onRegion">;
332
+ event: Literals<readonly ["connect", "message", "close", "alarm"]>;
333
+ context: optionalKey<declareConstructor<{
334
+ scope: | {
335
+ kind: ...;
336
+ teamId: ...;
337
+ }
338
+ | {
339
+ kind: ...;
340
+ tenant: ...;
341
+ };
342
+ computerId: string | null;
343
+ actor: | {
344
+ kind: ...;
345
+ memberId: ...;
346
+ }
347
+ | {
348
+ kind: ...;
349
+ agentId: ...;
350
+ }
351
+ | {
352
+ kind: ...;
353
+ keyId: ...;
354
+ };
355
+ backgroundLane?: string;
356
+ backgroundOrigin?: {
357
+ method: ...;
358
+ seal: ...;
359
+ };
360
+ role?: "member" | "owner" | "admin";
361
+ soleMember?: true;
362
+ workflow?: {
363
+ workflowId: ...;
364
+ runId: ...;
365
+ nodeId: ...;
366
+ armedBy: ...;
367
+ };
368
+ idempotencyKey?: string;
369
+ }, {
370
+ scope: | {
371
+ kind: ...;
372
+ teamId: ...;
373
+ }
374
+ | {
375
+ kind: ...;
376
+ tenant: ...;
377
+ };
378
+ computerId: string | null;
379
+ actor: | {
380
+ kind: ...;
381
+ memberId: ...;
382
+ }
383
+ | {
384
+ kind: ...;
385
+ agentId: ...;
386
+ }
387
+ | {
388
+ kind: ...;
389
+ keyId: ...;
390
+ };
391
+ backgroundLane?: string;
392
+ backgroundOrigin?: {
393
+ method: ...;
394
+ seal: ...;
395
+ };
396
+ role?: "member" | "owner" | "admin";
397
+ soleMember?: true;
398
+ workflow?: {
399
+ workflowId: ...;
400
+ runId: ...;
401
+ nodeId: ...;
402
+ armedBy: ...;
403
+ };
404
+ idempotencyKey?: string;
405
+ }, readonly [], {
406
+ scope: | {
407
+ kind: ...;
408
+ teamId: ...;
409
+ }
410
+ | {
411
+ kind: ...;
412
+ tenant: ...;
413
+ };
414
+ computerId: string | null;
415
+ actor: | {
416
+ kind: ...;
417
+ memberId: ...;
418
+ }
419
+ | {
420
+ kind: ...;
421
+ agentId: ...;
422
+ }
423
+ | {
424
+ kind: ...;
425
+ keyId: ...;
426
+ };
427
+ backgroundLane?: string;
428
+ backgroundOrigin?: {
429
+ method: ...;
430
+ seal: ...;
431
+ };
432
+ role?: "member" | "owner" | "admin";
433
+ soleMember?: true;
434
+ workflow?: {
435
+ workflowId: ...;
436
+ runId: ...;
437
+ nodeId: ...;
438
+ armedBy: ...;
439
+ };
440
+ idempotencyKey?: string;
441
+ }>>;
319
442
  }>, Struct<{
320
443
  kind: Literal<"lifecycle">;
321
444
  name: Literal<"syncRefused">;
@@ -365,13 +488,123 @@ Shared host-held caller/Workflow fact builders, never guest argument decoders.
365
488
 
366
489
  #### Type Declaration
367
490
 
368
- | Name | Type | Description |
369
- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
370
- | <a id="property-fromcaller"></a> `fromCaller()` | (`authority`, `context`, `deadline`, `method?`, `sessionId?`, `agentPolicy?`) => `object` | Combine host-admitted caller facts with the invocation and grant deadlines. |
371
- | <a id="property-fromworkflownode"></a> `fromWorkflowNode()` | (`authority`, `input`, `deadline`) => `object` | Attribute an already host-admitted published node to its retained arming actor. |
491
+ | Name | Type | Description |
492
+ | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
493
+ | <a id="property-fromcaller"></a> `fromCaller()` | (`authority`, `context`, `deadline`, `method?`, `sessionId?`, `agentPolicy?`) => `object` | Combine host-admitted caller facts with the invocation and grant deadlines. |
494
+ | <a id="property-fromworkflownode"></a> `fromWorkflowNode()` | (`authority`, `input`, `deadline`) => `object` | Attribute an already host-admitted published node to its retained arming actor. |
495
+ | <a id="property-fromregion"></a> `fromRegion()` | (`authority`, `event`, `deadline`, `context?`) => `object` | A Region event under the Instance's current authority: no binding grants, and a caller only on a connect the host has just admitted. |
496
+
497
+ ---
498
+
499
+ ### regionAdmissionHeader
500
+
501
+ ```ts
502
+ const regionAdmissionHeader: "x-fungi-region-admission" =
503
+ "x-fungi-region-admission";
504
+ ```
505
+
506
+ The private header a host uses to hand an admitted Region connect to its
507
+ Instance.
372
508
 
373
509
  ## Functions
374
510
 
511
+ ### invocationCaller()
512
+
513
+ ```ts
514
+ function invocationCaller(facts):
515
+ | {
516
+ scope:
517
+ | {
518
+ kind: "team";
519
+ teamId: string;
520
+ }
521
+ | {
522
+ kind: "standalone";
523
+ tenant: string;
524
+ };
525
+ computerId: string | null;
526
+ actor:
527
+ | {
528
+ kind: "member";
529
+ memberId: string;
530
+ }
531
+ | {
532
+ kind: "agent";
533
+ agentId: string;
534
+ }
535
+ | {
536
+ kind: "team-key";
537
+ keyId: string;
538
+ };
539
+ backgroundLane?: string;
540
+ backgroundOrigin?: {
541
+ method: string;
542
+ seal: string;
543
+ };
544
+ role?: "member" | "owner" | "admin";
545
+ soleMember?: true;
546
+ workflow?: {
547
+ workflowId: string;
548
+ runId: string;
549
+ nodeId: string;
550
+ armedBy:
551
+ | {
552
+ kind: "member";
553
+ memberId: string;
554
+ }
555
+ | {
556
+ kind: "agent";
557
+ agentId: string;
558
+ }
559
+ | {
560
+ kind: "team-key";
561
+ keyId: string;
562
+ };
563
+ };
564
+ idempotencyKey?: string;
565
+ }
566
+ | undefined;
567
+ ```
568
+
569
+ The host-attested caller a frame carries, if any: every call, and a Region
570
+ connect. Instance owners check its scope against their own binding.
571
+
572
+ #### Parameters
573
+
574
+ | Parameter | Type |
575
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
576
+ | `facts` | \{ `instanceId`: [`InstanceId`](index.md#instanceid); `selection`: \{ `instanceId`: [`InstanceId`](index.md#instanceid); `owner`: \{ `kind`: `"installation"` \| `"deployment"`; `id`: `string`; \}; `appId`: `AppId`; `releaseId`: `ReleaseId`; `authorityVersion`: `number`; \}; `artifactDigest`: `Sha256Digest`; `subject`: \| \{ `kind`: `"call"`; `context`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; `sessionId?`: `string`; `agentPolicy?`: \{ `policyRevision`: `string`; `grantorMemberId`: `string`; \}; `method?`: \{ `name`: `string`; `effect`: `"read"` \| `"write"` \| `"external"`; \}; `replay?`: \{ `lane`: `string`; `epoch`: `number`; `admitted`: readonly `string`[]; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onGitPush"`; `eventId`: `string`; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onRegion"`; `event`: `"message"` \| `"connect"` \| `"close"` \| `"alarm"`; `context?`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"syncRefused"`; `lane`: `string`; `code`: `"access_changed"` \| `"installation_unavailable"`; \}; `grants`: readonly `object`[]; `deadlineAt`: `number`; `ancestry`: readonly [`InstanceId`](index.md#instanceid)[]; \} |
577
+ | `facts.instanceId` | [`InstanceId`](index.md#instanceid) |
578
+ | `facts.selection` | \{ `instanceId`: [`InstanceId`](index.md#instanceid); `owner`: \{ `kind`: `"installation"` \| `"deployment"`; `id`: `string`; \}; `appId`: `AppId`; `releaseId`: `ReleaseId`; `authorityVersion`: `number`; \} |
579
+ | `facts.selection.instanceId` | [`InstanceId`](index.md#instanceid) |
580
+ | `facts.selection.owner` | \{ `kind`: `"installation"` \| `"deployment"`; `id`: `string`; \} |
581
+ | `facts.selection.owner.kind` | `"installation"` \| `"deployment"` |
582
+ | `facts.selection.owner.id` | `string` |
583
+ | `facts.selection.appId` | `AppId` |
584
+ | `facts.selection.releaseId` | `ReleaseId` |
585
+ | `facts.selection.authorityVersion` | `number` |
586
+ | `facts.artifactDigest` | `Sha256Digest` |
587
+ | `facts.subject` | \| \{ `kind`: `"call"`; `context`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; `sessionId?`: `string`; `agentPolicy?`: \{ `policyRevision`: `string`; `grantorMemberId`: `string`; \}; `method?`: \{ `name`: `string`; `effect`: `"read"` \| `"write"` \| `"external"`; \}; `replay?`: \{ `lane`: `string`; `epoch`: `number`; `admitted`: readonly `string`[]; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onGitPush"`; `eventId`: `string`; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onRegion"`; `event`: `"message"` \| `"connect"` \| `"close"` \| `"alarm"`; `context?`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"syncRefused"`; `lane`: `string`; `code`: `"access_changed"` \| `"installation_unavailable"`; \} |
588
+ | `facts.grants` | readonly `object`[] |
589
+ | `facts.deadlineAt` | `number` |
590
+ | `facts.ancestry` | readonly [`InstanceId`](index.md#instanceid)[] |
591
+
592
+ #### Returns
593
+
594
+ \| \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`:
595
+ `"standalone"`; `tenant`: `string`; \}; `computerId`: `string` \| `null`;
596
+ `actor`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`:
597
+ `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`:
598
+ `string`; \}; `backgroundLane?`: `string`; `backgroundOrigin?`: \{ `method`:
599
+ `string`; `seal`: `string`; \}; `role?`: `"member"` \| `"owner"` \| `"admin"`;
600
+ `soleMember?`: `true`; `workflow?`: \{ `workflowId`: `string`; `runId`:
601
+ `string`; `nodeId`: `string`; `armedBy`: \| \{ `kind`: `"member"`; `memberId`:
602
+ `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`:
603
+ `"team-key"`; `keyId`: `string`; \}; \}; `idempotencyKey?`: `string`; \} \|
604
+ `undefined`
605
+
606
+ ---
607
+
375
608
  ### assertBackgroundBinding()
376
609
 
377
610
  ```ts
@@ -587,22 +820,77 @@ Mint standalone facts only after host caller and Release admission.
587
820
 
588
821
  `object`
589
822
 
590
- | Name | Type | Default value |
591
- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------- |
592
- | `instanceId` | [`InstanceId`](index.md#instanceid) | `instanceIdSchema` |
593
- | `selection` | `object` | `selectionSchema` |
594
- | `selection.instanceId` | [`InstanceId`](index.md#instanceid) | `instanceIdSchema` |
595
- | `selection.owner` | `object` | `ownerSchema` |
596
- | `selection.owner.kind` | `"installation"` \| `"deployment"` | - |
597
- | `selection.owner.id` | `string` | `Schema.NonEmptyString` |
598
- | `selection.appId` | `AppId` | `appIdSchema` |
599
- | `selection.releaseId` | `ReleaseId` | `releaseIdSchema` |
600
- | `selection.authorityVersion` | `number` | - |
601
- | `artifactDigest` | `Sha256Digest` | `sha256DigestSchema` |
602
- | `subject` | \| \{ `kind`: `"call"`; `context`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; `sessionId?`: `string`; `agentPolicy?`: \{ `policyRevision`: `string`; `grantorMemberId`: `string`; \}; `method?`: \{ `name`: `string`; `effect`: `"read"` \| `"write"` \| `"external"`; \}; `replay?`: \{ `lane`: `string`; `epoch`: `number`; `admitted`: readonly `string`[]; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onGitPush"`; `eventId`: `string`; \} \| \{ `kind`: `"lifecycle"`; `name`: `"syncRefused"`; `lane`: `string`; `code`: `"access_changed"` \| `"installation_unavailable"`; \} | - |
603
- | `grants` | readonly `object`[] | `grantsSchema` |
604
- | `deadlineAt` | `number` | - |
605
- | `ancestry` | readonly [`InstanceId`](index.md#instanceid)[] | - |
823
+ | Name | Type | Default value |
824
+ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- |
825
+ | `instanceId` | [`InstanceId`](index.md#instanceid) | `instanceIdSchema` |
826
+ | `selection` | `object` | `selectionSchema` |
827
+ | `selection.instanceId` | [`InstanceId`](index.md#instanceid) | `instanceIdSchema` |
828
+ | `selection.owner` | `object` | `ownerSchema` |
829
+ | `selection.owner.kind` | `"installation"` \| `"deployment"` | - |
830
+ | `selection.owner.id` | `string` | `Schema.NonEmptyString` |
831
+ | `selection.appId` | `AppId` | `appIdSchema` |
832
+ | `selection.releaseId` | `ReleaseId` | `releaseIdSchema` |
833
+ | `selection.authorityVersion` | `number` | - |
834
+ | `artifactDigest` | `Sha256Digest` | `sha256DigestSchema` |
835
+ | `subject` | \| \{ `kind`: `"call"`; `context`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; `sessionId?`: `string`; `agentPolicy?`: \{ `policyRevision`: `string`; `grantorMemberId`: `string`; \}; `method?`: \{ `name`: `string`; `effect`: `"read"` \| `"write"` \| `"external"`; \}; `replay?`: \{ `lane`: `string`; `epoch`: `number`; `admitted`: readonly `string`[]; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onGitPush"`; `eventId`: `string`; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onRegion"`; `event`: `"message"` \| `"connect"` \| `"close"` \| `"alarm"`; `context?`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"syncRefused"`; `lane`: `string`; `code`: `"access_changed"` \| `"installation_unavailable"`; \} | - |
836
+ | `grants` | readonly `object`[] | `grantsSchema` |
837
+ | `deadlineAt` | `number` | - |
838
+ | `ancestry` | readonly [`InstanceId`](index.md#instanceid)[] | - |
839
+
840
+ ---
841
+
842
+ ### admittedRegionConnectFacts()
843
+
844
+ ```ts
845
+ function admittedRegionConnectFacts(installation, release, context): object;
846
+ ```
847
+
848
+ Mint a Region connect only after host caller and Release admission. The Instance
849
+ itself refuses a Release whose verified profile is not region.
850
+
851
+ #### Parameters
852
+
853
+ | Parameter | Type |
854
+ | --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
855
+ | `installation` | [`Installation`](apps.md#installation) |
856
+ | `release` | [`VerifiedRelease`](host.md#verifiedrelease) |
857
+ | `context` | \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \} |
858
+ | `context.scope` | \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \} |
859
+ | `context.computerId` | `string` \| `null` |
860
+ | `context.actor` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} |
861
+ | `context.backgroundLane?` | `string` |
862
+ | `context.backgroundOrigin?` | \{ `method`: `string`; `seal`: `string`; \} |
863
+ | `context.backgroundOrigin.method` | `string` |
864
+ | `context.backgroundOrigin.seal` | `string` |
865
+ | `context.role?` | `"member"` \| `"owner"` \| `"admin"` |
866
+ | `context.soleMember?` | `true` |
867
+ | `context.workflow?` | \{ `workflowId`: `string`; `runId`: `string`; `nodeId`: `string`; `armedBy`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \}; \} |
868
+ | `context.workflow.workflowId` | `string` |
869
+ | `context.workflow.runId` | `string` |
870
+ | `context.workflow.nodeId` | `string` |
871
+ | `context.workflow.armedBy` | \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`: `string`; \} |
872
+ | `context.idempotencyKey?` | `string` |
873
+
874
+ #### Returns
875
+
876
+ `object`
877
+
878
+ | Name | Type | Default value |
879
+ | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- |
880
+ | `instanceId` | [`InstanceId`](index.md#instanceid) | `instanceIdSchema` |
881
+ | `selection` | `object` | `selectionSchema` |
882
+ | `selection.instanceId` | [`InstanceId`](index.md#instanceid) | `instanceIdSchema` |
883
+ | `selection.owner` | `object` | `ownerSchema` |
884
+ | `selection.owner.kind` | `"installation"` \| `"deployment"` | - |
885
+ | `selection.owner.id` | `string` | `Schema.NonEmptyString` |
886
+ | `selection.appId` | `AppId` | `appIdSchema` |
887
+ | `selection.releaseId` | `ReleaseId` | `releaseIdSchema` |
888
+ | `selection.authorityVersion` | `number` | - |
889
+ | `artifactDigest` | `Sha256Digest` | `sha256DigestSchema` |
890
+ | `subject` | \| \{ `kind`: `"call"`; `context`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; `sessionId?`: `string`; `agentPolicy?`: \{ `policyRevision`: `string`; `grantorMemberId`: `string`; \}; `method?`: \{ `name`: `string`; `effect`: `"read"` \| `"write"` \| `"external"`; \}; `replay?`: \{ `lane`: `string`; `epoch`: `number`; `admitted`: readonly `string`[]; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onGitPush"`; `eventId`: `string`; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onRegion"`; `event`: `"message"` \| `"connect"` \| `"close"` \| `"alarm"`; `context?`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"syncRefused"`; `lane`: `string`; `code`: `"access_changed"` \| `"installation_unavailable"`; \} | - |
891
+ | `grants` | readonly `object`[] | `grantsSchema` |
892
+ | `deadlineAt` | `number` | - |
893
+ | `ancestry` | readonly [`InstanceId`](index.md#instanceid)[] | - |
606
894
 
607
895
  ---
608
896
 
@@ -706,6 +994,62 @@ function admittedMethodCallerFacts(
706
994
  name: "onGitPush";
707
995
  eventId: string;
708
996
  }
997
+ | {
998
+ kind: "lifecycle";
999
+ name: "onRegion";
1000
+ event: "message" | "connect" | "close" | "alarm";
1001
+ context?: {
1002
+ scope:
1003
+ | {
1004
+ kind: "team";
1005
+ teamId: string;
1006
+ }
1007
+ | {
1008
+ kind: "standalone";
1009
+ tenant: string;
1010
+ };
1011
+ computerId: string | null;
1012
+ actor:
1013
+ | {
1014
+ kind: "member";
1015
+ memberId: string;
1016
+ }
1017
+ | {
1018
+ kind: "agent";
1019
+ agentId: string;
1020
+ }
1021
+ | {
1022
+ kind: "team-key";
1023
+ keyId: string;
1024
+ };
1025
+ backgroundLane?: string;
1026
+ backgroundOrigin?: {
1027
+ method: string;
1028
+ seal: string;
1029
+ };
1030
+ role?: "member" | "owner" | "admin";
1031
+ soleMember?: true;
1032
+ workflow?: {
1033
+ workflowId: string;
1034
+ runId: string;
1035
+ nodeId: string;
1036
+ armedBy:
1037
+ | {
1038
+ kind: "member";
1039
+ memberId: string;
1040
+ }
1041
+ | {
1042
+ kind: "agent";
1043
+ agentId: string;
1044
+ }
1045
+ | {
1046
+ kind: "team-key";
1047
+ keyId: string;
1048
+ };
1049
+ };
1050
+ idempotencyKey?: string;
1051
+ };
1052
+ }
709
1053
  | {
710
1054
  kind: "lifecycle";
711
1055
  name: "syncRefused";
@@ -774,7 +1118,263 @@ Seal the host-verified named method after its current admission checks.
774
1118
  `method?`: \{ `name`: `string`; `effect`: `"read"` \| `"write"` \| `"external"`;
775
1119
  \}; `replay?`: \{ `lane`: `string`; `epoch`: `number`; `admitted`: readonly
776
1120
  `string`[]; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onGitPush"`;
777
- `eventId`: `string`; \} \| \{ `kind`: `"lifecycle"`; `name`: `"syncRefused"`;
778
- `lane`: `string`; `code`: `"access_changed"` \| `"installation_unavailable"`;
779
- \}; `grants`: readonly `object`[]; `deadlineAt`: `number`; `ancestry`: readonly
1121
+ `eventId`: `string`; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onRegion"`;
1122
+ `event`: `"message"` \| `"connect"` \| `"close"` \| `"alarm"`; `context?`: \{
1123
+ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`:
1124
+ `"standalone"`; `tenant`: `string`; \}; `computerId`: `string` \| `null`;
1125
+ `actor`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`:
1126
+ `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`:
1127
+ `string`; \}; `backgroundLane?`: `string`; `backgroundOrigin?`: \{ `method`:
1128
+ `string`; `seal`: `string`; \}; `role?`: `"member"` \| `"owner"` \| `"admin"`;
1129
+ `soleMember?`: `true`; `workflow?`: \{ `workflowId`: `string`; `runId`:
1130
+ `string`; `nodeId`: `string`; `armedBy`: \| \{ `kind`: `"member"`; `memberId`:
1131
+ `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`:
1132
+ `"team-key"`; `keyId`: `string`; \}; \}; `idempotencyKey?`: `string`; \}; \} \|
1133
+ \{ `kind`: `"lifecycle"`; `name`: `"syncRefused"`; `lane`: `string`; `code`:
1134
+ `"access_changed"` \| `"installation_unavailable"`; \}; `grants`: readonly
1135
+ `object`[]; `deadlineAt`: `number`; `ancestry`: readonly
780
1136
  [`InstanceId`](index.md#instanceid)[]; \}\>
1137
+
1138
+ ---
1139
+
1140
+ ### regionAdmissionRequest()
1141
+
1142
+ ```ts
1143
+ function regionAdmissionRequest(request, facts, limits): Request;
1144
+ ```
1145
+
1146
+ Host side: the admitted connect facts ride the Instance's own upgrade request.
1147
+
1148
+ #### Parameters
1149
+
1150
+ | Parameter | Type |
1151
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1152
+ | `request` | `Request` |
1153
+ | `facts` | \{ `instanceId`: [`InstanceId`](index.md#instanceid); `selection`: \{ `instanceId`: [`InstanceId`](index.md#instanceid); `owner`: \{ `kind`: `"installation"` \| `"deployment"`; `id`: `string`; \}; `appId`: `AppId`; `releaseId`: `ReleaseId`; `authorityVersion`: `number`; \}; `artifactDigest`: `Sha256Digest`; `subject`: \| \{ `kind`: `"call"`; `context`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; `sessionId?`: `string`; `agentPolicy?`: \{ `policyRevision`: `string`; `grantorMemberId`: `string`; \}; `method?`: \{ `name`: `string`; `effect`: `"read"` \| `"write"` \| `"external"`; \}; `replay?`: \{ `lane`: `string`; `epoch`: `number`; `admitted`: readonly `string`[]; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onGitPush"`; `eventId`: `string`; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onRegion"`; `event`: `"message"` \| `"connect"` \| `"close"` \| `"alarm"`; `context?`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"syncRefused"`; `lane`: `string`; `code`: `"access_changed"` \| `"installation_unavailable"`; \}; `grants`: readonly `object`[]; `deadlineAt`: `number`; `ancestry`: readonly [`InstanceId`](index.md#instanceid)[]; \} |
1154
+ | `facts.instanceId` | [`InstanceId`](index.md#instanceid) |
1155
+ | `facts.selection` | \{ `instanceId`: [`InstanceId`](index.md#instanceid); `owner`: \{ `kind`: `"installation"` \| `"deployment"`; `id`: `string`; \}; `appId`: `AppId`; `releaseId`: `ReleaseId`; `authorityVersion`: `number`; \} |
1156
+ | `facts.selection.instanceId` | [`InstanceId`](index.md#instanceid) |
1157
+ | `facts.selection.owner` | \{ `kind`: `"installation"` \| `"deployment"`; `id`: `string`; \} |
1158
+ | `facts.selection.owner.kind` | `"installation"` \| `"deployment"` |
1159
+ | `facts.selection.owner.id` | `string` |
1160
+ | `facts.selection.appId` | `AppId` |
1161
+ | `facts.selection.releaseId` | `ReleaseId` |
1162
+ | `facts.selection.authorityVersion` | `number` |
1163
+ | `facts.artifactDigest` | `Sha256Digest` |
1164
+ | `facts.subject` | \| \{ `kind`: `"call"`; `context`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; `sessionId?`: `string`; `agentPolicy?`: \{ `policyRevision`: `string`; `grantorMemberId`: `string`; \}; `method?`: \{ `name`: `string`; `effect`: `"read"` \| `"write"` \| `"external"`; \}; `replay?`: \{ `lane`: `string`; `epoch`: `number`; `admitted`: readonly `string`[]; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onGitPush"`; `eventId`: `string`; \} \| \{ `kind`: `"lifecycle"`; `name`: `"onRegion"`; `event`: `"message"` \| `"connect"` \| `"close"` \| `"alarm"`; `context?`: \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \}; `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"` \| `"admin"`; `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`; \}; \} \| \{ `kind`: `"lifecycle"`; `name`: `"syncRefused"`; `lane`: `string`; `code`: `"access_changed"` \| `"installation_unavailable"`; \} |
1165
+ | `facts.grants` | readonly `object`[] |
1166
+ | `facts.deadlineAt` | `number` |
1167
+ | `facts.ancestry` | readonly [`InstanceId`](index.md#instanceid)[] |
1168
+ | `limits` | `Readonly`\<\{ `cpuMs`: `number`; `subRequests`: `number`; \}\> |
1169
+
1170
+ #### Returns
1171
+
1172
+ `Request`
1173
+
1174
+ ---
1175
+
1176
+ ### readRegionAdmission()
1177
+
1178
+ ```ts
1179
+ function readRegionAdmission(request):
1180
+ | {
1181
+ facts: {
1182
+ instanceId: InstanceId;
1183
+ selection: {
1184
+ instanceId: InstanceId;
1185
+ owner: {
1186
+ kind: "installation" | "deployment";
1187
+ id: string;
1188
+ };
1189
+ appId: AppId;
1190
+ releaseId: ReleaseId;
1191
+ authorityVersion: number;
1192
+ };
1193
+ artifactDigest: Sha256Digest;
1194
+ subject: | {
1195
+ kind: "call";
1196
+ context: {
1197
+ scope: | {
1198
+ kind: "team";
1199
+ teamId: string;
1200
+ }
1201
+ | {
1202
+ kind: "standalone";
1203
+ tenant: string;
1204
+ };
1205
+ computerId: string | null;
1206
+ actor: | {
1207
+ kind: "member";
1208
+ memberId: string;
1209
+ }
1210
+ | {
1211
+ kind: "agent";
1212
+ agentId: string;
1213
+ }
1214
+ | {
1215
+ kind: "team-key";
1216
+ keyId: string;
1217
+ };
1218
+ backgroundLane?: string;
1219
+ backgroundOrigin?: {
1220
+ method: string;
1221
+ seal: string;
1222
+ };
1223
+ role?: "member" | "owner" | "admin";
1224
+ soleMember?: true;
1225
+ workflow?: {
1226
+ workflowId: string;
1227
+ runId: string;
1228
+ nodeId: string;
1229
+ armedBy: | {
1230
+ kind: "member";
1231
+ memberId: string;
1232
+ }
1233
+ | {
1234
+ kind: "agent";
1235
+ agentId: string;
1236
+ }
1237
+ | {
1238
+ kind: "team-key";
1239
+ keyId: string;
1240
+ };
1241
+ };
1242
+ idempotencyKey?: string;
1243
+ };
1244
+ sessionId?: string;
1245
+ agentPolicy?: {
1246
+ policyRevision: string;
1247
+ grantorMemberId: string;
1248
+ };
1249
+ method?: {
1250
+ name: string;
1251
+ effect: "read" | "write" | "external";
1252
+ };
1253
+ replay?: {
1254
+ lane: string;
1255
+ epoch: number;
1256
+ admitted: readonly string[];
1257
+ };
1258
+ }
1259
+ | {
1260
+ kind: "lifecycle";
1261
+ name: "onGitPush";
1262
+ eventId: string;
1263
+ }
1264
+ | {
1265
+ kind: "lifecycle";
1266
+ name: "onRegion";
1267
+ event: "message" | "connect" | "close" | "alarm";
1268
+ context?: {
1269
+ scope: | {
1270
+ kind: "team";
1271
+ teamId: string;
1272
+ }
1273
+ | {
1274
+ kind: "standalone";
1275
+ tenant: string;
1276
+ };
1277
+ computerId: string | null;
1278
+ actor: | {
1279
+ kind: "member";
1280
+ memberId: string;
1281
+ }
1282
+ | {
1283
+ kind: "agent";
1284
+ agentId: string;
1285
+ }
1286
+ | {
1287
+ kind: "team-key";
1288
+ keyId: string;
1289
+ };
1290
+ backgroundLane?: string;
1291
+ backgroundOrigin?: {
1292
+ method: string;
1293
+ seal: string;
1294
+ };
1295
+ role?: "member" | "owner" | "admin";
1296
+ soleMember?: true;
1297
+ workflow?: {
1298
+ workflowId: string;
1299
+ runId: string;
1300
+ nodeId: string;
1301
+ armedBy: | {
1302
+ kind: ...;
1303
+ memberId: ...;
1304
+ }
1305
+ | {
1306
+ kind: ...;
1307
+ agentId: ...;
1308
+ }
1309
+ | {
1310
+ kind: ...;
1311
+ keyId: ...;
1312
+ };
1313
+ };
1314
+ idempotencyKey?: string;
1315
+ };
1316
+ }
1317
+ | {
1318
+ kind: "lifecycle";
1319
+ name: "syncRefused";
1320
+ lane: string;
1321
+ code: "access_changed" | "installation_unavailable";
1322
+ };
1323
+ grants: readonly object[];
1324
+ deadlineAt: number;
1325
+ ancestry: readonly InstanceId[];
1326
+ };
1327
+ limits: Readonly<{
1328
+ cpuMs: number;
1329
+ subRequests: number;
1330
+ }>;
1331
+ }
1332
+ | null;
1333
+ ```
1334
+
1335
+ Instance side: read the host's admission; null when this is no Region connect.
1336
+
1337
+ #### Parameters
1338
+
1339
+ | Parameter | Type |
1340
+ | --------- | --------- |
1341
+ | `request` | `Request` |
1342
+
1343
+ #### Returns
1344
+
1345
+ \| \{ `facts`: \{ `instanceId`: [`InstanceId`](index.md#instanceid);
1346
+ `selection`: \{ `instanceId`: [`InstanceId`](index.md#instanceid); `owner`: \{
1347
+ `kind`: `"installation"` \| `"deployment"`; `id`: `string`; \}; `appId`:
1348
+ `AppId`; `releaseId`: `ReleaseId`; `authorityVersion`: `number`; \};
1349
+ `artifactDigest`: `Sha256Digest`; `subject`: \| \{ `kind`: `"call"`; `context`:
1350
+ \{ `scope`: \| \{ `kind`: `"team"`; `teamId`: `string`; \} \| \{ `kind`:
1351
+ `"standalone"`; `tenant`: `string`; \}; `computerId`: `string` \| `null`;
1352
+ `actor`: \| \{ `kind`: `"member"`; `memberId`: `string`; \} \| \{ `kind`:
1353
+ `"agent"`; `agentId`: `string`; \} \| \{ `kind`: `"team-key"`; `keyId`:
1354
+ `string`; \}; `backgroundLane?`: `string`; `backgroundOrigin?`: \{ `method`:
1355
+ `string`; `seal`: `string`; \}; `role?`: `"member"` \| `"owner"` \| `"admin"`;
1356
+ `soleMember?`: `true`; `workflow?`: \{ `workflowId`: `string`; `runId`:
1357
+ `string`; `nodeId`: `string`; `armedBy`: \| \{ `kind`: `"member"`; `memberId`:
1358
+ `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`:
1359
+ `"team-key"`; `keyId`: `string`; \}; \}; `idempotencyKey?`: `string`; \};
1360
+ `sessionId?`: `string`; `agentPolicy?`: \{ `policyRevision`: `string`;
1361
+ `grantorMemberId`: `string`; \}; `method?`: \{ `name`: `string`; `effect`:
1362
+ `"read"` \| `"write"` \| `"external"`; \}; `replay?`: \{ `lane`: `string`;
1363
+ `epoch`: `number`; `admitted`: readonly `string`[]; \}; \} \| \{ `kind`:
1364
+ `"lifecycle"`; `name`: `"onGitPush"`; `eventId`: `string`; \} \| \{ `kind`:
1365
+ `"lifecycle"`; `name`: `"onRegion"`; `event`: `"message"` \| `"connect"` \|
1366
+ `"close"` \| `"alarm"`; `context?`: \{ `scope`: \| \{ `kind`: `"team"`;
1367
+ `teamId`: `string`; \} \| \{ `kind`: `"standalone"`; `tenant`: `string`; \};
1368
+ `computerId`: `string` \| `null`; `actor`: \| \{ `kind`: `"member"`; `memberId`:
1369
+ `string`; \} \| \{ `kind`: `"agent"`; `agentId`: `string`; \} \| \{ `kind`:
1370
+ `"team-key"`; `keyId`: `string`; \}; `backgroundLane?`: `string`;
1371
+ `backgroundOrigin?`: \{ `method`: `string`; `seal`: `string`; \}; `role?`:
1372
+ `"member"` \| `"owner"` \| `"admin"`; `soleMember?`: `true`; `workflow?`: \{
1373
+ `workflowId`: `string`; `runId`: `string`; `nodeId`: `string`; `armedBy`: \| \{
1374
+ `kind`: ...; `memberId`: ...; \} \| \{ `kind`: ...; `agentId`: ...; \} \| \{
1375
+ `kind`: ...; `keyId`: ...; \}; \}; `idempotencyKey?`: `string`; \}; \} \| \{
1376
+ `kind`: `"lifecycle"`; `name`: `"syncRefused"`; `lane`: `string`; `code`:
1377
+ `"access_changed"` \| `"installation_unavailable"`; \}; `grants`: readonly
1378
+ `object`[]; `deadlineAt`: `number`; `ancestry`: readonly
1379
+ [`InstanceId`](index.md#instanceid)[]; \}; `limits`: `Readonly`\<\{ `cpuMs`:
1380
+ `number`; `subRequests`: `number`; \}\>; \} \| `null`