@fungi.computer/oyster 0.0.1 → 0.2.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 (195) hide show
  1. package/README.md +228 -176
  2. package/dist/agent-avatars.d.ts +103 -0
  3. package/dist/agent-avatars.js +66 -0
  4. package/dist/agents.d.ts +12 -2
  5. package/dist/agents.js +39 -2
  6. package/dist/app-builds.d.ts +76 -17
  7. package/dist/app-builds.js +207 -63
  8. package/dist/app-sources.d.ts +7 -22
  9. package/dist/app-sources.js +49 -14
  10. package/dist/apps/gate.d.ts +7 -7
  11. package/dist/apps/gate.js +6 -6
  12. package/dist/apps/installation.d.ts +35 -35
  13. package/dist/apps/installation.js +20 -19
  14. package/dist/build/artifact-writer.d.ts +40 -0
  15. package/dist/build/artifact-writer.js +181 -0
  16. package/dist/build/build-jobs.js +7 -1
  17. package/dist/build/build-policy.d.ts +10 -0
  18. package/dist/build/build-policy.js +10 -0
  19. package/dist/build/build-step.d.ts +12 -1
  20. package/dist/build/build-step.js +9 -1
  21. package/dist/build/candidate-builder.d.ts +68 -0
  22. package/dist/build/candidate-builder.js +91 -0
  23. package/dist/build/candidate-cli.d.ts +1 -0
  24. package/dist/build/candidate-cli.js +119 -0
  25. package/dist/build/candidate-cli.mjs +28220 -0
  26. package/dist/build/content-objects.d.ts +37 -0
  27. package/dist/build/content-objects.js +53 -0
  28. package/dist/build/effect.d.ts +18 -0
  29. package/dist/build/effect.js +52 -12
  30. package/dist/build/git-environment.d.ts +3 -0
  31. package/dist/build/git-environment.js +21 -9
  32. package/dist/build/local-build.d.ts +13 -3
  33. package/dist/build/local-build.js +149 -99
  34. package/dist/build/snapshot-package-store.d.ts +10 -0
  35. package/dist/build/snapshot-package-store.js +15 -0
  36. package/dist/build/snapshot-program-scripts.js +1 -1
  37. package/dist/build/snapshot-programs/snapshot-path.d.ts +2 -0
  38. package/dist/build/snapshot-programs/snapshot-path.js +6 -0
  39. package/dist/build/submission-contract.d.ts +461 -17
  40. package/dist/build/submission-contract.js +136 -26
  41. package/dist/build/workspace-build.d.ts +7 -2
  42. package/dist/build/workspace-build.js +55 -11
  43. package/dist/build-contract.d.ts +3 -0
  44. package/dist/build-contract.js +3 -0
  45. package/dist/build-egress.d.ts +62 -0
  46. package/dist/build-egress.js +148 -0
  47. package/dist/build.d.ts +1 -0
  48. package/dist/build.js +1 -0
  49. package/dist/cloudflare.js +4 -4
  50. package/dist/frame-binding-wire-script.js +1 -1
  51. package/dist/frame-binding-wire.d.ts +1 -1
  52. package/dist/frame-binding-wire.js +1 -1
  53. package/dist/git-journal.js +4 -4
  54. package/dist/index.d.ts +1 -0
  55. package/dist/index.js +1 -0
  56. package/dist/installation-consent.d.ts +3 -1
  57. package/dist/installation-consent.js +2 -0
  58. package/dist/mcp-owner.js +20 -8
  59. package/dist/pack.d.ts +6 -3
  60. package/dist/pack.js +28 -11
  61. package/dist/page/gill-observation.d.ts +4 -0
  62. package/dist/page/gill-observation.js +31 -0
  63. package/dist/page/mount.d.ts +4 -8
  64. package/dist/page/window-launch.d.ts +18 -0
  65. package/dist/page/window-launch.js +11 -0
  66. package/dist/page-script.js +4 -4
  67. package/dist/release.d.ts +11 -0
  68. package/dist/release.js +4 -1
  69. package/dist/shell/app-directory.d.ts +50 -45
  70. package/dist/shell/app-directory.js +19 -18
  71. package/dist/shell/shell-module.d.ts +26 -2
  72. package/dist/shell/shell-module.js +51 -2
  73. package/dist/shell/window-manager.d.ts +5 -1
  74. package/dist/shell/window-manager.js +21 -2
  75. package/dist/shell/workbench-directory.d.ts +332 -0
  76. package/dist/shell/workbench-directory.js +35 -0
  77. package/dist/shell/workbench-host-types.d.ts +1 -1
  78. package/dist/shell/workbench-host.js +5 -0
  79. package/dist/shell/workbench-model.d.ts +3 -1
  80. package/dist/source/index.d.ts +6 -7
  81. package/dist/source/index.js +6 -7
  82. package/dist/source/template-push.d.ts +33 -0
  83. package/dist/source/template-push.js +223 -0
  84. package/dist/source/template-repository.d.ts +2 -0
  85. package/dist/source/template-repository.js +13 -0
  86. package/dist/source/{template-write.d.ts → template-seed.d.ts} +19 -20
  87. package/dist/source/template-seed.js +80 -0
  88. package/dist/standalone/agent-directory.d.ts +4 -0
  89. package/dist/standalone/agent-directory.js +4 -0
  90. package/dist/standalone/agents.d.ts +227 -0
  91. package/dist/standalone/agents.js +834 -0
  92. package/dist/standalone/app-builds-binding.d.ts +36 -0
  93. package/dist/standalone/app-builds-binding.js +119 -0
  94. package/dist/standalone/app-set.d.ts +91 -0
  95. package/dist/standalone/app-set.js +395 -0
  96. package/dist/standalone/app-source.d.ts +41 -0
  97. package/dist/standalone/app-source.js +59 -0
  98. package/dist/standalone/builds.d.ts +18 -0
  99. package/dist/standalone/builds.js +101 -0
  100. package/dist/standalone/computer-egress.d.ts +37 -0
  101. package/dist/standalone/computer-egress.js +111 -0
  102. package/dist/standalone/computer.d.ts +122 -0
  103. package/dist/standalone/computer.js +714 -0
  104. package/dist/standalone/install-apps-cli.d.ts +2 -0
  105. package/dist/standalone/install-apps-cli.js +126 -0
  106. package/dist/standalone/instance.d.ts +35 -0
  107. package/dist/standalone/instance.js +74 -0
  108. package/dist/standalone/media.d.ts +76 -0
  109. package/dist/standalone/media.js +227 -0
  110. package/dist/standalone/preview.d.ts +51 -0
  111. package/dist/standalone/preview.js +167 -0
  112. package/dist/standalone/registry.d.ts +102 -0
  113. package/dist/standalone/registry.js +193 -0
  114. package/dist/standalone/tenancy.d.ts +42 -0
  115. package/dist/standalone/tenancy.js +241 -0
  116. package/dist/standalone/worker.d.ts +55 -0
  117. package/dist/standalone/worker.js +147 -0
  118. package/dist/standalone/workflow-authority-readers.d.ts +16 -0
  119. package/dist/standalone/workflow-authority-readers.js +35 -0
  120. package/dist/standalone/workflow-binding.d.ts +216 -0
  121. package/dist/standalone/workflow-binding.js +217 -0
  122. package/dist/standalone/workflow-events.d.ts +46 -0
  123. package/dist/standalone/workflow-events.js +39 -0
  124. package/dist/standalone/workflow-git-capture.d.ts +7 -0
  125. package/dist/standalone/workflow-git-capture.js +62 -0
  126. package/dist/standalone/workflow-host.d.ts +955 -0
  127. package/dist/standalone/workflow-host.js +778 -0
  128. package/dist/standalone/workflow-node-capture.d.ts +13 -0
  129. package/dist/standalone/workflow-node-capture.js +72 -0
  130. package/dist/standalone/workflow-root-authority.d.ts +27 -0
  131. package/dist/standalone/workflow-root-authority.js +87 -0
  132. package/dist/standalone/workflow-schedules.d.ts +52 -0
  133. package/dist/standalone/workflow-schedules.js +40 -0
  134. package/dist/standalone/workflow-trigger-host.d.ts +1716 -0
  135. package/dist/standalone/workflow-trigger-host.js +52 -0
  136. package/dist/standalone/workflows.d.ts +713 -0
  137. package/dist/standalone/workflows.js +554 -0
  138. package/dist/tenancy/auth0.d.ts +64 -0
  139. package/dist/tenancy/auth0.js +198 -0
  140. package/dist/tenancy/cloudflare/rate-limit.d.ts +8 -0
  141. package/dist/tenancy/cloudflare/rate-limit.js +19 -0
  142. package/dist/tenancy/cloudflare/registry.d.ts +50 -0
  143. package/dist/tenancy/cloudflare/registry.js +301 -0
  144. package/dist/tenancy/cloudflare.d.ts +2 -0
  145. package/dist/tenancy/cloudflare.js +2 -0
  146. package/dist/tenancy/cold-directory.d.ts +13 -0
  147. package/dist/tenancy/cold-directory.js +43 -0
  148. package/dist/tenancy/contracts.d.ts +195 -0
  149. package/dist/tenancy/contracts.js +1 -0
  150. package/dist/tenancy/index.d.ts +19 -0
  151. package/dist/tenancy/index.js +156 -0
  152. package/dist/tenancy/owner-key.d.ts +26 -0
  153. package/dist/tenancy/owner-key.js +63 -0
  154. package/dist/tenancy/oyster.d.ts +4 -0
  155. package/dist/tenancy/oyster.js +25 -0
  156. package/dist/tenancy/registry-record.d.ts +7 -0
  157. package/dist/tenancy/registry-record.js +44 -0
  158. package/dist/tenancy/registry.d.ts +27 -0
  159. package/dist/tenancy/registry.js +138 -0
  160. package/dist/tenancy/resolve.d.ts +7 -0
  161. package/dist/tenancy/resolve.js +64 -0
  162. package/dist/workers-git.js +1 -4
  163. package/dist/workers.d.ts +2 -2
  164. package/dist/workers.js +3 -1
  165. package/docs/api/build-contract.md +829 -32
  166. package/docs/api/build.md +253 -17
  167. package/docs/api/modules.md +40 -32
  168. package/docs/api/pack.md +6 -3
  169. package/docs/api/shell/app-directory.md +267 -0
  170. package/docs/api/shell/shell-module.md +64 -3
  171. package/docs/api/shell/workbench-directory.md +119 -0
  172. package/docs/api/shell/workbench.md +19 -0
  173. package/docs/api/shell.md +127 -0
  174. package/docs/api/tenancy/auth0.md +110 -0
  175. package/docs/api/tenancy/cloudflare.md +221 -0
  176. package/docs/api/tenancy/cold-directory.md +46 -0
  177. package/docs/api/tenancy/owner-key.md +63 -0
  178. package/docs/api/tenancy/registry.md +77 -0
  179. package/docs/api/tenancy/resolve.md +69 -0
  180. package/docs/api/tenancy.md +430 -0
  181. package/docs/api/workers-git.md +140 -21
  182. package/docs/api/workers.md +15 -2
  183. package/docs/site/agent-quickstart.mdx +52 -55
  184. package/examples/standalone/worker.ts +7 -14
  185. package/examples/standalone/wrangler.jsonc +67 -6
  186. package/package.json +78 -25
  187. package/dist/build/r2-artifact-writer.d.ts +0 -31
  188. package/dist/build/r2-artifact-writer.js +0 -179
  189. package/dist/source/template-write.js +0 -344
  190. package/docs/media/architecture.mmd +0 -32
  191. package/docs/media/architecture.png +0 -0
  192. package/docs/media/bonsai-network.png +0 -0
  193. package/docs/media/bonsai-repository.png +0 -0
  194. package/examples/git/worker.ts +0 -39
  195. package/examples/git/wrangler.jsonc +0 -32
