@fungi.computer/oyster 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.
Files changed (242) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1082 -2
  3. package/dist/agents.d.ts +114 -0
  4. package/dist/agents.js +322 -0
  5. package/dist/app-builds.d.ts +151 -0
  6. package/dist/app-builds.js +355 -0
  7. package/dist/app-sandbox.d.ts +2 -0
  8. package/dist/app-sandbox.js +2 -0
  9. package/dist/app-sources.d.ts +46 -0
  10. package/dist/app-sources.js +335 -0
  11. package/dist/app-storage.d.ts +141 -0
  12. package/dist/app-storage.js +281 -0
  13. package/dist/apps/gate.d.ts +105 -0
  14. package/dist/apps/gate.js +273 -0
  15. package/dist/apps/index.d.ts +5 -0
  16. package/dist/apps/index.js +5 -0
  17. package/dist/apps/installation.d.ts +248 -0
  18. package/dist/apps/installation.js +307 -0
  19. package/dist/apps/operations.d.ts +8 -0
  20. package/dist/apps/operations.js +98 -0
  21. package/dist/apps/tools.d.ts +33 -0
  22. package/dist/apps/tools.js +17 -0
  23. package/dist/auth.d.ts +11 -0
  24. package/dist/auth.js +93 -0
  25. package/dist/backend-request.d.ts +3 -0
  26. package/dist/backend-request.js +53 -0
  27. package/dist/build/build-jobs.d.ts +128 -0
  28. package/dist/build/build-jobs.js +197 -0
  29. package/dist/build/build-step.d.ts +26 -0
  30. package/dist/build/build-step.js +20 -0
  31. package/dist/build/bundled-html.d.ts +7 -0
  32. package/dist/build/bundled-html.js +64 -0
  33. package/dist/build/definition-emission.d.ts +34 -0
  34. package/dist/build/definition-emission.js +201 -0
  35. package/dist/build/effect.d.ts +231 -0
  36. package/dist/build/effect.js +396 -0
  37. package/dist/build/git-environment.d.ts +6 -0
  38. package/dist/build/git-environment.js +48 -0
  39. package/dist/build/html-recipe.d.ts +20 -0
  40. package/dist/build/html-recipe.js +51 -0
  41. package/dist/build/local-build.d.ts +57 -0
  42. package/dist/build/local-build.js +1078 -0
  43. package/dist/build/r2-artifact-writer.d.ts +31 -0
  44. package/dist/build/r2-artifact-writer.js +179 -0
  45. package/dist/build/snapshot-package-store.d.ts +2 -0
  46. package/dist/build/snapshot-package-store.js +21 -0
  47. package/dist/build/snapshot-program-scripts.d.ts +6 -0
  48. package/dist/build/snapshot-program-scripts.js +2 -0
  49. package/dist/build/submission-contract.d.ts +384 -0
  50. package/dist/build/submission-contract.js +70 -0
  51. package/dist/build/workspace-build.d.ts +50 -0
  52. package/dist/build/workspace-build.js +156 -0
  53. package/dist/build-contract.d.ts +4 -0
  54. package/dist/build-contract.js +4 -0
  55. package/dist/build-jobs.d.ts +2 -0
  56. package/dist/build-jobs.js +2 -0
  57. package/dist/build.d.ts +11 -0
  58. package/dist/build.js +13 -0
  59. package/dist/capability-descriptor.d.ts +46 -0
  60. package/dist/capability-descriptor.js +51 -0
  61. package/dist/catalog-frame.d.ts +39 -0
  62. package/dist/catalog-frame.js +72 -0
  63. package/dist/cause-class.d.ts +19 -0
  64. package/dist/cause-class.js +54 -0
  65. package/dist/cloudflare.d.ts +123 -0
  66. package/dist/cloudflare.js +391 -0
  67. package/dist/computer-terminal.d.ts +38 -0
  68. package/dist/computer-terminal.js +410 -0
  69. package/dist/computer.d.ts +60 -0
  70. package/dist/computer.js +33 -0
  71. package/dist/event-recipients.d.ts +57 -0
  72. package/dist/event-recipients.js +144 -0
  73. package/dist/facet-invocation.d.ts +4 -0
  74. package/dist/facet-invocation.js +45 -0
  75. package/dist/files.d.ts +42 -0
  76. package/dist/files.js +123 -0
  77. package/dist/frame-binding-wire-script.d.ts +2 -0
  78. package/dist/frame-binding-wire-script.js +1 -0
  79. package/dist/frame-binding-wire.d.ts +28 -0
  80. package/dist/frame-binding-wire.js +54 -0
  81. package/dist/git-admission.d.ts +52 -0
  82. package/dist/git-admission.js +188 -0
  83. package/dist/git-auth.d.ts +11 -0
  84. package/dist/git-auth.js +27 -0
  85. package/dist/git-door.d.ts +35 -0
  86. package/dist/git-door.js +108 -0
  87. package/dist/git-journal.d.ts +31 -0
  88. package/dist/git-journal.js +188 -0
  89. package/dist/git.d.ts +31 -0
  90. package/dist/git.js +64 -0
  91. package/dist/guest-policy.d.ts +9 -0
  92. package/dist/guest-policy.js +13 -0
  93. package/dist/host.d.ts +244 -0
  94. package/dist/host.js +1043 -0
  95. package/dist/index.d.ts +166 -0
  96. package/dist/index.js +320 -0
  97. package/dist/installation-consent.d.ts +79 -0
  98. package/dist/installation-consent.js +82 -0
  99. package/dist/internal/background-origins.d.ts +3 -0
  100. package/dist/internal/background-origins.js +8 -0
  101. package/dist/internal/delivery.d.ts +12 -0
  102. package/dist/internal/delivery.js +167 -0
  103. package/dist/internal/host-gate.d.ts +14 -0
  104. package/dist/internal/host-gate.js +62 -0
  105. package/dist/internal/registry-installations.d.ts +6 -0
  106. package/dist/internal/registry-installations.js +12 -0
  107. package/dist/invocation.d.ts +251 -0
  108. package/dist/invocation.js +377 -0
  109. package/dist/keys.d.ts +48 -0
  110. package/dist/keys.js +52 -0
  111. package/dist/mcp-owner.d.ts +27 -0
  112. package/dist/mcp-owner.js +143 -0
  113. package/dist/mcp.d.ts +89 -0
  114. package/dist/mcp.js +429 -0
  115. package/dist/media.d.ts +23 -0
  116. package/dist/media.js +12 -0
  117. package/dist/pack.d.ts +76 -0
  118. package/dist/pack.js +134 -0
  119. package/dist/page/capabilities.d.ts +23 -0
  120. package/dist/page/capabilities.js +256 -0
  121. package/dist/page/computer-handles.d.ts +79 -0
  122. package/dist/page/computer-handles.js +44 -0
  123. package/dist/page/lifetime.d.ts +6 -0
  124. package/dist/page/lifetime.js +19 -0
  125. package/dist/page/mount.d.ts +163 -0
  126. package/dist/page/mount.js +390 -0
  127. package/dist/page/storage.d.ts +3 -0
  128. package/dist/page/storage.js +82 -0
  129. package/dist/page/terminal.d.ts +5 -0
  130. package/dist/page/terminal.js +7 -0
  131. package/dist/page-script.d.ts +14 -0
  132. package/dist/page-script.js +5 -0
  133. package/dist/r2-files.d.ts +3 -0
  134. package/dist/r2-files.js +79 -0
  135. package/dist/release.d.ts +72 -0
  136. package/dist/release.js +164 -0
  137. package/dist/root-data.d.ts +86 -0
  138. package/dist/root-data.js +69 -0
  139. package/dist/shell/app-directory.d.ts +537 -0
  140. package/dist/shell/app-directory.js +195 -0
  141. package/dist/shell/browser-actions.d.ts +7 -0
  142. package/dist/shell/browser-actions.js +56 -0
  143. package/dist/shell/command-host.d.ts +112 -0
  144. package/dist/shell/command-host.js +502 -0
  145. package/dist/shell/commands.d.ts +25 -0
  146. package/dist/shell/commands.js +78 -0
  147. package/dist/shell/index.d.ts +8 -0
  148. package/dist/shell/index.js +8 -0
  149. package/dist/shell/keys.d.ts +41 -0
  150. package/dist/shell/keys.js +134 -0
  151. package/dist/shell/shell-module.d.ts +31 -0
  152. package/dist/shell/shell-module.js +37 -0
  153. package/dist/shell/window-manager.d.ts +124 -0
  154. package/dist/shell/window-manager.js +711 -0
  155. package/dist/shell/workbench-contract.d.ts +68 -0
  156. package/dist/shell/workbench-contract.js +1 -0
  157. package/dist/shell/workbench-host-types.d.ts +96 -0
  158. package/dist/shell/workbench-host-types.js +1 -0
  159. package/dist/shell/workbench-host.d.ts +34 -0
  160. package/dist/shell/workbench-host.js +347 -0
  161. package/dist/shell/workbench-model.d.ts +192 -0
  162. package/dist/shell/workbench-model.js +53 -0
  163. package/dist/shell/workbench.d.ts +4 -0
  164. package/dist/shell/workbench.js +2 -0
  165. package/dist/source/fork.d.ts +27 -0
  166. package/dist/source/fork.js +46 -0
  167. package/dist/source/index.d.ts +11 -0
  168. package/dist/source/index.js +11 -0
  169. package/dist/source/seed-receipt.d.ts +53 -0
  170. package/dist/source/seed-receipt.js +18 -0
  171. package/dist/source/team-source.d.ts +32 -0
  172. package/dist/source/team-source.js +42 -0
  173. package/dist/source/template-repository.d.ts +2 -0
  174. package/dist/source/template-repository.js +8 -0
  175. package/dist/source/template-write.d.ts +69 -0
  176. package/dist/source/template-write.js +344 -0
  177. package/dist/storage-frame.d.ts +64 -0
  178. package/dist/storage-frame.js +28 -0
  179. package/dist/tenant.d.ts +81 -0
  180. package/dist/tenant.js +71 -0
  181. package/dist/testing/capabilities.d.ts +29 -0
  182. package/dist/testing/capabilities.js +130 -0
  183. package/dist/testing/catalog.d.ts +3 -0
  184. package/dist/testing/catalog.js +53 -0
  185. package/dist/testing/index.d.ts +10 -0
  186. package/dist/testing/index.js +10 -0
  187. package/dist/testing/installation.d.ts +11 -0
  188. package/dist/testing/installation.js +25 -0
  189. package/dist/testing/native-worker.d.ts +21 -0
  190. package/dist/testing/native-worker.js +106 -0
  191. package/dist/testing/worker.d.ts +18 -0
  192. package/dist/testing/worker.js +67 -0
  193. package/dist/testing/workers-runtime.d.ts +24 -0
  194. package/dist/testing/workers-runtime.js +33 -0
  195. package/dist/webhook-delivery.d.ts +14 -0
  196. package/dist/webhook-delivery.js +17 -0
  197. package/dist/workers-git.d.ts +285 -0
  198. package/dist/workers-git.js +1174 -0
  199. package/dist/workers.d.ts +352 -0
  200. package/dist/workers.js +866 -0
  201. package/docs/api/README.md +82 -0
  202. package/docs/api/agents.md +332 -0
  203. package/docs/api/app-storage.md +209 -0
  204. package/docs/api/apps.md +1375 -0
  205. package/docs/api/auth.md +63 -0
  206. package/docs/api/build-contract.md +507 -0
  207. package/docs/api/build.md +1476 -0
  208. package/docs/api/cloudflare.md +421 -0
  209. package/docs/api/computer.md +203 -0
  210. package/docs/api/files.md +117 -0
  211. package/docs/api/git.md +470 -0
  212. package/docs/api/host.md +1328 -0
  213. package/docs/api/index.md +430 -0
  214. package/docs/api/invocation.md +738 -0
  215. package/docs/api/keys.md +175 -0
  216. package/docs/api/mcp.md +301 -0
  217. package/docs/api/media.md +40 -0
  218. package/docs/api/modules.md +42 -0
  219. package/docs/api/pack.md +138 -0
  220. package/docs/api/page/mount.md +298 -0
  221. package/docs/api/root-data.md +111 -0
  222. package/docs/api/shell/app-directory.md +332 -0
  223. package/docs/api/shell/command-host.md +224 -0
  224. package/docs/api/shell/commands.md +197 -0
  225. package/docs/api/shell/keys.md +183 -0
  226. package/docs/api/shell/shell-module.md +143 -0
  227. package/docs/api/shell/window-manager.md +267 -0
  228. package/docs/api/shell/workbench.md +186 -0
  229. package/docs/api/shell.md +1788 -0
  230. package/docs/api/tenant.md +194 -0
  231. package/docs/api/workers-git.md +1527 -0
  232. package/docs/api/workers.md +1678 -0
  233. package/docs/media/architecture.mmd +32 -0
  234. package/docs/media/architecture.png +0 -0
  235. package/docs/media/bonsai-network.png +0 -0
  236. package/docs/media/bonsai-repository.png +0 -0
  237. package/docs/site/agent-quickstart.mdx +349 -0
  238. package/examples/git/worker.ts +39 -0
  239. package/examples/git/wrangler.jsonc +32 -0
  240. package/examples/standalone/worker.ts +14 -0
  241. package/examples/standalone/wrangler.jsonc +21 -0
  242. package/package.json +249 -3
