@fungi.computer/oyster 0.34.0 → 0.35.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.
@@ -150,6 +150,8 @@ export declare abstract class StandaloneRegistry extends OysterRegistry implemen
150
150
  } | null>;
151
151
  /** A durable selection snapshot; the configured default remains the App build Computer. */
152
152
  selectedComputer(): Promise<string>;
153
+ /** Name for the host's captured selection, from the same owner as the picker. */
154
+ computerName(computerId: string): string | null;
153
155
  /** Frame dispatch checks inventory ownership, not a mutable UI selection. */
154
156
  ownsComputer(computerId: string): boolean;
155
157
  /** One atomic registry admission proves the stored creator is still the owner. */
@@ -285,6 +285,13 @@ export class StandaloneRegistry extends OysterRegistry {
285
285
  throw new Error("Selected Computer is missing");
286
286
  return computerId;
287
287
  }
288
+ /** Name for the host's captured selection, from the same owner as the picker. */
289
+ computerName(computerId) {
290
+ const configured = this.#configured();
291
+ const computer = this.#computers.read(computerId) ??
292
+ (configured.computerId === computerId ? configured : null);
293
+ return computer?.name ?? null;
294
+ }
288
295
  /** Frame dispatch checks inventory ownership, not a mutable UI selection. */
289
296
  ownsComputer(computerId) {
290
297
  return (computerId === this.#configured().computerId ||
@@ -30,7 +30,7 @@ export type StandaloneEnv = OysterGitWorkerEnv & StandaloneTenancyEnv & Standalo
30
30
  export { ComputerDO } from "./computer.js";
31
31
  export { WorkspaceProxy, WorkspaceServiceProxy, } from "@fungi.computer/computer";
32
32
  import { StandaloneRegistry as BaseRegistry, type StandaloneRegistryGit } from "./registry.js";
33
- /** The registry uses the same root, with its own in-process Computer selection. */
33
+ /** The registry reads both Computer identity fields in process, never by self RPC. */
34
34
  export declare class OysterRegistry extends BaseRegistry {
35
35
  #private;
36
36
  constructor(state: DurableObjectState, env: StandaloneEnv, git?: StandaloneRegistryGit);
@@ -45,10 +45,13 @@ const computerRegistry = (env) => tenantRegistry(env, tenantScope(defaultTenant,
45
45
  export { ComputerDO } from "./computer.js";
46
46
  export { WorkspaceProxy, WorkspaceServiceProxy, } from "@fungi.computer/computer";
47
47
  import { StandaloneRegistry as BaseRegistry, } from "./registry.js";
48
- /** The registry uses the same root, with its own in-process Computer selection. */
48
+ /** The registry reads both Computer identity fields in process, never by self RPC. */
49
49
  export class OysterRegistry extends BaseRegistry {
50
50
  #rootEnv;
51
- #root = standaloneRoot(() => this.selectedComputer());
51
+ #root = standaloneRoot(async () => {
52
+ const computerId = await this.selectedComputer();
53
+ return { computerId, computerName: this.computerName(computerId) };
54
+ });
52
55
  constructor(state, env, git = {}) {
53
56
  super(state, env, git);
54
57
  this.#rootEnv = env;
@@ -81,7 +84,14 @@ const standaloneRoot = (selectComputer) => {
81
84
  computerControl: (env, scope) => (principal) => oysterPrincipalIsOwner(principal)
82
85
  ? standaloneComputerControl(tenantRegistry(env, scope), principal.actor.memberId)
83
86
  : null,
84
- workspace: async (env, keysLive, scope, request) => standaloneWorkspace(env, keysLive, await selectComputer(tenantRegistry(env, scope), request)),
87
+ workspace: async (env, keysLive, scope, request) => {
88
+ const registry = tenantRegistry(env, scope);
89
+ const { computerId, computerName } = await selectComputer(registry, request);
90
+ return {
91
+ ...standaloneWorkspace(env, keysLive, computerId),
92
+ computerName,
93
+ };
94
+ },
85
95
  capabilities: (env, workspace) => [
86
96
  ...standaloneComputerCapabilities(env, workspace),
87
97
  ...workersMedia(env, workspace),
@@ -117,7 +127,10 @@ const standaloneRoot = (selectComputer) => {
117
127
  });
118
128
  return root;
119
129
  };
120
- const oysterRoot = standaloneRoot(standaloneComputerSelection);
130
+ const oysterRoot = standaloneRoot(async (registry, incoming) => {
131
+ const computerId = await standaloneComputerSelection(registry, incoming);
132
+ return { computerId, computerName: await registry.computerName(computerId) };
133
+ });
121
134
  export class OysterMcp extends createOysterGitMcpOwner(oysterRoot) {
122
135
  }
123
136
  /** Background wakes readmit members through this root's tenancy, as HTTP and MCP do. */
package/dist/workers.d.ts CHANGED
@@ -465,6 +465,7 @@ export declare class OysterInstance<Env extends OysterWorkerEnv = OysterWorkerEn
465
465
  /** One host-selected workspace shared by App context and capability adapters. */
466
466
  export type OysterWorkspace = Readonly<{
467
467
  computerId: string;
468
+ computerName?: string | null;
468
469
  files: FileSource;
469
470
  /** Caller-scoped Computer calls; file-only workspaces omit it. */
470
471
  computer?: OysterHost["computer"];
package/dist/workers.js CHANGED
@@ -1351,7 +1351,11 @@ export function oysterWorkerHost(env, auth, options = {}) {
1351
1351
  backgroundOriginKey: () => backgroundOriginKey(originSecret.value),
1352
1352
  };
1353
1353
  if (options.workspace !== undefined)
1354
- host = { ...host, computerId: options.workspace.computerId };
1354
+ host = {
1355
+ ...host,
1356
+ computerId: options.workspace.computerId,
1357
+ computerName: options.workspace.computerName ?? null,
1358
+ };
1355
1359
  if (options.workspace?.computer !== undefined)
1356
1360
  host = { ...host, computer: options.workspace.computer };
1357
1361
  if (options.appToolPolicy !== undefined)
package/docs/api/host.md CHANGED
@@ -494,6 +494,7 @@ type OysterHost = Readonly<{
494
494
  instances: InstanceDirectory;
495
495
  bootUi: (release) => Promise<UiBootCheckOutcome>;
496
496
  computerId?: string;
497
+ computerName?: string | null;
497
498
  computer?: (principal) => KnapsackComputer | null | Promise<KnapsackComputer | null>;
498
499
  appToolPolicy?: (actor) =>
499
500
  | AppToolPolicy
@@ -171,6 +171,7 @@ Read the server-admitted configuration this page was served with.
171
171
  | `storage` | `boolean` | `Schema.Boolean` | - |
172
172
  | `appsOpen` | `boolean` | `Schema.Boolean` | The Release declares `apps.open`; only an embedding shell can serve it. |
173
173
  | `computerId` | `string` \| `null` | - | - |
174
+ | `computerName?` | `string` \| `null` | - | - |
174
175
  | `authorityVersion` | `number` | `Schema.Int` | - |
175
176
  | `commands` | readonly `Readonly`\<\{ `id`: `string`; `title`: `string`; `category`: `string`; `description?`: `string`; `sigil?`: `string`; `projections?`: `Readonly`\<\{ `bindings?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `values`: ...; \}\>; `agent?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `keybind?`: ...; \}\>; `help?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `menu?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `palette?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `slash?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `aliases`: ...; \}\>; \}\>; \}\>[] | - | - |
176
177
  | `icon` | `string` \| `null` | - | - |
@@ -211,25 +212,26 @@ would, without a frame between the shell and its host.
211
212
 
212
213
  #### Parameters
213
214
 
214
- | Parameter | Type | Description |
215
- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
216
- | `config` | \{ `workbench`: `boolean`; `shellModuleUrl`: `string` \| `null`; `storage`: `boolean`; `appsOpen`: `boolean`; `computerId`: `string` \| `null`; `authorityVersion`: `number`; `commands`: readonly `Readonly`\<\{ `id`: `string`; `title`: `string`; `category`: `string`; `description?`: `string`; `sigil?`: `string`; `projections?`: `Readonly`\<\{ `bindings?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `values`: ...; \}\>; `agent?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `keybind?`: ...; \}\>; `help?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `menu?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `palette?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `slash?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `aliases`: ...; \}\>; \}\>; \}\>[]; `icon`: `string` \| `null`; `roles`: readonly `string`[]; `installationId`: `string`; `appId`: `string`; `releaseId`: `string`; `uiUrl`: `string`; `backendUrl`: `string`; `methodsUrl`: `string`; `capabilities`: readonly `object`[]; \} | - |
217
- | `config.workbench` | `boolean` | - |
218
- | `config.shellModuleUrl` | `string` \| `null` | The home shell Release's own module, imported top-level; null if it ships none. |
219
- | `config.storage` | `boolean` | - |
220
- | `config.appsOpen` | `boolean` | The Release declares `apps.open`; only an embedding shell can serve it. |
221
- | `config.computerId` | `string` \| `null` | - |
222
- | `config.authorityVersion` | `number` | - |
223
- | `config.commands` | readonly `Readonly`\<\{ `id`: `string`; `title`: `string`; `category`: `string`; `description?`: `string`; `sigil?`: `string`; `projections?`: `Readonly`\<\{ `bindings?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `values`: ...; \}\>; `agent?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `keybind?`: ...; \}\>; `help?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `menu?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `palette?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `slash?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `aliases`: ...; \}\>; \}\>; \}\>[] | - |
224
- | `config.icon` | `string` \| `null` | - |
225
- | `config.roles` | readonly `string`[] | - |
226
- | `config.installationId` | `string` | - |
227
- | `config.appId` | `string` | - |
228
- | `config.releaseId` | `string` | - |
229
- | `config.uiUrl` | `string` | - |
230
- | `config.backendUrl` | `string` | - |
231
- | `config.methodsUrl` | `string` | - |
232
- | `config.capabilities` | readonly `object`[] | - |
215
+ | Parameter | Type | Description |
216
+ | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
217
+ | `config` | \{ `workbench`: `boolean`; `shellModuleUrl`: `string` \| `null`; `storage`: `boolean`; `appsOpen`: `boolean`; `computerId`: `string` \| `null`; `computerName?`: `string` \| `null`; `authorityVersion`: `number`; `commands`: readonly `Readonly`\<\{ `id`: `string`; `title`: `string`; `category`: `string`; `description?`: `string`; `sigil?`: `string`; `projections?`: `Readonly`\<\{ `bindings?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `values`: ...; \}\>; `agent?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `keybind?`: ...; \}\>; `help?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `menu?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `palette?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `slash?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `aliases`: ...; \}\>; \}\>; \}\>[]; `icon`: `string` \| `null`; `roles`: readonly `string`[]; `installationId`: `string`; `appId`: `string`; `releaseId`: `string`; `uiUrl`: `string`; `backendUrl`: `string`; `methodsUrl`: `string`; `capabilities`: readonly `object`[]; \} | - |
218
+ | `config.workbench` | `boolean` | - |
219
+ | `config.shellModuleUrl` | `string` \| `null` | The home shell Release's own module, imported top-level; null if it ships none. |
220
+ | `config.storage` | `boolean` | - |
221
+ | `config.appsOpen` | `boolean` | The Release declares `apps.open`; only an embedding shell can serve it. |
222
+ | `config.computerId` | `string` \| `null` | - |
223
+ | `config.computerName?` | `string` \| `null` | - |
224
+ | `config.authorityVersion` | `number` | - |
225
+ | `config.commands` | readonly `Readonly`\<\{ `id`: `string`; `title`: `string`; `category`: `string`; `description?`: `string`; `sigil?`: `string`; `projections?`: `Readonly`\<\{ `bindings?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `values`: ...; \}\>; `agent?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `keybind?`: ...; \}\>; `help?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `menu?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `palette?`: `Readonly`\<\{ `order?`: ... \| ...; \}\>; `slash?`: `Readonly`\<\{ `order?`: ...; \}\> & `Readonly`\<\{ `aliases`: ...; \}\>; \}\>; \}\>[] | - |
226
+ | `config.icon` | `string` \| `null` | - |
227
+ | `config.roles` | readonly `string`[] | - |
228
+ | `config.installationId` | `string` | - |
229
+ | `config.appId` | `string` | - |
230
+ | `config.releaseId` | `string` | - |
231
+ | `config.uiUrl` | `string` | - |
232
+ | `config.backendUrl` | `string` | - |
233
+ | `config.methodsUrl` | `string` | - |
234
+ | `config.capabilities` | readonly `object`[] | - |
233
235
 
234
236
  #### Returns
235
237