@fungi.computer/oyster 0.1.0 → 0.3.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 (292) hide show
  1. package/README.md +376 -72
  2. package/dist/agent-avatars.d.ts +103 -0
  3. package/dist/agent-avatars.js +66 -0
  4. package/dist/agents.d.ts +15 -4
  5. package/dist/agents.js +43 -4
  6. package/dist/app-builds.d.ts +81 -8
  7. package/dist/app-builds.js +210 -60
  8. package/dist/app-storage.d.ts +3 -3
  9. package/dist/approval-capability.d.ts +5 -0
  10. package/dist/approval-capability.js +46 -0
  11. package/dist/approval-home.d.ts +51 -0
  12. package/dist/approval-home.js +226 -0
  13. package/dist/apps/catalog.d.ts +335 -0
  14. package/dist/apps/catalog.js +46 -0
  15. package/dist/apps/gate.d.ts +26 -12
  16. package/dist/apps/gate.js +48 -22
  17. package/dist/apps/index.d.ts +3 -1
  18. package/dist/apps/index.js +3 -1
  19. package/dist/apps/installation.d.ts +147 -66
  20. package/dist/apps/installation.js +193 -86
  21. package/dist/apps/permissions.d.ts +247 -0
  22. package/dist/apps/permissions.js +255 -0
  23. package/dist/boot-capability-route.d.ts +15 -0
  24. package/dist/boot-capability-route.js +196 -0
  25. package/dist/boot-capability.d.ts +103 -0
  26. package/dist/boot-capability.js +141 -0
  27. package/dist/boot-construction.d.ts +12 -0
  28. package/dist/boot-construction.js +175 -0
  29. package/dist/boot-gate.d.ts +267 -0
  30. package/dist/boot-gate.js +236 -0
  31. package/dist/boot-host-script.d.ts +2 -0
  32. package/dist/boot-host-script.js +1 -0
  33. package/dist/boot-mount.d.ts +21 -0
  34. package/dist/boot-mount.js +65 -0
  35. package/dist/browser/boot.d.ts +73 -0
  36. package/dist/browser/boot.js +502 -0
  37. package/dist/browser/browser.d.ts +104 -0
  38. package/dist/browser/browser.js +374 -0
  39. package/dist/browser/capability-source.d.ts +76 -0
  40. package/dist/browser/capability-source.js +338 -0
  41. package/dist/browser/cdp-client.d.ts +56 -0
  42. package/dist/browser/cdp-client.js +184 -0
  43. package/dist/browser/errors.d.ts +79 -0
  44. package/dist/browser/errors.js +32 -0
  45. package/dist/browser/index.d.ts +16 -0
  46. package/dist/browser/index.js +14 -0
  47. package/dist/browser/lease-registry.d.ts +61 -0
  48. package/dist/browser/lease-registry.js +101 -0
  49. package/dist/browser/operations.d.ts +225 -0
  50. package/dist/browser/operations.js +137 -0
  51. package/dist/browser/page.d.ts +25 -0
  52. package/dist/browser/page.js +172 -0
  53. package/dist/browser/quick-reads.d.ts +29 -0
  54. package/dist/browser/quick-reads.js +160 -0
  55. package/dist/browser/sessions.d.ts +52 -0
  56. package/dist/browser/sessions.js +118 -0
  57. package/dist/browser/url-policy.d.ts +18 -0
  58. package/dist/browser/url-policy.js +58 -0
  59. package/dist/build/app-imports.d.ts +12 -0
  60. package/dist/build/app-imports.js +105 -0
  61. package/dist/build/build-policy.d.ts +5 -3
  62. package/dist/build/build-policy.js +5 -3
  63. package/dist/build/candidate-builder.d.ts +1 -1
  64. package/dist/build/candidate-cli.mjs +8428 -337
  65. package/dist/build/local-build.d.ts +2 -0
  66. package/dist/build/local-build.js +28 -6
  67. package/dist/build/snapshot-package-store.d.ts +1 -1
  68. package/dist/build/snapshot-package-store.js +7 -2
  69. package/dist/build/workspace-build.d.ts +92 -5
  70. package/dist/build/workspace-build.js +93 -19
  71. package/dist/build-egress.js +4 -4
  72. package/dist/build.d.ts +1 -1
  73. package/dist/build.js +1 -1
  74. package/dist/catalog-frame.js +1 -1
  75. package/dist/cloudflare.d.ts +13 -3
  76. package/dist/cloudflare.js +106 -8
  77. package/dist/frame-binding-wire-script.js +1 -1
  78. package/dist/frame-binding-wire.d.ts +1 -1
  79. package/dist/frame-binding-wire.js +5 -3
  80. package/dist/git-auth.d.ts +0 -2
  81. package/dist/git-auth.js +0 -2
  82. package/dist/git-journal.js +4 -4
  83. package/dist/git.d.ts +0 -1
  84. package/dist/git.js +0 -2
  85. package/dist/host.d.ts +39 -13
  86. package/dist/host.js +268 -142
  87. package/dist/index.d.ts +26 -15
  88. package/dist/index.js +40 -16
  89. package/dist/install-release-cli.d.ts +2 -0
  90. package/dist/install-release-cli.js +46 -0
  91. package/dist/installation-client.d.ts +43 -0
  92. package/dist/installation-client.js +178 -0
  93. package/dist/installation-execution.d.ts +11 -0
  94. package/dist/installation-execution.js +184 -0
  95. package/dist/installation-operations.d.ts +1437 -0
  96. package/dist/installation-operations.js +664 -0
  97. package/dist/installation-store-generation.d.ts +3 -0
  98. package/dist/installation-store-generation.js +16 -0
  99. package/dist/instance-id.d.ts +10 -0
  100. package/dist/instance-id.js +10 -0
  101. package/dist/instance-refusal.d.ts +11 -0
  102. package/dist/instance-refusal.js +21 -0
  103. package/dist/internal/delivery.js +4 -2
  104. package/dist/internal/host-gate.js +7 -1
  105. package/dist/internal/registry-installations.js +4 -4
  106. package/dist/keys.d.ts +5 -1
  107. package/dist/keys.js +10 -2
  108. package/dist/machine-link/authority.d.ts +89 -0
  109. package/dist/machine-link/authority.js +37 -0
  110. package/dist/machine-link/client.d.ts +66 -0
  111. package/dist/machine-link/client.js +94 -0
  112. package/dist/machine-link/delivery.d.ts +18 -0
  113. package/dist/machine-link/delivery.js +55 -0
  114. package/dist/machine-link/enrollment.d.ts +111 -0
  115. package/dist/machine-link/enrollment.js +286 -0
  116. package/dist/machine-link/fences.d.ts +37 -0
  117. package/dist/machine-link/fences.js +166 -0
  118. package/dist/machine-link/home.d.ts +20 -0
  119. package/dist/machine-link/home.js +24 -0
  120. package/dist/machine-link/host.d.ts +43 -0
  121. package/dist/machine-link/host.js +189 -0
  122. package/dist/machine-link/index.d.ts +15 -0
  123. package/dist/machine-link/index.js +15 -0
  124. package/dist/machine-link/link.d.ts +48 -0
  125. package/dist/machine-link/link.js +223 -0
  126. package/dist/machine-link/presence.d.ts +10 -0
  127. package/dist/machine-link/presence.js +25 -0
  128. package/dist/machine-link/workers.d.ts +6 -0
  129. package/dist/machine-link/workers.js +6 -0
  130. package/dist/mcp-owner.d.ts +2 -2
  131. package/dist/mcp-owner.js +41 -33
  132. package/dist/mcp.d.ts +15 -3
  133. package/dist/mcp.js +146 -25
  134. package/dist/pack.d.ts +14 -3
  135. package/dist/pack.js +44 -19
  136. package/dist/page/app-access.d.ts +7 -0
  137. package/dist/page/app-access.js +75 -0
  138. package/dist/page/boot-host.js +57 -0
  139. package/dist/page/capabilities.d.ts +3 -3
  140. package/dist/page/capabilities.js +16 -12
  141. package/dist/page/computer-handles.d.ts +3 -3
  142. package/dist/page/computer-target.d.ts +3 -0
  143. package/dist/page/computer-target.js +9 -0
  144. package/dist/page/mount.d.ts +23 -7
  145. package/dist/page/mount.js +152 -16
  146. package/dist/page-assets.d.ts +22 -0
  147. package/dist/page-assets.js +28 -0
  148. package/dist/page-script.d.ts +3 -0
  149. package/dist/page-script.js +5 -4
  150. package/dist/release.d.ts +13 -6
  151. package/dist/release.js +10 -7
  152. package/dist/root-data.d.ts +16 -6
  153. package/dist/root-data.js +2 -2
  154. package/dist/source/index.d.ts +1 -1
  155. package/dist/source/team-source.d.ts +20 -8
  156. package/dist/source/team-source.js +39 -10
  157. package/dist/source/template-seed.d.ts +2 -2
  158. package/dist/standalone/agent-mail.d.ts +24 -0
  159. package/dist/standalone/agent-mail.js +62 -0
  160. package/dist/standalone/agent-store.d.ts +9 -0
  161. package/dist/standalone/agent-store.js +30 -0
  162. package/dist/standalone/agents.d.ts +78 -12
  163. package/dist/standalone/agents.js +470 -59
  164. package/dist/standalone/app-builds-binding.d.ts +20 -2
  165. package/dist/standalone/app-builds-binding.js +151 -27
  166. package/dist/standalone/app-set.d.ts +5 -2
  167. package/dist/standalone/app-set.js +174 -143
  168. package/dist/standalone/browser.d.ts +11 -0
  169. package/dist/standalone/browser.js +72 -0
  170. package/dist/standalone/builds.d.ts +13 -4
  171. package/dist/standalone/builds.js +28 -44
  172. package/dist/standalone/computer-egress.d.ts +2 -0
  173. package/dist/standalone/computer-egress.js +13 -4
  174. package/dist/standalone/computer-fleet.d.ts +43 -0
  175. package/dist/standalone/computer-fleet.js +200 -0
  176. package/dist/standalone/computer.d.ts +44 -9
  177. package/dist/standalone/computer.js +132 -25
  178. package/dist/standalone/install-apps-cli.js +43 -6
  179. package/dist/standalone/instance.d.ts +2 -2
  180. package/dist/standalone/instance.js +8 -11
  181. package/dist/standalone/machine-link.d.ts +354 -0
  182. package/dist/standalone/machine-link.js +368 -0
  183. package/dist/standalone/media.d.ts +2 -2
  184. package/dist/standalone/media.js +19 -16
  185. package/dist/standalone/preview.d.ts +2 -2
  186. package/dist/standalone/preview.js +39 -12
  187. package/dist/standalone/registry.d.ts +149 -9
  188. package/dist/standalone/registry.js +299 -8
  189. package/dist/standalone/worker.d.ts +19 -5
  190. package/dist/standalone/worker.js +90 -54
  191. package/dist/standalone/workflow-binding.d.ts +28 -32
  192. package/dist/standalone/workflow-binding.js +20 -20
  193. package/dist/standalone/workflow-control.d.ts +4 -0
  194. package/dist/standalone/workflow-control.js +40 -0
  195. package/dist/standalone/workflow-events.d.ts +2 -2
  196. package/dist/standalone/workflow-events.js +9 -10
  197. package/dist/standalone/workflow-git-capture.js +4 -3
  198. package/dist/standalone/workflow-host.d.ts +177 -152
  199. package/dist/standalone/workflow-host.js +137 -30
  200. package/dist/standalone/workflow-node-capture.js +11 -4
  201. package/dist/standalone/workflow-schedules.d.ts +5 -2
  202. package/dist/standalone/workflow-schedules.js +9 -10
  203. package/dist/standalone/workflow-trigger-host.d.ts +88 -6
  204. package/dist/standalone/workflow-trigger-host.js +2 -2
  205. package/dist/standalone/workflow-webhooks.d.ts +22 -0
  206. package/dist/standalone/workflow-webhooks.js +39 -0
  207. package/dist/standalone/workflows.d.ts +203 -50
  208. package/dist/standalone/workflows.js +198 -39
  209. package/dist/storage-frame.d.ts +6 -6
  210. package/dist/testing/capabilities.js +14 -3
  211. package/dist/testing/installation.js +26 -2
  212. package/dist/testing/worker.js +1 -1
  213. package/dist/testing/workers-runtime.d.ts +8 -2
  214. package/dist/testing/workers-runtime.js +20 -2
  215. package/dist/webhook-abuse.d.ts +25 -0
  216. package/dist/webhook-abuse.js +54 -0
  217. package/dist/webhook-custody.d.ts +144 -0
  218. package/dist/webhook-custody.js +222 -0
  219. package/dist/webhook-ingress.d.ts +36 -0
  220. package/dist/webhook-ingress.js +146 -0
  221. package/dist/webhooks.d.ts +111 -0
  222. package/dist/webhooks.js +189 -0
  223. package/dist/workers-git.d.ts +12 -17
  224. package/dist/workers-git.js +60 -55
  225. package/dist/workers.d.ts +224 -13
  226. package/dist/workers.js +351 -51
  227. package/dist/workflow-agent-authority.d.ts +8 -0
  228. package/dist/workflow-agent-authority.js +42 -0
  229. package/dist/workflows.d.ts +66 -0
  230. package/dist/workflows.js +97 -0
  231. package/docs/api/README.md +63 -37
  232. package/docs/api/agents.md +17 -0
  233. package/docs/api/app-storage.md +1 -1
  234. package/docs/api/apps.md +1394 -543
  235. package/docs/api/browser/boot.md +132 -0
  236. package/docs/api/browser.md +1440 -0
  237. package/docs/api/build-contract.md +38 -25
  238. package/docs/api/build.md +263 -84
  239. package/docs/api/cloudflare.md +93 -7
  240. package/docs/api/git.md +3 -13
  241. package/docs/api/host.md +944 -118
  242. package/docs/api/index.md +320 -18
  243. package/docs/api/keys.md +24 -1
  244. package/docs/api/mcp.md +59 -12
  245. package/docs/api/modules.md +33 -40
  246. package/docs/api/pack.md +57 -8
  247. package/docs/api/page/mount.md +92 -4
  248. package/docs/api/workers-git.md +103 -24
  249. package/docs/api/workers.md +1581 -244
  250. package/docs/site/agent-quickstart.mdx +28 -14
  251. package/examples/standalone/worker.ts +3 -1
  252. package/examples/standalone/wrangler.jsonc +2 -0
  253. package/package.json +73 -69
  254. package/dist/installation-consent.d.ts +0 -79
  255. package/dist/installation-consent.js +0 -82
  256. package/dist/shell/app-directory.d.ts +0 -542
  257. package/dist/shell/app-directory.js +0 -199
  258. package/dist/shell/browser-actions.d.ts +0 -7
  259. package/dist/shell/browser-actions.js +0 -56
  260. package/dist/shell/command-host.d.ts +0 -112
  261. package/dist/shell/command-host.js +0 -502
  262. package/dist/shell/commands.d.ts +0 -25
  263. package/dist/shell/commands.js +0 -78
  264. package/dist/shell/index.d.ts +0 -8
  265. package/dist/shell/index.js +0 -8
  266. package/dist/shell/keys.d.ts +0 -41
  267. package/dist/shell/keys.js +0 -134
  268. package/dist/shell/shell-module.d.ts +0 -55
  269. package/dist/shell/shell-module.js +0 -86
  270. package/dist/shell/window-manager.d.ts +0 -124
  271. package/dist/shell/window-manager.js +0 -711
  272. package/dist/shell/workbench-contract.d.ts +0 -68
  273. package/dist/shell/workbench-directory.d.ts +0 -332
  274. package/dist/shell/workbench-directory.js +0 -35
  275. package/dist/shell/workbench-host-types.d.ts +0 -96
  276. package/dist/shell/workbench-host-types.js +0 -1
  277. package/dist/shell/workbench-host.d.ts +0 -34
  278. package/dist/shell/workbench-host.js +0 -347
  279. package/dist/shell/workbench-model.d.ts +0 -192
  280. package/dist/shell/workbench-model.js +0 -53
  281. package/dist/shell/workbench.d.ts +0 -4
  282. package/dist/shell/workbench.js +0 -2
  283. package/docs/api/shell/app-directory.md +0 -599
  284. package/docs/api/shell/command-host.md +0 -224
  285. package/docs/api/shell/commands.md +0 -197
  286. package/docs/api/shell/keys.md +0 -183
  287. package/docs/api/shell/shell-module.md +0 -204
  288. package/docs/api/shell/window-manager.md +0 -267
  289. package/docs/api/shell/workbench-directory.md +0 -119
  290. package/docs/api/shell/workbench.md +0 -205
  291. package/docs/api/shell.md +0 -1915
  292. /package/dist/{shell/workbench-contract.js → page/boot-host.d.ts} +0 -0
