@fungi.computer/agar 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 (159) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +766 -2
  3. package/dist/agent-message-meta.d.ts +74 -0
  4. package/dist/agent-message-meta.js +63 -0
  5. package/dist/agents.d.ts +170 -0
  6. package/dist/agents.js +218 -0
  7. package/dist/app-build-contract.d.ts +43 -0
  8. package/dist/app-build-contract.js +24 -0
  9. package/dist/apps.d.ts +66 -0
  10. package/dist/apps.js +47 -0
  11. package/dist/backend-declaration.d.ts +6 -0
  12. package/dist/backend-declaration.js +65 -0
  13. package/dist/backend-definition.d.ts +88 -0
  14. package/dist/backend-definition.js +158 -0
  15. package/dist/backend-refusal.d.ts +10 -0
  16. package/dist/backend-refusal.js +10 -0
  17. package/dist/backend.d.ts +30 -0
  18. package/dist/backend.js +28 -0
  19. package/dist/capabilities.d.ts +30 -0
  20. package/dist/capabilities.js +50 -0
  21. package/dist/channels.d.ts +142 -0
  22. package/dist/channels.js +97 -0
  23. package/dist/commands.d.ts +33 -0
  24. package/dist/commands.js +46 -0
  25. package/dist/computer-contracts.d.ts +73 -0
  26. package/dist/computer-contracts.js +57 -0
  27. package/dist/computer.d.ts +294 -0
  28. package/dist/computer.js +319 -0
  29. package/dist/connect.d.ts +11 -0
  30. package/dist/connect.js +211 -0
  31. package/dist/errors.d.ts +34 -0
  32. package/dist/errors.js +106 -0
  33. package/dist/failure.d.ts +2 -0
  34. package/dist/failure.js +9 -0
  35. package/dist/files.d.ts +25 -0
  36. package/dist/files.js +84 -0
  37. package/dist/game-servers.d.ts +530 -0
  38. package/dist/game-servers.js +244 -0
  39. package/dist/gills.d.ts +43 -0
  40. package/dist/gills.js +174 -0
  41. package/dist/git-commit.d.ts +143 -0
  42. package/dist/git-commit.js +251 -0
  43. package/dist/git-rpc.d.ts +310 -0
  44. package/dist/git-rpc.js +166 -0
  45. package/dist/git-steps.d.ts +579 -0
  46. package/dist/git-steps.js +804 -0
  47. package/dist/git-wire.d.ts +33 -0
  48. package/dist/git-wire.js +240 -0
  49. package/dist/git.d.ts +322 -0
  50. package/dist/git.js +98 -0
  51. package/dist/host.d.ts +97 -0
  52. package/dist/host.js +732 -0
  53. package/dist/inbox.d.ts +99 -0
  54. package/dist/inbox.js +184 -0
  55. package/dist/index.d.ts +31 -0
  56. package/dist/index.js +15 -0
  57. package/dist/inference.d.ts +17 -0
  58. package/dist/inference.js +115 -0
  59. package/dist/internal/app-error.d.ts +8 -0
  60. package/dist/internal/app-error.js +36 -0
  61. package/dist/internal/app-session.d.ts +8 -0
  62. package/dist/internal/app-session.js +551 -0
  63. package/dist/internal/back-inputs.d.ts +22 -0
  64. package/dist/internal/back-inputs.js +93 -0
  65. package/dist/internal/browser-bridge.d.ts +30 -0
  66. package/dist/internal/browser-bridge.js +203 -0
  67. package/dist/internal/capabilities.d.ts +13 -0
  68. package/dist/internal/capabilities.js +138 -0
  69. package/dist/internal/commands.d.ts +9 -0
  70. package/dist/internal/commands.js +257 -0
  71. package/dist/internal/disconnect-host.d.ts +7 -0
  72. package/dist/internal/disconnect-host.js +19 -0
  73. package/dist/internal/git-edit-tree.d.ts +6 -0
  74. package/dist/internal/git-edit-tree.js +46 -0
  75. package/dist/internal/memory-fs.d.ts +39 -0
  76. package/dist/internal/memory-fs.js +154 -0
  77. package/dist/internal/protocol.d.ts +116 -0
  78. package/dist/internal/protocol.js +6 -0
  79. package/dist/internal/query-feed.d.ts +23 -0
  80. package/dist/internal/query-feed.js +111 -0
  81. package/dist/internal/result.d.ts +22 -0
  82. package/dist/internal/result.js +61 -0
  83. package/dist/internal/rpc-contract.d.ts +24 -0
  84. package/dist/internal/rpc-contract.js +78 -0
  85. package/dist/internal/schemas.d.ts +307 -0
  86. package/dist/internal/schemas.js +524 -0
  87. package/dist/internal/store.d.ts +8 -0
  88. package/dist/internal/store.js +30 -0
  89. package/dist/internal/terminal-gate.d.ts +17 -0
  90. package/dist/internal/terminal-gate.js +94 -0
  91. package/dist/lifecycle.d.ts +44 -0
  92. package/dist/lifecycle.js +1 -0
  93. package/dist/marketplace.d.ts +159 -0
  94. package/dist/marketplace.js +102 -0
  95. package/dist/media-json.d.ts +181 -0
  96. package/dist/media-json.js +204 -0
  97. package/dist/media-library.d.ts +11 -0
  98. package/dist/media-library.js +15 -0
  99. package/dist/media-request-id.d.ts +7 -0
  100. package/dist/media-request-id.js +16 -0
  101. package/dist/media.d.ts +354 -0
  102. package/dist/media.js +654 -0
  103. package/dist/method-refusal.d.ts +64 -0
  104. package/dist/method-refusal.js +48 -0
  105. package/dist/pending.d.ts +10 -0
  106. package/dist/pending.js +10 -0
  107. package/dist/query.d.ts +76 -0
  108. package/dist/query.js +195 -0
  109. package/dist/react-mount.d.ts +23 -0
  110. package/dist/react-mount.js +108 -0
  111. package/dist/react.d.ts +41 -0
  112. package/dist/react.js +111 -0
  113. package/dist/read-copy.d.ts +103 -0
  114. package/dist/read-copy.js +195 -0
  115. package/dist/roles/files.d.ts +295 -0
  116. package/dist/roles/files.js +184 -0
  117. package/dist/root.d.ts +21 -0
  118. package/dist/root.js +1 -0
  119. package/dist/rpc.d.ts +1 -0
  120. package/dist/rpc.js +1 -0
  121. package/dist/status.d.ts +17 -0
  122. package/dist/status.js +50 -0
  123. package/dist/storage-wire.d.ts +167 -0
  124. package/dist/storage-wire.js +115 -0
  125. package/dist/storage.d.ts +72 -0
  126. package/dist/storage.js +143 -0
  127. package/dist/store.d.ts +11 -0
  128. package/dist/store.js +1 -0
  129. package/dist/test-kit/git.d.ts +31 -0
  130. package/dist/test-kit/git.js +174 -0
  131. package/dist/ui.d.ts +169 -0
  132. package/dist/ui.js +10 -0
  133. package/dist/window.d.ts +41 -0
  134. package/dist/window.js +15 -0
  135. package/dist/world.d.ts +16 -0
  136. package/dist/world.js +17 -0
  137. package/docs/api/README.md +28 -0
  138. package/docs/api/app-build-contract.md +113 -0
  139. package/docs/api/backend-declaration.md +62 -0
  140. package/docs/api/backend-definition.md +215 -0
  141. package/docs/api/backend.md +269 -0
  142. package/docs/api/errors.md +169 -0
  143. package/docs/api/files.md +91 -0
  144. package/docs/api/gills.md +164 -0
  145. package/docs/api/git-commit.md +279 -0
  146. package/docs/api/git-rpc.md +243 -0
  147. package/docs/api/git-steps.md +1010 -0
  148. package/docs/api/git-wire.md +197 -0
  149. package/docs/api/git.md +579 -0
  150. package/docs/api/index.md +2880 -0
  151. package/docs/api/media-json.md +507 -0
  152. package/docs/api/media-request-id.md +32 -0
  153. package/docs/api/modules.md +32 -0
  154. package/docs/api/query.md +253 -0
  155. package/docs/api/react.md +216 -0
  156. package/docs/api/read-copy.md +204 -0
  157. package/docs/api/rpc.md +128 -0
  158. package/docs/api/storage.md +620 -0
  159. package/package.json +197 -3
