@fungi.computer/oyster 0.3.1 → 0.4.0

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 (75) hide show
  1. package/README.md +2 -1
  2. package/dist/agent-computer-source.d.ts +42 -0
  3. package/dist/agent-computer-source.js +88 -0
  4. package/dist/agent-computers.d.ts +104 -0
  5. package/dist/agent-computers.js +227 -0
  6. package/dist/agents.d.ts +10 -0
  7. package/dist/agents.js +33 -0
  8. package/dist/boot-capability.d.ts +1 -1
  9. package/dist/boot-capability.js +1 -1
  10. package/dist/browser/boot.d.ts +2 -2
  11. package/dist/browser/boot.js +10 -3
  12. package/dist/browser/browser.d.ts +1 -1
  13. package/dist/browser/browser.js +2 -1
  14. package/dist/browser/cdp-client.d.ts +2 -0
  15. package/dist/browser/errors.d.ts +2 -2
  16. package/dist/browser/errors.js +2 -2
  17. package/dist/browser/index.d.ts +3 -2
  18. package/dist/browser/index.js +3 -2
  19. package/dist/browser/page.js +11 -4
  20. package/dist/browser/sessions.d.ts +7 -4
  21. package/dist/browser/sessions.js +159 -0
  22. package/dist/browser/url-policy.d.ts +4 -2
  23. package/dist/browser/url-policy.js +4 -2
  24. package/dist/computer-control-port.d.ts +26 -0
  25. package/dist/computer-control-port.js +1 -0
  26. package/dist/host.d.ts +3 -0
  27. package/dist/machine-link/delivery.d.ts +1 -1
  28. package/dist/machine-link/delivery.js +2 -3
  29. package/dist/machine-link/host.d.ts +37 -6
  30. package/dist/machine-link/host.js +209 -14
  31. package/dist/machine-link/link.d.ts +13 -1
  32. package/dist/machine-link/link.js +20 -7
  33. package/dist/mcp.d.ts +152 -11
  34. package/dist/mcp.js +131 -13
  35. package/dist/page/computer-handles.d.ts +3 -3
  36. package/dist/page-script.js +1 -1
  37. package/dist/standalone/agent-computers.d.ts +29 -0
  38. package/dist/standalone/agent-computers.js +101 -0
  39. package/dist/standalone/agent-mail.d.ts +41 -18
  40. package/dist/standalone/agent-model-choice.d.ts +26 -0
  41. package/dist/standalone/agent-model-choice.js +72 -0
  42. package/dist/standalone/agents.d.ts +50 -5
  43. package/dist/standalone/agents.js +505 -53
  44. package/dist/standalone/app-builds-binding.js +1 -1
  45. package/dist/standalone/computer-control.d.ts +4 -0
  46. package/dist/standalone/computer-control.js +62 -0
  47. package/dist/standalone/computer-fleet.d.ts +1 -0
  48. package/dist/standalone/computer-fleet.js +1 -1
  49. package/dist/standalone/computer.d.ts +21 -2
  50. package/dist/standalone/computer.js +12 -0
  51. package/dist/standalone/machine-link.d.ts +10 -0
  52. package/dist/standalone/machine-link.js +6 -0
  53. package/dist/standalone/registry.d.ts +12 -0
  54. package/dist/standalone/registry.js +18 -0
  55. package/dist/standalone/tenancy.d.ts +14 -1
  56. package/dist/standalone/tenancy.js +37 -3
  57. package/dist/standalone/worker.js +36 -9
  58. package/dist/standalone/workflow-binding.d.ts +2 -2
  59. package/dist/standalone/workflow-host.d.ts +11 -11
  60. package/dist/standalone/workflows.d.ts +22 -22
  61. package/dist/storage-frame.d.ts +3 -3
  62. package/dist/workers-git.d.ts +2 -0
  63. package/dist/workers-git.js +11 -1
  64. package/dist/workers.d.ts +8 -8
  65. package/docs/api/agents.md +66 -0
  66. package/docs/api/apps.md +104 -104
  67. package/docs/api/build-contract.md +35 -35
  68. package/docs/api/build.md +12 -12
  69. package/docs/api/host.md +61 -61
  70. package/docs/api/mcp.md +141 -13
  71. package/docs/api/root-data.md +1 -1
  72. package/docs/api/tenancy.md +1 -1
  73. package/docs/api/workers-git.md +3 -2
  74. package/docs/api/workers.md +81 -83
  75. package/package.json +25 -17
