drivethrough-cli 0.1.33 → 0.1.34
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/main.mjs +7 -7
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -40265,7 +40265,7 @@ var init_output_schemas = __esm({
|
|
|
40265
40265
|
reference: external_exports.string().optional().describe("With reference: true \u2014 the drivethrough.json integrations format and two complete examples"),
|
|
40266
40266
|
next: external_exports.string().optional()
|
|
40267
40267
|
}).describe("Everything declared plus recent outcomes"),
|
|
40268
|
-
|
|
40268
|
+
create_integration_setup_link: external_exports.looseObject({
|
|
40269
40269
|
ok,
|
|
40270
40270
|
url: external_exports.string().optional().describe("The one-time link to relay to the user (they paste keys there, never in chat)"),
|
|
40271
40271
|
session: external_exports.string().optional().describe("Pass back after the user says they're done"),
|
|
@@ -41197,10 +41197,10 @@ function registerTools(server, ctx) {
|
|
|
41197
41197
|
}
|
|
41198
41198
|
);
|
|
41199
41199
|
server.registerTool(
|
|
41200
|
-
"
|
|
41200
|
+
"create_integration_setup_link",
|
|
41201
41201
|
{
|
|
41202
|
-
outputSchema: OUTPUT_SCHEMAS.
|
|
41203
|
-
title: "
|
|
41202
|
+
outputSchema: OUTPUT_SCHEMAS.create_integration_setup_link,
|
|
41203
|
+
title: "Create integration setup link",
|
|
41204
41204
|
description: `Get a one-time link where the user sets the API keys a site's integrations need (Pro plan) \u2014 two steps, like create_upload. Call it with the site: it returns a link (10 minutes, one use, no sign-in). Send it to the user as a clickable link and have them paste the keys there. NEVER ask for a key in the chat, and never put one in a file \u2014 this tool never receives or returns a key's value. When they say they're done, call again with the returned session: it reports which names are set. A deploy that needs an unset secret is refused with a fresh link already in the error \u2014 relay that one instead. Pass names to rotate a key that is already set. A webhook's secret comes FROM the other service: tell the user to add a webhook there pointing at its URL (get_integrations and the deploy error give it) and paste the signing secret it shows into the link page; a url_token secret is generated on the link page, which then shows the full URL to paste.`,
|
|
41205
41205
|
// Destructive: a link can replace a key that is already set, and the old
|
|
41206
41206
|
// value is gone once the user saves (OpenAI's guidelines reserve false
|
|
@@ -41236,7 +41236,7 @@ function registerTools(server, ctx) {
|
|
|
41236
41236
|
session,
|
|
41237
41237
|
set: Object.fromEntries(secrets2.map((s2) => [s2.name, s2.set])),
|
|
41238
41238
|
all_set: unset.length === 0,
|
|
41239
|
-
next: unset.length ? `Still unset: ${unset.join(", ")}. Ask the user to finish on the page \u2014 or, if the link was used or expired, call
|
|
41239
|
+
next: unset.length ? `Still unset: ${unset.join(", ")}. Ask the user to finish on the page \u2014 or, if the link was used or expired, call create_integration_setup_link again without a session for a fresh one.` : "Every declared secret is set. Deploy (or redeploy) the site, then check each piece with preview_action, preview_schedule or preview_webhook, and have the user use the page once."
|
|
41240
41240
|
});
|
|
41241
41241
|
}
|
|
41242
41242
|
const link = await ctx.api.request("POST", `${sitePath(site2)}/secrets/link`, {
|
|
@@ -41461,7 +41461,7 @@ RECIPE \u2014 a searchable, filterable list (catalogue, directory, archive)
|
|
|
41461
41461
|
whose query the config doesn't declare (it will render empty for visitors),
|
|
41462
41462
|
and a declaration no page uses (pure cost on every insert).
|
|
41463
41463
|
|
|
41464
|
-
Connecting a site to another service's API (Pro plan): this is site configuration, not something you run. The site's drivethrough.json declares it and deploy_site deploys it, like any other file; get_integrations {reference: true} returns the format with two complete examples. The integration tools: get_integrations (what is declared and how it went),
|
|
41464
|
+
Connecting a site to another service's API (Pro plan): this is site configuration, not something you run. The site's drivethrough.json declares it and deploy_site deploys it, like any other file; get_integrations {reference: true} returns the format with two complete examples. The integration tools: get_integrations (what is declared and how it went), create_integration_setup_link (a one-time link where the user sets API keys \u2014 never ask for a key in the chat), and preview_action, preview_schedule, preview_webhook (show what would be sent or stored; nothing is sent). Preview each piece, then have the user use the page once and confirm the outcome in get_integrations before telling them it works.
|
|
41465
41465
|
|
|
41466
41466
|
Custom domains (paid plans): manage_domain attaches a domain the user already owns. After attaching, check_domain {action: "connect"} looks up one-click setup at their registrar (relay the URL when offered, else the exact DNS records from attach), and check_domain {action: "status"} polls until "active" \u2014 DNS seen, then TLS issued.`;
|
|
41467
41467
|
INTEGRATION_EXAMPLE_A = JSON.stringify({
|
|
@@ -41500,7 +41500,7 @@ Custom domains (paid plans): manage_domain attaches a domain the user already ow
|
|
|
41500
41500
|
},
|
|
41501
41501
|
schedules: { cycle: { every: "3h", rotate: "quote", action: "show" } }
|
|
41502
41502
|
});
|
|
41503
|
-
INTEGRATION_REFERENCE = `Integrations are declared in the site's drivethrough.json and deployed with deploy_site, like any other file. Keys: "secrets" lists the key names (values are set by the user via
|
|
41503
|
+
INTEGRATION_REFERENCE = `Integrations are declared in the site's drivethrough.json and deployed with deploy_site, like any other file. Keys: "secrets" lists the key names (values are set by the user via create_integration_setup_link, never in chat or a file). "routes" maps a same-origin path under /api/ext/<name> to an upstream, allowing only the listed "methods" and "paths" prefixes, adding "headers" server-side (\${NAME} inserts a secret); "access" is "owner" (default), "viewers" or "public"; "cache" and "query" are optional. "actions" declare a POST ("post" URL, "headers", JSON "body" where {{field}} inserts a row's field); a type with "on_write": "<action>" sends it when a visitor's form or the owner's button on the page saves a row \u2014 never for write_db, imports or schedule pulls. "schedules" repeat every 1h/3h/6h/12h/1d/1w/1mo (no cron strings, times of day or timezones): "rotate": "<type>" with "action" sends the next row of the type through the action; "pull": {route, path, into, map} saves a route's JSON response as a new row ("map" uses $.dotted.paths; numeric strings become numbers). They pause after 10 failures in a row (the owner gets one email) until the next deploy. "webhooks" receive events another service POSTs to https://<site>/api/hook/<name>: "verify" is "stripe", "github", "standard" (Standard Webhooks: Resend, Clerk, Svix\u2026), "hmac_sha256" (with "header": the signature header's name) or, only for services that can't sign, "url_token"; "secret" names the declared secret; "map" (same $.paths) fills a row of "into". Unverified, duplicate and replayed deliveries are never stored. Every mistake is refused at deploy time with the corrected snippet \u2014 follow it. Two complete examples \u2014 a read-only brokerage dashboard that also snapshots equity hourly for a chart: ${INTEGRATION_EXAMPLE_A} \u2014 and a display that shows a quote when the owner clicks, and cycles through saved quotes every 3 hours: ${INTEGRATION_EXAMPLE_B}.`;
|
|
41504
41504
|
}
|
|
41505
41505
|
});
|
|
41506
41506
|
|