@@ -0,0 +1,91 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/agar**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/agar](modules.md) / files
8
+
9
+ # files
10
+
11
+ ## Type Aliases
12
+
13
+ ### AppFileRead
14
+
15
+ ```ts
16
+ type AppFileRead = Disposable & object;
17
+ ```
18
+
19
+ A parent-owned read. Closing it aborts the parent HTTP operation.
20
+
21
+ #### Type Declaration
22
+
23
+ | Name | Type | Description |
24
+ | ------------ | ----------------------------- | --------------------------------------------------------------- |
25
+ | `response()` | () => `Promise`\<`Response`\> | Resolve with the underlying Response once it is available. |
26
+ | `close()` | () => `Promise`\<`void`\> | Release the parent's open read, aborting it if still in flight. |
27
+
28
+ ---
29
+
30
+ ### AppFileWrite
31
+
32
+ ```ts
33
+ type AppFileWrite = Disposable & object;
34
+ ```
35
+
36
+ A parent-owned upload; close requests transport abort, never promises rollback.
37
+
38
+ #### Type Declaration
39
+
40
+ | Name | Type | Description |
41
+ | --------- | ---------------------------------- | --------------------------------------------------------------- |
42
+ | `write()` | (`content`) => `Promise`\<`void`\> | Stream the upload's content to the parent-owned destination. |
43
+ | `close()` | () => `Promise`\<`void`\> | Request that the parent abort or finalize the upload transport. |
44
+
45
+ ## Functions
46
+
47
+ ### readAppFile()
48
+
49
+ ```ts
50
+ function readAppFile(read, options): Promise<File>;
51
+ ```
52
+
53
+ Native Response crosses RPC; File is constructed only in the receiving App.
54
+
55
+ #### Parameters
56
+
57
+ | Parameter | Type |
58
+ | ----------------- | ------------------------------------------------- |
59
+ | `read` | [`AppFileRead`](#appfileread) |
60
+ | `options` | \{ `name`: `string`; `signal?`: `AbortSignal`; \} |
61
+ | `options.name` | `string` |
62
+ | `options.signal?` | `AbortSignal` |
63
+
64
+ #### Returns
65
+
66
+ `Promise`\<`File`\>
67
+
68
+ ---
69
+
70
+ ### writeAppFile()
71
+
72
+ ```ts
73
+ function writeAppFile(write, content, options): Promise<void>;
74
+ ```
75
+
76
+ Stream a Blob's bytes to a parent-owned upload. Aborting `signal` closes the
77
+ upload early; a close failure after a successful write is reported, never
78
+ thrown, since it cannot change an already-acknowledged commit.
79
+
80
+ #### Parameters
81
+
82
+ | Parameter | Type |
83
+ | ----------------- | ------------------------------- |
84
+ | `write` | [`AppFileWrite`](#appfilewrite) |
85
+ | `content` | `Blob` |
86
+ | `options` | \{ `signal?`: `AbortSignal`; \} |
87
+ | `options.signal?` | `AbortSignal` |
88
+
89
+ #### Returns
90
+
91
+ `Promise`\<`void`\>
@@ -0,0 +1,164 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/agar**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/agar](modules.md) / gills
8
+
9
+ # gills
10
+
11
+ ## Type Aliases
12
+
13
+ ### AppBackendGill
14
+
15
+ ```ts
16
+ type AppBackendGill = Readonly<{
17
+ declaration: AppDeclaredGill;
18
+ limit: number;
19
+ input: (selection) => Readonly<{
20
+ [key: string]: WhistleJsonValue;
21
+ limit: number;
22
+ }>;
23
+ parseCall: (raw) => GillCall;
24
+ call: (selection, read) => Promise<GillReply>;
25
+ rows: (output, context) => GillResponse;
26
+ }>;
27
+ ```
28
+
29
+ App-owned projection; methods keep their ordinary domain-shaped output.
30
+
31
+ ## Functions
32
+
33
+ ### decodeGillRefusal()
34
+
35
+ ```ts
36
+ function decodeGillRefusal(
37
+ raw,
38
+ declaration,
39
+ ):
40
+ | {
41
+ viewId: string;
42
+ title: string;
43
+ state: "empty";
44
+ rows: readonly [];
45
+ next?: string;
46
+ }
47
+ | {
48
+ viewId: string;
49
+ title: string;
50
+ state: "error";
51
+ rows: readonly [];
52
+ reason?: "exec_isolation_required" | "params_required";
53
+ error: string;
54
+ recovery?:
55
+ | {
56
+ kind: "configure";
57
+ param: string;
58
+ }
59
+ | {
60
+ kind: "open";
61
+ };
62
+ }
63
+ | {
64
+ viewId: string;
65
+ title: string;
66
+ state: "full";
67
+ rows: readonly object[];
68
+ next?: string;
69
+ }
70
+ | undefined;
71
+ ```
72
+
73
+ Decode the App host's strict isolation refusal into its permanent Gill state.
74
+
75
+ #### Parameters
76
+
77
+ | Parameter | Type |
78
+ | ------------- | ------------------------------------------------------ |
79
+ | `raw` | `unknown` |
80
+ | `declaration` | `Readonly`\<\{ `id`: `string`; `title`: `string`; \}\> |
81
+
82
+ #### Returns
83
+
84
+ ##### Type Literal
85
+
86
+ ```ts
87
+ {
88
+ viewId: string;
89
+ title: string;
90
+ state: "empty";
91
+ rows: readonly [];
92
+ next?: string;
93
+ }
94
+ ```
95
+
96
+ ---
97
+
98
+ ##### Type Literal
99
+
100
+ ```ts
101
+ {
102
+ viewId: string;
103
+ title: string;
104
+ state: "error";
105
+ rows: readonly [];
106
+ reason?: "exec_isolation_required" | "params_required";
107
+ error: string;
108
+ recovery?: | {
109
+ kind: "configure";
110
+ param: string;
111
+ }
112
+ | {
113
+ kind: "open";
114
+ };
115
+ }
116
+ ```
117
+
118
+ | Name | Type | Description |
119
+ | ----------- | ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
120
+ | `viewId` | `string` | - |
121
+ | `title` | `string` | - |
122
+ | `state` | `"error"` | - |
123
+ | `rows` | readonly \[\] | - |
124
+ | `reason?` | `"exec_isolation_required"` \| `"params_required"` | Host-owned permanent execution refusal; an ordinary error may still be refreshed. |
125
+ | `error` | `string` | - |
126
+ | `recovery?` | \| \{ `kind`: `"configure"`; `param`: `string`; \} \| \{ `kind`: `"open"`; \} | The host supplies the same-placement picker and this App's launch. |
127
+
128
+ ---
129
+
130
+ ##### Type Literal
131
+
132
+ ```ts
133
+ {
134
+ viewId: string;
135
+ title: string;
136
+ state: "full";
137
+ rows: readonly object[];
138
+ next?: string;
139
+ }
140
+ ```
141
+
142
+ ---
143
+
144
+ `undefined`
145
+
146
+ ---
147
+
148
+ ### defineAppGill()
149
+
150
+ ```ts
151
+ function defineAppGill(options): AppBackendGill;
152
+ ```
153
+
154
+ Define a compact view of one of this App's declared read methods.
155
+
156
+ #### Parameters
157
+
158
+ | Parameter | Type |
159
+ | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
160
+ | `options` | `Readonly`\<\{ `id`: `string`; `title`: `string`; `source`: `string`; `limit`: `number`; `sizes?`: readonly `AppGillDesktopSize`[]; `params?`: readonly `AppGillParam`[]; `watch?`: `AppGillWatch`; `input`: [`AppBackendGill`](#appbackendgill)\[`"input"`\]; `rows`: [`AppBackendGill`](#appbackendgill)\[`"rows"`\]; \}\> |
161
+
162
+ #### Returns
163
+
164
+ [`AppBackendGill`](#appbackendgill)
@@ -0,0 +1,279 @@
1
+ <!-- Generated by Botanical API docs (TypeDoc + typedoc-plugin-markdown). Do not edit. -->
2
+
3
+ [**@fungi.computer/agar**](README.md)
4
+
5
+ ---
6
+
7
+ [@fungi.computer/agar](modules.md) / git-commit
8
+
9
+ # git-commit
10
+
11
+ ## Type Aliases
12
+
13
+ ### GitCommitStore
14
+
15
+ ```ts
16
+ type GitCommitStore = Pick<GitBinding, "exchange">;
17
+ ```
18
+
19
+ The binding operations these writes use.
20
+
21
+ ---
22
+
23
+ ### GitFileChange
24
+
25
+ ```ts
26
+ type GitFileChange = Readonly<{
27
+ path: string;
28
+ content: Uint8Array | null;
29
+ mode?: "100644" | "100755";
30
+ }>;
31
+ ```
32
+
33
+ One file to write (`content`) or delete (`content: null`), repository-relative.
34
+
35
+ ---
36
+
37
+ ### GitIdentity
38
+
39
+ ```ts
40
+ type GitIdentity = Readonly<{
41
+ name: string;
42
+ email: string;
43
+ }>;
44
+ ```
45
+
46
+ Name and email recorded as a commit's author and committer.
47
+
48
+ ---
49
+
50
+ ### CommitFilesRequest
51
+
52
+ ```ts
53
+ type CommitFilesRequest = Readonly<{
54
+ repository: string;
55
+ branch: string;
56
+ expectedHead: string | null;
57
+ startFrom?: string;
58
+ changes: readonly GitFileChange[];
59
+ message: string;
60
+ author: GitIdentity;
61
+ }>;
62
+ ```
63
+
64
+ A commit of file changes to one branch.
65
+
66
+ ---
67
+
68
+ ### GitWriteOutcome
69
+
70
+ ```ts
71
+ type GitWriteOutcome =
72
+ | Readonly<{
73
+ kind: "committed";
74
+ commit: string;
75
+ }>
76
+ | Readonly<{
77
+ kind: "unchanged";
78
+ commit: string;
79
+ }>
80
+ | Readonly<{
81
+ kind: "updated";
82
+ }>
83
+ | Readonly<{
84
+ kind: "stale";
85
+ head: string | null;
86
+ }>;
87
+ ```
88
+
89
+ What a compare-and-swap write did.
90
+
91
+ ---
92
+
93
+ ### MergeBranchRequest
94
+
95
+ ```ts
96
+ type MergeBranchRequest = Readonly<{
97
+ target: string;
98
+ source: string;
99
+ branch: string;
100
+ sourceBranch: string;
101
+ expectedSource: string;
102
+ expectedTarget?: string;
103
+ behind?: number;
104
+ message: string;
105
+ author: GitIdentity;
106
+ }>;
107
+ ```
108
+
109
+ Merge a branch of `source` (such as a fork) into a branch of `target`.
110
+
111
+ ---
112
+
113
+ ### GitMergeOutcome
114
+
115
+ ```ts
116
+ type GitMergeOutcome =
117
+ | Readonly<{
118
+ kind: "merged";
119
+ before: string;
120
+ after: string;
121
+ }>
122
+ | Readonly<{
123
+ kind: "up-to-date";
124
+ head: string;
125
+ }>
126
+ | Readonly<{
127
+ kind: "conflict";
128
+ head: string;
129
+ paths: readonly string[];
130
+ }>
131
+ | Readonly<{
132
+ kind: "stale";
133
+ head: string | null;
134
+ }>
135
+ | Readonly<{
136
+ kind: "source-moved";
137
+ head: string;
138
+ }>;
139
+ ```
140
+
141
+ What a merge did. Merges always write a merge commit when there is new work.
142
+
143
+ ---
144
+
145
+ ### MoveRefRequest
146
+
147
+ ```ts
148
+ type MoveRefRequest = Readonly<{
149
+ repository: string;
150
+ ref: string;
151
+ expected: string | null;
152
+ commit: string;
153
+ source: string;
154
+ }>;
155
+ ```
156
+
157
+ Point a ref at a commit that is the head of `source`.
158
+
159
+ ---
160
+
161
+ ### MoveRefsRequest
162
+
163
+ ```ts
164
+ type MoveRefsRequest = Readonly<{
165
+ repository: string;
166
+ source: string;
167
+ commit: string;
168
+ updates: readonly Readonly<{
169
+ ref: string;
170
+ expected: string | null;
171
+ }>[];
172
+ }>;
173
+ ```
174
+
175
+ Ordered ref moves to one fetched source commit; each move has its own CAS guard.
176
+
177
+ ---
178
+
179
+ ### GitRefMovesOutcome
180
+
181
+ ```ts
182
+ type GitRefMovesOutcome =
183
+ | Readonly<{
184
+ kind: "updated";
185
+ }>
186
+ | Readonly<{
187
+ kind: "stale";
188
+ ref: string;
189
+ head: string | null;
190
+ }>;
191
+ ```
192
+
193
+ Earlier moves remain accepted if a later ref is stale; this is not an atomic
194
+ push.
195
+
196
+ ## Functions
197
+
198
+ ### commitFiles()
199
+
200
+ ```ts
201
+ function commitFiles(store, request, beforeWrite?): Promise<GitWriteOutcome>;
202
+ ```
203
+
204
+ Commit files using independently resumable, CAS-guarded Git steps.
205
+
206
+ #### Parameters
207
+
208
+ | Parameter | Type |
209
+ | -------------- | ------------------------------------------- |
210
+ | `store` | [`GitCommitStore`](#gitcommitstore) |
211
+ | `request` | [`CommitFilesRequest`](#commitfilesrequest) |
212
+ | `beforeWrite?` | () => `Promise`\<`void`\> |
213
+
214
+ #### Returns
215
+
216
+ `Promise`\<[`GitWriteOutcome`](#gitwriteoutcome)\>
217
+
218
+ ---
219
+
220
+ ### moveRef()
221
+
222
+ ```ts
223
+ function moveRef(store, request): Promise<GitWriteOutcome>;
224
+ ```
225
+
226
+ Point a ref at the head commit of `source`, compare-and-swap on the ref.
227
+
228
+ #### Parameters
229
+
230
+ | Parameter | Type |
231
+ | --------- | ----------------------------------- |
232
+ | `store` | [`GitCommitStore`](#gitcommitstore) |
233
+ | `request` | [`MoveRefRequest`](#moverefrequest) |
234
+
235
+ #### Returns
236
+
237
+ `Promise`\<[`GitWriteOutcome`](#gitwriteoutcome)\>
238
+
239
+ ---
240
+
241
+ ### moveRefs()
242
+
243
+ ```ts
244
+ function moveRefs(store, request): Promise<GitRefMovesOutcome>;
245
+ ```
246
+
247
+ Fetch a source once, then move refs in order with separate guarded pushes.
248
+
249
+ #### Parameters
250
+
251
+ | Parameter | Type |
252
+ | --------- | ------------------------------------- |
253
+ | `store` | [`GitCommitStore`](#gitcommitstore) |
254
+ | `request` | [`MoveRefsRequest`](#moverefsrequest) |
255
+
256
+ #### Returns
257
+
258
+ `Promise`\<[`GitRefMovesOutcome`](#gitrefmovesoutcome)\>
259
+
260
+ ---
261
+
262
+ ### mergeBranch()
263
+
264
+ ```ts
265
+ function mergeBranch(store, request): Promise<GitMergeOutcome>;
266
+ ```
267
+
268
+ Merge branches through the same one-exchange step engine as background owners.
269
+
270
+ #### Parameters
271
+
272
+ | Parameter | Type |
273
+ | --------- | ------------------------------------------- |
274
+ | `store` | [`GitCommitStore`](#gitcommitstore) |
275
+ | `request` | [`MergeBranchRequest`](#mergebranchrequest) |
276
+
277
+ #### Returns
278
+
279
+ `Promise`\<[`GitMergeOutcome`](#gitmergeoutcome)\>