@ancha-labs/cli 0.4.34 → 0.4.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/mcp-entry.mjs CHANGED
@@ -607,8 +607,8 @@ var require_Node = __commonJS({
607
607
  };
608
608
  const res = toJS.toJS(this, "", ctx);
609
609
  if (typeof onAnchor === "function")
610
- for (const { count: count4, res: res2 } of ctx.anchors.values())
611
- onAnchor(res2, count4);
610
+ for (const { count: count5, res: res2 } of ctx.anchors.values())
611
+ onAnchor(res2, count5);
612
612
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
613
613
  }
614
614
  };
@@ -716,13 +716,13 @@ var require_Alias = __commonJS({
716
716
  const anchor2 = anchors2 && source && anchors2.get(source);
717
717
  return anchor2 ? anchor2.count * anchor2.aliasCount : 0;
718
718
  } else if (identity2.isCollection(node3)) {
719
- let count4 = 0;
719
+ let count5 = 0;
720
720
  for (const item2 of node3.items) {
721
721
  const c = getAliasCount(doc, item2, anchors2);
722
- if (c > count4)
723
- count4 = c;
722
+ if (c > count5)
723
+ count5 = c;
724
724
  }
725
- return count4;
725
+ return count5;
726
726
  } else if (identity2.isPair(node3)) {
727
727
  const kc = getAliasCount(doc, node3.key, anchors2);
728
728
  const vc = getAliasCount(doc, node3.value, anchors2);
@@ -3675,8 +3675,8 @@ var require_Document = __commonJS({
3675
3675
  };
3676
3676
  const res = toJS.toJS(this.contents, jsonArg ?? "", ctx);
3677
3677
  if (typeof onAnchor === "function")
3678
- for (const { count: count4, res: res2 } of ctx.anchors.values())
3679
- onAnchor(res2, count4);
3678
+ for (const { count: count5, res: res2 } of ctx.anchors.values())
3679
+ onAnchor(res2, count5);
3680
3680
  return typeof reviver === "function" ? applyReviver.applyReviver(reviver, { "": res }, "", res) : res;
3681
3681
  }
3682
3682
  /**
@@ -3753,12 +3753,12 @@ var require_errors3 = __commonJS({
3753
3753
  lineStr = prev + lineStr;
3754
3754
  }
3755
3755
  if (/[^ ]/.test(lineStr)) {
3756
- let count4 = 1;
3756
+ let count5 = 1;
3757
3757
  const end = error62.linePos[1];
3758
3758
  if (end?.line === line2 && end.col > col) {
3759
- count4 = Math.max(1, Math.min(end.col - col, 80 - ci));
3759
+ count5 = Math.max(1, Math.min(end.col - col, 80 - ci));
3760
3760
  }
3761
- const pointer = " ".repeat(ci) + "^".repeat(count4);
3761
+ const pointer = " ".repeat(ci) + "^".repeat(count5);
3762
3762
  error62.message += `:
3763
3763
 
3764
3764
  ${lineStr}
@@ -8653,14 +8653,14 @@ function codePointLength(str) {
8653
8653
  const units = str.length;
8654
8654
  if (!highSurrogate.test(str))
8655
8655
  return units;
8656
- let count4 = units;
8656
+ let count5 = units;
8657
8657
  for (let i = 0; i < units - 1; i++) {
8658
8658
  if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
8659
- count4--;
8659
+ count5--;
8660
8660
  i++;
8661
8661
  }
8662
8662
  }
8663
- return count4;
8663
+ return count5;
8664
8664
  }
8665
8665
  function getLengthableOrigin(input2) {
8666
8666
  if (Array.isArray(input2))
@@ -13043,8 +13043,8 @@ function az_default() {
13043
13043
  }
13044
13044
 
13045
13045
  // node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/be.js
13046
- function getBelarusianPlural(count4, one, few, many) {
13047
- const absCount = Math.abs(count4);
13046
+ function getBelarusianPlural(count5, one, few, many) {
13047
+ const absCount = Math.abs(count5);
13048
13048
  const lastDigit = absCount % 10;
13049
13049
  const lastTwoDigits = absCount % 100;
13050
13050
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -15691,8 +15691,8 @@ function hu_default() {
15691
15691
  }
15692
15692
 
15693
15693
  // node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/hy.js
15694
- function getArmenianPlural(count4, one, many) {
15695
- return Math.abs(count4) === 1 ? one : many;
15694
+ function getArmenianPlural(count5, one, many) {
15695
+ return Math.abs(count5) === 1 ? one : many;
15696
15696
  }
15697
15697
  function withDefiniteArticle(word) {
15698
15698
  if (!word)
@@ -18430,8 +18430,8 @@ function ro_default() {
18430
18430
  }
18431
18431
 
18432
18432
  // node_modules/.pnpm/zod@4.6.7/node_modules/zod/v4/locales/ru.js
18433
- function getRussianPlural(count4, one, few, many) {
18434
- const absCount = Math.abs(count4);
18433
+ function getRussianPlural(count5, one, few, many) {
18434
+ const absCount = Math.abs(count5);
18435
18435
  const lastDigit = absCount % 10;
18436
18436
  const lastTwoDigits = absCount % 100;
18437
18437
  if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
@@ -34802,15 +34802,15 @@ var require_resolve = /* @__PURE__ */ __commonJSMin(((exports) => {
34802
34802
  return false;
34803
34803
  }
34804
34804
  function countKeys(schema) {
34805
- let count4 = 0;
34805
+ let count5 = 0;
34806
34806
  for (const key2 in schema) {
34807
34807
  if (key2 === "$ref") return Infinity;
34808
- count4++;
34808
+ count5++;
34809
34809
  if (SIMPLE_INLINED.has(key2)) continue;
34810
- if (typeof schema[key2] == "object") (0, util_1.eachItem)(schema[key2], (sch) => count4 += countKeys(sch));
34811
- if (count4 === Infinity) return Infinity;
34810
+ if (typeof schema[key2] == "object") (0, util_1.eachItem)(schema[key2], (sch) => count5 += countKeys(sch));
34811
+ if (count5 === Infinity) return Infinity;
34812
34812
  }
34813
- return count4;
34813
+ return count5;
34814
34814
  }
34815
34815
  function getFullPath(resolver, id10 = "", normalize) {
34816
34816
  if (normalize !== false) id10 = normalizeId(id10);
@@ -37763,8 +37763,8 @@ var require_contains = /* @__PURE__ */ __commonJSMin(((exports) => {
37763
37763
  cxt.result(valid, () => cxt.reset());
37764
37764
  function validateItemsWithCount() {
37765
37765
  const schValid = gen.name("_valid");
37766
- const count4 = gen.let("count", 0);
37767
- validateItems(schValid, () => gen.if(schValid, () => checkLimits(count4)));
37766
+ const count5 = gen.let("count", 0);
37767
+ validateItems(schValid, () => gen.if(schValid, () => checkLimits(count5)));
37768
37768
  }
37769
37769
  function validateItems(_valid, block2) {
37770
37770
  gen.forRange("i", 0, len, (i) => {
@@ -37777,13 +37777,13 @@ var require_contains = /* @__PURE__ */ __commonJSMin(((exports) => {
37777
37777
  block2();
37778
37778
  });
37779
37779
  }
37780
- function checkLimits(count4) {
37781
- gen.code((0, codegen_1._)`${count4}++`);
37782
- if (max === void 0) gen.if((0, codegen_1._)`${count4} >= ${min}`, () => gen.assign(valid, true).break());
37780
+ function checkLimits(count5) {
37781
+ gen.code((0, codegen_1._)`${count5}++`);
37782
+ if (max === void 0) gen.if((0, codegen_1._)`${count5} >= ${min}`, () => gen.assign(valid, true).break());
37783
37783
  else {
37784
- gen.if((0, codegen_1._)`${count4} > ${max}`, () => gen.assign(valid, false).break());
37784
+ gen.if((0, codegen_1._)`${count5} > ${max}`, () => gen.assign(valid, false).break());
37785
37785
  if (min === 1) gen.assign(valid, true);
37786
- else gen.if((0, codegen_1._)`${count4} >= ${min}`, () => gen.assign(valid, true));
37786
+ else gen.if((0, codegen_1._)`${count5} >= ${min}`, () => gen.assign(valid, true));
37787
37787
  }
37788
37788
  }
37789
37789
  }
@@ -44571,16 +44571,16 @@ function requiredClientCapabilitiesForInputRequest(entry2) {
44571
44571
  }
44572
44572
  function missingClientCapabilities(required2, declared) {
44573
44573
  const missing = {};
44574
- for (const [capability, requirement] of Object.entries(required2)) {
44575
- if (requirement === void 0) continue;
44574
+ for (const [capability, requirement2] of Object.entries(required2)) {
44575
+ if (requirement2 === void 0) continue;
44576
44576
  const declaredValue = declared === void 0 ? void 0 : declared[capability];
44577
44577
  if (declaredValue === void 0) {
44578
- missing[capability] = requirement;
44578
+ missing[capability] = requirement2;
44579
44579
  continue;
44580
44580
  }
44581
- if (isPlainObject$7(requirement) && isPlainObject$7(declaredValue)) {
44581
+ if (isPlainObject$7(requirement2) && isPlainObject$7(declaredValue)) {
44582
44582
  const missingMembers = {};
44583
- for (const [member, memberRequirement] of Object.entries(requirement)) if (memberRequirement !== void 0 && declaredValue[member] === void 0 && !isImpliedCapabilityMember(capability, member, declaredValue)) missingMembers[member] = memberRequirement;
44583
+ for (const [member, memberRequirement] of Object.entries(requirement2)) if (memberRequirement !== void 0 && declaredValue[member] === void 0 && !isImpliedCapabilityMember(capability, member, declaredValue)) missingMembers[member] = memberRequirement;
44584
44584
  if (Object.keys(missingMembers).length > 0) missing[capability] = missingMembers;
44585
44585
  }
44586
44586
  }
@@ -50774,15 +50774,15 @@ var require_resolve2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
50774
50774
  return false;
50775
50775
  }
50776
50776
  function countKeys(schema) {
50777
- let count4 = 0;
50777
+ let count5 = 0;
50778
50778
  for (const key2 in schema) {
50779
50779
  if (key2 === "$ref") return Infinity;
50780
- count4++;
50780
+ count5++;
50781
50781
  if (SIMPLE_INLINED.has(key2)) continue;
50782
- if (typeof schema[key2] == "object") (0, util_1.eachItem)(schema[key2], (sch) => count4 += countKeys(sch));
50783
- if (count4 === Infinity) return Infinity;
50782
+ if (typeof schema[key2] == "object") (0, util_1.eachItem)(schema[key2], (sch) => count5 += countKeys(sch));
50783
+ if (count5 === Infinity) return Infinity;
50784
50784
  }
50785
- return count4;
50785
+ return count5;
50786
50786
  }
50787
50787
  function getFullPath(resolver, id10 = "", normalize) {
50788
50788
  if (normalize !== false) id10 = normalizeId(id10);
@@ -53735,8 +53735,8 @@ var require_contains2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
53735
53735
  cxt.result(valid, () => cxt.reset());
53736
53736
  function validateItemsWithCount() {
53737
53737
  const schValid = gen.name("_valid");
53738
- const count4 = gen.let("count", 0);
53739
- validateItems(schValid, () => gen.if(schValid, () => checkLimits(count4)));
53738
+ const count5 = gen.let("count", 0);
53739
+ validateItems(schValid, () => gen.if(schValid, () => checkLimits(count5)));
53740
53740
  }
53741
53741
  function validateItems(_valid, block2) {
53742
53742
  gen.forRange("i", 0, len, (i) => {
@@ -53749,13 +53749,13 @@ var require_contains2 = /* @__PURE__ */ __commonJSMin2(((exports) => {
53749
53749
  block2();
53750
53750
  });
53751
53751
  }
53752
- function checkLimits(count4) {
53753
- gen.code((0, codegen_1._)`${count4}++`);
53754
- if (max === void 0) gen.if((0, codegen_1._)`${count4} >= ${min}`, () => gen.assign(valid, true).break());
53752
+ function checkLimits(count5) {
53753
+ gen.code((0, codegen_1._)`${count5}++`);
53754
+ if (max === void 0) gen.if((0, codegen_1._)`${count5} >= ${min}`, () => gen.assign(valid, true).break());
53755
53755
  else {
53756
- gen.if((0, codegen_1._)`${count4} > ${max}`, () => gen.assign(valid, false).break());
53756
+ gen.if((0, codegen_1._)`${count5} > ${max}`, () => gen.assign(valid, false).break());
53757
53757
  if (min === 1) gen.assign(valid, true);
53758
- else gen.if((0, codegen_1._)`${count4} >= ${min}`, () => gen.assign(valid, true));
53758
+ else gen.if((0, codegen_1._)`${count5} >= ${min}`, () => gen.assign(valid, true));
53759
53759
  }
53760
53760
  }
53761
53761
  }
@@ -57517,8 +57517,8 @@ function parseDuration(s) {
57517
57517
  });
57518
57518
  }
57519
57519
  const [, sign, d, h, m, sec, ms] = match;
57520
- const total = Number(d ?? 0) * MS_PER.d + Number(h ?? 0) * MS_PER.h + Number(m ?? 0) * MS_PER.m + Number(sec ?? 0) * MS_PER.s + Number(ms ?? 0) * MS_PER.ms;
57521
- return sign === "-" && total !== 0 ? -total : total;
57520
+ const total2 = Number(d ?? 0) * MS_PER.d + Number(h ?? 0) * MS_PER.h + Number(m ?? 0) * MS_PER.m + Number(sec ?? 0) * MS_PER.s + Number(ms ?? 0) * MS_PER.ms;
57521
+ return sign === "-" && total2 !== 0 ? -total2 : total2;
57522
57522
  }
57523
57523
 
57524
57524
  // packages/core/src/agent-tools-protocol.ts
@@ -58432,7 +58432,7 @@ var GA4SeedSchema = external_exports.strictObject({
58432
58432
  if (new Set(session.events.map((e) => e.name)).size !== session.events.length) issue2(["sessions", i, "events"], "event names must be unique within one session");
58433
58433
  });
58434
58434
  if (seed2.sessions.reduce((n, s) => n + s.events.length, 0) > 1e5) issue2(["sessions"], "seed exceeds 100000 event buckets");
58435
- for (const property2 of seed2.properties) if (seed2.sessions.filter((s) => s.propertyId === property2.id).reduce((n, s) => n + s.events.reduce((total, e) => total + BigInt(e.revenueMicros), 0n), 0n) > BigInt(Number.MAX_SAFE_INTEGER)) issue2(["sessions"], "property revenue exceeds supported exact micro-unit range");
58435
+ for (const property2 of seed2.properties) if (seed2.sessions.filter((s) => s.propertyId === property2.id).reduce((n, s) => n + s.events.reduce((total2, e) => total2 + BigInt(e.revenueMicros), 0n), 0n) > BigInt(Number.MAX_SAFE_INTEGER)) issue2(["sessions"], "property revenue exceeds supported exact micro-unit range");
58436
58436
  });
58437
58437
  function ga4StarterSeed() {
58438
58438
  const session = (n, date9, userId, source, medium, campaign2, qualified = false) => ({
@@ -59988,6 +59988,8 @@ var past = external_exports.string().refine(
59988
59988
  (value2) => external_exports.iso.datetime({ offset: true }).safeParse(value2).success ? Number.isFinite(Date.parse(value2)) : isDuration(value2) && parseDuration(value2) <= 0,
59989
59989
  "expected an ISO 8601 time with a timezone, or a nonpositive offset from the start of the test such as -720h"
59990
59990
  );
59991
+ var STRIPE_TEST_BANKS = ["success", "no_account", "account_closed", "insufficient_funds", "debit_not_authorized", "invalid_currency"];
59992
+ var span = external_exports.string().refine((value2) => isDuration(value2) && parseDuration(value2) >= 0, "expected a nonnegative duration such as 2d or 30m");
59991
59993
  var moment = external_exports.string().refine(
59992
59994
  (value2) => external_exports.iso.datetime({ offset: true }).safeParse(value2).success ? Number.isFinite(Date.parse(value2)) : isDuration(value2),
59993
59995
  "expected an ISO 8601 time with a timezone, or an offset from the start of the test such as 72h or -24h"
@@ -59997,6 +59999,29 @@ var StripeSeedSchema = external_exports.strictObject({
59997
59999
  account: external_exports.strictObject({ name: text8, currency: external_exports.enum(["usd", "eur", "gbp", "cad", "aud"]).default("usd"), statement_descriptor: external_exports.string().regex(/^[A-Za-z0-9 .-]{5,22}$/).optional() }),
59998
60000
  /** Funds on the account, in the account currency. */
59999
60001
  balance: external_exports.strictObject({ available: amount.default(0), pending: amount.default(0) }).default({ available: 0, pending: 0 }),
60002
+ /** Connect timings, with Stripe's US defaults: funds settle, payouts arrive, verification reviews and disputes cost.
60003
+ * Optional without a default, like connected_accounts: a seed that omits both parses and fingerprints as before. */
60004
+ connect: external_exports.strictObject({
60005
+ settlement: external_exports.strictObject({ available_after: span.default("2d"), payout_arrival: span.default("1d") }).default({ available_after: "2d", payout_arrival: "1d" }),
60006
+ verification: external_exports.strictObject({ review: span.default("0s") }).default({ review: "0s" }),
60007
+ disputes: external_exports.strictObject({ fee: amount.default(1500) }).default({ fee: 1500 })
60008
+ }).optional(),
60009
+ /** Connect: the platform's connected accounts (sellers), referenced as $ref in scenes and checks. */
60010
+ connected_accounts: external_exports.array(external_exports.strictObject({
60011
+ ref: ref9,
60012
+ type: external_exports.enum(["express", "custom"]).default("express"),
60013
+ email: external_exports.string().regex(EMAIL3),
60014
+ name: text8,
60015
+ business_type: external_exports.enum(["individual", "company"]).default("individual"),
60016
+ /** complete: card_payments and transfers active; incomplete: onboarding requirements due; restricted: past due, capabilities inactive. */
60017
+ onboarding: external_exports.enum(["complete", "incomplete", "restricted"]).default("complete"),
60018
+ /** The payout bank account: success, or one of Stripe's failing test accounts. */
60019
+ bank: external_exports.enum(STRIPE_TEST_BANKS).default("success"),
60020
+ payouts: external_exports.enum(["daily", "weekly", "monthly", "manual"]).default("daily"),
60021
+ balance: external_exports.strictObject({ available: amount.default(0), pending: amount.default(0) }).default({ available: 0, pending: 0 }),
60022
+ created: past.default("-720h"),
60023
+ metadata
60024
+ })).max(200).optional(),
60000
60025
  products: external_exports.array(external_exports.strictObject({
60001
60026
  ref: ref9,
60002
60027
  name: text8,
@@ -60142,6 +60167,7 @@ var StripeSeedSchema = external_exports.strictObject({
60142
60167
  });
60143
60168
  });
60144
60169
  seed2.customers.forEach((c, i) => declare("customer", c.ref, ["customers", i, "ref"]));
60170
+ (seed2.connected_accounts ?? []).forEach((a, i) => declare("account", a.ref, ["connected_accounts", i, "ref"]));
60145
60171
  const customerOf = /* @__PURE__ */ new Map();
60146
60172
  seed2.subscriptions.forEach((s, i) => {
60147
60173
  declare("subscription", s.ref, ["subscriptions", i, "ref"]);
@@ -60178,10 +60204,10 @@ var StripeSeedSchema = external_exports.strictObject({
60178
60204
  declare("credit_note", n.ref, ["credit_notes", i, "ref"]);
60179
60205
  const inv = seed2.invoices.find((v) => v.ref === n.invoice);
60180
60206
  if (!inv || inv.status !== "paid") issue2(["credit_notes", i, "invoice"], "credit notes need a paid invoice");
60181
- const total = inv?.lines.reduce((sum, l) => sum + (l.unit_amount ?? prices.get(l.price)?.unit_amount ?? 0) * l.quantity, 0) ?? 0;
60207
+ const total2 = inv?.lines.reduce((sum, l) => sum + (l.unit_amount ?? prices.get(l.price)?.unit_amount ?? 0) * l.quantity, 0) ?? 0;
60182
60208
  const cumulative = (credited.get(n.invoice) ?? 0) + n.amount;
60183
60209
  credited.set(n.invoice, cumulative);
60184
- if (cumulative > total) issue2(["credit_notes", i, "amount"], "credit notes exceed the invoice total");
60210
+ if (cumulative > total2) issue2(["credit_notes", i, "amount"], "credit notes exceed the invoice total");
60185
60211
  });
60186
60212
  const disputed = /* @__PURE__ */ new Set();
60187
60213
  seed2.disputes?.forEach((d, i) => {
@@ -60192,8 +60218,8 @@ var StripeSeedSchema = external_exports.strictObject({
60192
60218
  const payment = seed2.payments.find((p2) => p2.ref === d.payment), inv = seed2.invoices.find((v) => v.ref === d.payment);
60193
60219
  const card = inv ? seed2.customers.find((c) => c.ref === inv.customer)?.card : void 0;
60194
60220
  if (inv && (card?.decline || seed2.livemode === false && !card)) issue2(["disputes", i, "payment"], "an invoice dispute needs a successful card charge");
60195
- const total = payment?.amount ?? inv?.lines.reduce((sum, l) => sum + (l.unit_amount ?? prices.get(l.price)?.unit_amount ?? 0) * l.quantity, 0) ?? 0;
60196
- if (d.amount !== void 0 && d.amount > total) issue2(["disputes", i, "amount"], "dispute amount exceeds the payment");
60221
+ const total2 = payment?.amount ?? inv?.lines.reduce((sum, l) => sum + (l.unit_amount ?? prices.get(l.price)?.unit_amount ?? 0) * l.quantity, 0) ?? 0;
60222
+ if (d.amount !== void 0 && d.amount > total2) issue2(["disputes", i, "amount"], "dispute amount exceeds the payment");
60197
60223
  });
60198
60224
  seed2.refunds.forEach((r, i) => {
60199
60225
  declare("refund", r.ref, ["refunds", i, "ref"]);
@@ -60219,9 +60245,80 @@ var StripeSubscriptionsCheckSchema = external_exports.strictObject({
60219
60245
  var StripeUnchangedCheckSchema = external_exports.strictObject({
60220
60246
  objects: external_exports.array(external_exports.strictObject({ type: StripeObjectTypeSchema, id: objectId })).min(1).max(1e3)
60221
60247
  });
60248
+ var capabilityState = external_exports.enum(["active", "inactive", "pending", "unrequested"]);
60249
+ var signedAmount = external_exports.number().int().min(-99999999).max(99999999);
60250
+ var count2 = external_exports.number().int().nonnegative();
60251
+ var total = external_exports.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
60252
+ var requirement = external_exports.string().regex(/^[a-z_]+(?:\.[a-z0-9_]+)*$/, "expected a requirement such as individual.verification.document");
60253
+ var StripeAccountsCheckSchema = external_exports.strictObject({
60254
+ account: objectId.optional(),
60255
+ email: external_exports.email().optional(),
60256
+ charges_enabled: external_exports.boolean().optional(),
60257
+ payouts_enabled: external_exports.boolean().optional(),
60258
+ details_submitted: external_exports.boolean().optional(),
60259
+ capabilities: external_exports.strictObject({ card_payments: capabilityState.optional(), transfers: capabilityState.optional() }).optional(),
60260
+ disabled_reason: external_exports.string().min(1).nullable().optional(),
60261
+ /** true: something is currently due or past due. */
60262
+ requirements_due: external_exports.boolean().optional(),
60263
+ count: count2.optional()
60264
+ }).refine((c) => c.account === void 0 || c.email === void 0, "give account or email, not both");
60265
+ var StripeTransfersCheckSchema = external_exports.strictObject({
60266
+ destination: objectId.optional(),
60267
+ charge: objectId.optional(),
60268
+ transfer_group: external_exports.string().min(1).optional(),
60269
+ count: count2.optional(),
60270
+ amount: total.optional(),
60271
+ amount_reversed: total.optional(),
60272
+ after_start: external_exports.boolean().optional()
60273
+ }).refine((c) => c.count !== void 0 || c.amount !== void 0 || c.amount_reversed !== void 0, "give count, amount or amount_reversed");
60274
+ var StripeApplicationFeesCheckSchema = external_exports.strictObject({
60275
+ account: objectId.optional(),
60276
+ charge: objectId.optional(),
60277
+ count: count2.optional(),
60278
+ amount: total.optional(),
60279
+ amount_refunded: total.optional(),
60280
+ after_start: external_exports.boolean().optional()
60281
+ }).refine((c) => c.count !== void 0 || c.amount !== void 0 || c.amount_refunded !== void 0, "give count, amount or amount_refunded");
60282
+ var StripePayoutsCheckSchema = external_exports.strictObject({
60283
+ account: objectId.optional(),
60284
+ status: external_exports.enum(["pending", "in_transit", "paid", "failed", "canceled"]).optional(),
60285
+ failure_code: external_exports.string().min(1).optional(),
60286
+ count: count2.optional(),
60287
+ amount: total.optional(),
60288
+ after_start: external_exports.boolean().optional()
60289
+ }).refine((c) => c.count !== void 0 || c.amount !== void 0, "give count, amount, or both");
60290
+ var StripeAccountBalanceCheckSchema = external_exports.strictObject({ account: objectId.optional(), available: signedAmount.optional(), pending: signedAmount.optional() }).refine((c) => c.available !== void 0 || c.pending !== void 0, "give available, pending, or both");
60291
+ var accountTarget = { account: objectId.optional(), email: external_exports.email().optional() };
60292
+ var oneAccount = (a) => a.account === void 0 !== (a.email === void 0);
60293
+ var StripeCompleteOnboardingSchema = external_exports.strictObject({ ...accountTarget, bank: external_exports.enum(STRIPE_TEST_BANKS).optional() }).refine(oneAccount, "give exactly one of account or email");
60294
+ var StripeRequireSchema = external_exports.strictObject({
60295
+ ...accountTarget,
60296
+ requirements: external_exports.array(requirement).min(1).max(30),
60297
+ capabilities: external_exports.array(external_exports.enum(["card_payments", "transfers"])).min(1).optional(),
60298
+ deadline: span.optional()
60299
+ }).refine(oneAccount, "give exactly one of account or email");
60300
+ var StripeUpdateBankSchema = external_exports.strictObject({ ...accountTarget, bank: external_exports.enum(STRIPE_TEST_BANKS) }).refine(oneAccount, "give exactly one of account or email");
60301
+ var StripeDisputeSchema = external_exports.strictObject({
60302
+ charge: objectId.optional(),
60303
+ payment_intent: objectId.optional(),
60304
+ customer_email: external_exports.email().optional(),
60305
+ reason: external_exports.enum(["fraudulent", "product_not_received", "product_unacceptable", "duplicate", "subscription_canceled", "credit_not_processed", "unrecognized", "general"]).default("fraudulent"),
60306
+ amount: amount.optional()
60307
+ }).refine((a) => [a.charge, a.payment_intent, a.customer_email].filter((v) => v !== void 0).length === 1, "give exactly one of charge, payment_intent or customer_email");
60308
+ var StripeCloseDisputeSchema = external_exports.strictObject({
60309
+ dispute: objectId.optional(),
60310
+ charge: objectId.optional(),
60311
+ payment_intent: objectId.optional(),
60312
+ customer_email: external_exports.email().optional(),
60313
+ outcome: external_exports.enum(["won", "lost"])
60314
+ }).refine((a) => [a.dispute, a.charge, a.payment_intent, a.customer_email].filter((v) => v !== void 0).length === 1, "give exactly one of dispute, charge, payment_intent or customer_email");
60222
60315
  var stripeStarterSeed = {
60223
60316
  account: { name: "Acme", currency: "usd", statement_descriptor: "ACME ANALYTICS" },
60224
60317
  balance: { available: 1284550, pending: 12e4 },
60318
+ connected_accounts: [
60319
+ { ref: "seller_ready", type: "express", name: "Alex Reed", email: "alex@market.example", onboarding: "complete", payouts: "manual" },
60320
+ { ref: "seller_new", type: "express", name: "Sam Park", email: "sam@market.example", onboarding: "incomplete", payouts: "manual" }
60321
+ ],
60225
60322
  products: [
60226
60323
  { ref: "team", name: "Acme Team", description: "Dashboards and exports for up to ten analysts", prices: [{ ref: "team_monthly", unit_amount: 12e4, nickname: "Team monthly", lookup_key: "team_monthly", recurring: { interval: "month" } }] },
60227
60324
  { ref: "enterprise", name: "Acme Enterprise", description: "Per-seat plan with SSO and audit logs", unit_label: "seat", prices: [
@@ -60420,13 +60517,13 @@ var ClerkWebhookSchema = external_exports.strictObject({
60420
60517
  events: external_exports.array(external_exports.string().regex(/^[a-zA-Z]+\.[a-z_]+$/, "a Clerk event type such as user.created")).min(1).optional()
60421
60518
  });
60422
60519
  var sessionFilter = { ...identity, status: external_exports.enum(["abandoned", "active", "ended", "expired", "removed", "replaced", "revoked"]).optional() };
60423
- var count2 = external_exports.number().int().nonnegative();
60520
+ var count3 = external_exports.number().int().nonnegative();
60424
60521
  var ClerkSessionsCheckSchema = external_exports.union([
60425
- external_exports.strictObject({ ...sessionFilter, count: count2 }),
60426
- external_exports.strictObject({ ...sessionFilter, count_gte: count2.default(1) }),
60427
- external_exports.strictObject({ ...sessionFilter, count_lte: count2 })
60522
+ external_exports.strictObject({ ...sessionFilter, count: count3 }),
60523
+ external_exports.strictObject({ ...sessionFilter, count_gte: count3.default(1) }),
60524
+ external_exports.strictObject({ ...sessionFilter, count_lte: count3 })
60428
60525
  ]).refine(oneIdentity, "give exactly one of user or email");
60429
- var ClerkMembershipsCheckSchema = external_exports.strictObject({ ...identity, organization: external_exports.string().min(1), role: external_exports.enum(CLERK_ROLES).optional(), count: count2.optional() }).refine(oneIdentity, "give exactly one of user or email");
60526
+ var ClerkMembershipsCheckSchema = external_exports.strictObject({ ...identity, organization: external_exports.string().min(1), role: external_exports.enum(CLERK_ROLES).optional(), count: count3.optional() }).refine(oneIdentity, "give exactly one of user or email");
60430
60527
 
60431
60528
  // packages/core/src/tools/better-stack.ts
60432
60529
  var BETTER_STACK_MONITOR_TYPES = ["status", "expected_status_code", "keyword", "keyword_absence", "ping", "tcp", "udp", "smtp", "pop", "imap", "dns"];
@@ -62821,8 +62918,8 @@ var offset12 = duration5((ms) => ms <= 0, "expected a duration at or before star
62821
62918
  var when5 = duration5(() => true, "expected a duration such as -2h or 30d");
62822
62919
  var cents2 = (value2) => Math.abs(value2 * 100 - Math.round(value2 * 100)) < 1e-9;
62823
62920
  var price = external_exports.number().min(0.01).max(0.99).refine(cents2, "a whole number of cents, e.g. 0.56");
62824
- var count3 = external_exports.number().positive().max(1e7).refine(cents2, "at most two decimal places");
62825
- var level = external_exports.tuple([price, count3]);
62921
+ var count4 = external_exports.number().positive().max(1e7).refine(cents2, "at most two decimal places");
62922
+ var level = external_exports.tuple([price, count4]);
62826
62923
  var ticker = external_exports.string().regex(/^[A-Z0-9][A-Z0-9.-]*$/, "an upper-case ticker such as KXFED-26DEC").max(100);
62827
62924
  var market = external_exports.strictObject({
62828
62925
  /** Appended to the event ticker: KXFEDDECISION-26DEC + C25 → KXFEDDECISION-26DEC-C25. */
@@ -62848,7 +62945,7 @@ var market = external_exports.strictObject({
62848
62945
  /** Other traders' resting bids: `yes` buys Yes, `no` buys No, as [price, contracts]. */
62849
62946
  book: external_exports.strictObject({ yes: external_exports.array(level).max(100).default([]), no: external_exports.array(level).max(100).default([]) }).default({ yes: [], no: [] }),
62850
62947
  /** Recent public trades between other traders. */
62851
- trades: external_exports.array(external_exports.strictObject({ at: offset12, count: count3, yesPrice: price, takerSide: external_exports.enum(["yes", "no"]) })).max(1e3).default([])
62948
+ trades: external_exports.array(external_exports.strictObject({ at: offset12, count: count4, yesPrice: price, takerSide: external_exports.enum(["yes", "no"]) })).max(1e3).default([])
62852
62949
  });
62853
62950
  var event2 = external_exports.strictObject({
62854
62951
  ticker,
@@ -62874,12 +62971,12 @@ var order = external_exports.strictObject({
62874
62971
  market: ticker,
62875
62972
  side: external_exports.enum(["bid", "ask"]),
62876
62973
  price,
62877
- count: count3,
62974
+ count: count4,
62878
62975
  created: offset12,
62879
62976
  clientOrderId: external_exports.string().min(1).max(100).optional(),
62880
62977
  timeInForce: external_exports.enum(KALSHI_TIME_IN_FORCE).default("good_till_canceled"),
62881
62978
  /** Executions, oldest first; a bid fills at or below its price, an ask at or above. Whatever is left rests unless canceled. */
62882
- fills: external_exports.array(external_exports.strictObject({ at: offset12, count: count3, price: price.optional(), taker: external_exports.boolean().default(true) })).max(1e3).default([]),
62979
+ fills: external_exports.array(external_exports.strictObject({ at: offset12, count: count4, price: price.optional(), taker: external_exports.boolean().default(true) })).max(1e3).default([]),
62883
62980
  canceled: offset12.optional()
62884
62981
  });
62885
62982
  var KalshiSeedSchema = external_exports.strictObject({
@@ -65263,7 +65360,7 @@ var FUNCTIONS = {
65263
65360
  const cleaned = formulaText(value2).replace(/[^0-9.eE+-]/g, "");
65264
65361
  return cleaned ? Number.isNaN(Number(cleaned)) ? err() : Number(cleaned) : null;
65265
65362
  } },
65266
- SUM: { min: 1, max: Infinity, run: (args) => numbers(args).reduce((total, n) => total + n, 0) },
65363
+ SUM: { min: 1, max: Infinity, run: (args) => numbers(args).reduce((total2, n) => total2 + n, 0) },
65267
65364
  MAX: { min: 1, max: Infinity, run: (args) => {
65268
65365
  const list = numbers(args);
65269
65366
  return list.length ? Math.max(...list) : 0;
@@ -65274,7 +65371,7 @@ var FUNCTIONS = {
65274
65371
  } },
65275
65372
  AVERAGE: { min: 1, max: Infinity, run: (args) => {
65276
65373
  const list = numbers(args);
65277
- return list.length ? list.reduce((total, n) => total + n, 0) / list.length : err();
65374
+ return list.length ? list.reduce((total2, n) => total2 + n, 0) / list.length : err();
65278
65375
  } },
65279
65376
  COUNT: { min: 1, max: Infinity, run: (args) => numbers(args).length },
65280
65377
  COUNTA: { min: 1, max: Infinity, run: (args) => args.flatMap(flat).filter((item2) => item2 !== null && item2 !== "").length },
@@ -65289,11 +65386,11 @@ var FUNCTIONS = {
65289
65386
  } },
65290
65387
  RECORD_ID: { min: 0, max: 0, run: (_args, scope2) => scope2.recordId },
65291
65388
  DATEADD: { min: 3, max: 3, run: (args) => {
65292
- const date9 = dateArg(args[0]), count4 = num(args[1]), unit = unitOf(args[2]);
65389
+ const date9 = dateArg(args[0]), count5 = num(args[1]), unit = unitOf(args[2]);
65293
65390
  if (date9 === null) return null;
65294
- if (isFormulaError(date9) || !unit || Number.isNaN(count4)) return err();
65295
- if (FIXED[unit]) return formulaDate(date9.ms + count4 * FIXED[unit], date9.dateOnly && unit !== "milliseconds" && unit !== "seconds" && unit !== "minutes" && unit !== "hours");
65296
- return formulaDate(addMonths(date9.ms, Math.trunc(count4) * (unit === "years" ? 12 : unit === "quarters" ? 3 : 1)), date9.dateOnly);
65391
+ if (isFormulaError(date9) || !unit || Number.isNaN(count5)) return err();
65392
+ if (FIXED[unit]) return formulaDate(date9.ms + count5 * FIXED[unit], date9.dateOnly && unit !== "milliseconds" && unit !== "seconds" && unit !== "minutes" && unit !== "hours");
65393
+ return formulaDate(addMonths(date9.ms, Math.trunc(count5) * (unit === "years" ? 12 : unit === "quarters" ? 3 : 1)), date9.dateOnly);
65297
65394
  } },
65298
65395
  DATETIME_DIFF: { min: 2, max: 3, run: (args) => {
65299
65396
  const a = dateArg(args[0]), b = dateArg(args[1]), unit = args[2] === void 0 ? "seconds" : unitOf(args[2]);
@@ -65371,11 +65468,11 @@ var FUNCTIONS = {
65371
65468
  } },
65372
65469
  WORKDAY: { min: 2, max: 3, run: (args) => {
65373
65470
  if (args[2] !== void 0) throw new FormulaGap("WORKDAY() with holidays");
65374
- const date9 = dateArg(args[0]), count4 = Math.trunc(num(args[1]));
65471
+ const date9 = dateArg(args[0]), count5 = Math.trunc(num(args[1]));
65375
65472
  if (date9 === null || isFormulaError(date9)) return date9;
65376
65473
  let ms = startOfDay(date9.ms);
65377
- for (let left = Math.abs(count4); left > 0; ) {
65378
- ms += Math.sign(count4) * 864e5;
65474
+ for (let left = Math.abs(count5); left > 0; ) {
65475
+ ms += Math.sign(count5) * 864e5;
65379
65476
  if (isWorkday(ms)) left--;
65380
65477
  }
65381
65478
  return formulaDate(ms, true);
@@ -66740,13 +66837,13 @@ function books(seed2, issue2, money8) {
66740
66837
  account3(t.account, ["customerRefunds", index, "account"], ["Bank"], "refund account");
66741
66838
  }
66742
66839
  for (const [id10, amount2] of applied) if (round2(amount2) > (totals.get(id10) ?? 0) + 1e-9) {
66743
- const name3 = seed2.invoices.some((t) => t.id === id10) ? "invoices" : "vendorBills", path2 = [name3, seed2[name3].findIndex((t) => t.id === id10)], total = totals.get(id10) ?? 0;
66744
- issue2(path2, `${name3 === "invoices" ? "invoice" : "vendor bill"} is over-applied: applications total ${money8(path2, round2(amount2))} against a total of ${money8(path2, total)} (over by ${money8(path2, round2(amount2 - total))})`);
66840
+ const name3 = seed2.invoices.some((t) => t.id === id10) ? "invoices" : "vendorBills", path2 = [name3, seed2[name3].findIndex((t) => t.id === id10)], total2 = totals.get(id10) ?? 0;
66841
+ issue2(path2, `${name3 === "invoices" ? "invoice" : "vendor bill"} is over-applied: applications total ${money8(path2, round2(amount2))} against a total of ${money8(path2, total2)} (over by ${money8(path2, round2(amount2 - total2))})`);
66745
66842
  }
66746
66843
  for (const name3 of ["creditMemos", "customerPayments", "vendorCredits", "vendorPayments"]) for (const [index, t] of seed2[name3].entries()) {
66747
- const total = ("amount" in t ? t.amount : totals.get(t.id) ?? 0) + ("credit" in t ? t.credit.reduce((sum, a) => sum + a.amount, 0) : 0);
66844
+ const total2 = ("amount" in t ? t.amount : totals.get(t.id) ?? 0) + ("credit" in t ? t.credit.reduce((sum, a) => sum + a.amount, 0) : 0);
66748
66845
  const used2 = round2(spent.get(t.id) ?? 0), path2 = [name3, index, "apply"];
66749
- if (used2 > total + 1e-9) issue2(path2, `applies more than the ${name3 === "creditMemos" ? "credit memo" : name3 === "vendorCredits" ? "bill credit" : "payment"}: ${money8(path2, used2)} against ${money8(path2, round2(total))} (over by ${money8(path2, round2(used2 - total))})`);
66846
+ if (used2 > total2 + 1e-9) issue2(path2, `applies more than the ${name3 === "creditMemos" ? "credit memo" : name3 === "vendorCredits" ? "bill credit" : "payment"}: ${money8(path2, used2)} against ${money8(path2, round2(total2))} (over by ${money8(path2, round2(used2 - total2))})`);
66750
66847
  }
66751
66848
  const open2 = [];
66752
66849
  const ar = seed2.accounts.find((a) => a.type === "AcctRec" && !a.inactive)?.id, ap = seed2.accounts.find((a) => a.type === "AcctPay" && !a.inactive)?.id;
@@ -67686,6 +67783,11 @@ var StateCheckSchema = external_exports.union([
67686
67783
  external_exports.strictObject({ "clerk.sessions": ClerkSessionsCheckSchema }),
67687
67784
  external_exports.strictObject({ "clerk.memberships": ClerkMembershipsCheckSchema }),
67688
67785
  external_exports.strictObject({ "stripe.subscriptions": StripeSubscriptionsCheckSchema }),
67786
+ external_exports.strictObject({ "stripe.accounts": StripeAccountsCheckSchema }),
67787
+ external_exports.strictObject({ "stripe.transfers": StripeTransfersCheckSchema }),
67788
+ external_exports.strictObject({ "stripe.application_fees": StripeApplicationFeesCheckSchema }),
67789
+ external_exports.strictObject({ "stripe.payouts": StripePayoutsCheckSchema }),
67790
+ external_exports.strictObject({ "stripe.account_balance": StripeAccountBalanceCheckSchema }),
67689
67791
  external_exports.strictObject({ "zendesk.ticket": ZendeskTicketCheckSchema }),
67690
67792
  external_exports.strictObject({ "zendesk.unchanged": ZendeskUnchangedCheckSchema }),
67691
67793
  external_exports.strictObject({ "netsuite.record": NetsuiteRecordCheckSchema }),
@@ -67717,7 +67819,12 @@ var actorActions = [
67717
67819
  { "shopify.complete_checkout": ShopifyCompleteCheckoutSchema },
67718
67820
  { "shopify.subscribe_webhook": ShopifyWebhookSchema },
67719
67821
  { "clerk.sign_in": ClerkSignInSchema },
67720
- { "clerk.subscribe_webhook": ClerkWebhookSchema }
67822
+ { "clerk.subscribe_webhook": ClerkWebhookSchema },
67823
+ { "stripe.complete_onboarding": StripeCompleteOnboardingSchema },
67824
+ { "stripe.require": StripeRequireSchema },
67825
+ { "stripe.update_bank": StripeUpdateBankSchema },
67826
+ { "stripe.dispute": StripeDisputeSchema },
67827
+ { "stripe.close_dispute": StripeCloseDisputeSchema }
67721
67828
  ];
67722
67829
  var timed = (action) => external_exports.strictObject({ at: actorAt, ...action });
67723
67830
  var conditional = (action) => external_exports.strictObject({ when: WorldPredicateSchema, after: duration6("Nonnegative delay after predicate first qualifies").optional(), once: external_exports.literal(true).optional(), ...action });
@@ -67737,6 +67844,11 @@ var ActorSchema = external_exports.union([
67737
67844
  timed(actorActions[12]),
67738
67845
  timed(actorActions[13]),
67739
67846
  timed(actorActions[14]),
67847
+ timed(actorActions[15]),
67848
+ timed(actorActions[16]),
67849
+ timed(actorActions[17]),
67850
+ timed(actorActions[18]),
67851
+ timed(actorActions[19]),
67740
67852
  conditional(actorActions[0]),
67741
67853
  conditional(actorActions[1]),
67742
67854
  conditional(actorActions[2]),
@@ -67751,7 +67863,12 @@ var ActorSchema = external_exports.union([
67751
67863
  conditional(actorActions[11]),
67752
67864
  conditional(actorActions[12]),
67753
67865
  conditional(actorActions[13]),
67754
- conditional(actorActions[14])
67866
+ conditional(actorActions[14]),
67867
+ conditional(actorActions[15]),
67868
+ conditional(actorActions[16]),
67869
+ conditional(actorActions[17]),
67870
+ conditional(actorActions[18]),
67871
+ conditional(actorActions[19])
67755
67872
  ]);
67756
67873
  var AppCallSchema = external_exports.strictObject({
67757
67874
  at: actorAt,
@@ -68489,7 +68606,7 @@ var TOOL_DESCRIPTORS = [
68489
68606
  descriptor("amazon-s3", "Amazon S3", "Buckets, objects and multipart uploads", ["Buckets", "Objects", "Tags", "Multipart uploads"], "REST (SigV4)", ["Path-style addressing: the SDK chooses it for an IP endpoint; set forcePathStyle for a host name.", "One account and access key; per-bucket read-write, read-only or no access stands in for IAM policies.", "Presigned URLs are verified."]),
68490
68607
  descriptor("linear", "Linear", "Issues, projects and team workflows", ["Issues", "Comments", "Teams", "Workflow states", "Labels", "Projects", "Users"], "GraphQL", ["Linear's published schema.", "Filters cover the common comparators.", "@linear/sdk accepts a plain-http apiUrl only on localhost, 127.0.0.1 or [::1]; elsewhere the endpoint needs TLS."]),
68491
68608
  descriptor("okta", "Okta", "People, groups, app assignments and the System Log", ["Users", "Groups", "Applications", "App assignments", "System Log"], "Management API v1", ["One org and one SSWS API token owned by a super administrator.", "Lifecycle changes are immediate; activation and reset links are returned.", "The System Log records every change made through the API."]),
68492
- descriptor("stripe", "Stripe", "Customers, subscriptions, invoices and payments", ["Customers", "Products", "Prices", "Subscriptions", "Invoices", "Invoice items", "Payment intents", "Charges", "Refunds", "Balance"], "API 2026-10-28.endive", ["Live-account objects and a stored card per seeded customer by default. Set seed.stripe.livemode: false for test tokens (pm_card_visa, pm_card_chargeDeclined\u2026).", "The SDK takes no base path: point host/port/protocol at the env-scoped host ({env}-stripe.localhost) or prefix STRIPE_API_URL in a custom fetch client."]),
68609
+ descriptor("stripe", "Stripe", "Customers, subscriptions, invoices, payments and Connect accounts, onboarding, transfers, application fees and payouts", ["Customers", "Products", "Prices", "Subscriptions", "Invoices", "Invoice items", "Payment intents", "Charges", "Refunds", "Balance", "Connected accounts", "Onboarding", "Transfers", "Application fees", "Payouts"], "API 2026-10-28.endive", ["Live-account objects and a stored card per seeded customer by default. Set seed.stripe.livemode: false for test tokens (pm_card_visa, pm_card_chargeDeclined\u2026).", "The SDK takes no base path: point host/port/protocol at the env-scoped host ({env}-stripe.localhost) or prefix STRIPE_API_URL in a custom fetch client."]),
68493
68610
  descriptor("clerk", "Clerk", "Users, organizations, sign-in and sessions", ["Users", "Organizations", "Memberships", "Invitations", "Sessions"], "Backend and Frontend APIs v1", ["Email-code, password and invitation-ticket sign-in with RS256 session tokens.", "Verification and invitation emails appear in the world inbox.", "Organization claims and Svix-signed webhooks follow the world state."]),
68494
68611
  descriptor("better-stack", "Better Stack", "Uptime monitors, heartbeats, incidents and status pages", ["Monitors", "Heartbeats", "Incidents", "On-call", "Status pages"], "Uptime API v2 / v3", ["A monitor is down while it has an open incident, and heartbeats recover when pinged.", "No official SDK exists; tested against the documented REST shapes."]),
68495
68612
  descriptor("notion", "Notion", "Pages, databases, blocks and comments", ["Pages", "Blocks", "Databases", "Data sources", "Comments", "Users", "Search"], "Notion-Version 2025-09-03", ["An internal integration: it sees only pages shared with it, as Notion does.", "Text, heading, list, to-do, toggle, quote, callout, code, divider and bookmark blocks.", "Databases are served as data sources."]),