@duct-sdk/sdk 0.3.3 → 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 +8 -0
- package/dist/cli/generators/config.js +1 -0
- package/dist/cli/index.js +12 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
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
|
+
|
|
5
13
|
## [0.3.3] — 2026-06-09
|
|
6
14
|
|
|
7
15
|
### Fixed
|
|
@@ -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) {
|