@@ -37,8 +37,8 @@ export function createStandaloneWorkflowTriggerHost(options) {
37
37
  errors: standaloneTriggerErrors,
38
38
  runs: {
39
39
  ...runs,
40
- async startCachedGraph(binding, request) {
41
- const started = await runs.startCachedGraph(binding, request);
40
+ async startCachedGraph(binding, request, admission) {
41
+ const started = await runs.startCachedGraph(binding, request, admission);
42
42
  // A replay re-records the same caller after a lost reply.
43
43
  if (started.kind === "started" || started.kind === "replay")
44
44
  options.recordCaller(started.runId, binding.armedBy, binding.computerId);
@@ -0,0 +1,22 @@
1
+ import { Hono } from "hono";
2
+ import type { OysterEnv, OysterHost } from "../host.js";
3
+ import type { StandaloneWorkflowEnv } from "./workflows.js";
4
+ /** The root resolves the origin before this unauthenticated signed-delivery path. */
5
+ export declare function standaloneWorkflowWebhookRoutes(env: Pick<StandaloneWorkflowEnv, "WORKFLOW_RUNS">, hostFor: (request: Request) => Promise<Pick<OysterHost, "installations"> | null>): import("hono/hono-base").HonoBase<import("hono/types").BlankEnv, {
6
+ "/api/installations/:installationId/workflows/webhooks/:bindingId": {
7
+ $all: {
8
+ input: {
9
+ param: {
10
+ installationId: string;
11
+ } & {
12
+ bindingId: string;
13
+ };
14
+ };
15
+ output: {};
16
+ outputFormat: string;
17
+ status: import("hono/utils/http-status").StatusCode;
18
+ };
19
+ };
20
+ }, "/", "/api/installations/:installationId/workflows/webhooks/:bindingId">;
21
+ /** Mounted only under the root's authenticated owner routes; the DO re-admits. */
22
+ export declare function standaloneWorkflowWebhookControls(env: Pick<StandaloneWorkflowEnv, "WORKFLOW_RUNS">, hostFor: () => Promise<Pick<OysterHost, "installations">>): Hono<OysterEnv>;
@@ -0,0 +1,39 @@
1
+ import { Hono } from "hono";
2
+ import { bodyLimit } from "hono/body-limit";
3
+ import * as Schema from "effect/Schema";
4
+ import { workflowWebhookCommandSchema } from "../webhooks.js";
5
+ const refused = () => Response.json({ error: "refused" }, { status: 403, headers: { "cache-control": "no-store" } });
6
+ /** Address an existing library, never use an opaque binding ID as a DO name. */
7
+ async function libraryExists(host, installationId) {
8
+ const installation = await host.installations.get(installationId);
9
+ return (installation?.status === "enabled" &&
10
+ installation.authority.approvedGrants.some((grant) => grant.capability === "workflow.run"));
11
+ }
12
+ /** The root resolves the origin before this unauthenticated signed-delivery path. */
13
+ export function standaloneWorkflowWebhookRoutes(env, hostFor) {
14
+ return new Hono().all("/api/installations/:installationId/workflows/webhooks/:bindingId", async (context) => {
15
+ const host = await hostFor(context.req.raw);
16
+ const installationId = context.req.param("installationId");
17
+ if (host === null || !(await libraryExists(host, installationId)))
18
+ return refused();
19
+ const address = new URL(context.req.url);
20
+ address.pathname = `/webhooks/${encodeURIComponent(context.req.param("bindingId"))}`;
21
+ address.search = "";
22
+ return env.WORKFLOW_RUNS.getByName(installationId).fetch(new Request(address, context.req.raw));
23
+ });
24
+ }
25
+ /** Mounted only under the root's authenticated owner routes; the DO re-admits. */
26
+ export function standaloneWorkflowWebhookControls(env, hostFor) {
27
+ return new Hono().post("/api/installations/:installationId/workflows/webhooks", bodyLimit({ maxSize: 64 * 1024, onError: refused }), async (context) => {
28
+ const installationId = context.req.param("installationId");
29
+ if (!(await libraryExists(await hostFor(), installationId)))
30
+ return refused();
31
+ const body = Schema.decodeUnknownResult(Schema.fromJsonString(Schema.Json))(await context.req.text());
32
+ if (body._tag === "Failure")
33
+ return refused();
34
+ const command = workflowWebhookCommandSchema.safeParse(body.success);
35
+ if (!command.success)
36
+ return refused();
37
+ return env.WORKFLOW_RUNS.getByName(installationId).webhookControl(context.get("principal"), installationId, command.data);
38
+ });
39
+ }
@@ -6,16 +6,25 @@ import { type GraphReview, type GraphParams, type NodeCall, type NodeEvent, type
6
6
  import { type StandaloneTenancyEnv } from "./tenancy.js";
7
7
  import type { AppEventFact } from "@fungi.computer/puffball/app-event-facts";
8
8
  import type { InvocationFacts } from "../invocation.js";
9
+ import type { OysterPrincipal } from "../host.js";
9
10
  import type { OysterGitWorkerEnv, OysterGitWorkerHost } from "../workers-git.js";
10
11
  import { type TenantScope } from "../tenant.js";
11
12
  import type { GitWriter, RepositoryRef } from "@fungi.computer/agar/git";
12
- import type { WorkflowGitPassResult } from "@fungi.computer/agar/computer-contracts";
13
+ import { type WorkflowGitCredential, type WorkflowGitPassGrant } from "@fungi.computer/braid/runtime";
13
14
  import { reviewKey, type EventDisarmInput, type WorkflowGitPassRequest, type TriggerArmTarget, type ScheduleDisarmInput } from "./workflow-binding.js";
14
15
  import type { StandaloneComputerEnv } from "./computer.js";
15
16
  import type { StandaloneAgentsEnv } from "./agents.js";
16
17
  import type { OysterMediaEnv } from "./media.js";
18
+ import { createWorkflowWebhooks } from "../webhooks.js";
17
19
  export type StandaloneWorkflowEnv = OysterGitWorkerEnv & StandaloneComputerEnv & StandaloneAgentsEnv & OysterMediaEnv & StandaloneTenancyEnv & GraphWorkflowBindings & {
18
20
  WORKFLOW_RUNS: DurableObjectNamespace<StandaloneWorkflowRunsBase>;
21
+ WORKFLOW_WEBHOOK_HOST_RATE?: Pick<RateLimit, "limit">;
22
+ WORKFLOW_WEBHOOK_BINDING_RATE?: Pick<RateLimit, "limit">;
23
+ /** Trusted configuration; absent admission closes the new webhook surface. */
24
+ WORKFLOW_WEBHOOK_POLICY?: {
25
+ limits: Parameters<typeof createWorkflowWebhooks>[0]["limits"];
26
+ concurrency: Parameters<typeof createWorkflowWebhooks>[0]["abuse"]["concurrency"];
27
+ };
19
28
  };
20
29
  /** Schedule time and the native alarm instant that delivers a due time. */
21
30
  export type StandaloneScheduleClock = Readonly<{
@@ -24,23 +33,31 @@ export type StandaloneScheduleClock = Readonly<{
24
33
  }>;
25
34
  /** SQLite and the native Workflow binding belong to this standalone host; its root supplies `hostFor`. */
26
35
  export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneWorkflowEnv = StandaloneWorkflowEnv> extends DurableObject<Env> {
36
+ #private;
27
37
  private readonly composed;
28
38
  /** Schedule time and its native alarm instant; production is the wall clock. */
29
39
  protected readonly scheduleClock: StandaloneScheduleClock;
30
40
  private readonly owner;
31
41
  /** The deployable root's host for one tenant; Workflow runs use the default tenant. */
32
- protected abstract hostFor(scope: TenantScope): OysterGitWorkerHost;
42
+ protected abstract hostFor(scope: TenantScope): Promise<OysterGitWorkerHost>;
33
43
  constructor(ctx: DurableObjectState, env: Env);
34
44
  /** Record the library this object serves; another name is a revocation. */
35
45
  private nameLibrary;
36
46
  /**
37
- * Mint (or renew) the Git pass for the Git step a node frame is executing.
38
- * Null when this library dispatched no such step; a step that does not match
39
- * the frame's attested Workflow, member and Computer is a revocation.
47
+ * Admit the Git step a node frame is executing: its public grant, never a
48
+ * credential. Null when this library dispatched no such step; a step that
49
+ * does not match the frame's attested Workflow, member and Computer is a
50
+ * revocation. Only NEW native admission then issues, through issueWorkflowGit.
40
51
  */
41
- openWorkflowGitPass(raw: WorkflowGitPassRequest): Promise<WorkflowGitPassResult | null>;
42
- /** The tenant Git door's per-request admission of a presented pass. */
43
- admitWorkflowGitPass(passId: string, repository: RepositoryRef, scope: "read" | "write"): Promise<Extract<GitWriter, {
52
+ admitWorkflowGit(raw: WorkflowGitPassRequest): Promise<WorkflowGitPassGrant | null>;
53
+ /** One fresh credential for a NEW native invocation of an admitted step. */
54
+ issueWorkflowGit(invocationId: string, grant: WorkflowGitPassGrant): Promise<WorkflowGitCredential>;
55
+ /** A live native replay extends its lease; it never issues another. */
56
+ renewWorkflowGit(invocationId: string, grant: WorkflowGitPassGrant): Promise<void>;
57
+ /** Close an invocation's credential, even before its issue arrives. */
58
+ closeWorkflowGit(invocationId: string, grant: WorkflowGitPassGrant): Promise<void>;
59
+ /** The tenant Git door's per-request admission of a presented bearer. */
60
+ admitWorkflowGitPass(bearer: string, repository: RepositoryRef, scope: "read" | "write"): Promise<Extract<GitWriter, {
44
61
  kind: "actor";
45
62
  }> | null>;
46
63
  /** A finished run's passes and recorded Git steps end with it. */
@@ -60,7 +77,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
60
77
  } | {
61
78
  kind: "refused";
62
79
  reason: string;
63
- readonly error?: undefined;
80
+ error?: undefined;
64
81
  }>;
65
82
  disarmSchedule(facts: InvocationFacts, input: ScheduleDisarmInput): Promise<{
66
83
  kind: "not_found";
@@ -75,13 +92,14 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
75
92
  } | {
76
93
  schedules: {
77
94
  scheduleId: string;
95
+ installationId: string;
78
96
  workflowId: string;
79
97
  triggerId: string;
80
98
  nextDueAt: number;
81
99
  state: "active" | "finished" | "paused" | "cancelled";
82
100
  lastError: string | null;
83
101
  }[];
84
- readonly error?: undefined;
102
+ error?: undefined;
85
103
  }>;
86
104
  armEventTrigger(facts: InvocationFacts, input: TriggerArmTarget): Promise<{
87
105
  kind: "armed";
@@ -93,7 +111,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
93
111
  } | {
94
112
  kind: "refused";
95
113
  reason: string;
96
- readonly error?: undefined;
114
+ error?: undefined;
97
115
  }>;
98
116
  disarmEventTrigger(facts: InvocationFacts, input: EventDisarmInput): Promise<{
99
117
  kind: "disarmed";
@@ -115,7 +133,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
115
133
  state: "active" | "paused";
116
134
  lastError: string | null;
117
135
  }[];
118
- readonly error?: undefined;
136
+ error?: undefined;
119
137
  }>;
120
138
  /** Up to 50 runs of this library, newest first; this host has no per-member rule. */
121
139
  runs(facts: InvocationFacts, input: {
@@ -125,7 +143,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
125
143
  runId: string;
126
144
  workflowId: string | undefined;
127
145
  commit: string | undefined;
128
- source: "manual" | "agent" | "key" | "event" | "schedule";
146
+ source: "key" | "manual" | "agent" | "event" | "schedule";
129
147
  initiatedBy: Readonly<{
130
148
  kind: "member";
131
149
  memberId: string;
@@ -144,7 +162,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
144
162
  runId: string;
145
163
  workflowId: string | undefined;
146
164
  commit: string | undefined;
147
- source: "manual" | "agent" | "key" | "event" | "schedule";
165
+ source: "key" | "manual" | "agent" | "event" | "schedule";
148
166
  initiatedBy: Readonly<{
149
167
  kind: "member";
150
168
  memberId: string;
@@ -162,6 +180,10 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
162
180
  }>;
163
181
  /** Native alarm delivery: fire every due schedule of this library. */
164
182
  alarm(): Promise<void>;
183
+ /** Signed traffic uses the native fetch interface; no sender principal is accepted. */
184
+ fetch(request: Request): Promise<Response>;
185
+ /** Root-authenticated owner RPC; command data cannot nominate an actor or pin. */
186
+ webhookControl(principal: OysterPrincipal, installationId: string, raw: unknown): Promise<Response>;
165
187
  /**
166
188
  * The emitting App's Instance delivers each accepted event here. The
167
189
  * emitter's live Release must declare the event and its payload schema
@@ -230,10 +252,10 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
230
252
  runId?: undefined;
231
253
  planDigest?: undefined;
232
254
  } | {
233
- kind: "conflict" | "replay" | "started";
255
+ kind: "replay" | "conflict" | "started";
234
256
  runId: string;
235
257
  planDigest: string;
236
- readonly error?: undefined;
258
+ error?: undefined;
237
259
  }>;
238
260
  loadRun(installationId: string, runId: string): Promise<{
239
261
  plan: {
@@ -249,13 +271,13 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
249
271
  readonly input: {
250
272
  readonly [x: string]: S.Json;
251
273
  };
252
- readonly title: string;
253
274
  readonly apps: {
254
275
  readonly [x: string]: {
255
276
  readonly appId: string;
256
277
  readonly role?: string | undefined;
257
278
  };
258
279
  };
280
+ readonly title: string;
259
281
  readonly nodes: readonly ({
260
282
  readonly id: string;
261
283
  readonly kind: "code";
@@ -273,8 +295,8 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
273
295
  readonly values: {
274
296
  readonly [x: string]: import("@fungi.computer/braid").Mapping;
275
297
  };
276
- readonly method: string;
277
298
  readonly kind: "app";
299
+ readonly method: string;
278
300
  readonly id: string;
279
301
  readonly app: string;
280
302
  readonly methodDigest: string;
@@ -293,17 +315,19 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
293
315
  } | {
294
316
  readonly kind: "review";
295
317
  readonly id: string;
318
+ readonly timeout: number;
296
319
  readonly title: string;
297
320
  readonly reviewers: "runner" | "owners";
298
321
  readonly show: readonly {
299
322
  readonly node: string;
300
323
  readonly port: string;
301
324
  }[];
302
- readonly timeout: number;
303
325
  readonly choices?: readonly {
304
- readonly id: string;
305
326
  readonly label: string;
327
+ readonly id: string;
328
+ readonly description?: string | undefined;
306
329
  }[] | undefined;
330
+ readonly detail?: string | undefined;
307
331
  } | {
308
332
  readonly id: string;
309
333
  readonly kind: "condition";
@@ -368,8 +392,8 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
368
392
  readonly values: {
369
393
  readonly [x: string]: import("@fungi.computer/braid").Mapping;
370
394
  };
371
- readonly method: string;
372
395
  readonly kind: "app";
396
+ readonly method: string;
373
397
  readonly id: string;
374
398
  readonly app: string;
375
399
  readonly methodDigest: string;
@@ -388,17 +412,19 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
388
412
  } | {
389
413
  readonly kind: "review";
390
414
  readonly id: string;
415
+ readonly timeout: number;
391
416
  readonly title: string;
392
417
  readonly reviewers: "runner" | "owners";
393
418
  readonly show: readonly {
394
419
  readonly node: string;
395
420
  readonly port: string;
396
421
  }[];
397
- readonly timeout: number;
398
422
  readonly choices?: readonly {
399
- readonly id: string;
400
423
  readonly label: string;
424
+ readonly id: string;
425
+ readonly description?: string | undefined;
401
426
  }[] | undefined;
427
+ readonly detail?: string | undefined;
402
428
  } | {
403
429
  readonly id: string;
404
430
  readonly kind: "condition";
@@ -451,10 +477,10 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
451
477
  readonly triggers?: readonly ({
452
478
  readonly id: string;
453
479
  readonly on: "webhook";
454
- readonly when?: import("@fungi.computer/braid").Predicate | undefined;
455
480
  readonly input?: {
456
481
  readonly [x: string]: import("@fungi.computer/braid").Mapping;
457
482
  } | undefined;
483
+ readonly when?: import("@fungi.computer/braid").Predicate | undefined;
458
484
  readonly title?: string | undefined;
459
485
  } | {
460
486
  readonly id: string;
@@ -469,15 +495,15 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
469
495
  readonly title?: string | undefined;
470
496
  } | {
471
497
  readonly id: string;
472
- readonly event: string;
473
498
  readonly on: "event";
499
+ readonly event: string;
474
500
  readonly app: string;
475
501
  readonly eventDigest: string;
476
- readonly repository?: import("@fungi.computer/braid").Mapping | undefined;
477
- readonly when?: import("@fungi.computer/braid").Predicate | undefined;
478
502
  readonly input?: {
479
503
  readonly [x: string]: import("@fungi.computer/braid").Mapping;
480
504
  } | undefined;
505
+ readonly when?: import("@fungi.computer/braid").Predicate | undefined;
506
+ readonly repository?: import("@fungi.computer/braid").Mapping | undefined;
481
507
  readonly title?: string | undefined;
482
508
  })[] | undefined;
483
509
  };
@@ -485,14 +511,14 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
485
511
  readonly [x: string]: {
486
512
  readonly methods: {
487
513
  readonly [x: string]: {
488
- readonly digest: string;
489
514
  readonly output: {
490
515
  readonly [x: string]: S.Json;
491
516
  };
492
517
  readonly input: {
493
518
  readonly [x: string]: S.Json;
494
519
  };
495
- readonly approval: "none" | "queue" | "simulate";
520
+ readonly digest: string;
521
+ readonly approval: "queue" | "none" | "simulate";
496
522
  readonly description: string;
497
523
  readonly effect: "read" | "write" | "external";
498
524
  readonly requires: readonly string[];
@@ -520,15 +546,15 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
520
546
  };
521
547
  readonly estimatedSteps: number;
522
548
  readonly requiredBindings: readonly {
523
- readonly method: string;
524
- readonly installationId: string;
525
549
  readonly output: {
526
550
  readonly [x: string]: S.Json;
527
551
  };
528
552
  readonly input: {
529
553
  readonly [x: string]: S.Json;
530
554
  };
531
- readonly approval: "none" | "queue" | "simulate";
555
+ readonly method: string;
556
+ readonly installationId: string;
557
+ readonly approval: "queue" | "none" | "simulate";
532
558
  readonly description: string;
533
559
  readonly effect: "read" | "write" | "external";
534
560
  readonly requires: readonly string[];
@@ -547,9 +573,29 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
547
573
  readonly code: "invalid_input" | "revoked" | "not_granted" | "invalid_output" | "member_revoked" | "workflow_run_revoked" | "computer_revoked" | "budget_exhausted" | "unknown_method";
548
574
  }>;
549
575
  dispatch(call: NodeCall): Promise<{
550
- readonly kind: "complete";
551
576
  readonly output: S.Json;
577
+ readonly kind: "complete";
552
578
  readonly costMilliunits: number;
579
+ readonly row?: {
580
+ readonly id: string;
581
+ readonly title: string;
582
+ readonly status?: {
583
+ readonly label: string;
584
+ readonly tone: "success" | "error" | "info" | "warning" | "neutral" | "primary" | "secondary" | "accent";
585
+ } | undefined;
586
+ readonly media?: {
587
+ readonly path: string;
588
+ readonly format: "fungi:image" | "fungi:video";
589
+ } | undefined;
590
+ readonly open?: {
591
+ readonly params: readonly {
592
+ readonly key: string;
593
+ readonly value: string;
594
+ }[];
595
+ } | undefined;
596
+ readonly detail?: string | undefined;
597
+ readonly tone?: "error" | "running" | "settled" | "attention" | "muted" | undefined;
598
+ } | undefined;
553
599
  } | {
554
600
  readonly kind: "refused";
555
601
  readonly code: "invalid_input" | "revoked" | "not_granted" | "invalid_output" | "member_revoked" | "workflow_run_revoked" | "computer_revoked" | "budget_exhausted" | "unknown_method";
@@ -576,37 +622,53 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
576
622
  status(facts: InvocationFacts, raw: {
577
623
  runId: string;
578
624
  }): Promise<{
579
- error: string;
580
- runId?: undefined;
581
- planDigest?: undefined;
582
- title?: undefined;
583
- outcome?: undefined;
584
- events?: undefined;
585
- reviews?: undefined;
586
- status?: undefined;
587
- output?: undefined;
588
- } | {
589
625
  runId: string;
590
626
  planDigest: string;
591
627
  title: string;
592
628
  outcome: "terminal" | "cancelled" | "active" | null;
593
629
  events: readonly {
594
- readonly state: "running" | "queued" | "failed" | "complete" | "waiting" | "skipped";
595
630
  readonly runId: string;
596
631
  readonly nodeId: string;
632
+ readonly state: "skipped" | "queued" | "running" | "failed" | "complete" | "waiting";
597
633
  readonly iteration: string;
598
634
  readonly attempt: number;
599
635
  readonly output?: {
600
636
  readonly [x: string]: S.Json;
601
637
  } | undefined;
602
- readonly costMilliunits?: number | undefined;
638
+ readonly refusal?: string | undefined;
639
+ readonly row?: {
640
+ readonly id: string;
641
+ readonly title: string;
642
+ readonly status?: {
643
+ readonly label: string;
644
+ readonly tone: "success" | "error" | "info" | "warning" | "neutral" | "primary" | "secondary" | "accent";
645
+ } | undefined;
646
+ readonly media?: {
647
+ readonly path: string;
648
+ readonly format: "fungi:image" | "fungi:video";
649
+ } | undefined;
650
+ readonly open?: {
651
+ readonly params: readonly {
652
+ readonly key: string;
653
+ readonly value: string;
654
+ }[];
655
+ } | undefined;
656
+ readonly detail?: string | undefined;
657
+ readonly tone?: "error" | "running" | "settled" | "attention" | "muted" | undefined;
658
+ } | undefined;
603
659
  readonly graphId?: string | undefined;
604
660
  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;
605
667
  readonly recordedAt?: number | undefined;
606
668
  readonly durationMs?: number | undefined;
669
+ readonly costMilliunits?: number | undefined;
607
670
  readonly outputDigest?: string | undefined;
608
671
  readonly errorMessage?: string | undefined;
609
- readonly refusal?: string | undefined;
610
672
  }[];
611
673
  reviews: {
612
674
  review: {
@@ -619,28 +681,119 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
619
681
  readonly iteration: string;
620
682
  readonly instanceId: string;
621
683
  readonly eventType: string;
684
+ readonly position?: readonly {
685
+ readonly node: string;
686
+ readonly loop: "repeat" | "map";
687
+ readonly index: number;
688
+ readonly count: number;
689
+ }[];
622
690
  readonly choices?: readonly string[];
623
691
  };
624
692
  status: "closed" | "pending" | "answered" | "delivered" | "timed_out";
625
693
  openedAt: number;
626
694
  expiresAt: number;
627
695
  }[];
628
- status: "unknown" | "running" | "queued" | "errored" | "complete" | "waiting" | "paused" | "terminated" | "waitingForPause";
696
+ status: "unknown" | "paused" | "queued" | "running" | "errored" | "terminated" | "complete" | "waiting" | "waitingForPause";
629
697
  output: {} | null;
630
698
  error: {
631
699
  name: string;
632
700
  message: string;
633
701
  } | null;
634
- }>;
702
+ } | {
703
+ error: string;
704
+ } | null>;
705
+ private runStatus;
635
706
  cancel(facts: InvocationFacts, raw: {
636
707
  runId: string;
637
708
  }): Promise<{
638
709
  kind: string;
639
- reason: string;
640
710
  } | {
641
711
  kind: string;
642
- reason?: undefined;
712
+ reason: string;
643
713
  }>;
714
+ /** Host-only MCP control reopens the configured owner's authority on every call. */
715
+ control(principal: OysterPrincipal, operation: "status" | "cancel", runId: string): Promise<{
716
+ runId: string;
717
+ planDigest: string;
718
+ title: string;
719
+ outcome: "terminal" | "cancelled" | "active" | null;
720
+ events: readonly {
721
+ readonly runId: string;
722
+ readonly nodeId: string;
723
+ readonly state: "skipped" | "queued" | "running" | "failed" | "complete" | "waiting";
724
+ readonly iteration: string;
725
+ readonly attempt: number;
726
+ readonly output?: {
727
+ readonly [x: string]: S.Json;
728
+ } | undefined;
729
+ readonly refusal?: string | undefined;
730
+ readonly row?: {
731
+ readonly id: string;
732
+ readonly title: string;
733
+ readonly status?: {
734
+ readonly label: string;
735
+ readonly tone: "success" | "error" | "info" | "warning" | "neutral" | "primary" | "secondary" | "accent";
736
+ } | undefined;
737
+ readonly media?: {
738
+ readonly path: string;
739
+ readonly format: "fungi:image" | "fungi:video";
740
+ } | undefined;
741
+ readonly open?: {
742
+ readonly params: readonly {
743
+ readonly key: string;
744
+ readonly value: string;
745
+ }[];
746
+ } | undefined;
747
+ readonly detail?: string | undefined;
748
+ readonly tone?: "error" | "running" | "settled" | "attention" | "muted" | undefined;
749
+ } | undefined;
750
+ readonly graphId?: string | undefined;
751
+ 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
+ readonly recordedAt?: number | undefined;
759
+ readonly durationMs?: number | undefined;
760
+ readonly costMilliunits?: number | undefined;
761
+ readonly outputDigest?: string | undefined;
762
+ readonly errorMessage?: string | undefined;
763
+ }[];
764
+ reviews: {
765
+ review: {
766
+ readonly show: readonly S.Json[];
767
+ readonly title: string;
768
+ readonly timeout: number;
769
+ readonly runId: string;
770
+ readonly nodeId: string;
771
+ readonly reviewers: "runner" | "owners";
772
+ readonly iteration: string;
773
+ readonly instanceId: string;
774
+ readonly eventType: string;
775
+ readonly position?: readonly {
776
+ readonly node: string;
777
+ readonly loop: "repeat" | "map";
778
+ readonly index: number;
779
+ readonly count: number;
780
+ }[];
781
+ readonly choices?: readonly string[];
782
+ };
783
+ status: "closed" | "pending" | "answered" | "delivered" | "timed_out";
784
+ openedAt: number;
785
+ expiresAt: number;
786
+ }[];
787
+ status: "unknown" | "paused" | "queued" | "running" | "errored" | "terminated" | "complete" | "waiting" | "waitingForPause";
788
+ output: {} | null;
789
+ error: {
790
+ name: string;
791
+ message: string;
792
+ } | null;
793
+ } | {
794
+ kind: string;
795
+ } | null>;
796
+ private cancelRun;
644
797
  }
645
798
  /** The SAME extracted interpreter as Hub, with this host's owned ports. */
646
799
  export declare class StandaloneGraphWorkflow extends GraphWorkflow<StandaloneWorkflowEnv> {