@fungi.computer/computer 0.16.5 → 0.17.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.
@@ -0,0 +1,91 @@
1
+ import { ComputerServiceNotFoundError, computerServiceViewSchema, computerServiceNameSchema, maximumProcessLogLines, serviceLogsOutputSchema, } from "@fungi.computer/computer-contract";
2
+ import { z } from "zod";
3
+ import { applyDeclaredServices, ComputerServicesCommandError, } from "./services-apply.js";
4
+ const supervisorStatus = z.strictObject({
5
+ services: z.record(computerServiceNameSchema, z.strictObject({
6
+ state: z.enum(["up", "restarting", "down"]),
7
+ pid: z.number().int().positive().optional(),
8
+ seconds: z.number().int().nonnegative().optional(),
9
+ })),
10
+ });
11
+ const logTail = serviceLogsOutputSchema;
12
+ async function command(runtime, operation, text) {
13
+ const result = await runtime.run(text);
14
+ if (result.status !== "completed" || result.exitCode !== 0)
15
+ throw new ComputerServicesCommandError(operation, result);
16
+ return result.stdout;
17
+ }
18
+ /** Render and start what is declared, now, but only on a runtime that already runs. */
19
+ async function applyWhileAwake(inventory, runtime) {
20
+ if (!(await runtime.awake()))
21
+ return false;
22
+ await applyDeclaredServices({
23
+ inventory,
24
+ run: (text) => runtime.run(text),
25
+ whenEmpty: "run",
26
+ });
27
+ return true;
28
+ }
29
+ async function views(inventory, runtime) {
30
+ const declared = inventory.list();
31
+ const awake = await runtime.awake();
32
+ const live = awake
33
+ ? supervisorStatus.parse(JSON.parse(await command(runtime, "status", "fungi-services status"))).services
34
+ : {};
35
+ return declared.map((service) => computerServiceViewSchema.parse({
36
+ ...service,
37
+ status: !awake
38
+ ? { state: "asleep" }
39
+ : (live[service.name] ??
40
+ // Declared and enabled but not rendered yet, or stopped and not rendered.
41
+ { state: service.enabled ? "restarting" : "down" }),
42
+ }));
43
+ }
44
+ async function viewOf(inventory, runtime, service) {
45
+ const found = (await views(inventory, runtime)).find((view) => view.name === service.name);
46
+ if (found === undefined)
47
+ throw new ComputerServiceNotFoundError(service.name);
48
+ return found;
49
+ }
50
+ /** `list_services`: every declaration with its live status; reading never wakes the Computer. */
51
+ export async function listServices(inventory, runtime) {
52
+ return { services: [...(await views(inventory, runtime))] };
53
+ }
54
+ /** `declare_service`: save, then start now if the Computer is awake. */
55
+ export async function declareService(inventory, runtime, input, declaredBy) {
56
+ const service = inventory.declare(input, declaredBy);
57
+ await applyWhileAwake(inventory, runtime);
58
+ return viewOf(inventory, runtime, service);
59
+ }
60
+ /** `stop_service` and `start_service`: change whether it is declared as running. */
61
+ export async function setServiceEnabled(inventory, runtime, name, enabled) {
62
+ const service = inventory.setEnabled(name, enabled);
63
+ await applyWhileAwake(inventory, runtime);
64
+ return viewOf(inventory, runtime, service);
65
+ }
66
+ /** `restart_service`: apply first, then restart one that was already declared to run. */
67
+ export async function restartService(inventory, runtime, name) {
68
+ const before = inventory.get(name);
69
+ if (before === undefined)
70
+ throw new ComputerServiceNotFoundError(name);
71
+ const service = inventory.setEnabled(name, true);
72
+ if (await applyWhileAwake(inventory, runtime))
73
+ if (before.enabled)
74
+ await command(runtime, "restart", `fungi-services restart ${name}`);
75
+ return viewOf(inventory, runtime, service);
76
+ }
77
+ /** `remove_service`: forget it, stopping it if the Computer is awake. */
78
+ export async function removeService(inventory, runtime, name) {
79
+ inventory.remove(name);
80
+ await applyWhileAwake(inventory, runtime);
81
+ return { name, removed: true };
82
+ }
83
+ /** `service_logs`: the newest lines, kept only while the Computer is awake. */
84
+ export async function serviceLogs(inventory, runtime, input) {
85
+ if (inventory.get(input.name) === undefined)
86
+ throw new ComputerServiceNotFoundError(input.name);
87
+ if (!(await runtime.awake()))
88
+ return { name: input.name, lines: [], truncated: false };
89
+ const lines = input.lines ?? maximumProcessLogLines;
90
+ return logTail.parse(JSON.parse(await command(runtime, "logs", `fungi-services logs ${input.name} ${String(lines)}`)));
91
+ }
@@ -0,0 +1,38 @@
1
+ import { computerServiceSchema, type computerServiceDeclarationSchema } from "@fungi.computer/computer-contract";
2
+ import { z } from "zod";
3
+ import { type ExposedPortStorage } from "./port-ownership.js";
4
+ /** A declared service as stored, the shape the contract names. */
5
+ export type ComputerService = z.output<typeof computerServiceSchema>;
6
+ /** What a person or Agent declares: name, command and optional cwd, port and env. */
7
+ export type ComputerServiceDeclaration = z.output<typeof computerServiceDeclarationSchema>;
8
+ /** The JSON `fungi-services apply` reads on stdin to render the supervisor's directories. */
9
+ export type ApplyService = Pick<ComputerService, "name" | "command" | "cwd" | "env" | "enabled">;
10
+ export type ComputerServicesApply = Readonly<{
11
+ services: readonly Readonly<ApplyService>[];
12
+ }>;
13
+ /**
14
+ * The Computer's declared services: the durable rules, never the live state.
15
+ * Whether one is up is read from the supervisor on demand. A service's port is
16
+ * admitted through the same table as a process's, so a port has one owner.
17
+ */
18
+ export declare class ComputerServiceInventory {
19
+ #private;
20
+ constructor(storage: ExposedPortStorage, now: () => number);
21
+ /** Declare or replace one service; it is enabled, so the next apply starts it. */
22
+ declare(input: ComputerServiceDeclaration, declaredBy: string): ComputerService;
23
+ /** One service, or `undefined` when none is declared by that name. */
24
+ get(name: string): ComputerService | undefined;
25
+ /** Every declared service by name. */
26
+ list(): readonly ComputerService[];
27
+ /** Start or stop declaring a service as running; a stopped one stays declared. */
28
+ setEnabled(name: string, enabled: boolean): ComputerService;
29
+ /** Remove a declaration and the port it owned. */
30
+ remove(name: string): void;
31
+ /**
32
+ * Re-admit every declared service port. The process inventory rebuilds the
33
+ * exposure table when its own schema changes; the declarations outlive that.
34
+ */
35
+ ensurePorts(): void;
36
+ /** What `fungi-services apply` renders: every declaration and whether it runs. */
37
+ applyPayload(): ComputerServicesApply;
38
+ }
@@ -0,0 +1,123 @@
1
+ import { ComputerServiceLimitError, ComputerServiceNotFoundError, computerServiceSchema, maximumComputerServices, } from "@fungi.computer/computer-contract";
2
+ import { z } from "zod";
3
+ import { claimPort, createExposedPorts, releasePortsOwnedBy, } from "./port-ownership.js";
4
+ const envColumn = z.record(z.string(), z.string());
5
+ function toService(row) {
6
+ const env = envColumn.parse(JSON.parse(row.env));
7
+ const service = {
8
+ name: row.name,
9
+ command: row.command,
10
+ enabled: row.enabled === 1,
11
+ declaredBy: row.declared_by,
12
+ declaredAt: row.declared_at,
13
+ revision: row.revision,
14
+ };
15
+ if (row.cwd !== null)
16
+ service.cwd = row.cwd;
17
+ if (row.port !== null)
18
+ service.port = row.port;
19
+ if (Object.keys(env).length > 0)
20
+ service.env = env;
21
+ return computerServiceSchema.parse(service);
22
+ }
23
+ const ownerOf = (name) => `service:${name}`;
24
+ /**
25
+ * The Computer's declared services: the durable rules, never the live state.
26
+ * Whether one is up is read from the supervisor on demand. A service's port is
27
+ * admitted through the same table as a process's, so a port has one owner.
28
+ */
29
+ export class ComputerServiceInventory {
30
+ #storage;
31
+ #now;
32
+ constructor(storage, now) {
33
+ this.#storage = storage;
34
+ this.#now = now;
35
+ storage.transactionSync(() => {
36
+ createExposedPorts(storage);
37
+ storage.sql.exec("CREATE TABLE IF NOT EXISTS computer_services (name TEXT PRIMARY KEY, command TEXT NOT NULL, cwd TEXT, port INTEGER, env TEXT NOT NULL DEFAULT '{}', enabled INTEGER NOT NULL CHECK (enabled IN (0,1)), declared_by TEXT NOT NULL, declared_at INTEGER NOT NULL, revision INTEGER NOT NULL CHECK (revision >= 1)) STRICT");
38
+ });
39
+ }
40
+ #row(name) {
41
+ return this.#storage.sql
42
+ .exec("SELECT * FROM computer_services WHERE name = ?", name)
43
+ .toArray()[0];
44
+ }
45
+ /** Declare or replace one service; it is enabled, so the next apply starts it. */
46
+ declare(input, declaredBy) {
47
+ return this.#storage.transactionSync(() => {
48
+ const existing = this.#row(input.name);
49
+ if (existing === undefined) {
50
+ const count = this.#storage.sql
51
+ .exec("SELECT COUNT(*) AS count FROM computer_services")
52
+ .toArray()[0]?.count ?? maximumComputerServices;
53
+ if (count >= maximumComputerServices)
54
+ throw new ComputerServiceLimitError();
55
+ }
56
+ // Only a port that moves is released: keeping it must not reset its
57
+ // visibility or share links.
58
+ if (existing?.port != null && existing.port !== (input.port ?? null))
59
+ releasePortsOwnedBy(this.#storage, ownerOf(input.name));
60
+ if (input.port !== undefined)
61
+ claimPort(this.#storage, input.port, ownerOf(input.name));
62
+ this.#storage.sql.exec("INSERT INTO computer_services (name, command, cwd, port, env, enabled, declared_by, declared_at, revision) VALUES (?, ?, ?, ?, ?, 1, ?, ?, 1) ON CONFLICT(name) DO UPDATE SET command = excluded.command, cwd = excluded.cwd, port = excluded.port, env = excluded.env, enabled = 1, declared_by = excluded.declared_by, declared_at = excluded.declared_at, revision = revision + 1", input.name, input.command, input.cwd ?? null, input.port ?? null, JSON.stringify(input.env ?? {}), declaredBy, this.#now());
63
+ return this.#require(input.name);
64
+ });
65
+ }
66
+ #require(name) {
67
+ const row = this.#row(name);
68
+ if (row === undefined)
69
+ throw new ComputerServiceNotFoundError(name);
70
+ return toService(row);
71
+ }
72
+ /** One service, or `undefined` when none is declared by that name. */
73
+ get(name) {
74
+ const row = this.#row(name);
75
+ return row === undefined ? undefined : toService(row);
76
+ }
77
+ /** Every declared service by name. */
78
+ list() {
79
+ return this.#storage.sql
80
+ .exec("SELECT * FROM computer_services ORDER BY name")
81
+ .toArray()
82
+ .map(toService);
83
+ }
84
+ /** Start or stop declaring a service as running; a stopped one stays declared. */
85
+ setEnabled(name, enabled) {
86
+ return this.#storage.transactionSync(() => {
87
+ this.#require(name);
88
+ this.#storage.sql.exec("UPDATE computer_services SET enabled = ? WHERE name = ?", enabled ? 1 : 0, name);
89
+ return this.#require(name);
90
+ });
91
+ }
92
+ /** Remove a declaration and the port it owned. */
93
+ remove(name) {
94
+ this.#storage.transactionSync(() => {
95
+ this.#require(name);
96
+ releasePortsOwnedBy(this.#storage, ownerOf(name));
97
+ this.#storage.sql.exec("DELETE FROM computer_services WHERE name = ?", name);
98
+ });
99
+ }
100
+ /**
101
+ * Re-admit every declared service port. The process inventory rebuilds the
102
+ * exposure table when its own schema changes; the declarations outlive that.
103
+ */
104
+ ensurePorts() {
105
+ this.#storage.transactionSync(() => {
106
+ for (const service of this.list())
107
+ if (service.port !== undefined)
108
+ claimPort(this.#storage, service.port, ownerOf(service.name));
109
+ });
110
+ }
111
+ /** What `fungi-services apply` renders: every declaration and whether it runs. */
112
+ applyPayload() {
113
+ const services = this.list().map(({ name, command, cwd, env, enabled }) => {
114
+ const entry = { name, command, enabled };
115
+ if (cwd !== undefined)
116
+ entry.cwd = cwd;
117
+ if (env !== undefined)
118
+ entry.env = env;
119
+ return entry;
120
+ });
121
+ return { services };
122
+ }
123
+ }
@@ -5362,8 +5362,8 @@ var require_coerce = __commonJS({
5362
5362
  const minor = match4[3] || "0";
5363
5363
  const patch = match4[4] || "0";
5364
5364
  const prerelease = options.includePrerelease && match4[5] ? `-${match4[5]}` : "";
5365
- const build2 = options.includePrerelease && match4[6] ? `+${match4[6]}` : "";
5366
- return parse6(`${major}.${minor}.${patch}${prerelease}${build2}`, options);
5365
+ const build = options.includePrerelease && match4[6] ? `+${match4[6]}` : "";
5366
+ return parse6(`${major}.${minor}.${patch}${prerelease}${build}`, options);
5367
5367
  };
5368
5368
  module.exports = coerce;
5369
5369
  }