@@ -0,0 +1,430 @@
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) / index
8
+
9
+ # index
10
+
11
+ ## Classes
12
+
13
+ ### AppInstanceError
14
+
15
+ Stable runtime failure identity; message remains presentation only.
16
+
17
+ #### Extends
18
+
19
+ - `Error`
20
+
21
+ #### Constructors
22
+
23
+ ##### Constructor
24
+
25
+ ```ts
26
+ new AppInstanceError(code, options?): AppInstanceError;
27
+ ```
28
+
29
+ ###### Parameters
30
+
31
+ | Parameter | Type |
32
+ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
33
+ | `code` | \| `"stale_authority"` \| `"invalid_owner_state"` \| `"invalid_invocation_facts"` \| `"revoked"` \| `"binding_not_granted"` \| `"binding_unavailable"` \| `"expired"` \| `"reentrant"` \| `"instance_identity_mismatch"` \| `"instance_owner_mismatch"` \| `"conflicting_owner_state"` \| `"instance_deleted"` \| `"release_app_mismatch"` \| `"state_schema_migration_unsupported"` \| `"instance_inactive"` \| `"instance_authority_version_mismatch"` \| `"release_no_longer_matches_instance"` \| `"instance_release_mismatch"` \| `"installation_tenant_mismatch"` |
34
+ | `options?` | `ErrorOptions` |
35
+
36
+ ###### Returns
37
+
38
+ [`AppInstanceError`](#appinstanceerror)
39
+
40
+ ###### Overrides
41
+
42
+ ```ts
43
+ Error.constructor;
44
+ ```
45
+
46
+ #### Properties
47
+
48
+ ##### name
49
+
50
+ ```ts
51
+ readonly name: "AppInstanceError" = "AppInstanceError";
52
+ ```
53
+
54
+ ###### Overrides
55
+
56
+ ```ts
57
+ Error.name;
58
+ ```
59
+
60
+ ##### code
61
+
62
+ ```ts
63
+ readonly code:
64
+ | "stale_authority"
65
+ | "invalid_owner_state"
66
+ | "invalid_invocation_facts"
67
+ | "revoked"
68
+ | "binding_not_granted"
69
+ | "binding_unavailable"
70
+ | "expired"
71
+ | "reentrant"
72
+ | "instance_identity_mismatch"
73
+ | "instance_owner_mismatch"
74
+ | "conflicting_owner_state"
75
+ | "instance_deleted"
76
+ | "release_app_mismatch"
77
+ | "state_schema_migration_unsupported"
78
+ | "instance_inactive"
79
+ | "instance_authority_version_mismatch"
80
+ | "release_no_longer_matches_instance"
81
+ | "instance_release_mismatch"
82
+ | "installation_tenant_mismatch";
83
+ ```
84
+
85
+ ## Type Aliases
86
+
87
+ ### InstanceId
88
+
89
+ ```ts
90
+ type InstanceId = CairnId<"app-instance", "instance">;
91
+ ```
92
+
93
+ A stable App Instance ID minted by [instanceIds](#instanceids).
94
+
95
+ ---
96
+
97
+ ### OwnerState
98
+
99
+ ```ts
100
+ type OwnerState = Schema.Schema.Type<typeof ownerStateSchema>;
101
+ ```
102
+
103
+ A decoded [ownerStateSchema](#ownerstateschema) value, the input to `apply`.
104
+
105
+ ---
106
+
107
+ ### Selection
108
+
109
+ ```ts
110
+ type Selection = Schema.Schema.Type<typeof selectionSchema>;
111
+ ```
112
+
113
+ A decoded [selectionSchema](#selectionschema) value, the authority for `fetch`
114
+ and `call`.
115
+
116
+ ---
117
+
118
+ ### Instance
119
+
120
+ ```ts
121
+ type Instance = Schema.Schema.Type<typeof instanceSchema>;
122
+ ```
123
+
124
+ A decoded [instanceSchema](#instanceschema) record, as returned by `apply` and
125
+ `inspect`.
126
+
127
+ ---
128
+
129
+ ### Backend
130
+
131
+ ```ts
132
+ type Backend = Readonly<{
133
+ release: Release;
134
+ digest: Sha256Digest;
135
+ backend: DurableBackend;
136
+ }>;
137
+ ```
138
+
139
+ A resolved, verified durable backend: its Release, artifact digest and code.
140
+
141
+ ---
142
+
143
+ ### AppInstanceErrorCode
144
+
145
+ ```ts
146
+ type AppInstanceErrorCode = typeof appInstanceErrorCodeSchema.Type;
147
+ ```
148
+
149
+ One of the bounded [appInstanceErrorCodeSchema](#appinstanceerrorcodeschema)
150
+ rejection codes.
151
+
152
+ ---
153
+
154
+ ### BackendResolution
155
+
156
+ ```ts
157
+ type BackendResolution<Host> =
158
+ | Readonly<{
159
+ kind: "metadata";
160
+ }>
161
+ | Readonly<{
162
+ kind: "invocation";
163
+ frame: InvocationFrame<Host>;
164
+ }>;
165
+ ```
166
+
167
+ Supervisor schema checks do not open guest authority; execution carries a frame.
168
+
169
+ #### Type Parameters
170
+
171
+ | Type Parameter |
172
+ | -------------- |
173
+ | `Host` |
174
+
175
+ ---
176
+
177
+ ### InstancePorts
178
+
179
+ ```ts
180
+ type InstancePorts<Host> = Readonly<{
181
+ instanceId: string;
182
+ read: () => Effect.Effect<Instance | null, Error>;
183
+ write: (instance) => Effect.Effect<void, Error>;
184
+ resolve: (release, scope) => Effect.Effect<Backend, Error>;
185
+ abort: () => Effect.Effect<void, Error>;
186
+ purge: () => Effect.Effect<void, Error>;
187
+ connect: (backend, frame) => Effect.Effect<AppBackendConnection, Error>;
188
+ }>;
189
+ ```
190
+
191
+ Host storage, verified artifact resolution, and frame-bound execution ports.
192
+
193
+ #### Type Parameters
194
+
195
+ | Type Parameter |
196
+ | -------------- |
197
+ | `Host` |
198
+
199
+ ---
200
+
201
+ ### AppBackendConnection
202
+
203
+ ```ts
204
+ type AppBackendConnection = Readonly<{
205
+ authorizeGitPush?: (question) => Effect.Effect<GitPushVerdict, Error>;
206
+ onGitPush?: (fact) => Effect.Effect<void, Error>;
207
+ syncRefused?: (refusal) => Effect.Effect<void, Error>;
208
+ fetch: (request) => Effect.Effect<Response, Error>;
209
+ call: (name, input) => Effect.Effect<AppMethodReply, Error>;
210
+ gill: (cargo) => Effect.Effect<Schema.Json, Error>;
211
+ }>;
212
+ ```
213
+
214
+ One admitted connection to a running App backend.
215
+
216
+ ---
217
+
218
+ ### AppInstance
219
+
220
+ ```ts
221
+ type AppInstance<Host> = Readonly<{
222
+ apply: (input) => Effect.Effect<Instance, Error>;
223
+ fetch: (frame, request) => Effect.Effect<Response, Error>;
224
+ call: (frame, api, name, input) => Effect.Effect<AppMethodReply, Error>;
225
+ gill: (frame, api, source, input) => Effect.Effect<GillReply, Error>;
226
+ authorizeGitPush: (frame, question) => Effect.Effect<GitPushVerdict, Error>;
227
+ onGitPush: (frame, fact) => Effect.Effect<void, Error>;
228
+ syncRefused: (frame, refusal) => Effect.Effect<void, Error>;
229
+ inspect: () => Effect.Effect<Instance | null, Error>;
230
+ }>;
231
+ ```
232
+
233
+ The lifecycle and admission operations of one App Instance.
234
+
235
+ #### Type Parameters
236
+
237
+ | Type Parameter |
238
+ | -------------- |
239
+ | `Host` |
240
+
241
+ ## Variables
242
+
243
+ ### instanceIds
244
+
245
+ ```ts
246
+ const instanceIds: Readonly<{
247
+ instance: IdCodec<"app-instance", "instance", 1>;
248
+ }>;
249
+ ```
250
+
251
+ The Cairn ID family that mints and recognizes App Instance IDs (`instance_…`).
252
+
253
+ ---
254
+
255
+ ### instanceIdSchema
256
+
257
+ ```ts
258
+ const instanceIdSchema: Schema.Codec<InstanceId, string>;
259
+ ```
260
+
261
+ Decodes a string into an [InstanceId](#instanceid), rejecting any other ID
262
+ family.
263
+
264
+ ---
265
+
266
+ ### ownerSchema
267
+
268
+ ```ts
269
+ const ownerSchema: Struct<{
270
+ kind: Literals<readonly ["installation", "deployment"]>;
271
+ id: NonEmptyString;
272
+ }>;
273
+ ```
274
+
275
+ The owner that issues authority for an Instance: an `installation` of an App or
276
+ a `deployment`. Owner identity never changes for the life of an Instance.
277
+
278
+ ---
279
+
280
+ ### selectionSchema
281
+
282
+ ```ts
283
+ const selectionSchema: Struct<{
284
+ instanceId: Codec<InstanceId, string, never, never>;
285
+ owner: Struct<{
286
+ kind: Literals<readonly ["installation", "deployment"]>;
287
+ id: NonEmptyString;
288
+ }>;
289
+ appId: refine<AppId, String>;
290
+ releaseId: refine<ReleaseId, String>;
291
+ authorityVersion: Number;
292
+ }>;
293
+ ```
294
+
295
+ An owner-issued selection: which Instance, owner, App and Release a request runs
296
+ against, at a positive authority version.
297
+
298
+ ---
299
+
300
+ ### ownerStateSchema
301
+
302
+ ```ts
303
+ const ownerStateSchema: Struct<{
304
+ instanceId: Codec<InstanceId, string, never, never>;
305
+ owner: Struct<{
306
+ kind: Literals<readonly ["installation", "deployment"]>;
307
+ id: NonEmptyString;
308
+ }>;
309
+ appId: refine<AppId, String>;
310
+ releaseId: refine<ReleaseId, String>;
311
+ authorityVersion: Number;
312
+ status: Literals<readonly ["enabled", "disabled", "deleted"]>;
313
+ }>;
314
+ ```
315
+
316
+ A complete owner-issued state: a selection plus `enabled`, `disabled` or
317
+ `deleted`.
318
+
319
+ ---
320
+
321
+ ### instanceSchema
322
+
323
+ ```ts
324
+ const instanceSchema: Struct<{
325
+ instanceId: Codec<InstanceId, string, never, never>;
326
+ owner: Struct<{
327
+ kind: Literals<readonly ["installation", "deployment"]>;
328
+ id: NonEmptyString;
329
+ }>;
330
+ appId: refine<AppId, String>;
331
+ releaseId: refine<ReleaseId, String>;
332
+ authorityVersion: Number;
333
+ stateSchema: NullOr<Number>;
334
+ desiredStatus: Literals<readonly ["enabled", "disabled", "deleted"]>;
335
+ status: Literals<readonly ["active", "disabled", "deleting", "deleted"]>;
336
+ }>;
337
+ ```
338
+
339
+ The persisted Instance record: the last applied selection, its state-schema
340
+ version, the owner's desired status and the runtime's own status.
341
+
342
+ ---
343
+
344
+ ### appInstanceErrorCodeSchema
345
+
346
+ ```ts
347
+ const appInstanceErrorCodeSchema: Literals<
348
+ readonly [
349
+ "invalid_owner_state",
350
+ "invalid_invocation_facts",
351
+ "revoked",
352
+ "binding_not_granted",
353
+ "binding_unavailable",
354
+ "expired",
355
+ "reentrant",
356
+ "instance_identity_mismatch",
357
+ "instance_owner_mismatch",
358
+ "conflicting_owner_state",
359
+ "stale_authority",
360
+ "instance_deleted",
361
+ "release_app_mismatch",
362
+ "state_schema_migration_unsupported",
363
+ "instance_inactive",
364
+ "instance_authority_version_mismatch",
365
+ "release_no_longer_matches_instance",
366
+ "instance_release_mismatch",
367
+ "installation_tenant_mismatch",
368
+ ]
369
+ >;
370
+ ```
371
+
372
+ The runtime owns the bounded rejection grammar, including across RPC.
373
+
374
+ ## Functions
375
+
376
+ ### selectionOf()
377
+
378
+ ```ts
379
+ function selectionOf(installation): object;
380
+ ```
381
+
382
+ The admitted selection for an installation's Instance.
383
+
384
+ #### Parameters
385
+
386
+ | Parameter | Type |
387
+ | -------------- | -------------------------------------- |
388
+ | `installation` | [`Installation`](apps.md#installation) |
389
+
390
+ #### Returns
391
+
392
+ `object`
393
+
394
+ | Name | Type | Default value |
395
+ | ------------------ | ---------------------------------- | ----------------------- |
396
+ | `instanceId` | [`InstanceId`](#instanceid) | `instanceIdSchema` |
397
+ | `owner` | `object` | `ownerSchema` |
398
+ | `owner.kind` | `"installation"` \| `"deployment"` | - |
399
+ | `owner.id` | `string` | `Schema.NonEmptyString` |
400
+ | `appId` | `AppId` | `appIdSchema` |
401
+ | `releaseId` | `ReleaseId` | `releaseIdSchema` |
402
+ | `authorityVersion` | `number` | - |
403
+
404
+ ---
405
+
406
+ ### createAppInstance()
407
+
408
+ ```ts
409
+ function createAppInstance<Host>(ports): AppInstance<Host>;
410
+ ```
411
+
412
+ Create the resource-local lifecycle for one App Instance over host ports. This
413
+ is not admission: the host must obtain real authority from its owner before
414
+ calling `apply`, `fetch` or `call`.
415
+
416
+ #### Type Parameters
417
+
418
+ | Type Parameter |
419
+ | -------------- |
420
+ | `Host` |
421
+
422
+ #### Parameters
423
+
424
+ | Parameter | Type |
425
+ | --------- | ------------------------------------------- |
426
+ | `ports` | [`InstancePorts`](#instanceports)\<`Host`\> |
427
+
428
+ #### Returns
429
+
430
+ [`AppInstance`](#appinstance)\<`Host`\>