@fungi.computer/oyster 0.5.0 → 0.7.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.
- package/README.md +155 -63
- package/dist/agent-archive-projection.d.ts +8 -0
- package/dist/agent-archive-projection.js +49 -0
- package/dist/agent-schedules.d.ts +50 -0
- package/dist/agent-schedules.js +17 -0
- package/dist/agents.d.ts +35 -14
- package/dist/agents.js +97 -144
- package/dist/app-builds.d.ts +7 -2
- package/dist/app-builds.js +19 -2
- package/dist/approval-capability.d.ts +1 -1
- package/dist/approval-capability.js +11 -16
- package/dist/approval-home.d.ts +2 -1
- package/dist/approval-home.js +5 -3
- package/dist/apps/catalog.js +1 -1
- package/dist/apps/gate.d.ts +4 -7
- package/dist/apps/gate.js +14 -29
- package/dist/apps/index.d.ts +1 -1
- package/dist/apps/installation.d.ts +4 -42
- package/dist/apps/installation.js +7 -75
- package/dist/apps/operations.js +0 -10
- package/dist/apps/permissions.d.ts +18 -8
- package/dist/apps/permissions.js +7 -1
- package/dist/auth.js +9 -1
- package/dist/authorization.d.ts +307 -0
- package/dist/authorization.js +542 -0
- package/dist/boot-host-script.js +1 -1
- package/dist/build/build-jobs.d.ts +2 -2
- package/dist/build/candidate-builder.d.ts +2 -0
- package/dist/build/candidate-builder.js +5 -1
- package/dist/build/candidate-cli.js +3 -0
- package/dist/build/candidate-cli.mjs +67 -22
- package/dist/build/job-log.d.ts +23 -0
- package/dist/build/job-log.js +88 -0
- package/dist/build/local-build.d.ts +2 -0
- package/dist/build/local-build.js +11 -9
- package/dist/channels/binding.d.ts +8 -1
- package/dist/channels/binding.js +12 -0
- package/dist/channels/conversations.d.ts +16 -5
- package/dist/channels/visitor-channel.d.ts +53 -0
- package/dist/channels/visitor-channel.js +124 -0
- package/dist/channels/visitor-edge.d.ts +115 -0
- package/dist/channels/visitor-edge.js +582 -0
- package/dist/channels/visitor-request.d.ts +7 -0
- package/dist/channels/visitor-request.js +17 -0
- package/dist/channels/visitor-stream-slots.d.ts +2 -0
- package/dist/channels/visitor-stream-slots.js +33 -0
- package/dist/channels/visitors.d.ts +47 -0
- package/dist/channels/visitors.js +181 -0
- package/dist/cloudflare.d.ts +11 -2
- package/dist/cloudflare.js +27 -1
- package/dist/{page/computer-target.d.ts → computer-target.d.ts} +2 -0
- package/dist/{page/computer-target.js → computer-target.js} +3 -1
- package/dist/files.js +9 -8
- package/dist/git-admission.d.ts +3 -3
- package/dist/git-admission.js +4 -6
- package/dist/git-door.d.ts +8 -7
- package/dist/git-door.js +18 -17
- package/dist/git.d.ts +1 -1
- package/dist/host.d.ts +38 -42
- package/dist/host.js +182 -239
- package/dist/installation-execution.js +10 -5
- package/dist/installation-operations.d.ts +4 -180
- package/dist/installation-operations.js +1 -5
- package/dist/installation-store-generation.d.ts +4 -1
- package/dist/installation-store-generation.js +59 -6
- package/dist/internal/delivery.js +0 -1
- package/dist/internal/host-gate.d.ts +9 -6
- package/dist/internal/host-gate.js +19 -25
- package/dist/internal/invocation-timing.d.ts +16 -0
- package/dist/internal/invocation-timing.js +23 -0
- package/dist/internal/registry-installations.js +1 -0
- package/dist/invocation.d.ts +19 -11
- package/dist/invocation.js +171 -96
- package/dist/keys.d.ts +2 -19
- package/dist/keys.js +1 -37
- package/dist/mcp.d.ts +15 -27
- package/dist/mcp.js +105 -155
- package/dist/page/agent-browser.d.ts +15 -0
- package/dist/page/agent-browser.js +162 -0
- package/dist/page/app-permissions-port.d.ts +3 -0
- package/dist/page/app-permissions-port.js +43 -0
- package/dist/page/app-permissions.d.ts +11 -0
- package/dist/page/app-permissions.js +296 -0
- package/dist/page/capabilities.js +1 -1
- package/dist/page/child-selection.d.ts +27 -0
- package/dist/page/child-selection.js +38 -0
- package/dist/page/isolated-page-theme.d.ts +2 -0
- package/dist/page/isolated-page-theme.js +11 -0
- package/dist/page/mount.d.ts +2 -13
- package/dist/page/mount.js +8 -94
- package/dist/page-script.d.ts +0 -3
- package/dist/page-script.js +3 -4
- package/dist/release.d.ts +13 -0
- package/dist/release.js +10 -0
- package/dist/request-origin.d.ts +4 -0
- package/dist/request-origin.js +10 -0
- package/dist/standalone/agent-archive-owner.d.ts +42 -0
- package/dist/standalone/agent-archive-owner.js +116 -0
- package/dist/standalone/agent-archive-schedules.d.ts +6 -0
- package/dist/standalone/agent-archive-schedules.js +76 -0
- package/dist/standalone/agent-archive.d.ts +31 -0
- package/dist/standalone/agent-archive.js +67 -0
- package/dist/standalone/agent-computers.d.ts +7 -6
- package/dist/standalone/agent-computers.js +4 -7
- package/dist/standalone/agent-mail.d.ts +2 -2
- package/dist/standalone/agents.d.ts +157 -20
- package/dist/standalone/agents.js +242 -38
- package/dist/standalone/app-builds-binding.js +1 -1
- package/dist/standalone/app-set.js +2 -54
- package/dist/standalone/app-source.d.ts +3 -4
- package/dist/standalone/app-source.js +12 -9
- package/dist/standalone/builds.d.ts +2 -14
- package/dist/standalone/builds.js +15 -13
- package/dist/standalone/computer-fleet.d.ts +4 -4
- package/dist/standalone/computer-fleet.js +20 -43
- package/dist/standalone/computer.d.ts +4 -3
- package/dist/standalone/computer.js +52 -53
- package/dist/standalone/dashboard-approval.d.ts +10 -0
- package/dist/standalone/dashboard-approval.js +66 -0
- package/dist/standalone/machine-link.d.ts +4 -221
- package/dist/standalone/machine-link.js +21 -15
- package/dist/standalone/media.d.ts +1 -0
- package/dist/standalone/media.js +20 -14
- package/dist/standalone/owner-routes.d.ts +16 -0
- package/dist/standalone/owner-routes.js +21 -0
- package/dist/standalone/permission-resources.d.ts +5 -0
- package/dist/standalone/permission-resources.js +31 -0
- package/dist/standalone/registry.d.ts +7 -0
- package/dist/standalone/registry.js +3 -0
- package/dist/standalone/tenancy.js +3 -1
- package/dist/standalone/worker-routes.d.ts +19 -0
- package/dist/standalone/worker-routes.js +9 -0
- package/dist/standalone/worker.d.ts +1 -1
- package/dist/standalone/worker.js +27 -35
- package/dist/standalone/workflow-binding.d.ts +8 -3
- package/dist/standalone/workflow-binding.js +14 -5
- package/dist/standalone/workflow-git-capture.js +2 -1
- package/dist/standalone/workflow-host.d.ts +8 -103
- package/dist/standalone/workflow-host.js +1 -1
- package/dist/standalone/workflow-node-capture.js +2 -2
- package/dist/standalone/workflow-root-authority.d.ts +1 -1
- package/dist/standalone/workflow-root-authority.js +1 -1
- package/dist/standalone/workflow-schedules.d.ts +14 -5
- package/dist/standalone/workflow-schedules.js +11 -5
- package/dist/standalone/workflow-webhooks.d.ts +4 -18
- package/dist/standalone/workflow-webhooks.js +5 -5
- package/dist/standalone/workflows.d.ts +36 -28
- package/dist/standalone/workflows.js +6 -3
- package/dist/storage-frame.d.ts +6 -6
- package/dist/testing/capabilities.d.ts +7 -6
- package/dist/testing/capabilities.js +3 -6
- package/dist/testing/installation.d.ts +0 -1
- package/dist/testing/installation.js +2 -5
- package/dist/turnstile.d.ts +27 -0
- package/dist/turnstile.js +51 -0
- package/dist/workers-git.d.ts +12 -4
- package/dist/workers-git.js +58 -36
- package/dist/workers.d.ts +9 -1
- package/dist/workers.js +59 -20
- package/dist/workflows.d.ts +2 -0
- package/dist/workflows.js +1 -0
- package/docs/api/README.md +7 -0
- package/docs/api/agent-schedules.md +175 -0
- package/docs/api/agents.md +34 -13
- package/docs/api/app-storage.md +1 -1
- package/docs/api/apps.md +323 -225
- package/docs/api/authorization.md +1300 -0
- package/docs/api/build-contract.md +2 -2
- package/docs/api/build.md +40 -37
- package/docs/api/cloudflare.md +27 -2
- package/docs/api/git.md +20 -11
- package/docs/api/host.md +80 -199
- package/docs/api/index.md +1 -1
- package/docs/api/invocation.md +15 -11
- package/docs/api/keys.md +1 -98
- package/docs/api/mcp.md +43 -40
- package/docs/api/modules.md +2 -0
- package/docs/api/page/mount.md +16 -19
- package/docs/api/workers-git.md +46 -12
- package/docs/api/workers.md +125 -235
- package/docs/site/agent-quickstart.mdx +6 -2
- package/examples/standalone/wrangler.celld.jsonc +66 -0
- package/package.json +64 -21
- package/dist/standalone/channel-session-door.d.ts +0 -4
- package/dist/standalone/channel-session-door.js +0 -42
|
@@ -5,10 +5,10 @@ import { GraphWorkflow, type GraphRunEnding, type GraphWorkflowBindings } from "
|
|
|
5
5
|
import { type GraphReview, type GraphParams, type NodeCall, type NodeEvent, type NodeDispatcher } from "@fungi.computer/braid";
|
|
6
6
|
import { type StandaloneTenancyEnv } from "./tenancy.js";
|
|
7
7
|
import type { AppEventFact } from "@fungi.computer/puffball/app-event-facts";
|
|
8
|
+
import { type ScheduleListInput } from "@fungi.computer/workflows-wire";
|
|
8
9
|
import type { InvocationFacts } from "../invocation.js";
|
|
9
|
-
import type { OysterPrincipal } from "../host.js";
|
|
10
10
|
import type { OysterGitWorkerEnv, OysterGitWorkerHost } from "../workers-git.js";
|
|
11
|
-
import { type TenantScope } from "../tenant.js";
|
|
11
|
+
import { type TenantPrincipal, type TenantScope } from "../tenant.js";
|
|
12
12
|
import type { GitWriter, RepositoryRef } from "@fungi.computer/agar/git";
|
|
13
13
|
import { type WorkflowGitCredential, type WorkflowGitPassGrant } from "@fungi.computer/braid/runtime";
|
|
14
14
|
import { reviewKey, type EventDisarmInput, type WorkflowGitPassRequest, type TriggerArmTarget, type ScheduleDisarmInput } from "./workflow-binding.js";
|
|
@@ -86,10 +86,16 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
86
86
|
} | {
|
|
87
87
|
error: string;
|
|
88
88
|
}>;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
pauseSchedule(facts: InvocationFacts, input: {
|
|
90
|
+
scheduleId: string;
|
|
91
|
+
}): Promise<{
|
|
92
|
+
kind: "not_found";
|
|
92
93
|
} | {
|
|
94
|
+
kind: "paused";
|
|
95
|
+
} | {
|
|
96
|
+
error: string;
|
|
97
|
+
}>;
|
|
98
|
+
schedules(facts: InvocationFacts, input: ScheduleListInput): Promise<{
|
|
93
99
|
schedules: {
|
|
94
100
|
scheduleId: string;
|
|
95
101
|
installationId: string;
|
|
@@ -99,7 +105,9 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
99
105
|
state: "active" | "finished" | "paused" | "cancelled";
|
|
100
106
|
lastError: string | null;
|
|
101
107
|
}[];
|
|
102
|
-
|
|
108
|
+
nextCursor: string | null;
|
|
109
|
+
} | {
|
|
110
|
+
error: string;
|
|
103
111
|
}>;
|
|
104
112
|
armEventTrigger(facts: InvocationFacts, input: TriggerArmTarget): Promise<{
|
|
105
113
|
kind: "armed";
|
|
@@ -143,7 +151,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
143
151
|
runId: string;
|
|
144
152
|
workflowId: string | undefined;
|
|
145
153
|
commit: string | undefined;
|
|
146
|
-
source: "key" | "manual" | "agent" | "
|
|
154
|
+
source: "key" | "manual" | "agent" | "schedule" | "event";
|
|
147
155
|
initiatedBy: Readonly<{
|
|
148
156
|
kind: "member";
|
|
149
157
|
memberId: string;
|
|
@@ -162,7 +170,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
162
170
|
runId: string;
|
|
163
171
|
workflowId: string | undefined;
|
|
164
172
|
commit: string | undefined;
|
|
165
|
-
source: "key" | "manual" | "agent" | "
|
|
173
|
+
source: "key" | "manual" | "agent" | "schedule" | "event";
|
|
166
174
|
initiatedBy: Readonly<{
|
|
167
175
|
kind: "member";
|
|
168
176
|
memberId: string;
|
|
@@ -183,7 +191,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
183
191
|
/** Signed traffic uses the native fetch interface; no sender principal is accepted. */
|
|
184
192
|
fetch(request: Request): Promise<Response>;
|
|
185
193
|
/** Root-authenticated owner RPC; command data cannot nominate an actor or pin. */
|
|
186
|
-
webhookControl(principal:
|
|
194
|
+
webhookControl(principal: TenantPrincipal, installationId: string, raw: unknown): Promise<Response>;
|
|
187
195
|
/**
|
|
188
196
|
* The emitting App's Instance delivers each accepted event here. The
|
|
189
197
|
* emitter's live Release must declare the event and its payload schema
|
|
@@ -271,13 +279,13 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
271
279
|
readonly input: {
|
|
272
280
|
readonly [x: string]: S.Json;
|
|
273
281
|
};
|
|
282
|
+
readonly title: string;
|
|
274
283
|
readonly apps: {
|
|
275
284
|
readonly [x: string]: {
|
|
276
285
|
readonly appId: string;
|
|
277
286
|
readonly role?: string | undefined;
|
|
278
287
|
};
|
|
279
288
|
};
|
|
280
|
-
readonly title: string;
|
|
281
289
|
readonly nodes: readonly ({
|
|
282
290
|
readonly id: string;
|
|
283
291
|
readonly kind: "code";
|
|
@@ -315,19 +323,19 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
315
323
|
} | {
|
|
316
324
|
readonly id: string;
|
|
317
325
|
readonly kind: "review";
|
|
318
|
-
readonly timeout: number;
|
|
319
326
|
readonly title: string;
|
|
327
|
+
readonly timeout: number;
|
|
320
328
|
readonly reviewers: "runner" | "owners";
|
|
321
329
|
readonly show: readonly {
|
|
322
330
|
readonly node: string;
|
|
323
331
|
readonly port: string;
|
|
324
332
|
}[];
|
|
333
|
+
readonly detail?: string | undefined;
|
|
325
334
|
readonly choices?: readonly {
|
|
326
335
|
readonly label: string;
|
|
327
336
|
readonly id: string;
|
|
328
337
|
readonly description?: string | undefined;
|
|
329
338
|
}[] | undefined;
|
|
330
|
-
readonly detail?: string | undefined;
|
|
331
339
|
} | {
|
|
332
340
|
readonly id: string;
|
|
333
341
|
readonly kind: "condition";
|
|
@@ -412,19 +420,19 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
412
420
|
} | {
|
|
413
421
|
readonly id: string;
|
|
414
422
|
readonly kind: "review";
|
|
415
|
-
readonly timeout: number;
|
|
416
423
|
readonly title: string;
|
|
424
|
+
readonly timeout: number;
|
|
417
425
|
readonly reviewers: "runner" | "owners";
|
|
418
426
|
readonly show: readonly {
|
|
419
427
|
readonly node: string;
|
|
420
428
|
readonly port: string;
|
|
421
429
|
}[];
|
|
430
|
+
readonly detail?: string | undefined;
|
|
422
431
|
readonly choices?: readonly {
|
|
423
432
|
readonly label: string;
|
|
424
433
|
readonly id: string;
|
|
425
434
|
readonly description?: string | undefined;
|
|
426
435
|
}[] | undefined;
|
|
427
|
-
readonly detail?: string | undefined;
|
|
428
436
|
} | {
|
|
429
437
|
readonly id: string;
|
|
430
438
|
readonly kind: "condition";
|
|
@@ -477,10 +485,10 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
477
485
|
readonly triggers?: readonly ({
|
|
478
486
|
readonly id: string;
|
|
479
487
|
readonly on: "webhook";
|
|
488
|
+
readonly when?: import("@fungi.computer/braid").Predicate | undefined;
|
|
480
489
|
readonly input?: {
|
|
481
490
|
readonly [x: string]: import("@fungi.computer/braid").Mapping;
|
|
482
491
|
} | undefined;
|
|
483
|
-
readonly when?: import("@fungi.computer/braid").Predicate | undefined;
|
|
484
492
|
readonly title?: string | undefined;
|
|
485
493
|
} | {
|
|
486
494
|
readonly id: string;
|
|
@@ -495,14 +503,14 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
495
503
|
readonly title?: string | undefined;
|
|
496
504
|
} | {
|
|
497
505
|
readonly id: string;
|
|
506
|
+
readonly app: string;
|
|
498
507
|
readonly on: "event";
|
|
499
508
|
readonly event: string;
|
|
500
|
-
readonly app: string;
|
|
501
509
|
readonly eventDigest: string;
|
|
510
|
+
readonly when?: import("@fungi.computer/braid").Predicate | undefined;
|
|
502
511
|
readonly input?: {
|
|
503
512
|
readonly [x: string]: import("@fungi.computer/braid").Mapping;
|
|
504
513
|
} | undefined;
|
|
505
|
-
readonly when?: import("@fungi.computer/braid").Predicate | undefined;
|
|
506
514
|
readonly repository?: import("@fungi.computer/braid").Mapping | undefined;
|
|
507
515
|
readonly title?: string | undefined;
|
|
508
516
|
})[] | undefined;
|
|
@@ -581,7 +589,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
581
589
|
readonly title: string;
|
|
582
590
|
readonly status?: {
|
|
583
591
|
readonly label: string;
|
|
584
|
-
readonly tone: "success" | "error" | "
|
|
592
|
+
readonly tone: "success" | "error" | "neutral" | "primary" | "secondary" | "accent" | "info" | "warning";
|
|
585
593
|
} | undefined;
|
|
586
594
|
readonly media?: {
|
|
587
595
|
readonly path: string;
|
|
@@ -594,7 +602,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
594
602
|
}[];
|
|
595
603
|
} | undefined;
|
|
596
604
|
readonly detail?: string | undefined;
|
|
597
|
-
readonly tone?: "error" | "
|
|
605
|
+
readonly tone?: "error" | "attention" | "running" | "settled" | "muted" | undefined;
|
|
598
606
|
} | undefined;
|
|
599
607
|
} | {
|
|
600
608
|
readonly kind: "refused";
|
|
@@ -628,8 +636,8 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
628
636
|
outcome: "active" | "terminal" | "cancelled" | null;
|
|
629
637
|
events: readonly {
|
|
630
638
|
readonly runId: string;
|
|
631
|
-
readonly state: "skipped" | "queued" | "running" | "failed" | "complete" | "waiting";
|
|
632
639
|
readonly nodeId: string;
|
|
640
|
+
readonly state: "failed" | "running" | "complete" | "skipped" | "queued" | "waiting";
|
|
633
641
|
readonly iteration: string;
|
|
634
642
|
readonly attempt: number;
|
|
635
643
|
readonly output?: {
|
|
@@ -647,7 +655,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
647
655
|
readonly title: string;
|
|
648
656
|
readonly status?: {
|
|
649
657
|
readonly label: string;
|
|
650
|
-
readonly tone: "success" | "error" | "
|
|
658
|
+
readonly tone: "success" | "error" | "neutral" | "primary" | "secondary" | "accent" | "info" | "warning";
|
|
651
659
|
} | undefined;
|
|
652
660
|
readonly media?: {
|
|
653
661
|
readonly path: string;
|
|
@@ -660,7 +668,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
660
668
|
}[];
|
|
661
669
|
} | undefined;
|
|
662
670
|
readonly detail?: string | undefined;
|
|
663
|
-
readonly tone?: "error" | "
|
|
671
|
+
readonly tone?: "error" | "attention" | "running" | "settled" | "muted" | undefined;
|
|
664
672
|
} | undefined;
|
|
665
673
|
readonly graphId?: string | undefined;
|
|
666
674
|
readonly poll?: number | undefined;
|
|
@@ -693,7 +701,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
693
701
|
openedAt: number;
|
|
694
702
|
expiresAt: number;
|
|
695
703
|
}[];
|
|
696
|
-
status: "unknown" | "
|
|
704
|
+
status: "unknown" | "running" | "complete" | "paused" | "queued" | "errored" | "terminated" | "waiting" | "waitingForPause";
|
|
697
705
|
output: {} | null;
|
|
698
706
|
error: {
|
|
699
707
|
name: string;
|
|
@@ -712,15 +720,15 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
712
720
|
reason: string;
|
|
713
721
|
}>;
|
|
714
722
|
/** Host-only MCP control reopens the configured owner's authority on every call. */
|
|
715
|
-
control(principal:
|
|
723
|
+
control(principal: TenantPrincipal, operation: "status" | "cancel", runId: string): Promise<{
|
|
716
724
|
runId: string;
|
|
717
725
|
planDigest: string;
|
|
718
726
|
title: string;
|
|
719
727
|
outcome: "active" | "terminal" | "cancelled" | null;
|
|
720
728
|
events: readonly {
|
|
721
729
|
readonly runId: string;
|
|
722
|
-
readonly state: "skipped" | "queued" | "running" | "failed" | "complete" | "waiting";
|
|
723
730
|
readonly nodeId: string;
|
|
731
|
+
readonly state: "failed" | "running" | "complete" | "skipped" | "queued" | "waiting";
|
|
724
732
|
readonly iteration: string;
|
|
725
733
|
readonly attempt: number;
|
|
726
734
|
readonly output?: {
|
|
@@ -738,7 +746,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
738
746
|
readonly title: string;
|
|
739
747
|
readonly status?: {
|
|
740
748
|
readonly label: string;
|
|
741
|
-
readonly tone: "success" | "error" | "
|
|
749
|
+
readonly tone: "success" | "error" | "neutral" | "primary" | "secondary" | "accent" | "info" | "warning";
|
|
742
750
|
} | undefined;
|
|
743
751
|
readonly media?: {
|
|
744
752
|
readonly path: string;
|
|
@@ -751,7 +759,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
751
759
|
}[];
|
|
752
760
|
} | undefined;
|
|
753
761
|
readonly detail?: string | undefined;
|
|
754
|
-
readonly tone?: "error" | "
|
|
762
|
+
readonly tone?: "error" | "attention" | "running" | "settled" | "muted" | undefined;
|
|
755
763
|
} | undefined;
|
|
756
764
|
readonly graphId?: string | undefined;
|
|
757
765
|
readonly poll?: number | undefined;
|
|
@@ -784,7 +792,7 @@ export declare abstract class StandaloneWorkflowRunsBase<Env extends StandaloneW
|
|
|
784
792
|
openedAt: number;
|
|
785
793
|
expiresAt: number;
|
|
786
794
|
}[];
|
|
787
|
-
status: "unknown" | "
|
|
795
|
+
status: "unknown" | "running" | "complete" | "paused" | "queued" | "errored" | "terminated" | "waiting" | "waitingForPause";
|
|
788
796
|
output: {} | null;
|
|
789
797
|
error: {
|
|
790
798
|
name: string;
|
|
@@ -11,7 +11,7 @@ import { createStandaloneWorkflowEvents, } from "./workflow-events.js";
|
|
|
11
11
|
import { createStandaloneWorkflowTriggerHost, standaloneTriggerErrors, } from "./workflow-trigger-host.js";
|
|
12
12
|
import { createWorkflowPublishedDefinitionPort, readPublishedWorkflow, } from "@fungi.computer/workflows-wire";
|
|
13
13
|
import { workflowAgentAuthority } from "../workflow-agent-authority.js";
|
|
14
|
-
import { defaultTenant, tenantScope } from "../tenant.js";
|
|
14
|
+
import { defaultTenant, tenantScope, } from "../tenant.js";
|
|
15
15
|
import { AppInstanceError } from "../index.js";
|
|
16
16
|
import { createWorkflowGitPasses, createWorkflowGitPassStore, workflowGitPassWriter, workflowRunReport, wireRunInitiator, } from "@fungi.computer/braid/runtime";
|
|
17
17
|
import { canonicalJson } from "@fungi.computer/braid";
|
|
@@ -403,8 +403,11 @@ export class StandaloneWorkflowRunsBase extends DurableObject {
|
|
|
403
403
|
async disarmSchedule(facts, input) {
|
|
404
404
|
return (await this.library(facts, "disarmSchedule")).schedules.disarm(facts, input);
|
|
405
405
|
}
|
|
406
|
-
async
|
|
407
|
-
return (await this.library(facts, "
|
|
406
|
+
async pauseSchedule(facts, input) {
|
|
407
|
+
return (await this.library(facts, "pauseSchedule")).schedules.pause(facts, input);
|
|
408
|
+
}
|
|
409
|
+
async schedules(facts, input) {
|
|
410
|
+
return (await this.library(facts, "schedules")).schedules.list(facts, input);
|
|
408
411
|
}
|
|
409
412
|
async armEventTrigger(facts, input) {
|
|
410
413
|
return (await this.library(facts, "armEventTrigger")).events.arm(facts, input);
|
package/dist/storage-frame.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const storageFrameMethods: {
|
|
|
8
8
|
readonly kind: "accepted";
|
|
9
9
|
readonly value: {
|
|
10
10
|
readonly value: Schema.Json;
|
|
11
|
-
readonly source: "
|
|
11
|
+
readonly source: "team" | "member" | "none";
|
|
12
12
|
readonly team: {
|
|
13
13
|
readonly value: Schema.Json;
|
|
14
14
|
readonly revision: number;
|
|
@@ -21,7 +21,7 @@ export declare const storageFrameMethods: {
|
|
|
21
21
|
};
|
|
22
22
|
} | {
|
|
23
23
|
readonly kind: "rejected";
|
|
24
|
-
readonly code: "unavailable" | "
|
|
24
|
+
readonly code: "unavailable" | "invalid" | "conflict" | "undeclared_key" | "scope_not_declared" | "owner_required" | "too_large" | "quota_exceeded";
|
|
25
25
|
};
|
|
26
26
|
requiredOperations: () => string[];
|
|
27
27
|
};
|
|
@@ -29,7 +29,7 @@ export declare const storageFrameMethods: {
|
|
|
29
29
|
decodeArgs: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => readonly [{
|
|
30
30
|
readonly value: Schema.Json;
|
|
31
31
|
readonly key: string;
|
|
32
|
-
readonly scope: "
|
|
32
|
+
readonly scope: "team" | "member";
|
|
33
33
|
readonly basedOn: number | null;
|
|
34
34
|
}];
|
|
35
35
|
decodeResult: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
@@ -39,14 +39,14 @@ export declare const storageFrameMethods: {
|
|
|
39
39
|
};
|
|
40
40
|
} | {
|
|
41
41
|
readonly kind: "rejected";
|
|
42
|
-
readonly code: "unavailable" | "
|
|
42
|
+
readonly code: "unavailable" | "invalid" | "conflict" | "undeclared_key" | "scope_not_declared" | "owner_required" | "too_large" | "quota_exceeded";
|
|
43
43
|
};
|
|
44
44
|
requiredOperations: () => string[];
|
|
45
45
|
};
|
|
46
46
|
reset: {
|
|
47
47
|
decodeArgs: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => readonly [{
|
|
48
48
|
readonly key: string;
|
|
49
|
-
readonly scope: "
|
|
49
|
+
readonly scope: "team" | "member";
|
|
50
50
|
readonly basedOn: number | null;
|
|
51
51
|
}];
|
|
52
52
|
decodeResult: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
@@ -56,7 +56,7 @@ export declare const storageFrameMethods: {
|
|
|
56
56
|
};
|
|
57
57
|
} | {
|
|
58
58
|
readonly kind: "rejected";
|
|
59
|
-
readonly code: "unavailable" | "
|
|
59
|
+
readonly code: "unavailable" | "invalid" | "conflict" | "undeclared_key" | "scope_not_declared" | "owner_required" | "too_large" | "quota_exceeded";
|
|
60
60
|
};
|
|
61
61
|
requiredOperations: () => string[];
|
|
62
62
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Hono } from "hono";
|
|
2
1
|
import { type AppCapabilityId } from "@fungi.computer/puffball/app";
|
|
3
2
|
import { type OysterAgents } from "../agents.js";
|
|
4
3
|
import type { LiveOysterKey } from "../keys.js";
|
|
@@ -16,16 +15,18 @@ export type CapabilityFixtureOptions = Readonly<{
|
|
|
16
15
|
fileSource?: FileSource;
|
|
17
16
|
/** `false` clears the owner's approval after install. */
|
|
18
17
|
admitted?: boolean;
|
|
19
|
-
/** Serve a public installation to an anonymous visitor. */
|
|
20
|
-
visitor?: boolean;
|
|
21
18
|
authenticate?: (request: Request) => Promise<OysterAuthResult>;
|
|
22
19
|
agents?: OysterAgents;
|
|
23
20
|
liveKey?: (keyId: string) => Promise<LiveOysterKey | null>;
|
|
24
21
|
}>;
|
|
25
22
|
/** One Oyster host with a single installation whose capability grants the options shape. */
|
|
26
23
|
export declare function capabilityFixture(options?: CapabilityFixtureOptions): Promise<{
|
|
27
|
-
app:
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
app: Readonly<{
|
|
25
|
+
fetch: (request: Request<unknown, CfProperties<unknown>>, env?: unknown, executionCtx?: import("hono").ExecutionContext | undefined) => Promise<Response>;
|
|
26
|
+
request: (input: string | Request<unknown, CfProperties<unknown>> | URL, requestInit?: RequestInit<CfProperties<unknown>> | undefined, Env?: unknown, executionCtx?: import("hono").ExecutionContext | undefined) => Promise<Response>;
|
|
27
|
+
servedPaths: () => readonly string[];
|
|
28
|
+
}>;
|
|
29
|
+
page: () => Promise<Response>;
|
|
30
|
+
request: () => Promise<Response>;
|
|
30
31
|
removeDeclaration(): Promise<void>;
|
|
31
32
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computer, routes as routeTable } from "../authorization.js";
|
|
2
2
|
import * as Schema from "effect/Schema";
|
|
3
3
|
import { releaseSchema } from "@fungi.computer/puffball/effect";
|
|
4
4
|
import { parseArtifactRef, parseSha256Digest } from "@fungi.computer/puffball";
|
|
@@ -43,7 +43,7 @@ export async function capabilityFixture(options = {}) {
|
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
const routes =
|
|
46
|
+
const routes = routeTable().post("/list", computer(), (context) => context.json({ entries: [] }));
|
|
47
47
|
const capabilities = options.adapters ??
|
|
48
48
|
(options.fileSource
|
|
49
49
|
? fileCapabilities(options.fileSource)
|
|
@@ -80,16 +80,13 @@ export async function capabilityFixture(options = {}) {
|
|
|
80
80
|
approval: null,
|
|
81
81
|
},
|
|
82
82
|
};
|
|
83
|
-
// An anonymous reader reaches only a public App, as the host's visitor.
|
|
84
|
-
if (options.visitor)
|
|
85
|
-
installation = { ...installation, visibility: "public" };
|
|
86
83
|
const readOnly = () => Promise.reject(new Error("Fixture installations are read-only"));
|
|
87
84
|
let base = {
|
|
88
85
|
bootUi: () => Promise.resolve({ kind: "passed" }),
|
|
89
86
|
auth: {
|
|
90
87
|
resolve: () => Promise.reject(new Error("Capability fixture resolves no actor")),
|
|
91
88
|
authenticate: options.authenticate ??
|
|
92
|
-
((request) => Promise.resolve(
|
|
89
|
+
((request) => Promise.resolve(request.headers.get("x-who") === "anonymous"
|
|
93
90
|
? { kind: "refused", status: 401 }
|
|
94
91
|
: {
|
|
95
92
|
kind: "admitted",
|
|
@@ -30,7 +30,7 @@ export async function approvedInstallation(input) {
|
|
|
30
30
|
grant: { operations, resources: "tenant-scope" },
|
|
31
31
|
}));
|
|
32
32
|
if (changes.length === 0)
|
|
33
|
-
return
|
|
33
|
+
return installed;
|
|
34
34
|
const approved = applyInstallationCommand(installed, { kind: "change-grants", changes }, {
|
|
35
35
|
by: { kind: "member", memberId: "fixture-owner" },
|
|
36
36
|
role: "owner",
|
|
@@ -42,8 +42,5 @@ export async function approvedInstallation(input) {
|
|
|
42
42
|
});
|
|
43
43
|
if (Result.isFailure(approved))
|
|
44
44
|
throw new Error(approved.failure.code);
|
|
45
|
-
return
|
|
46
|
-
...approved.success.next,
|
|
47
|
-
visibility: input.visibility ?? "private",
|
|
48
|
-
};
|
|
45
|
+
return approved.success.next;
|
|
49
46
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Host-owned configuration inputs, decoded before any challenge is opened. */
|
|
2
|
+
export type TurnstileEnvironment = Readonly<{
|
|
3
|
+
TURNSTILE?: string;
|
|
4
|
+
TURNSTILE_SITE_KEY?: string;
|
|
5
|
+
TURNSTILE_SECRET_KEY?: string;
|
|
6
|
+
}>;
|
|
7
|
+
/** Explicit opt-out, complete verification credentials, or a closed door. */
|
|
8
|
+
export type TurnstileConfiguration = Readonly<{
|
|
9
|
+
kind: "disabled";
|
|
10
|
+
}> | Readonly<{
|
|
11
|
+
kind: "enabled";
|
|
12
|
+
siteKey: string;
|
|
13
|
+
secretKey: string;
|
|
14
|
+
}> | Readonly<{
|
|
15
|
+
kind: "misconfigured";
|
|
16
|
+
}>;
|
|
17
|
+
/** Retain the development default; HTTPS hosts without keys fail closed. */
|
|
18
|
+
export declare function readTurnstileConfiguration(environment: TurnstileEnvironment, origin: string | undefined): TurnstileConfiguration;
|
|
19
|
+
/** Verify with Cloudflare; timeout policy and safe failure reporting belong to the host. */
|
|
20
|
+
export declare function verifyTurnstileToken(input: {
|
|
21
|
+
secretKey: string;
|
|
22
|
+
token: string;
|
|
23
|
+
remoteIp?: string;
|
|
24
|
+
}, options: {
|
|
25
|
+
timeoutMs: number;
|
|
26
|
+
onError(cause: unknown): void;
|
|
27
|
+
}): Promise<"passed" | "failed" | "unavailable">;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const siteverifyUrl = "https://challenges.cloudflare.com/turnstile/v0/siteverify";
|
|
3
|
+
const environmentSchema = z.object({
|
|
4
|
+
TURNSTILE: z.literal("off").optional(),
|
|
5
|
+
TURNSTILE_SITE_KEY: z.string().trim().min(1).optional(),
|
|
6
|
+
TURNSTILE_SECRET_KEY: z.string().trim().min(1).optional(),
|
|
7
|
+
});
|
|
8
|
+
const responseSchema = z.object({ success: z.boolean() });
|
|
9
|
+
/** Retain the development default; HTTPS hosts without keys fail closed. */
|
|
10
|
+
export function readTurnstileConfiguration(environment, origin) {
|
|
11
|
+
const parsed = environmentSchema.safeParse(environment);
|
|
12
|
+
if (!parsed.success)
|
|
13
|
+
return { kind: "misconfigured" };
|
|
14
|
+
if (parsed.data.TURNSTILE === "off")
|
|
15
|
+
return { kind: "disabled" };
|
|
16
|
+
const { TURNSTILE_SITE_KEY: siteKey, TURNSTILE_SECRET_KEY: secretKey } = parsed.data;
|
|
17
|
+
if (siteKey === undefined && secretKey === undefined)
|
|
18
|
+
return URL.parse(origin ?? "")?.protocol === "https:"
|
|
19
|
+
? { kind: "misconfigured" }
|
|
20
|
+
: { kind: "disabled" };
|
|
21
|
+
if (siteKey === undefined || secretKey === undefined)
|
|
22
|
+
return { kind: "misconfigured" };
|
|
23
|
+
return { kind: "enabled", siteKey, secretKey };
|
|
24
|
+
}
|
|
25
|
+
/** Verify with Cloudflare; timeout policy and safe failure reporting belong to the host. */
|
|
26
|
+
export async function verifyTurnstileToken(input, options) {
|
|
27
|
+
try {
|
|
28
|
+
const body = {
|
|
29
|
+
secret: input.secretKey,
|
|
30
|
+
response: input.token,
|
|
31
|
+
};
|
|
32
|
+
if (input.remoteIp !== undefined)
|
|
33
|
+
body.remoteip = input.remoteIp;
|
|
34
|
+
const response = await fetch(siteverifyUrl, {
|
|
35
|
+
method: "POST",
|
|
36
|
+
headers: { "Content-Type": "application/json" },
|
|
37
|
+
body: JSON.stringify(body),
|
|
38
|
+
signal: AbortSignal.timeout(options.timeoutMs),
|
|
39
|
+
});
|
|
40
|
+
if (!response.ok)
|
|
41
|
+
return "unavailable";
|
|
42
|
+
const verdict = responseSchema.safeParse(await response.json());
|
|
43
|
+
if (!verdict.success)
|
|
44
|
+
return "unavailable";
|
|
45
|
+
return verdict.data.success ? "passed" : "failed";
|
|
46
|
+
}
|
|
47
|
+
catch (cause) {
|
|
48
|
+
options.onError(cause);
|
|
49
|
+
return "unavailable";
|
|
50
|
+
}
|
|
51
|
+
}
|
package/dist/workers-git.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { type OysterTenancy, type ResolvedTenant, type TenantScope } from "./ten
|
|
|
6
6
|
*/
|
|
7
7
|
import { DurableObject } from "cloudflare:workers";
|
|
8
8
|
import { type InvocationFrame } from "./invocation.js";
|
|
9
|
-
import { Hono } from "hono";
|
|
10
9
|
import { type GitBinding } from "@fungi.computer/agar/git";
|
|
11
10
|
import { type GitDoorTarget, type StandardWebhookPayload } from "./git.js";
|
|
12
11
|
import { type KeyStore } from "@fungi.computer/ear-tag/keys";
|
|
@@ -17,6 +16,7 @@ import { type ArtifactsNamespace } from "@fungi.computer/burrow";
|
|
|
17
16
|
import { type HostEventSource, type HostRecipientEvent, type RecipientDelivery } from "./event-recipients.js";
|
|
18
17
|
export type { HostEventSource, HostRecipientEvent, RecipientDelivery, } from "./event-recipients.js";
|
|
19
18
|
import { type OysterAuth, type OysterCapability, type OysterEnv, type OysterGitHost, type OysterHost } from "./host.js";
|
|
19
|
+
import { type Routes } from "./authorization.js";
|
|
20
20
|
import type { GitWriter } from "@fungi.computer/agar/git";
|
|
21
21
|
import { OysterInstance, type OysterBindingContext, type OysterBindingRow, type OysterBindingTable, type OysterWorkspace, type OysterWorkerEnv, type OysterInvocationHost } from "./workers.js";
|
|
22
22
|
/** The GIT binding plus the credential only the host's git door may use. */
|
|
@@ -167,7 +167,7 @@ declare const OysterBinding_base: abstract new (ctx: ExecutionContext, env: Oyst
|
|
|
167
167
|
export declare class OysterBinding extends OysterBinding_base {
|
|
168
168
|
}
|
|
169
169
|
/** Owner routes for keys and webhooks; `createOyster` mounts them owner-only. */
|
|
170
|
-
export declare function gitAdminRoutes(env: OysterGitEnv, scope: TenantScope):
|
|
170
|
+
export declare function gitAdminRoutes(env: OysterGitEnv, scope: TenantScope): Routes<OysterEnv>;
|
|
171
171
|
/** A standalone Oyster Worker that also hosts git Apps. */
|
|
172
172
|
export type OysterGitWorkerEnv = OysterWorkerEnv & OysterGitEnv & Readonly<{
|
|
173
173
|
/** This Oyster's public origin, for clone URLs (e.g. https://oyster.example). */
|
|
@@ -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
|
+
/** Picker facts through this host's existing, owner-admitted directories. */
|
|
195
|
+
permissionResources?: (env: Env, scope: TenantScope) => NonNullable<OysterHost["permissionResources"]>;
|
|
194
196
|
/** Host-owned fleet control, admitted on every invocation by its durable owner. */
|
|
195
197
|
computerControl?: (env: Env, scope: TenantScope) => NonNullable<OysterHost["computerControl"]>;
|
|
196
198
|
/** Workflow controls supplied by the host's existing run owner. */
|
|
@@ -216,7 +218,7 @@ export type OysterGitWorkerOptions<Env extends OysterGitWorkerEnv> = Readonly<{
|
|
|
216
218
|
auth: OysterAuth;
|
|
217
219
|
}>) => OysterWorkspace | Promise<OysterWorkspace>;
|
|
218
220
|
/** Additional capabilities share the exact workspace selected for the base host. */
|
|
219
|
-
capabilities?: (env: Env, workspace: OysterWorkspace
|
|
221
|
+
capabilities?: (env: Env, workspace: OysterWorkspace) => readonly OysterCapability[];
|
|
220
222
|
/** Admit a presented Workflow Git credential for one repository and scope;
|
|
221
223
|
* omit when this host issues no Workflow Git credentials. */
|
|
222
224
|
workflowGitPass?: (env: Env, scope: TenantScope, pass: string, target: GitDoorTarget) => Promise<Extract<GitWriter, {
|
|
@@ -227,7 +229,7 @@ export type OysterGitWorkerOptions<Env extends OysterGitWorkerEnv> = Readonly<{
|
|
|
227
229
|
kind: "actor";
|
|
228
230
|
}> | null>;
|
|
229
231
|
/** Further owner-only routes this host serves, after the owner guard. */
|
|
230
|
-
ownerRoutes?: (env: Env, scope: TenantScope) =>
|
|
232
|
+
ownerRoutes?: (env: Env, scope: TenantScope) => Routes<OysterEnv>;
|
|
231
233
|
}>;
|
|
232
234
|
/** A tenant's whole Git host: the App server, `host.git` and the owner routes. */
|
|
233
235
|
export type OysterGitWorkerHost = OysterHost & Readonly<{
|
|
@@ -278,5 +280,11 @@ export declare function oysterWorkerGit<Env extends OysterGitWorkerEnv>(env: Env
|
|
|
278
280
|
* `oysterGitRoot(options).hostFor`; a cold directory passes its own resolved tenant.
|
|
279
281
|
*/
|
|
280
282
|
export declare function oysterGitWorkerHost<Env extends OysterGitWorkerEnv>(env: Env, options: OysterGitWorkerOptions<Env>, selected: ResolvedTenant, request?: Request): Promise<OysterGitWorkerHost>;
|
|
283
|
+
/**
|
|
284
|
+
* A Git host's whole owner table: keys and webhooks, the root's own owner
|
|
285
|
+
* routes, and Agent approval and MCP server custody. The host and the
|
|
286
|
+
* authorization law both compose it here.
|
|
287
|
+
*/
|
|
288
|
+
export declare function oysterGitOwnerRoutes(env: OysterGitEnv, scope: TenantScope, hostOwnerRoutes: Routes<OysterEnv> | undefined, agents: OysterAgents | undefined): Routes<OysterEnv>;
|
|
281
289
|
/** Deploy the MCP owner from the same root as createOysterGitWorker. */
|
|
282
290
|
export declare function createOysterGitMcpOwner<Env extends OysterGitWorkerEnv>(root: OysterGitRoot<Env>): new (ctx: DurableObjectState, env: Env) => import("./mcp-owner.js").OysterMcpOwner<Env>;
|