drivethrough-cli 0.1.33 → 0.1.35

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.
Files changed (2) hide show
  1. package/dist/main.mjs +11 -8
  2. package/package.json +1 -1
package/dist/main.mjs CHANGED
@@ -40078,7 +40078,10 @@ var init_output_schemas = __esm({
40078
40078
  diff_omitted: external_exports.string().optional()
40079
40079
  });
40080
40080
  testResult = external_exports.looseObject({
40081
- ok,
40081
+ // Not the success literal: a run that reached the other service and failed
40082
+ // is still a successful call, and its ok:false (with error/next) is exactly
40083
+ // what the model needs to read.
40084
+ ok: external_exports.boolean().describe("Whether the run (or dry run) succeeded \u2014 false comes with error and next"),
40082
40085
  target: external_exports.string().optional(),
40083
40086
  kind: external_exports.string().optional().describe('"route", "action", "schedule" or "webhook"'),
40084
40087
  status: external_exports.string().optional().describe('"ok", "failed", "skipped", "plan" or "quota"'),
@@ -40265,7 +40268,7 @@ var init_output_schemas = __esm({
40265
40268
  reference: external_exports.string().optional().describe("With reference: true \u2014 the drivethrough.json integrations format and two complete examples"),
40266
40269
  next: external_exports.string().optional()
40267
40270
  }).describe("Everything declared plus recent outcomes"),
40268
- request_secrets: external_exports.looseObject({
40271
+ create_integration_setup_link: external_exports.looseObject({
40269
40272
  ok,
40270
40273
  url: external_exports.string().optional().describe("The one-time link to relay to the user (they paste keys there, never in chat)"),
40271
40274
  session: external_exports.string().optional().describe("Pass back after the user says they're done"),
@@ -41197,10 +41200,10 @@ function registerTools(server, ctx) {
41197
41200
  }
41198
41201
  );
41199
41202
  server.registerTool(
41200
- "request_secrets",
41203
+ "create_integration_setup_link",
41201
41204
  {
41202
- outputSchema: OUTPUT_SCHEMAS.request_secrets,
41203
- title: "Request secrets",
41205
+ outputSchema: OUTPUT_SCHEMAS.create_integration_setup_link,
41206
+ title: "Create integration setup link",
41204
41207
  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
41208
  // Destructive: a link can replace a key that is already set, and the old
41206
41209
  // value is gone once the user saves (OpenAI's guidelines reserve false
@@ -41236,7 +41239,7 @@ function registerTools(server, ctx) {
41236
41239
  session,
41237
41240
  set: Object.fromEntries(secrets2.map((s2) => [s2.name, s2.set])),
41238
41241
  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 request_secrets 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."
41242
+ 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
41243
  });
41241
41244
  }
41242
41245
  const link = await ctx.api.request("POST", `${sitePath(site2)}/secrets/link`, {
@@ -41461,7 +41464,7 @@ RECIPE \u2014 a searchable, filterable list (catalogue, directory, archive)
41461
41464
  whose query the config doesn't declare (it will render empty for visitors),
41462
41465
  and a declaration no page uses (pure cost on every insert).
41463
41466
 
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), request_secrets (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.
41467
+ 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
41468
 
41466
41469
  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
41470
  INTEGRATION_EXAMPLE_A = JSON.stringify({
@@ -41500,7 +41503,7 @@ Custom domains (paid plans): manage_domain attaches a domain the user already ow
41500
41503
  },
41501
41504
  schedules: { cycle: { every: "3h", rotate: "quote", action: "show" } }
41502
41505
  });
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 request_secrets, 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}.`;
41506
+ 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
41507
  }
41505
41508
  });
41506
41509
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drivethrough-cli",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "description": "Agent-first hosting CLI. Say what you want. Stay in the car.",
5
5
  "type": "module",
6
6
  "license": "MIT",