@@ -22999,12 +22999,12 @@ async function createDefinitionEmission(source, recipe) {
22999
22999
  let declarationCode;
23000
23000
  const declarationPlugin = {
23001
23001
  name: "derived-app-declaration",
23002
- setup(build2) {
23003
- build2.onResolve(
23002
+ setup(build) {
23003
+ build.onResolve(
23004
23004
  { filter: /^fungi:app-declaration$/ },
23005
23005
  (args2) => args2.kind === "entry-point" ? { path: "app-declaration.js", namespace: declarationNamespace } : void 0
23006
23006
  );
23007
- build2.onLoad(
23007
+ build.onLoad(
23008
23008
  { filter: /.*/, namespace: declarationNamespace },
23009
23009
  () => ({
23010
23010
  contents: `import { appBackend } from ${JSON.stringify(definitionPath)}; import { buildAppDeclaration } from ${JSON.stringify(buildOnlySdk)}; export const appDeclaration = buildAppDeclaration(appBackend, ${JSON.stringify(packageDeclaration)});`,
@@ -24405,7 +24405,6 @@ import { dirname as dirname3, isAbsolute as isAbsolute4, join as join3, relative
24405
24405
  import { readFile as readFile2, realpath as realpath2 } from "node:fs/promises";
24406
24406
  import { dirname as dirname2, extname, join as join2 } from "node:path";
24407
24407
  import { fileURLToPath, pathToFileURL as pathToFileURL2, URL as URL3 } from "node:url";
24408
- import { build } from "esbuild";
24409
24408
 
24410
24409
  // ../../node_modules/.pnpm/parse5@8.0.1/node_modules/parse5/dist/common/unicode.js
24411
24410
  var UNDEFINED_CODE_POINTS = /* @__PURE__ */ new Set([
@@ -32290,6 +32289,15 @@ function parse3(html, options) {
32290
32289
  return Parser.parse(html, options);
32291
32290
  }
32292
32291
 
32292
+ // src/lazy-import.ts
32293
+ async function loadLazily(load3, what) {
32294
+ try {
32295
+ return await load3();
32296
+ } catch (cause) {
32297
+ throw new Error(`${what} failed to load`, { cause });
32298
+ }
32299
+ }
32300
+
32293
32301
  // src/build/app-imports.ts
32294
32302
  var codeExtensions = /* @__PURE__ */ new Set([
32295
32303
  ".js",
@@ -32344,6 +32352,10 @@ async function appRuntimeImports(options) {
32344
32352
  if (path !== void 0)
32345
32353
  modules.push({ entryPoints: [await contained(join2(root, path))] });
32346
32354
  const imports = /* @__PURE__ */ new Set();
32355
+ const { build } = await loadLazily(
32356
+ () => import("esbuild"),
32357
+ "Oyster's App build tool (esbuild)"
32358
+ );
32347
32359
  for (const module of modules) {
32348
32360
  const result2 = await build({
32349
32361
  ...module,
@@ -32411,14 +32423,14 @@ var manifestSchema = fromJsonString2(
32411
32423
  );
32412
32424
  function readBuildManifest(packageJson) {
32413
32425
  const manifest = decodeUnknownSync(manifestSchema)(packageJson);
32414
- const build2 = manifest.fungi?.build;
32426
+ const build = manifest.fungi?.build;
32415
32427
  return {
32416
32428
  ...manifest,
32417
32429
  fungi: {
32418
32430
  ...manifest.fungi,
32419
- build: build2 === void 0 ? void 0 : decodeUnknownSync(workspaceBuildPolicySchema, {
32431
+ build: build === void 0 ? void 0 : decodeUnknownSync(workspaceBuildPolicySchema, {
32420
32432
  onExcessProperty: "error"
32421
- })(build2)
32433
+ })(build)
32422
32434
  }
32423
32435
  };
32424
32436
  }
@@ -32583,19 +32595,19 @@ async function resolveWorkspaceBuild(options) {
32583
32595
  const path = within(root, join3(appDirectory, stylesheet));
32584
32596
  steps.push({ kind: "tailwind", input: path, output: path });
32585
32597
  }
32586
- const build2 = {
32598
+ const build = {
32587
32599
  directory,
32588
32600
  packageName,
32589
32601
  react: policy.react === true,
32590
32602
  dependencies: Object.freeze(dependencies),
32591
32603
  steps: Object.freeze(steps)
32592
32604
  };
32593
- if (policy.shellEntry === void 0) return Object.freeze(build2);
32605
+ if (policy.shellEntry === void 0) return Object.freeze(build);
32594
32606
  const shellEntry = relative3(
32595
32607
  join3(root, directory),
32596
32608
  join3(root, appDirectory, policy.shellEntry)
32597
32609
  ).split(sep3).join("/");
32598
- return Object.freeze({ ...build2, shellEntry });
32610
+ return Object.freeze({ ...build, shellEntry });
32599
32611
  }
32600
32612
 
32601
32613
  // src/build/bundled-html.ts
@@ -35996,8 +36008,8 @@ var workspacePackageSchema = Struct({
35996
36008
  name: String4.pipe(check(isMinLength(1))),
35997
36009
  path: String4.pipe(check(isMinLength(1)))
35998
36010
  });
35999
- function productionWorkspaceSelectors(build2) {
36000
- return ["--filter-prod", `${build2.packageName}...`];
36011
+ function productionWorkspaceSelectors(build) {
36012
+ return ["--filter-prod", `${build.packageName}...`];
36001
36013
  }
36002
36014
  function capturedWorkspaceBuild(snapshot, entry, run2, backendEntry) {
36003
36015
  return flatMap2(
@@ -36072,7 +36084,7 @@ function snapshotBuildEnvironment(sourceSnapshotPath) {
36072
36084
  };
36073
36085
  return env;
36074
36086
  }
36075
- function rebuildViteSnapshot(sourceSnapshotPath, recipe, options) {
36087
+ function rebuildViteSnapshot(sourceSnapshotPath, recipe, options, shared) {
36076
36088
  if (recipe.kind === "source-html")
36077
36089
  return rebuildNpmSnapshot(sourceSnapshotPath, recipe, options);
36078
36090
  return gen2(function* () {
@@ -36098,15 +36110,23 @@ function rebuildViteSnapshot(sourceSnapshotPath, recipe, options) {
36098
36110
  )
36099
36111
  );
36100
36112
  const installStarted = performance.now();
36101
- yield* run2([
36102
- ...productionWorkspaceSelectors(html),
36103
- ...frozenSnapshotInstallArguments(
36104
- options.packageStoreDirectory,
36105
- options.packageCacheDirectory
36106
- )
36107
- ]);
36113
+ if (shared === null)
36114
+ yield* run2([
36115
+ ...productionWorkspaceSelectors(html),
36116
+ ...frozenSnapshotInstallArguments(
36117
+ options.packageStoreDirectory,
36118
+ options.packageCacheDirectory
36119
+ )
36120
+ ]);
36121
+ else if (shared.snapshotPath !== sourceSnapshotPath || !productionWorkspaceSelectors(html).every(
36122
+ (selector) => shared.selectors.has(selector)
36123
+ ))
36124
+ return yield* fail5(
36125
+ new Error("The shared install did not hydrate this App's workspace")
36126
+ );
36108
36127
  const buildStarted = performance.now();
36109
- options.onPhase?.("install", buildStarted - installStarted);
36128
+ if (shared === null)
36129
+ options.onPhase?.("install", buildStarted - installStarted);
36110
36130
  const appDirectory = join5(sourceSnapshotPath, html.directory);
36111
36131
  const dependencies = join5(appDirectory, ".publisher-dependencies.mjs");
36112
36132
  const program = join5(appDirectory, ".publisher-build.mjs");
@@ -36120,8 +36140,11 @@ function rebuildViteSnapshot(sourceSnapshotPath, recipe, options) {
36120
36140
  catch: (error2) => error2
36121
36141
  })
36122
36142
  );
36143
+ const steps = html.steps.filter(
36144
+ (step) => step.kind !== "typescript" || !shared?.compiled.has(step.config)
36145
+ );
36123
36146
  const groups = [];
36124
- for (const step of html.steps) {
36147
+ for (const step of steps) {
36125
36148
  const last = groups.at(-1);
36126
36149
  if (step.kind === "typescript" && last?.every((member) => member.kind === "typescript"))
36127
36150
  last.push(step);
@@ -36154,6 +36177,9 @@ function rebuildViteSnapshot(sourceSnapshotPath, recipe, options) {
36154
36177
  ],
36155
36178
  appDirectory
36156
36179
  );
36180
+ for (const compiled of group)
36181
+ if (compiled.kind === "typescript")
36182
+ shared?.compiled.add(compiled.config);
36157
36183
  }
36158
36184
  yield* run2(
36159
36185
  [
@@ -36448,6 +36474,9 @@ function localSnapshotBuildOptions(source, recipe, emission) {
36448
36474
  return options;
36449
36475
  }
36450
36476
  function createLocalBuildExecutor(options = {}) {
36477
+ return createWorkspaceBuildExecutor(options, null);
36478
+ }
36479
+ function createWorkspaceBuildExecutor(options, shared) {
36451
36480
  const emissions = /* @__PURE__ */ new WeakMap();
36452
36481
  const compiler2 = {
36453
36482
  build: (source, recipe) => {
@@ -36514,7 +36543,7 @@ function createLocalBuildExecutor(options = {}) {
36514
36543
  const ui = yield* recipe.kind === "bundled-html" ? tryPromise2({
36515
36544
  try: () => readBundledHtml(source.snapshotPath, recipe),
36516
36545
  catch: () => new Error("Captured HTML bundle failed validation")
36517
- }) : rebuildViteSnapshot(source.snapshotPath, recipe, options);
36546
+ }) : rebuildViteSnapshot(source.snapshotPath, recipe, options, shared);
36518
36547
  const code = yield* compiler2.build(source, {
36519
36548
  bundle: true,
36520
36549
  entry,
@@ -36540,7 +36569,7 @@ function createLocalBuildExecutor(options = {}) {
36540
36569
  };
36541
36570
  });
36542
36571
  }
36543
- return recipe.format !== "esm" ? rebuildViteSnapshot(source.snapshotPath, recipe, options) : acquireUseRelease2(
36572
+ return recipe.format !== "esm" ? rebuildViteSnapshot(source.snapshotPath, recipe, options, shared) : acquireUseRelease2(
36544
36573
  tryPromise2({
36545
36574
  try: () => {
36546
36575
  const emission = emissions.get(source);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fungi.computer/computer",
3
- "version": "0.16.5",
3
+ "version": "0.17.0",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "description": "Cloudflare Computer host for one durable Fungi Computer",
6
6
  "type": "module",
@@ -50,6 +50,10 @@
50
50
  "./port-access": {
51
51
  "types": "./dist/port-access.d.ts",
52
52
  "import": "./dist/port-access.js"
53
+ },
54
+ "./services": {
55
+ "types": "./dist/services.d.ts",
56
+ "import": "./dist/services.js"
53
57
  }
54
58
  },
55
59
  "files": [
@@ -62,12 +66,12 @@
62
66
  "dependencies": {
63
67
  "@fungi.computer/cairn": "0.1.0",
64
68
  "@fungi.computer/capnweb": "0.12.0-fungi.0",
65
- "@fungi.computer/cloudflare-computer": "0.2.1-fungi.2",
69
+ "@fungi.computer/cloudflare-computer": "0.2.1-fungi.3",
66
70
  "@fungi.computer/cordyceps": "0.4.3",
67
- "@fungi.computer/knapsack": "0.4.23",
68
- "@fungi.computer/seam": "0.2.6",
69
- "@fungi.computer/watchdog": "0.1.4",
70
- "@fungi.computer/computer-contract": "0.5.10",
71
+ "@fungi.computer/knapsack": "0.4.24",
72
+ "@fungi.computer/seam": "0.2.7",
73
+ "@fungi.computer/watchdog": "0.1.5",
74
+ "@fungi.computer/computer-contract": "0.6.0",
71
75
  "effect": "4.0.2",
72
76
  "just-bash": "3.4.2",
73
77
  "zod": "4.4.3",
@@ -119,7 +123,7 @@
119
123
  "build:container": "bash ../../tooling/proof-runner/run-proof.sh docker build --load --platform linux/amd64 --provenance=false .",
120
124
  "build:native": "fungi-apply-patch-build --out native/bin",
121
125
  "clean": "node --input-type=module --eval \"import { rm } from 'node:fs/promises'; await rm('dist', { recursive: true, force: true });\"",
122
- "test": "pnpm run test:unit && pnpm run test:fleet-native && node test/files-rpc.native.mjs && node test/shell-groups.native.mjs && node test/port-proof.mjs && node test/terminal-container-proof.mjs && node test/ssh-container-proof.mjs && node test/fuse-startup-proof.mjs && node test/container-resource-proof.mjs && node test/runtime-proof.mjs && node test/process-schema-proof.mjs && node test/process-proof.mjs && node test/terminal-proof.mjs && pnpm run test:app-method-execution && pnpm run test:execution-lifecycle && pnpm run test:home-patch",
126
+ "test": "pnpm run test:unit && pnpm run test:fleet-native && node test/files-rpc.native.mjs && node test/shell-groups.native.mjs && node test/port-proof.mjs && node test/services-proof.mjs && node test/services-wake-proof.mjs && node test/terminal-container-proof.mjs && node test/ssh-container-proof.mjs && node test/fuse-startup-proof.mjs && node test/container-resource-proof.mjs && node test/runtime-proof.mjs && node test/process-schema-proof.mjs && node test/process-proof.mjs && node test/terminal-proof.mjs && pnpm run test:app-method-execution && pnpm run test:execution-lifecycle && pnpm run test:home-patch",
123
127
  "format:check": "node ../../tooling/repository/scripts/format-package-check.mjs",
124
128
  "lint:anti-slop": "node ../../tooling/repository/scripts/lint-package-anti-slop.mjs",
125
129
  "test:merge": "pnpm run test",
@@ -129,7 +133,8 @@
129
133
  "test:ssh-container": "node test/ssh-container-proof.mjs",
130
134
  "test:preview-failure:browser": "node test/preview-failure.browser.mjs",
131
135
  "test:execution-lifecycle": "node test/execution-lifecycle-proof.mjs",
132
- "test:unit": "bash ../../tooling/proof-runner/hermetic-host.sh -- sh -c \"node --test --test-concurrency=${BOTANICAL_TEST_WORKERS:-4} test/egress-policy.test.mjs test/preview.test.mjs test/port-failure.test.mjs test/port-access.test.mjs test/process-wait.test.mjs test/fleet.test.mjs test/proof-worker.test.mjs test/proof-client.test.mjs test/native-readiness.test.mjs test/workspace-sync.test.mjs test/runtime-observer.test.mjs test/files-patch.test.mjs test/exec-output.test.mjs && node --test --test-concurrency=${BOTANICAL_TEST_WORKERS:-4} test/seam-signature.test.mjs test/local-backend-replay.test.mjs test/machine-link-reopen-replay.test.mjs test/computer-backends.test.mjs test/terminal-welcome.test.mjs test/on-box-vm.test.mjs && node test/terminal-protocol.test.mjs && node test/container-policy.test.mjs && node test/files-adapter-proof.mjs && node test/operation-record-proof.mjs && node test/process-inventory-proof.mjs\"",
136
+ "test:unit": "bash ../../tooling/proof-runner/hermetic-host.sh -- sh -c \"node --test --test-concurrency=${BOTANICAL_TEST_WORKERS:-4} test/egress-policy.test.mjs test/preview.test.mjs test/port-failure.test.mjs test/port-access.test.mjs test/process-wait.test.mjs test/fleet.test.mjs test/proof-worker.test.mjs test/proof-client.test.mjs test/native-readiness.test.mjs test/workspace-sync.test.mjs test/runtime-observer.test.mjs test/files-patch.test.mjs test/exec-output.test.mjs test/tools-install.test.mjs test/services.test.mjs test/services-apply.test.mjs test/services-tools.test.mjs test/services-render.test.mjs && node --test --test-concurrency=${BOTANICAL_TEST_WORKERS:-4} test/seam-signature.test.mjs test/local-backend-replay.test.mjs test/machine-link-reopen-replay.test.mjs test/computer-backends.test.mjs test/terminal-welcome.test.mjs test/on-box-vm.test.mjs && node test/terminal-protocol.test.mjs && node test/container-policy.test.mjs && node test/files-adapter-proof.mjs && node test/operation-record-proof.mjs && node test/process-inventory-proof.mjs\"",
137
+ "test:services": "node test/services-proof.mjs && node test/services-wake-proof.mjs",
133
138
  "test:fleet-native": "node test/fleet.native.mjs",
134
139
  "assemble:image": "node scripts/assemble-image.mjs"
135
140
  }