@fungi.computer/nacre 0.2.0 → 0.2.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.
@@ -602,8 +602,12 @@ export function createWindowManager(options) {
602
602
  const controller = new AbortController();
603
603
  record.reconfigureController = controller;
604
604
  try {
605
- if (!record.host && record.mountPromise)
606
- await record.mountPromise;
605
+ const mounted = record.mountPromise;
606
+ if (!record.host && mounted) {
607
+ // A cancelled update must release the queue so close can retire
608
+ // the loading mount and await its eventual cleanup.
609
+ await Effect.runPromise(Effect.tryPromise({ try: () => mounted, catch: (cause) => cause }), { signal: controller.signal });
610
+ }
607
611
  if (reconfigurationWasCancelled(record, controller))
608
612
  return;
609
613
  const host = record.host;
@@ -78,6 +78,7 @@ class MountedChildHandle {
78
78
  reconfigureCurrent;
79
79
  release;
80
80
  #disposed = false;
81
+ #disposal;
81
82
  constructor(surface, commands, reconfigureCurrent, release) {
82
83
  this.surface = surface;
83
84
  this.commands = commands;
@@ -130,11 +131,10 @@ class MountedChildHandle {
130
131
  ? { origin: parsed.origin }
131
132
  : { arguments: parseJsonValue(input.arguments), origin: parsed.origin });
132
133
  }
133
- async dispose() {
134
- if (this.#disposed)
135
- return;
134
+ dispose() {
136
135
  this.#disposed = true;
137
- await this.release();
136
+ // Share the barrier before release can call back into the handle.
137
+ return (this.#disposal ??= Promise.resolve().then(() => this.release()));
138
138
  }
139
139
  [Symbol.dispose]() {
140
140
  void this.dispose();
package/docs/api/index.md CHANGED
@@ -117,7 +117,7 @@ requestGill(input): Promise<
117
117
  title: string;
118
118
  state: "error";
119
119
  rows: readonly [];
120
- reason?: "exec_isolation_required" | "params_required";
120
+ reason?: "exec_isolation_required" | "params_required" | "disabled";
121
121
  error: string;
122
122
  recovery?: | {
123
123
  kind: "configure";
@@ -159,11 +159,11 @@ resource data.
159
159
  `Promise`\< \| \{ `viewId`: `string`; `title`: `string`; `state`: `"empty"`;
160
160
  `rows`: readonly \[\]; `next?`: `string`; \} \| \{ `viewId`: `string`; `title`:
161
161
  `string`; `state`: `"error"`; `rows`: readonly \[\]; `reason?`:
162
- `"exec_isolation_required"` \| `"params_required"`; `error`: `string`;
163
- `recovery?`: \| \{ `kind`: `"configure"`; `param`: `string`; \} \| \{ `kind`:
164
- `"open"`; \}; \} \| \{ `viewId`: `string`; `title`: `string`; `state`: `"full"`;
165
- `rows`: readonly `object`[]; `next?`: `string`; \} \| \{ `options`: readonly
166
- `object`[]; `next?`: `string`; \}\>
162
+ `"exec_isolation_required"` \| `"params_required"` \| `"disabled"`; `error`:
163
+ `string`; `recovery?`: \| \{ `kind`: `"configure"`; `param`: `string`; \} \| \{
164
+ `kind`: `"open"`; \}; \} \| \{ `viewId`: `string`; `title`: `string`; `state`:
165
+ `"full"`; `rows`: readonly `object`[]; `next?`: `string`; \} \| \{ `options`:
166
+ readonly `object`[]; `next?`: `string`; \}\>
167
167
 
168
168
  ###### Implementation of
169
169
 
@@ -558,7 +558,7 @@ requestGill(input): Promise<
558
558
  title: Schema.String;
559
559
  state: Schema.Literal<"error">;
560
560
  rows: Schema.Tuple<readonly []>;
561
- reason?: Schema.optional<Schema.Literals<readonly ["exec_isolation_required", "params_required"]>>;
561
+ reason?: Schema.optional<Schema.Literals<readonly ["exec_isolation_required", "params_required", "disabled"]>>;
562
562
  error: Schema.String;
563
563
  recovery?: Schema.optional<Schema.Union<readonly [Schema.Struct<{
564
564
  kind: Schema.Literal<...>;
@@ -618,7 +618,7 @@ resource data.
618
618
  `title`: `Schema.String`; `state`: `Schema.Literal`\<`"error"`\>; `rows`:
619
619
  `Schema.Tuple`\<readonly \[\]\>; `reason?`:
620
620
  `Schema.optional`\<`Schema.Literals`\<readonly \[`"exec_isolation_required"`,
621
- `"params_required"`\]\>\>; `error`: `Schema.String`; `recovery?`:
621
+ `"params_required"`, `"disabled"`\]\>\>; `error`: `Schema.String`; `recovery?`:
622
622
  `Schema.optional`\<`Schema.Union`\<readonly \[`Schema.Struct`\<\{ `kind`:
623
623
  `Schema.Literal`\<...\>; `param`: `Schema.String`; \}\>, `Schema.Struct`\<\{
624
624
  `kind`: `Schema.Literal`\<...\>; \}\>\]\>\>; \} \| \{ `viewId`: `Schema.String`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/nacre",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "description": "The shell client for hosting Apps: workbench, command host, keys, commands, window manager and App directory rows",
6
6
  "type": "module",
@@ -56,16 +56,17 @@
56
56
  "LICENSE"
57
57
  ],
58
58
  "dependencies": {
59
- "@fungi.computer/agar": "0.7.1",
59
+ "@fungi.computer/agar": "0.7.2",
60
60
  "@fungi.computer/ear-tag": "0.1.0",
61
- "@fungi.computer/gills": "0.2.1",
62
- "@fungi.computer/puffball": "0.5.1",
61
+ "@fungi.computer/gills": "0.2.2",
62
+ "@fungi.computer/puffball": "0.5.2",
63
63
  "@fungi.computer/whistle": "0.3.0",
64
64
  "effect": "4.0.2",
65
65
  "zod": "4.4.3"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/node": "24.13.3",
69
+ "jsdom": "29.0.1",
69
70
  "typescript": "5.9.3",
70
71
  "vitest": "4.1.11"
71
72
  },