package/docs/api/shell.md CHANGED
@@ -1366,6 +1366,16 @@ Release this host registration.
1366
1366
 
1367
1367
  `Promise`\<`void`\>
1368
1368
 
1369
+ ---
1370
+
1371
+ ### TeamComputer
1372
+
1373
+ ```ts
1374
+ type TeamComputer = z.output<typeof teamComputerSchema>;
1375
+ ```
1376
+
1377
+ A decoded Team Computer inventory record.
1378
+
1369
1379
  ## Variables
1370
1380
 
1371
1381
  ### workbenchGillRequestSchema
@@ -1476,6 +1486,50 @@ const appOpenRequestSchema: Union<
1476
1486
 
1477
1487
  Runtime check for an App-open handoff arriving across an untrusted boundary.
1478
1488
 
1489
+ ---
1490
+
1491
+ ### teamComputerSchema
1492
+
1493
+ ```ts
1494
+ const teamComputerSchema: ZodObject<
1495
+ {
1496
+ computerId: ZodString;
1497
+ name: ZodString;
1498
+ createdAt: ZodNumber;
1499
+ updatedAt: ZodNumber;
1500
+ },
1501
+ $strict
1502
+ >;
1503
+ ```
1504
+
1505
+ One Team Computer in a host's inventory: the wire of `computers()`.
1506
+
1507
+ ---
1508
+
1509
+ ### teamComputerDirectorySchema
1510
+
1511
+ ```ts
1512
+ const teamComputerDirectorySchema: ZodObject<
1513
+ {
1514
+ computers: ZodArray<
1515
+ ZodObject<
1516
+ {
1517
+ computerId: ZodString;
1518
+ name: ZodString;
1519
+ createdAt: ZodNumber;
1520
+ updatedAt: ZodNumber;
1521
+ },
1522
+ $strict
1523
+ >
1524
+ >;
1525
+ nextOffset: ZodNullable<ZodNumber>;
1526
+ },
1527
+ $strict
1528
+ >;
1529
+ ```
1530
+
1531
+ One page of a host's Team Computer inventory.
1532
+
1479
1533
  ## Functions
