@schoolai/shipyard 3.5.0 → 3.5.1-rc.20260504.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.
@@ -243,7 +243,7 @@ async function runDaemonChild() {
243
243
  env.SHIPYARD_USER_ID = authResult.userId;
244
244
  env.SHIPYARD_USER_DISPLAY_NAME = authResult.displayName;
245
245
  env.SHIPYARD_SIGNALING_URL = authResult.signalingUrl;
246
- const { serve } = await import("./serve-IVUGCBEE.js");
246
+ const { serve } = await import("./serve-NZHMK5B6.js");
247
247
  return serve({ isDev: env.SHIPYARD_DEV, autoOpenBrowser: !authResult.deviceFlowRan });
248
248
  }
249
249
  async function runSupervisor() {
@@ -282,4 +282,4 @@ async function runSupervisor() {
282
282
  export {
283
283
  startCommand
284
284
  };
285
- //# sourceMappingURL=start-I7ZONWK7.js.map
285
+ //# sourceMappingURL=start-GKOOIAPI.js.map
@@ -3,9 +3,9 @@ import {
3
3
  assertNever,
4
4
  decodeLine,
5
5
  encodeLine
6
- } from "../../chunk-SNYEQHUK.js";
7
- import "../../chunk-VPMN47TL.js";
8
- import "../../chunk-2H7UOFLK.js";
6
+ } from "./chunk-SNYEQHUK.js";
7
+ import "./chunk-VPMN47TL.js";
8
+ import "./chunk-2H7UOFLK.js";
9
9
 
10
10
  // src/services/watcher-worker/worker.ts
11
11
  async function runWorker(deps) {
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/services/watcher-worker/worker.ts"],"sourcesContent":["import { assertNever } from '../../shared/assert-never.js';\nimport {\n decodeLine,\n encodeLine,\n type WorkerCommand,\n type WorkerParcelEvent,\n type WorkerReply,\n type WorkerSubscribeOptions,\n} from './worker-protocol.js';\n\n/**\n * Watcher worker entry point — the only place in the daemon that imports\n * `@parcel/watcher` (post-Commit-4). The worker is intentionally minimal:\n * subscribe/unsubscribe/shutdown over stdio, no business logic, no state\n * beyond a Map<id, AsyncSubscription>.\n *\n * Crashes are expected (parcel/watcher SIGABRTs on FSEvents NULL-deref); we\n * keep the blast surface as small as possible so the parent's supervisor\n * can replay the subscription map onto a fresh worker.\n */\n\ninterface ParcelEventLike {\n type: 'create' | 'update' | 'delete';\n path: string;\n}\n\ninterface ParcelAsyncSubscriptionLike {\n unsubscribe(): Promise<void>;\n}\n\nexport type WorkerSubscribeFn = (\n path: string,\n fn: (err: Error | null, events: ParcelEventLike[]) => unknown,\n opts?: WorkerSubscribeOptions\n) => Promise<ParcelAsyncSubscriptionLike>;\n\nexport interface RunWorkerDeps {\n subscribe: WorkerSubscribeFn;\n stdin: NodeJS.ReadableStream;\n stdout: NodeJS.WritableStream;\n stderr: NodeJS.WritableStream;\n}\n\ninterface ActiveSubscription {\n handle: ParcelAsyncSubscriptionLike;\n}\n\nexport async function runWorker(deps: RunWorkerDeps): Promise<void> {\n const subs = new Map<string, ActiveSubscription>();\n let shuttingDown = false;\n let resolveDone: () => void;\n const done = new Promise<void>((resolve) => {\n resolveDone = resolve;\n });\n\n function logStderr(\n level: 'info' | 'warn' | 'error',\n event: string,\n extra?: Record<string, unknown>\n ): void {\n const payload = extra ? { level, event, ...extra } : { level, event };\n deps.stderr.write(`${JSON.stringify(payload)}\\n`);\n }\n\n function writeReply(reply: WorkerReply): void {\n deps.stdout.write(`${encodeLine(reply)}\\n`);\n }\n\n /** Coerce a parcel/watcher event into the protocol's strict shape. */\n function toWireEvents(events: ParcelEventLike[]): WorkerParcelEvent[] {\n return events.map((e) => ({ type: e.type, path: e.path }));\n }\n\n async function handleSubscribe(\n id: string,\n path: string,\n opts: WorkerSubscribeOptions\n ): Promise<void> {\n const callback = (err: Error | null, events: ParcelEventLike[]) => {\n if (err !== null) {\n logStderr('warn', 'watcher_callback_error', {\n id,\n path,\n err: err.message,\n });\n return;\n }\n /**\n * Drop events for ids that have been unsubscribed but whose underlying\n * watcher hasn't fully torn down yet.\n */\n if (!subs.has(id)) return;\n writeReply({ type: 'events', id, events: toWireEvents(events) });\n };\n\n try {\n const handle = await deps.subscribe(path, callback, opts);\n /** If the worker began shutdown while subscribe was in flight, undo. */\n if (shuttingDown) {\n await handle.unsubscribe().catch(() => {});\n return;\n }\n subs.set(id, { handle });\n writeReply({ type: 'subscribed', id });\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n writeReply({ type: 'subscribe_failed', id, error: message });\n }\n }\n\n async function handleUnsubscribe(id: string): Promise<void> {\n const entry = subs.get(id);\n subs.delete(id);\n if (entry) {\n try {\n await entry.handle.unsubscribe();\n } catch (err) {\n logStderr('warn', 'watcher_unsubscribe_failed', {\n id,\n err: err instanceof Error ? err.message : String(err),\n });\n }\n }\n writeReply({ type: 'unsubscribed', id });\n }\n\n async function handleShutdown(): Promise<void> {\n if (shuttingDown) return;\n shuttingDown = true;\n const entries = Array.from(subs.values());\n subs.clear();\n await Promise.all(\n entries.map(async (entry) => {\n try {\n await entry.handle.unsubscribe();\n } catch (err) {\n logStderr('warn', 'watcher_unsubscribe_failed_on_shutdown', {\n err: err instanceof Error ? err.message : String(err),\n });\n }\n })\n );\n resolveDone();\n }\n\n function dispatch(cmd: WorkerCommand): void {\n switch (cmd.cmd) {\n case 'subscribe':\n void handleSubscribe(cmd.id, cmd.path, cmd.opts);\n return;\n case 'unsubscribe':\n void handleUnsubscribe(cmd.id);\n return;\n case 'shutdown':\n void handleShutdown();\n return;\n default:\n assertNever(cmd);\n }\n }\n\n let buffer = '';\n deps.stdin.on('data', (chunk: Buffer | string) => {\n buffer += typeof chunk === 'string' ? chunk : chunk.toString('utf8');\n let nl = buffer.indexOf('\\n');\n while (nl !== -1) {\n const line = buffer.slice(0, nl);\n buffer = buffer.slice(nl + 1);\n nl = buffer.indexOf('\\n');\n if (line.length === 0) continue;\n const decoded = decodeLine(line);\n if (decoded === null) {\n logStderr('warn', 'worker_decode_failed', { line });\n continue;\n }\n /** Workers should never see Reply messages; ignore-and-log if they do. */\n if ('type' in decoded) {\n logStderr('warn', 'worker_received_unexpected_reply', { type: decoded.type });\n continue;\n }\n dispatch(decoded);\n }\n });\n\n /** Parent died → unsubscribe everything and exit. */\n deps.stdin.on('end', () => {\n void handleShutdown();\n });\n deps.stdin.on('close', () => {\n void handleShutdown();\n });\n\n return done;\n}\n\n/**\n * Default entry: when this file is run directly via `fork()` from the\n * supervisor, import `@parcel/watcher` and wire it up to runWorker. Tests\n * import `runWorker` directly and skip this branch entirely.\n */\nasync function main(): Promise<void> {\n const parcelWatcher = await import('@parcel/watcher');\n await runWorker({\n subscribe: (path, fn, opts) => parcelWatcher.subscribe(path, fn, toParcelOptions(opts)),\n stdin: process.stdin,\n stdout: process.stdout,\n stderr: process.stderr,\n });\n}\n\n/**\n * Translate the protocol's options shape to `@parcel/watcher`'s. The protocol\n * accepts `backend: 'default'` to mean \"use the platform default\" — parcel's\n * `BackendType` does not include 'default' and instead expects the field to\n * be omitted entirely.\n */\nfunction toParcelOptions(\n opts: WorkerSubscribeOptions | undefined\n): { ignore?: string[]; backend?: 'brute-force' | 'watchman' } | undefined {\n if (!opts) return undefined;\n const out: { ignore?: string[]; backend?: 'brute-force' | 'watchman' } = {};\n if (opts.ignore) out.ignore = opts.ignore;\n if (opts.backend && opts.backend !== 'default') out.backend = opts.backend;\n return out;\n}\n\nconst entryUrl = process.argv[1] ? `file://${process.argv[1]}` : null;\nif (entryUrl !== null && import.meta.url === entryUrl) {\n void main();\n}\n"],"mappings":";;;;;;;;;;AA+CA,eAAsB,UAAU,MAAoC;AAClE,QAAM,OAAO,oBAAI,IAAgC;AACjD,MAAI,eAAe;AACnB,MAAI;AACJ,QAAM,OAAO,IAAI,QAAc,CAAC,YAAY;AAC1C,kBAAc;AAAA,EAChB,CAAC;AAED,WAAS,UACP,OACA,OACA,OACM;AACN,UAAM,UAAU,QAAQ,EAAE,OAAO,OAAO,GAAG,MAAM,IAAI,EAAE,OAAO,MAAM;AACpE,SAAK,OAAO,MAAM,GAAG,KAAK,UAAU,OAAO,CAAC;AAAA,CAAI;AAAA,EAClD;AAEA,WAAS,WAAW,OAA0B;AAC5C,S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,EAAE,MAAM,QAAQ,KAAK,CAAC;AAC5E;AAAA,MACF;AACA,eAAS,OAAO;AAAA,IAClB;AAAA,EACF,CAAC;AAGD,OAAK,MAAM,GAAG,OAAO,MAAM;AACzB,SAAK,eAAe;AAAA,EACtB,CAAC;AACD,OAAK,MAAM,GAAG,SAAS,MAAM;AAC3B,SAAK,eAAe;AAAA,EACtB,CAAC;AAED,SAAO;AACT;AAOA,eAAe,OAAsB;AACnC,QAAM,gBAAgB,MAAM,OAAO,iBAAiB;AACpD,QAAM,UAAU;AAAA,IACd,WAAW,CAAC,MAAM,IAAI,SAAS,cAAc,UAAU,MAAM,IAAI,gBAAgB,IAAI,CAAC;AAAA,IACtF,OAAO,QAAQ;AAAA,IACf,QAAQ,QAAQ;AAAA,IAChB,QAAQ,QAAQ;AAAA,EAClB,CAAC;AACH;AAQA,SAAS,gBACP,MACyE;AACzE,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,MAAmE,CAAC;AAC1E,MAAI,KAAK,OAAQ,KAAI,SAAS,KAAK;AACnC,MAAI,KAAK,WAAW,KAAK,YAAY,UAAW,KAAI,UAAU,KAAK;AACnE,SAAO;AACT;AAEA,IAAM,WAAW,QAAQ,KAAK,CAAC,IAAI,UAAU,QAAQ,KAAK,CAAC,CAAC,KAAK;AACjE,IAAI,aAAa,QAAQ,YAAY,QAAQ,UAAU;AACrD,OAAK,KAAK;AACZ;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schoolai/shipyard",
3
- "version": "3.5.0",
3
+ "version": "3.5.1-rc.20260504.1",
4
4
  "description": "Shipyard daemon - Claude Agent SDK + Loro CRDT sync",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/services/watcher-worker/worker.ts"],"sourcesContent":["import { assertNever } from '../../shared/assert-never.js';\nimport {\n decodeLine,\n encodeLine,\n type WorkerCommand,\n type WorkerParcelEvent,\n type WorkerReply,\n type WorkerSubscribeOptions,\n} from './worker-protocol.js';\n\n/**\n * Watcher worker entry point — the only place in the daemon that imports\n * `@parcel/watcher` (post-Commit-4). The worker is intentionally minimal:\n * subscribe/unsubscribe/shutdown over stdio, no business logic, no state\n * beyond a Map<id, AsyncSubscription>.\n *\n * Crashes are expected (parcel/watcher SIGABRTs on FSEvents NULL-deref); we\n * keep the blast surface as small as possible so the parent's supervisor\n * can replay the subscription map onto a fresh worker.\n */\n\ninterface ParcelEventLike {\n type: 'create' | 'update' | 'delete';\n path: string;\n}\n\ninterface ParcelAsyncSubscriptionLike {\n unsubscribe(): Promise<void>;\n}\n\nexport type WorkerSubscribeFn = (\n path: string,\n fn: (err: Error | null, events: ParcelEventLike[]) => unknown,\n opts?: WorkerSubscribeOptions\n) => Promise<ParcelAsyncSubscriptionLike>;\n\nexport interface RunWorkerDeps {\n subscribe: WorkerSubscribeFn;\n stdin: NodeJS.ReadableStream;\n stdout: NodeJS.WritableStream;\n stderr: NodeJS.WritableStream;\n}\n\ninterface ActiveSubscription {\n handle: ParcelAsyncSubscriptionLike;\n}\n\nexport async function runWorker(deps: RunWorkerDeps): Promise<void> {\n const subs = new Map<string, ActiveSubscription>();\n let shuttingDown = false;\n let resolveDone: () => void;\n const done = new Promise<void>((resolve) => {\n resolveDone = resolve;\n });\n\n function logStderr(\n level: 'info' | 'warn' | 'error',\n event: string,\n extra?: Record<string, unknown>\n ): void {\n const payload = extra ? { level, event, ...extra } : { level, event };\n deps.stderr.write(`${JSON.stringify(payload)}\\n`);\n }\n\n function writeReply(reply: WorkerReply): void {\n deps.stdout.write(`${encodeLine(reply)}\\n`);\n }\n\n /** Coerce a parcel/watcher event into the protocol's strict shape. */\n function toWireEvents(events: ParcelEventLike[]): WorkerParcelEvent[] {\n return events.map((e) => ({ type: e.type, path: e.path }));\n }\n\n async function handleSubscribe(\n id: string,\n path: string,\n opts: WorkerSubscribeOptions\n ): Promise<void> {\n const callback = (err: Error | null, events: ParcelEventLike[]) => {\n if (err !== null) {\n logStderr('warn', 'watcher_callback_error', {\n id,\n path,\n err: err.message,\n });\n return;\n }\n /**\n * Drop events for ids that have been unsubscribed but whose underlying\n * watcher hasn't fully torn down yet.\n */\n if (!subs.has(id)) return;\n writeReply({ type: 'events', id, events: toWireEvents(events) });\n };\n\n try {\n const handle = await deps.subscribe(path, callback, opts);\n /** If the worker began shutdown while subscribe was in flight, undo. */\n if (shuttingDown) {\n await handle.unsubscribe().catch(() => {});\n return;\n }\n subs.set(id, { handle });\n writeReply({ type: 'subscribed', id });\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n writeReply({ type: 'subscribe_failed', id, error: message });\n }\n }\n\n async function handleUnsubscribe(id: string): Promise<void> {\n const entry = subs.get(id);\n subs.delete(id);\n if (entry) {\n try {\n await entry.handle.unsubscribe();\n } catch (err) {\n logStderr('warn', 'watcher_unsubscribe_failed', {\n id,\n err: err instanceof Error ? err.message : String(err),\n });\n }\n }\n writeReply({ type: 'unsubscribed', id });\n }\n\n async function handleShutdown(): Promise<void> {\n if (shuttingDown) return;\n shuttingDown = true;\n const entries = Array.from(subs.values());\n subs.clear();\n await Promise.all(\n entries.map(async (entry) => {\n try {\n await entry.handle.unsubscribe();\n } catch (err) {\n logStderr('warn', 'watcher_unsubscribe_failed_on_shutdown', {\n err: err instanceof Error ? err.message : String(err),\n });\n }\n })\n );\n resolveDone();\n }\n\n function dispatch(cmd: WorkerCommand): void {\n switch (cmd.cmd) {\n case 'subscribe':\n void handleSubscribe(cmd.id, cmd.path, cmd.opts);\n return;\n case 'unsubscribe':\n void handleUnsubscribe(cmd.id);\n return;\n case 'shutdown':\n void handleShutdown();\n return;\n default:\n assertNever(cmd);\n }\n }\n\n let buffer = '';\n deps.stdin.on('data', (chunk: Buffer | string) => {\n buffer += typeof chunk === 'string' ? chunk : chunk.toString('utf8');\n let nl = buffer.indexOf('\\n');\n while (nl !== -1) {\n const line = buffer.slice(0, nl);\n buffer = buffer.slice(nl + 1);\n nl = buffer.indexOf('\\n');\n if (line.length === 0) continue;\n const decoded = decodeLine(line);\n if (decoded === null) {\n logStderr('warn', 'worker_decode_failed', { line });\n continue;\n }\n /** Workers should never see Reply messages; ignore-and-log if they do. */\n if ('type' in decoded) {\n logStderr('warn', 'worker_received_unexpected_reply', { type: decoded.type });\n continue;\n }\n dispatch(decoded);\n }\n });\n\n /** Parent died → unsubscribe everything and exit. */\n deps.stdin.on('end', () => {\n void handleShutdown();\n });\n deps.stdin.on('close', () => {\n void handleShutdown();\n });\n\n return done;\n}\n\n/**\n * Default entry: when this file is run directly via `fork()` from the\n * supervisor, import `@parcel/watcher` and wire it up to runWorker. Tests\n * import `runWorker` directly and skip this branch entirely.\n */\nasync function main(): Promise<void> {\n const parcelWatcher = await import('@parcel/watcher');\n await runWorker({\n subscribe: (path, fn, opts) => parcelWatcher.subscribe(path, fn, toParcelOptions(opts)),\n stdin: process.stdin,\n stdout: process.stdout,\n stderr: process.stderr,\n });\n}\n\n/**\n * Translate the protocol's options shape to `@parcel/watcher`'s. The protocol\n * accepts `backend: 'default'` to mean \"use the platform default\" — parcel's\n * `BackendType` does not include 'default' and instead expects the field to\n * be omitted entirely.\n */\nfunction toParcelOptions(\n opts: WorkerSubscribeOptions | undefined\n): { ignore?: string[]; backend?: 'brute-force' | 'watchman' } | undefined {\n if (!opts) return undefined;\n const out: { ignore?: string[]; backend?: 'brute-force' | 'watchman' } = {};\n if (opts.ignore) out.ignore = opts.ignore;\n if (opts.backend && opts.backend !== 'default') out.backend = opts.backend;\n return out;\n}\n\nconst entryUrl = process.argv[1] ? `file://${process.argv[1]}` : null;\nif (entryUrl !== null && import.meta.url === entryUrl) {\n void main();\n}\n"],"mappings":";;;;;;;;;;AA+CA,eAAsB,UAAU,MAAoC;AAClE,QAAM,OAAO,oBAAI,IAAgC;AACjD,MAAI,eAAe;AACnB,MAAI;AACJ,QAAM,OAAO,IAAI,QAAc,CAAC,YAAY;AAC1C,kBAAc;AAAA,EAChB,CAAC;AAED,WA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