@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,197 @@
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) / shell/commands
8
+
9
+ # shell/commands
10
+
11
+ ## Type Aliases
12
+
13
+ ### ShellActions
14
+
15
+ ```ts
16
+ type ShellActions = Readonly<{
17
+ openApp: () => void;
18
+ showKeys: () => void;
19
+ showCommandLine: () => void;
20
+ focusStep: (step) => void;
21
+ swapStep: (step) => void;
22
+ toggleZoom: () => void;
23
+ back?: () => void;
24
+ }>;
25
+ ```
26
+
27
+ The behavior supplied by either a browser or terminal workspace shell.
28
+
29
+ ## Variables
30
+
31
+ ### backBinding
32
+
33
+ ```ts
34
+ const backBinding: "<leader> [" = "<leader> [";
35
+ ```
36
+
37
+ The Back binding, also shown by the shell in window chrome.
38
+
39
+ ## Functions
40
+
41
+ ### shellCommands()
42
+
43
+ ```ts
44
+ function shellCommands(actions): readonly Readonly<{
45
+ id: string;
46
+ title: string;
47
+ category: string;
48
+ description?: string;
49
+ projections?: {
50
+ bindings?: {
51
+ order?: number;
52
+ values: readonly string[];
53
+ };
54
+ agent?: {
55
+ keybind?: string;
56
+ order?: number;
57
+ };
58
+ help?: {
59
+ order?: number;
60
+ };
61
+ menu?: {
62
+ order?: number;
63
+ };
64
+ palette?: {
65
+ order?: number;
66
+ };
67
+ slash?: {
68
+ aliases: readonly string[];
69
+ order?: number;
70
+ arguments?: {
71
+ hint: string;
72
+ words?: readonly ...[];
73
+ text?: {
74
+ field: ...;
75
+ arguments: ...;
76
+ requestIdField?: ...;
77
+ };
78
+ };
79
+ };
80
+ };
81
+ action?: {
82
+ inputSchema?: {
83
+ [key: string]:
84
+ | string
85
+ | number
86
+ | boolean
87
+ | readonly string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...[]
88
+ | {
89
+ [key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...;
90
+ }
91
+ | null;
92
+ };
93
+ outputSchema?: {
94
+ [key: string]:
95
+ | string
96
+ | number
97
+ | boolean
98
+ | readonly string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...[]
99
+ | {
100
+ [key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...;
101
+ }
102
+ | null;
103
+ };
104
+ presentation?: | {
105
+ type: "action";
106
+ }
107
+ | {
108
+ type: "custom";
109
+ data: {
110
+ [key: string]:
111
+ | string
112
+ | number
113
+ | boolean
114
+ | readonly string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...[]
115
+ | {
116
+ [key: string]: string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | number | boolean | readonly (string | ... 4 more ... | null)[] | { ...; } | null)[] | { ...; } | null)[] | { ...; } | ...;
117
+ }
118
+ | null;
119
+ };
120
+ }
121
+ | {
122
+ type: "choice";
123
+ options: readonly object[];
124
+ }
125
+ | {
126
+ type: "form";
127
+ submitLabel?: string;
128
+ }
129
+ | {
130
+ type: "confirmation";
131
+ message: string;
132
+ confirmLabel?: string;
133
+ cancelLabel?: string;
134
+ };
135
+ };
136
+ availability?: () => WhistleAvailability;
137
+ handler: (input) => unknown;
138
+ }>[];
139
+ ```
140
+
141
+ Shared workspace declarations. Window moves have direct Alt chords and leader
142
+ keys; global actions live behind the shell-owned leader.
143
+
144
+ #### Parameters
145
+
146
+ | Parameter | Type |
147
+ | --------- | ------------------------------- |
148
+ | `actions` | [`ShellActions`](#shellactions) |
149
+
150
+ #### Returns
151
+
152
+ readonly `Readonly`\<\{ `id`: `string`; `title`: `string`; `category`: `string`;
153
+ `description?`: `string`; `projections?`: \{ `bindings?`: \{ `order?`: `number`;
154
+ `values`: readonly `string`[]; \}; `agent?`: \{ `keybind?`: `string`; `order?`:
155
+ `number`; \}; `help?`: \{ `order?`: `number`; \}; `menu?`: \{ `order?`:
156
+ `number`; \}; `palette?`: \{ `order?`: `number`; \}; `slash?`: \{ `aliases`:
157
+ readonly `string`[]; `order?`: `number`; `arguments?`: \{ `hint`: `string`;
158
+ `words?`: readonly ...[]; `text?`: \{ `field`: ...; `arguments`: ...;
159
+ `requestIdField?`: ...; \}; \}; \}; \}; `action?`: \{ `inputSchema?`: \{
160
+ \[`key`: `string`\]: \| `string` \| `number` \| `boolean` \| readonly string \|
161
+ number \| boolean \| readonly (string \| number \| boolean \| readonly (string
162
+ \| number \| boolean \| readonly (string \| number \| boolean \| readonly
163
+ (string \| number \| boolean \| readonly (string \| number \| boolean \|
164
+ readonly (string \| ... 4 more ... \| null)\[\] \| \{ ...; \} \| null)\[\] \| \{
165
+ ...; \} \| null)\[\] \| \{ ...; \} \| ...[] \| \{ \[`key`: `string`\]: string \|
166
+ number \| boolean \| readonly (string \| number \| boolean \| readonly (string
167
+ \| number \| boolean \| readonly (string \| number \| boolean \| readonly
168
+ (string \| number \| boolean \| readonly (string \| number \| boolean \|
169
+ readonly (string \| ... 4 more ... \| null)\[\] \| \{ ...; \} \| null)\[\] \| \{
170
+ ...; \} \| null)\[\] \| \{ ...; \} \| ...; \} \| `null`; \}; `outputSchema?`: \{
171
+ \[`key`: `string`\]: \| `string` \| `number` \| `boolean` \| readonly string \|
172
+ number \| boolean \| readonly (string \| number \| boolean \| readonly (string
173
+ \| number \| boolean \| readonly (string \| number \| boolean \| readonly
174
+ (string \| number \| boolean \| readonly (string \| number \| boolean \|
175
+ readonly (string \| ... 4 more ... \| null)\[\] \| \{ ...; \} \| null)\[\] \| \{
176
+ ...; \} \| null)\[\] \| \{ ...; \} \| ...[] \| \{ \[`key`: `string`\]: string \|
177
+ number \| boolean \| readonly (string \| number \| boolean \| readonly (string
178
+ \| number \| boolean \| readonly (string \| number \| boolean \| readonly
179
+ (string \| number \| boolean \| readonly (string \| number \| boolean \|
180
+ readonly (string \| ... 4 more ... \| null)\[\] \| \{ ...; \} \| null)\[\] \| \{
181
+ ...; \} \| null)\[\] \| \{ ...; \} \| ...; \} \| `null`; \}; `presentation?`: \|
182
+ \{ `type`: `"action"`; \} \| \{ `type`: `"custom"`; `data`: \{ \[`key`:
183
+ `string`\]: \| `string` \| `number` \| `boolean` \| readonly string \| number \|
184
+ boolean \| readonly (string \| number \| boolean \| readonly (string \| number
185
+ \| boolean \| readonly (string \| number \| boolean \| readonly (string \|
186
+ number \| boolean \| readonly (string \| number \| boolean \| readonly (string
187
+ \| ... 4 more ... \| null)\[\] \| \{ ...; \} \| null)\[\] \| \{ ...; \} \|
188
+ null)\[\] \| \{ ...; \} \| ...[] \| \{ \[`key`: `string`\]: string \| number \|
189
+ boolean \| readonly (string \| number \| boolean \| readonly (string \| number
190
+ \| boolean \| readonly (string \| number \| boolean \| readonly (string \|
191
+ number \| boolean \| readonly (string \| number \| boolean \| readonly (string
192
+ \| ... 4 more ... \| null)\[\] \| \{ ...; \} \| null)\[\] \| \{ ...; \} \|
193
+ null)\[\] \| \{ ...; \} \| ...; \} \| `null`; \}; \} \| \{ `type`: `"choice"`;
194
+ `options`: readonly `object`[]; \} \| \{ `type`: `"form"`; `submitLabel?`:
195
+ `string`; \} \| \{ `type`: `"confirmation"`; `message`: `string`;
196
+ `confirmLabel?`: `string`; `cancelLabel?`: `string`; \}; \}; `availability?`: ()
197
+ => `WhistleAvailability`; `handler`: (`input`) => `unknown`; \}\>[]
@@ -0,0 +1,183 @@
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) / shell/keys
8
+
9
+ # shell/keys
10
+
11
+ ## Type Aliases
12
+
13
+ ### ShellChord
14
+
15
+ ```ts
16
+ type ShellChord = Readonly<{
17
+ key: string;
18
+ alt: boolean;
19
+ ctrl: boolean;
20
+ meta: boolean;
21
+ shift: boolean;
22
+ }>;
23
+ ```
24
+
25
+ One physical chord parsed from a Whistle binding such as `alt+left`.
26
+
27
+ ---
28
+
29
+ ### KeyEventFacts
30
+
31
+ ```ts
32
+ type KeyEventFacts = Pick<
33
+ KeyboardEvent,
34
+ "altKey" | "ctrlKey" | "key" | "metaKey" | "shiftKey"
35
+ >;
36
+ ```
37
+
38
+ Keyboard facts shared by DOM events and terminal adapters.
39
+
40
+ ---
41
+
42
+ ### LeaderKey
43
+
44
+ ```ts
45
+ type LeaderKey = WhistleBindingProjection &
46
+ Readonly<{
47
+ key: string;
48
+ }>;
49
+ ```
50
+
51
+ One key offered after the leader chord, with the command it runs.
52
+
53
+ ---
54
+
55
+ ### ShellKeyHost
56
+
57
+ ```ts
58
+ type ShellKeyHost = Readonly<{
59
+ active: () => WhistleSnapshot;
60
+ subscribe: (listener) => () => void;
61
+ execute: (commandId, input) => Promise<WhistleExecutionOutcome>;
62
+ }>;
63
+ ```
64
+
65
+ The shell host operations the key dispatcher reads.
66
+
67
+ ## Functions
68
+
69
+ ### parseChord()
70
+
71
+ ```ts
72
+ function parseChord(
73
+ binding,
74
+ mac,
75
+ ): Readonly<{
76
+ key: string;
77
+ alt: boolean;
78
+ ctrl: boolean;
79
+ meta: boolean;
80
+ shift: boolean;
81
+ }> | null;
82
+ ```
83
+
84
+ Parse one single-chord binding. Sequences (including `<leader> x`) and unknown
85
+ modifiers return `null`; they are never matched as one chord.
86
+
87
+ #### Parameters
88
+
89
+ | Parameter | Type |
90
+ | --------- | --------- |
91
+ | `binding` | `string` |
92
+ | `mac` | `boolean` |
93
+
94
+ #### Returns
95
+
96
+ \| `Readonly`\<\{ `key`: `string`; `alt`: `boolean`; `ctrl`: `boolean`; `meta`:
97
+ `boolean`; `shift`: `boolean`; \}\> \| `null`
98
+
99
+ ---
100
+
101
+ ### chordMatches()
102
+
103
+ ```ts
104
+ function chordMatches(event, chord): boolean;
105
+ ```
106
+
107
+ Whether one key event is exactly this chord.
108
+
109
+ #### Parameters
110
+
111
+ | Parameter | Type |
112
+ | --------- | --------------------------------- |
113
+ | `event` | [`KeyEventFacts`](#keyeventfacts) |
114
+ | `chord` | [`ShellChord`](#shellchord) |
115
+
116
+ #### Returns
117
+
118
+ `boolean`
119
+
120
+ ---
121
+
122
+ ### leaderKeys()
123
+
124
+ ```ts
125
+ function leaderKeys(active): readonly LeaderKey[];
126
+ ```
127
+
128
+ The `<leader> x` rows of the active view, first binding per key.
129
+
130
+ #### Parameters
131
+
132
+ | Parameter | Type |
133
+ | --------- | ----------------- |
134
+ | `active` | `WhistleSnapshot` |
135
+
136
+ #### Returns
137
+
138
+ readonly [`LeaderKey`](#leaderkey)[]
139
+
140
+ ---
141
+
142
+ ### leaderKeyMatches()
143
+
144
+ ```ts
145
+ function leaderKeyMatches(event, key): boolean;
146
+ ```
147
+
148
+ Whether one key event (after the leader) selects this leader key.
149
+
150
+ #### Parameters
151
+
152
+ | Parameter | Type |
153
+ | --------- | ------------------------------------------------------------------------------ |
154
+ | `event` | `Pick`\<`KeyboardEvent`, `"altKey"` \| `"ctrlKey"` \| `"key"` \| `"metaKey"`\> |
155
+ | `key` | `string` |
156
+
157
+ #### Returns
158
+
159
+ `boolean`
160
+
161
+ ---
162
+
163
+ ### installShellKeys()
164
+
165
+ ```ts
166
+ function installShellKeys(root, host, mac): () => void;
167
+ ```
168
+
169
+ Dispatch the active view's single-chord bindings from the shell document. Text
170
+ entry is a mode: while an input is focused only Ctrl/Cmd chords fire, so
171
+ Alt-arrows keep their word-navigation meaning.
172
+
173
+ #### Parameters
174
+
175
+ | Parameter | Type |
176
+ | --------- | ------------------------------- |
177
+ | `root` | `HTMLElement` |
178
+ | `host` | [`ShellKeyHost`](#shellkeyhost) |
179
+ | `mac` | `boolean` |
180
+
181
+ #### Returns
182
+
183
+ () => `void`
@@ -0,0 +1,143 @@
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) / shell/shell-module
8
+
9
+ # shell/shell-module
10
+
11
+ ## Classes
12
+
13
+ ### ShellModuleError
14
+
15
+ The picked shell's module could not be loaded or does not fit the contract.
16
+
17
+ #### Extends
18
+
19
+ - `Error`
20
+
21
+ #### Constructors
22
+
23
+ ##### Constructor
24
+
25
+ ```ts
26
+ new ShellModuleError(message?): ShellModuleError;
27
+ ```
28
+
29
+ ###### Parameters
30
+
31
+ | Parameter | Type |
32
+ | ---------- | -------- |
33
+ | `message?` | `string` |
34
+
35
+ ###### Returns
36
+
37
+ [`ShellModuleError`](#shellmoduleerror)
38
+
39
+ ###### Inherited from
40
+
41
+ ```ts
42
+ Error.constructor;
43
+ ```
44
+
45
+ ##### Constructor
46
+
47
+ ```ts
48
+ new ShellModuleError(message?, options?): ShellModuleError;
49
+ ```
50
+
51
+ ###### Parameters
52
+
53
+ | Parameter | Type |
54
+ | ---------- | -------------- |
55
+ | `message?` | `string` |
56
+ | `options?` | `ErrorOptions` |
57
+
58
+ ###### Returns
59
+
60
+ [`ShellModuleError`](#shellmoduleerror)
61
+
62
+ ###### Inherited from
63
+
64
+ ```ts
65
+ Error.constructor;
66
+ ```
67
+
68
+ #### Properties
69
+
70
+ ##### name
71
+
72
+ ```ts
73
+ readonly name: "ShellModuleError" = "ShellModuleError";
74
+ ```
75
+
76
+ ###### Overrides
77
+
78
+ ```ts
79
+ Error.name;
80
+ ```
81
+
82
+ ## Type Aliases
83
+
84
+ ### ShellMountInput
85
+
86
+ ```ts
87
+ type ShellMountInput = Readonly<{
88
+ workbench: TeamWorkbenchHostHandle;
89
+ storage: AppStorage;
90
+ methods: Readonly<{
91
+ call: Promise<WhistleJsonValue>;
92
+ }>;
93
+ }>;
94
+ ```
95
+
96
+ What a host hands the shell a Team picked. The host composes that shell into its
97
+ own top-level document, so it runs with the host's escalated permissions: the
98
+ workbench mounts each child App in its sandboxed frame, and `storage`/`methods`
99
+ are the shell installation's own desktop data.
100
+
101
+ ---
102
+
103
+ ### MountShell
104
+
105
+ ```ts
106
+ type MountShell = (root, input) => Promise<() => void>;
107
+ ```
108
+
109
+ Render the shell into `root`; resolves once it is mounted, with the function
110
+ that removes it again. The shell loads its own code and styles.
111
+
112
+ #### Parameters
113
+
114
+ | Parameter | Type |
115
+ | --------- | ------------------------------------- |
116
+ | `root` | `HTMLElement` |
117
+ | `input` | [`ShellMountInput`](#shellmountinput) |
118
+
119
+ #### Returns
120
+
121
+ `Promise`\<() => `void`\>
122
+
123
+ ## Functions
124
+
125
+ ### importShellModule()
126
+
127
+ ```ts
128
+ function importShellModule(moduleUrl, hostOrigin): Promise<MountShell>;
129
+ ```
130
+
131
+ Import the picked shell Release's module from the host's own origin and check
132
+ that it exports `mountShell`. The host never bundles a shell.
133
+
134
+ #### Parameters
135
+
136
+ | Parameter | Type |
137
+ | ------------ | -------- |
138
+ | `moduleUrl` | `URL` |
139
+ | `hostOrigin` | `string` |
140
+
141
+ #### Returns
142
+
143
+ `Promise`\<[`MountShell`](#mountshell)\>