1480
1534
 
1481
1535
  ### createBrowserActionHandler()
@@ -1561,6 +1615,79 @@ Re-exports
1561
1615
 
1562
1616
  ---
1563
1617
 
1618
+ ### appComputerPermissionSchema
1619
+
1620
+ Re-exports
1621
+ [appComputerPermissionSchema](shell/app-directory.md#appcomputerpermissionschema)
1622
+
1623
+ ---
1624
+
1625
+ ### AppComputerOperation
1626
+
1627
+ Re-exports [AppComputerOperation](shell/app-directory.md#appcomputeroperation)
1628
+
1629
+ ---
1630
+
1631
+ ### AppComputerPermission
1632
+
1633
+ Re-exports [AppComputerPermission](shell/app-directory.md#appcomputerpermission)
1634
+
1635
+ ---
1636
+
1637
+ ### appAgentPermissionSchema
1638
+
1639
+ Re-exports
1640
+ [appAgentPermissionSchema](shell/app-directory.md#appagentpermissionschema)
1641
+
1642
+ ---
1643
+
1644
+ ### AppAgentPermission
1645
+
1646
+ Re-exports [AppAgentPermission](shell/app-directory.md#appagentpermission)
1647
+
1648
+ ---
1649
+
1650
+ ### appGenerationPermissionsSchema
1651
+
1652
+ Re-exports
1653
+ [appGenerationPermissionsSchema](shell/app-directory.md#appgenerationpermissionsschema)
1654
+
1655
+ ---
1656
+
1657
+ ### AppGenerationPermissions
1658
+
1659
+ Re-exports
1660
+ [AppGenerationPermissions](shell/app-directory.md#appgenerationpermissions)
1661
+
1662
+ ---
1663
+
1664
+ ### appMarketplacePermissionsSchema
1665
+
1666
+ Re-exports
1667
+ [appMarketplacePermissionsSchema](shell/app-directory.md#appmarketplacepermissionsschema)
1668
+
1669
+ ---
1670
+
1671
+ ### AppMarketplacePermissions
1672
+
1673
+ Re-exports
1674
+ [AppMarketplacePermissions](shell/app-directory.md#appmarketplacepermissions)
1675
+
1676
+ ---
1677
+
1678
+ ### appDirectoryResponseSchema
1679
+
1680
+ Re-exports
1681
+ [appDirectoryResponseSchema](shell/app-directory.md#appdirectoryresponseschema)
1682
+
1683
+ ---
1684
+
1685
+ ### AppDirectory
1686
+
1687
+ Re-exports [AppDirectory](shell/app-directory.md#appdirectory)
1688
+
1689
+ ---
1690
+
1564
1691
  ### appCatalogEntrySchema
1565
1692
 
1566
1693
  Re-exports [appCatalogEntrySchema](shell/app-directory.md#appcatalogentryschema)
@@ -0,0 +1,110 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/oyster**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/oyster](../modules.md) / tenancy/auth0
8
+
9
+ # tenancy/auth0
10
+
11
+ ## Type Aliases
12
+
13
+ ### Auth0Transaction
14
+
15
+ ```ts
16
+ type Auth0Transaction = Readonly<{
17
+ tenantId: TenantId;
18
+ redirectUri: string;
19
+ state: string;
20
+ codeVerifier: string;
21
+ expiresAt: number;
22
+ }>;
23
+ ```
24
+
25
+ One short-lived, single-use browser authorization transaction.
26
+
27
+ ---
28
+
29
+ ### Auth0Session
30
+
31
+ ```ts
32
+ type Auth0Session = Readonly<{
33
+ tenantId: TenantId;
34
+ identity: Identity;
35
+ expiresAt: number;
36
+ }>;
37
+ ```
38
+
39
+ Server-owned verified identity session; browsers receive only its random handle.
40
+
41
+ ---
42
+
43
+ ### Auth0BrowserOptions
44
+
45
+ ```ts
46
+ type Auth0BrowserOptions = Readonly<{
47
+ callbackPath: string;
48
+ resolveTenant: ReadonlyTenancy["resolve"];
49
+ registry: Pick<ReadonlyTenantRegistry, "get" | "membershipOf">;
50
+ transactions: Readonly<{
51
+ put: Promise<void>;
52
+ take: Promise<Readonly<{
53
+ tenantId: TenantId;
54
+ redirectUri: string;
55
+ state: string;
56
+ codeVerifier: string;
57
+ expiresAt: number;
58
+ }> | null>;
59
+ }>;
60
+ sessions: Readonly<{
61
+ put: Promise<void>;
62
+ get: Promise<Readonly<{
63
+ tenantId: TenantId;
64
+ identity: Identity;
65
+ expiresAt: number;
66
+ }> | null>;
67
+ }>;
68
+ }>;
69
+ ```
70
+
71
+ Host ports for optional browser login; stored state must be shared across host
72
+ instances.
73
+
74
+ ---
75
+
76
+ ### Auth0Options
77
+
78
+ ```ts
79
+ type Auth0Options = Readonly<{
80
+ domain: string;
81
+ clientId: string;
82
+ audience: string;
83
+ clientSecret?: string;
84
+ fetch?: typeof globalThis.fetch;
85
+ browser?: Auth0BrowserOptions;
86
+ }>;
87
+ ```
88
+
89
+ Auth0 issuer and audience configuration; browser login is opt-in.
90
+
91
+ ## Functions
92
+
93
+ ### auth0()
94
+
95
+ ```ts
96
+ function auth0(options): AuthAdapter;
97
+ ```
98
+
99
+ Verify Auth0 identities; the registry alone supplies canonical membership and
100
+ role.
101
+
102
+ #### Parameters
103
+
104
+ | Parameter | Type |
105
+ | --------- | ------------------------------- |
106
+ | `options` | [`Auth0Options`](#auth0options) |
107
+
108
+ #### Returns
109
+
110
+ [`AuthAdapter`](../tenancy.md#authadapter)
@@ -0,0 +1,221 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/oyster**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/oyster](../modules.md) / tenancy/cloudflare
8
+
9
+ # tenancy/cloudflare
10
+
11
+ ## Type Aliases
12
+
13
+ ### RateLimitOptions
14
+
15
+ ```ts
16
+ type RateLimitOptions = Readonly<{
17
+ retryAfterSeconds: number;
18
+ }>;
19
+ ```
20
+
21
+ Retry-After is an advisory response delay, not a configured quota or reset time.
22
+
23
+ ---
24
+
25
+ ### RegistryAdmission
26
+
27
+ ```ts
28
+ type RegistryAdmission = Readonly<{
29
+ tenant: Tenant;
30
+ membership: Membership | null;
31
+ }>;
32
+ ```
33
+
34
+ The registry owner's atomic read of one host and one identity.
35
+
36
+ ---
37
+
38
+ ### AdmissionRecord
39
+
40
+ ```ts
41
+ type AdmissionRecord = RegistryAdmission &
42
+ Readonly<{
43
+ host: string;
44
+ identity: Identity;
45
+ }>;
46
+ ```
47
+
48
+ One request's atomic registry read, with the host and identity it named.
49
+
50
+ ---
51
+
52
+ ### TenantAdmission
53
+
54
+ ```ts
55
+ type TenantAdmission = AdmissionRecord & Brand<"TenantAdmission">;
56
+ ```
57
+
58
+ One atomic registry read for one request. Only
59
+ [durableObjectRegistry](#durableobjectregistry) constructs it, so lower layers
60
+ cannot mint authority.
61
+
62
+ ---
63
+
64
+ ### TenancyRegistryDO
65
+
66
+ ```ts
67
+ type TenancyRegistryDO = ManagedTenantRegistry &
68
+ Required<Pick<ReadonlyTenantRegistry, "byDomain">> &
69
+ Readonly<{
70
+ admission: Promise<Readonly<{
71
+ tenant: Tenant;
72
+ membership: Membership | null;
73
+ }> | null>;
74
+ }> &
75
+ Rpc.DurableObjectBranded;
76
+ ```
77
+
78
+ Native registry instance; its public shape exposes no runtime-private state.
79
+
80
+ ---
81
+
82
+ ### DomainRegistry
83
+
84
+ ```ts
85
+ type DomainRegistry = ReadonlyTenantRegistry &
86
+ Required<Pick<ReadonlyTenantRegistry, "byDomain">>;
87
+ ```
88
+
89
+ A read-only registry that includes the provisioned-domain index.
90
+
91
+ ---
92
+
93
+ ### DurableReadonlyRegistry
94
+
95
+ ```ts
96
+ type DurableReadonlyRegistry = DomainRegistry &
97
+ Readonly<{
98
+ admission: Promise<TenantAdmission | null>;
99
+ }>;
100
+ ```
101
+
102
+ Read-only native registry, with one-read request admission.
103
+
104
+ ---
105
+
106
+ ### DurableRegistry
107
+
108
+ ```ts
109
+ type DurableRegistry = ManagedTenantRegistry & DurableReadonlyRegistry;
110
+ ```
111
+
112
+ Managed native registry includes the provisioned-domain index.
113
+
114
+ ## Variables
115
+
116
+ ### TenancyRegistryDO
117
+
118
+ ```ts
119
+ TenancyRegistryDO: (ctx) => TenancyRegistryDO;
120
+ ```
121
+
122
+ Re-export from a host Worker and bind a SQLite-backed Durable Object namespace.
123
+
124
+ Re-export from a host Worker and bind a SQLite-backed Durable Object namespace.
125
+
126
+ #### Parameters
127
+
128
+ | Parameter | Type |
129
+ | --------- | -------------------- |
130
+ | `ctx` | `DurableObjectState` |
131
+
132
+ #### Returns
133
+
134
+ [`TenancyRegistryDO`](#tenancyregistrydo-1)
135
+
136
+ ## Functions
137
+
138
+ ### rateLimit()
139
+
140
+ ```ts
141
+ function rateLimit(binding, options): TenancyPolicy;
142
+ ```
143
+
144
+ Delegate abuse admission to the configured native binding, using only its key
145
+ API.
146
+
147
+ #### Parameters
148
+
149
+ | Parameter | Type |
150
+ | --------- | --------------------------------------- |
151
+ | `binding` | `Pick`\<`RateLimit`, `"limit"`\> |
152
+ | `options` | [`RateLimitOptions`](#ratelimitoptions) |
153
+
154
+ #### Returns
155
+
156
+ [`TenancyPolicy`](../tenancy.md#tenancypolicy)
157
+
158
+ ---
159
+
160
+ ### durableObjectRegistry()
161
+
162
+ #### Call Signature
163
+
164
+ ```ts
165
+ function durableObjectRegistry(binding, options): DurableReadonlyRegistry;
166
+ ```
167
+
168
+ Explicitly expose only read methods when the host requests a read-only facade.
169
+
170
+ ##### Parameters
171
+
172
+ | Parameter | Type |
173
+ | ------------------ | ------------------------------------------------------------------------------------------------ |
174
+ | `binding` | `Pick`\<`DurableObjectNamespace`\<[`TenancyRegistryDO`](#tenancyregistrydo-1)\>, `"getByName"`\> |
175
+ | `options` | \{ `readonly`: `true`; \} |
176
+ | `options.readonly` | `true` |
177
+
178
+ ##### Returns
179
+
180
+ [`DurableReadonlyRegistry`](#durablereadonlyregistry)
181
+
182
+ #### Call Signature
183
+
184
+ ```ts
185
+ function durableObjectRegistry(binding, options?): DurableRegistry;
186
+ ```
187
+
188
+ Use one namespace's registry object as the tenant and owner mapping authority.
189
+
190
+ ##### Parameters
191
+
192
+ | Parameter | Type |
193
+ | ------------------- | ------------------------------------------------------------------------------------------------ |
194
+ | `binding` | `Pick`\<`DurableObjectNamespace`\<[`TenancyRegistryDO`](#tenancyregistrydo-1)\>, `"getByName"`\> |
195
+ | `options?` | \{ `readonly?`: `false`; \} |
196
+ | `options.readonly?` | `false` |
197
+
198
+ ##### Returns
199
+
200
+ [`DurableRegistry`](#durableregistry)
201
+
202
+ ---
203
+
204
+ ### admittedRegistry()
205
+
206
+ ```ts
207
+ function admittedRegistry(admission): DomainRegistry;
208
+ ```
209
+
210
+ Answer registry reads only from one request's admission. Any other tenant, host,
211
+ identity or member reads as absent, so every refusal stays closed.
212
+
213
+ #### Parameters
214
+
215
+ | Parameter | Type |
216
+ | ----------- | ------------------------------------- |
217
+ | `admission` | [`TenantAdmission`](#tenantadmission) |
218
+
219
+ #### Returns
220
+
221
+ [`DomainRegistry`](#domainregistry)
@@ -0,0 +1,46 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/oyster**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/oyster](../modules.md) / tenancy/cold-directory
8
+
9
+ # tenancy/cold-directory
10
+
11
+ ## Type Aliases
12
+
13
+ ### ColdTenantDirectory
14
+
15
+ ```ts
16
+ type ColdTenantDirectory = Readonly<{
17
+ resolve: Promise<Readonly<{
18
+ scope: TenantScope;
19
+ auth: OysterAuth;
20
+ }> | null>;
21
+ }>;
22
+ ```
23
+
24
+ Live directory admission for a host-persisted tenant during background work.
25
+
26
+ ## Functions
27
+
28
+ ### coldTenantDirectory()
29
+
30
+ ```ts
31
+ function coldTenantDirectory(registry): ColdTenantDirectory;
32
+ ```
33
+
34
+ Reconstruct background admission from the same host-owned tenant registry. Every
35
+ selection and member lookup reads current authority. This adapter has no
36
+ credential authority: its authenticate method always refuses requests.
37
+
38
+ #### Parameters
39
+
40
+ | Parameter | Type |
41
+ | ---------- | ------------------------------------------------------------------------------------------------------------------- |
42
+ | `registry` | `Pick`\<[`ReadonlyTenantRegistry`](../tenancy.md#readonlytenantregistry), `"get"` \| `"status"` \| `"memberById"`\> |
43
+
44
+ #### Returns
45
+
46
+ [`ColdTenantDirectory`](#coldtenantdirectory)
@@ -0,0 +1,63 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/oyster**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/oyster](../modules.md) / tenancy/owner-key
8
+
9
+ # tenancy/owner-key
10
+
11
+ ## Type Aliases
12
+
13
+ ### OwnerKeyRecord
14
+
15
+ ```ts
16
+ type OwnerKeyRecord = Readonly<{
17
+ key: string;
18
+ memberId: string;
19
+ }>;
20
+ ```
21
+
22
+ Stored owner verification material for one selected tenant.
23
+
24
+ ---
25
+
26
+ ### OwnerKeyOptions
27
+
28
+ ```ts
29
+ type OwnerKeyOptions = Readonly<{
30
+ registry: Pick<ReadonlyTenantRegistry, "get">;
31
+ keys: Readonly<{
32
+ get: Promise<Readonly<{
33
+ key: string;
34
+ memberId: string;
35
+ }> | null>;
36
+ }>;
37
+ login?: Readonly<{
38
+ resolveTenant: ReadonlyTenancy["resolve"];
39
+ }>;
40
+ }>;
41
+ ```
42
+
43
+ Live owner authority and host-held verification material.
44
+
45
+ ## Functions
46
+
47
+ ### ownerKey()
48
+
49
+ ```ts
50
+ function ownerKey(options): AuthAdapter;
51
+ ```
52
+
53
+ Reuse Oyster verification and admit only a current, explicitly stored owner.
54
+
55
+ #### Parameters
56
+
57
+ | Parameter | Type |
58
+ | --------- | ------------------------------------- |
59
+ | `options` | [`OwnerKeyOptions`](#ownerkeyoptions) |
60
+
61
+ #### Returns
62
+
63
+ [`AuthAdapter`](../tenancy.md#authadapter)
@@ -0,0 +1,77 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/oyster**](../README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/oyster](../modules.md) / tenancy/registry
8
+
9
+ # tenancy/registry
10
+
11
+ ## Type Aliases
12
+
13
+ ### MemoryMembership
14
+
15
+ ```ts
16
+ type MemoryMembership = Readonly<{
17
+ tenantId: TenantId;
18
+ identity: Identity;
19
+ memberId: string;
20
+ role: Membership["role"];
21
+ }>;
22
+ ```
23
+
24
+ Initial live membership records for a disposable in-memory registry.
25
+
26
+ ---
27
+
28
+ ### MemoryRegistryOptions
29
+
30
+ ```ts
31
+ type MemoryRegistryOptions = Readonly<{
32
+ tenants?: readonly Tenant[];
33
+ memberships?: readonly MemoryMembership[];
34
+ }>;
35
+ ```
36
+
37
+ Provisioned records and canonical member mappings owned by the host.
38
+
39
+ ---
40
+
41
+ ### MemoryRegistry
42
+
43
+ ```ts
44
+ type MemoryRegistry = ManagedTenantRegistry &
45
+ Readonly<{
46
+ byDomain: Promise<Readonly<{
47
+ id: TenantId;
48
+ handle: string;
49
+ origin: string;
50
+ status: "active" | "suspended" | "deleting";
51
+ owners: readonly string[];
52
+ domains: readonly string[];
53
+ }> | null>;
54
+ }>;
55
+ ```
56
+
57
+ The memory adapter always supplies the optional custom-domain index.
58
+
59
+ ## Functions
60
+
61
+ ### memoryRegistry()
62
+
63
+ ```ts
64
+ function memoryRegistry(options?): MemoryRegistry;
65
+ ```
66
+
67
+ In-memory tenant and member owner; create updates both atomically.
68
+
69
+ #### Parameters
70
+
71
+ | Parameter | Type |
72
+ | --------- | ------------------------------------------------- |
73
+ | `options` | [`MemoryRegistryOptions`](#memoryregistryoptions) |
74
+
75
+ #### Returns
76
+
77
+ [`MemoryRegistry`](#memoryregistry)