@whop/cli 0.8.2 → 0.9.1

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/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  external_exports
6
6
  } from "./chunk-KFCNNWPI.js";
7
7
 
8
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Cli.js
8
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Cli.js
9
9
  var Cli_exports = {};
10
10
  __export(Cli_exports, {
11
11
  collectSkillCommands: () => collectSkillCommands,
@@ -106,7 +106,7 @@ function extractSegmentPart(segment, segmentTokenStart, segmentTokenCount, targe
106
106
  return segment.slice(charStart, charEnd);
107
107
  }
108
108
 
109
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/internal/helpers.js
109
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/internal/helpers.js
110
110
  function isRecord(value) {
111
111
  return typeof value === "object" && value !== null && !Array.isArray(value);
112
112
  }
@@ -154,7 +154,7 @@ function suggest(input, candidates) {
154
154
  return best;
155
155
  }
156
156
 
157
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Completions.js
157
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Completions.js
158
158
  function register(shell, name) {
159
159
  switch (shell) {
160
160
  case "bash":
@@ -417,7 +417,7 @@ let _incur_complete_${id} = {|spans|
417
417
  }`;
418
418
  }
419
419
 
420
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Errors.js
420
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Errors.js
421
421
  var BaseError = class extends Error {
422
422
  name = "Incur.BaseError";
423
423
  /** The short, human-readable error message (without details). */
@@ -491,7 +491,7 @@ function walk(error, fn) {
491
491
  return current;
492
492
  }
493
493
 
494
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Fetch.js
494
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Fetch.js
495
495
  var reservedFlags = /* @__PURE__ */ new Set(["method", "body", "data", "header"]);
496
496
  var reservedShort = { X: "method", d: "data", H: "header" };
497
497
  function parseArgv(argv2) {
@@ -627,7 +627,7 @@ async function parseResponse(response) {
627
627
  };
628
628
  }
629
629
 
630
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Filter.js
630
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Filter.js
631
631
  function parse(expression) {
632
632
  const paths = [];
633
633
  const tokens = [];
@@ -1127,7 +1127,7 @@ function resolveOptions(options) {
1127
1127
  };
1128
1128
  }
1129
1129
 
1130
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/internal/json.js
1130
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/internal/json.js
1131
1131
  function stringify(value, space) {
1132
1132
  return JSON.stringify(value, (_key, value2) => {
1133
1133
  if (typeof value2 === "bigint")
@@ -1139,7 +1139,7 @@ function normalize(value) {
1139
1139
  return JSON.parse(stringify(value));
1140
1140
  }
1141
1141
 
1142
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/internal/yaml.js
1142
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/internal/yaml.js
1143
1143
  import { createRequire } from "module";
1144
1144
  var cached;
1145
1145
  async function load() {
@@ -1151,7 +1151,7 @@ function loadSync() {
1151
1151
  return cached;
1152
1152
  }
1153
1153
 
1154
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Formatter.js
1154
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Formatter.js
1155
1155
  function format2(value, fmt = "toon") {
1156
1156
  if (value == null)
1157
1157
  return "";
@@ -1259,7 +1259,7 @@ ${String(val)}`;
1259
1259
  return kvTable(obj);
1260
1260
  }
1261
1261
 
1262
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Parser.js
1262
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Parser.js
1263
1263
  function parse2(argv2, options = {}) {
1264
1264
  const { args: argsSchema, options: optionsSchema, alias, defaults } = options;
1265
1265
  const optionNames = createOptionNames(optionsSchema, alias);
@@ -1676,10 +1676,10 @@ function defaultEnvSource() {
1676
1676
  return {};
1677
1677
  }
1678
1678
 
1679
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/internal/command.js
1679
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/internal/command.js
1680
1680
  var sentinel = Symbol.for("incur.sentinel");
1681
1681
  async function execute(command, options) {
1682
- const { argv: argv2, inputOptions, agent, format: format3, formatExplicit, name, path: path8, version, envSource = process.env, env: envSchema, globals = {}, vars: varsSchema, middlewares = [] } = options;
1682
+ const { argv: argv2, inputOptions: inputOptions2, agent, format: format3, formatExplicit, name, path: path8, version, envSource = process.env, env: envSchema, globals = {}, vars: varsSchema, middlewares = [], request: request2 } = options;
1683
1683
  const displayName = options.displayName ?? name;
1684
1684
  const parseMode = options.parseMode ?? "argv";
1685
1685
  const varsMap = varsSchema ? varsSchema.parse({}) : {};
@@ -1705,9 +1705,9 @@ async function execute(command, options) {
1705
1705
  } else if (parseMode === "split") {
1706
1706
  const parsed = parse2(argv2, { args: command.args });
1707
1707
  args = parsed.args;
1708
- parsedOptions = command.options ? zodParse(command.options, inputOptions) : {};
1708
+ parsedOptions = command.options ? zodParse(command.options, inputOptions2) : {};
1709
1709
  } else {
1710
- const split2 = splitParams(inputOptions, command);
1710
+ const split2 = splitParams(inputOptions2, command);
1711
1711
  args = command.args ? zodParse(command.args, split2.args) : {};
1712
1712
  parsedOptions = command.options ? zodParse(command.options, split2.options) : {};
1713
1713
  }
@@ -1725,6 +1725,7 @@ async function execute(command, options) {
1725
1725
  name,
1726
1726
  ok: okFn,
1727
1727
  options: parsedOptions,
1728
+ request: request2,
1728
1729
  var: varsMap,
1729
1730
  version
1730
1731
  });
@@ -1796,6 +1797,7 @@ async function execute(command, options) {
1796
1797
  formatExplicit,
1797
1798
  globals,
1798
1799
  name,
1800
+ request: request2,
1799
1801
  set(key, value) {
1800
1802
  varsMap[key] = value;
1801
1803
  },
@@ -1923,7 +1925,7 @@ function findBuiltinSubcommand(builtin, token) {
1923
1925
  return builtin.subcommands?.find((sub) => sub.name === token || sub.aliases?.includes(token));
1924
1926
  }
1925
1927
 
1926
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Help.js
1928
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Help.js
1927
1929
  function formatRoot(name, options = {}) {
1928
1930
  const { aliases, configFlag, description, globals, version, commands = [], root = false } = options;
1929
1931
  const lines = [];
@@ -2209,7 +2211,7 @@ function redact(value) {
2209
2211
  return `****${value.slice(-4)}`;
2210
2212
  }
2211
2213
 
2212
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/internal/cta.js
2214
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/internal/cta.js
2213
2215
  function formatCtaBlock(name, block) {
2214
2216
  if (!block || block.commands.length === 0)
2215
2217
  return void 0;
@@ -2232,7 +2234,7 @@ function formatCta(name, cta) {
2232
2234
  return { command: cmd, ...cta.description ? { description: cta.description } : void 0 };
2233
2235
  }
2234
2236
 
2235
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/internal/pm.js
2237
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/internal/pm.js
2236
2238
  function detectRunner() {
2237
2239
  const userAgent = process.env.npm_config_user_agent ?? "";
2238
2240
  const execPath = process.env.npm_execpath ?? "";
@@ -2243,7 +2245,7 @@ function detectRunner() {
2243
2245
  return "npx";
2244
2246
  }
2245
2247
 
2246
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Schema.js
2248
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Schema.js
2247
2249
  function toJsonSchema(schema) {
2248
2250
  const result = external_exports.toJSONSchema(schema, {
2249
2251
  unrepresentable: "any",
@@ -2257,39 +2259,23 @@ function toJsonSchema(schema) {
2257
2259
  return result;
2258
2260
  }
2259
2261
 
2260
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Mcp.js
2262
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Mcp.js
2261
2263
  async function serve(name, version, commands, options = {}) {
2262
2264
  const stdio = importStdioModule();
2263
2265
  const mcp = await import("./dist-2MZJLO2W.js");
2264
2266
  const { fromJsonSchema, McpServer } = mcp;
2265
2267
  const StdioServerTransport = await importStdioServerTransport(mcp, stdio);
2266
2268
  const server = new McpServer({ name, version }, options.instructions ? { instructions: options.instructions } : void 0);
2267
- for (const tool of collectTools(commands, [])) {
2268
- const mergedShape = {
2269
- ...tool.command.args?.shape,
2270
- ...tool.command.options?.shape
2271
- };
2272
- const hasInput = Object.keys(mergedShape).length > 0;
2273
- server.registerTool(tool.name, {
2274
- ...tool.description ? { description: tool.description } : void 0,
2275
- ...hasInput ? { inputSchema: external_exports.object(mergedShape) } : void 0,
2276
- ...tool.outputSchema ? { outputSchema: fromJsonSchema(tool.outputSchema) } : void 0,
2277
- ...tool.annotations ? { annotations: tool.annotations } : void 0,
2278
- ...tool.instructions ? { _meta: { instructions: tool.instructions } } : void 0
2279
- }, async (...callArgs) => {
2280
- const params = hasInput ? callArgs[0] : {};
2281
- const extra = hasInput ? callArgs[1] : callArgs[0];
2282
- return callTool(tool, params, {
2283
- extra,
2284
- sendNotification: (n) => server.server.notification(n),
2285
- name,
2286
- version,
2287
- middlewares: options.middlewares,
2288
- env: options.env,
2289
- vars: options.vars
2290
- });
2291
- });
2292
- }
2269
+ registerTools(server, commands, {
2270
+ env: options.env,
2271
+ fromJsonSchema,
2272
+ middlewares: options.middlewares,
2273
+ name,
2274
+ sendNotification: (notification) => server.server.notification(notification),
2275
+ tools: options.tools,
2276
+ vars: options.vars,
2277
+ version
2278
+ });
2293
2279
  const input = options.input ?? process.stdin;
2294
2280
  const output = options.output ?? process.stdout;
2295
2281
  const transport = new StdioServerTransport(input, output);
@@ -2325,6 +2311,7 @@ async function callTool(tool, params, options = {}) {
2325
2311
  name: options.name ?? tool.name,
2326
2312
  parseMode: "flat",
2327
2313
  path: tool.name,
2314
+ request: options.request,
2328
2315
  vars: options.vars,
2329
2316
  version: options.version
2330
2317
  });
@@ -2368,34 +2355,215 @@ async function callTool(tool, params, options = {}) {
2368
2355
  ...cta ? { _meta: { cta } } : void 0
2369
2356
  };
2370
2357
  }
2371
- function collectTools(commands, prefix, parentMiddlewares = []) {
2358
+ function registerTools(server, commands, options) {
2359
+ const tools = collectTools(commands, [], [], options.tools);
2360
+ if (tools.length === 0)
2361
+ return;
2362
+ if ((options.tools?.discovery ?? "progressive") === "direct") {
2363
+ for (const tool of tools)
2364
+ registerDirectTool(server, tool, options);
2365
+ return;
2366
+ }
2367
+ registerDiscoveryTools(server, tools, options);
2368
+ }
2369
+ function registerDirectTool(server, tool, options) {
2370
+ const mergedShape = {
2371
+ ...tool.command.args?.shape,
2372
+ ...tool.command.options?.shape
2373
+ };
2374
+ const hasInput = Object.keys(mergedShape).length > 0;
2375
+ server.registerTool(tool.name, {
2376
+ ...tool.description ? { description: tool.description } : void 0,
2377
+ ...hasInput ? { inputSchema: external_exports.object(mergedShape) } : void 0,
2378
+ ...tool.outputSchema ? { outputSchema: options.fromJsonSchema(tool.outputSchema) } : void 0,
2379
+ ...tool.annotations ? { annotations: tool.annotations } : void 0,
2380
+ ...tool.instructions ? { _meta: { instructions: tool.instructions } } : void 0
2381
+ }, async (...callArgs) => {
2382
+ const params = hasInput ? callArgs[0] : {};
2383
+ const extra = hasInput ? callArgs[1] : callArgs[0];
2384
+ return callTool(tool, params, callOptions(options, extra));
2385
+ });
2386
+ }
2387
+ function registerDiscoveryTools(server, tools, options) {
2388
+ const byName = new Map(tools.map((tool) => [tool.name, tool]));
2389
+ server.registerTool("search_tools", {
2390
+ description: "Search or page through available tools by capability. Returns names and descriptions without loading their schemas. Inspect a result before calling it.",
2391
+ inputSchema: external_exports.object({
2392
+ limit: external_exports.number().int().min(1).max(20).default(5).describe("Maximum matches."),
2393
+ offset: external_exports.number().int().min(0).default(0).describe("Matches to skip."),
2394
+ query: external_exports.string().default("").describe("Capability to find. Empty lists all tools.")
2395
+ }),
2396
+ annotations: catalogAnnotations
2397
+ }, async (params) => {
2398
+ const matches = searchTools(tools, params.query);
2399
+ const page = matches.slice(params.offset, params.offset + params.limit);
2400
+ return toolResult({
2401
+ tools: page.map((tool) => ({
2402
+ name: tool.name,
2403
+ ...tool.description ? { description: tool.description } : void 0,
2404
+ ...tool.annotations ? { annotations: tool.annotations } : void 0
2405
+ })),
2406
+ ...params.offset + page.length < matches.length ? { nextOffset: params.offset + page.length } : void 0
2407
+ });
2408
+ });
2409
+ server.registerTool("get_tool_details", {
2410
+ description: "Inspect one tool returned by search_tools. Returns its complete input schema and metadata.",
2411
+ inputSchema: external_exports.object({ name: external_exports.string().min(1).describe("Exact tool name.") }),
2412
+ annotations: catalogAnnotations
2413
+ }, async (params) => {
2414
+ const tool = byName.get(params.name);
2415
+ if (!tool)
2416
+ return toolError(`Unknown tool: ${params.name}`);
2417
+ return toolResult({
2418
+ name: tool.name,
2419
+ ...tool.description ? { description: tool.description } : void 0,
2420
+ inputSchema: tool.inputSchema,
2421
+ ...tool.outputSchema ? { outputSchema: tool.outputSchema } : void 0,
2422
+ ...tool.annotations ? { annotations: tool.annotations } : void 0,
2423
+ ...tool.instructions ? { instructions: tool.instructions } : void 0
2424
+ });
2425
+ });
2426
+ server.registerTool("call_read_tool", {
2427
+ description: "Execute a tool marked read-only after inspecting its schema with get_tool_details.",
2428
+ inputSchema: callSchema,
2429
+ annotations: readAnnotations
2430
+ }, async (params, extra) => {
2431
+ const tool = byName.get(params.name);
2432
+ if (!tool)
2433
+ return toolError(`Unknown tool: ${params.name}`);
2434
+ if (tool.annotations?.readOnlyHint !== true)
2435
+ return toolError(`Tool is not read-only: ${params.name}`);
2436
+ return callTool(tool, params.arguments, callOptions(options, extra));
2437
+ });
2438
+ server.registerTool("call_write_tool", {
2439
+ description: "Execute a writable or unclassified tool after inspecting its schema with get_tool_details.",
2440
+ inputSchema: callSchema,
2441
+ annotations: writeAnnotations
2442
+ }, async (params, extra) => {
2443
+ const tool = byName.get(params.name);
2444
+ if (!tool)
2445
+ return toolError(`Unknown tool: ${params.name}`);
2446
+ if (tool.annotations?.readOnlyHint === true)
2447
+ return toolError(`Tool is read-only: ${params.name}`);
2448
+ return callTool(tool, params.arguments, callOptions(options, extra));
2449
+ });
2450
+ }
2451
+ var callSchema = external_exports.object({
2452
+ name: external_exports.string().min(1).describe("Exact tool name."),
2453
+ arguments: external_exports.record(external_exports.string(), external_exports.unknown()).default({}).describe("Arguments from its schema.")
2454
+ });
2455
+ var catalogAnnotations = {
2456
+ destructiveHint: false,
2457
+ idempotentHint: true,
2458
+ openWorldHint: false,
2459
+ readOnlyHint: true
2460
+ };
2461
+ var readAnnotations = {
2462
+ destructiveHint: false,
2463
+ idempotentHint: true,
2464
+ openWorldHint: true,
2465
+ readOnlyHint: true
2466
+ };
2467
+ var writeAnnotations = {
2468
+ destructiveHint: true,
2469
+ idempotentHint: false,
2470
+ openWorldHint: true,
2471
+ readOnlyHint: false
2472
+ };
2473
+ function callOptions(options, extra) {
2474
+ return {
2475
+ env: options.env,
2476
+ extra,
2477
+ middlewares: options.middlewares,
2478
+ name: options.name,
2479
+ request: options.request?.(extra),
2480
+ ...options.sendNotification ? { sendNotification: options.sendNotification } : void 0,
2481
+ vars: options.vars,
2482
+ version: options.version
2483
+ };
2484
+ }
2485
+ function searchTools(tools, query) {
2486
+ const normalized = normalizeSearch(query);
2487
+ const terms = normalized.split(" ").filter(Boolean);
2488
+ return tools.map((tool) => ({ tool, score: toolScore(tool, normalized, terms) })).filter(({ score }) => score > 0).sort((a, b) => b.score - a.score || a.tool.name.localeCompare(b.tool.name)).map(({ tool }) => tool);
2489
+ }
2490
+ function toolScore(tool, query, terms) {
2491
+ const name = normalizeSearch(tool.name);
2492
+ const description = normalizeSearch(tool.description ?? "");
2493
+ if (name === query)
2494
+ return 1e3;
2495
+ let score = name.startsWith(query) ? 100 : name.includes(query) ? 50 : 0;
2496
+ for (const term of terms) {
2497
+ if (name.split(" ").includes(term))
2498
+ score += 20;
2499
+ else if (name.includes(term))
2500
+ score += 10;
2501
+ if (description.includes(term))
2502
+ score += 2;
2503
+ }
2504
+ return score;
2505
+ }
2506
+ function normalizeSearch(value) {
2507
+ return value.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
2508
+ }
2509
+ function toolResult(value) {
2510
+ return { content: [{ type: "text", text: stringify(value) }] };
2511
+ }
2512
+ function toolError(message) {
2513
+ return { ...toolResult({ error: message }), isError: true };
2514
+ }
2515
+ function collectTools(commands, prefix, parentMiddlewares = [], filter) {
2516
+ const tools = filterTools(collectToolEntries(commands, prefix, parentMiddlewares), filter);
2517
+ assertUniqueToolNames(tools);
2518
+ return tools.sort((a, b) => a.name.localeCompare(b.name));
2519
+ }
2520
+ function collectToolEntries(commands, prefix, parentMiddlewares = []) {
2372
2521
  const result = [];
2373
2522
  for (const [name, entry] of commands) {
2374
2523
  if ("_alias" in entry)
2375
2524
  continue;
2525
+ if (entry.mcp === false)
2526
+ continue;
2376
2527
  const path8 = [...prefix, name];
2377
2528
  if ("_group" in entry && entry._group) {
2378
2529
  const groupMw = [
2379
2530
  ...parentMiddlewares,
2380
2531
  ...entry.middlewares ?? []
2381
2532
  ];
2382
- result.push(...collectTools(entry.commands, path8, groupMw));
2533
+ result.push(...collectToolEntries(entry.commands, path8, groupMw));
2383
2534
  } else {
2384
- const outputSchema = entry.output ? mcpOutputSchema(entry.output) : void 0;
2535
+ const mcp = entry.mcp === false ? void 0 : entry.mcp;
2536
+ const outputSchema2 = entry.output ? mcpOutputSchema(entry.output) : void 0;
2385
2537
  result.push({
2386
- name: entry.mcp?.name ?? path8.join("_"),
2387
- description: entry.mcp?.description ?? entry.description,
2538
+ name: mcp?.name ?? path8.join("_"),
2539
+ description: mcp?.description ?? entry.description,
2388
2540
  inputSchema: buildToolSchema(entry.args, entry.options),
2389
- ...outputSchema ? { outputSchema } : void 0,
2390
- ...entry.mcp?.annotations ? { annotations: entry.mcp.annotations } : void 0,
2391
- ...entry.mcp?.instructions ? { instructions: entry.mcp.instructions } : void 0,
2541
+ ...outputSchema2 ? { outputSchema: outputSchema2 } : void 0,
2542
+ ...mcp?.annotations ? { annotations: mcp.annotations } : void 0,
2543
+ ...mcp?.instructions ? { instructions: mcp.instructions } : void 0,
2392
2544
  command: entry,
2393
2545
  ...parentMiddlewares.length > 0 ? { middlewares: parentMiddlewares } : void 0
2394
2546
  });
2395
2547
  }
2396
2548
  }
2397
- assertUniqueToolNames(result);
2398
- return result.sort((a, b) => a.name.localeCompare(b.name));
2549
+ return result;
2550
+ }
2551
+ function filterTools(tools, filter) {
2552
+ if (!filter)
2553
+ return tools;
2554
+ const includes = filter.include?.map(patternToRegExp);
2555
+ const excludes = filter.exclude?.map(patternToRegExp) ?? [];
2556
+ return tools.filter((tool) => {
2557
+ if (excludes.some((pattern) => pattern.test(tool.name)))
2558
+ return false;
2559
+ if (!includes || includes.length === 0)
2560
+ return true;
2561
+ return includes.some((pattern) => pattern.test(tool.name));
2562
+ });
2563
+ }
2564
+ function patternToRegExp(pattern) {
2565
+ const escaped = pattern.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*");
2566
+ return new RegExp(`^${escaped}$`);
2399
2567
  }
2400
2568
  function assertUniqueToolNames(tools) {
2401
2569
  const seen = /* @__PURE__ */ new Set();
@@ -2426,15 +2594,17 @@ function buildToolSchema(args, options) {
2426
2594
  return { type: "object", properties };
2427
2595
  }
2428
2596
 
2429
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Openapi.js
2597
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Openapi.js
2430
2598
  var Openapi_exports = {};
2431
2599
  __export(Openapi_exports, {
2600
+ coerceIfNeeded: () => coerceIfNeeded,
2432
2601
  fromCli: () => fromCli,
2433
2602
  generateCommands: () => generateCommands,
2434
- resolve: () => resolve
2603
+ resolve: () => resolve,
2604
+ toZod: () => toZod
2435
2605
  });
2436
2606
 
2437
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/internal/dereference.js
2607
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/internal/dereference.js
2438
2608
  function dereference(root) {
2439
2609
  const cache = /* @__PURE__ */ new Map();
2440
2610
  return walk2(root, root, cache);
@@ -2486,7 +2656,7 @@ function resolvePointer(root, pointer) {
2486
2656
  return current;
2487
2657
  }
2488
2658
 
2489
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Openapi.js
2659
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Openapi.js
2490
2660
  function fromCli(cli2, options = {}) {
2491
2661
  const commands = toCommands.get(cli2);
2492
2662
  if (!commands)
@@ -2526,7 +2696,7 @@ function splitCommandName(name) {
2526
2696
  function addCommand(paths, segments, command) {
2527
2697
  const argsSchema = command.args ? toJsonSchema(command.args) : void 0;
2528
2698
  const optionsSchema = command.options ? toJsonSchema(command.options) : void 0;
2529
- const outputSchema = command.output ? toJsonSchema(command.output) : void 0;
2699
+ const outputSchema2 = command.output ? toJsonSchema(command.output) : void 0;
2530
2700
  const args = objectProperties(argsSchema);
2531
2701
  const requiredArgs = new Set(requiredProperties(argsSchema));
2532
2702
  const method = inferMethod(segments);
@@ -2550,7 +2720,7 @@ function addCommand(paths, segments, command) {
2550
2720
  ...command.description ? { summary: command.description } : void 0,
2551
2721
  ...parameters.length ? { parameters } : void 0,
2552
2722
  ...requestBody(method, optionsSchema),
2553
- responses: responses(outputSchema)
2723
+ responses: responses(outputSchema2)
2554
2724
  };
2555
2725
  const item = paths[variant.path] ?? {};
2556
2726
  item[method] = operation;
@@ -2700,6 +2870,8 @@ async function generateCommands(spec2, fetch3, options = {}) {
2700
2870
  const operations = openapiOperations(paths);
2701
2871
  const namespaceInfo = getNamespaceInfo(operations);
2702
2872
  const { config } = options;
2873
+ if (config?.compact)
2874
+ compactOperations(operations);
2703
2875
  for (const { method, operation: op, path: path8 } of operations) {
2704
2876
  const segments = commandSegments({
2705
2877
  method,
@@ -2713,7 +2885,7 @@ async function generateCommands(spec2, fetch3, options = {}) {
2713
2885
  const queryParams = (op.parameters ?? []).filter((p) => p.in === "query");
2714
2886
  const headerParams = headerOptions([
2715
2887
  ...(op.parameters ?? []).filter((p) => p.in === "header"),
2716
- ...securityHeaderParams(resolved, op)
2888
+ ...config?.security === false ? [] : securityHeaderParams(resolved, op)
2717
2889
  ]);
2718
2890
  const bodySchema = op.requestBody?.content?.["application/json"]?.schema;
2719
2891
  const bodyProps = bodySchema?.properties ?? {};
@@ -2760,11 +2932,19 @@ async function generateCommands(spec2, fetch3, options = {}) {
2760
2932
  const optionsSchema = Object.keys(optShape).length > 0 ? external_exports.object(optShape) : void 0;
2761
2933
  setCommand(commands, segments, {
2762
2934
  description: op.summary ?? op.description,
2935
+ mcp: {
2936
+ annotations: mcpAnnotations(method),
2937
+ // Help keeps the short summary; MCP tools surface the full prose.
2938
+ ...op.summary && op.description && op.summary !== op.description ? { description: `${op.summary}
2939
+
2940
+ ${op.description}` } : void 0
2941
+ },
2763
2942
  args: argsSchema,
2764
2943
  options: optionsSchema,
2765
2944
  run: createHandler({
2766
2945
  basePath: options.basePath,
2767
2946
  fetch: fetch3,
2947
+ forwardHeaders: config?.forwardHeaders,
2768
2948
  httpMethod,
2769
2949
  path: path8,
2770
2950
  headerParams,
@@ -2776,6 +2956,15 @@ async function generateCommands(spec2, fetch3, options = {}) {
2776
2956
  }
2777
2957
  return commands;
2778
2958
  }
2959
+ function mcpAnnotations(method) {
2960
+ const readOnly = ["get", "head", "options", "trace"].includes(method);
2961
+ return {
2962
+ destructiveHint: !readOnly,
2963
+ idempotentHint: readOnly || method === "delete" || method === "put",
2964
+ openWorldHint: true,
2965
+ readOnlyHint: readOnly
2966
+ };
2967
+ }
2779
2968
  var openapiMethods = /* @__PURE__ */ new Set([
2780
2969
  "delete",
2781
2970
  "get",
@@ -2829,6 +3018,58 @@ function securityHeaderParam(name, scheme) {
2829
3018
  return void 0;
2830
3019
  }
2831
3020
  var authorizationSchemes = /* @__PURE__ */ new Set(["basic", "bearer"]);
3021
+ var compactPatternLimit = 100;
3022
+ var dateTimeFormats = /* @__PURE__ */ new Set(["date", "date-time", "duration", "time"]);
3023
+ function compactOperations(operations) {
3024
+ for (const { operation } of operations) {
3025
+ for (const parameter of operation.parameters ?? [])
3026
+ if (parameter.schema)
3027
+ parameter.schema = compactSchema(parameter.schema);
3028
+ const body = operation.requestBody?.content?.["application/json"];
3029
+ if (body?.schema)
3030
+ body.schema = compactSchema(body.schema);
3031
+ }
3032
+ }
3033
+ function compactSchema(schema, seen = /* @__PURE__ */ new Map()) {
3034
+ const cached2 = seen.get(schema);
3035
+ if (cached2)
3036
+ return cached2;
3037
+ const out = { ...schema };
3038
+ seen.set(schema, out);
3039
+ delete out.example;
3040
+ delete out.examples;
3041
+ if (typeof out.pattern === "string" && out.pattern.length > compactPatternLimit)
3042
+ delete out.pattern;
3043
+ if (typeof out.format === "string" && dateTimeFormats.has(out.format))
3044
+ delete out.format;
3045
+ for (const key of ["allOf", "anyOf", "oneOf", "prefixItems"]) {
3046
+ if (!Array.isArray(out[key]))
3047
+ continue;
3048
+ const entries = out[key].map((entry) => compactSchema(entry, seen)).filter((entry) => Object.keys(entry).length > 0);
3049
+ if (entries.length > 0)
3050
+ out[key] = entries;
3051
+ else
3052
+ delete out[key];
3053
+ }
3054
+ for (const key of ["additionalProperties", "contains", "items", "not", "propertyNames"]) {
3055
+ const value = out[key];
3056
+ if (isSchemaObject(value))
3057
+ out[key] = compactSchema(value, seen);
3058
+ }
3059
+ for (const key of ["$defs", "patternProperties", "properties"]) {
3060
+ const value = out[key];
3061
+ if (!isSchemaObject(value))
3062
+ continue;
3063
+ const map = {};
3064
+ for (const [name, entry] of Object.entries(value))
3065
+ map[name] = isSchemaObject(entry) ? compactSchema(entry, seen) : entry;
3066
+ out[key] = map;
3067
+ }
3068
+ return out;
3069
+ }
3070
+ function isSchemaObject(value) {
3071
+ return typeof value === "object" && value !== null && !Array.isArray(value);
3072
+ }
2832
3073
  function headerOptions(parameters) {
2833
3074
  const seen = /* @__PURE__ */ new Set();
2834
3075
  const headers = [];
@@ -2966,10 +3207,15 @@ function createHandler(config) {
2966
3207
  if (value !== void 0)
2967
3208
  input.headers.set(p.name, String(value));
2968
3209
  }
3210
+ for (const name of config.forwardHeaders ?? []) {
3211
+ const value = context.request?.headers.get(name);
3212
+ if (!input.headers.has(name) && value !== null && value !== void 0)
3213
+ input.headers.set(name, value);
3214
+ }
2969
3215
  if (body && !input.headers.has("content-type"))
2970
3216
  input.headers.set("content-type", "application/json");
2971
- const request = buildRequest(input);
2972
- const response = await config.fetch(request);
3217
+ const request2 = buildRequest(input);
3218
+ const response = await config.fetch(request2);
2973
3219
  const output = await parseResponse(response);
2974
3220
  if (!output.ok)
2975
3221
  return context.error({
@@ -3005,7 +3251,174 @@ function coerceIfNeeded(schema) {
3005
3251
  return desc ? coerced.describe(desc) : coerced;
3006
3252
  }
3007
3253
 
3008
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Skill.js
3254
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/McpSource.js
3255
+ var protocolVersion = "2025-06-18";
3256
+ async function resolve2(source, options = {}) {
3257
+ const session = sourceSession(source);
3258
+ await request(session, "initialize", {
3259
+ protocolVersion,
3260
+ capabilities: {},
3261
+ clientInfo: { name: "incur", version: options.version ?? "1.0.0" }
3262
+ });
3263
+ session.initialized = true;
3264
+ await request(session, "notifications/initialized");
3265
+ const result = await request(session, "tools/list");
3266
+ const listed = result.tools ?? [];
3267
+ if (isProgressiveCatalog(listed))
3268
+ return { discovery: "progressive", tools: await discoverTools(session), session };
3269
+ return { tools: listed, session };
3270
+ }
3271
+ function generateCommands2(resolved) {
3272
+ const commands = /* @__PURE__ */ new Map();
3273
+ for (const tool of resolved.tools) {
3274
+ const options = tool.inputSchema ? inputOptions(tool.inputSchema) : void 0;
3275
+ const output = outputSchema(tool.outputSchema);
3276
+ commands.set(tool.name, {
3277
+ description: tool.description,
3278
+ ...tool.annotations ? { mcp: { annotations: tool.annotations } } : void 0,
3279
+ ...options ? { options } : void 0,
3280
+ ...output ? { output } : void 0,
3281
+ async run(context) {
3282
+ const parameters = { name: tool.name, arguments: { ...context.args, ...context.options } };
3283
+ const result = await request(resolved.session, "tools/call", resolved.discovery === "progressive" ? {
3284
+ name: tool.annotations?.readOnlyHint === true ? "call_read_tool" : "call_write_tool",
3285
+ arguments: parameters
3286
+ } : parameters);
3287
+ if (result.isError)
3288
+ return context.error({ code: "MCP_TOOL_ERROR", message: resultText(result) });
3289
+ return resultValue(result);
3290
+ }
3291
+ });
3292
+ }
3293
+ return commands;
3294
+ }
3295
+ function isProgressiveCatalog(tools) {
3296
+ if (tools.length !== 4)
3297
+ return false;
3298
+ const names = new Set(tools.map((tool) => tool.name));
3299
+ return names.has("search_tools") && names.has("get_tool_details") && names.has("call_read_tool") && names.has("call_write_tool");
3300
+ }
3301
+ async function discoverTools(session) {
3302
+ const tools = [];
3303
+ let offset = 0;
3304
+ while (offset !== void 0) {
3305
+ const search = await callRemoteTool(session, "search_tools", {
3306
+ query: "",
3307
+ limit: 20,
3308
+ offset
3309
+ });
3310
+ for (const match of search.tools ?? []) {
3311
+ if (!match.name)
3312
+ continue;
3313
+ const tool = await callRemoteTool(session, "get_tool_details", {
3314
+ name: match.name
3315
+ });
3316
+ if (tool.name)
3317
+ tools.push(tool);
3318
+ }
3319
+ if (search.nextOffset !== void 0 && search.nextOffset <= offset)
3320
+ throw new Error("MCP tool catalog returned a non-advancing offset");
3321
+ offset = search.nextOffset;
3322
+ }
3323
+ return tools;
3324
+ }
3325
+ async function callRemoteTool(session, name, arguments_) {
3326
+ const result = await request(session, "tools/call", { name, arguments: arguments_ });
3327
+ if (result.isError)
3328
+ throw new Error(resultText(result) || `MCP tool failed: ${name}`);
3329
+ return resultValue(result);
3330
+ }
3331
+ function sourceSession(source) {
3332
+ if (typeof source === "string" || source instanceof URL)
3333
+ return { url: new URL(source), fetch: globalThis.fetch.bind(globalThis) };
3334
+ return {
3335
+ url: new URL(source.url),
3336
+ fetch: source.fetch ?? globalThis.fetch.bind(globalThis),
3337
+ ...source.headers ? { headers: source.headers } : void 0
3338
+ };
3339
+ }
3340
+ async function request(session, method, params) {
3341
+ const notification = method.startsWith("notifications/");
3342
+ const id = notification ? void 0 : crypto.randomUUID();
3343
+ const headers = new Headers(session.headers);
3344
+ headers.set("content-type", "application/json");
3345
+ headers.set("accept", "application/json, text/event-stream");
3346
+ if (session.id)
3347
+ headers.set("mcp-session-id", session.id);
3348
+ if (session.initialized)
3349
+ headers.set("MCP-Protocol-Version", protocolVersion);
3350
+ const body = JSON.stringify({ jsonrpc: "2.0", ...id ? { id } : void 0, method, params });
3351
+ const response = await session.fetch(new Request(session.url, { method: "POST", headers, body }));
3352
+ const sessionId = response.headers.get("mcp-session-id");
3353
+ if (sessionId)
3354
+ session.id = sessionId;
3355
+ if (!response.ok)
3356
+ throw new Error(`MCP HTTP ${response.status}`);
3357
+ if (notification && response.status === 202)
3358
+ return {};
3359
+ const text4 = await response.text();
3360
+ if (!text4)
3361
+ return {};
3362
+ const contentType = response.headers.get("content-type") ?? "";
3363
+ const message = contentType.includes("text/event-stream") ? parseSse(text4, id) : JSON.parse(text4);
3364
+ if (message.error)
3365
+ throw new Error(message.error.message ?? "MCP request failed");
3366
+ return message.result ?? {};
3367
+ }
3368
+ function parseSse(text4, id) {
3369
+ for (const event of text4.split(/\r?\n\r?\n/)) {
3370
+ const data = event.split(/\r?\n/).filter((line) => line.startsWith("data:")).map((line) => line.slice(5).trimStart()).join("\n");
3371
+ if (!data)
3372
+ continue;
3373
+ const message = JSON.parse(data);
3374
+ if (id === void 0 || message.id === id)
3375
+ return message;
3376
+ }
3377
+ throw new Error("MCP SSE response did not include the matching JSON-RPC message");
3378
+ }
3379
+ function inputOptions(schema) {
3380
+ const properties = schema.properties ?? {};
3381
+ const required = new Set(schema.required ?? []);
3382
+ const shape = {};
3383
+ for (const [key, property] of Object.entries(properties)) {
3384
+ let zodType = toZod(property);
3385
+ if (!required.has(key))
3386
+ zodType = zodType.optional();
3387
+ if (typeof property.description === "string")
3388
+ zodType = zodType.describe(property.description);
3389
+ shape[key] = coerceIfNeeded(zodType);
3390
+ }
3391
+ return Object.keys(shape).length > 0 ? external_exports.object(shape) : void 0;
3392
+ }
3393
+ function outputSchema(schema) {
3394
+ if (!schema || schema.type !== "object")
3395
+ return void 0;
3396
+ try {
3397
+ return external_exports.fromJSONSchema(schema);
3398
+ } catch {
3399
+ return void 0;
3400
+ }
3401
+ }
3402
+ function resultText(result) {
3403
+ const content = Array.isArray(result.content) ? result.content : [];
3404
+ return content.map((item) => item.type === "text" ? item.text : "").filter(Boolean).join("\n");
3405
+ }
3406
+ function resultValue(result) {
3407
+ if (result.structuredContent !== void 0)
3408
+ return result.structuredContent;
3409
+ const content = Array.isArray(result.content) ? result.content : [];
3410
+ const textItems = content.filter((item) => item.type === "text").map((item) => item.text);
3411
+ if (textItems.length === 1) {
3412
+ try {
3413
+ return JSON.parse(textItems[0]);
3414
+ } catch {
3415
+ return textItems[0];
3416
+ }
3417
+ }
3418
+ return textItems;
3419
+ }
3420
+
3421
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Skill.js
3009
3422
  import { createHash } from "crypto";
3010
3423
  function index(name, commands, description) {
3011
3424
  const lines = [`# ${name}`];
@@ -3160,14 +3573,14 @@ ${rows.join("\n")}`);
3160
3573
  ${rows.join("\n")}`);
3161
3574
  }
3162
3575
  if (cmd.output) {
3163
- const outputSchema = toJsonSchema(cmd.output);
3164
- const table2 = schemaToTable(outputSchema);
3576
+ const outputSchema2 = toJsonSchema(cmd.output);
3577
+ const table2 = schemaToTable(outputSchema2);
3165
3578
  if (table2)
3166
3579
  sections.push(`${sub} Output
3167
3580
 
3168
3581
  ${table2}`);
3169
3582
  else {
3170
- const type = resolveTypeName2(outputSchema);
3583
+ const type = resolveTypeName2(outputSchema2);
3171
3584
  sections.push(`${sub} Output
3172
3585
 
3173
3586
  Type: \`${type}\``);
@@ -3249,7 +3662,7 @@ function resolveTypeName2(prop) {
3249
3662
  return "unknown";
3250
3663
  }
3251
3664
 
3252
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/SyncMcp.js
3665
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/SyncMcp.js
3253
3666
  import { execFile } from "child_process";
3254
3667
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
3255
3668
  import { homedir } from "os";
@@ -3300,8 +3713,16 @@ function registerAmp(name, command) {
3300
3713
  return true;
3301
3714
  }
3302
3715
  function defaultCommand(name, runner) {
3716
+ if (isStandaloneBinary())
3717
+ return `"${process.execPath}" --mcp`;
3303
3718
  return shouldUseBareCommand(name) ? `${name} --mcp` : `${runner} ${detectPackageSpecifier(name)} --mcp`;
3304
3719
  }
3720
+ function isStandaloneBinary() {
3721
+ const bin = process.argv[1]?.replace(/\\/g, "/");
3722
+ if (!bin)
3723
+ return false;
3724
+ return bin.startsWith("/$bunfs/") || bin.includes("/~BUN/");
3725
+ }
3305
3726
  function nodeModulesInfo() {
3306
3727
  const normalized = process.argv[1]?.replace(/\\/g, "/");
3307
3728
  const match = normalized?.match(/^(.+)\/node_modules\/(.+)$/);
@@ -3377,24 +3798,24 @@ function splitCommand(input) {
3377
3798
  return tokens;
3378
3799
  }
3379
3800
  function exec(cmd, args) {
3380
- return new Promise((resolve5, reject) => {
3801
+ return new Promise((resolve6, reject) => {
3381
3802
  execFile(cmd, args, (error, stdout, stderr) => {
3382
3803
  if (error) {
3383
3804
  const msg = stderr?.trim() || stdout?.trim() || error.message;
3384
3805
  reject(new Error(msg));
3385
3806
  } else
3386
- resolve5({ stdout, stderr });
3807
+ resolve6({ stdout, stderr });
3387
3808
  });
3388
3809
  });
3389
3810
  }
3390
3811
 
3391
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/SyncSkills.js
3812
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/SyncSkills.js
3392
3813
  import fsSync from "fs";
3393
3814
  import fs2 from "fs/promises";
3394
3815
  import os2 from "os";
3395
3816
  import path2 from "path";
3396
3817
 
3397
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/internal/agents.js
3818
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/internal/agents.js
3398
3819
  import * as fs from "fs";
3399
3820
  import * as os from "os";
3400
3821
  import * as path from "path";
@@ -3674,7 +4095,7 @@ function resolveParent(dir) {
3674
4095
  }
3675
4096
  }
3676
4097
 
3677
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/SyncSkills.js
4098
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/SyncSkills.js
3678
4099
  async function sync(name, commands, options = {}) {
3679
4100
  const { depth = 1, description, global = true } = options;
3680
4101
  const cwd = options.cwd ?? (global ? resolvePackageRoot() : process.cwd());
@@ -3835,7 +4256,7 @@ function readHash(name) {
3835
4256
  return readMeta(name)?.hash;
3836
4257
  }
3837
4258
 
3838
- // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3/node_modules/incur/dist/Cli.js
4259
+ // ../../node_modules/.pnpm/incur@https+++codeload.github.com+whopio+incur+tar.gz+9e4339e90ed46153268c0183d5f49245598bed57/node_modules/incur/dist/Cli.js
3839
4260
  var destructiveCommandHint = "Confirm with the user before executing this destructive command.";
3840
4261
  function create(nameOrDefinition, definition) {
3841
4262
  const name = typeof nameOrDefinition === "string" ? nameOrDefinition : nameOrDefinition.name;
@@ -3848,7 +4269,8 @@ function create(nameOrDefinition, definition) {
3848
4269
  const middlewares = [];
3849
4270
  const pending = [];
3850
4271
  const mcpHandler = createMcpHttpHandler(name, def.version ?? "0.0.0", {
3851
- stateless: def.mcp?.stateless
4272
+ stateless: def.mcp?.stateless,
4273
+ tools: def.mcp?.tools
3852
4274
  });
3853
4275
  if (def.openapi && rootFetch) {
3854
4276
  pending.push((async () => {
@@ -3867,6 +4289,21 @@ function create(nameOrDefinition, definition) {
3867
4289
  vars: def.vars,
3868
4290
  command(nameOrCli, def2) {
3869
4291
  if (typeof nameOrCli === "string") {
4292
+ if (isMcpSourceDefinition(def2)) {
4293
+ pending.push((async () => {
4294
+ const resolved = await resolve2(def2.mcp);
4295
+ const generated = generateCommands2(resolved);
4296
+ const entry2 = {
4297
+ _group: true,
4298
+ description: def2.description,
4299
+ commands: generated,
4300
+ ...def2.outputPolicy ? { outputPolicy: def2.outputPolicy } : void 0
4301
+ };
4302
+ assertNoGlobalOptionConflicts(nameOrCli, entry2, toGlobals.get(cli2));
4303
+ commands.set(nameOrCli, entry2);
4304
+ })());
4305
+ return cli2;
4306
+ }
3870
4307
  if (def2 && "fetch" in def2 && isFetchSource(def2.fetch)) {
3871
4308
  const fetch3 = resolveFetch(def2.fetch);
3872
4309
  if (def2.openapi) {
@@ -3882,7 +4319,8 @@ function create(nameOrDefinition, definition) {
3882
4319
  _group: true,
3883
4320
  description: def2.description,
3884
4321
  commands: generated,
3885
- ...def2.outputPolicy ? { outputPolicy: def2.outputPolicy } : void 0
4322
+ ...def2.outputPolicy ? { outputPolicy: def2.outputPolicy } : void 0,
4323
+ ...def2.mcp === false ? { mcp: false } : void 0
3886
4324
  };
3887
4325
  assertNoGlobalOptionConflicts(nameOrCli, entry2, toGlobals.get(cli2));
3888
4326
  commands.set(nameOrCli, entry2);
@@ -4023,7 +4461,8 @@ function create(nameOrDefinition, definition) {
4023
4461
  async function serveImpl(name, commands, argv2, options = {}) {
4024
4462
  const stdout = options.stdout ?? ((s) => process.stdout.write(s));
4025
4463
  const exit = options.exit ?? ((code) => process.exit(code));
4026
- const human = process.stdout.isTTY === true;
4464
+ const tty = process.stdout.isTTY === true;
4465
+ let human = tty;
4027
4466
  const configEnabled = options.config !== void 0;
4028
4467
  const configFlag = options.config?.flag;
4029
4468
  const displayName = resolveDisplayName(name, options.aliases);
@@ -4058,6 +4497,7 @@ async function serveImpl(name, commands, argv2, options = {}) {
4058
4497
  return;
4059
4498
  }
4060
4499
  const { fullOutput, format: formatFlag, formatExplicit, filterOutput, tokenLimit, tokenOffset, tokenCount, llms, llmsFull, mcp: mcpFlag, help, version, schema, configPath: configPath2, configDisabled, rest } = builtinFlags;
4500
+ human = tty && !formatExplicit;
4061
4501
  let globals = {};
4062
4502
  let filtered = rest;
4063
4503
  function parseGlobalOptions(validate) {
@@ -4091,7 +4531,8 @@ async function serveImpl(name, commands, argv2, options = {}) {
4091
4531
  env: options.envSchema,
4092
4532
  vars: options.vars,
4093
4533
  version: options.version,
4094
- ...options.mcp?.instructions ? { instructions: options.mcp.instructions } : void 0
4534
+ ...options.mcp?.instructions ? { instructions: options.mcp.instructions } : void 0,
4535
+ ...options.mcp?.tools ? { tools: options.mcp.tools } : void 0
4095
4536
  });
4096
4537
  return;
4097
4538
  }
@@ -4666,7 +5107,7 @@ async function serveImpl(name, commands, argv2, options = {}) {
4666
5107
  const cta = output.meta.cta;
4667
5108
  if (human && !fullOutput) {
4668
5109
  if (output.ok && output.data != null && renderOutput) {
4669
- const custom = !formatExplicit && options.renderer != null ? options.renderer(output.data) : null;
5110
+ const custom = options.renderer != null ? options.renderer(output.data) : null;
4670
5111
  const rendered = custom ?? format2(output.data, format3);
4671
5112
  const t = truncate(rendered);
4672
5113
  writeln(t.text);
@@ -4752,8 +5193,8 @@ async function serveImpl(name, commands, argv2, options = {}) {
4752
5193
  const input = parseArgv(fetchRest);
4753
5194
  if (fetchGateway.basePath)
4754
5195
  input.path = fetchGateway.basePath + input.path;
4755
- const request = buildRequest(input);
4756
- const response = await fetchGateway.fetch(request);
5196
+ const request2 = buildRequest(input);
5197
+ const response = await fetchGateway.fetch(request2);
4757
5198
  if (isStreamingResponse(response)) {
4758
5199
  const generator = parseStreamingResponse(response);
4759
5200
  await handleStreaming(generator, {
@@ -4972,27 +5413,17 @@ function createMcpHttpHandler(name, version, options = {}) {
4972
5413
  if (!transport) {
4973
5414
  const { fromJsonSchema, McpServer, WebStandardStreamableHTTPServerTransport } = await import("./dist-2MZJLO2W.js");
4974
5415
  const server = new McpServer({ name, version });
4975
- for (const tool of collectTools(commands, [])) {
4976
- const mergedShape = {
4977
- ...tool.command.args?.shape,
4978
- ...tool.command.options?.shape
4979
- };
4980
- const hasInput = Object.keys(mergedShape).length > 0;
4981
- server.registerTool(tool.name, {
4982
- ...tool.description ? { description: tool.description } : void 0,
4983
- ...hasInput ? { inputSchema: external_exports.object(mergedShape) } : void 0,
4984
- ...tool.outputSchema ? { outputSchema: fromJsonSchema(tool.outputSchema) } : void 0
4985
- }, async (...callArgs) => {
4986
- const params = hasInput ? callArgs[0] : {};
4987
- return callTool(tool, params, {
4988
- name,
4989
- version,
4990
- middlewares: mcpOptions?.middlewares,
4991
- env: mcpOptions?.env,
4992
- vars: mcpOptions?.vars
4993
- });
4994
- });
4995
- }
5416
+ registerTools(server, commands, {
5417
+ env: mcpOptions?.env,
5418
+ fromJsonSchema,
5419
+ middlewares: mcpOptions?.middlewares,
5420
+ name,
5421
+ request: (extra) => extra?.http?.req,
5422
+ sendNotification: (notification) => server.server.notification(notification),
5423
+ tools: options.tools,
5424
+ vars: mcpOptions?.vars,
5425
+ version
5426
+ });
4996
5427
  const transportOptions = stateless ? { enableJsonResponse: true } : {
4997
5428
  sessionIdGenerator: () => crypto.randomUUID(),
4998
5429
  enableJsonResponse: true
@@ -5073,15 +5504,15 @@ async function fetchImpl(name, commands, req, options = {}) {
5073
5504
  }
5074
5505
  return new Response("Not Found", { status: 404 });
5075
5506
  }
5076
- let inputOptions = {};
5507
+ let inputOptions2 = {};
5077
5508
  if (req.method === "GET")
5078
5509
  for (const [key, value] of url.searchParams)
5079
- inputOptions[key] = value;
5510
+ inputOptions2[key] = value;
5080
5511
  else {
5081
5512
  try {
5082
5513
  const contentType = req.headers.get("content-type") ?? "";
5083
5514
  if (contentType.includes("application/json"))
5084
- inputOptions = await req.json();
5515
+ inputOptions2 = await req.json();
5085
5516
  } catch {
5086
5517
  }
5087
5518
  }
@@ -5093,7 +5524,7 @@ async function fetchImpl(name, commands, req, options = {}) {
5093
5524
  }
5094
5525
  if (segments.length === 0) {
5095
5526
  if (options.rootCommand)
5096
- return executeCommand(name, options.rootCommand, [], inputOptions, start, options);
5527
+ return executeCommand(name, options.rootCommand, [], inputOptions2, req, start, options);
5097
5528
  return jsonResponse({
5098
5529
  ok: false,
5099
5530
  error: { code: "COMMAND_NOT_FOUND", message: "No root command defined." },
@@ -5127,12 +5558,12 @@ async function fetchImpl(name, commands, req, options = {}) {
5127
5558
  return resolved.fetchGateway.fetch(req);
5128
5559
  const { command, path: path8, rest } = resolved;
5129
5560
  const groupMiddlewares = "middlewares" in resolved ? resolved.middlewares : [];
5130
- return executeCommand(path8, command, rest, inputOptions, start, {
5561
+ return executeCommand(path8, command, rest, inputOptions2, req, start, {
5131
5562
  ...options,
5132
5563
  groupMiddlewares
5133
5564
  });
5134
5565
  }
5135
- async function executeCommand(path8, command, rest, inputOptions, start, options) {
5566
+ async function executeCommand(path8, command, rest, inputOptions2, request2, start, options) {
5136
5567
  function jsonResponse(body, status) {
5137
5568
  return new Response(stringify(body), {
5138
5569
  status,
@@ -5145,12 +5576,12 @@ async function executeCommand(path8, command, rest, inputOptions, start, options
5145
5576
  ...command.middleware ?? []
5146
5577
  ];
5147
5578
  let globals = {};
5148
- let commandInputOptions = inputOptions;
5579
+ let commandInputOptions = inputOptions2;
5149
5580
  if (options.globals) {
5150
5581
  const globalKeys = new Set(Object.keys(options.globals.schema.shape));
5151
5582
  const rawGlobals = {};
5152
5583
  commandInputOptions = {};
5153
- for (const [key, value] of Object.entries(inputOptions)) {
5584
+ for (const [key, value] of Object.entries(inputOptions2)) {
5154
5585
  if (globalKeys.has(key))
5155
5586
  rawGlobals[key] = value;
5156
5587
  else
@@ -5180,6 +5611,7 @@ async function executeCommand(path8, command, rest, inputOptions, start, options
5180
5611
  name: options.name ?? path8,
5181
5612
  parseMode: "split",
5182
5613
  path: path8,
5614
+ request: request2,
5183
5615
  vars: options.vars,
5184
5616
  version: options.version
5185
5617
  });
@@ -5637,10 +6069,15 @@ async function runMcpDoctor(name, commands, options) {
5637
6069
  env: options.envSchema,
5638
6070
  vars: options.vars,
5639
6071
  version: options.version,
5640
- ...options.mcp?.instructions ? { instructions: options.mcp.instructions } : void 0
6072
+ ...options.mcp?.instructions ? { instructions: options.mcp.instructions } : void 0,
6073
+ tools: { ...options.mcp?.tools, discovery: "direct" }
5641
6074
  }).catch((error) => {
5642
6075
  serveError = error;
5643
6076
  });
6077
+ let serveFinished = false;
6078
+ void done.finally(() => {
6079
+ serveFinished = true;
6080
+ });
5644
6081
  input.write(`${stringify({
5645
6082
  jsonrpc: "2.0",
5646
6083
  id: 1,
@@ -5654,7 +6091,7 @@ async function runMcpDoctor(name, commands, options) {
5654
6091
  `);
5655
6092
  input.write(`${stringify({ jsonrpc: "2.0", id: 2, method: "tools/list", params: {} })}
5656
6093
  `);
5657
- await new Promise((resolve5) => setTimeout(resolve5, 20));
6094
+ await waitForMcpDoctorResponses(chunks, () => serveFinished);
5658
6095
  input.end();
5659
6096
  await done;
5660
6097
  if (serveError)
@@ -5708,6 +6145,14 @@ async function runMcpDoctor(name, commands, options) {
5708
6145
  errors
5709
6146
  };
5710
6147
  }
6148
+ async function waitForMcpDoctorResponses(chunks, finished) {
6149
+ const started = Date.now();
6150
+ while (!finished() && (chunks.join("").match(/\n/g)?.length ?? 0) < 2) {
6151
+ if (Date.now() - started >= 1e3)
6152
+ return;
6153
+ await new Promise((resolve6) => setTimeout(resolve6, 5));
6154
+ }
6155
+ }
5711
6156
  function parseMcpDoctorResponses(chunks) {
5712
6157
  const responses2 = [];
5713
6158
  for (const line of chunks.join("").split(/\r?\n/)) {
@@ -5756,6 +6201,14 @@ function isFetchSource(value) {
5756
6201
  const source = value;
5757
6202
  return typeof source.fetch === "function" && source.url instanceof URL;
5758
6203
  }
6204
+ function isMcpSourceDefinition(value) {
6205
+ if (typeof value !== "object" || value === null || !("mcp" in value))
6206
+ return false;
6207
+ const source = value.mcp;
6208
+ if (typeof source === "string" || source instanceof URL)
6209
+ return true;
6210
+ return typeof source === "object" && source !== null && "url" in source;
6211
+ }
5759
6212
  function resolveFetch(source) {
5760
6213
  if (typeof source === "function")
5761
6214
  return source;
@@ -6046,8 +6499,8 @@ function collectCommands(commands, prefix) {
6046
6499
  if (entry.description)
6047
6500
  cmd.description = entry.description;
6048
6501
  const inputSchema = buildInputSchema(entry.args, entry.env, entry.options);
6049
- const outputSchema = entry.output ? toJsonSchema(entry.output) : void 0;
6050
- if (inputSchema || outputSchema) {
6502
+ const outputSchema2 = entry.output ? toJsonSchema(entry.output) : void 0;
6503
+ if (inputSchema || outputSchema2) {
6051
6504
  cmd.schema = {};
6052
6505
  if (inputSchema?.args)
6053
6506
  cmd.schema.args = inputSchema.args;
@@ -6055,8 +6508,8 @@ function collectCommands(commands, prefix) {
6055
6508
  cmd.schema.env = inputSchema.env;
6056
6509
  if (inputSchema?.options)
6057
6510
  cmd.schema.options = inputSchema.options;
6058
- if (outputSchema)
6059
- cmd.schema.output = outputSchema;
6511
+ if (outputSchema2)
6512
+ cmd.schema.output = outputSchema2;
6060
6513
  }
6061
6514
  const examples = formatExamples(entry.examples);
6062
6515
  if (examples) {
@@ -6138,7 +6591,7 @@ function collectSkillCommands(commands, prefix, groups, rootCommand) {
6138
6591
  return result.sort((a, b) => (a.name ?? "").localeCompare(b.name ?? ""));
6139
6592
  }
6140
6593
  function isDestructive(command) {
6141
- return command.destructive === true || command.mcp?.annotations?.destructiveHint === true;
6594
+ return command.destructive === true || command.mcp !== false && command.mcp?.annotations?.destructiveHint === true;
6142
6595
  }
6143
6596
  function appendDestructiveHint(hint) {
6144
6597
  if (!hint)
@@ -6263,7 +6716,7 @@ var native_spec_default = {
6263
6716
  {
6264
6717
  description: "Stats represent aggregated activity for an account over time. They help you understand revenue, transactions, disputes, members, referrals, and advertising performance across reporting periods like days, weeks, or months.\n\nUse the Stats API to list available metrics and their filterable properties, then retrieve time-series values for a date range.\n",
6265
6718
  name: "Stats",
6266
- "x-whop-summary": "Aggregated account time series for reporting."
6719
+ "x-whop-summary": "Aggregated financial, audience, and traffic reporting."
6267
6720
  },
6268
6721
  {
6269
6722
  description: "A Ledger Activity row is a single financial event on an account's ledger \u2014 a payment, withdrawal, refund, transfer, on-chain deposit, swap, or card transaction. Each row is derived from the underlying ledger lines and carries a typed `resource` and `source` so you can present and link the event without extra lookups.\n\nUse Ledger Activity to build a statement or transaction feed for an account or user. Reconcile against your own records with `amount` (signed, in the currency's smallest precision units) and `posted_at`, and use `available_at` to know when inflows became withdrawable.\n",
@@ -6286,7 +6739,7 @@ var native_spec_default = {
6286
6739
  "x-whop-summary": "Move funds between Whop accounts and users."
6287
6740
  },
6288
6741
  {
6289
- description: "Deposits describe ways to add funds to an account balance, including hosted deposit pages, bank deposit instructions, and supported crypto wallet addresses.\n\nUse the Deposits API to create deposit instructions for an account and retrieve existing bank deposit activity.\n",
6742
+ description: "Deposits describe ways to add funds to an account balance, including hosted deposit pages, bank deposit instructions, and supported crypto wallet addresses.\n\nUse the Deposits API to create deposit instructions for an account.\n",
6290
6743
  name: "Deposits",
6291
6744
  "x-whop-summary": "Add funds to a balance."
6292
6745
  },
@@ -6336,7 +6789,7 @@ var native_spec_default = {
6336
6789
  "x-whop-summary": "Visitors and customers of an account, aggregated from pixel events."
6337
6790
  },
6338
6791
  {
6339
- description: "An Event records conversion or engagement activity for an account, such as page views, purchases, or leads. Each event ties the action to the [person](/api-reference/beta/people/person) who took it, so activity can be attributed to the ads and links that drove it.\n\nUse the Events API to send new tracking events and list the events recorded for a person.\n",
6792
+ description: "An Event records conversion or engagement activity for an account, such as page views, purchases, or leads. Each event ties the action to the [person](/api-reference/beta/people/person) who took it, so activity can be attributed to the ads and links that drove it.\n\nUse the Events API to send new tracking events, list recent identity-linked events for an account, and inspect the events recorded for a person.\n",
6340
6793
  name: "Events",
6341
6794
  "x-whop-summary": "Conversion and engagement events tracked for attribution."
6342
6795
  },
@@ -6430,7 +6883,8 @@ var native_spec_default = {
6430
6883
  name: "Tracking",
6431
6884
  tags: [
6432
6885
  "People",
6433
- "Events"
6886
+ "Events",
6887
+ "Reports"
6434
6888
  ]
6435
6889
  },
6436
6890
  {
@@ -6617,6 +7071,10 @@ var native_spec_default = {
6617
7071
  "application/json": {
6618
7072
  schema: {
6619
7073
  properties: {
7074
+ country: {
7075
+ description: "The ISO 3166-1 alpha-2 country code where the account's business is located (e.g. `US`). Defaults to the parent account's country for connected accounts.",
7076
+ type: "string"
7077
+ },
6620
7078
  email: {
6621
7079
  description: "The email address of the account owner. Required for business account API key requests.",
6622
7080
  type: "string"
@@ -7005,6 +7463,66 @@ var native_spec_default = {
7005
7463
  "null"
7006
7464
  ]
7007
7465
  },
7466
+ tax_collection_enabled_states: {
7467
+ description: "US state codes (50 states plus `DC`) where the account collects tax. Replaces the full set on update. Only settable when `tax_remitted_by` is `self`.",
7468
+ items: {
7469
+ enum: [
7470
+ "AL",
7471
+ "AK",
7472
+ "AZ",
7473
+ "AR",
7474
+ "CA",
7475
+ "CO",
7476
+ "CT",
7477
+ "DE",
7478
+ "DC",
7479
+ "FL",
7480
+ "GA",
7481
+ "HI",
7482
+ "ID",
7483
+ "IL",
7484
+ "IN",
7485
+ "IA",
7486
+ "KS",
7487
+ "KY",
7488
+ "LA",
7489
+ "ME",
7490
+ "MD",
7491
+ "MA",
7492
+ "MI",
7493
+ "MN",
7494
+ "MS",
7495
+ "MO",
7496
+ "MT",
7497
+ "NE",
7498
+ "NV",
7499
+ "NH",
7500
+ "NJ",
7501
+ "NM",
7502
+ "NY",
7503
+ "NC",
7504
+ "ND",
7505
+ "OH",
7506
+ "OK",
7507
+ "OR",
7508
+ "PA",
7509
+ "RI",
7510
+ "SC",
7511
+ "SD",
7512
+ "TN",
7513
+ "TX",
7514
+ "UT",
7515
+ "VT",
7516
+ "VA",
7517
+ "WA",
7518
+ "WV",
7519
+ "WI",
7520
+ "WY"
7521
+ ],
7522
+ type: "string"
7523
+ },
7524
+ type: "array"
7525
+ },
7008
7526
  tax_identifiers: {
7009
7527
  description: "Account tax/VAT registrations to add or update. When `tax_remitted_by` is `self`, tax is calculated and collected only in the countries where the account holds a registration.",
7010
7528
  items: {
@@ -7321,7 +7839,7 @@ var native_spec_default = {
7321
7839
  ]
7322
7840
  },
7323
7841
  patch: {
7324
- description: "Updates the account's preferences. Each top-level key present in the body is replaced as a whole; omitted keys are left untouched. `ads_payment_methods` always requires a `primary` entry. `backup` is optional when the primary is `platform_balance` \u2014 omitting it removes any configured card \u2014 while a `card` primary requires a `platform_balance` backup. A `platform_balance` entry may omit `id` to use the account's default Whop balance. Configuring a `card` requires a user token; account API keys can set up platform-balance billing, remove a configured card, and swap `primary` and `backup`.",
7842
+ description: "Updates the account's preferences. Each top-level key present in the body is replaced as a whole; omitted keys are left untouched. `ads_payment_methods` always requires a `primary` entry. `backup` is optional and any pairing is allowed \u2014 two cards, `card`+`platform_balance`, or a single method \u2014 so a card-only advertiser can fund ads without a platform balance. The `primary` and `backup` must be different sources. A `platform_balance` entry may omit `id` to use the account's default Whop balance. Configuring a `card` requires a user token; account API keys can set up platform-balance billing only.",
7325
7843
  operationId: "update-preferences",
7326
7844
  parameters: [
7327
7845
  {
@@ -7343,7 +7861,7 @@ var native_spec_default = {
7343
7861
  description: "How the account pays for Whop Ads spend. `primary` is charged first; `backup` covers the charge when the primary fails.",
7344
7862
  properties: {
7345
7863
  backup: {
7346
- description: "Optional when the primary is `platform_balance`; omitting it removes any configured card. Required (as `platform_balance`) when the primary is `card`.",
7864
+ description: "Optional second method charged if the primary fails. Any pairing is allowed (two cards, card+balance, balance+card); omit it to run on a single method. Must differ from the primary.",
7347
7865
  properties: {
7348
7866
  id: {
7349
7867
  description: "The funding source ID: a Whop balance (`ldgr_`) for `platform_balance`, or a payment method (`payt_`) for `card`. Optional for `platform_balance` \u2014 defaults to the account's default Whop balance. Required for `card`.",
@@ -10756,7 +11274,7 @@ var native_spec_default = {
10756
11274
  },
10757
11275
  "/bounties": {
10758
11276
  get: {
10759
- description: "Lists bounties visible to the credential. Account API keys return the account's bounties, scheduled drafts included; user tokens return the bounties the user can see and work. Pass account_id to view one account's bounties as a team member (or a connected account of the caller's), or user_id (your own) to list the bounties you participated in.",
11277
+ description: "Lists bounties visible to the credential \u2014 for an account API key, the account's bounties including scheduled drafts; for a user token, the bounties the user can see and work.",
10760
11278
  operationId: "list",
10761
11279
  parameters: [
10762
11280
  {
@@ -10969,7 +11487,7 @@ var native_spec_default = {
10969
11487
  ]
10970
11488
  },
10971
11489
  post: {
10972
- description: "Creates a bounty and escrows its pool (gross_reward_amount times accepted_submissions_limit) from the poster's balance, or an account balance the caller may move funds for (account_id). A user credential posts as itself; a company API key posts as the account's owner. Publishes immediately, or a recurring scheduled draft with publish_at. Every bounty is anchored in a forum: a company-funded bounty defaults to the account's public forum; a personal one must pass experience_id.",
11490
+ description: "Creates a bounty and escrows its reward pool. Publishes immediately, or as a scheduled draft when you set `publish_at`.",
10973
11491
  operationId: "create",
10974
11492
  parameters: [
10975
11493
  {
@@ -11005,19 +11523,6 @@ var native_spec_default = {
11005
11523
  "null"
11006
11524
  ]
11007
11525
  },
11008
- business_goal_type: {
11009
- description: "What the poster wants the work to achieve.",
11010
- enum: [
11011
- "clipping",
11012
- "post_engagement",
11013
- "owned_account_growth",
11014
- "ugc_content",
11015
- "local_activation",
11016
- "other"
11017
- ],
11018
- example: "clipping",
11019
- type: "string"
11020
- },
11021
11526
  description: {
11022
11527
  description: "Full task instructions shown to workers.",
11023
11528
  type: "string"
@@ -11030,7 +11535,7 @@ var native_spec_default = {
11030
11535
  ]
11031
11536
  },
11032
11537
  frequency: {
11033
- description: "How often a scheduled bounty republishes. Defaults to once. Only applies with publish_at.",
11538
+ description: "How often the schedule creates a new bounty. Each occurrence is a separate bounty. Defaults to `once`; only applies with `publish_at`.",
11034
11539
  enum: [
11035
11540
  "once",
11036
11541
  "hourly",
@@ -11109,7 +11614,7 @@ var native_spec_default = {
11109
11614
  },
11110
11615
  "/bounties/{id}": {
11111
11616
  get: {
11112
- description: "Retrieves one bounty by ID. The bounty must be visible to the credential; bounties outside the caller's scope return 404.",
11617
+ description: "Retrieves a bounty by ID. Bounties outside the caller's scope return `404`.",
11113
11618
  operationId: "get",
11114
11619
  responses: {
11115
11620
  "200": {
@@ -11156,7 +11661,7 @@ var native_spec_default = {
11156
11661
  },
11157
11662
  "/bounty_submissions": {
11158
11663
  get: {
11159
- description: "Lists bounty submissions visible to the credential. User tokens return the submissions they authored plus every submission on bounties they posted; account API keys return the submissions on the account's bounties. Pass account_id to view another account's submissions as a team member, or bounty_id to narrow the list to one bounty.",
11664
+ description: "Lists bounty submissions visible to the credential \u2014 for a user token, the submissions they authored plus those on bounties they posted; for an account API key, the submissions on the account's bounties.",
11160
11665
  operationId: "list",
11161
11666
  parameters: [
11162
11667
  {
@@ -13767,126 +14272,6 @@ var native_spec_default = {
13767
14272
  }
13768
14273
  },
13769
14274
  "/deposits": {
13770
- get: {
13771
- description: "Returns deposit transactions for a business account. Bank deposit transactions are nested under the bank field.",
13772
- operationId: "list",
13773
- parameters: [
13774
- {
13775
- description: "Business account ID (biz_*).",
13776
- in: "query",
13777
- name: "account_id",
13778
- required: true,
13779
- schema: {
13780
- type: "string"
13781
- }
13782
- }
13783
- ],
13784
- responses: {
13785
- "200": {
13786
- content: {
13787
- "application/json": {
13788
- schema: {
13789
- properties: {
13790
- account_id: {
13791
- description: "Account ID that owns these deposit transactions.",
13792
- type: "string"
13793
- },
13794
- bank: {
13795
- description: "Bank deposit transactions for this account.",
13796
- items: {
13797
- properties: {
13798
- created_at: {
13799
- description: "When the bank deposit transaction was created.",
13800
- format: "date-time",
13801
- type: "string"
13802
- },
13803
- destination_amount: {
13804
- description: "Amount credited to the account balance.",
13805
- type: [
13806
- "string",
13807
- "null"
13808
- ]
13809
- },
13810
- destination_currency: {
13811
- description: "Currency credited to the account balance.",
13812
- type: [
13813
- "string",
13814
- "null"
13815
- ]
13816
- },
13817
- id: {
13818
- description: "Bank deposit transaction ID.",
13819
- type: "string"
13820
- },
13821
- source_amount: {
13822
- description: "Amount sent by the depositor.",
13823
- type: "string"
13824
- },
13825
- source_currency: {
13826
- description: "Currency sent by the depositor.",
13827
- type: "string"
13828
- },
13829
- status: {
13830
- description: "Current bank deposit status.",
13831
- type: "string"
13832
- }
13833
- },
13834
- required: [
13835
- "id",
13836
- "source_amount",
13837
- "source_currency",
13838
- "destination_amount",
13839
- "destination_currency",
13840
- "status",
13841
- "created_at"
13842
- ],
13843
- type: "object"
13844
- },
13845
- type: "array"
13846
- },
13847
- object: {
13848
- enum: [
13849
- "deposits"
13850
- ],
13851
- type: "string"
13852
- }
13853
- },
13854
- required: [
13855
- "object",
13856
- "account_id",
13857
- "bank"
13858
- ],
13859
- type: "object"
13860
- }
13861
- }
13862
- },
13863
- description: "deposits retrieved"
13864
- },
13865
- "400": {
13866
- $ref: "#/components/responses/InvalidParameters",
13867
- description: "account ID is invalid"
13868
- },
13869
- "401": {
13870
- $ref: "#/components/responses/Unauthorized",
13871
- description: "missing or invalid authentication"
13872
- },
13873
- "403": {
13874
- $ref: "#/components/responses/Forbidden",
13875
- description: "credential lacks the payout account read scope"
13876
- }
13877
- },
13878
- security: [
13879
- {
13880
- bearerAuth: [
13881
- "payout:account:read"
13882
- ]
13883
- }
13884
- ],
13885
- summary: "Retrieve Deposits",
13886
- tags: [
13887
- "Deposits"
13888
- ]
13889
- },
13890
14275
  post: {
13891
14276
  description: "Resolves a deposit destination and returns the on-chain addresses that can fund it. No authentication is required; any business can be resolved by its account ID. A caller authenticated as a user can additionally resolve their own user account.",
13892
14277
  operationId: "create",
@@ -14152,14 +14537,14 @@ var native_spec_default = {
14152
14537
  },
14153
14538
  "/events": {
14154
14539
  get: {
14155
- description: "Lists pixel events for a person, most recent first. Events are shaped like the POST /events intake: attribution in context, identity in user.",
14540
+ description: "Lists pixel events, most recent first. Pass person_id for one person's journey, or omit it to list identity-linked events for an account within an explicit time range. Events are shaped like the POST /events intake: attribution in context, identity in user.",
14156
14541
  operationId: "list",
14157
14542
  parameters: [
14158
14543
  {
14159
- description: "The ID of the person.",
14544
+ description: "The ID of the person. Omit to list recent identity-linked events for the account.",
14160
14545
  in: "query",
14161
14546
  name: "person_id",
14162
- required: true,
14547
+ required: false,
14163
14548
  schema: {
14164
14549
  type: "string"
14165
14550
  }
@@ -14174,21 +14559,23 @@ var native_spec_default = {
14174
14559
  }
14175
14560
  },
14176
14561
  {
14177
- description: "Start of the time range as a Unix timestamp.",
14562
+ description: "Start of the time range as an ISO 8601 timestamp. Required when person_id is omitted.",
14178
14563
  in: "query",
14179
14564
  name: "from",
14180
14565
  required: false,
14181
14566
  schema: {
14182
- type: "integer"
14567
+ format: "date-time",
14568
+ type: "string"
14183
14569
  }
14184
14570
  },
14185
14571
  {
14186
- description: "End of the time range as a Unix timestamp. Defaults to now.",
14572
+ description: "End of the time range as an ISO 8601 timestamp. Required when person_id is omitted; otherwise defaults to now.",
14187
14573
  in: "query",
14188
14574
  name: "to",
14189
14575
  required: false,
14190
14576
  schema: {
14191
- type: "integer"
14577
+ format: "date-time",
14578
+ type: "string"
14192
14579
  }
14193
14580
  },
14194
14581
  {
@@ -14303,7 +14690,8 @@ var native_spec_default = {
14303
14690
  type: "string"
14304
14691
  },
14305
14692
  event_time: {
14306
- type: "integer"
14693
+ format: "date-time",
14694
+ type: "string"
14307
14695
  },
14308
14696
  id: {
14309
14697
  type: "string"
@@ -14314,6 +14702,9 @@ var native_spec_default = {
14314
14702
  "null"
14315
14703
  ]
14316
14704
  },
14705
+ person_id: {
14706
+ type: "string"
14707
+ },
14317
14708
  questions: {
14318
14709
  items: {
14319
14710
  properties: {
@@ -14449,6 +14840,7 @@ var native_spec_default = {
14449
14840
  "id",
14450
14841
  "event_id",
14451
14842
  "event_name",
14843
+ "person_id",
14452
14844
  "event_time"
14453
14845
  ],
14454
14846
  type: "object"
@@ -14491,7 +14883,7 @@ var native_spec_default = {
14491
14883
  }
14492
14884
  }
14493
14885
  },
14494
- description: "events listed"
14886
+ description: "account events listed"
14495
14887
  },
14496
14888
  "401": {
14497
14889
  $ref: "#/components/responses/Unauthorized",
@@ -16891,6 +17283,15 @@ var native_spec_default = {
16891
17283
  "null"
16892
17284
  ]
16893
17285
  },
17286
+ income_source: {
17287
+ description: "Which income source the commission is on: product-sales gross profit or Whop Ads spend billed to the business.",
17288
+ enum: [
17289
+ "sales",
17290
+ "ad_spend"
17291
+ ],
17292
+ example: "sales",
17293
+ type: "string"
17294
+ },
16894
17295
  object: {
16895
17296
  enum: [
16896
17297
  "partner_business_earning"
@@ -17050,6 +17451,7 @@ var native_spec_default = {
17050
17451
  "product",
17051
17452
  "status",
17052
17453
  "second_tier",
17454
+ "income_source",
17053
17455
  "transaction_amount_usd",
17054
17456
  "payout_percentage",
17055
17457
  "commission_amount_usd",
@@ -18133,6 +18535,25 @@ var native_spec_default = {
18133
18535
  type: "boolean"
18134
18536
  }
18135
18537
  },
18538
+ {
18539
+ description: "Narrows available_destinations to this one destination (a pd_ identifier from a previous listing) and includes its required_fields \u2014 the values to collect to add it as a payout method. Implies include_available.",
18540
+ in: "query",
18541
+ name: "destination_id",
18542
+ required: false,
18543
+ schema: {
18544
+ type: "string"
18545
+ }
18546
+ },
18547
+ {
18548
+ description: "Currency the destination would deliver payouts in. Only meaningful with destination_id; required fields vary by destination currency.",
18549
+ in: "query",
18550
+ name: "destination_currency",
18551
+ required: false,
18552
+ schema: {
18553
+ default: "usd",
18554
+ type: "string"
18555
+ }
18556
+ },
18136
18557
  {
18137
18558
  description: "Number of payout methods to return from the start of the window. Capped at 25 when an amount is provided.",
18138
18559
  in: "query",
@@ -18316,6 +18737,84 @@ var native_spec_default = {
18316
18737
  "null"
18317
18738
  ]
18318
18739
  },
18740
+ required_fields: {
18741
+ description: "The fields to collect to add this destination as a payout method. Present only when the request narrows to one destination with destination_id; null otherwise.",
18742
+ items: {
18743
+ properties: {
18744
+ id: {
18745
+ description: "Field ID, echoed back as the field key when creating the payout method.",
18746
+ type: "string"
18747
+ },
18748
+ input_type: {
18749
+ description: "How to collect the value: `text`, `options`, or `date`.",
18750
+ type: "string"
18751
+ },
18752
+ label: {
18753
+ description: "Human-readable field name.",
18754
+ type: "string"
18755
+ },
18756
+ object: {
18757
+ enum: [
18758
+ "required_field"
18759
+ ],
18760
+ type: "string"
18761
+ },
18762
+ options: {
18763
+ description: "Allowed values, for options fields.",
18764
+ items: {
18765
+ type: "string"
18766
+ },
18767
+ type: [
18768
+ "array",
18769
+ "null"
18770
+ ]
18771
+ },
18772
+ placeholder: {
18773
+ description: "Example value.",
18774
+ type: [
18775
+ "string",
18776
+ "null"
18777
+ ]
18778
+ },
18779
+ required: {
18780
+ description: "Whether the field must be provided.",
18781
+ type: "boolean"
18782
+ },
18783
+ sensitive: {
18784
+ description: "Whether the value is vaulted in transit and never stored raw, such as a bank account number.",
18785
+ type: "boolean"
18786
+ },
18787
+ type: {
18788
+ description: "Semantic field type, for example `bank_account_number` or `swift`.",
18789
+ type: "string"
18790
+ },
18791
+ validation: {
18792
+ description: "Regex the value must match. Null for options fields.",
18793
+ type: [
18794
+ "string",
18795
+ "null"
18796
+ ]
18797
+ }
18798
+ },
18799
+ required: [
18800
+ "object",
18801
+ "id",
18802
+ "label",
18803
+ "type",
18804
+ "input_type",
18805
+ "required",
18806
+ "validation",
18807
+ "options",
18808
+ "placeholder",
18809
+ "sensitive"
18810
+ ],
18811
+ type: "object"
18812
+ },
18813
+ type: [
18814
+ "array",
18815
+ "null"
18816
+ ]
18817
+ },
18319
18818
  supports_instant_delivery: {
18320
18819
  type: "boolean"
18321
18820
  },
@@ -18331,7 +18830,8 @@ var native_spec_default = {
18331
18830
  "delivery_type",
18332
18831
  "supports_standard_delivery",
18333
18832
  "supports_instant_delivery",
18334
- "quotes"
18833
+ "quotes",
18834
+ "required_fields"
18335
18835
  ],
18336
18836
  type: "object"
18337
18837
  },
@@ -18630,6 +19130,216 @@ var native_spec_default = {
18630
19130
  tags: [
18631
19131
  "Payouts"
18632
19132
  ]
19133
+ },
19134
+ post: {
19135
+ description: "Saves a new payout method for an account or user by submitting the destination's required fields, keyed by field id (list them with GET /payouts/methods?destination_id=...). Sensitive values are vaulted in transit and never stored raw; a Basis Theory token id may be passed in place of a raw value. The created method is immediately usable as payout_method_id on POST /payouts. A field validation failure returns the destination's full required_fields schema alongside the error.",
19136
+ operationId: "create-method",
19137
+ parameters: [
19138
+ {
19139
+ $ref: "#/components/parameters/ApiVersionDate"
19140
+ }
19141
+ ],
19142
+ requestBody: {
19143
+ content: {
19144
+ "application/json": {
19145
+ schema: {
19146
+ properties: {
19147
+ account_id: {
19148
+ description: "The account to add the payout method for (a biz_ identifier). Provide this or user_id.",
19149
+ type: "string"
19150
+ },
19151
+ destination_currency: {
19152
+ default: "usd",
19153
+ description: "Currency the destination delivers payouts in.",
19154
+ type: "string"
19155
+ },
19156
+ destination_id: {
19157
+ description: "The payout destination to add (a pd_ identifier from a previous listing).",
19158
+ type: "string"
19159
+ },
19160
+ fields: {
19161
+ additionalProperties: {
19162
+ type: "string"
19163
+ },
19164
+ description: "The destination's required field values, keyed by field id.",
19165
+ type: "object"
19166
+ },
19167
+ is_default: {
19168
+ default: false,
19169
+ description: "Whether to make this the account's default payout method.",
19170
+ type: "boolean"
19171
+ },
19172
+ nickname: {
19173
+ description: "A label for the payout method, unique per destination.",
19174
+ type: "string"
19175
+ },
19176
+ user_id: {
19177
+ description: "The user to add the payout method for (a user_ identifier). Provide this or account_id.",
19178
+ type: "string"
19179
+ }
19180
+ },
19181
+ required: [
19182
+ "destination_id",
19183
+ "nickname",
19184
+ "fields"
19185
+ ],
19186
+ type: "object"
19187
+ }
19188
+ }
19189
+ },
19190
+ required: true
19191
+ },
19192
+ responses: {
19193
+ "201": {
19194
+ content: {
19195
+ "application/json": {
19196
+ schema: {
19197
+ properties: {
19198
+ account_reference: {
19199
+ description: "Masked identifier for the destination.",
19200
+ type: [
19201
+ "string",
19202
+ "null"
19203
+ ]
19204
+ },
19205
+ created_at: {
19206
+ format: "date-time",
19207
+ type: "string"
19208
+ },
19209
+ destination_currency: {
19210
+ type: "string"
19211
+ },
19212
+ id: {
19213
+ description: "Payout method ID, usable as payout_method_id on POST /payouts.",
19214
+ type: "string"
19215
+ },
19216
+ institution_name: {
19217
+ type: [
19218
+ "string",
19219
+ "null"
19220
+ ]
19221
+ },
19222
+ is_default: {
19223
+ type: "boolean"
19224
+ },
19225
+ nickname: {
19226
+ type: [
19227
+ "string",
19228
+ "null"
19229
+ ]
19230
+ },
19231
+ object: {
19232
+ enum: [
19233
+ "payout_method"
19234
+ ],
19235
+ type: "string"
19236
+ },
19237
+ payer_name: {
19238
+ type: [
19239
+ "string",
19240
+ "null"
19241
+ ]
19242
+ },
19243
+ payout_destination: {
19244
+ properties: {
19245
+ delivery_type: {
19246
+ type: "string"
19247
+ },
19248
+ icon_url: {
19249
+ type: [
19250
+ "string",
19251
+ "null"
19252
+ ]
19253
+ },
19254
+ name: {
19255
+ type: [
19256
+ "string",
19257
+ "null"
19258
+ ]
19259
+ },
19260
+ supports_instant_delivery: {
19261
+ type: "boolean"
19262
+ },
19263
+ supports_standard_delivery: {
19264
+ type: "boolean"
19265
+ }
19266
+ },
19267
+ required: [
19268
+ "name",
19269
+ "icon_url",
19270
+ "delivery_type",
19271
+ "supports_standard_delivery",
19272
+ "supports_instant_delivery"
19273
+ ],
19274
+ type: [
19275
+ "object",
19276
+ "null"
19277
+ ]
19278
+ },
19279
+ quote: {
19280
+ description: "Always null on create.",
19281
+ type: [
19282
+ "object",
19283
+ "null"
19284
+ ]
19285
+ },
19286
+ status: {
19287
+ enum: [
19288
+ "created",
19289
+ "active",
19290
+ "broken"
19291
+ ],
19292
+ type: "string"
19293
+ }
19294
+ },
19295
+ required: [
19296
+ "object",
19297
+ "id",
19298
+ "status",
19299
+ "is_default",
19300
+ "nickname",
19301
+ "account_reference",
19302
+ "institution_name",
19303
+ "payer_name",
19304
+ "destination_currency",
19305
+ "created_at",
19306
+ "payout_destination",
19307
+ "quote"
19308
+ ],
19309
+ type: "object"
19310
+ }
19311
+ }
19312
+ },
19313
+ description: "a pre-tokenized Basis Theory value passes through unvaulted"
19314
+ },
19315
+ "400": {
19316
+ $ref: "#/components/responses/InvalidParameters",
19317
+ description: "over-long nickname is rejected before any value is vaulted"
19318
+ },
19319
+ "401": {
19320
+ $ref: "#/components/responses/Unauthorized",
19321
+ description: "missing or invalid authentication"
19322
+ },
19323
+ "403": {
19324
+ $ref: "#/components/responses/Forbidden",
19325
+ description: "credential lacks the create-destination scope"
19326
+ },
19327
+ "404": {
19328
+ $ref: "#/components/responses/NotFound",
19329
+ description: "payout destination not found"
19330
+ }
19331
+ },
19332
+ security: [
19333
+ {
19334
+ bearerAuth: [
19335
+ "payout:create_destination"
19336
+ ]
19337
+ }
19338
+ ],
19339
+ summary: "Create Payout Method",
19340
+ tags: [
19341
+ "Payouts"
19342
+ ]
18633
19343
  }
18634
19344
  },
18635
19345
  "/people": {
@@ -18647,21 +19357,23 @@ var native_spec_default = {
18647
19357
  }
18648
19358
  },
18649
19359
  {
18650
- description: "Start of the time range as a Unix timestamp. Defaults to 366 days before `to`.",
19360
+ description: "Start of the time range as an ISO 8601 timestamp. Defaults to 366 days before `to`.",
18651
19361
  in: "query",
18652
19362
  name: "from",
18653
19363
  required: false,
18654
19364
  schema: {
18655
- type: "integer"
19365
+ format: "date-time",
19366
+ type: "string"
18656
19367
  }
18657
19368
  },
18658
19369
  {
18659
- description: "End of the time range as a Unix timestamp. Defaults to now.",
19370
+ description: "End of the time range as an ISO 8601 timestamp. Defaults to now.",
18660
19371
  in: "query",
18661
19372
  name: "to",
18662
19373
  required: false,
18663
19374
  schema: {
18664
- type: "integer"
19375
+ format: "date-time",
19376
+ type: "string"
18665
19377
  }
18666
19378
  },
18667
19379
  {
@@ -18823,7 +19535,8 @@ var native_spec_default = {
18823
19535
  ]
18824
19536
  },
18825
19537
  first_seen_at: {
18826
- type: "integer"
19538
+ format: "date-time",
19539
+ type: "string"
18827
19540
  },
18828
19541
  has_failed_payment: {
18829
19542
  type: "boolean"
@@ -18832,7 +19545,8 @@ var native_spec_default = {
18832
19545
  type: "string"
18833
19546
  },
18834
19547
  last_seen_at: {
18835
- type: "integer"
19548
+ format: "date-time",
19549
+ type: "string"
18836
19550
  },
18837
19551
  ltv: {
18838
19552
  type: "number"
@@ -18953,21 +19667,23 @@ var native_spec_default = {
18953
19667
  }
18954
19668
  },
18955
19669
  {
18956
- description: "Start of the time range as a Unix timestamp.",
19670
+ description: "Start of the time range as an ISO 8601 timestamp.",
18957
19671
  in: "query",
18958
19672
  name: "from",
18959
19673
  required: false,
18960
19674
  schema: {
18961
- type: "integer"
19675
+ format: "date-time",
19676
+ type: "string"
18962
19677
  }
18963
19678
  },
18964
19679
  {
18965
- description: "End of the time range as a Unix timestamp. Defaults to now.",
19680
+ description: "End of the time range as an ISO 8601 timestamp. Defaults to now.",
18966
19681
  in: "query",
18967
19682
  name: "to",
18968
19683
  required: false,
18969
19684
  schema: {
18970
- type: "integer"
19685
+ format: "date-time",
19686
+ type: "string"
18971
19687
  }
18972
19688
  }
18973
19689
  ],
@@ -19070,7 +19786,8 @@ var native_spec_default = {
19070
19786
  ]
19071
19787
  },
19072
19788
  first_seen_at: {
19073
- type: "integer"
19789
+ format: "date-time",
19790
+ type: "string"
19074
19791
  },
19075
19792
  has_failed_payment: {
19076
19793
  type: "boolean"
@@ -19079,7 +19796,8 @@ var native_spec_default = {
19079
19796
  type: "string"
19080
19797
  },
19081
19798
  last_seen_at: {
19082
- type: "integer"
19799
+ format: "date-time",
19800
+ type: "string"
19083
19801
  },
19084
19802
  ltv: {
19085
19803
  type: "number"
@@ -21144,9 +21862,10 @@ var native_spec_default = {
21144
21862
  type: "string"
21145
21863
  },
21146
21864
  platform: {
21147
- description: "The platform to connect the social account on. Today, the supported option is `meta_business`.",
21865
+ description: "The platform to connect the social account on. Supported options are `meta_business` and `tiktok`.",
21148
21866
  enum: [
21149
- "meta_business"
21867
+ "meta_business",
21868
+ "tiktok"
21150
21869
  ],
21151
21870
  type: "string"
21152
21871
  },
@@ -21155,7 +21874,7 @@ var native_spec_default = {
21155
21874
  type: "string"
21156
21875
  },
21157
21876
  scopes: {
21158
- description: "Capabilities to grant for the connected social account. Use `advertise` when connecting a Meta Business account for ads.",
21877
+ description: "Capabilities to grant for the connected social account. Use `advertise` when connecting a Meta Business or TikTok account for ads.",
21159
21878
  items: {
21160
21879
  enum: [
21161
21880
  "advertise"
@@ -21509,7 +22228,7 @@ var native_spec_default = {
21509
22228
  },
21510
22229
  "/stats/{metric}": {
21511
22230
  get: {
21512
- description: "Retrieves a metric as a time series of points for an account over a date range.",
22231
+ description: "Retrieves a metric as a time series of points for an account over a time range.",
21513
22232
  operationId: "get",
21514
22233
  parameters: [
21515
22234
  {
@@ -21623,6 +22342,15 @@ var native_spec_default = {
21623
22342
  type: "string"
21624
22343
  }
21625
22344
  },
22345
+ {
22346
+ description: "Filter disputes to a normalized reason, for example product_not_received. Pair with breakdown_by=dispute_reason to split dispute counts by reason.",
22347
+ in: "query",
22348
+ name: "dispute_reason",
22349
+ required: false,
22350
+ schema: {
22351
+ type: "string"
22352
+ }
22353
+ },
21626
22354
  {
21627
22355
  description: "Filter to a single GMV source, for example payments. Pair with breakdown_by=source to split by source. Available on metrics that list source.",
21628
22356
  in: "query",
@@ -21741,12 +22469,14 @@ var native_spec_default = {
21741
22469
  }
21742
22470
  },
21743
22471
  {
21744
- description: "Trailing window for snapshot metrics. Only accepted by snapshot metrics (each lists its allowed windows in the catalog); defaults to the metric's first supported window. Only 30d today.",
22472
+ description: "Window used by a snapshot metric. Ordinary snapshots accept 30d as their trailing activity window. Cohorted dispute metrics accept 7d or 28d as the sales-transaction pool; their attribution window is fixed in the metric name. Each metric lists its accepted values in the catalog.",
21745
22473
  in: "query",
21746
22474
  name: "snapshot_window",
21747
22475
  required: false,
21748
22476
  schema: {
21749
22477
  enum: [
22478
+ "7d",
22479
+ "28d",
21750
22480
  "30d"
21751
22481
  ],
21752
22482
  type: "string"
@@ -24214,7 +24944,7 @@ var native_spec_default = {
24214
24944
  },
24215
24945
  oneOf: [
24216
24946
  {
24217
- description: "Request body for an individual (KYC) verification. Omit `kind` or set it to `individual`. KYC is required to pay out funds and is a prerequisite for Whop Card access. Accepting payments does not require verification until a business reaches $5000 in payments.\n\nAdd `business_name`, `business_structure`, and `country` of incorporation if the individual operates under a business entity. This enables payouts to be received by a business bank account.",
24947
+ description: "Request body for an individual (KYC) verification. Omit `kind` or set it to `individual`. KYC is required to pay out funds and is a prerequisite for Whop Card access. Accepting payments does not require verification until a business reaches $5000 in payments.\n\nAdd `business_name` and `business_structure` if the individual operates under a business entity \u2014 this enables payouts to be received by a business bank account. `country` is always the individual's own country, and the supported `business_structure` values vary by it \u2014 see [Business structures](/developer/verification/business-structures).",
24218
24948
  properties: {
24219
24949
  address: {
24220
24950
  properties: {
@@ -24269,20 +24999,51 @@ var native_spec_default = {
24269
24999
  type: "string"
24270
25000
  },
24271
25001
  document_type: {
24272
- description: "Identity document being sent. Providing it (with `documents`) verifies from uploaded documents instead of a hosted session, and determines the expected `documents` keys: cards and licenses need front and back, passports only the photo page.",
25002
+ description: "Identity document being sent, when verifying with `documents`. Decides exactly which file slots to send: `ID_CARD` \u2192 `id_card_front` + `id_card_back` + `selfie`; `DRIVERS` \u2192 `drivers_front` + `drivers_back` + `selfie`; `RESIDENCE_PERMIT` \u2192 `residence_permit_front` + `residence_permit_back` + `selfie`; `PASSPORT` \u2192 `passport_front` + `selfie`. See [Identity documents](/developer/verification/identity-documents).",
24273
25003
  enum: [
24274
25004
  "ID_CARD",
24275
- "PASSPORT",
24276
25005
  "DRIVERS",
24277
- "RESIDENCE_PERMIT"
25006
+ "RESIDENCE_PERMIT",
25007
+ "PASSPORT"
24278
25008
  ],
24279
25009
  type: "string"
24280
25010
  },
24281
25011
  documents: {
24282
- additionalProperties: {
24283
- type: "string"
25012
+ description: "Identity document files, each value the file's raw bytes base64-encoded (JPEG, PNG, or PDF, up to 5MB per file before encoding). Sending this object verifies the person from the files in this request instead of a hosted session \u2014 individual verifications only, and the request must also carry `document_type`, `first_name`, `last_name`, `date_of_birth`, `country`, `phone`, `tax_identification_number`, and an `address` with `line1`, `city`, `state`, and `postal_code`. Send every slot for your `document_type` \u2014 a missing or rejected file fails the whole request and nothing is submitted; review starts automatically once every document is accepted. See [Identity documents](/developer/verification/identity-documents) for a full walkthrough.",
25013
+ properties: {
25014
+ drivers_back: {
25015
+ description: "Back of the driver's license, base64-encoded. Required when `document_type` is `DRIVERS`.",
25016
+ type: "string"
25017
+ },
25018
+ drivers_front: {
25019
+ description: "Front of the driver's license, base64-encoded. Required when `document_type` is `DRIVERS`.",
25020
+ type: "string"
25021
+ },
25022
+ id_card_back: {
25023
+ description: "Back of the ID card, base64-encoded. Required when `document_type` is `ID_CARD`.",
25024
+ type: "string"
25025
+ },
25026
+ id_card_front: {
25027
+ description: "Front of the ID card, base64-encoded. Required when `document_type` is `ID_CARD`.",
25028
+ type: "string"
25029
+ },
25030
+ passport_front: {
25031
+ description: "Photo page of the passport, base64-encoded. Required when `document_type` is `PASSPORT`.",
25032
+ type: "string"
25033
+ },
25034
+ residence_permit_back: {
25035
+ description: "Back of the residence permit, base64-encoded. Required when `document_type` is `RESIDENCE_PERMIT`.",
25036
+ type: "string"
25037
+ },
25038
+ residence_permit_front: {
25039
+ description: "Front of the residence permit, base64-encoded. Required when `document_type` is `RESIDENCE_PERMIT`.",
25040
+ type: "string"
25041
+ },
25042
+ selfie: {
25043
+ description: "Photo of the person's face, base64-encoded. Always required, with every document type. Must be JPEG or PNG.",
25044
+ type: "string"
25045
+ }
24284
25046
  },
24285
- description: "Identity document files, keyed by slot (`id_card_front`, `id_card_back`, `selfie`, \u2026) with each value the file's raw bytes base64-encoded. Providing them verifies the person from these documents instead of a hosted session \u2014 individual verifications only, and the request must also carry `document_type`, `first_name`, `last_name`, `date_of_birth`, `country`, `phone`, `tax_identification_number`, and an `address` with `line1`, `city`, `state`, and `postal_code`. JPEG, PNG, and PDF are accepted (selfies must be images), up to 5MB per file before encoding. Send the complete set \u2014 a missing or rejected file fails the whole request and nothing is submitted; review starts automatically once every document is accepted.",
24286
25047
  type: "object"
24287
25048
  },
24288
25049
  first_name: {
@@ -25972,6 +26733,10 @@ var native_spec_default = {
25972
26733
  "null"
25973
26734
  ]
25974
26735
  },
26736
+ llc_formation: {
26737
+ description: "LLC formation state for the account: a draft state with `payment_pending`, or the live filing state with registration progress, documents, and pending signatures.",
26738
+ type: "object"
26739
+ },
25975
26740
  logo_url: {
25976
26741
  description: "Account logo image URL.",
25977
26742
  type: [
@@ -26103,6 +26868,13 @@ var native_spec_default = {
26103
26868
  "null"
26104
26869
  ]
26105
26870
  },
26871
+ tax_collection_enabled_states: {
26872
+ items: {
26873
+ description: "US state codes (of the 50 states plus `DC`) where the account collects tax: the full set when Whop remits (`tax_remitted_by` `whop`), the configured subset when the account self-remits (`self`), and empty when neither. On update, send the complete list to replace it (only allowed when `self`).",
26874
+ type: "string"
26875
+ },
26876
+ type: "array"
26877
+ },
26106
26878
  tax_identifiers: {
26107
26879
  description: "Account tax/VAT registrations, each with `id`, `tax_id_type`, and `tax_id_value`. Empty when none are set.",
26108
26880
  type: "array"
@@ -26191,9 +26963,11 @@ var native_spec_default = {
26191
26963
  "product_tax_code",
26192
26964
  "business_address",
26193
26965
  "tax_identifiers",
26966
+ "tax_collection_enabled_states",
26194
26967
  "total_usd",
26195
26968
  "balances",
26196
26969
  "verification",
26970
+ "llc_formation",
26197
26971
  "wallet",
26198
26972
  "social_links"
26199
26973
  ],
@@ -26393,6 +27167,12 @@ var native_spec_default = {
26393
27167
  "migrate_from_stripe",
26394
27168
  "accept_first_payment",
26395
27169
  "launch_first_ad",
27170
+ "launch_draft_campaign",
27171
+ "increase_ad_budget",
27172
+ "refresh_ad_creatives",
27173
+ "fix_ad_billing",
27174
+ "exclude_customers_from_ads",
27175
+ "retarget_abandoned_checkouts",
26396
27176
  "invite_team_member",
26397
27177
  "enable_tax_collection",
26398
27178
  "create_card",
@@ -26634,6 +27414,10 @@ var native_spec_default = {
26634
27414
  $ref: "#/components/schemas/AdEntityReference",
26635
27415
  description: "The ad group this ad belongs to, an object with an id."
26636
27416
  },
27417
+ added_to_cart_value: {
27418
+ description: "USD value attributed to add-to-cart events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
27419
+ type: "number"
27420
+ },
26637
27421
  added_to_carts: {
26638
27422
  description: "Whop pixel-attributed add-to-cart events, last-click.",
26639
27423
  type: "number"
@@ -26688,10 +27472,18 @@ var native_spec_default = {
26688
27472
  description: "The number of clicks.",
26689
27473
  type: "number"
26690
27474
  },
27475
+ completed_registration_value: {
27476
+ description: "USD value attributed to complete-registration events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
27477
+ type: "number"
27478
+ },
26691
27479
  completed_registrations: {
26692
27480
  description: "Whop pixel-attributed complete-registration events, last-click.",
26693
27481
  type: "number"
26694
27482
  },
27483
+ contact_value: {
27484
+ description: "USD value attributed to contact events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
27485
+ type: "number"
27486
+ },
26695
27487
  contacts: {
26696
27488
  description: "Whop pixel-attributed contact events, last-click.",
26697
27489
  type: "number"
@@ -26786,6 +27578,10 @@ var native_spec_default = {
26786
27578
  description: "Whop pixel-attributed custom conversions broken out by merchant-defined event name, last-click, as a { event_name => count } map over the stats window. Empty when no named custom events are attributed. Custom events fired without a name are counted in custom_conversions but omitted here, so these values sum to at most custom_conversions.",
26787
27579
  type: "object"
26788
27580
  },
27581
+ custom_event_values: {
27582
+ description: "The conversion value attributed to each merchant-defined custom event name, as a { event_name => value } map paralleling custom_event_counts. Sums the value passed to whop.track, normalized to USD; events fired without a value contribute 0.",
27583
+ type: "object"
27584
+ },
26789
27585
  delivery_status: {
26790
27586
  description: "The current delivery state, mirroring the Delivery column in the ads dashboard. When several states apply at once, the highest-precedence one is returned.",
26791
27587
  enum: [
@@ -26854,6 +27650,10 @@ var native_spec_default = {
26854
27650
  "null"
26855
27651
  ]
26856
27652
  },
27653
+ lead_value: {
27654
+ description: "USD value attributed to lead events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
27655
+ type: "number"
27656
+ },
26857
27657
  leads: {
26858
27658
  description: "Whop pixel-attributed leads, last-click.",
26859
27659
  type: "number"
@@ -26953,6 +27753,10 @@ var native_spec_default = {
26953
27753
  description: "Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when there is no spend.",
26954
27754
  type: "number"
26955
27755
  },
27756
+ schedule_value: {
27757
+ description: "USD value attributed to schedule events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
27758
+ type: "number"
27759
+ },
26956
27760
  schedules: {
26957
27761
  description: "Whop pixel-attributed schedule events, last-click.",
26958
27762
  type: "number"
@@ -26986,6 +27790,10 @@ var native_spec_default = {
26986
27790
  example: "active",
26987
27791
  type: "string"
26988
27792
  },
27793
+ submitted_application_value: {
27794
+ description: "USD value attributed to submit-application events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
27795
+ type: "number"
27796
+ },
26989
27797
  submitted_applications: {
26990
27798
  description: "Whop pixel-attributed submit-application events, last-click.",
26991
27799
  type: "number"
@@ -27023,6 +27831,10 @@ var native_spec_default = {
27023
27831
  description: "Query parameters appended to the URL, as a string-to-string map.",
27024
27832
  type: "object"
27025
27833
  },
27834
+ viewed_content_value: {
27835
+ description: "USD value attributed to view-content events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
27836
+ type: "number"
27837
+ },
27026
27838
  viewed_contents: {
27027
27839
  description: "Whop pixel-attributed view-content events, last-click.",
27028
27840
  type: "number"
@@ -27064,6 +27876,14 @@ var native_spec_default = {
27064
27876
  "added_to_carts",
27065
27877
  "custom_conversions",
27066
27878
  "custom_event_counts",
27879
+ "custom_event_values",
27880
+ "lead_value",
27881
+ "schedule_value",
27882
+ "submitted_application_value",
27883
+ "contact_value",
27884
+ "completed_registration_value",
27885
+ "viewed_content_value",
27886
+ "added_to_cart_value",
27067
27887
  "id",
27068
27888
  "title",
27069
27889
  "status",
@@ -27093,6 +27913,10 @@ var native_spec_default = {
27093
27913
  },
27094
27914
  AdCampaign: {
27095
27915
  properties: {
27916
+ added_to_cart_value: {
27917
+ description: "USD value attributed to add-to-cart events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
27918
+ type: "number"
27919
+ },
27096
27920
  added_to_carts: {
27097
27921
  description: "Whop pixel-attributed add-to-cart events, last-click.",
27098
27922
  type: "number"
@@ -27152,10 +27976,18 @@ var native_spec_default = {
27152
27976
  description: "The number of clicks.",
27153
27977
  type: "number"
27154
27978
  },
27979
+ completed_registration_value: {
27980
+ description: "USD value attributed to complete-registration events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
27981
+ type: "number"
27982
+ },
27155
27983
  completed_registrations: {
27156
27984
  description: "Whop pixel-attributed complete-registration events, last-click.",
27157
27985
  type: "number"
27158
27986
  },
27987
+ contact_value: {
27988
+ description: "USD value attributed to contact events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
27989
+ type: "number"
27990
+ },
27159
27991
  contacts: {
27160
27992
  description: "Whop pixel-attributed contact events, last-click.",
27161
27993
  type: "number"
@@ -27243,6 +28075,10 @@ var native_spec_default = {
27243
28075
  description: "Whop pixel-attributed custom conversions broken out by merchant-defined event name, last-click, as a { event_name => count } map over the stats window. Empty when no named custom events are attributed. Custom events fired without a name are counted in custom_conversions but omitted here, so these values sum to at most custom_conversions.",
27244
28076
  type: "object"
27245
28077
  },
28078
+ custom_event_values: {
28079
+ description: "The conversion value attributed to each merchant-defined custom event name, as a { event_name => value } map paralleling custom_event_counts. Sums the value passed to whop.track, normalized to USD; events fired without a value contribute 0.",
28080
+ type: "object"
28081
+ },
27246
28082
  delivery_status: {
27247
28083
  description: "The current delivery state, mirroring the Delivery column in the ads dashboard. When several states apply at once, the highest-precedence one is returned.",
27248
28084
  enum: [
@@ -27284,6 +28120,10 @@ var native_spec_default = {
27284
28120
  },
27285
28121
  type: "array"
27286
28122
  },
28123
+ lead_value: {
28124
+ description: "USD value attributed to lead events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28125
+ type: "number"
28126
+ },
27287
28127
  leads: {
27288
28128
  description: "Whop pixel-attributed leads, last-click.",
27289
28129
  type: "number"
@@ -27369,6 +28209,10 @@ var native_spec_default = {
27369
28209
  description: "Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when there is no spend.",
27370
28210
  type: "number"
27371
28211
  },
28212
+ schedule_value: {
28213
+ description: "USD value attributed to schedule events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28214
+ type: "number"
28215
+ },
27372
28216
  schedules: {
27373
28217
  description: "Whop pixel-attributed schedule events, last-click.",
27374
28218
  type: "number"
@@ -27416,6 +28260,10 @@ var native_spec_default = {
27416
28260
  example: "active",
27417
28261
  type: "string"
27418
28262
  },
28263
+ submitted_application_value: {
28264
+ description: "USD value attributed to submit-application events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28265
+ type: "number"
28266
+ },
27419
28267
  submitted_applications: {
27420
28268
  description: "Whop pixel-attributed submit-application events, last-click.",
27421
28269
  type: "number"
@@ -27439,6 +28287,10 @@ var native_spec_default = {
27439
28287
  description: "When the campaign was last updated, as an ISO 8601 timestamp.",
27440
28288
  type: "string"
27441
28289
  },
28290
+ viewed_content_value: {
28291
+ description: "USD value attributed to view-content events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28292
+ type: "number"
28293
+ },
27442
28294
  viewed_contents: {
27443
28295
  description: "Whop pixel-attributed view-content events, last-click.",
27444
28296
  type: "number"
@@ -27480,6 +28332,14 @@ var native_spec_default = {
27480
28332
  "added_to_carts",
27481
28333
  "custom_conversions",
27482
28334
  "custom_event_counts",
28335
+ "custom_event_values",
28336
+ "lead_value",
28337
+ "schedule_value",
28338
+ "submitted_application_value",
28339
+ "contact_value",
28340
+ "completed_registration_value",
28341
+ "viewed_content_value",
28342
+ "added_to_cart_value",
27483
28343
  "id",
27484
28344
  "title",
27485
28345
  "status",
@@ -27598,6 +28458,10 @@ var native_spec_default = {
27598
28458
  $ref: "#/components/schemas/AdEntityReference",
27599
28459
  description: "The ad campaign this ad group belongs to, an object with an id."
27600
28460
  },
28461
+ added_to_cart_value: {
28462
+ description: "USD value attributed to add-to-cart events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28463
+ type: "number"
28464
+ },
27601
28465
  added_to_carts: {
27602
28466
  description: "Whop pixel-attributed add-to-cart events, last-click.",
27603
28467
  type: "number"
@@ -27648,10 +28512,18 @@ var native_spec_default = {
27648
28512
  description: "The number of clicks.",
27649
28513
  type: "number"
27650
28514
  },
28515
+ completed_registration_value: {
28516
+ description: "USD value attributed to complete-registration events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28517
+ type: "number"
28518
+ },
27651
28519
  completed_registrations: {
27652
28520
  description: "Whop pixel-attributed complete-registration events, last-click.",
27653
28521
  type: "number"
27654
28522
  },
28523
+ contact_value: {
28524
+ description: "USD value attributed to contact events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28525
+ type: "number"
28526
+ },
27655
28527
  contacts: {
27656
28528
  description: "Whop pixel-attributed contact events, last-click.",
27657
28529
  type: "number"
@@ -27760,6 +28632,10 @@ var native_spec_default = {
27760
28632
  description: "Whop pixel-attributed custom conversions broken out by merchant-defined event name, last-click, as a { event_name => count } map over the stats window. Empty when no named custom events are attributed. Custom events fired without a name are counted in custom_conversions but omitted here, so these values sum to at most custom_conversions.",
27761
28633
  type: "object"
27762
28634
  },
28635
+ custom_event_values: {
28636
+ description: "The conversion value attributed to each merchant-defined custom event name, as a { event_name => value } map paralleling custom_event_counts. Sums the value passed to whop.track, normalized to USD; events fired without a value contribute 0.",
28637
+ type: "object"
28638
+ },
27763
28639
  delivery_status: {
27764
28640
  description: "The current delivery state, mirroring the Delivery column in the ads dashboard. When several states apply at once, the highest-precedence one is returned.",
27765
28641
  enum: [
@@ -27847,6 +28723,10 @@ var native_spec_default = {
27847
28723
  },
27848
28724
  type: "array"
27849
28725
  },
28726
+ lead_value: {
28727
+ description: "USD value attributed to lead events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28728
+ type: "number"
28729
+ },
27850
28730
  leads: {
27851
28731
  description: "Whop pixel-attributed leads, last-click.",
27852
28732
  type: "number"
@@ -27933,6 +28813,10 @@ var native_spec_default = {
27933
28813
  description: "Purchase value divided by spend, both in USD (a currency-neutral ratio); 0 when there is no spend.",
27934
28814
  type: "number"
27935
28815
  },
28816
+ schedule_value: {
28817
+ description: "USD value attributed to schedule events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28818
+ type: "number"
28819
+ },
27936
28820
  schedules: {
27937
28821
  description: "Whop pixel-attributed schedule events, last-click.",
27938
28822
  type: "number"
@@ -27965,6 +28849,10 @@ var native_spec_default = {
27965
28849
  example: "active",
27966
28850
  type: "string"
27967
28851
  },
28852
+ submitted_application_value: {
28853
+ description: "USD value attributed to submit-application events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28854
+ type: "number"
28855
+ },
27968
28856
  submitted_applications: {
27969
28857
  description: "Whop pixel-attributed submit-application events, last-click.",
27970
28858
  type: "number"
@@ -27991,6 +28879,10 @@ var native_spec_default = {
27991
28879
  description: "When the ad group was last updated, ISO 8601.",
27992
28880
  type: "string"
27993
28881
  },
28882
+ viewed_content_value: {
28883
+ description: "USD value attributed to view-content events. Sums the value sent with each event, normalized to USD; events without a value contribute 0.",
28884
+ type: "number"
28885
+ },
27994
28886
  viewed_contents: {
27995
28887
  description: "Whop pixel-attributed view-content events, last-click.",
27996
28888
  type: "number"
@@ -28032,6 +28924,14 @@ var native_spec_default = {
28032
28924
  "added_to_carts",
28033
28925
  "custom_conversions",
28034
28926
  "custom_event_counts",
28927
+ "custom_event_values",
28928
+ "lead_value",
28929
+ "schedule_value",
28930
+ "submitted_application_value",
28931
+ "contact_value",
28932
+ "completed_registration_value",
28933
+ "viewed_content_value",
28934
+ "added_to_cart_value",
28035
28935
  "id",
28036
28936
  "title",
28037
28937
  "status",
@@ -28285,23 +29185,6 @@ var native_spec_default = {
28285
29185
  description: "Total gross budget committed to the bounty: `gross_reward_amount` times `accepted_submissions_limit`.",
28286
29186
  type: "number"
28287
29187
  },
28288
- business_goal_type: {
28289
- description: "What the poster wants the work to achieve.",
28290
- enum: [
28291
- "clipping",
28292
- "post_engagement",
28293
- "owned_account_growth",
28294
- "ugc_content",
28295
- "local_activation",
28296
- "other",
28297
- null
28298
- ],
28299
- example: "clipping",
28300
- type: [
28301
- "string",
28302
- "null"
28303
- ]
28304
- },
28305
29188
  created_at: {
28306
29189
  description: "When the bounty was created, as an ISO 8601 timestamp.",
28307
29190
  type: "string"
@@ -28402,14 +29285,14 @@ var native_spec_default = {
28402
29285
  type: "string"
28403
29286
  },
28404
29287
  experience_id: {
28405
- description: "Experience the bounty is hosted in, prefixed `exp_`. Null for platform-wide bounties; may belong to a different account than the funder.",
29288
+ description: "Experience the bounty is hosted in, prefixed `exp_`. `null` for platform-wide bounties; may belong to a different account than the funder.",
28406
29289
  type: [
28407
29290
  "string",
28408
29291
  "null"
28409
29292
  ]
28410
29293
  },
28411
29294
  funding_account: {
28412
- description: "The account whose balance funds the bounty pool, or `null` when a user funds it personally. May differ from the account hosting `experience_id`.",
29295
+ description: "Account whose balance funds the bounty pool, or `null` when a user funds it personally. May differ from the account hosting `experience_id`.",
28413
29296
  oneOf: [
28414
29297
  {
28415
29298
  $ref: "#/components/schemas/AccountSummary"
@@ -28433,7 +29316,7 @@ var native_spec_default = {
28433
29316
  },
28434
29317
  poster: {
28435
29318
  $ref: "#/components/schemas/UserSummary",
28436
- description: "The user who posted the bounty."
29319
+ description: "User who posted the bounty \u2014 the account owner when created with an account API key."
28437
29320
  },
28438
29321
  scheduled_frequency: {
28439
29322
  description: "How often the schedule creates a new bounty. Each occurrence is a separate bounty; the original is not republished.",
@@ -28452,7 +29335,7 @@ var native_spec_default = {
28452
29335
  ]
28453
29336
  },
28454
29337
  scheduled_publish_at: {
28455
- description: "When a scheduled bounty will publish, as an ISO 8601 timestamp. Null once published, for bounties that were never scheduled, and for terminally failed drafts parked for manual rescheduling.",
29338
+ description: "When a scheduled bounty will publish, as an ISO 8601 timestamp. `null` once published, for bounties that were never scheduled, and for terminally failed drafts parked for manual rescheduling.",
28456
29339
  type: [
28457
29340
  "string",
28458
29341
  "null"
@@ -28475,7 +29358,7 @@ var native_spec_default = {
28475
29358
  type: "string"
28476
29359
  },
28477
29360
  submissions_closed_at: {
28478
- description: "When new submissions were explicitly stopped, as an ISO 8601 timestamp. Null when submissions were never explicitly stopped \u2014 including closed or completed bounties that simply filled every winner slot.",
29361
+ description: "When new submissions were explicitly stopped, as an ISO 8601 timestamp. `null` when submissions were never explicitly stopped \u2014 including closed or completed bounties that simply filled every winner slot.",
28479
29362
  type: [
28480
29363
  "string",
28481
29364
  "null"
@@ -28506,7 +29389,6 @@ var native_spec_default = {
28506
29389
  "accepted_submissions_count",
28507
29390
  "unresolved_submissions_count",
28508
29391
  "spots_remaining",
28509
- "business_goal_type",
28510
29392
  "allowed_country_codes",
28511
29393
  "submissions_closed_at",
28512
29394
  "scheduled_publish_at",
@@ -28541,23 +29423,6 @@ var native_spec_default = {
28541
29423
  description: "Total gross budget committed to the bounty: `gross_reward_amount` times `accepted_submissions_limit`.",
28542
29424
  type: "number"
28543
29425
  },
28544
- business_goal_type: {
28545
- description: "What the poster wants the work to achieve.",
28546
- enum: [
28547
- "clipping",
28548
- "post_engagement",
28549
- "owned_account_growth",
28550
- "ugc_content",
28551
- "local_activation",
28552
- "other",
28553
- null
28554
- ],
28555
- example: "clipping",
28556
- type: [
28557
- "string",
28558
- "null"
28559
- ]
28560
- },
28561
29426
  created_at: {
28562
29427
  description: "When the bounty was created, as an ISO 8601 timestamp.",
28563
29428
  type: "string"
@@ -28567,14 +29432,14 @@ var native_spec_default = {
28567
29432
  type: "string"
28568
29433
  },
28569
29434
  experience_id: {
28570
- description: "Experience the bounty is hosted in, prefixed `exp_`. Null for platform-wide bounties; may belong to a different account than the funder.",
29435
+ description: "Experience the bounty is hosted in, prefixed `exp_`. `null` for platform-wide bounties; may belong to a different account than the funder.",
28571
29436
  type: [
28572
29437
  "string",
28573
29438
  "null"
28574
29439
  ]
28575
29440
  },
28576
29441
  funding_account: {
28577
- description: "The account whose balance funds the bounty pool, or `null` when a user funds it personally. May differ from the account hosting `experience_id`.",
29442
+ description: "Account whose balance funds the bounty pool, or `null` when a user funds it personally. May differ from the account hosting `experience_id`.",
28578
29443
  oneOf: [
28579
29444
  {
28580
29445
  $ref: "#/components/schemas/AccountSummary"
@@ -28598,7 +29463,7 @@ var native_spec_default = {
28598
29463
  },
28599
29464
  poster: {
28600
29465
  $ref: "#/components/schemas/UserSummary",
28601
- description: "The user who posted the bounty."
29466
+ description: "User who posted the bounty \u2014 the account owner when created with an account API key."
28602
29467
  },
28603
29468
  scheduled_frequency: {
28604
29469
  description: "How often the schedule creates a new bounty. Each occurrence is a separate bounty; the original is not republished.",
@@ -28617,7 +29482,7 @@ var native_spec_default = {
28617
29482
  ]
28618
29483
  },
28619
29484
  scheduled_publish_at: {
28620
- description: "When a scheduled bounty will publish, as an ISO 8601 timestamp. Null once published, for bounties that were never scheduled, and for terminally failed drafts parked for manual rescheduling.",
29485
+ description: "When a scheduled bounty will publish, as an ISO 8601 timestamp. `null` once published, for bounties that were never scheduled, and for terminally failed drafts parked for manual rescheduling.",
28621
29486
  type: [
28622
29487
  "string",
28623
29488
  "null"
@@ -28640,7 +29505,7 @@ var native_spec_default = {
28640
29505
  type: "string"
28641
29506
  },
28642
29507
  submissions_closed_at: {
28643
- description: "When new submissions were explicitly stopped, as an ISO 8601 timestamp. Null when submissions were never explicitly stopped \u2014 including closed or completed bounties that simply filled every winner slot.",
29508
+ description: "When new submissions were explicitly stopped, as an ISO 8601 timestamp. `null` when submissions were never explicitly stopped \u2014 including closed or completed bounties that simply filled every winner slot.",
28644
29509
  type: [
28645
29510
  "string",
28646
29511
  "null"
@@ -28671,7 +29536,6 @@ var native_spec_default = {
28671
29536
  "accepted_submissions_count",
28672
29537
  "unresolved_submissions_count",
28673
29538
  "spots_remaining",
28674
- "business_goal_type",
28675
29539
  "allowed_country_codes",
28676
29540
  "submissions_closed_at",
28677
29541
  "scheduled_publish_at",
@@ -28702,7 +29566,7 @@ var native_spec_default = {
28702
29566
  type: "string"
28703
29567
  },
28704
29568
  denial_reason: {
28705
- description: "Why the submission was denied, when a presentable reason exists. Always null unless `status` is `denied`.",
29569
+ description: "Why the submission was denied, when a presentable reason exists. Always `null` unless `status` is `denied`.",
28706
29570
  type: [
28707
29571
  "string",
28708
29572
  "null"
@@ -28713,7 +29577,7 @@ var native_spec_default = {
28713
29577
  type: "string"
28714
29578
  },
28715
29579
  resolved_at: {
28716
- description: "When the submission was approved or denied, as an ISO 8601 timestamp.",
29580
+ description: "When the submission was approved or denied, as an ISO 8601 timestamp. `null` until then.",
28717
29581
  type: [
28718
29582
  "string",
28719
29583
  "null"
@@ -28731,7 +29595,7 @@ var native_spec_default = {
28731
29595
  type: "string"
28732
29596
  },
28733
29597
  submitted_at: {
28734
- description: "When proof was submitted for review, as an ISO 8601 timestamp. Null while the attempt is in progress.",
29598
+ description: "When proof was submitted for review, as an ISO 8601 timestamp. `null` while the attempt is in progress.",
28735
29599
  type: [
28736
29600
  "string",
28737
29601
  "null"
@@ -28743,7 +29607,7 @@ var native_spec_default = {
28743
29607
  },
28744
29608
  worker: {
28745
29609
  $ref: "#/components/schemas/UserSummary",
28746
- description: "The user who submitted the work."
29610
+ description: "User who submitted the work."
28747
29611
  }
28748
29612
  },
28749
29613
  required: [
@@ -31371,6 +32235,7 @@ var native_spec_default = {
31371
32235
  enum: [
31372
32236
  "create_business",
31373
32237
  "become_affiliate",
32238
+ "become_whop_partner",
31374
32239
  "theme_business",
31375
32240
  "create_product",
31376
32241
  "create_plan",
@@ -31381,6 +32246,12 @@ var native_spec_default = {
31381
32246
  "migrate_from_stripe",
31382
32247
  "accept_first_payment",
31383
32248
  "launch_first_ad",
32249
+ "launch_draft_campaign",
32250
+ "increase_ad_budget",
32251
+ "refresh_ad_creatives",
32252
+ "fix_ad_billing",
32253
+ "exclude_customers_from_ads",
32254
+ "retarget_abandoned_checkouts",
31384
32255
  "invite_team_member",
31385
32256
  "enable_tax_collection",
31386
32257
  "create_card",
@@ -36268,7 +37139,7 @@ import { createRequire as createRequire2 } from "module";
36268
37139
  // src/lib/build-info.ts
36269
37140
  var buildChannel = true ? "npm" : "dev";
36270
37141
  var buildTarget = typeof WHOP_CLI_TARGET === "string" ? WHOP_CLI_TARGET : null;
36271
- var buildVersion = true ? "0.8.2" : null;
37142
+ var buildVersion = true ? "0.9.1" : null;
36272
37143
  function isHomebrewPath(execPath, env = process.env) {
36273
37144
  if (/[/\\](Cellar|homebrew|linuxbrew)[/\\]/.test(execPath)) return true;
36274
37145
  const prefix = env.HOMEBREW_PREFIX?.trim();
@@ -37257,7 +38128,7 @@ var HTTP_METHODS = /* @__PURE__ */ new Set([
37257
38128
  ]);
37258
38129
  var API_VERSION_HEADER = "Api-Version-Date";
37259
38130
  var API_VERSION_DATE = native_spec_default.info["x-api-version-date"];
37260
- var HIDDEN_PARAMS = /* @__PURE__ */ new Set(["authorization", "api-version-date"]);
38131
+ var HIDDEN_PARAMS = /* @__PURE__ */ new Set(["api-version-date"]);
37261
38132
  var AUTO_FILLED_PARAMS = /* @__PURE__ */ new Set(["company_id", "account_id"]);
37262
38133
  function hiddenParamRefs(spec2) {
37263
38134
  const refs = /* @__PURE__ */ new Set();
@@ -37281,9 +38152,8 @@ function isHiddenParam(p, hiddenRefs) {
37281
38152
  return typeof rec.name === "string" && HIDDEN_PARAMS.has(rec.name.toLowerCase());
37282
38153
  }
37283
38154
  function transformParams(op, hiddenRefs) {
37284
- const { security: _security, ...rest } = op;
37285
- const params = rest.parameters;
37286
- if (!Array.isArray(params)) return rest;
38155
+ const params = op.parameters;
38156
+ if (!Array.isArray(params)) return op;
37287
38157
  const relaxed = params.filter((p) => !isHiddenParam(p, hiddenRefs)).map((p) => {
37288
38158
  if (p != null && typeof p === "object" && AUTO_FILLED_PARAMS.has(
37289
38159
  String(p.name ?? "")
@@ -37292,7 +38162,7 @@ function transformParams(op, hiddenRefs) {
37292
38162
  }
37293
38163
  return p;
37294
38164
  });
37295
- return { ...rest, parameters: relaxed };
38165
+ return { ...op, parameters: relaxed };
37296
38166
  }
37297
38167
  function filterSpecByTag(spec2, tag) {
37298
38168
  const hiddenRefs = hiddenParamRefs(spec2);
@@ -37383,7 +38253,7 @@ async function resolveActiveAccountId() {
37383
38253
  return resolveAccountId(profile, normalizeApiKey(rawKey));
37384
38254
  }
37385
38255
  function createWhopFetch() {
37386
- return async (request) => {
38256
+ return async (request2) => {
37387
38257
  const profile = getActiveProfile();
37388
38258
  const rawKey = profile ? await getValidAccessToken(profile) : process.env.WHOP_API_KEY ?? null;
37389
38259
  if (!rawKey) {
@@ -37391,11 +38261,11 @@ function createWhopFetch() {
37391
38261
  return Response.json({ message: message2 }, { status: 401 });
37392
38262
  }
37393
38263
  const token = normalizeApiKey(rawKey);
37394
- const incomingUrl = new URL(request.url);
37395
- const op = findOperation(request.method, incomingUrl.pathname);
38264
+ const incomingUrl = new URL(request2.url);
38265
+ const op = findOperation(request2.method, incomingUrl.pathname);
37396
38266
  const accountId = await resolveAccountId(profile, token);
37397
- const method = request.method.toUpperCase();
37398
- let body = request.body ? await request.text() : void 0;
38267
+ const method = request2.method.toUpperCase();
38268
+ let body = request2.body ? await request2.text() : void 0;
37399
38269
  if (op && accountId) {
37400
38270
  if (method === "GET" || method === "DELETE" || method === "HEAD") {
37401
38271
  for (const name of ACCOUNT_FIELDS) {
@@ -37436,13 +38306,13 @@ function createWhopFetch() {
37436
38306
  }
37437
38307
  const base = apiBaseUrl().replace(/\/$/, "");
37438
38308
  const target = `${base}${incomingUrl.pathname}${incomingUrl.search}`;
37439
- const headers = new Headers(request.headers);
38309
+ const headers = new Headers(request2.headers);
37440
38310
  headers.set("Authorization", `Bearer ${token}`);
37441
38311
  headers.set("Content-Type", "application/json");
37442
38312
  if (!headers.has(API_VERSION_HEADER)) {
37443
38313
  headers.set(API_VERSION_HEADER, API_VERSION_DATE);
37444
38314
  }
37445
- const res = await fetch(target, { method: request.method, headers, body });
38315
+ const res = await fetch(target, { method: request2.method, headers, body });
37446
38316
  if (res.ok) {
37447
38317
  if (method === "POST" || method === "PATCH") {
37448
38318
  const text5 = await res.text();
@@ -37521,7 +38391,7 @@ var groups_default = [
37521
38391
  {
37522
38392
  name: "stats",
37523
38393
  tag: "Stats",
37524
- description: "Aggregated account time series for reporting.",
38394
+ description: "Aggregated financial, audience, and traffic reporting.",
37525
38395
  group: "Core Resources"
37526
38396
  },
37527
38397
  {
@@ -37669,7 +38539,7 @@ import { isCancel as isCancel3, select as select2, spinner as spinner2, text as
37669
38539
  import { spawnSync as spawnSync2 } from "child_process";
37670
38540
  import { createHash as createHash3 } from "crypto";
37671
38541
  import { existsSync as existsSync5, readFileSync as readFileSync5, readdirSync as readdirSync2 } from "fs";
37672
- import { join as join6, relative as relative2, resolve as resolve4 } from "path";
38542
+ import { join as join6, relative as relative2, resolve as resolve5 } from "path";
37673
38543
  import chalk from "chalk";
37674
38544
 
37675
38545
  // src/journey/client.ts
@@ -37808,18 +38678,18 @@ async function waitForBuildPromotion(buildId, timeoutMs = 3e4) {
37808
38678
  return latest;
37809
38679
  }
37810
38680
  function sleep(ms) {
37811
- return new Promise((resolve5) => setTimeout(resolve5, ms));
38681
+ return new Promise((resolve6) => setTimeout(resolve6, ms));
37812
38682
  }
37813
38683
 
37814
38684
  // src/apps/config.ts
37815
38685
  import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
37816
- import { join as join4, resolve as resolve3 } from "path";
38686
+ import { join as join4, resolve as resolve4 } from "path";
37817
38687
  var APP_CONFIG_FILENAME = "whop.app.json";
37818
38688
  function findProjectDir(startDir) {
37819
- let dir = resolve3(startDir ?? process.cwd());
38689
+ let dir = resolve4(startDir ?? process.cwd());
37820
38690
  for (let i = 0; i < 25; i++) {
37821
38691
  if (existsSync3(join4(dir, APP_CONFIG_FILENAME))) return dir;
37822
- const parent = resolve3(dir, "..");
38692
+ const parent = resolve4(dir, "..");
37823
38693
  if (parent === dir) break;
37824
38694
  dir = parent;
37825
38695
  }
@@ -38191,7 +39061,8 @@ async function registerSpecCommands(group, tag) {
38191
39061
  const spec2 = filterSpecByTag(apps_spec_default, tag);
38192
39062
  const generated = await Openapi_exports.generateCommands(
38193
39063
  spec2,
38194
- createWhopFetch()
39064
+ createWhopFetch(),
39065
+ { config: { security: false } }
38195
39066
  );
38196
39067
  for (const [name, entry] of generated) {
38197
39068
  if ("run" in entry) group.command(name, entry);
@@ -38210,7 +39081,7 @@ function ensurePackageManager() {
38210
39081
  });
38211
39082
  }
38212
39083
  async function ensureViteApp(c2, pm, dirOption) {
38213
- const projectDir = dirOption ? resolve4(dirOption) : findProjectDir() ?? process.cwd();
39084
+ const projectDir = dirOption ? resolve5(dirOption) : findProjectDir() ?? process.cwd();
38214
39085
  const isViteApp = existsSync5(join6(projectDir, "package.json")) && findViteConfig(projectDir) !== void 0;
38215
39086
  if (isViteApp) return { projectDir, freshlyScaffolded: false };
38216
39087
  if (c2.agent) {
@@ -38271,7 +39142,7 @@ async function scaffoldNewApp(c2, pm) {
38271
39142
  retryable: true
38272
39143
  });
38273
39144
  }
38274
- const targetDir = resolve4(`./${route}`);
39145
+ const targetDir = resolve5(`./${route}`);
38275
39146
  if (existsSync5(targetDir) && readdirSync2(targetDir).length > 0) {
38276
39147
  throw new DeployAbort({
38277
39148
  code: "TARGET_NOT_EMPTY",
@@ -38500,9 +39371,9 @@ var LOG_LEVEL_COLORS = {
38500
39371
  function printLogLine(row) {
38501
39372
  const time = row.created_at.replace("T", " ").replace("Z", "");
38502
39373
  const color = LOG_LEVEL_COLORS[row.level] ?? chalk.dim;
38503
- const request = row.request_method ? chalk.dim(` ${row.request_method} ${row.request_path ?? ""}`) : "";
39374
+ const request2 = row.request_method ? chalk.dim(` ${row.request_method} ${row.request_path ?? ""}`) : "";
38504
39375
  console.log(
38505
- `${chalk.dim(time)} ${color(row.level.padEnd(5))}${request} ${row.message}`
39376
+ `${chalk.dim(time)} ${color(row.level.padEnd(5))}${request2} ${row.message}`
38506
39377
  );
38507
39378
  if (row.stack) console.log(chalk.dim(row.stack));
38508
39379
  }
@@ -38634,7 +39505,7 @@ async function buildAppGroup() {
38634
39505
  dir: external_exports.string().optional().describe("Project directory (defaults to the current directory)")
38635
39506
  }),
38636
39507
  run: async (c2) => {
38637
- const projectDir = c2.options.dir ? resolve4(c2.options.dir) : findProjectDir();
39508
+ const projectDir = c2.options.dir ? resolve5(c2.options.dir) : findProjectDir();
38638
39509
  const config = projectDir ? readAppConfig(projectDir) : null;
38639
39510
  if (!projectDir || !config) {
38640
39511
  return c2.error({
@@ -39664,7 +40535,8 @@ async function buildMediaGroup(description) {
39664
40535
  const spec2 = filterSpecByTag(native_spec_default, "Media");
39665
40536
  const generated = await Openapi_exports.generateCommands(
39666
40537
  spec2,
39667
- whopFetch2
40538
+ whopFetch2,
40539
+ { config: { security: false } }
39668
40540
  );
39669
40541
  const getEntry = generated.get("get");
39670
40542
  for (const [name, entry] of generated) {
@@ -39801,13 +40673,13 @@ async function fetchAsset(c2, getEntry, id, progress) {
39801
40673
  }
39802
40674
  }
39803
40675
  function sleep2(ms) {
39804
- return new Promise((resolve5) => setTimeout(resolve5, ms));
40676
+ return new Promise((resolve6) => setTimeout(resolve6, ms));
39805
40677
  }
39806
40678
 
39807
40679
  // package.json
39808
40680
  var package_default = {
39809
40681
  name: "@whop/cli",
39810
- version: "0.8.2",
40682
+ version: "0.9.1",
39811
40683
  description: "The Whop CLI \u2014 build and manage Whop apps from your terminal. Human and agent friendly.",
39812
40684
  keywords: [
39813
40685
  "agent",
@@ -39866,7 +40738,7 @@ var package_default = {
39866
40738
  devDependencies: {
39867
40739
  "@types/node": "25.3.5",
39868
40740
  fflate: "0.8.2",
39869
- incur: "github:whopio/incur#fbe3f4dbf48f1bc780cb1bca476f7dade1fe12d3",
40741
+ incur: "github:whopio/incur#9e4339e90ed46153268c0183d5f49245598bed57",
39870
40742
  tsup: "8.5.0",
39871
40743
  tsx: "4.19.4",
39872
40744
  typescript: "5.9.3",
@@ -40973,7 +41845,12 @@ for (const { name, tag, description } of API_GROUPS) {
40973
41845
  cli.command(await buildMediaGroup(description));
40974
41846
  continue;
40975
41847
  }
40976
- cli.command(name, { description, fetch: fetch2, openapi: spec(tag) });
41848
+ cli.command(name, {
41849
+ description,
41850
+ fetch: fetch2,
41851
+ openapi: spec(tag),
41852
+ openapiConfig: { security: false }
41853
+ });
40977
41854
  }
40978
41855
  var cli_default = cli;
40979
41856