@fungi.computer/oyster 0.12.1 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/candidate-cli.mjs +257 -142
- package/dist/build/definition-emission.js +17 -3
- package/dist/build/local-build.d.ts +6 -0
- package/dist/build/local-build.js +104 -91
- package/dist/build/process-group.d.ts +6 -0
- package/dist/build/process-group.js +92 -0
- package/dist/build/workspace-build.d.ts +1 -1
- package/dist/build.d.ts +1 -1
- package/dist/build.js +1 -1
- package/dist/embed-scripts.js +1 -1
- package/dist/host-page-assets.d.ts +12 -0
- package/dist/host-page-assets.js +1 -0
- package/dist/host-page.d.ts +31 -0
- package/dist/host-page.js +342 -0
- package/dist/host.js +116 -49
- package/dist/pack.d.ts +3 -1
- package/dist/pack.js +28 -7
- package/dist/page/app-permissions.js +3 -13
- package/dist/page-script.d.ts +1 -1
- package/dist/page-script.js +2 -2
- package/dist/standalone/hello-app.d.ts +4 -1
- package/dist/standalone/hello-app.js +67 -22
- package/dist/standalone/hello-lesson.d.ts +2 -0
- package/dist/standalone/hello-lesson.js +36 -0
- package/dist/standalone/local-desktop.d.ts +6 -4
- package/dist/standalone/local-desktop.js +39 -20
- package/dist/standalone/sign-in-link.d.ts +2 -1
- package/dist/standalone/sign-in-link.js +94 -32
- package/dist/standalone/try-cli.d.ts +12 -9
- package/dist/standalone/try-cli.js +402 -137
- package/docs/api/pack.md +3 -2
- package/package.json +12 -8
package/dist/pack.js
CHANGED
|
@@ -2,6 +2,8 @@ import { mkdir, mkdtemp, readdir, readFile, rm, writeFile, } from "node:fs/promi
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join, relative, resolve } from "node:path";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Cause from "effect/Cause";
|
|
6
|
+
import * as Exit from "effect/Exit";
|
|
5
7
|
import * as Schema from "effect/Schema";
|
|
6
8
|
import { releaseSchema } from "@fungi.computer/puffball/effect";
|
|
7
9
|
import { installOnOyster, installationObservationSignal, completedInstallationResponse, } from "./installation-client.js";
|
|
@@ -23,6 +25,7 @@ async function filesUnder(directory) {
|
|
|
23
25
|
.sort();
|
|
24
26
|
}
|
|
25
27
|
async function packCapturedSource(options, sourceCapture) {
|
|
28
|
+
options.signal?.throwIfAborted();
|
|
26
29
|
const revision = parseSourceRevision(options.sourceRevision);
|
|
27
30
|
const out = resolve(options.outDirectory);
|
|
28
31
|
const artifactsDirectory = join(out, "artifacts");
|
|
@@ -33,14 +36,30 @@ async function packCapturedSource(options, sourceCapture) {
|
|
|
33
36
|
? {}
|
|
34
37
|
: { packageStoreDirectory: options.packageStoreDirectory }),
|
|
35
38
|
});
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const packed = await Effect.runPromiseExit(Effect.gen(function* () {
|
|
40
|
+
const prepared = yield* Effect.scoped(preparer.prepareCandidate(parseReleaseId(options.releaseId ??
|
|
41
|
+
`rel_${revision.slice("git:".length, "git:".length + 12)}`)));
|
|
42
|
+
// These are local artifact writes, not host installation admission.
|
|
43
|
+
// Settle them before the caller may remove its output directory.
|
|
44
|
+
return yield* Effect.uninterruptible(commitPreparedCandidate(prepared, {
|
|
45
|
+
artifactWriter: createLocalArtifactWriter(artifactsDirectory, options.recipe.assets),
|
|
46
|
+
releaseCatalog: { createRelease: (value) => Promise.resolve(value) },
|
|
47
|
+
}));
|
|
48
|
+
}), { signal: options.signal });
|
|
49
|
+
if (Exit.isFailure(packed)) {
|
|
50
|
+
// Scope cleanup defects must not disappear behind a simultaneous build failure.
|
|
51
|
+
const defect = packed.cause.reasons.find(Cause.isDieReason);
|
|
52
|
+
if (defect !== undefined)
|
|
53
|
+
throw defect.defect;
|
|
54
|
+
if (Cause.hasInterruptsOnly(packed.cause))
|
|
55
|
+
options.signal?.throwIfAborted();
|
|
56
|
+
throw Cause.squash(packed.cause);
|
|
57
|
+
}
|
|
58
|
+
const release = packed.value;
|
|
59
|
+
options.signal?.throwIfAborted();
|
|
42
60
|
await mkdir(out, { recursive: true });
|
|
43
61
|
await writeFile(join(out, "release.json"), `${Schema.encodeUnknownSync(Schema.fromJsonString(releaseSchema))(release)}\n`);
|
|
62
|
+
options.signal?.throwIfAborted();
|
|
44
63
|
const artifacts = (await filesUnder(artifactsDirectory)).map((path) => ({
|
|
45
64
|
artifactRef: parseArtifactRef(`artifact:${relative(artifactsDirectory, path)}`),
|
|
46
65
|
path,
|
|
@@ -56,7 +75,7 @@ export async function packRelease(options) {
|
|
|
56
75
|
* and install it, or switch an existing installation to it
|
|
57
76
|
* ({@link installRelease}).
|
|
58
77
|
* `waitMs` starts with the upload/observation phase after packing; a supplied
|
|
59
|
-
* caller signal retains its original lifetime
|
|
78
|
+
* caller signal also interrupts packing and retains its original lifetime.
|
|
60
79
|
*/
|
|
61
80
|
export async function installFromSource(input) {
|
|
62
81
|
const outDirectory = await mkdtemp(join(tmpdir(), "oyster-source-release-"));
|
|
@@ -67,6 +86,8 @@ export async function installFromSource(input) {
|
|
|
67
86
|
sourceRevision: input.source.sourceRevision,
|
|
68
87
|
outDirectory,
|
|
69
88
|
};
|
|
89
|
+
if (input.signal !== undefined)
|
|
90
|
+
options = { ...options, signal: input.signal };
|
|
70
91
|
if (input.releaseId !== undefined)
|
|
71
92
|
options = { ...options, releaseId: input.releaseId };
|
|
72
93
|
if (input.packageStoreDirectory !== undefined)
|
|
@@ -262,17 +262,7 @@ function ShellPermissionRow({ column, changed, otherChanges, disabled, onToggle,
|
|
|
262
262
|
gap: "var(--spacing-sm)",
|
|
263
263
|
padding: 0,
|
|
264
264
|
minHeight: 36,
|
|
265
|
-
}, children: [_jsx(Sigil, { name: column.sigil, size: 20 }), _jsxs("div", { style: {
|
|
266
|
-
display: "flex",
|
|
267
|
-
alignItems: "baseline",
|
|
268
|
-
gap: "var(--spacing-sm)",
|
|
269
|
-
minWidth: 0,
|
|
270
|
-
}, children: [_jsx("strong", { style: { whiteSpace: "nowrap", flexShrink: 0 }, children: column.label }), _jsx("span", { title: column.description, style: {
|
|
271
|
-
color: "var(--stipe-fg-muted)",
|
|
272
|
-
whiteSpace: "nowrap",
|
|
273
|
-
overflow: "hidden",
|
|
274
|
-
textOverflow: "ellipsis",
|
|
275
|
-
}, children: column.description })] }), _jsxs("div", { style: {
|
|
265
|
+
}, children: [_jsx(Sigil, { name: column.sigil, size: 20 }), _jsx("strong", { children: column.label }), _jsxs("div", { style: {
|
|
276
266
|
display: "flex",
|
|
277
267
|
alignItems: "center",
|
|
278
268
|
gap: "var(--spacing-sm)",
|
|
@@ -280,11 +270,11 @@ function ShellPermissionRow({ column, changed, otherChanges, disabled, onToggle,
|
|
|
280
270
|
? "Shell change not saved"
|
|
281
271
|
: on
|
|
282
272
|
? "Shell allowed"
|
|
283
|
-
: "Shell not allowed" }), _jsx(Button, { type: "button", size: "xs", variant: changed || !on ? "outline" : "ghost-destructive", disabled: disabled, onClick: changed ? onCancel : onToggle, children: changed ? "Cancel" : on ? "Revoke" : "Allow" })] })] }) }),
|
|
273
|
+
: "Shell not allowed" }), _jsx(Button, { type: "button", size: "xs", variant: changed || !on ? "outline" : "ghost-destructive", disabled: disabled, onClick: changed ? onCancel : onToggle, children: changed ? "Cancel" : on ? "Revoke" : "Allow" })] })] }) }), _jsxs("p", { style: {
|
|
284
274
|
margin: 0,
|
|
285
275
|
color: "var(--stipe-fg-muted)",
|
|
286
276
|
fontSize: "var(--text-sm)",
|
|
287
|
-
}, children: column.warning }), changed && (_jsx(FormFooter, { divider: false, status: otherChanges
|
|
277
|
+
}, children: [_jsx("span", { style: { display: "block" }, children: column.description }), column.warning] }), changed && (_jsx(FormFooter, { divider: false, status: otherChanges
|
|
288
278
|
? "Save all permission edits, including Shell access?"
|
|
289
279
|
: on
|
|
290
280
|
? "Allow Shell full access?"
|
package/dist/page-script.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const pageScript: string;
|
|
|
4
4
|
/** Shared host fonts, served once as a digest-pinned stylesheet. */
|
|
5
5
|
export declare const fontStyles: string;
|
|
6
6
|
|
|
7
|
-
/**
|
|
7
|
+
/** Nunito and Maple Mono, for host entry and recovery pages. */
|
|
8
8
|
export declare const loginFontStyles: string;
|
|
9
9
|
|
|
10
10
|
/** Caps styles for server-rendered host pages. */
|