@fungi.computer/oyster 0.6.0 → 0.8.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 +133 -78
- package/dist/agent-archive-projection.d.ts +8 -0
- package/dist/agent-archive-projection.js +49 -0
- package/dist/agent-schedules.d.ts +61 -0
- package/dist/agent-schedules.js +19 -0
- package/dist/agents.d.ts +35 -14
- package/dist/agents.js +93 -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.d.ts +1 -24
- package/dist/auth.js +9 -39
- 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 +70 -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 +9 -1
- package/dist/build/local-build.js +11 -9
- package/dist/cloudflare.d.ts +4 -1
- package/dist/cloudflare.js +1 -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 +33 -40
- package/dist/host.js +156 -275
- package/dist/installation-execution.js +14 -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 +3 -2
- package/dist/internal/host-gate.js +5 -18
- 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 +15 -14
- package/dist/invocation.js +58 -26
- 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/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 +7 -93
- package/dist/page-script.d.ts +0 -3
- package/dist/page-script.js +3 -4
- 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 +186 -20
- package/dist/standalone/agents.js +251 -30
- 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 +13 -42
- 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.d.ts +0 -3
- package/dist/standalone/tenancy.js +2 -5
- 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 +10 -3
- package/dist/standalone/workflow-binding.js +22 -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 +31 -4
- package/dist/standalone/workflow-schedules.js +18 -5
- package/dist/standalone/workflow-webhooks.d.ts +4 -18
- package/dist/standalone/workflow-webhooks.js +5 -5
- package/dist/standalone/workflows.d.ts +53 -27
- package/dist/standalone/workflows.js +9 -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/workers-git.d.ts +12 -4
- package/dist/workers-git.js +38 -35
- package/dist/workers.d.ts +9 -1
- package/dist/workers.js +44 -8
- package/dist/workflows.d.ts +4 -0
- package/dist/workflows.js +2 -0
- package/docs/api/README.md +7 -0
- package/docs/api/agent-schedules.md +176 -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/auth.md +0 -55
- package/docs/api/authorization.md +1300 -0
- package/docs/api/build.md +42 -38
- package/docs/api/cloudflare.md +3 -3
- package/docs/api/git.md +20 -11
- package/docs/api/host.md +64 -192
- package/docs/api/index.md +1 -1
- package/docs/api/invocation.md +14 -14
- 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 +111 -222
- package/package.json +41 -22
- package/dist/page/computer-target.d.ts +0 -3
- package/dist/page/computer-target.js +0 -9
- package/dist/standalone/channel-session-door.d.ts +0 -4
- package/dist/standalone/channel-session-door.js +0 -72
|
@@ -87,7 +87,7 @@ export declare function createTeamBuildPublisher(options: Readonly<{
|
|
|
87
87
|
readonly expiresAt: number;
|
|
88
88
|
readonly remote: string;
|
|
89
89
|
readonly reportUrl: string;
|
|
90
|
-
readonly status: "revoked" | "
|
|
90
|
+
readonly status: "revoked" | "failed" | "running" | "succeeded" | "interrupted";
|
|
91
91
|
readonly artifact: {
|
|
92
92
|
readonly digest: string;
|
|
93
93
|
readonly bytes: number;
|
|
@@ -103,7 +103,7 @@ export declare function createTeamBuildPublisher(options: Readonly<{
|
|
|
103
103
|
readonly expiresAt: number;
|
|
104
104
|
readonly remote: string;
|
|
105
105
|
readonly reportUrl: string;
|
|
106
|
-
readonly status: "revoked" | "
|
|
106
|
+
readonly status: "revoked" | "failed" | "running" | "succeeded" | "interrupted";
|
|
107
107
|
readonly artifact: {
|
|
108
108
|
readonly digest: string;
|
|
109
109
|
readonly bytes: number;
|
|
@@ -56,6 +56,8 @@ export declare function buildTeamCandidate(input: {
|
|
|
56
56
|
outputPath: string;
|
|
57
57
|
/** Trusted Computer-local cache; never part of customer configuration. */
|
|
58
58
|
packageStoreDirectory?: string;
|
|
59
|
+
/** Host-owned observation of raw subprocess output; never source configuration. */
|
|
60
|
+
onOutput?: (stream: "stdout" | "stderr", bytes: Uint8Array) => void;
|
|
59
61
|
}): Promise<Readonly<{
|
|
60
62
|
digest: string;
|
|
61
63
|
bytes: number;
|
|
@@ -48,15 +48,19 @@ export async function buildTeamCandidate(input) {
|
|
|
48
48
|
const onPhase = (phase, milliseconds) => {
|
|
49
49
|
phases[phase] += milliseconds;
|
|
50
50
|
};
|
|
51
|
+
const onOutput = (stream, bytes) => {
|
|
52
|
+
input.onOutput?.(stream, bytes);
|
|
53
|
+
};
|
|
51
54
|
const prepareStarted = performance.now();
|
|
52
55
|
const candidate = await Effect.runPromise(createCapturedCandidatePreparer(config, {
|
|
53
56
|
sourceCapture: createLocalCommitSourceCapture(input.repositoryPath, config.sourceRevision),
|
|
54
57
|
buildExecutor: createLocalBuildExecutor(input.packageStoreDirectory === undefined
|
|
55
|
-
? { packageScripts: "run", onPhase }
|
|
58
|
+
? { packageScripts: "run", onPhase, onOutput }
|
|
56
59
|
: {
|
|
57
60
|
packageScripts: "run",
|
|
58
61
|
packageStoreDirectory: input.packageStoreDirectory,
|
|
59
62
|
onPhase,
|
|
63
|
+
onOutput,
|
|
60
64
|
}),
|
|
61
65
|
}).prepareCandidate(parseReleaseId("rel_build")));
|
|
62
66
|
const prepared = performance.now() - prepareStarted;
|
|
@@ -32,6 +32,9 @@ try {
|
|
|
32
32
|
outputPath,
|
|
33
33
|
// Computer scratch survives captured snapshot cleanup, without a global or durable Workspace store.
|
|
34
34
|
packageStoreDirectory: "/var/tmp/fungi-app-package-store",
|
|
35
|
+
onOutput: (stream, bytes) => {
|
|
36
|
+
process[stream].write(bytes);
|
|
37
|
+
},
|
|
35
38
|
});
|
|
36
39
|
const reportUrl = process.env.TEAM_BUILD_REPORT;
|
|
37
40
|
if (!reportUrl)
|
|
@@ -19518,6 +19518,16 @@ var appBackendBindingKinds = {
|
|
|
19518
19518
|
requires: ["workflow.run", "workflow.arm"],
|
|
19519
19519
|
effect: "write"
|
|
19520
19520
|
},
|
|
19521
|
+
pauseSchedule: {
|
|
19522
|
+
cap: "app.workflow.run",
|
|
19523
|
+
requires: ["workflow.run", "workflow.arm"],
|
|
19524
|
+
effect: "write"
|
|
19525
|
+
},
|
|
19526
|
+
resumeSchedule: {
|
|
19527
|
+
cap: "app.workflow.run",
|
|
19528
|
+
requires: ["workflow.run", "workflow.arm"],
|
|
19529
|
+
effect: "write"
|
|
19530
|
+
},
|
|
19521
19531
|
schedules: {
|
|
19522
19532
|
cap: "app.workflow.read",
|
|
19523
19533
|
requires: ["workflow.run"],
|
|
@@ -19659,7 +19669,27 @@ var appBackendBindingKinds = {
|
|
|
19659
19669
|
name: "AGENTS",
|
|
19660
19670
|
operations: {
|
|
19661
19671
|
list: { cap: "agent.list", requires: ["agent.list"], effect: "read" },
|
|
19662
|
-
send: { cap: "agent.send", requires: ["agent.send"], effect: "write" }
|
|
19672
|
+
send: { cap: "agent.send", requires: ["agent.send"], effect: "write" },
|
|
19673
|
+
schedules: {
|
|
19674
|
+
cap: "agent.read",
|
|
19675
|
+
requires: ["agent.read"],
|
|
19676
|
+
effect: "read"
|
|
19677
|
+
},
|
|
19678
|
+
pauseSchedule: {
|
|
19679
|
+
cap: "agent.manage",
|
|
19680
|
+
requires: ["agent.manage"],
|
|
19681
|
+
effect: "write"
|
|
19682
|
+
},
|
|
19683
|
+
resumeSchedule: {
|
|
19684
|
+
cap: "agent.manage",
|
|
19685
|
+
requires: ["agent.manage"],
|
|
19686
|
+
effect: "write"
|
|
19687
|
+
},
|
|
19688
|
+
deleteSchedule: {
|
|
19689
|
+
cap: "agent.manage",
|
|
19690
|
+
requires: ["agent.manage"],
|
|
19691
|
+
effect: "write"
|
|
19692
|
+
}
|
|
19663
19693
|
}
|
|
19664
19694
|
}
|
|
19665
19695
|
};
|
|
@@ -19714,13 +19744,17 @@ var emptyAppDeclaration = Object.freeze({
|
|
|
19714
19744
|
|
|
19715
19745
|
// ../puffball/dist/app-api.js
|
|
19716
19746
|
var appApiMethodNameSchema = String4.check(makeFilter2(isAppApiMethodName));
|
|
19747
|
+
function isJsonContainer(value) {
|
|
19748
|
+
return value !== null && typeof value === "object";
|
|
19749
|
+
}
|
|
19717
19750
|
function withinDepth(value, depth = 0) {
|
|
19718
19751
|
if (depth > 16)
|
|
19719
19752
|
return false;
|
|
19720
|
-
if (
|
|
19721
|
-
|
|
19722
|
-
|
|
19723
|
-
|
|
19753
|
+
if (isJsonContainer(value)) {
|
|
19754
|
+
for (const child of Object.values(value))
|
|
19755
|
+
if (!withinDepth(child, depth + 1))
|
|
19756
|
+
return false;
|
|
19757
|
+
}
|
|
19724
19758
|
return true;
|
|
19725
19759
|
}
|
|
19726
19760
|
var projection = JsonObject.pipe(check(makeFilter2((value) => new TextEncoder().encode(JSON.stringify(value)).byteLength <= 2e4 && withinDepth(value), { message: "App API schema exceeds its byte or depth bound" })));
|
|
@@ -19731,15 +19765,12 @@ var method = Struct({
|
|
|
19731
19765
|
output: projection,
|
|
19732
19766
|
pending: optional2(Literal2(true)),
|
|
19733
19767
|
hidden: optional2(Literal2(true)),
|
|
19734
|
-
anonymous: optional2(Literal2(true)),
|
|
19735
19768
|
present: optional2(Struct({
|
|
19736
19769
|
verb: String4.check(isMinLength(1), isMaxLength(32))
|
|
19737
19770
|
})),
|
|
19738
19771
|
effect: Literals(["read", "write", "external"]),
|
|
19739
19772
|
requires: ArraySchema(Literals(appCapabilityIds)).pipe(check(makeFilter2((values) => new Set(values).size === values.length)))
|
|
19740
|
-
})
|
|
19741
|
-
message: "Anonymous methods must be reads with no required capabilities"
|
|
19742
|
-
}));
|
|
19773
|
+
});
|
|
19743
19774
|
var appApiSchema = Struct({
|
|
19744
19775
|
methods: Record(String4, method).pipe(check(makeFilter2((methods) => Object.keys(methods).every(is2(appApiMethodNameSchema)), { message: "Invalid App API method name" })), check(makeFilter2((methods) => Object.keys(methods).length <= 64)), check(makeFilter2((methods) => {
|
|
19745
19776
|
const names = Object.keys(methods);
|
|
@@ -21842,6 +21873,7 @@ var BirdDogAgentJobPayloadSchema = Struct({
|
|
|
21842
21873
|
});
|
|
21843
21874
|
var BirdDogAgentJobInputSchema = Struct({
|
|
21844
21875
|
work: BirdDogAgentWorkSchema,
|
|
21876
|
+
delivery: Literals(["steer", "followUp"]),
|
|
21845
21877
|
mail: optional2(BirdDogMailSchema)
|
|
21846
21878
|
});
|
|
21847
21879
|
|
|
@@ -22350,7 +22382,7 @@ var symbols = {
|
|
|
22350
22382
|
// Oyster: the open shell that holds the Apps' pearl.
|
|
22351
22383
|
oyster: (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [(0, import_jsx_runtime4.jsx)("path", { fill: grape, d: "M35.5 6C33.7 6.3 32.3 7.6 31.4 9.4 30.9 10.3 30.4 10.3 29.5 10 25.5 9 20.6 11.6 19.6 15.9 19.4 16.6 19 17 18 17.1 14.5 17.6 12 20.6 12.1 24.2 12.2 25.4 12 25.9 11.5 26.5 7.5 30 10.5 34.5 17.5 34.4 15.3 32.6 16 31 19 29 26 24 37 19.5 43.5 19 46 19 46 22 43 25.5 46.5 23.5 51.5 18.5 53.5 15 55 11 50 7 45 9 43.8 9.4 43.3 9.2 42.5 8 40.7 6.3 38 5.6 35.5 6Z" }), (0, import_jsx_runtime4.jsx)("circle", { fill: cream, cx: "34.9", cy: "41.9", r: "11.3" }), (0, import_jsx_runtime4.jsxs)("g", { fill: ink, children: [(0, import_jsx_runtime4.jsx)("rect", { x: "29.9", y: "33.2", width: "3.2", height: "5.6", rx: "1.6" }), (0, import_jsx_runtime4.jsx)("rect", { x: "36.7", y: "33.2", width: "3.2", height: "5.6", rx: "1.6" })] }), (0, import_jsx_runtime4.jsx)("path", { fill: grape, d: "M49.5 39C47.9 39.3 46.5 40 46.1 41.6 45.8 43.2 45.5 43.5 44 43.5 38.5 43.5 35 48 39 49.5 40 50 39.5 50.5 38 51 35.5 52.5 32.5 52 30 51 29 50.5 28.5 50 29.5 50 33 47.5 30 43.5 24.5 43.5 23.3 43.5 22.9 43.3 22.5 43 20.5 40.5 19 40 17.5 39.5 13 39.5 13 44 17 47.5 18.3 48.4 18.6 48.7 19 49.5 20.5 53 23 55 26 55 26.8 55 27 55.3 27.5 56 31 58.5 36.5 58.5 40 56 40.8 55.2 41.2 55 42 55 45 55 47.5 53 49 49.5 49.6 48.5 50 48 50.5 47.5 56 43.5 55 38.5 49.5 39Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: "none", stroke: yellow, strokeWidth: "3", strokeLinecap: "round", d: "M46.6 31.8 49.2 27.8 M49.4 35.5 52.8 33.7 M21.5 32.5 22.9 33.5 M19.3 37.5 21.1 38.1" })] }),
|
|
22352
22384
|
// Tourtois: the desktop shell, a tortoise carrying window panes.
|
|
22353
|
-
tourtois: (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [(0, import_jsx_runtime4.jsx)("rect", { fill: cream, x: "11.07", y: "35.73", width: "26.8", height: "9.7", rx: "3.25", transform: "rotate(-5 24.47 40.58)" }), (0, import_jsx_runtime4.jsx)("path", { fill: yellow, d: "M14.8 16C19 14.6 23 13.5 26.5 12.6 28.4 12.1 29.6 13.4 30.1 15.3L31.6 21 17.4 37.6C13.8 38.2 10.6 37.8 10.1 35.4L9.2 27.8C9.1 26.1 10.1 24.7 11.6 24.1 11.4 22.4 11.4 20.6 11.8 19.1 12.3 17.4 13.3 16.5 14.8 16Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: coral, d: "M14.0 24.1Q13.3 21.2 16.2 20.4L30.7 16.2Q33.6 15.4 34.6 18.2L36.0 22.7Q37.0 25.5 34.7 27.4L20.2 39.7Q17.9 41.6 17.2 38.7Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: blue, d: "M21 23.4 35.5 20.6C37.3 20.2 38.6 21 38.9 22.6L40 34.5C40.1 36.2 39.1 37.3 37.5 37.7 32.6 39.9 26 41 21 41 16 41 12.2 40.2 11 38.8 10.4 37.6 10.8 36.4 12.4 37L19.6 38.4 18.4 27C18.2 25.2 19.3 23.7 21 23.4Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: cream, d: "M22.8 29.6 34.8 26.9C36.2 26.6 37 27.3 37.2 28.6L37.9 33C38.1 34.2 37.5 35 36.3 35.3L24.3 37.8C23 38.1 22.3 37.5 22.1 36.3L21.3 31.6C21.1 30.6 21.7 29.8 22.8 29.6Z" }), (0, import_jsx_runtime4.jsxs)("g", { fill: cream, children: [(0, import_jsx_runtime4.jsx)("circle", { cx: "14.7", cy: "18.45", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "17.6", cy: "17.65", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "20.5", cy: "16.85", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "17.9", cy: "22.2", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "21", cy: "21.5", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "24.1", cy: "20.75", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "28.2", cy: "25.3", r: "1" })] }), (0, import_jsx_runtime4.jsx)("circle", { fill: coral, cx: "21.7", cy: "26.6", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { fill: yellow, cx: "24.9", cy: "25.9", r: "1.05" }), (0, import_jsx_runtime4.jsxs)("g", { fill: mint, children: [(0, import_jsx_runtime4.jsx)("ellipse", { cx: "8.8", cy: "36.6", rx: "3.6", ry: "1.9", transform: "rotate(22 8.8 36.6)" }), (0, import_jsx_runtime4.jsx)("path", { d: "M12 41C10 41.5 7.5 44.5 7 46.5 7 48 8.5 49.5 10.5 50 12.5 50.5 13.5 50 15 48 15.5 47 16.5 47.5 19 50 22 49.5 22 46.5 22 45.5 20.5 45.5 17 45 16.5 44.5 16.5 44 16.5 42 13.5 40.
|
|
22385
|
+
tourtois: (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [(0, import_jsx_runtime4.jsx)("rect", { fill: cream, x: "11.07", y: "35.73", width: "26.8", height: "9.7", rx: "3.25", transform: "rotate(-5 24.47 40.58)" }), (0, import_jsx_runtime4.jsx)("path", { fill: yellow, d: "M14.8 16C19 14.6 23 13.5 26.5 12.6 28.4 12.1 29.6 13.4 30.1 15.3L31.6 21 17.4 37.6C13.8 38.2 10.6 37.8 10.1 35.4L9.2 27.8C9.1 26.1 10.1 24.7 11.6 24.1 11.4 22.4 11.4 20.6 11.8 19.1 12.3 17.4 13.3 16.5 14.8 16Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: coral, d: "M14.0 24.1Q13.3 21.2 16.2 20.4L30.7 16.2Q33.6 15.4 34.6 18.2L36.0 22.7Q37.0 25.5 34.7 27.4L20.2 39.7Q17.9 41.6 17.2 38.7Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: blue, d: "M21 23.4 35.5 20.6C37.3 20.2 38.6 21 38.9 22.6L40 34.5C40.1 36.2 39.1 37.3 37.5 37.7 32.6 39.9 26 41 21 41 16 41 12.2 40.2 11 38.8 10.4 37.6 10.8 36.4 12.4 37L19.6 38.4 18.4 27C18.2 25.2 19.3 23.7 21 23.4Z" }), (0, import_jsx_runtime4.jsx)("path", { fill: cream, d: "M22.8 29.6 34.8 26.9C36.2 26.6 37 27.3 37.2 28.6L37.9 33C38.1 34.2 37.5 35 36.3 35.3L24.3 37.8C23 38.1 22.3 37.5 22.1 36.3L21.3 31.6C21.1 30.6 21.7 29.8 22.8 29.6Z" }), (0, import_jsx_runtime4.jsxs)("g", { fill: cream, children: [(0, import_jsx_runtime4.jsx)("circle", { cx: "14.7", cy: "18.45", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "17.6", cy: "17.65", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "20.5", cy: "16.85", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "17.9", cy: "22.2", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "21", cy: "21.5", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "24.1", cy: "20.75", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { cx: "28.2", cy: "25.3", r: "1" })] }), (0, import_jsx_runtime4.jsx)("circle", { fill: coral, cx: "21.7", cy: "26.6", r: "1" }), (0, import_jsx_runtime4.jsx)("circle", { fill: yellow, cx: "24.9", cy: "25.9", r: "1.05" }), (0, import_jsx_runtime4.jsxs)("g", { fill: mint, children: [(0, import_jsx_runtime4.jsx)("ellipse", { cx: "8.8", cy: "36.6", rx: "3.6", ry: "1.9", transform: "rotate(22 8.8 36.6)" }), (0, import_jsx_runtime4.jsx)("path", { d: "M12 41C10 41.5 7.5 44.5 7 46.5 7 48 8.5 49.5 10.5 50 12.5 50.5 13.5 50 15 48 15.5 47 16.5 47.5 19 50 22 49.5 22 46.5 22 45.5 20.5 45.5 17 45 16.5 44.5 16.5 44 16.5 42 13.5 40.5L12 41Z" }), (0, import_jsx_runtime4.jsx)("path", { d: "M40 33C39 38 36 42 34.5 41.5 32.5 40.5 29.5 42 28.5 44 26 49 27.5 51.5 32.5 51 36 51 37 50 36 46.5 36 45 37 44.5 38 44.5 38.5 45.5 40.5 49 43.5 50 46.5 47.5 47.5 46.5 46 43.5 44 42 43 41.5 43.5 40.5 44.5 39.5 46 38 47 37.5L47 33Z" })] }), (0, import_jsx_runtime4.jsx)("ellipse", { fill: mint, cx: "46.4", cy: "30.6", rx: "8.1", ry: "8.3" }), (0, import_jsx_runtime4.jsxs)("g", { fill: ink, children: [(0, import_jsx_runtime4.jsx)("rect", { x: "45.05", y: "26.95", width: "2.25", height: "4.6", rx: "1.1", transform: "rotate(-6 46.2 29.3)" }), (0, import_jsx_runtime4.jsx)("rect", { x: "49.25", y: "26.4", width: "2.25", height: "4.6", rx: "1.1", transform: "rotate(-6 50.4 28.7)" })] }), (0, import_jsx_runtime4.jsx)("path", { fill: coral, d: "M46.8 32.2H51C51 34.3 50 35.4 48.9 35.4S46.8 34.3 46.8 32.2Z", transform: "rotate(-8 48.9 33.5)" }), (0, import_jsx_runtime4.jsx)("path", { fill: "none", stroke: yellow, strokeWidth: "3", strokeLinecap: "round", d: "M50.9 17.7 50.5 19.7 M55.2 20.1 53.4 21.9 M56.5 24.5 55.7 24.7" })] }),
|
|
22354
22386
|
// The launcher's "All Apps": four App tiles, no install arrow.
|
|
22355
22387
|
allApps: (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [(0, import_jsx_runtime4.jsx)("rect", { fill: coral, x: "7", y: "7.25", width: "23.2", height: "22.7", rx: "4.6", transform: "rotate(-6.2 18.6 18.6)" }), (0, import_jsx_runtime4.jsx)("rect", { fill: blue, x: "33.9", y: "7.25", width: "23.2", height: "22.7", rx: "4.6", transform: "rotate(6.2 45.5 18.6)" }), (0, import_jsx_runtime4.jsx)("rect", { fill: mint, x: "7", y: "34.15", width: "23.2", height: "22.7", rx: "4.6", transform: "rotate(6.2 18.6 45.5)" }), (0, import_jsx_runtime4.jsx)("rect", { fill: yellow, x: "33.9", y: "34.15", width: "23.2", height: "22.7", rx: "4.6", transform: "rotate(-6.2 45.5 45.5)" })] }),
|
|
22356
22388
|
// Search: a magnifying glass.
|
|
@@ -35641,7 +35673,7 @@ async function stopHtmlGroup(child) {
|
|
|
35641
35673
|
}
|
|
35642
35674
|
throw new Error("HTML process group survived its five-second cleanup bound");
|
|
35643
35675
|
}
|
|
35644
|
-
function runHtmlCommand(args2, cwd, env, command = "pnpm") {
|
|
35676
|
+
function runHtmlCommand(args2, cwd, env, command = "pnpm", onOutput) {
|
|
35645
35677
|
return acquireUseRelease2(
|
|
35646
35678
|
sync2(() => {
|
|
35647
35679
|
if (process.platform === "win32")
|
|
@@ -35656,11 +35688,13 @@ function runHtmlCommand(args2, cwd, env, command = "pnpm") {
|
|
|
35656
35688
|
let stdout = "";
|
|
35657
35689
|
let stderr = "";
|
|
35658
35690
|
child.stdout.on("data", (chunk) => {
|
|
35691
|
+
onOutput?.("stdout", chunk);
|
|
35659
35692
|
stdout += chunk.toString();
|
|
35660
35693
|
if (Buffer2.byteLength(stdout) > 1024 * 1024)
|
|
35661
35694
|
reject(new Error("HTML command output exceeded its bound"));
|
|
35662
35695
|
});
|
|
35663
35696
|
child.stderr.on("data", (chunk) => {
|
|
35697
|
+
onOutput?.("stderr", chunk);
|
|
35664
35698
|
stderr += chunk.toString();
|
|
35665
35699
|
if (Buffer2.byteLength(stderr) > 1024 * 1024)
|
|
35666
35700
|
reject(new Error("HTML command diagnostics exceeded their bound"));
|
|
@@ -35701,10 +35735,10 @@ function snapshotBuildEnvironment(sourceSnapshotPath) {
|
|
|
35701
35735
|
}
|
|
35702
35736
|
function rebuildViteSnapshot(sourceSnapshotPath, recipe, options) {
|
|
35703
35737
|
if (recipe.kind === "source-html")
|
|
35704
|
-
return rebuildNpmSnapshot(sourceSnapshotPath, recipe);
|
|
35738
|
+
return rebuildNpmSnapshot(sourceSnapshotPath, recipe, options);
|
|
35705
35739
|
return gen2(function* () {
|
|
35706
35740
|
const env = snapshotBuildEnvironment(sourceSnapshotPath);
|
|
35707
|
-
const run2 = (args2, cwd = sourceSnapshotPath) => runHtmlCommand(args2, cwd, env);
|
|
35741
|
+
const run2 = (args2, cwd = sourceSnapshotPath) => runHtmlCommand(args2, cwd, env, "pnpm", options.onOutput);
|
|
35708
35742
|
if ((yield* run2(["--version"])).trim() !== "11.24.0") {
|
|
35709
35743
|
return yield* fail5(new Error("Publisher requires pnpm 11.24.0"));
|
|
35710
35744
|
}
|
|
@@ -35922,7 +35956,7 @@ function readHtmlBuildOutput(sourceSnapshotPath, recipe) {
|
|
|
35922
35956
|
return Object.freeze({ kind: "bytes", bytes });
|
|
35923
35957
|
});
|
|
35924
35958
|
}
|
|
35925
|
-
function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
|
|
35959
|
+
function rebuildNpmSnapshot(sourceSnapshotPath, recipe, options) {
|
|
35926
35960
|
return gen2(function* () {
|
|
35927
35961
|
const env = snapshotBuildEnvironment(sourceSnapshotPath);
|
|
35928
35962
|
const home = join5(sourceSnapshotPath, ".publisher-home");
|
|
@@ -35939,7 +35973,8 @@ function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
|
|
|
35939
35973
|
["--version"],
|
|
35940
35974
|
sourceSnapshotPath,
|
|
35941
35975
|
env,
|
|
35942
|
-
"npm"
|
|
35976
|
+
"npm",
|
|
35977
|
+
options.onOutput
|
|
35943
35978
|
)).trim() !== recipe.toolchain.npm)
|
|
35944
35979
|
return yield* fail5(
|
|
35945
35980
|
new Error("Captured npm version differs from the recipe")
|
|
@@ -35948,7 +35983,8 @@ function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
|
|
|
35948
35983
|
["ci", "--include=dev", "--ignore-scripts", "--no-audit", "--no-fund"],
|
|
35949
35984
|
sourceSnapshotPath,
|
|
35950
35985
|
env,
|
|
35951
|
-
"npm"
|
|
35986
|
+
"npm",
|
|
35987
|
+
options.onOutput
|
|
35952
35988
|
);
|
|
35953
35989
|
const program = join5(sourceSnapshotPath, ".publisher-build.mjs");
|
|
35954
35990
|
yield* tryPromise2(async () => {
|
|
@@ -35969,7 +36005,8 @@ function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
|
|
|
35969
36005
|
],
|
|
35970
36006
|
sourceSnapshotPath,
|
|
35971
36007
|
env,
|
|
35972
|
-
"node"
|
|
36008
|
+
"node",
|
|
36009
|
+
options.onOutput
|
|
35973
36010
|
);
|
|
35974
36011
|
return yield* readHtmlBuildOutput(sourceSnapshotPath, recipe);
|
|
35975
36012
|
});
|
|
@@ -36110,7 +36147,9 @@ function createLocalBuildExecutor(options = {}) {
|
|
|
36110
36147
|
if ((yield* runHtmlCommand(
|
|
36111
36148
|
["--version"],
|
|
36112
36149
|
source.snapshotPath,
|
|
36113
|
-
environment
|
|
36150
|
+
environment,
|
|
36151
|
+
"pnpm",
|
|
36152
|
+
options.onOutput
|
|
36114
36153
|
)).trim() !== "11.24.0")
|
|
36115
36154
|
return yield* fail5(
|
|
36116
36155
|
new Error("Publisher requires pnpm 11.24.0")
|
|
@@ -36121,7 +36160,9 @@ function createLocalBuildExecutor(options = {}) {
|
|
|
36121
36160
|
options.packageCacheDirectory
|
|
36122
36161
|
),
|
|
36123
36162
|
source.snapshotPath,
|
|
36124
|
-
environment
|
|
36163
|
+
environment,
|
|
36164
|
+
"pnpm",
|
|
36165
|
+
options.onOutput
|
|
36125
36166
|
);
|
|
36126
36167
|
}
|
|
36127
36168
|
}
|
|
@@ -36272,6 +36313,9 @@ async function buildTeamCandidate(input) {
|
|
|
36272
36313
|
const onPhase = (phase, milliseconds) => {
|
|
36273
36314
|
phases[phase] += milliseconds;
|
|
36274
36315
|
};
|
|
36316
|
+
const onOutput = (stream, bytes2) => {
|
|
36317
|
+
input.onOutput?.(stream, bytes2);
|
|
36318
|
+
};
|
|
36275
36319
|
const prepareStarted = performance.now();
|
|
36276
36320
|
const candidate = await runPromise2(
|
|
36277
36321
|
createCapturedCandidatePreparer(config2, {
|
|
@@ -36280,10 +36324,11 @@ async function buildTeamCandidate(input) {
|
|
|
36280
36324
|
config2.sourceRevision
|
|
36281
36325
|
),
|
|
36282
36326
|
buildExecutor: createLocalBuildExecutor(
|
|
36283
|
-
input.packageStoreDirectory === void 0 ? { packageScripts: "run", onPhase } : {
|
|
36327
|
+
input.packageStoreDirectory === void 0 ? { packageScripts: "run", onPhase, onOutput } : {
|
|
36284
36328
|
packageScripts: "run",
|
|
36285
36329
|
packageStoreDirectory: input.packageStoreDirectory,
|
|
36286
|
-
onPhase
|
|
36330
|
+
onPhase,
|
|
36331
|
+
onOutput
|
|
36287
36332
|
}
|
|
36288
36333
|
)
|
|
36289
36334
|
}).prepareCandidate(parseReleaseId("rel_build"))
|
|
@@ -36354,7 +36399,10 @@ try {
|
|
|
36354
36399
|
repositoryPath,
|
|
36355
36400
|
outputPath,
|
|
36356
36401
|
// Computer scratch survives captured snapshot cleanup, without a global or durable Workspace store.
|
|
36357
|
-
packageStoreDirectory: "/var/tmp/fungi-app-package-store"
|
|
36402
|
+
packageStoreDirectory: "/var/tmp/fungi-app-package-store",
|
|
36403
|
+
onOutput: (stream, bytes) => {
|
|
36404
|
+
process[stream].write(bytes);
|
|
36405
|
+
}
|
|
36358
36406
|
});
|
|
36359
36407
|
const reportUrl = process.env.TEAM_BUILD_REPORT;
|
|
36360
36408
|
if (!reportUrl) throw new TeamCandidateBuildError("report_failed");
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
/** Maximum retained combined stdout/stderr bytes, split equally into head and tail. */
|
|
3
|
+
export declare const buildJobLogMaxBytes: number;
|
|
4
|
+
/** Base64url preserves raw command bytes, including split UTF-8 and terminal control bytes. */
|
|
5
|
+
export declare const buildJobLogSchema: Schema.Struct<{
|
|
6
|
+
readonly encoding: Schema.Literal<"base64url">;
|
|
7
|
+
readonly output: Schema.String;
|
|
8
|
+
readonly truncated: Schema.NullOr<Schema.Struct<{
|
|
9
|
+
readonly droppedBytes: Schema.Number;
|
|
10
|
+
}>>;
|
|
11
|
+
}>;
|
|
12
|
+
export type BuildJobLog = Schema.Schema.Type<typeof buildJobLogSchema>;
|
|
13
|
+
/** The artifact-upload door cannot write this host-owned job-log namespace. */
|
|
14
|
+
export declare const isBuildJobLogRef: (ref: string) => boolean;
|
|
15
|
+
/** One bounded raw-event sink; event arrival order is the combined output order. */
|
|
16
|
+
export declare function createBuildJobLog(): {
|
|
17
|
+
/** Retained buffer capacity, distinct from the transient encoded result. */
|
|
18
|
+
readonly allocatedBytes: number;
|
|
19
|
+
append(bytes: Uint8Array): void;
|
|
20
|
+
finish(): BuildJobLog;
|
|
21
|
+
};
|
|
22
|
+
/** Preserve BirdDog's redacted 200-character status/mail budget and name the full log. */
|
|
23
|
+
export declare function buildJobDiagnostic(jobId: string, detail: string): string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import { base64url } from "jose";
|
|
3
|
+
import { boundedDiagnostic } from "@fungi.computer/bird-dog/effect";
|
|
4
|
+
/** Maximum retained combined stdout/stderr bytes, split equally into head and tail. */
|
|
5
|
+
export const buildJobLogMaxBytes = 2 * 1024 * 1024;
|
|
6
|
+
/** Base64url preserves raw command bytes, including split UTF-8 and terminal control bytes. */
|
|
7
|
+
export const buildJobLogSchema = Schema.Struct({
|
|
8
|
+
encoding: Schema.Literal("base64url"),
|
|
9
|
+
output: Schema.String.check(Schema.isMaxLength(Math.ceil(buildJobLogMaxBytes / 3) * 4)),
|
|
10
|
+
truncated: Schema.NullOr(Schema.Struct({
|
|
11
|
+
droppedBytes: Schema.Number.check(Schema.isInt(), Schema.isGreaterThan(0)),
|
|
12
|
+
})),
|
|
13
|
+
});
|
|
14
|
+
/** The artifact-upload door cannot write this host-owned job-log namespace. */
|
|
15
|
+
export const isBuildJobLogRef = (ref) => ref.startsWith("artifact:build-log-");
|
|
16
|
+
/** One bounded raw-event sink; event arrival order is the combined output order. */
|
|
17
|
+
export function createBuildJobLog() {
|
|
18
|
+
const half = buildJobLogMaxBytes / 2;
|
|
19
|
+
let head = new Uint8Array(0);
|
|
20
|
+
let tail = new Uint8Array(0);
|
|
21
|
+
let headBytes = 0;
|
|
22
|
+
let tailBytes = 0;
|
|
23
|
+
let tailPosition = 0;
|
|
24
|
+
let total = 0;
|
|
25
|
+
const capacityFor = (current, needed) => Math.min(half, Math.max(needed, current === 0 ? 4096 : current * 2));
|
|
26
|
+
return {
|
|
27
|
+
/** Retained buffer capacity, distinct from the transient encoded result. */
|
|
28
|
+
get allocatedBytes() {
|
|
29
|
+
return head.byteLength + tail.byteLength;
|
|
30
|
+
},
|
|
31
|
+
append(bytes) {
|
|
32
|
+
total += bytes.byteLength;
|
|
33
|
+
const prefix = Math.min(half - headBytes, bytes.byteLength);
|
|
34
|
+
if (headBytes + prefix > head.byteLength) {
|
|
35
|
+
const next = new Uint8Array(capacityFor(head.byteLength, headBytes + prefix));
|
|
36
|
+
next.set(head.subarray(0, headBytes));
|
|
37
|
+
head = next;
|
|
38
|
+
}
|
|
39
|
+
head.set(bytes.subarray(0, prefix), headBytes);
|
|
40
|
+
headBytes += prefix;
|
|
41
|
+
const remaining = bytes.subarray(prefix);
|
|
42
|
+
if (remaining.byteLength === 0)
|
|
43
|
+
return;
|
|
44
|
+
const needed = Math.min(half, tailBytes + remaining.byteLength);
|
|
45
|
+
if (needed > tail.byteLength) {
|
|
46
|
+
const next = new Uint8Array(capacityFor(tail.byteLength, needed));
|
|
47
|
+
const start = tailBytes === tail.byteLength ? tailPosition : 0;
|
|
48
|
+
const first = Math.min(tailBytes, tail.byteLength - start);
|
|
49
|
+
next.set(tail.subarray(start, start + first));
|
|
50
|
+
next.set(tail.subarray(0, tailBytes - first), first);
|
|
51
|
+
tail = next;
|
|
52
|
+
tailPosition = tailBytes;
|
|
53
|
+
}
|
|
54
|
+
const suffix = remaining.subarray(Math.max(0, remaining.byteLength - half));
|
|
55
|
+
if (remaining.byteLength >= half) {
|
|
56
|
+
tailBytes = 0;
|
|
57
|
+
tailPosition = 0;
|
|
58
|
+
}
|
|
59
|
+
const first = Math.min(suffix.byteLength, tail.byteLength - tailPosition);
|
|
60
|
+
tail.set(suffix.subarray(0, first), tailPosition);
|
|
61
|
+
tail.set(suffix.subarray(first), 0);
|
|
62
|
+
tailPosition = (tailPosition + suffix.byteLength) % tail.byteLength;
|
|
63
|
+
tailBytes = Math.min(half, tailBytes + remaining.byteLength);
|
|
64
|
+
},
|
|
65
|
+
finish() {
|
|
66
|
+
const bytes = new Uint8Array(headBytes + tailBytes);
|
|
67
|
+
bytes.set(head.subarray(0, headBytes));
|
|
68
|
+
const start = tailBytes === tail.byteLength ? tailPosition : 0;
|
|
69
|
+
const first = Math.min(tailBytes, tail.byteLength - start);
|
|
70
|
+
bytes.set(tail.subarray(start, start + first), headBytes);
|
|
71
|
+
bytes.set(tail.subarray(0, tailBytes - first), headBytes + first);
|
|
72
|
+
const droppedBytes = total - bytes.byteLength;
|
|
73
|
+
return {
|
|
74
|
+
encoding: "base64url",
|
|
75
|
+
output: base64url.encode(bytes),
|
|
76
|
+
truncated: droppedBytes === 0 ? null : { droppedBytes },
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/** The job read door, not an artifact-serving URL. */
|
|
82
|
+
const buildJobLogReference = (jobId) => `/api/builds/${encodeURIComponent(jobId)}?log`;
|
|
83
|
+
/** Preserve BirdDog's redacted 200-character status/mail budget and name the full log. */
|
|
84
|
+
export function buildJobDiagnostic(jobId, detail) {
|
|
85
|
+
const reference = `Log: ${buildJobLogReference(jobId)}`;
|
|
86
|
+
const diagnostic = boundedDiagnostic(detail) ?? "Build finished";
|
|
87
|
+
return `${reference}\n${diagnostic.slice(0, 200 - reference.length - 1)}`;
|
|
88
|
+
}
|
|
@@ -40,7 +40,13 @@ export declare function createFirstPartyAppSourceDistribution(options: {
|
|
|
40
40
|
readonly source: CapturedSource;
|
|
41
41
|
readonly entry: string;
|
|
42
42
|
}): Effect.Effect<FirstPartyAppSourceDistribution, unknown>;
|
|
43
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* How one build executor is composed; never part of a recipe or request.
|
|
45
|
+
* Build-log stdout/stderr are interleaved in arrival order and unlabelled.
|
|
46
|
+
* The job log is credential-bearing by design; it must never flow to
|
|
47
|
+
* diagnostics, Releases, agent surfaces, or support bundles without a
|
|
48
|
+
* recorded decision.
|
|
49
|
+
*/
|
|
44
50
|
export type LocalBuildExecutorOptions = Readonly<{
|
|
45
51
|
packageStoreDirectory?: string;
|
|
46
52
|
/** Host-hydrated metadata; supplied only for a cache-only pnpm install. */
|
|
@@ -53,6 +59,8 @@ export type LocalBuildExecutorOptions = Readonly<{
|
|
|
53
59
|
packageScripts?: "run";
|
|
54
60
|
/** Hears how long the dependency install and the compile each took. */
|
|
55
61
|
onPhase?: (phase: "install" | "build", milliseconds: number) => void;
|
|
62
|
+
/** Forward raw install/build output to the admitted Computer's job log. */
|
|
63
|
+
onOutput?: (stream: "stdout" | "stderr", bytes: Uint8Array) => void;
|
|
56
64
|
}>;
|
|
57
65
|
/** Exact pinned esbuild options shared by local builds and artifact-budget proofs. */
|
|
58
66
|
export declare function localSnapshotBuildOptions(source: CapturedSource, recipe: PinnedRecipe, emission: DefinitionEmission): esbuild.BuildOptions;
|
|
@@ -571,7 +571,7 @@ async function stopHtmlGroup(child) {
|
|
|
571
571
|
}
|
|
572
572
|
throw new Error("HTML process group survived its five-second cleanup bound");
|
|
573
573
|
}
|
|
574
|
-
function runHtmlCommand(args, cwd, env, command = "pnpm") {
|
|
574
|
+
function runHtmlCommand(args, cwd, env, command = "pnpm", onOutput) {
|
|
575
575
|
return Effect.acquireUseRelease(Effect.sync(() => {
|
|
576
576
|
if (process.platform === "win32")
|
|
577
577
|
throw new Error("HTML builds require POSIX process groups");
|
|
@@ -585,11 +585,13 @@ function runHtmlCommand(args, cwd, env, command = "pnpm") {
|
|
|
585
585
|
let stdout = "";
|
|
586
586
|
let stderr = "";
|
|
587
587
|
child.stdout.on("data", (chunk) => {
|
|
588
|
+
onOutput?.("stdout", chunk);
|
|
588
589
|
stdout += chunk.toString();
|
|
589
590
|
if (Buffer.byteLength(stdout) > 1024 * 1024)
|
|
590
591
|
reject(new Error("HTML command output exceeded its bound"));
|
|
591
592
|
});
|
|
592
593
|
child.stderr.on("data", (chunk) => {
|
|
594
|
+
onOutput?.("stderr", chunk);
|
|
593
595
|
stderr += chunk.toString();
|
|
594
596
|
if (Buffer.byteLength(stderr) > 1024 * 1024)
|
|
595
597
|
reject(new Error("HTML command diagnostics exceeded their bound"));
|
|
@@ -632,10 +634,10 @@ function snapshotBuildEnvironment(sourceSnapshotPath) {
|
|
|
632
634
|
}
|
|
633
635
|
function rebuildViteSnapshot(sourceSnapshotPath, recipe, options) {
|
|
634
636
|
if (recipe.kind === "source-html")
|
|
635
|
-
return rebuildNpmSnapshot(sourceSnapshotPath, recipe);
|
|
637
|
+
return rebuildNpmSnapshot(sourceSnapshotPath, recipe, options);
|
|
636
638
|
return Effect.gen(function* () {
|
|
637
639
|
const env = snapshotBuildEnvironment(sourceSnapshotPath);
|
|
638
|
-
const run = (args, cwd = sourceSnapshotPath) => runHtmlCommand(args, cwd, env);
|
|
640
|
+
const run = (args, cwd = sourceSnapshotPath) => runHtmlCommand(args, cwd, env, "pnpm", options.onOutput);
|
|
639
641
|
if ((yield* run(["--version"])).trim() !== "11.24.0") {
|
|
640
642
|
return yield* Effect.fail(new Error("Publisher requires pnpm 11.24.0"));
|
|
641
643
|
}
|
|
@@ -827,7 +829,7 @@ function readHtmlBuildOutput(sourceSnapshotPath, recipe) {
|
|
|
827
829
|
return Object.freeze({ kind: "bytes", bytes });
|
|
828
830
|
});
|
|
829
831
|
}
|
|
830
|
-
function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
|
|
832
|
+
function rebuildNpmSnapshot(sourceSnapshotPath, recipe, options) {
|
|
831
833
|
return Effect.gen(function* () {
|
|
832
834
|
const env = snapshotBuildEnvironment(sourceSnapshotPath);
|
|
833
835
|
const home = join(sourceSnapshotPath, ".publisher-home");
|
|
@@ -840,9 +842,9 @@ function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
|
|
|
840
842
|
await writeFile(userConfig, "", { flag: "wx" });
|
|
841
843
|
await writeFile(globalConfig, "", { flag: "wx" });
|
|
842
844
|
});
|
|
843
|
-
if ((yield* runHtmlCommand(["--version"], sourceSnapshotPath, env, "npm")).trim() !== recipe.toolchain.npm)
|
|
845
|
+
if ((yield* runHtmlCommand(["--version"], sourceSnapshotPath, env, "npm", options.onOutput)).trim() !== recipe.toolchain.npm)
|
|
844
846
|
return yield* Effect.fail(new Error("Captured npm version differs from the recipe"));
|
|
845
|
-
yield* runHtmlCommand(["ci", "--include=dev", "--ignore-scripts", "--no-audit", "--no-fund"], sourceSnapshotPath, env, "npm");
|
|
847
|
+
yield* runHtmlCommand(["ci", "--include=dev", "--ignore-scripts", "--no-audit", "--no-fund"], sourceSnapshotPath, env, "npm", options.onOutput);
|
|
846
848
|
const program = join(sourceSnapshotPath, ".publisher-build.mjs");
|
|
847
849
|
yield* Effect.tryPromise(async () => {
|
|
848
850
|
const { htmlBuildProgram } = await snapshotPrograms();
|
|
@@ -858,7 +860,7 @@ function rebuildNpmSnapshot(sourceSnapshotPath, recipe) {
|
|
|
858
860
|
dirname(recipe.entry),
|
|
859
861
|
"true",
|
|
860
862
|
"",
|
|
861
|
-
], sourceSnapshotPath, env, "node");
|
|
863
|
+
], sourceSnapshotPath, env, "node", options.onOutput);
|
|
862
864
|
return yield* readHtmlBuildOutput(sourceSnapshotPath, recipe);
|
|
863
865
|
});
|
|
864
866
|
}
|
|
@@ -982,9 +984,9 @@ export function createLocalBuildExecutor(options = {}) {
|
|
|
982
984
|
})))(await readFile(join(source.snapshotPath, "package.json"), "utf8"));
|
|
983
985
|
});
|
|
984
986
|
const environment = snapshotBuildEnvironment(source.snapshotPath);
|
|
985
|
-
if ((yield* runHtmlCommand(["--version"], source.snapshotPath, environment)).trim() !== "11.24.0")
|
|
987
|
+
if ((yield* runHtmlCommand(["--version"], source.snapshotPath, environment, "pnpm", options.onOutput)).trim() !== "11.24.0")
|
|
986
988
|
return yield* Effect.fail(new Error("Publisher requires pnpm 11.24.0"));
|
|
987
|
-
yield* runHtmlCommand(frozenSnapshotInstallArguments(options.packageStoreDirectory, options.packageCacheDirectory), source.snapshotPath, environment);
|
|
989
|
+
yield* runHtmlCommand(frozenSnapshotInstallArguments(options.packageStoreDirectory, options.packageCacheDirectory), source.snapshotPath, environment, "pnpm", options.onOutput);
|
|
988
990
|
}
|
|
989
991
|
}
|
|
990
992
|
const ui = yield* recipe.kind === "bundled-html"
|
package/dist/cloudflare.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { type AppBackendBindingName } from "@fungi.computer/puffball/app";
|
|
|
9
9
|
import { type InvocationFrame, type InvocationGate } from "./invocation.js";
|
|
10
10
|
import * as Schema from "effect/Schema";
|
|
11
11
|
import { z } from "zod";
|
|
12
|
+
import type { ResourceRef } from "./apps/installation.js";
|
|
12
13
|
import type { Release } from "@fungi.computer/puffball";
|
|
13
14
|
import { type UiBootCheckOutcome } from "./boot-gate.js";
|
|
14
15
|
export { checkBackendConstruction } from "./boot-construction.js";
|
|
@@ -39,6 +40,8 @@ export type FrameBindingMethod<Result> = Readonly<{
|
|
|
39
40
|
decodeResult: z.ZodType<Result>["parse"];
|
|
40
41
|
/** Determine the declared operations needed for these decoded arguments. */
|
|
41
42
|
requiredOperations: (args: readonly unknown[]) => readonly string[];
|
|
43
|
+
/** Select a concrete host resource after decoding, before provider dispatch. */
|
|
44
|
+
requestedResource?: (args: readonly unknown[]) => ResourceRef;
|
|
42
45
|
}>;
|
|
43
46
|
/** Method descriptors for the closed App binding vocabulary. */
|
|
44
47
|
export type FrameBindingMethods<Result> = Readonly<Partial<Record<AppBackendBindingName, Readonly<Record<string, FrameBindingMethod<Result>>>>>>;
|
|
@@ -119,7 +122,7 @@ export type AppInstanceLoader<FacetClass> = Readonly<{
|
|
|
119
122
|
getDurableObjectClass: (exportName: string) => FacetClass;
|
|
120
123
|
}>;
|
|
121
124
|
}>;
|
|
122
|
-
/**
|
|
125
|
+
/** Stop the shared native App facet at cohort drain or revocation. */
|
|
123
126
|
export declare function createCloudflareInvocationGate<Host, FacetClass>(ctx: Pick<AppInstanceContext<FacetClass>, "facets">, close: (frame: InvocationFrame<Host>) => Promise<void>): InvocationGate<Host>;
|
|
124
127
|
/**
|
|
125
128
|
* Run an App Instance inside a SQLite-backed Durable Object on workerd, celld
|
package/dist/cloudflare.js
CHANGED
|
@@ -267,7 +267,7 @@ const facetInvocationSchema = rpcHandleSchema({
|
|
|
267
267
|
invoke: rpcMethod(z.union([z.json(), z.undefined()])).input(z.tuple([z.string(), z.array(z.unknown()), z.unknown()])),
|
|
268
268
|
http: rpcMethod(facetHttpReplySchema).input(z.tuple([facetHttpInputSchema, z.unknown()])),
|
|
269
269
|
});
|
|
270
|
-
/**
|
|
270
|
+
/** Stop the shared native App facet at cohort drain or revocation. */
|
|
271
271
|
export function createCloudflareInvocationGate(ctx, close) {
|
|
272
272
|
return createInvocationGate({
|
|
273
273
|
abortGuest: () => {
|
package/dist/files.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* the Oyster's workspace unchanged. Other sources (a git repository) implement
|
|
7
7
|
* the same `FileSource`.
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { computer, routes } from "./authorization.js";
|
|
10
10
|
import * as Schema from "effect/Schema";
|
|
11
11
|
import { computerList, computerReadFile, computerWriteFile, } from "@fungi.computer/agar/computer";
|
|
12
12
|
const MAX_FILE_BYTES = 25 * 1024 * 1024;
|
|
@@ -66,10 +66,11 @@ export function fileCapabilities(source) {
|
|
|
66
66
|
},
|
|
67
67
|
];
|
|
68
68
|
}
|
|
69
|
+
/** The workspace is the Computer's: a key needs `computer.use` (see `authorization.ts`). */
|
|
69
70
|
function createFileRoutes(source) {
|
|
70
|
-
const
|
|
71
|
+
const table = routes();
|
|
71
72
|
const pathOf = (raw) => normalizeFilePath(raw ?? "");
|
|
72
|
-
|
|
73
|
+
table.get("/list", computer(), async (context) => {
|
|
73
74
|
const path = pathOf(context.req.query("path"));
|
|
74
75
|
if (path === null)
|
|
75
76
|
return refusal(400, "Invalid path");
|
|
@@ -80,7 +81,7 @@ function createFileRoutes(source) {
|
|
|
80
81
|
? refusal(404, "No such directory")
|
|
81
82
|
: Response.json(listing);
|
|
82
83
|
});
|
|
83
|
-
|
|
84
|
+
table.get("/content", computer(), async (context) => {
|
|
84
85
|
const path = pathOf(context.req.query("path"));
|
|
85
86
|
if (path === null)
|
|
86
87
|
return refusal(400, "Invalid path");
|
|
@@ -91,7 +92,7 @@ function createFileRoutes(source) {
|
|
|
91
92
|
headers: { "Content-Type": "application/octet-stream" },
|
|
92
93
|
});
|
|
93
94
|
});
|
|
94
|
-
|
|
95
|
+
table.put("/content", computer(), async (context) => {
|
|
95
96
|
const path = pathOf(context.req.query("path"));
|
|
96
97
|
if (path === null || path === "/")
|
|
97
98
|
return refusal(400, "Invalid path");
|
|
@@ -104,7 +105,7 @@ function createFileRoutes(source) {
|
|
|
104
105
|
await source.write(path, bytes);
|
|
105
106
|
return new Response(null, { status: 204 });
|
|
106
107
|
});
|
|
107
|
-
|
|
108
|
+
table.post("/mkdir", computer(), async (context) => {
|
|
108
109
|
const body = Schema.decodeUnknownOption(mkdirSchema)(await context.req.json());
|
|
109
110
|
const path = body._tag === "Some" ? normalizeFilePath(body.value.path) : null;
|
|
110
111
|
if (path === null || path === "/")
|
|
@@ -112,12 +113,12 @@ function createFileRoutes(source) {
|
|
|
112
113
|
await source.mkdir(path);
|
|
113
114
|
return new Response(null, { status: 204 });
|
|
114
115
|
});
|
|
115
|
-
|
|
116
|
+
table.post("/replace", computer(), async (context) => {
|
|
116
117
|
const body = Schema.decodeUnknownOption(replaceSchema)(await context.req.json());
|
|
117
118
|
const path = body._tag === "Some" ? normalizeFilePath(body.value.path) : null;
|
|
118
119
|
if (body._tag === "None" || path === null)
|
|
119
120
|
return refusal(400, "Invalid request");
|
|
120
121
|
return Response.json(await source.replace(path, body.value.expectedContent, body.value.content));
|
|
121
122
|
});
|
|
122
|
-
return
|
|
123
|
+
return table;
|
|
123
124
|
}
|