@duct-sdk/sdk 0.3.2 → 0.3.4

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/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  Public release notes for the Duct SDK. Versioning follows [semver](https://semver.org).
4
4
 
5
+ ## [0.3.4] — 2026-06-10
6
+
7
+ ### Fixed
8
+ - **`duct push` schema validation** — validates the loaded manifest against `DuctConfigSchema` before upload. Catches missing `product.baseUrl` and other required fields instead of pushing a broken manifest that fails at action-invoke time.
9
+
10
+ ### Changed
11
+ - **Manual mode template** — `duct init --manual` product block now documents optional `apiBaseUrl` (action proxy target; defaults to `baseUrl`).
12
+
13
+ ## [0.3.3] — 2026-06-09
14
+
15
+ ### Fixed
16
+ - **Stable iframe `src`** — `userContext` is no longer embedded in the shell iframe URL; context is delivered via `DUCT_READY` postMessage instead. Prevents full iframe reloads when the host page navigates after a deeplink handoff.
17
+
5
18
  ## [0.3.2] — 2026-06-09
6
19
 
7
20
  ### Added
@@ -4,7 +4,7 @@
4
4
  // ============================================================
5
5
  "use client";
6
6
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
7
- import React, { useEffect, useRef, useCallback, useState, } from "react";
7
+ import React, { useEffect, useRef, useCallback, useMemo, useState, } from "react";
8
8
  import { resolveShellDimensions, } from "../../core/types.js";
9
9
  /**
10
10
  * Hook that polls the shell status endpoint once on mount.
@@ -135,7 +135,10 @@ export function DuctShell({ shellId, userContext, onTokenRequest, onNavigate, on
135
135
  }, [readyCheck, shellId, shellHost]);
136
136
  const controlled = open !== undefined;
137
137
  const panelOpen = controlled ? open : isOpen;
138
- const shellUrl = buildShellUrl(shellHost, shellId, userContext);
138
+ // Keep iframe src stable across parent-page navigations (deeplink handoff).
139
+ // userContext is delivered via postMessage on DUCT_READY — embedding it in the
140
+ // URL would reload the iframe whenever the host page context changes.
141
+ const shellUrl = useMemo(() => buildShellUrl(shellHost, shellId), [shellHost, shellId]);
139
142
  const shellOrigin = (() => {
140
143
  try {
141
144
  return new URL(shellHost).origin;
@@ -223,6 +223,7 @@ export default defineDuctConfig({
223
223
  name: ${JSON.stringify(productName)},
224
224
  description: ${JSON.stringify(`${productName} — AI-powered interaction shell`)},
225
225
  baseUrl: ${JSON.stringify(baseUrl)},${logoLine}
226
+ // apiBaseUrl: optional separate origin for action HTTP proxy (defaults to baseUrl)
226
227
  },
227
228
 
228
229
  // Authentication — detected: ${authStrategy}
package/dist/cli/index.js CHANGED
@@ -15,6 +15,7 @@ import * as os from "os";
15
15
  import * as vm from "node:vm";
16
16
  import { pathToFileURL, fileURLToPath } from "node:url";
17
17
  import { readFileSync } from "fs";
18
+ import { DuctConfigSchema } from "../core/config.js";
18
19
  // ----------------------------------------------------------------
19
20
  // Load all standard .env files in dotenv priority order
20
21
  // Priority (last-loaded wins when key already set by earlier file):
@@ -423,6 +424,17 @@ program
423
424
  process.exit(1);
424
425
  }
425
426
  spinner.succeed("Config loaded");
427
+ const validation = DuctConfigSchema.safeParse(config);
428
+ if (!validation.success) {
429
+ spinner.fail("Config validation failed");
430
+ console.log(chalk.red("\nInvalid duct.config.ts:\n"));
431
+ for (const err of validation.error.errors) {
432
+ console.log(chalk.red(` • [${err.path.join(".")}] ${err.message}`));
433
+ }
434
+ console.log(chalk.gray("\nSee /docs/configuration for the required manifest shape.\n"));
435
+ process.exit(1);
436
+ }
437
+ config = validation.data;
426
438
  // Warn on weak DUCT_SECRET_KEY — must be ≥ 32 chars for adequate HMAC entropy
427
439
  const secretKey = process.env["DUCT_SECRET_KEY"];
428
440
  if (secretKey && secretKey.length < 32) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duct-sdk/sdk",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "description": "Duct SDK — A shell (like terminal) that knows when to talk, when to show, and when to hand off.",
6
6
  "main": "dist/index.js",