@fungi.computer/nacre 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.
- package/LICENSE +21 -0
- package/README.md +98 -2
- package/dist/app-directory.d.ts +600 -0
- package/dist/app-directory.js +323 -0
- package/dist/browser-actions.d.ts +7 -0
- package/dist/browser-actions.js +56 -0
- package/dist/command-host.d.ts +140 -0
- package/dist/command-host.js +532 -0
- package/dist/commands.d.ts +25 -0
- package/dist/commands.js +78 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/keys.d.ts +47 -0
- package/dist/keys.js +136 -0
- package/dist/shell-module.d.ts +98 -0
- package/dist/shell-module.js +90 -0
- package/dist/window-manager.d.ts +159 -0
- package/dist/window-manager.js +796 -0
- package/dist/workbench-contract.d.ts +70 -0
- package/dist/workbench-contract.js +1 -0
- package/dist/workbench-directory.d.ts +343 -0
- package/dist/workbench-directory.js +65 -0
- package/dist/workbench-host-types.d.ts +114 -0
- package/dist/workbench-host-types.js +1 -0
- package/dist/workbench-host.d.ts +34 -0
- package/dist/workbench-host.js +356 -0
- package/dist/workbench-model.d.ts +223 -0
- package/dist/workbench-model.js +93 -0
- package/dist/workbench.d.ts +4 -0
- package/dist/workbench.js +2 -0
- package/docs/api/README.md +21 -0
- package/docs/api/app-directory.md +587 -0
- package/docs/api/command-host.md +225 -0
- package/docs/api/commands.md +199 -0
- package/docs/api/index.md +1860 -0
- package/docs/api/keys.md +183 -0
- package/docs/api/shell-module.md +233 -0
- package/docs/api/window-manager.md +269 -0
- package/docs/api/workbench-directory.md +141 -0
- package/docs/api/workbench.md +201 -0
- package/package.json +98 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jamstack Consulting LLC
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,99 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Nacre (`@fungi.computer/nacre`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Nacre is mother-of-pearl, the lining an oyster grows on the inside of its shell.
|
|
4
|
+
This package is that lining for App hosts: the shell client that windows,
|
|
5
|
+
commands, keys and the App directory are built from. Oyster's page uses it, and
|
|
6
|
+
any shell can import it without the Oyster server.
|
|
7
|
+
|
|
8
|
+
## Install or set up
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
pnpm add @fungi.computer/nacre
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The package is ESM-only. It depends on `@fungi.computer/agar`,
|
|
15
|
+
`@fungi.computer/ear-tag`, `@fungi.computer/gills`, `@fungi.computer/puffball`,
|
|
16
|
+
`@fungi.computer/whistle`, `effect` and `zod`.
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { createWindowManager } from "@fungi.computer/nacre";
|
|
22
|
+
|
|
23
|
+
const windows = createWindowManager({
|
|
24
|
+
createContainer: () => ({}),
|
|
25
|
+
mount: () => ({
|
|
26
|
+
setVisibility: () => undefined,
|
|
27
|
+
reconfigure: () => undefined,
|
|
28
|
+
dispose: () => undefined,
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
31
|
+
await windows.open({ windowId: "notes" });
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Core concepts
|
|
35
|
+
|
|
36
|
+
`@fungi.computer/nacre` supplies the client side of hosting Apps. It can be
|
|
37
|
+
imported independently of the Workers server and Node packing helpers. The same
|
|
38
|
+
exports are available through focused entries:
|
|
39
|
+
|
|
40
|
+
| Entry | Contract |
|
|
41
|
+
| ------------------ | ----------------------------------------------------------------------------------- |
|
|
42
|
+
| `./workbench` | Workbench host contract, shared child-window host, Gill layout and arranger shapes. |
|
|
43
|
+
| `./command-host` | A Whistle graph that admits mounted commands against verified Release declarations. |
|
|
44
|
+
| `./keys` | DOM key dispatch and shared chord matching. |
|
|
45
|
+
| `./commands` | Window, App picker and command palette declarations over host callbacks. |
|
|
46
|
+
| `./window-manager` | Window generations, visibility, navigation, cancellation and disposal. |
|
|
47
|
+
| `./app-directory` | App addresses, reusable directory rows and catalog metadata. |
|
|
48
|
+
|
|
49
|
+
`./shell-module` is the contract between a host and the shell it runs, and is
|
|
50
|
+
imported on its own rather than through the root entry. A shell Release exports
|
|
51
|
+
`mountShell(root, input)` (`MountShell`); `input` (`ShellMountInput`) carries
|
|
52
|
+
the workbench handle, the shell installation's `AppStorage` and
|
|
53
|
+
`methods.call(method, input)` for its declared backend methods, which takes the
|
|
54
|
+
input as JSON text and resolves with the decoded JSON result.
|
|
55
|
+
`importShellModule(moduleUrl, hostOrigin)` imports the picked shell's module
|
|
56
|
+
from the host's own origin, checks that it exports `mountShell`, and rejects
|
|
57
|
+
with `ShellModuleError` otherwise. The host never bundles a shell.
|
|
58
|
+
|
|
59
|
+
Supply your own mount adapter to `createWindowManager`. It receives the
|
|
60
|
+
container, launch descriptor, cancellation signal and navigation callbacks; its
|
|
61
|
+
returned handle owns visibility, reconfiguration and disposal. The manager
|
|
62
|
+
disposes stale mounts and serializes changes to each window. It neither picks
|
|
63
|
+
Apps nor grants capabilities.
|
|
64
|
+
|
|
65
|
+
`createAppSurfaceCommandHost` owns command contribution and focus. Give
|
|
66
|
+
`mount(id, declarations)` the verified Release's declarations and pass the
|
|
67
|
+
returned handlers to Agar's `connectAppHost`. A mounted App cannot introduce an
|
|
68
|
+
undeclared command or claim the reserved shell chord. Dispose its command mount
|
|
69
|
+
when its iframe closes, and dispose the command host with the shell.
|
|
70
|
+
`installShellKeys` attaches DOM listeners only when called; its return value
|
|
71
|
+
removes them. Terminal shells can use the command and window owners without a
|
|
72
|
+
DOM.
|
|
73
|
+
|
|
74
|
+
Directory metadata is not launch authority. A host extends the public row schema
|
|
75
|
+
with its own permission model and admits each mount itself. Fungi's Team
|
|
76
|
+
directory, Team settings capability and signed Hub/host protocol live in its
|
|
77
|
+
private consumers; the public shell imports none of them.
|
|
78
|
+
|
|
79
|
+
## API reference
|
|
80
|
+
|
|
81
|
+
The generated reference is in [docs/api](docs/api/README.md).
|
|
82
|
+
|
|
83
|
+
## Examples and checks
|
|
84
|
+
|
|
85
|
+
- `pnpm --filter @fungi.computer/nacre test` runs the window manager, command
|
|
86
|
+
host, shell module and App catalog tests.
|
|
87
|
+
- `pnpm --filter @fungi.computer/nacre stranger` packs the package and
|
|
88
|
+
typechecks and runs a consumer against the tarball.
|
|
89
|
+
|
|
90
|
+
## Limits and errors
|
|
91
|
+
|
|
92
|
+
Directory metadata is not launch authority, and a mounted App cannot introduce
|
|
93
|
+
an undeclared command. `importShellModule` rejects a module that does not export
|
|
94
|
+
`mountShell` with `ShellModuleError`.
|
|
95
|
+
|
|
96
|
+
## Contribute and license
|
|
97
|
+
|
|
98
|
+
Changes land through the Botanical repository. MIT licensed; see
|
|
99
|
+
[LICENSE](LICENSE).
|