@@ -103,7 +103,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
103
103
  authorityVersion: number;
104
104
  declaredOperationsDigest: import("@fungi.computer/puffball").Sha256Digest;
105
105
  approvedGrants: readonly Readonly<{
106
- capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
106
+ capability: "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
107
107
  capabilityApproved: true;
108
108
  operations: readonly string[];
109
109
  resources: "tenant-scope" | readonly Readonly<{
@@ -239,7 +239,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
239
239
  authorityVersion: number;
240
240
  declaredOperationsDigest: import("@fungi.computer/puffball").Sha256Digest;
241
241
  approvedGrants: readonly Readonly<{
242
- capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
242
+ capability: "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
243
243
  capabilityApproved: true;
244
244
  operations: readonly string[];
245
245
  resources: "tenant-scope" | readonly Readonly<{
@@ -325,7 +325,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
325
325
  authorityVersion: number;
326
326
  declaredOperationsDigest: import("@fungi.computer/puffball").Sha256Digest;
327
327
  approvedGrants: readonly Readonly<{
328
- capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
328
+ capability: "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
329
329
  capabilityApproved: true;
330
330
  operations: readonly string[];
331
331
  resources: "tenant-scope" | readonly Readonly<{
@@ -444,7 +444,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
444
444
  authorityVersion: number;
445
445
  declaredOperationsDigest: import("@fungi.computer/puffball").Sha256Digest;
446
446
  approvedGrants: readonly Readonly<{
447
- capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
447
+ capability: "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
448
448
  capabilityApproved: true;
449
449
  operations: readonly string[];
450
450
  resources: "tenant-scope" | readonly Readonly<{
@@ -544,7 +544,7 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
544
544
  authorityVersion: number;
545
545
  declaredOperationsDigest: import("@fungi.computer/puffball").Sha256Digest;
546
546
  approvedGrants: readonly Readonly<{
547
- capability: "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
547
+ capability: "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "llm.generation" | "media.generation" | "games:servers" | "git.repository" | "apps.open" | "apps.call" | "app.storage" | "app.events.emit" | "team.workbenchHost" | "marketplace.browse" | "marketplace.purchase" | "workflow.run" | "workflow.publish" | "workflow.arm" | "world" | "channels.read" | "channels.personal.manage";
548
548
  capabilityApproved: true;
549
549
  operations: readonly string[];
550
550
  resources: "tenant-scope" | readonly Readonly<{
@@ -678,9 +678,9 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
678
678
  readonly values: {
679
679
  readonly [x: string]: import("@fungi.computer/braid").Mapping;
680
680
  };
681
+ readonly id: string;
681
682
  readonly kind: "app";
682
683
  readonly method: string;
683
- readonly id: string;
684
684
  readonly app: string;
685
685
  readonly methodDigest: string;
686
686
  readonly retry?: {
@@ -696,8 +696,8 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
696
696
  access: "read";
697
697
  } | undefined;
698
698
  } | {
699
- readonly kind: "review";
700
699
  readonly id: string;
700
+ readonly kind: "review";
701
701
  readonly timeout: number;
702
702
  readonly title: string;
703
703
  readonly reviewers: "runner" | "owners";
@@ -775,9 +775,9 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
775
775
  readonly values: {
776
776
  readonly [x: string]: import("@fungi.computer/braid").Mapping;
777
777
  };
778
+ readonly id: string;
778
779
  readonly kind: "app";
779
780
  readonly method: string;
780
- readonly id: string;
781
781
  readonly app: string;
782
782
  readonly methodDigest: string;
783
783
  readonly retry?: {
@@ -793,8 +793,8 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
793
793
  access: "read";
794
794
  } | undefined;
795
795
  } | {
796
- readonly kind: "review";
797
796
  readonly id: string;
797
+ readonly kind: "review";
798
798
  readonly timeout: number;
799
799
  readonly title: string;
800
800
  readonly reviewers: "runner" | "owners";
@@ -900,9 +900,9 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
900
900
  readonly input: {
901
901
  readonly [x: string]: S.Json;
902
902
  };
903
+ readonly description: string;
903
904
  readonly digest: string;
904
905
  readonly approval: "queue" | "none" | "simulate";
905
- readonly description: string;
906
906
  readonly effect: "read" | "write" | "external";
907
907
  readonly requires: readonly string[];
908
908
  readonly pending?: true | undefined;
@@ -935,10 +935,10 @@ export declare function createStandaloneWorkflowHost(owner: WatchdogSqliteOwner,
935
935
  readonly input: {
936
936
  readonly [x: string]: S.Json;
937
937
  };
938
+ readonly description: string;
938
939
  readonly method: string;
939
940
  readonly installationId: string;
940
941
  readonly approval: "queue" | "none" | "simulate";
941
- readonly description: string;
942
942
  readonly effect: "read" | "write" | "external";
943
943
  readonly requires: readonly string[];
944
944
  readonly app: string;
@@ -295,9 +295,9 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
295
295
  readonly values: {
296
296
  readonly [x: string]: import("@fungi.computer/braid").Mapping;
297
297
  };
298
+ readonly id: string;
298
299
  readonly kind: "app";
299
300
  readonly method: string;
300
- readonly id: string;
301
301
  readonly app: string;
302
302
  readonly methodDigest: string;
303
303
  readonly retry?: {
@@ -313,8 +313,8 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
313
313
  access: "read";
314
314
  } | undefined;
315
315
  } | {
316
- readonly kind: "review";
317
316
  readonly id: string;
317
+ readonly kind: "review";
318
318
  readonly timeout: number;
319
319
  readonly title: string;
320
320
  readonly reviewers: "runner" | "owners";
@@ -392,9 +392,9 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
392
392
  readonly values: {
393
393
  readonly [x: string]: import("@fungi.computer/braid").Mapping;
394
394
  };
395
+ readonly id: string;
395
396
  readonly kind: "app";
396
397
  readonly method: string;
397
- readonly id: string;
398
398
  readonly app: string;
399
399
  readonly methodDigest: string;
400
400
  readonly retry?: {
@@ -410,8 +410,8 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
410
410
  access: "read";
411
411
  } | undefined;
412
412
  } | {
413
- readonly kind: "review";
414
413
  readonly id: string;
414
+ readonly kind: "review";
415
415
  readonly timeout: number;
416
416
  readonly title: string;
417
417
  readonly reviewers: "runner" | "owners";
@@ -517,9 +517,9 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
517
517
  readonly input: {
518
518
  readonly [x: string]: S.Json;
519
519
  };
520
+ readonly description: string;
520
521
  readonly digest: string;
521
522
  readonly approval: "queue" | "none" | "simulate";
522
- readonly description: string;
523
523
  readonly effect: "read" | "write" | "external";
524
524
  readonly requires: readonly string[];
525
525
  readonly pending?: true | undefined;
@@ -552,10 +552,10 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
552
552
  readonly input: {
553
553
  readonly [x: string]: S.Json;
554
554
  };
555
+ readonly description: string;
555
556
  readonly method: string;
556
557
  readonly installationId: string;
557
558
  readonly approval: "queue" | "none" | "simulate";
558
- readonly description: string;
559
559
  readonly effect: "read" | "write" | "external";
560
560
  readonly requires: readonly string[];
561
561
  readonly app: string;
@@ -625,17 +625,23 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
625
625
  runId: string;
626
626
  planDigest: string;
627
627
  title: string;
628
- outcome: "terminal" | "cancelled" | "active" | null;
628
+ outcome: "active" | "terminal" | "cancelled" | null;
629
629
  events: readonly {
630
630
  readonly runId: string;
631
- readonly nodeId: string;
632
631
  readonly state: "skipped" | "queued" | "running" | "failed" | "complete" | "waiting";
632
+ readonly nodeId: string;
633
633
  readonly iteration: string;
634
634
  readonly attempt: number;
635
635
  readonly output?: {
636
636
  readonly [x: string]: S.Json;
637
637
  } | undefined;
638
638
  readonly refusal?: string | undefined;
639
+ readonly position?: readonly {
640
+ readonly node: string;
641
+ readonly loop: "map" | "repeat";
642
+ readonly index: number;
643
+ readonly count: number;
644
+ }[] | undefined;
639
645
  readonly row?: {
640
646
  readonly id: string;
641
647
  readonly title: string;
@@ -658,12 +664,6 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
658
664
  } | undefined;
659
665
  readonly graphId?: string | undefined;
660
666
  readonly poll?: number | undefined;
661
- readonly position?: readonly {
662
- readonly node: string;
663
- readonly loop: "map" | "repeat";
664
- readonly index: number;
665
- readonly count: number;
666
- }[] | undefined;
667
667
  readonly recordedAt?: number | undefined;
668
668
  readonly durationMs?: number | undefined;
669
669
  readonly costMilliunits?: number | undefined;
@@ -716,17 +716,23 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
716
716
  runId: string;
717
717
  planDigest: string;
718
718
  title: string;
719
- outcome: "terminal" | "cancelled" | "active" | null;
719
+ outcome: "active" | "terminal" | "cancelled" | null;
720
720
  events: readonly {
721
721
  readonly runId: string;
722
- readonly nodeId: string;
723
722
  readonly state: "skipped" | "queued" | "running" | "failed" | "complete" | "waiting";
723
+ readonly nodeId: string;
724
724
  readonly iteration: string;
725
725
  readonly attempt: number;
726
726
  readonly output?: {
727
727
  readonly [x: string]: S.Json;
728
728
  } | undefined;
729
729
  readonly refusal?: string | undefined;
730
+ readonly position?: readonly {
731
+ readonly node: string;
732
+ readonly loop: "map" | "repeat";
733
+ readonly index: number;
734
+ readonly count: number;
735
+ }[] | undefined;
730
736
  readonly row?: {
731
737
  readonly id: string;
732
738
  readonly title: string;
@@ -749,12 +755,6 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
749
755
  } | undefined;
750
756
  readonly graphId?: string | undefined;
751
757
  readonly poll?: number | undefined;
752
- readonly position?: readonly {
753
- readonly node: string;
754
- readonly loop: "map" | "repeat";
755
- readonly index: number;
756
- readonly count: number;
757
- }[] | undefined;
758
758
  readonly recordedAt?: number | undefined;
759
759
  readonly durationMs?: number | undefined;
760
760
  readonly costMilliunits?: number | undefined;
@@ -21,7 +21,7 @@ export declare const storageFrameMethods: {
21
21
  };
22
22
  } | {
23
23
  readonly kind: "rejected";
24
- readonly code: "unavailable" | "invalid" | "conflict" | "undeclared_key" | "scope_not_declared" | "owner_required" | "too_large" | "quota_exceeded";
24
+ readonly code: "unavailable" | "conflict" | "invalid" | "undeclared_key" | "scope_not_declared" | "owner_required" | "too_large" | "quota_exceeded";
25
25
  };
26
26
  requiredOperations: () => string[];
27
27
  };
@@ -39,7 +39,7 @@ export declare const storageFrameMethods: {
39
39
  };
40
40
  } | {
41
41
  readonly kind: "rejected";
42
- readonly code: "unavailable" | "invalid" | "conflict" | "undeclared_key" | "scope_not_declared" | "owner_required" | "too_large" | "quota_exceeded";
42
+ readonly code: "unavailable" | "conflict" | "invalid" | "undeclared_key" | "scope_not_declared" | "owner_required" | "too_large" | "quota_exceeded";
43
43
  };
44
44
  requiredOperations: () => string[];
45
45
  };
@@ -56,7 +56,7 @@ export declare const storageFrameMethods: {
56
56
  };
57
57
  } | {
58
58
  readonly kind: "rejected";
59
- readonly code: "unavailable" | "invalid" | "conflict" | "undeclared_key" | "scope_not_declared" | "owner_required" | "too_large" | "quota_exceeded";
59
+ readonly code: "unavailable" | "conflict" | "invalid" | "undeclared_key" | "scope_not_declared" | "owner_required" | "too_large" | "quota_exceeded";
60
60
  };
61
61
  requiredOperations: () => string[];
62
62
  };
@@ -191,6 +191,8 @@ export declare abstract class OysterGitInstance<Env extends OysterGitWorkerEnv =
191
191
  * `oysterGitRoot(options).hostFor`.
192
192
  */
193
193
  export type OysterGitWorkerOptions<Env extends OysterGitWorkerEnv> = Readonly<{
194
+ /** Host-owned fleet control, admitted on every invocation by its durable owner. */
195
+ computerControl?: (env: Env, scope: TenantScope) => NonNullable<OysterHost["computerControl"]>;
194
196
  /** Workflow controls supplied by the host's existing run owner. */
195
197
  workflows?: (env: Env, host: OysterGitWorkerHost) => NonNullable<OysterHost["workflows"]>;
196
198
  /** Resolve one host-selected tenant before authentication; unknown origins refuse.
@@ -889,7 +889,15 @@ export function createOysterGitWorker(root) {
889
889
  hosts = new Map();
890
890
  environments.set(env, hosts);
891
891
  }
892
- const resolved = await root.admit(env, request);
892
+ let resolved;
893
+ try {
894
+ resolved = await root.admit(env, request);
895
+ }
896
+ catch (error) {
897
+ if (error instanceof HTTPException)
898
+ return error.getResponse();
899
+ throw error;
900
+ }
893
901
  if (resolved === null)
894
902
  return new Response("Not found", { status: 404 });
895
903
  const { scope } = resolved;
@@ -1137,6 +1145,8 @@ export async function oysterGitWorkerHost(env, options, selected, request) {
1137
1145
  host = { ...host, pageScript: options.pageScript };
1138
1146
  if (options.workflows !== undefined)
1139
1147
  host = { ...host, workflows: options.workflows(env, host) };
1148
+ if (options.computerControl !== undefined)
1149
+ host = { ...host, computerControl: options.computerControl(env, scope) };
1140
1150
  if (options.homeInstallationId !== undefined)
1141
1151
  host = { ...host, homeInstallationId: options.homeInstallationId(env) };
1142
1152
  return host;
package/dist/workers.d.ts CHANGED
@@ -110,23 +110,24 @@ export declare class OysterRegistry<Env extends OysterWorkerEnv = OysterWorkerEn
110
110
  }>): Promise<{
111
111
  readonly record: {
112
112
  readonly revision: number;
113
+ readonly expiresAt: number;
114
+ readonly operation: string;
115
+ readonly description: {
116
+ readonly title: string;
117
+ readonly inputBytes: number;
118
+ readonly inputSha256: string;
119
+ };
113
120
  readonly by: {
114
121
  readonly kind: "human";
115
122
  readonly memberId: string;
116
123
  } | {
117
124
  readonly kind: "policy";
118
125
  } | null;
119
- readonly description: {
120
- readonly title: string;
121
- readonly inputBytes: number;
122
- readonly inputSha256: string;
123
- };
124
- readonly operation: string;
125
126
  readonly access: "write" | "external";
126
- readonly expiresAt: number;
127
127
  readonly reason: "pending" | "expired" | "not-found" | "not-eligible" | "already-answered" | "stale-revision" | "declined" | "fenced" | "not-granted" | "read-only" | "in-flight" | "outcome-unknown" | "identity-conflict" | null;
128
128
  readonly updatedAt: number;
129
129
  readonly module: string;
130
+ readonly state: "pending" | "expired" | "denied" | "applied" | "requested" | "approved" | "claimed" | "outcome_unknown";
130
131
  readonly recordId: string;
131
132
  readonly authorityFence: string;
132
133
  readonly requester: {
@@ -136,7 +137,6 @@ export declare class OysterRegistry<Env extends OysterWorkerEnv = OysterWorkerEn
136
137
  readonly displayName: string;
137
138
  };
138
139
  readonly reversibility: "reversible" | "irreversible-external";
139
- readonly state: "pending" | "expired" | "denied" | "applied" | "requested" | "approved" | "claimed" | "outcome_unknown";
140
140
  readonly requestedAt: number;
141
141
  readonly evidence?: readonly {
142
142
  readonly kind: "artifact";
@@ -203,6 +203,47 @@ type OysterAgents = Readonly<{
203
203
  error: "not_found" | "not_granted";
204
204
  }>
205
205
  >;
206
+ readModelChoice: Promise<{
207
+ keySource: "workers-ai" | "ai-gateway" | "byok";
208
+ model: {
209
+ providerId: Schema.String;
210
+ modelId: Schema.String;
211
+ reasoning?: Schema.optional<
212
+ Schema.Literals<
213
+ readonly ["minimal", "low", "medium", "high", "xhigh", "max"]
214
+ >
215
+ >;
216
+ };
217
+ } | null>;
218
+ decodeModelChoice: {
219
+ keySource: "workers-ai" | "ai-gateway" | "byok";
220
+ model: {
221
+ providerId: Schema.String;
222
+ modelId: Schema.String;
223
+ reasoning?: Schema.optional<
224
+ Schema.Literals<
225
+ readonly ["minimal", "low", "medium", "high", "xhigh", "max"]
226
+ >
227
+ >;
228
+ };
229
+ } | null;
230
+ setModelChoice: Promise<
231
+ | {
232
+ keySource: "workers-ai" | "ai-gateway" | "byok";
233
+ model: {
234
+ providerId: Schema.String;
235
+ modelId: Schema.String;
236
+ reasoning?: Schema.optional<
237
+ Schema.Literals<
238
+ readonly ["minimal", "low", "medium", "high", "xhigh", "max"]
239
+ >
240
+ >;
241
+ };
242
+ }
243
+ | Readonly<{
244
+ error: "not_found" | "not_granted" | AgentModelRefusal;
245
+ }>
246
+ >;
206
247
  policyStatus: Promise<Readonly<{
207
248
  status: "pending" | "approved";
208
249
  revision: string;
@@ -262,6 +303,31 @@ type OysterAgents = Readonly<{
262
303
 
263
304
  Where an Oyster's agents live and run.
264
305
 
306
+ ---
307
+
308
+ ### AgentModelChoice
309
+
310
+ ```ts
311
+ type AgentModelChoice = typeof agentModelChoiceSchema.Type;
312
+ ```
313
+
314
+ The Agent's model preference and source reference, never credential material.
315
+
316
+ ---
317
+
318
+ ### AgentModelRefusal
319
+
320
+ ```ts
321
+ type AgentModelRefusal =
322
+ | "invalid_model_choice"
323
+ | "unsupported_key_source"
324
+ | "key_source_mismatch"
325
+ | "model_unavailable"
326
+ | "key_not_connected";
327
+ ```
328
+
329
+ Stable reason for rejecting a model or credential source before a run.
330
+
265
331
  ## Variables
266
332
 
267
333
  ### maxAgentMcpServers