@duct-sdk/sdk 0.5.13 → 0.7.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/CHANGELOG.md +61 -0
- package/README.md +418 -264
- package/TOKEN_SPEC.md +243 -243
- package/dist/cli/action-confusion-format.d.ts +17 -0
- package/dist/cli/action-confusion-format.js +24 -0
- package/dist/cli/add.d.ts +7 -0
- package/dist/cli/add.js +152 -0
- package/dist/cli/agent-prompt.d.ts +3 -0
- package/dist/cli/agent-prompt.js +39 -0
- package/dist/cli/api-sources.d.ts +26 -0
- package/dist/cli/api-sources.js +222 -0
- package/dist/cli/cloud.d.ts +162 -0
- package/dist/cli/cloud.js +306 -0
- package/dist/cli/config-loader.d.ts +14 -0
- package/dist/cli/config-loader.js +56 -7
- package/dist/cli/device-login.d.ts +17 -0
- package/dist/cli/device-login.js +75 -0
- package/dist/cli/drift.js +6 -6
- package/dist/cli/generators/any-stack.d.ts +3 -0
- package/dist/cli/generators/any-stack.js +97 -0
- package/dist/cli/generators/config.js +3 -2
- package/dist/cli/generators/receiver.js +7 -7
- package/dist/cli/generators/shell.js +12 -12
- package/dist/cli/generators/token-route.js +245 -245
- package/dist/cli/generators/wiring-snippets.d.ts +0 -14
- package/dist/cli/generators/wiring-snippets.js +188 -305
- package/dist/cli/index.js +396 -611
- package/dist/cli/mcp-core.d.ts +42 -0
- package/dist/cli/mcp-core.js +161 -0
- package/dist/cli/mcp-setup.d.ts +4 -0
- package/dist/cli/mcp-setup.js +352 -0
- package/dist/cli/mcp.d.ts +2 -0
- package/dist/cli/mcp.js +457 -0
- package/dist/cli/migrate-intershell.js +5 -5
- package/dist/cli/policy-defaults.d.ts +37 -0
- package/dist/cli/policy-defaults.js +127 -0
- package/dist/cli/policy-replay-format.d.ts +9 -0
- package/dist/cli/policy-replay-format.js +46 -0
- package/dist/cli/processors/integration-audit.js +2 -2
- package/dist/cli/processors/openapi-parser.d.ts +5 -0
- package/dist/cli/processors/openapi-parser.js +8 -3
- package/dist/cli/project-loader.d.ts +58 -0
- package/dist/cli/project-loader.js +198 -0
- package/dist/cli/project-writer.d.ts +23 -0
- package/dist/cli/project-writer.js +171 -0
- package/dist/cli/push.d.ts +43 -0
- package/dist/cli/push.js +308 -0
- package/dist/cli/safety-checks.d.ts +9 -0
- package/dist/cli/safety-checks.js +29 -0
- package/dist/cli/setup.d.ts +20 -0
- package/dist/cli/setup.js +349 -0
- package/dist/cli/shell-name.d.ts +8 -0
- package/dist/cli/shell-name.js +29 -0
- package/dist/cli/shells.d.ts +22 -0
- package/dist/cli/shells.js +122 -0
- package/dist/cli/split.d.ts +7 -0
- package/dist/cli/split.js +71 -0
- package/dist/cli/sync.d.ts +25 -0
- package/dist/cli/sync.js +120 -0
- package/dist/cli/test-runner.d.ts +21 -0
- package/dist/cli/test-runner.js +281 -0
- package/dist/core/compile.d.ts +43 -0
- package/dist/core/compile.js +512 -0
- package/dist/core/config.d.ts +538 -19
- package/dist/core/config.js +22 -14
- package/dist/core/login-handoff.d.ts +1 -1
- package/dist/core/login-handoff.js +1 -1
- package/dist/core/project.d.ts +1864 -0
- package/dist/core/project.js +291 -0
- package/dist/core/readiness-checks.js +2 -2
- package/dist/core/types.d.ts +10 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/project.d.ts +4 -0
- package/dist/project.js +8 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +1 -0
- package/package.json +94 -95
- package/dist/adapters/react/page-context-guard.test.d.ts +0 -1
- package/dist/adapters/react/page-context-guard.test.js +0 -15
- package/dist/cli/agents/api-agent.d.ts +0 -22
- package/dist/cli/agents/api-agent.js +0 -761
- package/dist/cli/agents/auth-agent.d.ts +0 -7
- package/dist/cli/agents/auth-agent.js +0 -212
- package/dist/cli/agents/deeplink-agent.d.ts +0 -6
- package/dist/cli/agents/deeplink-agent.js +0 -285
- package/dist/cli/agents/llm.d.ts +0 -33
- package/dist/cli/agents/llm.js +0 -309
- package/dist/cli/agents/pipeline.d.ts +0 -72
- package/dist/cli/agents/pipeline.js +0 -421
- package/dist/cli/agents/reviewer-agent.d.ts +0 -13
- package/dist/cli/agents/reviewer-agent.js +0 -450
- package/dist/cli/agents/route-agent.d.ts +0 -17
- package/dist/cli/agents/route-agent.js +0 -383
- package/dist/cli/config-loader.test.d.ts +0 -1
- package/dist/cli/config-loader.test.js +0 -63
- package/dist/cli/detectors/topology.d.ts +0 -46
- package/dist/cli/detectors/topology.js +0 -417
- package/dist/cli/generators/config.test.d.ts +0 -1
- package/dist/cli/generators/config.test.js +0 -222
- package/dist/cli/generators/shell.test.d.ts +0 -1
- package/dist/cli/generators/shell.test.js +0 -73
- package/dist/cli/generators/token-route.test.d.ts +0 -1
- package/dist/cli/generators/token-route.test.js +0 -53
- package/dist/cli/generators/wiring-snippets.test.d.ts +0 -1
- package/dist/cli/generators/wiring-snippets.test.js +0 -80
- package/dist/cli/init.d.ts +0 -32
- package/dist/cli/init.js +0 -1336
- package/dist/cli/manifest-diff.test.d.ts +0 -1
- package/dist/cli/manifest-diff.test.js +0 -144
- package/dist/cli/processors/curl-parser.test.d.ts +0 -1
- package/dist/cli/processors/curl-parser.test.js +0 -24
- package/dist/cli/processors/integration-audit.test.d.ts +0 -1
- package/dist/cli/processors/integration-audit.test.js +0 -154
- package/dist/cli/processors/postprocess.d.ts +0 -22
- package/dist/cli/processors/postprocess.js +0 -107
- package/dist/cli/processors/prisma-parser.d.ts +0 -35
- package/dist/cli/processors/prisma-parser.js +0 -117
- package/dist/cli/processors/verify-discovery.d.ts +0 -33
- package/dist/cli/processors/verify-discovery.js +0 -193
- package/dist/cli/processors/verify-discovery.test.d.ts +0 -1
- package/dist/cli/processors/verify-discovery.test.js +0 -153
- package/dist/cli/processors/zod-extractor.d.ts +0 -27
- package/dist/cli/processors/zod-extractor.js +0 -153
- package/dist/cli/prompts/review.d.ts +0 -61
- package/dist/cli/prompts/review.js +0 -410
- package/dist/cli/selectors/express.d.ts +0 -12
- package/dist/cli/selectors/express.js +0 -117
- package/dist/cli/selectors/fastapi.d.ts +0 -12
- package/dist/cli/selectors/fastapi.js +0 -122
- package/dist/cli/selectors/generic.d.ts +0 -10
- package/dist/cli/selectors/generic.js +0 -74
- package/dist/cli/selectors/index.d.ts +0 -37
- package/dist/cli/selectors/index.js +0 -315
- package/dist/cli/selectors/next.d.ts +0 -12
- package/dist/cli/selectors/next.js +0 -130
- package/dist/core/config-policy.test.d.ts +0 -1
- package/dist/core/config-policy.test.js +0 -101
- package/dist/core/config-roundtrip.test.d.ts +0 -1
- package/dist/core/config-roundtrip.test.js +0 -180
- package/dist/core/endpoint-guard.test.d.ts +0 -1
- package/dist/core/endpoint-guard.test.js +0 -57
- package/dist/core/env-diagnostics.test.d.ts +0 -1
- package/dist/core/env-diagnostics.test.js +0 -31
- package/dist/core/evidence-bundle.conformance.test.d.ts +0 -1
- package/dist/core/evidence-bundle.conformance.test.js +0 -110
- package/dist/core/evidence-bundle.test.d.ts +0 -1
- package/dist/core/evidence-bundle.test.js +0 -58
- package/dist/core/invariants.test.d.ts +0 -1
- package/dist/core/invariants.test.js +0 -217
- package/dist/core/login-handoff.test.d.ts +0 -1
- package/dist/core/login-handoff.test.js +0 -31
- package/dist/core/profile.test.d.ts +0 -1
- package/dist/core/profile.test.js +0 -95
- package/dist/core/readiness-checks.test.d.ts +0 -1
- package/dist/core/readiness-checks.test.js +0 -106
- package/dist/core/receipt.test.d.ts +0 -1
- package/dist/core/receipt.test.js +0 -75
- package/dist/core/sdk-entrypoint.test.d.ts +0 -1
- package/dist/core/sdk-entrypoint.test.js +0 -8
- package/dist/core/side-effects-review.test.d.ts +0 -1
- package/dist/core/side-effects-review.test.js +0 -28
- package/dist/core/token.conformance.test.d.ts +0 -1
- package/dist/core/token.conformance.test.js +0 -43
- package/dist/core/token.test.d.ts +0 -1
- package/dist/core/token.test.js +0 -66
|
@@ -235,7 +235,7 @@ export function generateManualTemplate(opts) {
|
|
|
235
235
|
* Generated in manual mode — no AI agents were used.
|
|
236
236
|
* Fill in the routes, actions, and deeplinks sections below, then run:
|
|
237
237
|
*
|
|
238
|
-
* npx duct push
|
|
238
|
+
* npx @duct-sdk/sdk push
|
|
239
239
|
*
|
|
240
240
|
* to sync this manifest with Duct cloud.
|
|
241
241
|
*
|
|
@@ -438,7 +438,8 @@ export function generateConfigFile(config) {
|
|
|
438
438
|
* It defines what routes exist, what actions agents can invoke,
|
|
439
439
|
* and what deeplinks the shell can hand off to.
|
|
440
440
|
*
|
|
441
|
-
* Edit freely
|
|
441
|
+
* Edit freely, then \`npx @duct-sdk/sdk test\` → \`npx @duct-sdk/sdk push\`.
|
|
442
|
+
* Prefer the duct/ project layout: \`npx @duct-sdk/sdk split\`.
|
|
442
443
|
* Docs: ${docsBase}/config
|
|
443
444
|
*/
|
|
444
445
|
|
|
@@ -16,7 +16,7 @@ const REPLAY_STORE_VERIFY_OPTIONS = `,
|
|
|
16
16
|
function generateNextAppRouterReceiver(_config) {
|
|
17
17
|
const docsBase = getDocsUrl();
|
|
18
18
|
return `/**
|
|
19
|
-
* Duct Deeplink Receiver —
|
|
19
|
+
* Duct Deeplink Receiver — generated by \`npx @duct-sdk/sdk add identity\`
|
|
20
20
|
*
|
|
21
21
|
* This route receives signed deeplinks from the Duct shell and navigates
|
|
22
22
|
* the user to the correct page with pre-loaded state.
|
|
@@ -161,7 +161,7 @@ function buildRedirectPath(
|
|
|
161
161
|
function generateNextPagesRouterReceiver(_config) {
|
|
162
162
|
const docsBase = getDocsUrl();
|
|
163
163
|
return `/**
|
|
164
|
-
* Duct Deeplink Receiver —
|
|
164
|
+
* Duct Deeplink Receiver — generated by \`npx @duct-sdk/sdk add identity\`
|
|
165
165
|
*
|
|
166
166
|
* This route receives signed deeplinks from the Duct shell and navigates
|
|
167
167
|
* the user to the correct page with pre-loaded state.
|
|
@@ -345,7 +345,7 @@ export function generateTokenRoute(config, framework, tokenOptions) {
|
|
|
345
345
|
function generateRemixReceiver(_config) {
|
|
346
346
|
const docsBase = getDocsUrl();
|
|
347
347
|
return `/**
|
|
348
|
-
* Duct Deeplink Receiver —
|
|
348
|
+
* Duct Deeplink Receiver — generated by \`npx @duct-sdk/sdk add identity\`
|
|
349
349
|
*
|
|
350
350
|
* This route receives signed deeplinks from the Duct shell and navigates
|
|
351
351
|
* the user to the correct page with pre-loaded state.
|
|
@@ -428,7 +428,7 @@ export async function action({ request }: ActionFunctionArgs) {
|
|
|
428
428
|
function generateExpressReceiver(_config) {
|
|
429
429
|
const docsBase = getDocsUrl();
|
|
430
430
|
return `/**
|
|
431
|
-
* Duct Deeplink Receiver —
|
|
431
|
+
* Duct Deeplink Receiver — generated by \`npx @duct-sdk/sdk add identity\`
|
|
432
432
|
*
|
|
433
433
|
* This route receives signed deeplinks from the Duct shell and navigates
|
|
434
434
|
* the user to the correct page with pre-loaded state.
|
|
@@ -508,7 +508,7 @@ export default router;
|
|
|
508
508
|
function generateNuxtReceiver(_config) {
|
|
509
509
|
const docsBase = getDocsUrl();
|
|
510
510
|
return `/**
|
|
511
|
-
* Duct Deeplink Receiver —
|
|
511
|
+
* Duct Deeplink Receiver — generated by \`npx @duct-sdk/sdk add identity\`
|
|
512
512
|
*
|
|
513
513
|
* Nitro server route. Do not remove the signature verification step.
|
|
514
514
|
* Do not expose DUCT_SECRET_KEY client-side.
|
|
@@ -576,7 +576,7 @@ export default defineEventHandler(async (event) => {
|
|
|
576
576
|
// ----------------------------------------------------------------
|
|
577
577
|
function generateFastApiReceiver(_config) {
|
|
578
578
|
const docsBase = getDocsUrl();
|
|
579
|
-
return `# duct_receive.py —
|
|
579
|
+
return `# duct_receive.py — generated by \`npx @duct-sdk/sdk add identity\`
|
|
580
580
|
# FastAPI route that verifies signed Duct deeplinks (HS256 JWT).
|
|
581
581
|
# Requires: pip install pyjwt
|
|
582
582
|
#
|
|
@@ -651,7 +651,7 @@ async def duct_receive(request: Request):
|
|
|
651
651
|
function generateSvelteKitReceiver(_config) {
|
|
652
652
|
const docsBase = getDocsUrl();
|
|
653
653
|
return `/**
|
|
654
|
-
* Duct Deeplink Receiver —
|
|
654
|
+
* Duct Deeplink Receiver — generated by \`npx @duct-sdk/sdk add identity\`
|
|
655
655
|
*
|
|
656
656
|
* This route receives signed deeplinks from the Duct shell and navigates
|
|
657
657
|
* the user to the correct page with pre-loaded state.
|
|
@@ -27,14 +27,14 @@ function generateReactShellComponent(config) {
|
|
|
27
27
|
? `https://docs.${new URL(config.product.baseUrl).hostname.split('.').slice(-2).join('.')}`
|
|
28
28
|
: 'http://localhost:3005/docs';
|
|
29
29
|
return `/**
|
|
30
|
-
* Duct Shell Widget —
|
|
30
|
+
* Duct Shell Widget — generated by \`npx @duct-sdk/sdk add shell\`
|
|
31
31
|
*
|
|
32
32
|
* Mount this in your root layout. That's it.
|
|
33
33
|
* The shell is hosted by Duct. This component is a thin bridge.
|
|
34
34
|
* It renders the self-contained launcher, so do not add a second trigger.
|
|
35
35
|
*
|
|
36
36
|
* To customize: ${docsBase}/shell/customization
|
|
37
|
-
* To
|
|
37
|
+
* To regenerate: npx @duct-sdk/sdk add shell --force
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
40
|
"use client"; // Required for Next.js App Router
|
|
@@ -170,14 +170,14 @@ function generateRemixShellComponent(config) {
|
|
|
170
170
|
? `https://docs.${new URL(config.product.baseUrl).hostname.split('.').slice(-2).join('.')}`
|
|
171
171
|
: 'http://localhost:3005/docs';
|
|
172
172
|
return `/**
|
|
173
|
-
* Duct Shell Widget —
|
|
173
|
+
* Duct Shell Widget — generated by \`npx @duct-sdk/sdk add shell\`
|
|
174
174
|
*
|
|
175
175
|
* Mount this in your root layout. That's it.
|
|
176
176
|
* The shell is hosted by Duct. This component is a thin bridge.
|
|
177
177
|
* It renders the self-contained launcher, so do not add a second trigger.
|
|
178
178
|
*
|
|
179
179
|
* To customize: ${docsBase}/shell/customization
|
|
180
|
-
* To
|
|
180
|
+
* To regenerate: npx @duct-sdk/sdk add shell --force
|
|
181
181
|
*/
|
|
182
182
|
|
|
183
183
|
import { DuctShell } from "@duct-sdk/sdk/react";
|
|
@@ -225,14 +225,14 @@ function generateViteShellComponent(config) {
|
|
|
225
225
|
? `https://docs.${new URL(config.product.baseUrl).hostname.split('.').slice(-2).join('.')}`
|
|
226
226
|
: 'http://localhost:3005/docs';
|
|
227
227
|
return `/**
|
|
228
|
-
* Duct Shell Widget —
|
|
228
|
+
* Duct Shell Widget — generated by \`npx @duct-sdk/sdk add shell\`
|
|
229
229
|
*
|
|
230
230
|
* Mount this in your root layout. That's it.
|
|
231
231
|
* The shell is hosted by Duct. This component is a thin bridge.
|
|
232
232
|
* It renders the self-contained launcher, so do not add a second trigger.
|
|
233
233
|
*
|
|
234
234
|
* To customize: ${docsBase}/shell/customization
|
|
235
|
-
* To
|
|
235
|
+
* To regenerate: npx @duct-sdk/sdk add shell --force
|
|
236
236
|
*/
|
|
237
237
|
|
|
238
238
|
import { DuctShell } from "@duct-sdk/sdk/react";
|
|
@@ -345,13 +345,13 @@ function generateSvelteKitShellComponent(config) {
|
|
|
345
345
|
? `https://docs.${new URL(config.product.baseUrl).hostname.split('.').slice(-2).join('.')}`
|
|
346
346
|
: 'http://localhost:3005/docs';
|
|
347
347
|
return `<!--
|
|
348
|
-
Duct Shell Widget —
|
|
348
|
+
Duct Shell Widget — generated by \`npx @duct-sdk/sdk add shell\`
|
|
349
349
|
|
|
350
350
|
Mount this in your root layout. That's it.
|
|
351
351
|
The shell is hosted by Duct. This component is a thin bridge.
|
|
352
352
|
|
|
353
353
|
To customize: ${docsBase}/shell/customization
|
|
354
|
-
To
|
|
354
|
+
To regenerate: npx @duct-sdk/sdk add shell --force
|
|
355
355
|
-->
|
|
356
356
|
|
|
357
357
|
<script lang="ts">
|
|
@@ -460,13 +460,13 @@ function generateVue3ShellComponent(config) {
|
|
|
460
460
|
? "bottom: 86px; left: 24px;"
|
|
461
461
|
: "bottom: 86px; right: 24px;";
|
|
462
462
|
return `<!--
|
|
463
|
-
Duct Shell Widget —
|
|
463
|
+
Duct Shell Widget — generated by \`npx @duct-sdk/sdk add shell\`
|
|
464
464
|
|
|
465
465
|
Mount this in your root App.vue (or a layout component).
|
|
466
466
|
The shell is hosted by Duct. This is a thin postMessage bridge.
|
|
467
467
|
|
|
468
468
|
To customize: ${docsBase}/shell/customization
|
|
469
|
-
To
|
|
469
|
+
To regenerate: npx @duct-sdk/sdk add shell --force
|
|
470
470
|
-->
|
|
471
471
|
|
|
472
472
|
<template>
|
|
@@ -599,13 +599,13 @@ function generateNuxtShellComponent(config) {
|
|
|
599
599
|
? "bottom: 86px; left: 24px;"
|
|
600
600
|
: "bottom: 86px; right: 24px;";
|
|
601
601
|
return `<!--
|
|
602
|
-
Duct Shell Widget —
|
|
602
|
+
Duct Shell Widget — generated by \`npx @duct-sdk/sdk add shell\`
|
|
603
603
|
|
|
604
604
|
Mount this in your app.vue or a layouts file.
|
|
605
605
|
The shell is hosted by Duct. This is a thin postMessage bridge.
|
|
606
606
|
|
|
607
607
|
To customize: ${docsBase}/shell/customization
|
|
608
|
-
To
|
|
608
|
+
To regenerate: npx @duct-sdk/sdk add shell --force
|
|
609
609
|
-->
|
|
610
610
|
|
|
611
611
|
<template>
|