@schoolai/shipyard 3.3.0-rc.20260424.2 → 3.3.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/dist/index.js CHANGED
@@ -106,7 +106,7 @@ async function handleSubcommand() {
106
106
  return true;
107
107
  }
108
108
  if (subcommand === "start") {
109
- const { startCommand } = await import("./start-VMJBLE7N.js");
109
+ const { startCommand } = await import("./start-NVYMND3X.js");
110
110
  await startCommand();
111
111
  return true;
112
112
  }
@@ -123,7 +123,7 @@ async function main() {
123
123
  const args = parseCliArgs();
124
124
  if (args.serve) {
125
125
  await loadAuthFromConfig(env);
126
- const { serve } = await import("./serve-SSRZNIMO.js");
126
+ const { serve } = await import("./serve-QLYUK5XN.js");
127
127
  return serve({ isDev: env.SHIPYARD_DEV });
128
128
  }
129
129
  logger.error("Use `shipyard start` to run the daemon. Use --help for usage.");
@@ -29316,7 +29316,12 @@ var PublishTtlSchema = external_exports.enum(PUBLISH_TTL_CHOICES).default("24h")
29316
29316
  var PublishTargetSchema = external_exports.discriminatedUnion("kind", [
29317
29317
  external_exports.object({ kind: external_exports.literal("slug"), slug: external_exports.string().min(1) }),
29318
29318
  external_exports.object({ kind: external_exports.literal("canvasElementId"), canvasElementId: external_exports.string().min(1) }),
29319
- external_exports.object({ kind: external_exports.literal("previewPort"), previewPort: external_exports.number().int().positive().max(65535) })
29319
+ external_exports.object({
29320
+ kind: external_exports.literal("previewPort"),
29321
+ previewPort: external_exports.number().int().positive().max(65535),
29322
+ canvasElementId: external_exports.string().optional(),
29323
+ projectRoot: external_exports.string().optional()
29324
+ })
29320
29325
  ]);
29321
29326
  var PublishInputSchema = external_exports.object({
29322
29327
  target: PublishTargetSchema,
@@ -37889,6 +37894,13 @@ async function runPublishPreviewPort(input, ctx) {
37889
37894
  const bindKey = resolvedProjectRoot !== null ? sha256Hex(resolvedProjectRoot) : null;
37890
37895
  const existing = bindKey !== null ? input.publishedArtifactStore?.getBinding(input.taskId, "preview", bindKey) ?? null : null;
37891
37896
  const buildRoot = resolvedProjectRoot ?? input.projectRoot;
37897
+ ctx.log?.({
37898
+ event: "publish_preview_resolved",
37899
+ agentHint: agentHint ?? null,
37900
+ detectedPortMatch: detectedPortMatch?.projectRoot ?? null,
37901
+ resolvedProjectRoot,
37902
+ buildRoot
37903
+ });
37892
37904
  const built = await detectAndBuild(buildRoot, ctx);
37893
37905
  if (!built.ok) return built.outcome;
37894
37906
  ctx.onProgress("uploading");
@@ -38058,7 +38070,7 @@ async function handlePublishRequest(params) {
38058
38070
  publishedArtifactStore: params.publishedArtifactStore,
38059
38071
  getDetectedPorts: params.getDetectedPorts
38060
38072
  },
38061
- { onProgress: emitProgress }
38073
+ { onProgress: emitProgress, ...params.log !== void 0 && { log: params.log } }
38062
38074
  );
38063
38075
  if (outcome.ok) {
38064
38076
  emitResult({ ok: true, id: outcome.id, url: outcome.url, expiresAt: outcome.expiresAt });
@@ -51574,8 +51586,17 @@ var VisualizationFileWatcher = class {
51574
51586
  });
51575
51587
  if (match2) {
51576
51588
  const matchTreeId = match2.id;
51577
- this.#deps.canvasRepo.updateElement(params.taskId, matchTreeId, { data: loroData });
51578
- return { kind: "updated", elementId: `${match2.id}`, data };
51589
+ const preservedData = (() => {
51590
+ if (data.projectRoot !== void 0) return data;
51591
+ const existing = extractPreviewData(match2.data.data);
51592
+ if (existing?.projectRoot) {
51593
+ return { ...data, projectRoot: existing.projectRoot };
51594
+ }
51595
+ return data;
51596
+ })();
51597
+ const preservedLoroData = previewDataToLoroValue(preservedData);
51598
+ this.#deps.canvasRepo.updateElement(params.taskId, matchTreeId, { data: preservedLoroData });
51599
+ return { kind: "updated", elementId: `${match2.id}`, data: preservedData };
51579
51600
  }
51580
51601
  const positionable = existingElements.map((el) => ({
51581
51602
  x: el.data.x,
@@ -51743,7 +51764,9 @@ var VisualizationRegistry = class {
51743
51764
  if (params.url !== void 0) data.url = params.url;
51744
51765
  if (params.proxyPort !== void 0) data.proxyPort = params.proxyPort;
51745
51766
  if (params.initialPath !== void 0) data.initialPath = params.initialPath;
51746
- if (params.projectRoot !== void 0) data.projectRoot = params.projectRoot;
51767
+ if (typeof params.projectRoot === "string" && params.projectRoot.length > 0) {
51768
+ data.projectRoot = params.projectRoot;
51769
+ }
51747
51770
  return data;
51748
51771
  }
51749
51772
  /**
@@ -85319,7 +85342,14 @@ async function handlePublish(ctx, input) {
85319
85342
  };
85320
85343
  }
85321
85344
  const { target, ttl, title } = parsed.data;
85322
- const normalizedTarget = "slug" in target ? { kind: "slug", slug: target.slug } : "canvasElementId" in target ? { kind: "canvasElementId", canvasElementId: target.canvasElementId } : { kind: "previewPort", previewPort: target.previewPort };
85345
+ const normalizedTarget = target.kind === "slug" ? { kind: "slug", slug: target.slug } : target.kind === "previewPort" ? {
85346
+ kind: "previewPort",
85347
+ previewPort: target.previewPort,
85348
+ ...target.canvasElementId !== void 0 && {
85349
+ canvasElementId: target.canvasElementId
85350
+ },
85351
+ ...target.projectRoot !== void 0 && { projectRoot: target.projectRoot }
85352
+ } : { kind: "canvasElementId", canvasElementId: target.canvasElementId };
85323
85353
  const outcome = await runPublish(
85324
85354
  {
85325
85355
  target: normalizedTarget,
@@ -104858,7 +104888,8 @@ function wireControlChannel(rawChannel, daemon, logAdapter, deps) {
104858
104888
  event: "publish_request_received",
104859
104889
  correlationId,
104860
104890
  targetKind: target.kind,
104861
- ttl
104891
+ ttl,
104892
+ ...target.kind === "previewPort" && target.projectRoot !== void 0 ? { projectRoot: target.projectRoot } : {}
104862
104893
  });
104863
104894
  const wrappedSendControl = (msg) => {
104864
104895
  if (msg.type === "publish_result") {
@@ -104901,7 +104932,11 @@ function wireControlChannel(rawChannel, daemon, logAdapter, deps) {
104901
104932
  vizWatcher,
104902
104933
  publishedArtifactStore,
104903
104934
  getDetectedPorts,
104904
- sendControl: wrappedSendControl
104935
+ sendControl: wrappedSendControl,
104936
+ log: (entry) => {
104937
+ const event = typeof entry.event === "string" ? entry.event : "publish_log";
104938
+ logAdapter({ ...entry, event, correlationId });
104939
+ }
104905
104940
  }).catch((err) => {
104906
104941
  logAdapter({
104907
104942
  event: "publish_request_unhandled_error",
@@ -109401,4 +109436,4 @@ export {
109401
109436
  _testing,
109402
109437
  serve
109403
109438
  };
109404
- //# sourceMappingURL=serve-SSRZNIMO.js.map
109439
+ //# sourceMappingURL=serve-QLYUK5XN.js.map