gtmmaxing 0.1.9 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/dist/gtm.js +1432 -389
  3. package/package.json +3 -6
package/dist/gtm.js CHANGED
@@ -699,8 +699,8 @@ function cleanRegex(source) {
699
699
  const end = source.endsWith("$") ? source.length - 1 : source.length;
700
700
  return source.slice(start, end);
701
701
  }
702
- function floatSafeRemainder(val, step) {
703
- const ratio = val / step;
702
+ function floatSafeRemainder(val, step2) {
703
+ const ratio = val / step2;
704
704
  const roundedRatio = Math.round(ratio);
705
705
  const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
706
706
  if (Math.abs(ratio - roundedRatio) < tolerance)
@@ -2817,21 +2817,21 @@ var asciiTabOrNewline = /[\t\n\r]/g;
2817
2817
  function stripTabAndNewline(value) {
2818
2818
  return value.replace(asciiTabOrNewline, "");
2819
2819
  }
2820
- function urlHostnameOk(url2, hostname3) {
2820
+ function urlHostnameOk(url3, hostname3) {
2821
2821
  hostname3.lastIndex = 0;
2822
- return hostname3.test(url2.hostname);
2822
+ return hostname3.test(url3.hostname);
2823
2823
  }
2824
- function urlProtocolOk(url2, protocol) {
2824
+ function urlProtocolOk(url3, protocol) {
2825
2825
  protocol.lastIndex = 0;
2826
- return protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol);
2826
+ return protocol.test(url3.protocol.endsWith(":") ? url3.protocol.slice(0, -1) : url3.protocol);
2827
2827
  }
2828
2828
  var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
2829
2829
  $ZodStringFormat.init(inst, def);
2830
2830
  inst._zod.check = (payload) => {
2831
2831
  try {
2832
2832
  const trimmed = payload.value.trim();
2833
- const url2 = parseURLObject(trimmed, def);
2834
- if (url2 === URL_BAD_FORMAT) {
2833
+ const url3 = parseURLObject(trimmed, def);
2834
+ if (url3 === URL_BAD_FORMAT) {
2835
2835
  payload.issues.push({
2836
2836
  code: "invalid_format",
2837
2837
  format: "url",
@@ -2842,7 +2842,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
2842
2842
  });
2843
2843
  return;
2844
2844
  }
2845
- if (url2 === URL_UNPARSEABLE) {
2845
+ if (url3 === URL_UNPARSEABLE) {
2846
2846
  payload.issues.push({
2847
2847
  code: "invalid_format",
2848
2848
  format: "url",
@@ -2852,7 +2852,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
2852
2852
  });
2853
2853
  return;
2854
2854
  }
2855
- if (def.hostname && !urlHostnameOk(url2, def.hostname)) {
2855
+ if (def.hostname && !urlHostnameOk(url3, def.hostname)) {
2856
2856
  payload.issues.push({
2857
2857
  code: "invalid_format",
2858
2858
  format: "url",
@@ -2863,7 +2863,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
2863
2863
  continue: !def.abort
2864
2864
  });
2865
2865
  }
2866
- if (def.protocol && !urlProtocolOk(url2, def.protocol)) {
2866
+ if (def.protocol && !urlProtocolOk(url3, def.protocol)) {
2867
2867
  payload.issues.push({
2868
2868
  code: "invalid_format",
2869
2869
  format: "url",
@@ -2874,7 +2874,7 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
2874
2874
  continue: !def.abort
2875
2875
  });
2876
2876
  }
2877
- payload.value = def.normalize ? url2.href : stripTabAndNewline(trimmed);
2877
+ payload.value = def.normalize ? url3.href : stripTabAndNewline(trimmed);
2878
2878
  return;
2879
2879
  } catch (_) {
2880
2880
  payload.issues.push({
@@ -2922,8 +2922,8 @@ var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def
2922
2922
  $ZodStringFormat.init(inst, def);
2923
2923
  if (def.local || def.precision === -1) {
2924
2924
  inst._zod.bag.laxFormat = true;
2925
- inst._zod.onattach.push((s3) => {
2926
- s3._zod.bag.laxFormat = true;
2925
+ inst._zod.onattach.push((s4) => {
2926
+ s4._zod.bag.laxFormat = true;
2927
2927
  });
2928
2928
  }
2929
2929
  });
@@ -5033,9 +5033,9 @@ var memo = {
5033
5033
  if (!bucket)
5034
5034
  return empty;
5035
5035
  handoff = void 0;
5036
- const entry = { value: empty, issues: null };
5037
- bucket.set(payload.value, entry);
5038
- open.push(entry);
5036
+ const entry2 = { value: empty, issues: null };
5037
+ bucket.set(payload.value, entry2);
5038
+ open.push(entry2);
5039
5039
  return empty;
5040
5040
  },
5041
5041
  guard(inst) {
@@ -5104,16 +5104,16 @@ var memo = {
5104
5104
  const depth = open.length;
5105
5105
  const result = base(payload, ctx);
5106
5106
  handoff = void 0;
5107
- const entry = open.length > depth ? open.pop() : void 0;
5107
+ const entry2 = open.length > depth ? open.pop() : void 0;
5108
5108
  if (result instanceof Promise) {
5109
5109
  return result.then((r) => {
5110
- if (entry)
5111
- entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
5110
+ if (entry2)
5111
+ entry2.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
5112
5112
  return r;
5113
5113
  });
5114
5114
  }
5115
- if (entry)
5116
- entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;
5115
+ if (entry2)
5116
+ entry2.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;
5117
5117
  return result;
5118
5118
  };
5119
5119
  inst._zod.parse = wrapped;
@@ -15219,42 +15219,42 @@ function extractDefs(ctx, schema) {
15219
15219
  if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external)
15220
15220
  return;
15221
15221
  const idToSchema = /* @__PURE__ */ new Map();
15222
- for (const entry of ctx.seen.entries()) {
15223
- const id = ctx.metadataRegistry.get(entry[0])?.id;
15222
+ for (const entry2 of ctx.seen.entries()) {
15223
+ const id = ctx.metadataRegistry.get(entry2[0])?.id;
15224
15224
  if (id) {
15225
15225
  const existing = idToSchema.get(id);
15226
- if (existing && existing !== entry[0]) {
15226
+ if (existing && existing !== entry2[0]) {
15227
15227
  throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
15228
15228
  }
15229
- idToSchema.set(id, entry[0]);
15229
+ idToSchema.set(id, entry2[0]);
15230
15230
  }
15231
15231
  }
15232
- const makeURI = (entry) => {
15232
+ const makeURI = (entry2) => {
15233
15233
  const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
15234
15234
  if (ctx.external) {
15235
- const externalId = ctx.external.registry.get(entry[0])?.id;
15235
+ const externalId = ctx.external.registry.get(entry2[0])?.id;
15236
15236
  const uriGenerator = ctx.external.uri ?? ((id2) => id2);
15237
15237
  if (externalId) {
15238
15238
  return { ref: uriGenerator(externalId) };
15239
15239
  }
15240
- const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
15241
- entry[1].defId = id;
15240
+ const id = entry2[1].defId ?? entry2[1].schema.id ?? `schema${ctx.counter++}`;
15241
+ entry2[1].defId = id;
15242
15242
  return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id)}` };
15243
15243
  }
15244
15244
  const uriPrefix = `#`;
15245
15245
  const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
15246
- if (entry[1] === root && !entry[1].schema.id) {
15246
+ if (entry2[1] === root && !entry2[1].schema.id) {
15247
15247
  return { ref: uriPrefix };
15248
15248
  }
15249
- const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
15249
+ const defId = entry2[1].schema.id ?? `__schema${ctx.counter++}`;
15250
15250
  return { defId, ref: defUriPrefix + encodeJSONPointerSegment(defId) };
15251
15251
  };
15252
- const extractToDef = (entry) => {
15253
- if (entry[1].schema.$ref) {
15252
+ const extractToDef = (entry2) => {
15253
+ if (entry2[1].schema.$ref) {
15254
15254
  return;
15255
15255
  }
15256
- const seen = entry[1];
15257
- const { ref, defId } = makeURI(entry);
15256
+ const seen = entry2[1];
15257
+ const { ref, defId } = makeURI(entry2);
15258
15258
  seen.def = { ...seen.schema };
15259
15259
  if (defId)
15260
15260
  seen.defId = defId;
@@ -15265,8 +15265,8 @@ function extractDefs(ctx, schema) {
15265
15265
  schema2.$ref = ref;
15266
15266
  };
15267
15267
  if (ctx.cycles === "throw") {
15268
- for (const entry of ctx.seen.entries()) {
15269
- const seen = entry[1];
15268
+ for (const entry2 of ctx.seen.entries()) {
15269
+ const seen = entry2[1];
15270
15270
  if (seen.cycle) {
15271
15271
  throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
15272
15272
 
@@ -15274,31 +15274,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15274
15274
  }
15275
15275
  }
15276
15276
  }
15277
- for (const entry of ctx.seen.entries()) {
15278
- const seen = entry[1];
15279
- if (schema === entry[0]) {
15280
- extractToDef(entry);
15277
+ for (const entry2 of ctx.seen.entries()) {
15278
+ const seen = entry2[1];
15279
+ if (schema === entry2[0]) {
15280
+ extractToDef(entry2);
15281
15281
  continue;
15282
15282
  }
15283
15283
  if (ctx.external) {
15284
- const ext = ctx.external.registry.get(entry[0])?.id;
15285
- if (schema !== entry[0] && ext) {
15286
- extractToDef(entry);
15284
+ const ext = ctx.external.registry.get(entry2[0])?.id;
15285
+ if (schema !== entry2[0] && ext) {
15286
+ extractToDef(entry2);
15287
15287
  continue;
15288
15288
  }
15289
15289
  }
15290
- const id = ctx.metadataRegistry.get(entry[0])?.id;
15290
+ const id = ctx.metadataRegistry.get(entry2[0])?.id;
15291
15291
  if (id) {
15292
- extractToDef(entry);
15292
+ extractToDef(entry2);
15293
15293
  continue;
15294
15294
  }
15295
15295
  if (seen.cycle) {
15296
- extractToDef(entry);
15296
+ extractToDef(entry2);
15297
15297
  continue;
15298
15298
  }
15299
15299
  if (seen.count > 1) {
15300
15300
  if (ctx.reused === "ref") {
15301
- extractToDef(entry);
15301
+ extractToDef(entry2);
15302
15302
  continue;
15303
15303
  }
15304
15304
  }
@@ -15481,12 +15481,12 @@ function finalize(ctx, schema) {
15481
15481
  });
15482
15482
  };
15483
15483
  if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
15484
- for (const entry of [...ctx.seen.entries()].reverse()) {
15485
- flattenRef(entry[0]);
15484
+ for (const entry2 of [...ctx.seen.entries()].reverse()) {
15485
+ flattenRef(entry2[0]);
15486
15486
  }
15487
15487
  if (ctx.target !== "openapi-3.0") {
15488
- for (const entry of ctx.seen.entries()) {
15489
- compactTypeUnion(entry[1].def ?? entry[1].schema);
15488
+ for (const entry2 of ctx.seen.entries()) {
15489
+ compactTypeUnion(entry2[1].def ?? entry2[1].schema);
15490
15490
  }
15491
15491
  }
15492
15492
  for (const rewrite of ctx.deferred)
@@ -15533,8 +15533,8 @@ function finalize(ctx, schema) {
15533
15533
  delete result.id;
15534
15534
  const defs = ctx.external?.defs ?? {};
15535
15535
  if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
15536
- for (const entry of ctx.seen.entries()) {
15537
- const seen = entry[1];
15536
+ for (const entry2 of ctx.seen.entries()) {
15537
+ const seen = entry2[1];
15538
15538
  if (seen.def && seen.defId) {
15539
15539
  if (seen.def.id === seen.defId)
15540
15540
  delete seen.def.id;
@@ -16055,9 +16055,9 @@ function stringifyKeyNames(bySchema, json2, visited) {
16055
16055
  var pendingRecords = /* @__PURE__ */ new WeakMap();
16056
16056
  function rewriteKeyNames(ctx) {
16057
16057
  const bySchema = /* @__PURE__ */ new Map();
16058
- for (const entry of ctx.seen.values()) {
16059
- if (entry.def && !bySchema.has(entry.schema))
16060
- bySchema.set(entry.schema, entry);
16058
+ for (const entry2 of ctx.seen.values()) {
16059
+ if (entry2.def && !bySchema.has(entry2.schema))
16060
+ bySchema.set(entry2.schema, entry2);
16061
16061
  }
16062
16062
  const rewrites = /* @__PURE__ */ new Map();
16063
16063
  for (const record2 of pendingRecords.get(ctx) ?? []) {
@@ -16071,8 +16071,8 @@ function rewriteKeyNames(ctx) {
16071
16071
  }
16072
16072
  if (!rewrites.size)
16073
16073
  return;
16074
- for (const entry of ctx.seen.values()) {
16075
- for (const carrier of [entry.schema, entry.def]) {
16074
+ for (const entry2 of ctx.seen.values()) {
16075
+ for (const carrier of [entry2.schema, entry2.def]) {
16076
16076
  const rewritten = carrier && rewrites.get(carrier.propertyNames);
16077
16077
  if (rewritten)
16078
16078
  carrier.propertyNames = rewritten;
@@ -16267,8 +16267,8 @@ function toJSONSchema(input2, params) {
16267
16267
  const registry2 = input2;
16268
16268
  const ctx2 = initializeContext({ ...params, processors: allProcessors });
16269
16269
  const defs = {};
16270
- for (const entry of registry2._idmap.entries()) {
16271
- const [_, schema] = entry;
16270
+ for (const entry2 of registry2._idmap.entries()) {
16271
+ const [_, schema] = entry2;
16272
16272
  process2(schema, ctx2);
16273
16273
  }
16274
16274
  const schemas = {};
@@ -16278,8 +16278,8 @@ function toJSONSchema(input2, params) {
16278
16278
  defs
16279
16279
  };
16280
16280
  ctx2.external = external;
16281
- for (const entry of registry2._idmap.entries()) {
16282
- const [key, schema] = entry;
16281
+ for (const entry2 of registry2._idmap.entries()) {
16282
+ const [key, schema] = entry2;
16283
16283
  extractDefs(ctx2, schema);
16284
16284
  assignProp(schemas, key, finalize(ctx2, schema));
16285
16285
  }
@@ -17392,17 +17392,17 @@ var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
17392
17392
  inst._zod.processJSONSchema = (ctx, json2, params) => arrayProcessor(inst, ctx, json2, params);
17393
17393
  inst.element = def.element;
17394
17394
  }, {
17395
- min(n2, params) {
17396
- return this.check(_minLength(n2, params));
17395
+ min(n3, params) {
17396
+ return this.check(_minLength(n3, params));
17397
17397
  },
17398
17398
  nonempty(params) {
17399
17399
  return this.check(_minLength(1, params));
17400
17400
  },
17401
- max(n2, params) {
17402
- return this.check(_maxLength(n2, params));
17401
+ max(n3, params) {
17402
+ return this.check(_maxLength(n3, params));
17403
17403
  },
17404
- length(n2, params) {
17405
- return this.check(_length(n2, params));
17404
+ length(n3, params) {
17405
+ return this.check(_length(n3, params));
17406
17406
  },
17407
17407
  unwrap() {
17408
17408
  return this.element;
@@ -18570,12 +18570,12 @@ function convertSchema(schema, ctx) {
18570
18570
  let baseSchema = convertBaseSchema(schema, ctx);
18571
18571
  const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
18572
18572
  if (schema.anyOf && Array.isArray(schema.anyOf)) {
18573
- const options = schema.anyOf.map((s3) => convertSchema(s3, ctx));
18573
+ const options = schema.anyOf.map((s4) => convertSchema(s4, ctx));
18574
18574
  const anyOfUnion = z.union(options);
18575
18575
  baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
18576
18576
  }
18577
18577
  if (schema.oneOf && Array.isArray(schema.oneOf)) {
18578
- const options = schema.oneOf.map((s3) => convertSchema(s3, ctx));
18578
+ const options = schema.oneOf.map((s4) => convertSchema(s4, ctx));
18579
18579
  const oneOfUnion = z.xor(options);
18580
18580
  baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
18581
18581
  }
@@ -18660,24 +18660,24 @@ function visit(schema, fnOrHandlers) {
18660
18660
  return h ? h(node2, rewritten) : node2;
18661
18661
  };
18662
18662
  const cache = /* @__PURE__ */ new Map();
18663
- function run(s3) {
18664
- const cached2 = cache.get(s3);
18663
+ function run(s4) {
18664
+ const cached2 = cache.get(s4);
18665
18665
  if (cached2 === RESOLVING) {
18666
18666
  return new $ZodLazy({
18667
18667
  type: "lazy",
18668
- getter: () => cache.get(s3)
18668
+ getter: () => cache.get(s4)
18669
18669
  });
18670
18670
  }
18671
18671
  if (cached2 !== void 0)
18672
18672
  return cached2;
18673
- cache.set(s3, RESOLVING);
18674
- const inner = mapInner(s3);
18675
- const mapped = fn(inner, inner !== s3);
18676
- cache.set(s3, mapped);
18673
+ cache.set(s4, RESOLVING);
18674
+ const inner = mapInner(s4);
18675
+ const mapped = fn(inner, inner !== s4);
18676
+ cache.set(s4, mapped);
18677
18677
  return mapped;
18678
18678
  }
18679
- function mapInner(s3) {
18680
- const def = s3._zod.def;
18679
+ function mapInner(s4) {
18680
+ const def = s4._zod.def;
18681
18681
  const kind = def.type;
18682
18682
  switch (kind) {
18683
18683
  case "object": {
@@ -18697,11 +18697,11 @@ function visit(schema, fnOrHandlers) {
18697
18697
  if (newCatchall !== def.catchall)
18698
18698
  changed = true;
18699
18699
  }
18700
- return changed ? clone(s3, { ...def, shape: newShape, catchall: newCatchall }) : s3;
18700
+ return changed ? clone(s4, { ...def, shape: newShape, catchall: newCatchall }) : s4;
18701
18701
  }
18702
18702
  case "array": {
18703
18703
  const mapped = run(def.element);
18704
- return mapped === def.element ? s3 : clone(s3, { ...def, element: mapped });
18704
+ return mapped === def.element ? s4 : clone(s4, { ...def, element: mapped });
18705
18705
  }
18706
18706
  case "tuple": {
18707
18707
  const oldItems = def.items;
@@ -18719,17 +18719,17 @@ function visit(schema, fnOrHandlers) {
18719
18719
  if (newRest !== def.rest)
18720
18720
  changed = true;
18721
18721
  }
18722
- return changed ? clone(s3, { ...def, items: newItems, rest: newRest }) : s3;
18722
+ return changed ? clone(s4, { ...def, items: newItems, rest: newRest }) : s4;
18723
18723
  }
18724
18724
  case "record":
18725
18725
  case "map": {
18726
18726
  const newKey = run(def.keyType);
18727
18727
  const newVal = run(def.valueType);
18728
- return newKey === def.keyType && newVal === def.valueType ? s3 : clone(s3, { ...def, keyType: newKey, valueType: newVal });
18728
+ return newKey === def.keyType && newVal === def.valueType ? s4 : clone(s4, { ...def, keyType: newKey, valueType: newVal });
18729
18729
  }
18730
18730
  case "set": {
18731
18731
  const newVal = run(def.valueType);
18732
- return newVal === def.valueType ? s3 : clone(s3, { ...def, valueType: newVal });
18732
+ return newVal === def.valueType ? s4 : clone(s4, { ...def, valueType: newVal });
18733
18733
  }
18734
18734
  case "union": {
18735
18735
  const oldOptions = def.options;
@@ -18741,12 +18741,12 @@ function visit(schema, fnOrHandlers) {
18741
18741
  changed = true;
18742
18742
  newOptions.push(mapped);
18743
18743
  }
18744
- return changed ? clone(s3, { ...def, options: newOptions }) : s3;
18744
+ return changed ? clone(s4, { ...def, options: newOptions }) : s4;
18745
18745
  }
18746
18746
  case "intersection": {
18747
18747
  const newLeft = run(def.left);
18748
18748
  const newRight = run(def.right);
18749
- return newLeft === def.left && newRight === def.right ? s3 : clone(s3, { ...def, left: newLeft, right: newRight });
18749
+ return newLeft === def.left && newRight === def.right ? s4 : clone(s4, { ...def, left: newLeft, right: newRight });
18750
18750
  }
18751
18751
  case "optional":
18752
18752
  case "nullable":
@@ -18758,22 +18758,22 @@ function visit(schema, fnOrHandlers) {
18758
18758
  case "promise":
18759
18759
  case "success": {
18760
18760
  const newInner = run(def.innerType);
18761
- return newInner === def.innerType ? s3 : clone(s3, { ...def, innerType: newInner });
18761
+ return newInner === def.innerType ? s4 : clone(s4, { ...def, innerType: newInner });
18762
18762
  }
18763
18763
  case "pipe": {
18764
18764
  const newIn = run(def.in);
18765
18765
  const newOut = run(def.out);
18766
- return newIn === def.in && newOut === def.out ? s3 : clone(s3, { ...def, in: newIn, out: newOut });
18766
+ return newIn === def.in && newOut === def.out ? s4 : clone(s4, { ...def, in: newIn, out: newOut });
18767
18767
  }
18768
18768
  case "function": {
18769
18769
  const newInput = run(def.input);
18770
18770
  const newOutput = run(def.output);
18771
- return newInput === def.input && newOutput === def.output ? s3 : clone(s3, { ...def, input: newInput, output: newOutput });
18771
+ return newInput === def.input && newOutput === def.output ? s4 : clone(s4, { ...def, input: newInput, output: newOutput });
18772
18772
  }
18773
18773
  case "lazy": {
18774
18774
  const original = def.getter;
18775
18775
  const { _cachedInner, ...rest } = def;
18776
- return clone(s3, { ...rest, getter: () => run(original()) });
18776
+ return clone(s4, { ...rest, getter: () => run(original()) });
18777
18777
  }
18778
18778
  // A leaf by choice: `parts` are regex fragments, not data positions.
18779
18779
  case "template_literal":
@@ -18797,10 +18797,10 @@ function visit(schema, fnOrHandlers) {
18797
18797
  case "file":
18798
18798
  case "transform":
18799
18799
  case "custom":
18800
- return s3;
18800
+ return s4;
18801
18801
  default: {
18802
18802
  kind;
18803
- return s3;
18803
+ return s4;
18804
18804
  }
18805
18805
  }
18806
18806
  }
@@ -18810,11 +18810,11 @@ function visit(schema, fnOrHandlers) {
18810
18810
  // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/deep-partial.js
18811
18811
  function deepPartial(schema) {
18812
18812
  return visit(schema, {
18813
- object: (s3) => s3.partial(),
18813
+ object: (s4) => s4.partial(),
18814
18814
  // Every partialed option now admits `undefined`, which the constructor rejects as a duplicate.
18815
- union: (s3) => {
18816
- const def = s3._zod.def;
18817
- return def.discriminator === void 0 ? s3 : union(def.options);
18815
+ union: (s4) => {
18816
+ const def = s4._zod.def;
18817
+ return def.discriminator === void 0 ? s4 : union(def.options);
18818
18818
  }
18819
18819
  });
18820
18820
  }
@@ -18834,18 +18834,18 @@ function inSide(def) {
18834
18834
  }
18835
18835
  function input(schema) {
18836
18836
  return visit(schema, {
18837
- pipe: (s3) => inSide(s3._zod.def),
18837
+ pipe: (s4) => inSide(s4._zod.def),
18838
18838
  // A default value belongs to the output side, so a rewritten inner type leaves it stranded. `.default()` widens the declared input type with `undefined`, and `optional` is what carries that across.
18839
- default: (s3, rewritten) => rewritten ? optional(s3._zod.def.innerType) : s3,
18839
+ default: (s4, rewritten) => rewritten ? optional(s4._zod.def.innerType) : s4,
18840
18840
  // A catch value is output-side too, but `.catch()` leaves the declared input type alone, so the inner schema stands on its own.
18841
- catch: (s3, rewritten) => rewritten ? s3._zod.def.innerType : s3
18841
+ catch: (s4, rewritten) => rewritten ? s4._zod.def.innerType : s4
18842
18842
  });
18843
18843
  }
18844
18844
  function output(schema) {
18845
18845
  return visit(schema, {
18846
- pipe: (s3) => outSide(s3._zod.def),
18846
+ pipe: (s4) => outSide(s4._zod.def),
18847
18847
  // A prefault value is fed through the schema, which makes it input-side, so a rewritten inner type leaves it stranded.
18848
- prefault: (s3, rewritten) => rewritten ? s3._zod.def.innerType : s3
18848
+ prefault: (s4, rewritten) => rewritten ? s4._zod.def.innerType : s4
18849
18849
  });
18850
18850
  }
18851
18851
 
@@ -18874,6 +18874,51 @@ function date4(params) {
18874
18874
  return _coercedDate(ZodDate, params);
18875
18875
  }
18876
18876
 
18877
+ // ../contracts/src/result-quality.ts
18878
+ var qualitySummarySchema = external_exports.object({
18879
+ requested: external_exports.number().int().nonnegative().optional(),
18880
+ returned: external_exports.number().int().nonnegative(),
18881
+ dropped: external_exports.object({
18882
+ duplicate: external_exports.number().int().nonnegative().optional(),
18883
+ already_found: external_exports.number().int().nonnegative().optional(),
18884
+ invalid_result: external_exports.number().int().nonnegative().optional(),
18885
+ identity: external_exports.number().int().nonnegative().optional(),
18886
+ invalid_mailbox: external_exports.number().int().nonnegative().optional(),
18887
+ off_topic: external_exports.number().int().nonnegative().optional(),
18888
+ no_email: external_exports.number().int().nonnegative().optional(),
18889
+ excluded: external_exports.number().int().nonnegative().optional(),
18890
+ stale: external_exports.number().int().nonnegative().optional()
18891
+ }).strict().optional(),
18892
+ verified: external_exports.number().int().nonnegative().optional(),
18893
+ more: external_exports.object({ page: external_exports.number().int().positive() }).strict().optional(),
18894
+ message: external_exports.string().max(200).optional()
18895
+ }).strict();
18896
+ var REASON_LABELS = {
18897
+ duplicate: "duplicate",
18898
+ already_found: "already found",
18899
+ identity: "failed identity check",
18900
+ invalid_mailbox: "invalid mailbox",
18901
+ invalid_result: "unusable result",
18902
+ off_topic: "off topic",
18903
+ no_email: "no email found",
18904
+ excluded: "excluded",
18905
+ stale: "outside the date window"
18906
+ };
18907
+ function qualityFacts(quality) {
18908
+ return [
18909
+ ...Object.entries(quality.dropped ?? {}).map(([reason, count]) => reason === "no_email" ? `${count} ${count === 1 ? "profile" : "profiles"} with no email found` : `${count} ${REASON_LABELS[reason]}`),
18910
+ ...quality.verified !== void 0 ? [`${quality.verified} verified ${quality.verified === 1 ? "email" : "emails"}`] : [],
18911
+ ...quality.more ? [`More available: request page ${quality.more.page}`] : []
18912
+ ];
18913
+ }
18914
+ function qualityText(quality) {
18915
+ return [
18916
+ quality.requested === void 0 ? `${quality.returned} returned` : `${quality.returned} of ${quality.requested} returned`,
18917
+ ...qualityFacts(quality),
18918
+ quality.message
18919
+ ].filter(Boolean).join(". ");
18920
+ }
18921
+
18877
18922
  // ../contracts/src/lookup.ts
18878
18923
  var lookupStatusSchema = external_exports.enum(["found", "not_found", "error"]);
18879
18924
  var foundDeliverabilitySchema = external_exports.enum(["verified"]);
@@ -18913,6 +18958,133 @@ var externalErrorSchema = external_exports.object({
18913
18958
  detail: external_exports.string().optional()
18914
18959
  });
18915
18960
 
18961
+ // ../contracts/src/product-policy.ts
18962
+ var CREDIT_ATOMIC = 1e4;
18963
+ var EMAIL_LOOKUP_CREDITS = 1;
18964
+ var EMAIL_RECHECK_CREDITS = 2;
18965
+ var EMAIL_LOOKUP_ATOMIC = EMAIL_LOOKUP_CREDITS * CREDIT_ATOMIC;
18966
+ var AGENT_MAX_CREDITS = 1e5;
18967
+ var LEAD_MAX_TARGET = 500;
18968
+ var LEAD_MAX_CONTACTS_PER_COMPANY = 5;
18969
+ var AGENT_ANSWER_MAX_BYTES = 1024;
18970
+
18971
+ // ../contracts/src/seo-tool-input.ts
18972
+ var SEO_STEPS = [
18973
+ { id: "keyword-research", label: "Keyword research" },
18974
+ { id: "search-results", label: "Search results" },
18975
+ { id: "competitor-research", label: "Competitors" },
18976
+ { id: "ai-visibility", label: "AI visibility" },
18977
+ { id: "site-audit", label: "Site audit" },
18978
+ { id: "backlinks", label: "Backlinks" }
18979
+ ];
18980
+ var MAX_VOLUME_KEYWORDS = 1e3;
18981
+ var MAX_TREND_KEYWORDS = 5;
18982
+ var MAX_AI_QUESTIONS = 10;
18983
+ var SEO_ENGINES = {
18984
+ chatgpt: "ChatGPT",
18985
+ "google-ai-mode": "Google AI Mode",
18986
+ gemini: "Gemini",
18987
+ perplexity: "Perplexity"
18988
+ };
18989
+ var seoEngine = external_exports.enum(Object.keys(SEO_ENGINES));
18990
+ var seoKeyword = external_exports.string().trim().min(1).max(80);
18991
+ var seoKeywords = external_exports.array(seoKeyword).min(1).max(MAX_VOLUME_KEYWORDS);
18992
+ var seoQuestion = external_exports.string().trim().min(2).max(400);
18993
+ var seoQuestions = external_exports.array(seoQuestion).min(1).max(MAX_AI_QUESTIONS);
18994
+ var domainPattern = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+(?:[a-z]{2,63}|xn--[a-z0-9-]{2,59})$/i;
18995
+ var seoDomain = external_exports.string().trim().max(100).regex(domainPattern, "Enter a domain like example.com.").toLowerCase();
18996
+ var countryNames = new Intl.DisplayNames(["en"], { type: "region", fallback: "none" });
18997
+ var googleCountry = external_exports.string().trim().toLowerCase().regex(/^[a-z]{2}$/, "Enter a two-letter country code.").refine((value) => {
18998
+ if (!/^[a-z]{2}$/.test(value)) return false;
18999
+ const name = countryNames.of(value.toUpperCase());
19000
+ return !!name && name !== "Unknown Region";
19001
+ }, "Enter a country code such as US or GB.");
19002
+ var googleLanguage = external_exports.string().trim().toLowerCase().regex(/^[a-z]{2}$/, "Enter a two-letter language code.");
19003
+ var GOOGLE_LOCALE_FIELDS = [
19004
+ { key: "country", label: "Country code", placeholder: "US", maxLength: 2 },
19005
+ { key: "language", label: "Language code", placeholder: "EN", maxLength: 2 }
19006
+ ];
19007
+
19008
+ // ../contracts/src/seo-pricing.ts
19009
+ var STANDARD = "Standard source";
19010
+ var BACKUP = "Backup source";
19011
+ var labels = external_exports.enum([STANDARD, BACKUP, ...Object.values(SEO_ENGINES)]);
19012
+ var credits = external_exports.number().nonnegative();
19013
+ var creditRangeSchema = external_exports.tuple([credits.int(), credits.int()]);
19014
+ var seoPricingSchema = external_exports.object({
19015
+ range: creditRangeSchema,
19016
+ parts: external_exports.array(external_exports.object({ label: labels, range: external_exports.tuple([credits, credits]) })).max(4),
19017
+ perQuestion: creditRangeSchema.optional()
19018
+ });
19019
+ var creditBreakdownSchema = external_exports.array(external_exports.object({ label: labels, credits })).max(4);
19020
+ var standard = (step2, estimatedAtomic) => ({ label: STANDARD, estimatedAtomic, steps: [step2] });
19021
+ var backup = { label: BACKUP, estimatedAtomic: 0, steps: ["backup"] };
19022
+ var engineParts = {
19023
+ chatgpt: { label: SEO_ENGINES.chatgpt, estimatedAtomic: 2800, steps: ["chatgpt", "chatgptBackup"] },
19024
+ "google-ai-mode": { label: SEO_ENGINES["google-ai-mode"], estimatedAtomic: 4e3, steps: ["google", "googleBackup"] },
19025
+ gemini: { label: SEO_ENGINES.gemini, estimatedAtomic: 2400, steps: ["gemini", "geminiBackup"] },
19026
+ perplexity: { label: SEO_ENGINES.perplexity, estimatedAtomic: 6356, steps: ["perplexity"] }
19027
+ };
19028
+ var routes = {
19029
+ "keyword-ideas": [standard("ideas", 13080), backup],
19030
+ "keyword-volume": [standard("volume", 9e4), backup],
19031
+ "keyword-trends": [standard("trends", 1200), backup],
19032
+ "google-news-search": [standard("news", 150), backup],
19033
+ "google-local-search": [standard("local", 2e3)],
19034
+ "domain-seo-overview": [standard("overview", 1e3), backup],
19035
+ "domain-ranked-keywords": [standard("rankings", 13200), backup],
19036
+ "domain-ads": [{ label: STANDARD, estimatedAtomic: 21e3, steps: ["ads", "keywords"] }, backup],
19037
+ "ai-visibility-check": Object.values(engineParts),
19038
+ "ai-answer": Object.values(engineParts),
19039
+ "page-audit": [standard("audit", 150)],
19040
+ "backlink-summary": [standard("summary", 24036), backup],
19041
+ "backlink-list": [standard("backlinks", 1790), backup]
19042
+ };
19043
+ var markedUpCredits = (atomic) => 3 * atomic / (2 * CREDIT_ATOMIC);
19044
+ var seoChargeCredits = (atomic) => Math.max(1, Math.ceil(markedUpCredits(atomic)));
19045
+ var range = (standardAtomic, maxAtomic) => [seoChargeCredits(standardAtomic), seoChargeCredits(maxAtomic)];
19046
+ function uniqueVolumeKeywords(keywords) {
19047
+ const unique = /* @__PURE__ */ new Map();
19048
+ for (const keyword of keywords) {
19049
+ const key = keyword.toLowerCase();
19050
+ if (!unique.has(key)) unique.set(key, keyword);
19051
+ }
19052
+ return [...unique.values()];
19053
+ }
19054
+ function seoSourceCap(tool2, source, cap, { limit = Infinity, searchTerms } = {}) {
19055
+ if (tool2 === "keyword-volume" && source === "backup" && searchTerms) {
19056
+ const count = uniqueVolumeKeywords(searchTerms).length;
19057
+ return count <= 50 ? count * (cap / 50) : 0;
19058
+ }
19059
+ if (tool2 === "keyword-ideas" && source === "backup") return Math.min(8, limit) * (cap / 8);
19060
+ if (tool2 === "domain-ranked-keywords" && source === "backup") return Math.min(2, limit) * (cap / 2);
19061
+ if (tool2 === "domain-ads" && source === "keywords") return Math.min(5, limit) * (cap / 5);
19062
+ if (tool2 === "backlink-list" && source === "backlinks") return Math.min(10, limit) * (cap / 10);
19063
+ return cap;
19064
+ }
19065
+ function seoCostEnvelope(tool2, suppliers, input2) {
19066
+ const questions = tool2 === "ai-visibility-check" ? input2?.questions?.length ?? MAX_AI_QUESTIONS : 1;
19067
+ const parts = tool2 === "ai-answer" && input2?.engine ? [engineParts[input2.engine]] : routes[tool2];
19068
+ const bounds = parts.map((part) => {
19069
+ const max2 = part.steps.reduce((sum, source) => sum + seoSourceCap(tool2, source, suppliers[source].cap, input2), 0);
19070
+ return { label: part.label, min: Math.min(part.estimatedAtomic, max2), max: max2 };
19071
+ }).filter((part) => part.max > 0);
19072
+ const min = tool2 === "ai-answer" ? Math.min(...bounds.map((part) => part.min)) : bounds.reduce((sum, part) => sum + part.min, 0);
19073
+ const max = tool2 === "ai-answer" ? Math.max(...bounds.map((part) => part.max)) : bounds.reduce((sum, part) => sum + part.max, 0);
19074
+ const minQuestions = input2 ? questions : 1;
19075
+ return {
19076
+ supplierReserve: max * questions,
19077
+ pricing: {
19078
+ range: range(min * minQuestions, max * questions),
19079
+ parts: bounds.map((part) => ({ label: part.label, range: [markedUpCredits(part.min * minQuestions), markedUpCredits(part.max * questions)] })),
19080
+ ...tool2 === "ai-visibility-check" ? { perQuestion: range(min, max) } : {}
19081
+ }
19082
+ };
19083
+ }
19084
+ function fixedSeoPrice(credits3) {
19085
+ return { credits: credits3, pricing: { range: [credits3, credits3], parts: [{ label: STANDARD, range: [credits3, credits3] }] } };
19086
+ }
19087
+
18916
19088
  // ../contracts/src/tool-input.ts
18917
19089
  function publicWebsite(value) {
18918
19090
  try {
@@ -18934,7 +19106,7 @@ var websiteUrl = (value) => /^https:\/\//i.test(value.trim()) ? value.trim() : `
18934
19106
 
18935
19107
  // ../contracts/src/tool-request-fields.ts
18936
19108
  var toolRequestFields = external_exports.object({
18937
- query: external_exports.string().trim().min(2).max(500),
19109
+ query: external_exports.string().trim().min(1).max(500),
18938
19110
  /** Legacy hiring-signals input, kept so saved runs still parse; no longer used. */
18939
19111
  careerBoard: external_exports.string().trim().max(500).optional(),
18940
19112
  /** Hiring signals: optionally watch one company instead of the whole market. */
@@ -18956,7 +19128,12 @@ var toolRequestFields = external_exports.object({
18956
19128
  since: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(),
18957
19129
  /** Results page, from 1. */
18958
19130
  page: external_exports.number().int().min(1).max(100).optional(),
18959
- limit: external_exports.number().int().min(1).max(100).default(10)
19131
+ country: googleCountry.optional(),
19132
+ language: googleLanguage.optional(),
19133
+ engine: seoEngine.optional(),
19134
+ searchTerms: seoKeywords.optional(),
19135
+ questions: seoQuestions.optional(),
19136
+ limit: external_exports.number().int().min(1).max(MAX_VOLUME_KEYWORDS).default(10)
18960
19137
  });
18961
19138
 
18962
19139
  // ../contracts/src/profiles.ts
@@ -18970,8 +19147,8 @@ function linkedinProfileUrl(value) {
18970
19147
  return match ? `https://www.linkedin.com/in/${canonicalProfileSlug(match[1])}` : trimmed;
18971
19148
  }
18972
19149
  function cliProfileUrl(value) {
18973
- const url2 = linkedinProfileUrl(value);
18974
- return /^https:\/\/www\.linkedin\.com\/in\/[A-Za-z0-9_%-]{1,100}$/.test(url2) ? url2 : null;
19150
+ const url3 = linkedinProfileUrl(value);
19151
+ return /^https:\/\/www\.linkedin\.com\/in\/[A-Za-z0-9_%-]{1,100}$/.test(url3) ? url3 : null;
18975
19152
  }
18976
19153
  var isToolProfileUrl = (value) => /^https:\/\/(www\.)?linkedin\.com\/in\/[a-zA-Z0-9%_-]+\/?$/.test(value);
18977
19154
 
@@ -18997,20 +19174,16 @@ var machineJobLifecycle = defineLifecycle({
18997
19174
  });
18998
19175
  var AGENT_RUN_STATUSES = ["running", "completed", "not_found", "error"];
18999
19176
 
19000
- // ../contracts/src/product-policy.ts
19001
- var CREDIT_ATOMIC = 1e4;
19002
- var EMAIL_LOOKUP_CREDITS = 1;
19003
- var EMAIL_RECHECK_CREDITS = 2;
19004
- var EMAIL_LOOKUP_ATOMIC = EMAIL_LOOKUP_CREDITS * CREDIT_ATOMIC;
19005
- var AGENT_MAX_CREDITS = 1e5;
19006
- var LEAD_MAX_TARGET = 500;
19007
- var LEAD_MAX_CONTACTS_PER_COMPANY = 5;
19008
- var AGENT_ANSWER_MAX_BYTES = 1024;
19009
-
19010
19177
  // ../contracts/src/format.ts
19011
19178
  function creditWord(value) {
19012
19179
  return value === 1 ? "credit" : "credits";
19013
19180
  }
19181
+ function formatCredits(value, locale2) {
19182
+ return `${locale2 ? value.toLocaleString(locale2) : value} ${creditWord(value)}`;
19183
+ }
19184
+ function formatCreditRange([min, max]) {
19185
+ return min === max ? formatCredits(max) : `${min} to ${max} credits`;
19186
+ }
19014
19187
 
19015
19188
  // ../contracts/src/result-presentation.ts
19016
19189
  var RESULT_FIELD_LABELS = {
@@ -19137,6 +19310,123 @@ var RESULT_DISPLAY_SPECS = {
19137
19310
  identity: { field: "name", link: "url" }
19138
19311
  }
19139
19312
  };
19313
+ var seo = {
19314
+ keyword: { label: "Keyword" },
19315
+ volume: { label: "Monthly searches", type: "number", role: "metric" },
19316
+ cpc: { label: "CPC", type: "currency", role: "metric", unit: "currency", currency: "USD" },
19317
+ position: { label: "Position" },
19318
+ domain: { label: "Domain" },
19319
+ date: { label: "Date", type: "date" },
19320
+ domainRank: { label: "Domain rank (0-1,000)", type: "number", role: "metric" },
19321
+ domainAuthority: { label: "Domain authority (0-100)", type: "number", role: "metric" },
19322
+ count: (label) => ({ label, type: "count", role: "metric", unit: "count" }),
19323
+ money: (label) => ({ label, type: "currency", role: "metric", unit: "currency", currency: "USD" }),
19324
+ yesNo: (label, no, yes) => ({ label, type: "boolean", booleanLabels: [no, yes] })
19325
+ };
19326
+ var SEO_RESULT_DISPLAY_SPECS = {
19327
+ "keyword-ideas": {
19328
+ view: "table",
19329
+ primary: ["keyword", "volume", "cpc", "difficulty"],
19330
+ overrides: { keyword: seo.keyword, volume: seo.volume, cpc: seo.cpc, difficulty: { label: "Difficulty (0-100)", type: "number", role: "metric" } }
19331
+ },
19332
+ "keyword-volume": {
19333
+ view: "table",
19334
+ primary: ["keyword", "volume", "cpc", "competition", "competitionIndex"],
19335
+ overrides: { keyword: seo.keyword, volume: seo.volume, cpc: seo.cpc, competition: { label: "Ad competition" }, competitionIndex: { label: "Competition index (0-100)", type: "number", role: "metric" } }
19336
+ },
19337
+ "keyword-trends": {
19338
+ view: "table",
19339
+ primary: ["keyword", "date", "interest"],
19340
+ overrides: { keyword: seo.keyword, date: seo.date, interest: { label: "Relative interest (0-100)", type: "number", role: "metric" } }
19341
+ },
19342
+ "google-news-search": {
19343
+ view: "table",
19344
+ primary: ["position", "title", "publisher", "publishedAt"],
19345
+ overrides: { publishedAt: { label: "Published", type: "date" } }
19346
+ },
19347
+ "google-local-search": {
19348
+ view: "table",
19349
+ primary: ["position", "title", "address", "rating", "reviews", "website"],
19350
+ overrides: { reviews: seo.count("Reviews") }
19351
+ },
19352
+ "domain-seo-overview": {
19353
+ view: "card",
19354
+ primary: ["domain", "organicTraffic", "organicKeywords", "organicTrafficValue", "paidTraffic", "paidKeywords", "paidSpend"],
19355
+ overrides: {
19356
+ domain: seo.domain,
19357
+ month: { label: "Month" },
19358
+ organicTraffic: seo.count("Organic traffic per month"),
19359
+ organicKeywords: seo.count("Organic keywords"),
19360
+ organicTrafficValue: seo.money("Organic traffic value"),
19361
+ paidTraffic: seo.count("Paid traffic per month"),
19362
+ paidKeywords: seo.count("Paid keywords"),
19363
+ paidSpend: seo.money("Paid search spend"),
19364
+ paidTrafficValue: seo.money("Paid traffic value")
19365
+ }
19366
+ },
19367
+ "domain-ranked-keywords": {
19368
+ view: "table",
19369
+ primary: ["keyword", "position", "volume", "url"],
19370
+ overrides: { keyword: seo.keyword, position: seo.position, volume: seo.volume, url: { label: "Ranking URL" } }
19371
+ },
19372
+ "domain-ads": {
19373
+ view: "table",
19374
+ primary: ["keyword", "volume", "cpc", "recentAds", "lastSeen"],
19375
+ overrides: { keyword: { label: "Paid keyword" }, volume: seo.volume, cpc: seo.cpc, domain: seo.domain, recentAds: seo.yesNo("Ads in last 30 days", "No", "Yes"), lastSeen: { label: "Ad last seen" } }
19376
+ },
19377
+ "ai-visibility-check": {
19378
+ view: "table",
19379
+ primary: ["question", "engine", "mentioned", "mentionedBrands", "citedDomains"],
19380
+ overrides: {
19381
+ mentioned: seo.yesNo("Brand mentioned", "Not mentioned", "Mentioned"),
19382
+ mentionedBrands: { label: "Other brands named" },
19383
+ mentionedDomains: { label: "Other domains in answer" },
19384
+ citedDomains: { label: "Cited sources" },
19385
+ citations: { label: "Cited URLs" }
19386
+ }
19387
+ },
19388
+ "ai-answer": {
19389
+ view: "document",
19390
+ primary: ["engine", "question", "answer", "citations"],
19391
+ overrides: { citations: { label: "Cited URLs" } }
19392
+ },
19393
+ "page-audit": {
19394
+ view: "card",
19395
+ primary: ["url", "httpStatus", "score", "title", "description", "loadMs", "brokenLinks", "schemaFound", "schemaErrors"],
19396
+ overrides: {
19397
+ httpStatus: { label: "HTTP status" },
19398
+ score: { label: "On-page score (0-100)" },
19399
+ description: { label: "Meta description" },
19400
+ loadMs: { label: "Request duration (ms)", type: "number", role: "metric" },
19401
+ brokenLinks: seo.yesNo("Broken links", "None found", "Found"),
19402
+ schemaFound: seo.yesNo("Structured markup", "Not found", "Found"),
19403
+ schemaErrors: seo.yesNo("Markup errors", "None found", "Found")
19404
+ }
19405
+ },
19406
+ "backlink-summary": {
19407
+ view: "card",
19408
+ primary: ["domain", "backlinks", "referringDomains", "rank", "domainAuthority"],
19409
+ overrides: {
19410
+ domain: seo.domain,
19411
+ backlinks: seo.count("Backlinks"),
19412
+ referringDomains: seo.count("Referring domains"),
19413
+ rank: { label: "Link rank (0-1,000)", type: "number", role: "metric" },
19414
+ domainAuthority: seo.domainAuthority
19415
+ }
19416
+ },
19417
+ "backlink-list": {
19418
+ view: "table",
19419
+ primary: ["domain", "url", "anchor", "targetUrl", "domainRank"],
19420
+ overrides: {
19421
+ domain: { label: "Referring domain" },
19422
+ url: { label: "Referring page" },
19423
+ anchor: { label: "Anchor text" },
19424
+ targetUrl: { label: "Links to", type: "url", role: "source" },
19425
+ domainRank: seo.domainRank,
19426
+ domainAuthority: seo.domainAuthority
19427
+ }
19428
+ }
19429
+ };
19140
19430
  var DATES = /* @__PURE__ */ new Set([
19141
19431
  "posted",
19142
19432
  "postedAt",
@@ -19172,13 +19462,13 @@ var URLS = /* @__PURE__ */ new Set([
19172
19462
  ]);
19173
19463
  function createResultDisplay(spec, fields, findEmails) {
19174
19464
  const columns = Object.fromEntries(
19175
- Object.entries(fields).map(([field, column]) => {
19176
- const type = DATES.has(field) ? "date" : COUNTS.has(field) ? "count" : ["reply", "business", "verified"].includes(field) ? "boolean" : field === "domain" ? "domain" : URLS.has(field) ? "url" : field === "amount" ? "currency" : field === "email" ? "email" : field === "phone" ? "phone" : ["author", "handle", "subreddit"].includes(field) ? "handle" : column.kind === "entity" || field === spec.identity?.field ? "entity" : column.kind === "status" ? "status" : ["position", "rating", "score"].includes(field) ? "number" : "text";
19465
+ Object.entries(fields).map(([field, column2]) => {
19466
+ const type = DATES.has(field) ? "date" : COUNTS.has(field) ? "count" : ["reply", "business", "verified"].includes(field) ? "boolean" : field === "domain" ? "domain" : URLS.has(field) ? "url" : field === "amount" ? "currency" : field === "email" ? "email" : field === "phone" ? "phone" : ["author", "handle", "subreddit"].includes(field) ? "handle" : column2.kind === "entity" || field === spec.identity?.field ? "entity" : column2.kind === "status" ? "status" : ["position", "rating", "score"].includes(field) ? "number" : "text";
19177
19467
  const role = spec.identity?.field === field ? "identity" : ["text", "evidence", "snippet", "reason", "comment"].includes(field) ? "evidence" : ["count", "number", "currency"].includes(type) ? "metric" : ["url", "domain"].includes(type) ? "source" : "detail";
19178
19468
  return [
19179
19469
  field,
19180
19470
  {
19181
- label: column.label,
19471
+ label: column2.label,
19182
19472
  type,
19183
19473
  role,
19184
19474
  visibility: spec.primary.includes(field) ? "primary" : "secondary",
@@ -19683,12 +19973,12 @@ var INDUSTRIES = [
19683
19973
  "Zoos and Botanical Gardens"
19684
19974
  ];
19685
19975
  var INDUSTRY_ALIASES = {
19686
- saas: ["Software Development"],
19687
- "b2b saas": ["Software Development"],
19688
- software: ["Software Development"],
19976
+ saas: ["Software Development", "Technology, Information and Internet"],
19977
+ "b2b saas": ["Software Development", "Technology, Information and Internet"],
19978
+ software: ["Software Development", "Technology, Information and Internet"],
19689
19979
  ai: ["Software Development", "Technology, Information and Internet"],
19690
19980
  fintech: ["Financial Services"],
19691
- devtools: ["Software Development"],
19981
+ devtools: ["Software Development", "Technology, Information and Internet"],
19692
19982
  cybersecurity: ["Computer and Network Security"],
19693
19983
  security: ["Computer and Network Security"],
19694
19984
  it: ["Information Technology & Services"],
@@ -19715,10 +20005,10 @@ function companySizeLabels(value) {
19715
20005
  if (over) return bands(Number(over[1] ?? over[2]), Number.MAX_SAFE_INTEGER);
19716
20006
  const under = /^(?:<|under |less than )\s*(\d+)$/.exec(plain);
19717
20007
  if (under) return bands(1, Number(under[1]) - 1);
19718
- const range2 = SIZE_PLAIN.exec(plain);
19719
- if (!range2) return null;
19720
- const low = Number(range2[1]);
19721
- const high = Number(range2[2]);
20008
+ const range3 = SIZE_PLAIN.exec(plain);
20009
+ if (!range3) return null;
20010
+ const low = Number(range3[1]);
20011
+ const high = Number(range3[2]);
19722
20012
  return low <= high ? bands(low, high) : null;
19723
20013
  }
19724
20014
  function bands(low, high) {
@@ -19728,23 +20018,23 @@ function bands(low, high) {
19728
20018
  function directoryFilters(input2) {
19729
20019
  const industries = [];
19730
20020
  for (const word of input2.industries ?? []) {
19731
- const labels = industryLabels(word);
19732
- if (!labels) {
20021
+ const labels2 = industryLabels(word);
20022
+ if (!labels2) {
19733
20023
  const near = industrySuggestions(word);
19734
20024
  return { ok: false, field: "industries", message: `"${word}" is not a known industry${near.length ? `; try ${near.join(" or ")}` : ""}` };
19735
20025
  }
19736
- industries.push(...labels);
20026
+ industries.push(...labels2);
19737
20027
  }
19738
20028
  const sizes = [];
19739
20029
  for (const word of input2.company_sizes ?? []) {
19740
- const labels = companySizeLabels(word);
19741
- if (!labels) return { ok: false, field: "company_sizes", message: `"${word}" is not a size; use a range like 20-99` };
19742
- sizes.push(...labels);
20030
+ const labels2 = companySizeLabels(word);
20031
+ if (!labels2) return { ok: false, field: "company_sizes", message: `"${word}" is not a size; use a range like 20-99` };
20032
+ sizes.push(...labels2);
19743
20033
  }
19744
20034
  return { ok: true, industries: [...new Set(industries)], sizes: [...new Set(sizes)] };
19745
20035
  }
19746
20036
 
19747
- // ../contracts/src/tool-definitions.ts
20037
+ // ../contracts/src/define-tool.ts
19748
20038
  function toolDefinition(definition) {
19749
20039
  return definition;
19750
20040
  }
@@ -19760,12 +20050,14 @@ function defineTool(identity, build3) {
19760
20050
  title: definition.title ?? identity.name,
19761
20051
  price: {
19762
20052
  credits: identity.credits,
20053
+ ...identity.baseCredits === void 0 ? {} : { baseCredits: identity.baseCredits },
20054
+ ...identity.pricing ? { pricing: identity.pricing } : {},
19763
20055
  unit: identity.unit,
19764
20056
  basis: "run",
19765
20057
  free: definition.free ?? "Empty results are free."
19766
20058
  },
19767
20059
  supplierReserve: Object.values(definition.suppliers).reduce(
19768
- (sum, step) => sum + step.cap * step.maxCalls,
20060
+ (sum, step2) => sum + step2.cap * step2.maxCalls,
19769
20061
  definition.reservationHeadroom
19770
20062
  ),
19771
20063
  services: [
@@ -19778,10 +20070,515 @@ function defineTool(identity, build3) {
19778
20070
  ]
19779
20071
  };
19780
20072
  }
19781
- var text = (max) => external_exports.string().trim().min(1).max(max);
19782
- var optionalText = (max) => external_exports.string().trim().max(max).optional();
20073
+
20074
+ // ../contracts/src/seo-demo-rows.ts
20075
+ var seoDemoRows = {
20076
+ "keyword-ideas": (input2) => [
20077
+ { keyword: `best ${input2.query}`, volume: 1900, cpc: 4.5, difficulty: 27 },
20078
+ { keyword: `${input2.query} tools`, volume: 720, cpc: 2.75, difficulty: 19 }
20079
+ ],
20080
+ "keyword-volume": (input2) => (input2.searchTerms ?? []).map((keyword, index) => ({
20081
+ keyword,
20082
+ volume: 100 + index * 30,
20083
+ cpc: 2.4,
20084
+ competition: "MEDIUM",
20085
+ competitionIndex: 38
20086
+ })),
20087
+ "keyword-trends": (input2) => ["2026-11-20", "2026-11-21"].flatMap((date5, index) => (input2.searchTerms ?? []).map((keyword) => ({
20088
+ keyword,
20089
+ date: date5,
20090
+ interest: 48 + index * 8
20091
+ }))),
20092
+ "google-news-search": () => [
20093
+ { position: 1, title: "A new release for sales teams", url: "https://example.com/news/release", publisher: "Example News", publishedAt: "2026-11-20", snippet: "The release adds reporting features." },
20094
+ { position: 2, title: "CRM adoption grows", url: "https://example.org/news/crm", publisher: "Example Journal", publishedAt: "2026-11-19", snippet: "A look at the CRM market." }
20095
+ ],
20096
+ "google-local-search": () => [
20097
+ { position: 1, title: "Market Street Coffee", url: "https://maps.google.com/?cid=1", address: "Market Street, Boston", rating: 4.8, reviews: 330, website: "https://example.com/" },
20098
+ { position: 2, title: "Park Coffee", url: "https://maps.google.com/?cid=2", address: "Park Street, Boston", rating: 4.5, reviews: 190, website: "https://example.org/" }
20099
+ ],
20100
+ "domain-seo-overview": (input2) => [{
20101
+ domain: input2.query,
20102
+ month: "2026-10",
20103
+ organicTraffic: 88e4,
20104
+ organicKeywords: 842e3,
20105
+ organicTrafficValue: 132e5,
20106
+ paidTraffic: 45e4,
20107
+ paidKeywords: 67e3,
20108
+ paidSpend: 184e4,
20109
+ paidTrafficValue: null
20110
+ }],
20111
+ "domain-ranked-keywords": (input2) => [
20112
+ { keyword: "sales tools", position: 2, volume: 32200, url: `https://${input2.query}/sales` },
20113
+ { keyword: "crm platforms", position: 4, volume: 15500, url: `https://${input2.query}/crm` }
20114
+ ],
20115
+ "domain-ads": (input2) => [
20116
+ { domain: input2.query, recentAds: true, lastSeen: "2026-11-22", keyword: "sales crm", volume: 5400, cpc: 7.1 },
20117
+ { domain: input2.query, recentAds: true, lastSeen: "2026-11-22", keyword: "crm platform", volume: 14500, cpc: 4.1 }
20118
+ ],
20119
+ "ai-visibility-check": (input2) => (input2.questions ?? []).flatMap((question) => Object.values(SEO_ENGINES).map((engine, index) => ({
20120
+ question,
20121
+ engine,
20122
+ mentioned: index % 2 === 0,
20123
+ mentionedBrands: "Example Finder",
20124
+ mentionedDomains: "example.org",
20125
+ citedDomains: index % 2 === 0 ? input2.company ?? "example.com" : "example.org",
20126
+ citations: `https://${index % 2 === 0 ? input2.company ?? "example.com" : "example.org"}/`,
20127
+ status: "Answered"
20128
+ }))),
20129
+ "ai-answer": (input2) => [{
20130
+ question: input2.query,
20131
+ engine: SEO_ENGINES[input2.engine ?? "chatgpt"],
20132
+ answer: "Compare the quality of coverage, how the tool verifies its results, and the cost per successful lookup.",
20133
+ citations: "https://example.org/guides/email-finders"
20134
+ }],
20135
+ "page-audit": (input2) => [{
20136
+ url: input2.query,
20137
+ httpStatus: 200,
20138
+ score: 94,
20139
+ title: "Example page",
20140
+ description: "An example of a page audit.",
20141
+ headings: "H1 Example page\nH2 How it works",
20142
+ loadMs: 80,
20143
+ brokenLinks: false,
20144
+ schemaFound: true,
20145
+ schemaErrors: false
20146
+ }],
20147
+ "backlink-summary": (input2) => [{ domain: input2.query, backlinks: 62e4, referringDomains: 1900, rank: 640, domainAuthority: null }],
20148
+ "backlink-list": (input2) => [
20149
+ { url: "https://example.com/sales", domain: "example.com", targetUrl: `https://${input2.query}/sales`, anchor: "Sales tools", domainRank: 480, domainAuthority: null },
20150
+ { url: "https://example.org/crm", domain: "example.org", targetUrl: `https://${input2.query}/crm`, anchor: "CRM tools", domainRank: 380, domainAuthority: null }
20151
+ ]
20152
+ };
20153
+ var SEO_DEMO_ROWS = seoDemoRows;
20154
+
20155
+ // ../contracts/src/seo-tool-definitions.ts
19783
20156
  var s = external_exports.string();
19784
20157
  var n = external_exports.number().nullable();
20158
+ var brand = external_exports.string().trim().min(2).max(100);
20159
+ var query = external_exports.string().trim().min(2).max(500);
20160
+ var url2 = external_exports.string().trim().min(2).max(500);
20161
+ var domainInput = external_exports.object({ domain: seoDomain }).strict();
20162
+ var locale = { country: googleCountry.optional(), language: googleLanguage.optional() };
20163
+ var DATAFORSEO_BADGE = { name: "DataForSEO", logo: "dataforseo.png" };
20164
+ var supplierBadges = [
20165
+ { prefix: "dataforseo.", badge: DATAFORSEO_BADGE },
20166
+ { prefix: "spyfu.", badge: { name: "SpyFu", logo: "spyfu.png" } }
20167
+ ];
20168
+ function step(endpoint, cap, options = {}) {
20169
+ return {
20170
+ key: endpoint,
20171
+ endpoint,
20172
+ provider: endpoint.split(".")[0],
20173
+ via: "Treg",
20174
+ role: "SEO data",
20175
+ cap,
20176
+ maxCalls: options.maxCalls ?? 1,
20177
+ method: options.method ?? "POST",
20178
+ ...options.singleTask ? { body: "single-task" } : {},
20179
+ ...options.exclude ? { routeHeaders: { "X-Treg-Route-Exclude": options.exclude } } : {}
20180
+ };
20181
+ }
20182
+ function task(endpoint, cap) {
20183
+ return step(endpoint, cap, { singleTask: true });
20184
+ }
20185
+ var answerSources = {
20186
+ chatgpt: step("treg.ai-search.chatgpt.scrape", 2800, { exclude: "dataforseo" }),
20187
+ chatgptBackup: task("dataforseo.x.ai-optimization-chat-gpt-llm-scraper-live-advanced", 4e3),
20188
+ google: task("dataforseo.x.serp-google-ai-mode-live-advanced", 4e3),
20189
+ googleBackup: step("cloro.google.serp.ai_mode", 2400),
20190
+ gemini: step("treg.ai-search.gemini.scrape", 2400, { exclude: "dataforseo" }),
20191
+ geminiBackup: task("dataforseo.x.ai-optimization-gemini-llm-scraper-live-advanced", 4e3),
20192
+ perplexity: task("dataforseo.x.ai-optimization-perplexity-llm-responses-live", 8e3)
20193
+ };
20194
+ var sampleText = (value, label) => typeof value === "boolean" ? `${label}: ${value ? "Yes" : "No"}` : typeof value === "number" ? `${label}: ${value.toLocaleString("en-US")}` : String(value ?? "");
20195
+ var column = (label, kind = "text") => ({ label, kind });
20196
+ var domainColumn = column("Domain", "mono");
20197
+ var keywordColumn = column("Keyword", "mono");
20198
+ var urlColumn = column("URL");
20199
+ var keywordMetrics = { keyword: s, volume: n, cpc: n };
20200
+ var keywordColumns = { keyword: keywordColumn, volume: column("Monthly searches"), cpc: column("CPC (USD)") };
20201
+ var serpColumns = { position: column("Position"), title: column("Title", "entity"), url: urlColumn };
20202
+ var domainActions = [
20203
+ { entity: "company", target: "domain-ranked-keywords" },
20204
+ { entity: "company", target: "domain-ads" },
20205
+ { entity: "company", target: "backlink-summary" }
20206
+ ];
20207
+ var answerRow = { question: s, engine: s, citations: s };
20208
+ var answerColumns = { question: column("Question"), engine: column("Engine"), citations: column("Cited URLs", "mono") };
20209
+ var defaultForm = {
20210
+ inputMode: "text",
20211
+ mono: false,
20212
+ normalize: "trim",
20213
+ validation: "text",
20214
+ fields: [],
20215
+ grid: false,
20216
+ gate: "tools",
20217
+ example: "catalog",
20218
+ exampleLabel: "Try an example",
20219
+ exampleValues: {},
20220
+ exampleMono: false,
20221
+ progress: ""
20222
+ };
20223
+ function seoTool(spec) {
20224
+ const { id, seoStep, order, name, unit, limit, description, label, demo, action, request, form: form2, view, columns: fields, ...definition } = spec;
20225
+ const columns = { ...fields };
20226
+ const rows = SEO_DEMO_ROWS[id](request(spec.input.parse(spec.example)));
20227
+ const slots = ["main", "sub", "end"];
20228
+ for (const [index, field] of spec.preview.slice(0, slots.length).entries()) {
20229
+ if (!rows[0]) continue;
20230
+ columns[field] = {
20231
+ ...fields[field],
20232
+ demo: slots[index],
20233
+ // A one-row result shows one example row, never the same row twice.
20234
+ sample: [sampleText(rows[0][field], fields[field].label), rows[1] ? sampleText(rows[1][field], fields[field].label) : ""]
20235
+ };
20236
+ }
20237
+ const { pricing, supplierReserve } = seoCostEnvelope(id, spec.suppliers);
20238
+ const suppliers = Object.values(spec.suppliers);
20239
+ const badges = supplierBadges.filter(({ prefix }) => suppliers.some(({ endpoint }) => endpoint.startsWith(prefix))).map(({ badge }) => badge);
20240
+ const tool2 = defineTool({ name, credits: pricing.range[1], unit, limit, pricing }, () => toolDefinition({
20241
+ ...definition,
20242
+ description,
20243
+ toolRequest: (input2) => ({ tool: id, ...request(input2) }),
20244
+ display: { view: view ?? "table", primary: spec.preview },
20245
+ columns,
20246
+ output: Object.keys(columns),
20247
+ web: { route: id, section: "SEO", group: "social-lead-generation", description, step: seoStep, order },
20248
+ presentation: { description, label, example: demo, action, step: action.split(" ")[0], icon: "search", demo },
20249
+ form: { ...defaultForm, ...form2 },
20250
+ reservationHeadroom: 0,
20251
+ badges
20252
+ }));
20253
+ return { ...tool2, supplierReserve };
20254
+ }
20255
+ var keywordListForm = { keywordList: true };
20256
+ var domainForm = { validation: "domain", mono: true };
20257
+ var localeForm = { fields: GOOGLE_LOCALE_FIELDS, grid: true };
20258
+ var domainRequest = ({ domain: domain2 }) => ({ query: domain2 });
20259
+ var listRequest = ({ keywords }) => ({ query: keywords[0], searchTerms: keywords });
20260
+ var engineField = {
20261
+ key: "engine",
20262
+ label: "Engine",
20263
+ placeholder: "Choose an engine",
20264
+ maxLength: 20,
20265
+ required: true,
20266
+ requiredMessage: "Choose an engine.",
20267
+ options: [{ value: "", label: "Choose an engine" }, ...Object.entries(SEO_ENGINES).map(([value, label]) => ({ value, label }))]
20268
+ };
20269
+ var SEO_TOOL_DEFINITIONS = {
20270
+ "keyword-ideas": seoTool({
20271
+ id: "keyword-ideas",
20272
+ seoStep: "keyword-research",
20273
+ order: 0,
20274
+ name: "Keyword ideas",
20275
+ unit: "search",
20276
+ limit: 20,
20277
+ description: "Find related keywords with estimated monthly searches, cost per click and ranking difficulty where available.",
20278
+ label: "Seed keyword",
20279
+ demo: "email finder",
20280
+ action: "Find ideas",
20281
+ noun: "keywords",
20282
+ input: external_exports.object({ keyword: seoKeyword, limit: external_exports.number().int().min(1).max(20).optional() }).strict(),
20283
+ example: { keyword: "email finder" },
20284
+ request: ({ keyword, limit }) => ({ query: keyword, limit: limit ?? 20 }),
20285
+ row: external_exports.object({ ...keywordMetrics, difficulty: n }),
20286
+ columns: { ...keywordColumns, difficulty: column("Difficulty") },
20287
+ preview: ["keyword", "volume", "cpc", "difficulty"],
20288
+ suppliers: { ideas: task("dataforseo.google.keywords.ideas", 14400), backup: step("seranking.google.keywords.ideas", 14320, { method: "GET" }) },
20289
+ carries: { keyword: "keyword" },
20290
+ actions: [{ entity: "keyword", target: "google-search" }]
20291
+ }),
20292
+ "keyword-volume": seoTool({
20293
+ id: "keyword-volume",
20294
+ seoStep: "keyword-research",
20295
+ order: 1,
20296
+ name: "Keyword volume",
20297
+ unit: "batch",
20298
+ limit: MAX_VOLUME_KEYWORDS,
20299
+ description: "Get estimated monthly searches, cost per click and ad competition for up to 1,000 keywords.",
20300
+ label: "Keywords, one per line",
20301
+ demo: "email finder",
20302
+ action: "Check volume",
20303
+ noun: "keywords",
20304
+ input: external_exports.object({ keywords: seoKeywords }).strict(),
20305
+ example: { keywords: ["email finder", "work email finder"] },
20306
+ request: (input2) => ({ ...listRequest(input2), limit: MAX_VOLUME_KEYWORDS }),
20307
+ form: keywordListForm,
20308
+ row: external_exports.object({ ...keywordMetrics, competition: s, competitionIndex: n }),
20309
+ columns: { ...keywordColumns, competition: column("Competition"), competitionIndex: column("Competition index") },
20310
+ preview: ["keyword", "volume", "cpc", "competition"],
20311
+ suppliers: { volume: task("dataforseo.google.keywords.volume", 9e4), backup: step("treg.google.keywords.volume", 89500) },
20312
+ carries: { keyword: "keyword" },
20313
+ actions: [{ entity: "keyword", target: "google-search" }]
20314
+ }),
20315
+ "keyword-trends": seoTool({
20316
+ id: "keyword-trends",
20317
+ seoStep: "keyword-research",
20318
+ order: 2,
20319
+ name: "Keyword trends",
20320
+ unit: "comparison",
20321
+ limit: 500,
20322
+ description: "Compare relative search interest over the past 90 days for up to five keywords.",
20323
+ label: "Keywords, one per line",
20324
+ demo: "email finder",
20325
+ action: "Compare trends",
20326
+ noun: "observations",
20327
+ input: external_exports.object({ keywords: external_exports.array(seoKeyword.refine((term) => !term.includes(","), "Use one keyword per entry without commas.")).min(1).max(MAX_TREND_KEYWORDS) }).strict(),
20328
+ example: { keywords: ["email finder", "work email finder"] },
20329
+ request: (input2) => ({ ...listRequest(input2), limit: 500 }),
20330
+ form: keywordListForm,
20331
+ row: external_exports.object({ keyword: s, date: s, interest: n }),
20332
+ columns: { keyword: keywordColumn, date: column("Date", "date"), interest: column("Relative interest") },
20333
+ preview: ["keyword", "date", "interest"],
20334
+ suppliers: { trends: task("dataforseo.x.keywords-data-dataforseo-trends-explore-live", 1200), backup: step("serpapi.x.google-trends", 15e3, { method: "GET" }) },
20335
+ carries: { keyword: "keyword" },
20336
+ actions: [{ entity: "keyword", target: "google-search" }]
20337
+ }),
20338
+ "google-news-search": seoTool({
20339
+ id: "google-news-search",
20340
+ seoStep: "search-results",
20341
+ order: 11,
20342
+ name: "Google News search",
20343
+ unit: "search",
20344
+ limit: 10,
20345
+ description: "See which articles appear in Google News search, with headlines, links and publication dates when available.",
20346
+ label: "Search query",
20347
+ demo: "HubSpot",
20348
+ action: "Search news",
20349
+ noun: "articles",
20350
+ input: external_exports.object({ query, ...locale }).strict(),
20351
+ example: { query: "HubSpot" },
20352
+ request: (input2) => input2,
20353
+ form: localeForm,
20354
+ row: external_exports.object({ position: n, title: s, url: s, publisher: s, publishedAt: s, snippet: s }),
20355
+ columns: { ...serpColumns, publisher: column("Publisher"), publishedAt: column("Published", "date"), snippet: column("Snippet") },
20356
+ preview: ["position", "title", "publisher", "publishedAt"],
20357
+ suppliers: { news: step("treg.google.serp.news", 1e3, { exclude: "dataforseo" }), backup: task("dataforseo.x.serp-google-news-live-advanced", 2e3) },
20358
+ carries: { website: "url" },
20359
+ actions: [{ entity: "website", target: "page-audit" }]
20360
+ }),
20361
+ "google-local-search": seoTool({
20362
+ id: "google-local-search",
20363
+ seoStep: "search-results",
20364
+ order: 12,
20365
+ name: "Google local search",
20366
+ unit: "search",
20367
+ limit: 10,
20368
+ description: "See which businesses appear in Google's local results, with ratings, addresses and links where available.",
20369
+ label: "Search query with a city",
20370
+ demo: "coffee shops in Boston",
20371
+ action: "Search local results",
20372
+ noun: "businesses",
20373
+ input: external_exports.object({ query, ...locale }).strict(),
20374
+ example: { query: "coffee shops in Boston" },
20375
+ request: (input2) => input2,
20376
+ form: localeForm,
20377
+ row: external_exports.object({ position: n, title: s, url: s, address: s, rating: n, reviews: n, website: s }),
20378
+ columns: { ...serpColumns, address: column("Address"), rating: column("Rating"), reviews: column("Reviews"), website: column("Website") },
20379
+ preview: ["position", "title", "address", "rating"],
20380
+ suppliers: { local: task("dataforseo.x.serp-google-local-finder-live-advanced", 2e3) },
20381
+ carries: { website: "website" },
20382
+ actions: [{ entity: "website", target: "page-audit" }]
20383
+ }),
20384
+ "domain-seo-overview": seoTool({
20385
+ id: "domain-seo-overview",
20386
+ seoStep: "competitor-research",
20387
+ order: 20,
20388
+ name: "Domain SEO overview",
20389
+ unit: "domain",
20390
+ limit: 1,
20391
+ description: "See a domain's estimated organic traffic, ranked keyword count, traffic value and paid search activity.",
20392
+ label: "Domain",
20393
+ demo: "hubspot.com",
20394
+ action: "Check domain",
20395
+ noun: "domains",
20396
+ input: domainInput,
20397
+ example: { domain: "hubspot.com" },
20398
+ request: domainRequest,
20399
+ form: domainForm,
20400
+ row: external_exports.object({ domain: s, month: s, organicTraffic: n, organicKeywords: n, organicTrafficValue: n, paidTraffic: n, paidKeywords: n, paidSpend: n, paidTrafficValue: n }),
20401
+ columns: { domain: domainColumn, month: column("Month"), organicTraffic: column("Organic traffic"), organicKeywords: column("Organic keywords"), organicTrafficValue: column("Organic value (USD)"), paidTraffic: column("Paid traffic"), paidKeywords: column("Paid keywords"), paidSpend: column("Paid spend (USD)"), paidTrafficValue: column("Paid traffic value (USD)") },
20402
+ preview: ["domain", "organicTraffic", "organicKeywords", "organicTrafficValue"],
20403
+ view: "card",
20404
+ suppliers: { overview: step("spyfu.google.domain.overview", 1e3, { method: "GET" }), backup: task("dataforseo.x.dataforseo-labs-google-domain-rank-overview-live", 12120) },
20405
+ accepts: { company: "domain" },
20406
+ carries: { company: "domain" },
20407
+ actions: domainActions
20408
+ }),
20409
+ "domain-ranked-keywords": seoTool({
20410
+ id: "domain-ranked-keywords",
20411
+ seoStep: "competitor-research",
20412
+ order: 21,
20413
+ name: "Domain ranked keywords",
20414
+ unit: "domain",
20415
+ limit: 10,
20416
+ description: "Find organic keywords a domain ranks for, with position, monthly search volume and the ranking URL.",
20417
+ label: "Domain",
20418
+ demo: "hubspot.com",
20419
+ action: "Find rankings",
20420
+ noun: "keywords",
20421
+ input: domainInput,
20422
+ example: { domain: "hubspot.com" },
20423
+ request: (input2) => ({ ...domainRequest(input2), limit: 10 }),
20424
+ form: domainForm,
20425
+ row: external_exports.object({ keyword: s, position: n, volume: n, url: s }),
20426
+ columns: { keyword: keywordColumn, position: column("Position"), volume: column("Monthly searches"), url: urlColumn },
20427
+ preview: ["keyword", "position", "volume", "url"],
20428
+ suppliers: { rankings: task("dataforseo.google.domain.ranked_keywords", 13200), backup: step("spyfu.google.domain.ranked_keywords", 1e4, { method: "GET" }) },
20429
+ accepts: { company: "domain" },
20430
+ carries: { website: "url", keyword: "keyword" },
20431
+ actions: [{ entity: "website", target: "page-audit" }, { entity: "keyword", target: "google-search" }]
20432
+ }),
20433
+ "domain-ads": seoTool({
20434
+ id: "domain-ads",
20435
+ seoStep: "competitor-research",
20436
+ order: 22,
20437
+ name: "Domain ads",
20438
+ unit: "domain",
20439
+ limit: 5,
20440
+ description: "Check whether Google ads were observed for a domain in the past 30 days and find its estimated paid keywords.",
20441
+ label: "Domain",
20442
+ demo: "hubspot.com",
20443
+ action: "Check ads",
20444
+ noun: "paid keywords",
20445
+ input: domainInput,
20446
+ example: { domain: "hubspot.com" },
20447
+ request: (input2) => ({ ...domainRequest(input2), limit: 5 }),
20448
+ form: domainForm,
20449
+ row: external_exports.object({ domain: s, recentAds: external_exports.boolean().nullable(), lastSeen: s, ...keywordMetrics }),
20450
+ columns: { domain: domainColumn, recentAds: column("Ads seen in 30 days"), lastSeen: column("Last seen", "date"), ...keywordColumns },
20451
+ preview: ["domain", "recentAds", "lastSeen", "keyword"],
20452
+ suppliers: { ads: step("adyntel.google.ads.transparency", 11e3), backup: step("serpapi.google.ads.transparency", 15e3, { method: "GET" }), keywords: step("spyfu.google.domain.paid_keywords", 1e4, { method: "GET" }) },
20453
+ accepts: { company: "domain" },
20454
+ carries: { company: "domain", keyword: "keyword" },
20455
+ actions: [{ entity: "keyword", target: "google-search" }, { entity: "company", target: "domain-seo-overview" }]
20456
+ }),
20457
+ "ai-visibility-check": seoTool({
20458
+ id: "ai-visibility-check",
20459
+ seoStep: "ai-visibility",
20460
+ order: 30,
20461
+ name: "AI visibility check",
20462
+ unit: "check",
20463
+ limit: 40,
20464
+ description: "Check whether four AI search engines mention a brand or cite its website across up to ten buyer questions.",
20465
+ label: "Brand name",
20466
+ demo: "GTMMAXING",
20467
+ action: "Check visibility",
20468
+ noun: "answers",
20469
+ input: external_exports.object({ brand, domain: seoDomain, questions: seoQuestions }).strict(),
20470
+ example: { brand: "GTMMAXING", domain: "gtmmaxing.com", questions: ["What are the best email finder tools for B2B sales?"] },
20471
+ request: (input2) => ({ query: input2.brand, company: input2.domain, questions: input2.questions, limit: 40 }),
20472
+ form: { fields: [
20473
+ { key: "company", label: "Brand domain", placeholder: "gtmmaxing.com", maxLength: 100, required: true, requiredMessage: "Enter a brand domain." },
20474
+ { key: "questions", label: "Buyer questions, one per line", placeholder: "What are the best email finder tools for B2B sales?", maxLength: MAX_AI_QUESTIONS * 401, required: true, requiredMessage: "Enter one to ten buyer questions.", multiline: true }
20475
+ ], exampleValues: { company: "gtmmaxing.com", questions: "What are the best email finder tools for B2B sales?" } },
20476
+ row: external_exports.object({ ...answerRow, mentioned: external_exports.boolean().nullable(), mentionedBrands: s, mentionedDomains: s, citedDomains: s, status: s }),
20477
+ columns: { ...answerColumns, mentioned: column("Brand mentioned"), mentionedBrands: column("Other brand names"), mentionedDomains: column("Other domains in answer"), citedDomains: column("Cited domains"), status: column("Status", "status") },
20478
+ preview: ["question", "engine", "mentioned", "status"],
20479
+ suppliers: Object.fromEntries(Object.entries(answerSources).map(([key, value]) => [key, { ...value, maxCalls: MAX_AI_QUESTIONS }]))
20480
+ }),
20481
+ "ai-answer": seoTool({
20482
+ id: "ai-answer",
20483
+ seoStep: "ai-visibility",
20484
+ order: 31,
20485
+ name: "AI answer",
20486
+ unit: "answer",
20487
+ limit: 1,
20488
+ description: "Read a full answer and its cited URLs from ChatGPT, Google AI Mode, Gemini or Perplexity.",
20489
+ label: "Question",
20490
+ demo: "What are the best email finder tools for B2B sales?",
20491
+ action: "Get answer",
20492
+ noun: "answers",
20493
+ input: external_exports.object({ question: seoQuestion, engine: seoEngine }).strict(),
20494
+ example: { question: "What are the best email finder tools for B2B sales?", engine: "chatgpt" },
20495
+ request: ({ question, engine }) => ({ query: question, engine }),
20496
+ form: { fields: [engineField], exampleValues: { engine: "chatgpt" } },
20497
+ row: external_exports.object({ ...answerRow, answer: s }),
20498
+ columns: { ...answerColumns, answer: column("Answer") },
20499
+ preview: ["engine", "question", "answer", "citations"],
20500
+ view: "document",
20501
+ suppliers: answerSources
20502
+ }),
20503
+ "page-audit": seoTool({
20504
+ id: "page-audit",
20505
+ seoStep: "site-audit",
20506
+ order: 41,
20507
+ name: "Page audit",
20508
+ unit: "page",
20509
+ limit: 1,
20510
+ description: "Check one page's title, meta description, headings, request timing, broken link signal and structured markup.",
20511
+ label: "Page URL",
20512
+ demo: "https://gtmmaxing.com/",
20513
+ action: "Audit page",
20514
+ noun: "pages",
20515
+ input: external_exports.object({ url: url2 }).strict(),
20516
+ example: { url: "https://gtmmaxing.com/" },
20517
+ request: ({ url: url3 }) => ({ query: url3 }),
20518
+ form: { validation: "website", inputMode: "url", mono: true },
20519
+ row: external_exports.object({ url: s, httpStatus: n, score: n, title: s, description: s, headings: s, loadMs: n, brokenLinks: external_exports.boolean().nullable(), schemaFound: external_exports.boolean().nullable(), schemaErrors: external_exports.boolean().nullable() }),
20520
+ columns: { url: urlColumn, httpStatus: column("HTTP status"), score: column("On-page score"), title: column("Title"), description: column("Meta description"), headings: column("Headings"), loadMs: column("Request duration (ms)"), brokenLinks: column("Broken link signal"), schemaFound: column("Structured markup"), schemaErrors: column("Markup errors") },
20521
+ preview: ["url", "httpStatus", "score", "title"],
20522
+ view: "card",
20523
+ suppliers: { audit: task("dataforseo.web.page.audit", 150) },
20524
+ accepts: { website: "url" }
20525
+ }),
20526
+ "backlink-summary": seoTool({
20527
+ id: "backlink-summary",
20528
+ seoStep: "backlinks",
20529
+ order: 50,
20530
+ name: "Backlink summary",
20531
+ unit: "domain",
20532
+ limit: 1,
20533
+ description: "Get estimated total backlinks, referring domains and available authority metrics for a domain.",
20534
+ label: "Domain",
20535
+ demo: "hubspot.com",
20536
+ action: "Check backlinks",
20537
+ noun: "domains",
20538
+ input: domainInput,
20539
+ example: { domain: "hubspot.com" },
20540
+ request: domainRequest,
20541
+ form: domainForm,
20542
+ row: external_exports.object({ domain: s, backlinks: n, referringDomains: n, rank: n, domainAuthority: n }),
20543
+ columns: { domain: domainColumn, backlinks: column("Backlinks"), referringDomains: column("Referring domains"), rank: column("Link rank (0\u20131,000)"), domainAuthority: column("Domain authority (0\u2013100)") },
20544
+ preview: ["domain", "backlinks", "referringDomains", "rank"],
20545
+ view: "card",
20546
+ suppliers: { summary: task("dataforseo.web.backlinks.summary", 24036), backup: step("treg.web.backlinks.summary", 15e3, { exclude: "dataforseo" }) },
20547
+ accepts: { company: "domain" },
20548
+ carries: { company: "domain" },
20549
+ actions: [{ entity: "company", target: "backlink-list" }]
20550
+ }),
20551
+ "backlink-list": seoTool({
20552
+ id: "backlink-list",
20553
+ seoStep: "backlinks",
20554
+ order: 51,
20555
+ name: "Backlink list",
20556
+ unit: "domain",
20557
+ limit: 10,
20558
+ description: "See referring pages and domains with their anchor text, destination URL and available authority metrics.",
20559
+ label: "Domain",
20560
+ demo: "hubspot.com",
20561
+ action: "Find backlinks",
20562
+ noun: "backlinks",
20563
+ input: domainInput,
20564
+ example: { domain: "hubspot.com" },
20565
+ request: (input2) => ({ ...domainRequest(input2), limit: 10 }),
20566
+ form: domainForm,
20567
+ row: external_exports.object({ url: s, domain: s, targetUrl: s, anchor: s, domainRank: n, domainAuthority: n }),
20568
+ columns: { url: column("Referring URL"), domain: column("Referring domain", "mono"), targetUrl: column("Destination URL"), anchor: column("Anchor text"), domainRank: column("Domain rank (0\u20131,000)"), domainAuthority: column("Domain authority (0\u2013100)") },
20569
+ preview: ["domain", "url", "anchor", "domainRank"],
20570
+ suppliers: { backlinks: step("seranking.web.backlinks.list", 1790, { method: "GET" }), backup: task("dataforseo.web.backlinks.list", 24360) },
20571
+ accepts: { company: "domain" },
20572
+ carries: { website: "url" },
20573
+ actions: [{ entity: "website", target: "page-audit" }]
20574
+ })
20575
+ };
20576
+
20577
+ // ../contracts/src/tool-definitions.ts
20578
+ var text = (max) => external_exports.string().trim().min(1).max(max);
20579
+ var optionalText = (max) => external_exports.string().trim().max(max).optional();
20580
+ var s2 = external_exports.string();
20581
+ var n2 = external_exports.number().nullable();
19785
20582
  var companyFilters = {
19786
20583
  industries: external_exports.array(text(100)).min(1).max(10).optional().describe("Like SaaS"),
19787
20584
  company_sizes: external_exports.array(text(20)).min(1).max(9).optional().describe("Like 20-99")
@@ -19805,12 +20602,14 @@ function directoryRequest(input2, request) {
19805
20602
  var MAX_BATCH_PEOPLE = 100;
19806
20603
  var batchPeople = external_exports.array(text(300)).min(1).max(MAX_BATCH_PEOPLE).optional().describe(`Up to ${MAX_BATCH_PEOPLE} LinkedIn profile URLs or handles, instead of profile`);
19807
20604
  var TOOL_DEFINITIONS = {
20605
+ ...SEO_TOOL_DEFINITIONS,
19808
20606
  "seo-aeo-audit": defineTool(
19809
- { name: "SEO/AEO audit", credits: 35, unit: "completed audit", limit: 1 },
20607
+ { name: "SEO/AEO audit", ...fixedSeoPrice(39), unit: "completed audit", limit: 1 },
19810
20608
  () => toolDefinition({
19811
- description: "RankAI website audit for search engine and answer engine optimization, with a report URL when complete.",
20609
+ description: "Website audit for search engine and answer engine optimization, with a report URL when complete.",
20610
+ mcpDescription: "Audit a website for search engine and answer engine optimization. Returns a report URL when complete.",
19812
20611
  input: external_exports.object({ url: text(300) }).strict(),
19813
- row: external_exports.object({ url: s, auditId: s, status: s, reportUrl: s }),
20612
+ row: external_exports.object({ url: s2, auditId: s2, status: s2, reportUrl: s2 }),
19814
20613
  display: RESULT_DISPLAY_SPECS["seo-aeo-audit"],
19815
20614
  preview: ["url", "status", "reportUrl"],
19816
20615
  noun: "audits",
@@ -19819,10 +20618,11 @@ var TOOL_DEFINITIONS = {
19819
20618
  toolRequest: (input2) => ({ tool: "seo-aeo-audit", query: input2.url }),
19820
20619
  web: {
19821
20620
  route: "seo-aeo-audit",
19822
- description: "Audit a website for search engine and answer engine optimization with RankAI. Get a report link when complete.",
20621
+ description: "Audit a website for search engine and answer engine optimization and get a report link when complete.",
19823
20622
  group: "social-lead-generation",
19824
- section: "Web research",
19825
- order: 3
20623
+ section: "SEO",
20624
+ step: "site-audit",
20625
+ order: 40
19826
20626
  },
19827
20627
  columns: {
19828
20628
  url: { label: "Website", kind: "mono", sample: ["example.com", "example.org"], demo: "main" },
@@ -19850,6 +20650,7 @@ var TOOL_DEFINITIONS = {
19850
20650
  label: "Website URL",
19851
20651
  example: "example.com",
19852
20652
  action: "Audit website",
20653
+ step: "Audit",
19853
20654
  icon: "search",
19854
20655
  demo: "example.com"
19855
20656
  },
@@ -19875,7 +20676,7 @@ var TOOL_DEFINITIONS = {
19875
20676
  () => toolDefinition({
19876
20677
  description: "Company details from a domain: industry, size, country and about.",
19877
20678
  input: external_exports.object({ domain: text(100) }).strict(),
19878
- row: external_exports.object({ name: s, domain: s, industry: s, employees: s, country: s, about: s, url: s }),
20679
+ row: external_exports.object({ name: s2, domain: s2, industry: s2, employees: s2, country: s2, about: s2, url: s2 }),
19879
20680
  display: RESULT_DISPLAY_SPECS["company"],
19880
20681
  preview: ["name", "industry", "employees", "country"],
19881
20682
  noun: "companies",
@@ -19918,6 +20719,7 @@ var TOOL_DEFINITIONS = {
19918
20719
  label: "Company domain",
19919
20720
  example: "vercel.com",
19920
20721
  action: "Enrich company",
20722
+ step: "Enrich",
19921
20723
  icon: "contact",
19922
20724
  demo: "vercel.com"
19923
20725
  },
@@ -19928,7 +20730,7 @@ var TOOL_DEFINITIONS = {
19928
20730
  via: "Treg",
19929
20731
  role: "Resolve the domain to a LinkedIn company page",
19930
20732
  key: "domain",
19931
- cap: 500,
20733
+ cap: 1500,
19932
20734
  maxCalls: 1
19933
20735
  },
19934
20736
  company: {
@@ -19937,7 +20739,7 @@ var TOOL_DEFINITIONS = {
19937
20739
  via: "Treg",
19938
20740
  role: "Company details",
19939
20741
  key: "company",
19940
- cap: 500,
20742
+ cap: 1500,
19941
20743
  maxCalls: 1
19942
20744
  }
19943
20745
  },
@@ -19953,7 +20755,7 @@ var TOOL_DEFINITIONS = {
19953
20755
  ({ limit }) => toolDefinition({
19954
20756
  description: "Local businesses by type and city, with address, website and listed phone.",
19955
20757
  input: external_exports.object({ business_type: text(100), location: text(100), limit }).strict(),
19956
- row: external_exports.object({ name: s, address: s, phone: s, website: s, rating: n, url: s }),
20758
+ row: external_exports.object({ name: s2, address: s2, phone: s2, website: s2, rating: n2, url: s2 }),
19957
20759
  display: RESULT_DISPLAY_SPECS["local-leads"],
19958
20760
  preview: ["name", "address", "phone", "website"],
19959
20761
  noun: "businesses",
@@ -19970,7 +20772,7 @@ var TOOL_DEFINITIONS = {
19970
20772
  description: "Find local businesses with addresses, websites and listed phone numbers.",
19971
20773
  group: "social-lead-generation",
19972
20774
  section: "Lead lists",
19973
- order: 1
20775
+ order: 2
19974
20776
  },
19975
20777
  columns: {
19976
20778
  name: {
@@ -20025,6 +20827,7 @@ var TOOL_DEFINITIONS = {
20025
20827
  label: "Business category",
20026
20828
  example: "Dentists",
20027
20829
  action: "Find businesses",
20830
+ step: "Find",
20028
20831
  icon: "map",
20029
20832
  demo: "Dentists in Austin"
20030
20833
  },
@@ -20051,15 +20854,15 @@ var TOOL_DEFINITIONS = {
20051
20854
  description: "Sales brief from a company website: what they do, who they sell to, products and pricing.",
20052
20855
  input: external_exports.object({ url: text(300) }).strict(),
20053
20856
  row: external_exports.object({
20054
- company: s,
20055
- whatTheyDo: s,
20056
- sellsTo: s,
20057
- products: s,
20058
- customers: s,
20059
- pricing: s,
20060
- mainCta: s,
20061
- url: s,
20062
- fetchedAt: s
20857
+ company: s2,
20858
+ whatTheyDo: s2,
20859
+ sellsTo: s2,
20860
+ products: s2,
20861
+ customers: s2,
20862
+ pricing: s2,
20863
+ mainCta: s2,
20864
+ url: s2,
20865
+ fetchedAt: s2
20063
20866
  }),
20064
20867
  display: RESULT_DISPLAY_SPECS["website"],
20065
20868
  preview: ["company", "whatTheyDo", "sellsTo", "pricing"],
@@ -20118,6 +20921,7 @@ var TOOL_DEFINITIONS = {
20118
20921
  label: "Company website",
20119
20922
  example: "vercel.com",
20120
20923
  action: "Get brief",
20924
+ step: "Read",
20121
20925
  icon: "globe",
20122
20926
  demo: "vercel.com"
20123
20927
  },
@@ -20138,11 +20942,11 @@ var TOOL_DEFINITIONS = {
20138
20942
  })
20139
20943
  ),
20140
20944
  icp: defineTool(
20141
- { name: "Decision-maker finder", credits: 2, unit: "search (up to 10 profiles)", limit: 10 },
20945
+ { name: "Decision-maker finder", credits: 18, baseCredits: 2, unit: "search (up to 10 profiles)", limit: 10 },
20142
20946
  ({ limit }) => toolDefinition({
20143
20947
  description: "People at one company domain, optionally narrowed to job titles.",
20144
20948
  input: external_exports.object({ company: text(100), titles: external_exports.array(text(60)).max(5).optional(), limit }).strict(),
20145
- row: external_exports.object({ name: s, title: s, company: s, domain: s, country: s.optional(), url: s }),
20949
+ row: external_exports.object({ name: s2, title: s2, company: s2, domain: s2, country: s2.optional(), url: s2 }),
20146
20950
  display: RESULT_DISPLAY_SPECS["icp"],
20147
20951
  preview: ["name", "title", "company"],
20148
20952
  noun: "people",
@@ -20159,10 +20963,10 @@ var TOOL_DEFINITIONS = {
20159
20963
  description: "Start with a company domain. Add job titles to narrow the search, then find emails for the people you select.",
20160
20964
  group: "social-lead-generation",
20161
20965
  section: "Lead lists",
20162
- order: 2
20966
+ order: 0
20163
20967
  },
20164
20968
  columns: {
20165
- name: { label: "Name", kind: "entity", sample: ["Guillermo Rauch", "J\u2022\u2022\u2022 M\u2022\u2022\u2022"], demo: "main" },
20969
+ name: { label: "Name", kind: "entity", sample: ["G\u2022\u2022\u2022 R\u2022\u2022\u2022", "J\u2022\u2022\u2022 M\u2022\u2022\u2022"], demo: "main" },
20166
20970
  title: { label: "Title", kind: "pill", sample: ["CEO", "VP of Sales"], demo: "sub" },
20167
20971
  company: { label: "Company", kind: "text", sample: ["Vercel", "Vercel"] },
20168
20972
  domain: { label: "Domain", kind: "mono", sample: ["vercel.com", "vercel.com"], demo: "end" },
@@ -20197,6 +21001,7 @@ var TOOL_DEFINITIONS = {
20197
21001
  label: "Company domain",
20198
21002
  example: "vercel.com",
20199
21003
  action: "Find decision-makers",
21004
+ step: "Find",
20200
21005
  icon: "waterfall",
20201
21006
  demo: "vercel.com + CEO"
20202
21007
  },
@@ -20216,7 +21021,7 @@ var TOOL_DEFINITIONS = {
20216
21021
  via: "Treg",
20217
21022
  role: "Second source: people by exact company domain",
20218
21023
  key: "people-search",
20219
- cap: 500,
21024
+ cap: 1e5,
20220
21025
  maxCalls: 1
20221
21026
  },
20222
21027
  "company-domain": {
@@ -20225,7 +21030,7 @@ var TOOL_DEFINITIONS = {
20225
21030
  via: "Treg",
20226
21031
  role: "Fallback: resolve the company",
20227
21032
  key: "company-domain",
20228
- cap: 500,
21033
+ cap: 1500,
20229
21034
  maxCalls: 1
20230
21035
  },
20231
21036
  qualify: {
@@ -20234,7 +21039,7 @@ var TOOL_DEFINITIONS = {
20234
21039
  via: "Treg",
20235
21040
  role: "Fallback: confirm the company domain",
20236
21041
  key: "qualify",
20237
- cap: 500,
21042
+ cap: 1500,
20238
21043
  maxCalls: 1
20239
21044
  },
20240
21045
  "title-cascade": {
@@ -20243,7 +21048,7 @@ var TOOL_DEFINITIONS = {
20243
21048
  via: "Treg",
20244
21049
  role: "Fallback: title cascade",
20245
21050
  key: "title-cascade",
20246
- cap: 1500,
21051
+ cap: 3500,
20247
21052
  maxCalls: 1
20248
21053
  },
20249
21054
  "title-function": {
@@ -20252,7 +21057,7 @@ var TOOL_DEFINITIONS = {
20252
21057
  via: "Treg",
20253
21058
  role: "Fallback: title cascade",
20254
21059
  key: "title-function",
20255
- cap: 15e3,
21060
+ cap: 27500,
20256
21061
  maxCalls: 1
20257
21062
  }
20258
21063
  },
@@ -20279,7 +21084,7 @@ var TOOL_DEFINITIONS = {
20279
21084
  page: pageField,
20280
21085
  limit
20281
21086
  }).strict(),
20282
- row: external_exports.object({ company: s, role: s, location: s, posted: s, domain: s, industry: s, employees: s, url: s }),
21087
+ row: external_exports.object({ company: s2, role: s2, location: s2, posted: s2, domain: s2, industry: s2, employees: s2, url: s2 }),
20283
21088
  display: RESULT_DISPLAY_SPECS["signals"],
20284
21089
  preview: ["company", "domain", "role", "posted"],
20285
21090
  noun: "signals",
@@ -20339,6 +21144,7 @@ var TOOL_DEFINITIONS = {
20339
21144
  label: "Role being hired",
20340
21145
  example: "Sales Development Representative",
20341
21146
  action: "Find hiring companies",
21147
+ step: "Search",
20342
21148
  icon: "search",
20343
21149
  demo: "SDR \xB7 United States"
20344
21150
  },
@@ -20383,7 +21189,7 @@ var TOOL_DEFINITIONS = {
20383
21189
  () => toolDefinition({
20384
21190
  description: "Mailbox check for one email address.",
20385
21191
  input: external_exports.object({ email: text(254) }).strict(),
20386
- row: external_exports.object({ email: s, verdict: s, score: n, checkedAt: s }),
21192
+ row: external_exports.object({ email: s2, verdict: s2, score: n2, checkedAt: s2 }),
20387
21193
  display: RESULT_DISPLAY_SPECS["verify-email"],
20388
21194
  preview: ["email", "verdict", "score"],
20389
21195
  noun: "verifications",
@@ -20414,6 +21220,7 @@ var TOOL_DEFINITIONS = {
20414
21220
  gate: "tools",
20415
21221
  example: "email",
20416
21222
  exampleLabel: "Use my email",
21223
+ exampleQuery: "jane@example.com",
20417
21224
  exampleValues: {},
20418
21225
  exampleMono: true,
20419
21226
  progress: ""
@@ -20423,6 +21230,7 @@ var TOOL_DEFINITIONS = {
20423
21230
  label: "Email address",
20424
21231
  example: "name@company.com",
20425
21232
  action: "Verify email",
21233
+ step: "Verify",
20426
21234
  icon: "verify",
20427
21235
  demo: "name@company.com"
20428
21236
  },
@@ -20450,7 +21258,7 @@ var TOOL_DEFINITIONS = {
20450
21258
  () => toolDefinition({
20451
21259
  description: "Mobile number for one LinkedIn profile you have permission to enrich.",
20452
21260
  input: external_exports.object({ profile: text(300) }).strict(),
20453
- row: external_exports.object({ phone: s, type: s, country: s, url: s }),
21261
+ row: external_exports.object({ phone: s2, type: s2, country: s2, url: s2 }),
20454
21262
  display: RESULT_DISPLAY_SPECS["phone-pilot"],
20455
21263
  preview: ["phone", "type", "country"],
20456
21264
  noun: "phones",
@@ -20480,7 +21288,7 @@ var TOOL_DEFINITIONS = {
20480
21288
  grid: false,
20481
21289
  gate: "phone",
20482
21290
  example: "none",
20483
- exampleLabel: "Try an example",
21291
+ exampleLabel: "",
20484
21292
  exampleValues: {},
20485
21293
  exampleMono: true,
20486
21294
  progress: ""
@@ -20488,8 +21296,9 @@ var TOOL_DEFINITIONS = {
20488
21296
  presentation: {
20489
21297
  description: "Find a mobile number for a profile you have permission to enrich. We search 15 phone data providers in turn; coverage and line types vary by country.",
20490
21298
  label: "LinkedIn profile URL",
20491
- example: "https://www.linkedin.com/in/your-profile",
21299
+ example: "linkedin.com/in/\u2026",
20492
21300
  action: "Find number",
21301
+ step: "Find",
20493
21302
  icon: "phone",
20494
21303
  demo: "linkedin.com/in/\u2026"
20495
21304
  },
@@ -20523,7 +21332,7 @@ var TOOL_DEFINITIONS = {
20523
21332
  page: pageField,
20524
21333
  limit
20525
21334
  }).strict(),
20526
- row: external_exports.object({ name: s, title: s, company: s, domain: s, industry: s, employees: s, location: s, url: s }),
21335
+ row: external_exports.object({ name: s2, title: s2, company: s2, domain: s2, industry: s2, employees: s2, location: s2, url: s2 }),
20527
21336
  display: RESULT_DISPLAY_SPECS["people-search"],
20528
21337
  preview: ["name", "title", "company", "location"],
20529
21338
  noun: "people",
@@ -20540,7 +21349,7 @@ var TOOL_DEFINITIONS = {
20540
21349
  description: "Build a lead list by job title and location, then find emails for the people you select.",
20541
21350
  group: "social-lead-generation",
20542
21351
  section: "Lead lists",
20543
- order: 0
21352
+ order: 1
20544
21353
  },
20545
21354
  columns: {
20546
21355
  name: { label: "Name", kind: "entity", sample: ["A\u2022\u2022\u2022 L\u2022\u2022\u2022", "M\u2022\u2022\u2022 K\u2022\u2022\u2022"], demo: "main" },
@@ -20575,6 +21384,7 @@ var TOOL_DEFINITIONS = {
20575
21384
  label: "Job titles (comma separated)",
20576
21385
  example: "VP Sales, Head of Sales",
20577
21386
  action: "Find people",
21387
+ step: "Search",
20578
21388
  icon: "social",
20579
21389
  demo: "VP Sales \xB7 United States"
20580
21390
  },
@@ -20596,11 +21406,11 @@ var TOOL_DEFINITIONS = {
20596
21406
  })
20597
21407
  ),
20598
21408
  "google-search": defineTool(
20599
- { name: "Google search", credits: 1, unit: "search (up to 20 results)", limit: 20 },
21409
+ { name: "Google search", ...fixedSeoPrice(1), unit: "search (up to 20 results)", limit: 20 },
20600
21410
  ({ limit }) => toolDefinition({
20601
- description: "Top Google organic results for a query (United States, English).",
20602
- input: external_exports.object({ query: text(500), limit }).strict(),
20603
- row: external_exports.object({ position: n, title: s, domain: s, snippet: s, url: s }),
21411
+ description: "Top Google organic results for a query. Defaults to United States and English.",
21412
+ input: external_exports.object({ query: text(500), country: googleCountry.optional(), language: googleLanguage.optional(), limit }).strict(),
21413
+ row: external_exports.object({ position: n2, title: s2, domain: s2, snippet: s2, url: s2 }),
20604
21414
  display: RESULT_DISPLAY_SPECS["google-search"],
20605
21415
  preview: ["position", "title", "domain"],
20606
21416
  noun: "results",
@@ -20609,14 +21419,17 @@ var TOOL_DEFINITIONS = {
20609
21419
  toolRequest: (input2) => ({
20610
21420
  tool: "google-search",
20611
21421
  query: input2.query,
21422
+ country: input2.country,
21423
+ language: input2.language,
20612
21424
  ...input2.limit ? { limit: input2.limit } : {}
20613
21425
  }),
20614
21426
  web: {
20615
21427
  route: "google-search-scraper",
20616
21428
  description: "Turn a search query into Google's top results: titles, sites, snippets and links.",
20617
21429
  group: "social-lead-generation",
20618
- section: "Web research",
20619
- order: 0
21430
+ section: "SEO",
21431
+ step: "search-results",
21432
+ order: 10
20620
21433
  },
20621
21434
  columns: {
20622
21435
  position: { label: "Position", kind: "text", sample: ["1", "2"], demo: "main" },
@@ -20641,8 +21454,8 @@ var TOOL_DEFINITIONS = {
20641
21454
  mono: false,
20642
21455
  normalize: "trim",
20643
21456
  validation: "text",
20644
- fields: [],
20645
- grid: false,
21457
+ fields: GOOGLE_LOCALE_FIELDS,
21458
+ grid: true,
20646
21459
  gate: "tools",
20647
21460
  example: "catalog",
20648
21461
  exampleLabel: "Try an example",
@@ -20656,6 +21469,7 @@ var TOOL_DEFINITIONS = {
20656
21469
  label: "Search query",
20657
21470
  example: "best crm for startups",
20658
21471
  action: "Search Google",
21472
+ step: "Search",
20659
21473
  icon: "search",
20660
21474
  demo: "best crm for startups"
20661
21475
  },
@@ -20670,12 +21484,13 @@ var TOOL_DEFINITIONS = {
20670
21484
  maxCalls: 1,
20671
21485
  method: "POST"
20672
21486
  },
20673
- depth: { endpoint: "dataforseo.google.serp.organic", provider: "DataForSEO", via: "Treg", role: "Up to 20 organic results or missing-page fallback", key: "serp-depth", cap: 2e4, maxCalls: 1, method: "POST" }
21487
+ depth: { endpoint: "dataforseo.google.serp.organic", provider: "DataForSEO", via: "Treg", role: "Up to 20 organic results or missing-page fallback", key: "serp-depth", cap: 2e4, maxCalls: 1, method: "POST", body: "single-task" }
20674
21488
  },
20675
21489
  reservationHeadroom: 0,
20676
- badges: [{ name: "Google", logo: "google.png" }],
20677
- carries: { website: "url" },
20678
- actions: [{ entity: "website", target: "page-content" }]
21490
+ badges: [{ name: "Google", logo: "google.png" }, DATAFORSEO_BADGE],
21491
+ carries: { website: "url", company: "domain" },
21492
+ accepts: { keyword: "query" },
21493
+ actions: [{ entity: "website", target: "page-content" }, { entity: "website", target: "page-audit" }, { entity: "company", target: "domain-seo-overview" }]
20679
21494
  })
20680
21495
  ),
20681
21496
  "linkedin-profile": defineTool(
@@ -20684,15 +21499,15 @@ var TOOL_DEFINITIONS = {
20684
21499
  description: `Public LinkedIn profile: headline, current role, company, location and about. One profile or up to ${MAX_BATCH_PEOPLE} people.`,
20685
21500
  input: external_exports.object({ profile: text(300).optional(), people: batchPeople }).strict(),
20686
21501
  row: external_exports.object({
20687
- name: s,
20688
- headline: s,
20689
- role: s,
20690
- company: s,
20691
- location: s,
20692
- followers: n,
20693
- about: s,
20694
- companyPage: s,
20695
- url: s
21502
+ name: s2,
21503
+ headline: s2,
21504
+ role: s2,
21505
+ company: s2,
21506
+ location: s2,
21507
+ followers: n2,
21508
+ about: s2,
21509
+ companyPage: s2,
21510
+ url: s2
20696
21511
  }),
20697
21512
  display: RESULT_DISPLAY_SPECS["linkedin-profile"],
20698
21513
  preview: ["name", "role", "company", "location"],
@@ -20745,6 +21560,7 @@ var TOOL_DEFINITIONS = {
20745
21560
  label: "LinkedIn profile URL",
20746
21561
  example: "https://www.linkedin.com/in/williamhgates",
20747
21562
  action: "Get profile",
21563
+ step: "Read",
20748
21564
  icon: "linkedin",
20749
21565
  demo: "linkedin.com/in/williamhgates"
20750
21566
  },
@@ -20777,18 +21593,18 @@ var TOOL_DEFINITIONS = {
20777
21593
  topics: external_exports.array(text(40)).max(10).optional().describe("Words to look for in the past year's posts, like automation")
20778
21594
  }).strict(),
20779
21595
  row: external_exports.object({
20780
- name: s,
20781
- headline: s,
20782
- lastPostAt: s,
21596
+ name: s2,
21597
+ headline: s2,
21598
+ lastPostAt: s2,
20783
21599
  posts90d: external_exports.number(),
20784
21600
  posts365d: external_exports.number(),
20785
- topics: s,
20786
- topicPosts: n,
20787
- post: s,
20788
- postAt: s,
20789
- postKind: s,
20790
- postUrl: s,
20791
- url: s
21601
+ topics: s2,
21602
+ topicPosts: n2,
21603
+ post: s2,
21604
+ postAt: s2,
21605
+ postKind: s2,
21606
+ postUrl: s2,
21607
+ url: s2
20792
21608
  }),
20793
21609
  display: RESULT_DISPLAY_SPECS["linkedin-activity"],
20794
21610
  preview: ["name", "lastPostAt", "posts90d", "topicPosts"],
@@ -20869,6 +21685,7 @@ var TOOL_DEFINITIONS = {
20869
21685
  label: "LinkedIn profile URL",
20870
21686
  example: "https://www.linkedin.com/in/williamhgates",
20871
21687
  action: "Check activity",
21688
+ step: "Read",
20872
21689
  icon: "linkedin",
20873
21690
  demo: "automation, robotics"
20874
21691
  },
@@ -20900,7 +21717,7 @@ var TOOL_DEFINITIONS = {
20900
21717
  company: text(100).optional().describe("Company name or domain, like Adyen"),
20901
21718
  people: external_exports.array(external_exports.object({ name: text(100), company: text(100) }).strict()).min(1).max(MAX_BATCH_PEOPLE).optional().describe(`Up to ${MAX_BATCH_PEOPLE} {name, company} pairs, instead of name and company`)
20902
21719
  }).strict(),
20903
- row: external_exports.object({ name: s, title: s, company: s, location: s, url: s }),
21720
+ row: external_exports.object({ name: s2, title: s2, company: s2, location: s2, url: s2 }),
20904
21721
  display: RESULT_DISPLAY_SPECS["profile-finder"],
20905
21722
  preview: ["name", "title", "company", "url"],
20906
21723
  noun: "profiles",
@@ -20952,6 +21769,7 @@ var TOOL_DEFINITIONS = {
20952
21769
  label: "Full name",
20953
21770
  example: "Pedro Reis",
20954
21771
  action: "Find profile",
21772
+ step: "Find",
20955
21773
  icon: "linkedin",
20956
21774
  demo: "Pedro Reis, Adyen"
20957
21775
  },
@@ -20987,7 +21805,7 @@ var TOOL_DEFINITIONS = {
20987
21805
  () => toolDefinition({
20988
21806
  description: "Readable text of one public web page.",
20989
21807
  input: external_exports.object({ url: text(300) }).strict(),
20990
- row: external_exports.object({ title: s, url: s, words: external_exports.number(), content: s }),
21808
+ row: external_exports.object({ title: s2, url: s2, words: external_exports.number(), content: s2 }),
20991
21809
  display: RESULT_DISPLAY_SPECS["page-content"],
20992
21810
  preview: ["title", "url", "words"],
20993
21811
  noun: "pages",
@@ -21032,22 +21850,42 @@ var TOOL_DEFINITIONS = {
21032
21850
  label: "Page URL",
21033
21851
  example: "vercel.com/pricing",
21034
21852
  action: "Read page",
21853
+ step: "Read",
21035
21854
  icon: "globe",
21036
21855
  demo: "vercel.com/pricing"
21037
21856
  },
21038
21857
  suppliers: {
21858
+ exa: {
21859
+ endpoint: "exa.web.contents.get",
21860
+ provider: "Exa",
21861
+ via: "Treg",
21862
+ role: "Primary page text",
21863
+ key: "exa",
21864
+ cap: 1e3,
21865
+ maxCalls: 1
21866
+ },
21867
+ parallel: {
21868
+ endpoint: "parallel.web.extract",
21869
+ provider: "Parallel",
21870
+ via: "Treg",
21871
+ role: "Full-content fallback",
21872
+ key: "parallel",
21873
+ cap: 1e3,
21874
+ maxCalls: 1
21875
+ },
21039
21876
  page: {
21040
21877
  endpoint: "treg.web.extract",
21041
- provider: "Treg extract waterfall (15 providers, Crawl4AI first)",
21878
+ provider: "Treg extract waterfall",
21042
21879
  via: "Treg",
21043
- role: "Readable page content",
21880
+ role: "Routed page fallback",
21044
21881
  key: "page",
21045
- cap: 1e4,
21046
- maxCalls: 1
21882
+ cap: 8e3,
21883
+ maxCalls: 1,
21884
+ routeHeaders: { "X-Treg-Route-Exclude": "exa,parallel" }
21047
21885
  }
21048
21886
  },
21049
21887
  reservationHeadroom: 5e3,
21050
- badges: [],
21888
+ badges: [{ name: "Exa", logo: "exa.png" }, { name: "Parallel", logo: "parallel.png" }],
21051
21889
  carries: { website: "url" },
21052
21890
  accepts: { website: "url" }
21053
21891
  })
@@ -21058,17 +21896,17 @@ var TOOL_DEFINITIONS = {
21058
21896
  description: "Public Instagram profile with followers, bio, website and the business email or phone it shows.",
21059
21897
  input: external_exports.object({ profile: text(200).describe("Instagram username, @handle or profile URL") }).strict(),
21060
21898
  row: external_exports.object({
21061
- handle: s,
21062
- name: s,
21063
- bio: s,
21064
- followers: n,
21065
- following: n,
21899
+ handle: s2,
21900
+ name: s2,
21901
+ bio: s2,
21902
+ followers: n2,
21903
+ following: n2,
21066
21904
  business: external_exports.boolean(),
21067
21905
  verified: external_exports.boolean(),
21068
- website: s,
21069
- email: s,
21070
- phone: s,
21071
- url: s
21906
+ website: s2,
21907
+ email: s2,
21908
+ phone: s2,
21909
+ url: s2
21072
21910
  }),
21073
21911
  display: RESULT_DISPLAY_SPECS["instagram-profile"],
21074
21912
  preview: ["handle", "followers", "email", "website"],
@@ -21129,6 +21967,7 @@ var TOOL_DEFINITIONS = {
21129
21967
  label: "Instagram username or profile URL",
21130
21968
  example: "gymshark",
21131
21969
  action: "Get profile",
21970
+ step: "Read",
21132
21971
  icon: "instagram",
21133
21972
  demo: "gymshark"
21134
21973
  },
@@ -21169,20 +22008,20 @@ var TOOL_DEFINITIONS = {
21169
22008
  limit
21170
22009
  }).strict(),
21171
22010
  row: external_exports.object({
21172
- author: s,
21173
- name: s,
21174
- followers: n,
21175
- text: s,
21176
- postedAt: s,
21177
- likes: n,
21178
- replies: n,
21179
- reposts: n,
21180
- views: n,
22011
+ author: s2,
22012
+ name: s2,
22013
+ followers: n2,
22014
+ text: s2,
22015
+ postedAt: s2,
22016
+ likes: n2,
22017
+ replies: n2,
22018
+ reposts: n2,
22019
+ views: n2,
21181
22020
  reply: external_exports.boolean(),
21182
- url: s,
21183
- signal: s.default(""),
21184
- evidence: s.default(""),
21185
- reason: s.default("")
22021
+ url: s2,
22022
+ signal: s2.default(""),
22023
+ evidence: s2.default(""),
22024
+ reason: s2.default("")
21186
22025
  }),
21187
22026
  display: RESULT_DISPLAY_SPECS["x-search"],
21188
22027
  preview: ["author", "signal", "evidence", "url"],
@@ -21277,9 +22116,10 @@ var TOOL_DEFINITIONS = {
21277
22116
  },
21278
22117
  presentation: {
21279
22118
  description: "Find people asking for help, comparing options or describing a problem. Each buyer match includes the words that show their need. Use All matching posts for literal X search.",
21280
- label: "What buyers need, or X search",
22119
+ label: "What are buyers asking for?",
21281
22120
  example: '"looking for a CRM"',
21282
22121
  action: "Search X",
22122
+ step: "Search",
21283
22123
  icon: "search",
21284
22124
  demo: '"looking for a CRM"'
21285
22125
  },
@@ -21313,7 +22153,7 @@ var TOOL_DEFINITIONS = {
21313
22153
  ({ limit }) => toolDefinition({
21314
22154
  description: "Reddit buyer needs with quoted evidence; intent:posts for all matches. Full text and dates checked, up to 3 pages, past year by default.",
21315
22155
  input: external_exports.object({ query: text(300), intent: external_exports.enum(["buyers", "posts"]).optional(), within: external_exports.enum(SEARCH_WINDOWS).optional(), limit }).strict(),
21316
- row: external_exports.object({ subreddit: s, title: s, text: s, author: s, postedAt: s, score: n, comments: n, url: s, signal: s, evidence: s, reason: s }),
22156
+ row: external_exports.object({ subreddit: s2, title: s2, text: s2, author: s2, postedAt: s2, score: n2, comments: n2, url: s2, signal: s2, evidence: s2, reason: s2 }),
21317
22157
  display: RESULT_DISPLAY_SPECS["reddit-search"],
21318
22158
  preview: ["subreddit", "evidence", "url"],
21319
22159
  noun: "posts",
@@ -21397,6 +22237,7 @@ var TOOL_DEFINITIONS = {
21397
22237
  label: "Search query",
21398
22238
  example: "best cold email tool",
21399
22239
  action: "Search Reddit",
22240
+ step: "Search",
21400
22241
  icon: "search",
21401
22242
  demo: "best cold email tool"
21402
22243
  },
@@ -21427,15 +22268,15 @@ var TOOL_DEFINITIONS = {
21427
22268
  limit
21428
22269
  }).strict(),
21429
22270
  row: external_exports.object({
21430
- company: s,
21431
- amount: n,
21432
- currency: s,
21433
- round: s,
21434
- announced: s,
21435
- domain: s,
21436
- industry: s,
21437
- employees: s,
21438
- source: s
22271
+ company: s2,
22272
+ amount: n2,
22273
+ currency: s2,
22274
+ round: s2,
22275
+ announced: s2,
22276
+ domain: s2,
22277
+ industry: s2,
22278
+ employees: s2,
22279
+ source: s2
21439
22280
  }),
21440
22281
  display: RESULT_DISPLAY_SPECS["funding-signals"],
21441
22282
  preview: ["company", "domain", "amount", "announced"],
@@ -21482,6 +22323,7 @@ var TOOL_DEFINITIONS = {
21482
22323
  label: "Region",
21483
22324
  example: "US",
21484
22325
  action: "Find companies",
22326
+ step: "Search",
21485
22327
  icon: "search",
21486
22328
  demo: "US"
21487
22329
  },
@@ -21517,7 +22359,7 @@ var TOOL_DEFINITIONS = {
21517
22359
  ({ limit, maxResults }) => toolDefinition({
21518
22360
  description: "Companies similar to one you name, from its domain, for finding more accounts like your best customers.",
21519
22361
  input: external_exports.object({ company: text(100).describe("Company domain, like vercel.com"), limit }).strict(),
21520
- row: external_exports.object({ company: s, domain: s, industry: s }),
22362
+ row: external_exports.object({ company: s2, domain: s2, industry: s2 }),
21521
22363
  display: RESULT_DISPLAY_SPECS["lookalike-companies"],
21522
22364
  preview: ["company", "domain", "industry"],
21523
22365
  noun: "companies",
@@ -21555,6 +22397,7 @@ var TOOL_DEFINITIONS = {
21555
22397
  label: "Company domain",
21556
22398
  example: "vercel.com",
21557
22399
  action: "Find similar companies",
22400
+ step: "Match",
21558
22401
  icon: "search",
21559
22402
  demo: "vercel.com"
21560
22403
  },
@@ -21586,7 +22429,7 @@ var TOOL_DEFINITIONS = {
21586
22429
  technologies: external_exports.array(text(30)).min(1).max(8).optional().describe("Only these, like HubSpot"),
21587
22430
  limit
21588
22431
  }).strict(),
21589
- row: external_exports.object({ technology: s, category: s, lastSeen: s, domain: s }),
22432
+ row: external_exports.object({ technology: s2, category: s2, lastSeen: s2, domain: s2 }),
21590
22433
  display: RESULT_DISPLAY_SPECS["tech-stack"],
21591
22434
  preview: ["technology", "category", "lastSeen"],
21592
22435
  noun: "technologies",
@@ -21641,6 +22484,7 @@ var TOOL_DEFINITIONS = {
21641
22484
  label: "Company domain",
21642
22485
  example: "vercel.com",
21643
22486
  action: "Read tech stack",
22487
+ step: "Detect",
21644
22488
  icon: "search",
21645
22489
  demo: "vercel.com"
21646
22490
  },
@@ -21668,7 +22512,7 @@ var TOOL_DEFINITIONS = {
21668
22512
  title: "Post engagers",
21669
22513
  description: "Who commented on or reacted to one post URL; a competitor's post finds warm leads.",
21670
22514
  input: external_exports.object({ post: text(500).describe("LinkedIn post URL"), page: pageField, limit }).strict(),
21671
- row: external_exports.object({ name: s, headline: s, engagement: s, comment: s, url: s }),
22515
+ row: external_exports.object({ name: s2, headline: s2, engagement: s2, comment: s2, url: s2 }),
21672
22516
  display: RESULT_DISPLAY_SPECS["post-engagers"],
21673
22517
  preview: ["name", "headline", "engagement"],
21674
22518
  noun: "people",
@@ -21709,6 +22553,7 @@ var TOOL_DEFINITIONS = {
21709
22553
  label: "LinkedIn post URL",
21710
22554
  example: "https://www.linkedin.com/posts/example-activity-1",
21711
22555
  action: "Find people",
22556
+ step: "Collect",
21712
22557
  icon: "social",
21713
22558
  demo: "https://www.linkedin.com/posts/example-activity-1"
21714
22559
  },
@@ -21734,10 +22579,10 @@ var TOOL_DEFINITIONS = {
21734
22579
  };
21735
22580
 
21736
22581
  // ../contracts/src/reddit-search-query.ts
21737
- function parseRedditSearchQuery(query) {
21738
- const source = query.replace(/[“”]/g, '"');
22582
+ function parseRedditSearchQuery(query2) {
22583
+ const source = query2.replace(/[“”]/g, '"');
21739
22584
  const tokens = [];
21740
- const pattern = /\s+|(?:([a-z_]+):)?"([^"]+)"|[()\-]|[^\s()"\-][^\s()"]*/gy;
22585
+ const pattern = /\s+|(?:([a-z_]+):)?"([^"]+)"|[()-]|[^\s()"-][^\s()"]*/gy;
21741
22586
  let at = 0;
21742
22587
  while (at < source.length) {
21743
22588
  pattern.lastIndex = at;
@@ -21813,10 +22658,10 @@ function validateTerm(value, quoted) {
21813
22658
  if (["from", "to"].includes(operator) && !/^@?[a-zA-Z0-9_]{1,15}$/.test(argument)) throw new Error("Use an X username after from: or to:.");
21814
22659
  if (operator === "lang" && !/^[a-z]{2,3}$/i.test(argument)) throw new Error("Use a language code such as lang:en.");
21815
22660
  }
21816
- function parseXSearchQuery(query) {
22661
+ function parseXSearchQuery(query2) {
21817
22662
  const tokens = [];
21818
- const source = query.replace(/[“”]/g, '"');
21819
- const pattern = /\s+|"([^"]+)"|[()\-]|[^\s()"\-][^\s()"]*/gy;
22663
+ const source = query2.replace(/[“”]/g, '"');
22664
+ const pattern = /\s+|"([^"]+)"|[()-]|[^\s()"-][^\s()"]*/gy;
21820
22665
  let at = 0;
21821
22666
  while (at < source.length) {
21822
22667
  pattern.lastIndex = at;
@@ -21871,12 +22716,14 @@ function parseXSearchQuery(query) {
21871
22716
  }
21872
22717
 
21873
22718
  // ../contracts/src/tools.ts
21874
- var TOOL_CATALOG = Object.fromEntries(Object.entries(TOOL_DEFINITIONS).map(([id, { name, credits: credits2, unit, limit }]) => [id, { name, credits: credits2, unit, limit }]));
22719
+ var TOOL_CATALOG = Object.fromEntries(Object.entries(TOOL_DEFINITIONS).map(([id, { name, credits: credits3, price: { pricing }, baseCredits, unit, limit }]) => [id, { name, credits: credits3, ...baseCredits === void 0 ? {} : { baseCredits }, ...pricing ? { pricing } : {}, unit, limit }]));
22720
+ var DECISION_MAKER_BACKUP_NOTE = `Backup sources can search more for up to ${TOOL_CATALOG.icp.credits} credits per domain.`;
21875
22721
  var toolIdSchema = external_exports.enum(Object.keys(TOOL_CATALOG));
21876
22722
  var savedToolRequestSchema = external_exports.object({
21877
22723
  tool: toolIdSchema,
21878
22724
  ...toolRequestFields.shape
21879
22725
  }).strict();
22726
+ var toolSubmissionSchema = savedToolRequestSchema.extend({ maxCredits: external_exports.number().int().nonnegative().optional() });
21880
22727
  var toolRequestSchema = savedToolRequestSchema.superRefine((v, c) => {
21881
22728
  const reject = (message) => c.addIssue({ code: "custom", path: ["query"], message });
21882
22729
  if (v.tool === "x-search") {
@@ -21894,6 +22741,25 @@ var toolRequestSchema = savedToolRequestSchema.superRefine((v, c) => {
21894
22741
  } else if (v.intent) c.addIssue({ code: "custom", path: ["intent"], message: "Only X and Reddit search take a search intent." });
21895
22742
  if (v.careerBoard && !/^https:\/\/(boards\.greenhouse\.io|jobs\.lever\.co)\/[a-zA-Z0-9_-]+\/?$/.test(v.careerBoard)) reject("Use a public Greenhouse or Lever company board URL.");
21896
22743
  const form2 = TOOL_DEFINITIONS[v.tool].form;
22744
+ if (v.query.length < 2 && !form2.keywordList && v.tool !== "keyword-ideas") reject("Enter at least two characters.");
22745
+ if (v.limit > 100 && !form2.keywordList) c.addIssue({ code: "custom", path: ["limit"], message: "This tool accepts a limit up to 100." });
22746
+ if (form2.keywordList && !v.searchTerms?.length) reject("Enter one keyword per line.");
22747
+ if (v.tool === "keyword-trends" && v.searchTerms && (v.searchTerms.length > MAX_TREND_KEYWORDS || v.searchTerms.some((term) => term.includes(",")))) {
22748
+ reject("Enter up to five keywords without commas.");
22749
+ }
22750
+ if (v.tool === "keyword-ideas" && v.query.length > 80) reject("Enter a keyword up to 80 characters.");
22751
+ if (v.tool === "ai-answer" && v.query.length > 400) reject("Enter a question up to 400 characters.");
22752
+ if (v.tool === "ai-visibility-check") {
22753
+ if (v.query.length > 100) reject("Enter a brand name up to 100 characters.");
22754
+ if (!seoDomain.safeParse(v.company).success) c.addIssue({ code: "custom", path: ["company"], message: "Enter a domain like example.com." });
22755
+ }
22756
+ for (const field of ["country", "language", "engine", "questions"]) {
22757
+ if (v[field] && !form2.fields.some((item) => item.key === field)) c.addIssue({ code: "custom", path: [field], message: "This field is not supported for this tool." });
22758
+ }
22759
+ if (v.searchTerms && !form2.keywordList) c.addIssue({ code: "custom", path: ["searchTerms"], message: "This tool does not accept a list of keywords." });
22760
+ if (TOOL_DEFINITIONS[v.tool].web?.section === "SEO" && form2.validation === "domain" && !seoDomain.safeParse(v.query).success) {
22761
+ reject("Enter a domain like example.com.");
22762
+ }
21897
22763
  const validators = {
21898
22764
  text: () => true,
21899
22765
  website: () => publicWebsite(websiteUrl(v.query)),
@@ -21919,7 +22785,10 @@ var toolRequestSchema = savedToolRequestSchema.superRefine((v, c) => {
21919
22785
  if (afterWindow && !validators[form2.validation]()) reject(messages[form2.validation]);
21920
22786
  });
21921
22787
  var toolResultSchema = external_exports.object({
21922
- rows: external_exports.array(external_exports.record(external_exports.string(), external_exports.union([external_exports.string().max(1e5), external_exports.number(), external_exports.boolean(), external_exports.null()]))).max(100),
22788
+ creditBreakdown: creditBreakdownSchema.optional(),
22789
+ quality: qualitySummarySchema.optional(),
22790
+ backupSourcesSkipped: external_exports.literal(true).optional(),
22791
+ rows: external_exports.array(external_exports.record(external_exports.string(), external_exports.union([external_exports.string().max(1e5), external_exports.number(), external_exports.boolean(), external_exports.null()]))).max(MAX_VOLUME_KEYWORDS),
21923
22792
  notes: external_exports.array(external_exports.string().max(500)).max(10),
21924
22793
  /** There are more results: the next page and, when the source says, how many match in all. */
21925
22794
  more: external_exports.object({ page: external_exports.number().int().positive(), total: external_exports.number().int().nonnegative().optional() }).optional(),
@@ -22080,6 +22949,7 @@ var HIRING_WATCH_POLICY = {
22080
22949
  maxPostsPerCompany: TOOL_DEFINITIONS.signals.limit
22081
22950
  };
22082
22951
  var FUNDING_ALERT_CREDITS = 5;
22952
+ var JOB_CHANGE_CREDITS = 40;
22083
22953
  var TOPIC_WATCH_SOURCES = ["reddit", "x"];
22084
22954
  var TOPIC_WATCH_POLICY = {
22085
22955
  /** Credits per new qualifying post. The only price: checks and baselines are free. */
@@ -22129,12 +22999,30 @@ var topicWatchQuote = external_exports.object({
22129
22999
  var topicWatchCreate = topicWatchQuote.safeExtend({
22130
23000
  max_credits: external_exports.number().int().positive().max(Number.MAX_SAFE_INTEGER)
22131
23001
  });
23002
+ function jobChangeProfileUrl(value) {
23003
+ const trimmed = value.trim();
23004
+ const handle = /^[A-Za-z0-9][A-Za-z0-9_%-]{0,99}$/.exec(trimmed)?.[0] ?? /^(?:https?:\/\/)?(?:www\.)?linkedin\.com\/in\/([A-Za-z0-9_%-]{1,100})\/?(?:[?#].*)?$/i.exec(trimmed)?.[1];
23005
+ return handle ? `https://www.linkedin.com/in/${canonicalProfileSlug(handle)}` : null;
23006
+ }
23007
+ var jobChangeProfile = external_exports.string().trim().max(253).transform((value, ctx) => {
23008
+ const url3 = jobChangeProfileUrl(value);
23009
+ if (!url3) ctx.addIssue({ code: "custom", message: "Use a LinkedIn profile URL such as linkedin.com/in/name" });
23010
+ return url3 ?? "";
23011
+ });
23012
+ var jobChangeWatchQuote = external_exports.object({
23013
+ name: external_exports.string().trim().min(1).max(100),
23014
+ signal: external_exports.literal("job-change"),
23015
+ companies: external_exports.array(jobChangeProfile).min(1).max(HIRING_WATCH_POLICY.maxCompanies).transform((urls) => [...new Set(urls)])
23016
+ }).strict();
23017
+ var jobChangeWatchCreate = jobChangeWatchQuote.safeExtend({
23018
+ max_credits: external_exports.number().int().positive().max(Number.MAX_SAFE_INTEGER)
23019
+ });
22132
23020
  var watchInput = external_exports.object({
22133
23021
  action: external_exports.enum(["create", "list", "show", "changes", "pause", "resume", "delete", "webhook_set", "webhook_show", "webhook_rotate", "webhook_remove", "webhook_test"]),
22134
23022
  url: external_exports.string().max(400).optional(),
22135
23023
  name: external_exports.string().max(100).optional(),
22136
23024
  companies: external_exports.array(external_exports.string().max(253)).max(HIRING_WATCH_POLICY.maxCompanies).optional(),
22137
- signal: external_exports.enum(["hiring", "headcount", "tech-stack", "funding", "topic"]).optional(),
23025
+ signal: external_exports.enum(["hiring", "headcount", "tech-stack", "funding", "topic", "job-change"]).optional(),
22138
23026
  role: external_exports.string().max(200).optional(),
22139
23027
  topic: external_exports.string().max(300).optional(),
22140
23028
  sources: external_exports.array(external_exports.enum(TOPIC_WATCH_SOURCES)).max(2).optional(),
@@ -22152,6 +23040,8 @@ function watchPolicy(signal2) {
22152
23040
  return { ...HIRING_WATCH_POLICY, changeCredits: TOPIC_WATCH_POLICY.postCredits, intervalMs: TOPIC_WATCH_POLICY.intervalMs, supplierChecksPerMonth: TOPIC_WATCH_POLICY.supplierChecksPerMonth, supplierCheckAtomic: 0, maxPostsPerCompany: TOPIC_WATCH_POLICY.maxPostsPerCheck };
22153
23041
  if (signal2 === "funding")
22154
23042
  return { ...HIRING_WATCH_POLICY, changeCredits: FUNDING_ALERT_CREDITS, intervalMs: 24 * 60 * 60 * 1e3, supplierChecksPerMonth: 1, supplierCheckAtomic: 0, maxPostsPerCompany: 1 };
23043
+ if (signal2 === "job-change")
23044
+ return { ...HIRING_WATCH_POLICY, changeCredits: JOB_CHANGE_CREDITS, intervalMs: 31 * 24 * 60 * 60 * 1e3, supplierChecksPerMonth: 1, supplierCheckAtomic: TOOL_DEFINITIONS["linkedin-profile"].supplierReserve, maxPostsPerCompany: 1 };
22155
23045
  const tool2 = signal2 === "headcount" ? "company" : "tech-stack";
22156
23046
  return {
22157
23047
  ...HIRING_WATCH_POLICY,
@@ -22165,7 +23055,7 @@ function watchPolicy(signal2) {
22165
23055
  }
22166
23056
  function watchCheckCeiling(signal2, companies) {
22167
23057
  const policy = watchPolicy(signal2);
22168
- const units = signal2 === "topic" ? TOPIC_WATCH_POLICY.maxPostsPerCheck : signal2 === "tech-stack" ? companies : companies * policy.maxPostsPerCompany;
23058
+ const units = signal2 === "topic" ? TOPIC_WATCH_POLICY.maxPostsPerCheck : signal2 === "tech-stack" || signal2 === "job-change" ? companies : companies * policy.maxPostsPerCompany;
22169
23059
  return units * policy.changeCredits;
22170
23060
  }
22171
23061
  function watchQuoteFigures(signal2, size) {
@@ -22179,9 +23069,9 @@ var DAY_MS = 24 * 60 * 60 * 1e3;
22179
23069
  // ../contracts/src/lead-plan.ts
22180
23070
  var LEAD_PLAN_VERSION_HEADER = "X-GTM-Answer-Version";
22181
23071
  var LEAD_PLAN_MAX_BYTES = 4096;
22182
- var AGENT_RESPONSE_VERSION = 3;
23072
+ var AGENT_RESPONSE_VERSION = 5;
22183
23073
  var text2 = (max) => external_exports.string().trim().min(1).max(max);
22184
- var credits = external_exports.number().int().min(0).max(AGENT_MAX_CREDITS);
23074
+ var credits2 = external_exports.number().int().min(0).max(AGENT_MAX_CREDITS);
22185
23075
  var target = external_exports.number().int().min(1).max(LEAD_MAX_TARGET);
22186
23076
  var token = (max) => external_exports.string().regex(/^[A-Za-z0-9_-]+$/).min(1).max(max);
22187
23077
  var planId = token(64);
@@ -22223,15 +23113,15 @@ var leadPlanInput = external_exports.object({
22223
23113
  var leadPlanChoiceSchema = external_exports.object({
22224
23114
  plan_id: planId,
22225
23115
  option_id: optionId,
22226
- max_credits: credits,
23116
+ max_credits: credits2,
22227
23117
  idempotency_key: external_exports.string().regex(/^[\x21-\x7e]{8,128}$/)
22228
23118
  }).strict();
22229
23119
  var confidence = external_exports.enum(["low", "medium", "high"]);
22230
- var range = (bound) => external_exports.tuple([bound, bound]).refine(([min, max]) => min <= max, "Range must be ordered.");
23120
+ var range2 = (bound) => external_exports.tuple([bound, bound]).refine(([min, max]) => min <= max, "Range must be ordered.");
22231
23121
  var leadPlanEtaSchema = external_exports.discriminatedUnion("basis", [
22232
23122
  external_exports.object({ basis: external_exports.literal("unavailable") }).strict(),
22233
- external_exports.object({ basis: external_exports.literal("measured"), seconds: range(external_exports.number().int().nonnegative()), sample_size: external_exports.number().int().positive(), confidence }).strict(),
22234
- external_exports.object({ basis: external_exports.literal("conservative_model"), seconds: range(external_exports.number().int().nonnegative()), assumptions: text2(160), confidence }).strict()
23123
+ external_exports.object({ basis: external_exports.literal("measured"), seconds: range2(external_exports.number().int().nonnegative()), sample_size: external_exports.number().int().positive(), confidence }).strict(),
23124
+ external_exports.object({ basis: external_exports.literal("conservative_model"), seconds: range2(external_exports.number().int().nonnegative()), assumptions: text2(160), confidence }).strict()
22235
23125
  ]);
22236
23126
  var leadQualityPricesSchema = external_exports.object({
22237
23127
  checked: external_exports.object({ email_credits: external_exports.literal(EMAIL_LOOKUP_CREDITS), mailbox_check_included: external_exports.literal(true), definitive_verdict_guaranteed: external_exports.literal(false) }).strict(),
@@ -22240,8 +23130,8 @@ var leadQualityPricesSchema = external_exports.object({
22240
23130
  }).strict();
22241
23131
  var leadEstimateSchema = external_exports.object({
22242
23132
  target: target.nullable(),
22243
- credits: range(credits).nullable(),
22244
- with_recheck: range(credits).nullable(),
23133
+ credits: range2(credits2).nullable(),
23134
+ with_recheck: range2(credits2).nullable(),
22245
23135
  cap_remaining: external_exports.number().int().nonnegative(),
22246
23136
  affordable_target: external_exports.number().int().min(0).max(LEAD_MAX_TARGET),
22247
23137
  affordable_with_recheck: external_exports.number().int().min(0).max(LEAD_MAX_TARGET),
@@ -22252,8 +23142,8 @@ var leadStopSchema = external_exports.enum(["sources_exhausted", "budget_reached
22252
23142
  var leadProgressSchema = external_exports.object({
22253
23143
  found: external_exports.number().int().nonnegative(),
22254
23144
  target,
22255
- spent: credits,
22256
- budget_left: credits,
23145
+ spent: credits2,
23146
+ budget_left: credits2,
22257
23147
  state: external_exports.enum(["running", "done", "stopped"]),
22258
23148
  /** Present when the list stopped short of its target. */
22259
23149
  stop: leadStopSchema.optional()
@@ -22263,9 +23153,9 @@ var leadPlanOptionSchema = external_exports.object({
22263
23153
  target,
22264
23154
  quality: external_exports.literal("checked"),
22265
23155
  extra_recheck: external_exports.boolean(),
22266
- estimated_credits: credits,
22267
- max_credits: credits,
22268
- estimated_results: range(external_exports.number().int().min(0).max(LEAD_MAX_TARGET)),
23156
+ estimated_credits: credits2,
23157
+ max_credits: credits2,
23158
+ estimated_results: range2(external_exports.number().int().min(0).max(LEAD_MAX_TARGET)),
22269
23159
  eta: leadPlanEtaSchema,
22270
23160
  availability: external_exports.enum(["available", "cap_change_required", "insufficient_balance", "source_unavailable", "capacity_exceeded"]),
22271
23161
  reason: text2(160).optional()
@@ -22301,7 +23191,7 @@ var quoteObject = external_exports.object({
22301
23191
  next: external_exports.object({ tool: external_exports.literal("human"), args: external_exports.object({ message: external_exports.literal("Show all options and obtain a selection and credit limit before executing.") }).strict() }).strict(),
22302
23192
  /** Largest currently affordable quantity, not a replacement for a blocked option. */
22303
23193
  affordable_target: external_exports.number().int().min(0).max(LEAD_MAX_TARGET).optional(),
22304
- top_up: external_exports.object({ url: external_exports.url().max(256), credits }).strict().optional()
23194
+ top_up: external_exports.object({ url: external_exports.url().max(256), credits: credits2 }).strict().optional()
22305
23195
  }).strict();
22306
23196
  var bytes = (value) => new TextEncoder().encode(value).length;
22307
23197
  function leadPlanText(quote2) {
@@ -22365,7 +23255,7 @@ var leadPlanSnapshotSchema = leadPlanIdentitySchema.safeExtend({
22365
23255
 
22366
23256
  // ../contracts/src/email-finder.ts
22367
23257
  var text3 = (max) => external_exports.string().trim().min(1).max(max);
22368
- var s2 = external_exports.string();
23258
+ var s3 = external_exports.string();
22369
23259
  var EMAIL_SUPPLIER_STEPS = [
22370
23260
  {
22371
23261
  service: { endpoint: "treg_quickenrich", provider: "QuickEnrich", via: "Treg", role: "Work email, first try" },
@@ -22378,7 +23268,7 @@ var EMAIL_SUPPLIER_STEPS = [
22378
23268
  service: { endpoint: "treg_blitz", provider: "Blitz", via: "Treg", role: "Work email" },
22379
23269
  marketplace: "blitz",
22380
23270
  endpoint: "blitzapi.people.email.find",
22381
- cap: 495,
23271
+ cap: 1e3,
22382
23272
  method: "POST"
22383
23273
  },
22384
23274
  {
@@ -22414,12 +23304,12 @@ var EMAIL_FINDER_DEFINITION = {
22414
23304
  input: external_exports.object({ people: external_exports.array(text3(300)).min(1).max(MAX_BATCH_PEOPLE) }).strict(),
22415
23305
  accepts: { person: "people" },
22416
23306
  row: external_exports.object({
22417
- name: s2.nullable(),
22418
- title: s2.nullable(),
22419
- email: s2.nullable(),
22420
- verdict: s2.nullable(),
22421
- url: s2,
22422
- status: s2
23307
+ name: s3.nullable(),
23308
+ title: s3.nullable(),
23309
+ email: s3.nullable(),
23310
+ verdict: s3.nullable(),
23311
+ url: s3,
23312
+ status: s3
22423
23313
  }),
22424
23314
  preview: ["name", "email", "verdict"],
22425
23315
  noun: "contacts",
@@ -22433,7 +23323,7 @@ var EMAIL_FINDER_DEFINITION = {
22433
23323
  example: { people: ["https://www.linkedin.com/in/satyanadella"] },
22434
23324
  steps: EMAIL_SUPPLIER_STEPS,
22435
23325
  verification: EMAIL_VERIFICATION_STEP,
22436
- services: [...EMAIL_SUPPLIER_STEPS.map((step) => step.service), EMAIL_VERIFICATION_STEP.service],
23326
+ services: [...EMAIL_SUPPLIER_STEPS.map((step2) => step2.service), EMAIL_VERIFICATION_STEP.service],
22437
23327
  badges: [
22438
23328
  { name: "QuickEnrich", logo: "quickenrich.png" },
22439
23329
  { name: "Blitz", logo: "blitz.png" },
@@ -22472,7 +23362,8 @@ var CAPABILITIES = {
22472
23362
  "page-content": TOOL_DEFINITIONS["page-content"],
22473
23363
  "instagram-profile": TOOL_DEFINITIONS["instagram-profile"],
22474
23364
  "x-search": TOOL_DEFINITIONS["x-search"],
22475
- "reddit-search": TOOL_DEFINITIONS["reddit-search"]
23365
+ "reddit-search": TOOL_DEFINITIONS["reddit-search"],
23366
+ ...SEO_TOOL_DEFINITIONS
22476
23367
  };
22477
23368
  var CAPABILITY_IDS = Object.keys(CAPABILITIES);
22478
23369
  var capabilityIdSchema = external_exports.enum(CAPABILITY_IDS);
@@ -22517,6 +23408,7 @@ var findSignalsInput = external_exports.object({
22517
23408
  var icpFields = leadIcpSchema.shape;
22518
23409
  var findLeadsInput = external_exports.object({
22519
23410
  ...icpFields,
23411
+ exclude_domains: external_exports.array(text4(100)).max(100).optional(),
22520
23412
  hiring_roles: external_exports.array(text4(100)).min(1).max(5).optional().describe("Signal; a tool's name finds its users"),
22521
23413
  recently_funded: external_exports.boolean().optional(),
22522
23414
  like_companies: external_exports.array(text4(100)).min(1).max(5).optional(),
@@ -22549,7 +23441,7 @@ var accountInput = external_exports.object({
22549
23441
  quote: external_exports.object({ capability: external_exports.string().pipe(capabilityIdSchema.meta({ "x-gtm-catalog": true })), count: external_exports.number().int().min(1).max(1e5) }).strict().optional()
22550
23442
  }).strict();
22551
23443
  var OUTCOME_TOOLS = {
22552
- gtm_watch: { title: "Company watch", description: `Hiring/funding/topic ${HIRING_WATCH_POLICY.changeCredits}, headcount ${watchPolicy("headcount").changeCredits}/change, tech-stack ${watchPolicy("tech-stack").changeCredits}/company. Quote first.`, paid: true, capabilities: ["signals"], input: watchInput },
23444
+ gtm_watch: { title: "Watches", description: `Watch companies for hiring, headcount, tech-stack, funding, topic or job-change signals; list, pause or delete watches. Hiring ${HIRING_WATCH_POLICY.changeCredits} cr/change, headcount/tech-stack ${watchPolicy("headcount").changeCredits}, job-change ${watchPolicy("job-change").changeCredits}. Quote first.`, paid: true, capabilities: ["signals"], input: watchInput },
22553
23445
  gtm_find_contacts: {
22554
23446
  title: "Find contacts",
22555
23447
  description: `Profiles/names/run_id: ${CAPABILITIES["email-finder"].price.credits} cr/email; mailbox check included, ${price("phone-pilot")} cr/phone, recheck ${price("verify-email")}. Misses free.`,
@@ -22559,14 +23451,14 @@ var OUTCOME_TOOLS = {
22559
23451
  },
22560
23452
  gtm_build_list: {
22561
23453
  title: "Build a lead list",
22562
- description: `People ${price("people-search")} cr/100; decision-makers ${price("icp")} cr/domain; local businesses ${price("local-leads")} cr. Empty free.`,
23454
+ description: `People ${price("people-search")} cr/100; decision-makers ${TOOL_CATALOG.icp.baseCredits} cr/domain, ${price("icp")} if backups run; local businesses ${price("local-leads")} cr. Empty free.`,
22563
23455
  paid: true,
22564
23456
  capabilities: ["people-search", "icp", "local-leads"],
22565
23457
  input: buildListInput
22566
23458
  },
22567
23459
  gtm_find_leads: {
22568
23460
  title: "Find leads",
22569
- description: "Ask target; absent plans free; dry_run quotes. Run with max_credits.",
23461
+ description: "Find new B2B leads with work emails for a target audience. Ask the target first; dry_run quotes free; run with max_credits.",
22570
23462
  paid: true,
22571
23463
  capabilities: ["people-search", "signals", "funding-signals", "lookalike-companies", "post-engagers", "icp", "email-finder"],
22572
23464
  input: findLeadsInput
@@ -22624,6 +23516,7 @@ var agentAnswerStatusSchema = external_exports.enum(["completed", "not_found", "
22624
23516
  var agentCellSchema = external_exports.union([external_exports.string(), external_exports.number(), external_exports.boolean(), external_exports.null()]);
22625
23517
  var agentNextSchema = external_exports.object({ tool: external_exports.string().max(40), args: external_exports.record(external_exports.string(), external_exports.unknown()) }).strict();
22626
23518
  var agentAnswerSchema = external_exports.object({
23519
+ quality: qualitySummarySchema.optional(),
22627
23520
  status: agentAnswerStatusSchema,
22628
23521
  summary: external_exports.string().min(1).max(SUMMARY_MAX_CHARS),
22629
23522
  /** Machine-readable refusal or error reason, e.g. over_agent_cap. */
@@ -22637,6 +23530,8 @@ var agentAnswerSchema = external_exports.object({
22637
23530
  balance: external_exports.number().int().nonnegative().nullable(),
22638
23531
  /** Most credits the request could cost. */
22639
23532
  quote: external_exports.number().int().nonnegative().optional(),
23533
+ pricing: seoPricingSchema.optional(),
23534
+ credit_breakdown: creditBreakdownSchema.optional(),
22640
23535
  /** Rows kept on the server for this run. */
22641
23536
  total: external_exports.number().int().nonnegative(),
22642
23537
  label: external_exports.string().min(1).max(24),
@@ -22645,7 +23540,7 @@ var agentAnswerSchema = external_exports.object({
22645
23540
  next: agentNextSchema,
22646
23541
  /** Refusals: the fields the call does accept. */
22647
23542
  fields: external_exports.array(external_exports.string().max(40)).max(12).optional(),
22648
- /** Related link, e.g. a run's CSV or the public record behind a quote. */
23543
+ /** Related link, e.g. a run's CSV or an approval page. */
22649
23544
  link: external_exports.string().max(512).optional(),
22650
23545
  /** Out of credits, and the owner lets this agent pay from its own wallet: where to buy them, and how many it needs. */
22651
23546
  top_up: external_exports.object({ url: external_exports.string().max(256), credits: external_exports.number().int().positive() }).optional(),
@@ -22676,11 +23571,12 @@ function cell(value, max) {
22676
23571
  function build(draft, rowCount, columnCount, cellMax) {
22677
23572
  const allColumns = (draft.columns ?? Object.keys(draft.rows?.[0] ?? {})).slice(0, 6);
22678
23573
  const columns = allColumns.slice(0, columnCount);
22679
- const rows = (draft.rows ?? []).slice(0, rowCount).map((row) => columns.map((column) => cell(row[column], cellMax)));
23574
+ const rows = (draft.rows ?? []).slice(0, rowCount).map((row) => columns.map((column2) => cell(row[column2], cellMax)));
22680
23575
  const end = (draft.pageOffset ?? 0) + rows.length;
22681
23576
  const total = draft.total ?? draft.rows?.length ?? 0;
22682
23577
  const paging = draft.pageOffset !== void 0 && (draft.pageOffset > 0 || rows.length < (draft.rows?.length ?? 0));
22683
23578
  return {
23579
+ ...draft.quality ? { quality: draft.quality } : {},
22684
23580
  status: draft.status,
22685
23581
  summary: paging && !draft.reason ? rows.length ? `Rows ${draft.pageOffset + 1} to ${end} of ${total}.` : `No rows after ${total}.` : speakable(draft.summary),
22686
23582
  ...draft.reason ? { reason: draft.reason.slice(0, 40) } : {},
@@ -22689,6 +23585,8 @@ function build(draft, rowCount, columnCount, cellMax) {
22689
23585
  ...draft.run_cost !== void 0 && draft.run_cost !== (draft.cost ?? 0) ? { run_cost: draft.run_cost } : {},
22690
23586
  balance: draft.balance ?? null,
22691
23587
  ...draft.quote !== void 0 ? { quote: draft.quote } : {},
23588
+ ...draft.pricing ? { pricing: draft.pricing } : {},
23589
+ ...draft.credit_breakdown ? { credit_breakdown: draft.credit_breakdown } : {},
22692
23590
  total: draft.total ?? draft.rows?.length ?? 0,
22693
23591
  label: (draft.label ?? "rows").slice(0, 24),
22694
23592
  columns: rows.length ? columns : [],
@@ -22730,12 +23628,19 @@ function toonCell(value) {
22730
23628
  }
22731
23629
  function answerLines(answer) {
22732
23630
  const lines = [`summary: ${answer.summary}`, `status: ${answer.status}`];
23631
+ if (answer.quality) lines.push(`quality: ${qualityText(answer.quality)}`);
22733
23632
  if (answer.reason) lines.push(`reason: ${answer.reason}`);
22734
23633
  if (answer.run_id) lines.push(`run_id: ${answer.run_id}`);
22735
23634
  lines.push(`cost: ${answer.cost}`);
22736
23635
  if (answer.run_cost !== void 0) lines.push(`run_cost: ${answer.run_cost}`);
22737
23636
  if (answer.balance !== null) lines.push(`balance: ${answer.balance}`);
22738
23637
  if (answer.quote !== void 0) lines.push(`quote: ${answer.quote}`);
23638
+ if (answer.pricing) {
23639
+ lines.push(`credit_range: ${formatCreditRange(answer.pricing.range)}`);
23640
+ if (answer.pricing.perQuestion) lines.push(`credits_per_question: ${formatCreditRange(answer.pricing.perQuestion)}`);
23641
+ if (answer.pricing.parts.length) lines.push(`credit_parts: ${answer.pricing.parts.map(({ label, range: [min, max] }) => `${label} ${min === max ? max : `${min} to ${max}`}`).join(", ")}`);
23642
+ }
23643
+ if (answer.credit_breakdown?.length) lines.push(`credit_breakdown: ${answer.credit_breakdown.map(({ label, credits: credits3 }) => `${label} ${credits3}`).join(", ")}`);
22739
23644
  if (answer.replayed) lines.push("replayed: true");
22740
23645
  if (answer.report) lines.push(`report: ${answer.report}`);
22741
23646
  if (answer.estimate) lines.push(`estimate: ${JSON.stringify(answer.estimate)}`);
@@ -22921,6 +23826,41 @@ var agentAccessSchema = external_exports.object({
22921
23826
  default_cap: external_exports.object({ credits: creditCapSchema, period: capPeriodSchema })
22922
23827
  });
22923
23828
 
23829
+ // ../contracts/src/watch-operations.ts
23830
+ var watchIdInput = watchInput.pick({ watch_id: true }).required();
23831
+ var WATCH_OPERATIONS = {
23832
+ create: {
23833
+ title: "Create watch",
23834
+ description: "Create recurring alerts for hiring, headcount, tech stack, funding, topics, or job changes. Use domains or LinkedIn profiles in companies. Give a role for hiring or a search topic for social posts. Quote free with dry_run, then create with quote_id and monthly max_credits.",
23835
+ input: watchInput.pick({ name: true, companies: true, signal: true, role: true, topic: true, sources: true, max_credits: true, quote_id: true, dry_run: true }).required({ name: true }),
23836
+ writes: true,
23837
+ external: true
23838
+ },
23839
+ list: { title: "List watches", description: "List saved watches with their status. Use offset to page.", input: watchInput.pick({ offset: true }) },
23840
+ show: { title: "Show watch", description: "Show a watch's status, next check, and monthly credit usage.", input: watchIdInput },
23841
+ changes: {
23842
+ title: "Read watch changes",
23843
+ description: "Read new changes and notices across watches or for one watch. Pass the previous since cursor to continue.",
23844
+ input: watchInput.pick({ watch_id: true, since: true })
23845
+ },
23846
+ pause: { title: "Pause watch", description: "Pause scheduled checks for a watch.", input: watchIdInput, writes: true },
23847
+ resume: { title: "Resume watch", description: "Restart scheduled checks under the watch's existing monthly credit limit.", input: watchIdInput, writes: true, external: true },
23848
+ delete: { title: "Delete watch", description: "Delete a watch and stop its scheduled checks.", input: watchIdInput, writes: true, destructive: true },
23849
+ webhook_set: {
23850
+ title: "Set watch webhook",
23851
+ description: "Set or replace a watch's HTTPS webhook URL. Returns the new signing secret once.",
23852
+ input: watchIdInput.extend({ url: watchInput.shape.url.unwrap() }),
23853
+ writes: true,
23854
+ // Replacing a webhook stops deliveries to the old URL and invalidates its secret.
23855
+ destructive: true,
23856
+ external: true
23857
+ },
23858
+ webhook_show: { title: "Show watch webhook", description: "Read a watch webhook's URL and delivery status.", input: watchIdInput },
23859
+ webhook_rotate: { title: "Rotate watch webhook secret", description: "Replace a watch webhook's signing secret and reveal the new secret once.", input: watchIdInput, writes: true, destructive: true, external: true },
23860
+ webhook_remove: { title: "Remove watch webhook", description: "Remove the webhook from a watch and stop future deliveries.", input: watchIdInput, writes: true, destructive: true },
23861
+ webhook_test: { title: "Test watch webhook", description: "Queue a signed sample delivery to the watch webhook for free.", input: watchIdInput, writes: true, external: true }
23862
+ };
23863
+
22924
23864
  // ../contracts/src/code-mode.ts
22925
23865
  var CODE_MODE_METHODS = {
22926
23866
  find_contacts: "gtm_find_contacts",
@@ -22930,10 +23870,14 @@ var CODE_MODE_METHODS = {
22930
23870
  find_leads: "gtm_find_leads",
22931
23871
  workspace: "gtm_workspace",
22932
23872
  tools: "gtm_tools",
23873
+ run: "gtm_tools",
22933
23874
  results: "gtm_results",
22934
23875
  account: "gtm_account"
22935
23876
  };
22936
- var CODE_MODE_METHOD_NAMES = [...Object.keys(CODE_MODE_METHODS), "rows"];
23877
+ var CODE_MODE_WATCH_METHODS = Object.fromEntries(
23878
+ Object.keys(WATCH_OPERATIONS).map((action) => [`watch_${action}`, action])
23879
+ );
23880
+ var CODE_MODE_METHOD_NAMES = [...Object.keys(CODE_MODE_METHODS), ...Object.keys(CODE_MODE_WATCH_METHODS), "rows"];
22937
23881
  var CODE_MAX_CHARS = 2e4;
22938
23882
  var executeInput = external_exports.object({
22939
23883
  code: external_exports.string().min(1).max(CODE_MAX_CHARS).describe("Body of an async TypeScript function; return rows or a value"),
@@ -22941,7 +23885,6 @@ var executeInput = external_exports.object({
22941
23885
  idempotency_key: external_exports.string().regex(/^[\x21-\x7e]{8,128}$/).optional().describe("Same key replays the run for free"),
22942
23886
  dry_run: external_exports.boolean().optional().describe("Compile only; nothing runs")
22943
23887
  }).strict();
22944
- var methods = Object.keys(CODE_MODE_METHODS).join(", ").replace(/, (?=[^,]*$)/, " and ");
22945
23888
 
22946
23889
  // ../contracts/src/results-table.ts
22947
23890
  var tableRowsInput = external_exports.object({
@@ -22949,6 +23892,7 @@ var tableRowsInput = external_exports.object({
22949
23892
  offset: external_exports.number().int().min(0).max(1e5).optional()
22950
23893
  }).strict();
22951
23894
  var tableRowsPageSchema = external_exports.object({
23895
+ quality: qualitySummarySchema.optional(),
22952
23896
  run_id: external_exports.string(),
22953
23897
  status: external_exports.enum(AGENT_RUN_STATUSES),
22954
23898
  label: external_exports.string(),
@@ -23021,34 +23965,6 @@ var topupViewSchema = external_exports.object({
23021
23965
  var topupResponseSchema = external_exports.object({ topup: topupViewSchema });
23022
23966
  var agentTopupOptionsSchema = topupOptionsSchema.extend({ allowed: external_exports.boolean(), account: external_exports.string(), max_micros_per_payment: external_exports.number().int() });
23023
23967
 
23024
- // ../contracts/src/coverage.ts
23025
- var coverageRowSchema = external_exports.object({
23026
- capability: external_exports.string(),
23027
- title: external_exports.string(),
23028
- credits: external_exports.number().int().nonnegative(),
23029
- unit: external_exports.string(),
23030
- /** Finished runs in the window; 0 when the sample was too small to publish. */
23031
- runs: external_exports.number().int().nonnegative(),
23032
- succeeded: external_exports.number().int().nonnegative(),
23033
- empty: external_exports.number().int().nonnegative(),
23034
- failed: external_exports.number().int().nonnegative(),
23035
- /** Share of finished runs that returned a result, 0 to 1; null when the sample was too small. */
23036
- successRate: external_exports.number().min(0).max(1).nullable(),
23037
- entityKey: external_exports.string(),
23038
- entityUrl: external_exports.string()
23039
- });
23040
- var publicCoverageSchema = external_exports.object({
23041
- /** UTC date of the snapshot, YYYY-MM-DD. */
23042
- snapshotDay: external_exports.string(),
23043
- windowDays: external_exports.number().int().positive(),
23044
- /** The only wallet whose entities are read; anyone can write look-alike entities. */
23045
- publisher: external_exports.string(),
23046
- network: external_exports.object({ name: external_exports.string(), chainId: external_exports.number().int(), explorerUrl: external_exports.string() }),
23047
- rows: external_exports.array(coverageRowSchema),
23048
- /** This snapshot as a CSV on Swarm; null until its upload succeeds. */
23049
- export: external_exports.object({ swarmRef: external_exports.string(), url: external_exports.string(), sha256: external_exports.string(), rows: external_exports.number().int().nonnegative() }).nullable()
23050
- });
23051
-
23052
23968
  // ../contracts/src/arc.ts
23053
23969
  var arcOptionsSchema = external_exports.object({
23054
23970
  enabled: external_exports.boolean(),
@@ -23085,6 +24001,51 @@ var returnPath = new RegExp([
23085
24001
  `^/outboundmaxing/(?:\\?plan=(?:${planChoices.join("|")}))?$`
23086
24002
  ].join("|"));
23087
24003
 
24004
+ // ../contracts/src/email-sign-in.ts
24005
+ var EMAIL_SIGN_IN = {
24006
+ /** Digits in a code. */
24007
+ codeLength: 6,
24008
+ /** A code stops working after this many minutes. */
24009
+ codeTtlMinutes: 10,
24010
+ /** Wrong guesses allowed on one code before it is locked. */
24011
+ maxAttempts: 5
24012
+ };
24013
+ var signInEmailSchema = external_exports.string().trim().toLowerCase().max(254).pipe(external_exports.email());
24014
+ var emailSignInStartSchema = external_exports.strictObject({
24015
+ email: signInEmailSchema,
24016
+ /** Cloudflare Turnstile token; required only when the deployment turns the check on. */
24017
+ turnstileToken: external_exports.string().min(1).max(4096).optional()
24018
+ });
24019
+ var emailSignInVerifySchema = external_exports.strictObject({
24020
+ email: signInEmailSchema,
24021
+ code: external_exports.string().trim().regex(new RegExp(`^\\d{${EMAIL_SIGN_IN.codeLength}}$`))
24022
+ });
24023
+ var EMAIL_SIGN_IN_ERRORS = [
24024
+ "invalid_email",
24025
+ "disposable_email",
24026
+ "bot_check_failed",
24027
+ "rate_limited",
24028
+ "send_failed",
24029
+ "invalid_code",
24030
+ "code_expired",
24031
+ "too_many_attempts",
24032
+ "account_conflict",
24033
+ "email_sign_in_unavailable"
24034
+ ];
24035
+ var emailSignInErrorSchema = external_exports.object({ error: external_exports.enum(EMAIL_SIGN_IN_ERRORS) });
24036
+ var emailSignInStartResponseSchema = external_exports.object({ sent: external_exports.literal(true) });
24037
+ var signInSessionSchema = external_exports.object({ session: external_exports.string().min(1) });
24038
+ var reviewerSignInSchema = external_exports.strictObject({
24039
+ email: signInEmailSchema,
24040
+ password: external_exports.string().min(1).max(256)
24041
+ });
24042
+ var signInOptionsSchema = external_exports.object({
24043
+ email: external_exports.boolean(),
24044
+ /** Turnstile site key when the bot check is on, else null. */
24045
+ turnstileSiteKey: external_exports.string().nullable(),
24046
+ reviewer: external_exports.literal(true).optional()
24047
+ });
24048
+
23088
24049
  // ../contracts/src/agent-permissions.ts
23089
24050
  var CAP_PERIODS = capPeriodSchema.options;
23090
24051
  var MIN_CAP = creditCapSchema.minValue;
@@ -23164,20 +24125,69 @@ var TOOL_NAV_GROUPS = [
23164
24125
  { title: "Enrichment", icon: "contact" },
23165
24126
  { title: "Lead lists", icon: "social" },
23166
24127
  { title: "Web research", icon: "globe" },
23167
- { title: "Social listening", icon: "social" }
24128
+ { title: "Social listening", icon: "social" },
24129
+ { title: "SEO", icon: "search" }
23168
24130
  ].map((group) => {
23169
24131
  const tools = WEB_TOOLS.filter((tool2) => tool2.section === group.title).sort((a, b) => a.order - b.order);
23170
24132
  const marks = [
23171
24133
  ...group.title === "Enrichment" ? EMAIL_FINDER_DEFINITION.badges : [],
24134
+ // Lead the SEO logo stack with Google organic search's marks.
24135
+ ...group.title === "SEO" ? TOOL_DEFINITIONS["google-search"].badges : [],
23172
24136
  ...tools.flatMap((tool2) => tool2.badges)
23173
24137
  ];
23174
24138
  return {
23175
24139
  ...group,
23176
24140
  tools: [...group.title === "Enrichment" ? ["email-finder"] : [], ...tools.map((tool2) => tool2.id)],
24141
+ ...group.title === "SEO" ? { steps: SEO_STEPS.map((step2) => ({ ...step2, tools: tools.filter((tool2) => "step" in tool2 && tool2.step === step2.id).map((tool2) => tool2.id) })) } : {},
23177
24142
  providers: [...new Map(marks.map((mark) => [mark.name, mark])).values()]
23178
24143
  };
23179
24144
  });
23180
24145
 
24146
+ // ../contracts/src/workspace.ts
24147
+ var WORKSPACE_SEEN_PREVIEW = 50;
24148
+ var entry = (max) => external_exports.string().trim().min(1).max(max);
24149
+ var workspaceViewSchema = external_exports.object({
24150
+ icp: workspaceIcpInput.nullable(),
24151
+ excluded_domains: external_exports.array(external_exports.string()),
24152
+ excluded_profiles: external_exports.array(external_exports.string()),
24153
+ seen: external_exports.object({
24154
+ count: external_exports.number().int().nonnegative(),
24155
+ recent: external_exports.array(external_exports.object({ profile: external_exports.string(), found_at: external_exports.number().int() })).max(WORKSPACE_SEEN_PREVIEW)
24156
+ })
24157
+ });
24158
+ var workspaceIcpSaveSchema = external_exports.object({ icp: external_exports.record(external_exports.string(), external_exports.unknown()) }).strict();
24159
+ var workspaceExclusionsSchema = external_exports.object({
24160
+ domains: external_exports.array(entry(100)).min(1).max(500).optional(),
24161
+ profiles: external_exports.array(entry(300)).min(1).max(500).optional()
24162
+ }).strict().refine((value) => value.domains || value.profiles, "Give domains or profiles.");
24163
+ var workspaceErrorSchema = external_exports.object({ error: external_exports.string(), message: external_exports.string(), field: external_exports.string().optional() });
24164
+
24165
+ // ../contracts/src/mpp-pricing.ts
24166
+ var MPP_PRICES = {
24167
+ finder: 2e4,
24168
+ verifier: 2 * TOOL_DEFINITIONS["verify-email"].credits * CREDIT_ATOMIC
24169
+ };
24170
+
24171
+ // ../contracts/src/mpp.ts
24172
+ var mppFinderInput = external_exports.union([
24173
+ external_exports.object({ profile: external_exports.string().trim().min(1).max(2048) }).strict(),
24174
+ external_exports.object({ name: external_exports.string().trim().min(1).max(100), company: external_exports.string().trim().min(1).max(100) }).strict()
24175
+ ]);
24176
+ var mppVerifierInput = external_exports.object({ email: external_exports.email().max(254) }).strict();
24177
+ var mppFinderResult = external_exports.object({
24178
+ status: external_exports.enum(["found", "not_found"]),
24179
+ email: external_exports.string().nullable(),
24180
+ name: external_exports.string().nullable(),
24181
+ title: external_exports.string().nullable(),
24182
+ deliverability: external_exports.literal("verified").nullable()
24183
+ }).strict();
24184
+ var mppVerifierResult = external_exports.object({
24185
+ email: external_exports.string(),
24186
+ verdict: external_exports.enum(["valid", "invalid", "accept_all", "unknown", "webmail", "disposable"]),
24187
+ score: external_exports.number().nullable(),
24188
+ checkedAt: external_exports.string().nullable()
24189
+ }).strict();
24190
+
23181
24191
  // ../contracts/src/index.ts
23182
24192
  var historySourceSchema = external_exports.enum(["web", "agent"]);
23183
24193
  var lookupRunItemSchema = external_exports.object({
@@ -23304,14 +24314,14 @@ var GLOBAL = {
23304
24314
  var PAID = { "max-credits": { type: "string" }, "dry-run": { type: "boolean" }, "idempotency-key": { type: "string" } };
23305
24315
  var FILTERS = { industry: { type: "string", multiple: true }, size: { type: "string", multiple: true } };
23306
24316
  var SPECS = {
23307
- watch: { signal: { type: "string" }, topic: { type: "string" }, source: { type: "string", multiple: true }, url: { type: "string" }, name: { type: "string" }, company: { type: "string", multiple: true }, hiring: { type: "string" }, file: { type: "string" }, column: { type: "string" }, watch: { type: "string" }, since: { type: "string" }, offset: { type: "string" }, "quote-id": { type: "string" }, yes: { type: "boolean" }, new: { type: "boolean" }, csv: { type: "boolean" }, ...PAID },
24317
+ watch: { signal: { type: "string" }, topic: { type: "string" }, source: { type: "string", multiple: true }, url: { type: "string" }, name: { type: "string" }, company: { type: "string", multiple: true }, person: { type: "string", multiple: true }, hiring: { type: "string" }, file: { type: "string" }, column: { type: "string" }, watch: { type: "string" }, since: { type: "string" }, offset: { type: "string" }, "quote-id": { type: "string" }, yes: { type: "boolean" }, new: { type: "boolean" }, csv: { type: "boolean" }, ...PAID },
23308
24318
  login: { "no-browser": { type: "boolean" } },
23309
24319
  logout: {},
23310
24320
  whoami: {},
23311
24321
  "auth-header": {},
23312
24322
  contacts: { file: { type: "string" }, column: { type: "string" }, out: { type: "string" }, "run-id": { type: "string" }, target: { type: "string" }, find: { type: "string", multiple: true }, verify: { type: "boolean" }, ...PAID },
23313
24323
  list: { titles: { type: "string", multiple: true }, company: { type: "string", multiple: true }, location: { type: "string" }, "business-type": { type: "string" }, ...FILTERS, keywords: { type: "string", multiple: true }, page: { type: "string" }, limit: { type: "string" }, ...PAID },
23314
- leads: { titles: { type: "string", multiple: true }, location: { type: "string" }, ...FILTERS, keywords: { type: "string", multiple: true }, "hiring-role": { type: "string", multiple: true }, funded: { type: "boolean" }, like: { type: "string", multiple: true }, post: { type: "string", multiple: true }, target: { type: "string" }, "max-per-company": { type: "string" }, verify: { type: "boolean" }, ...PAID },
24324
+ leads: { "exclude-domain": { type: "string", multiple: true }, titles: { type: "string", multiple: true }, location: { type: "string" }, ...FILTERS, keywords: { type: "string", multiple: true }, "hiring-role": { type: "string", multiple: true }, funded: { type: "boolean" }, like: { type: "string", multiple: true }, post: { type: "string", multiple: true }, target: { type: "string" }, "max-per-company": { type: "string" }, verify: { type: "boolean" }, ...PAID },
23315
24325
  workspace: { titles: { type: "string", multiple: true }, location: { type: "string" }, ...FILTERS, keywords: { type: "string", multiple: true }, notes: { type: "string" }, domain: { type: "string", multiple: true }, profile: { type: "string", multiple: true } },
23316
24326
  research: { ...PAID },
23317
24327
  signals: { location: { type: "string" }, company: { type: "string" }, ...FILTERS, page: { type: "string" }, limit: { type: "string" }, ...PAID },
@@ -23375,6 +24385,7 @@ var ARGUMENT_NAMES = {
23375
24385
  like: "like_companies",
23376
24386
  post: "post_urls",
23377
24387
  domain: "domains",
24388
+ "exclude-domain": "exclude_domains",
23378
24389
  hiring: "role",
23379
24390
  source: "sources",
23380
24391
  watch: "watch_id",
@@ -23395,20 +24406,25 @@ function build2(name, values, positionals) {
23395
24406
  const [action, id, ...extra] = positionals;
23396
24407
  if (!action || !["create", "list", "show", "changes", "pause", "resume", "delete", "webhook_set", "webhook_show", "webhook_rotate", "webhook_remove", "webhook_test"].includes(action) || extra.length) throw new UsageError("Use gtm watch create|list|show|changes|pause|resume|delete.", name);
23397
24408
  const mutating = ["show", "pause", "resume", "delete"].includes(action) || action.startsWith("webhook_");
23398
- if (mutating && !id || !mutating && id) throw new UsageError("Show, pause, resume and delete take one watch id; other actions take flags.", name);
23399
- const file2 = str(values, "file"), column = str(values, "column");
24409
+ const flagged = mutating ? str(values, "watch") : void 0;
24410
+ if (id && flagged && id !== flagged) throw new UsageError("Give the watch id once, either as ID or as --watch ID.", name);
24411
+ const watchId = id ?? flagged;
24412
+ if (mutating && !watchId || !mutating && id) throw new UsageError("Show, pause, resume and delete take one watch id; other actions take flags.", name);
24413
+ if (values.person) values.company = [...values.company ?? [], ...values.person];
24414
+ const file2 = str(values, "file"), column2 = str(values, "column");
23400
24415
  if (file2 && values.company) throw new UsageError("Give --company or --file, not both.", name);
23401
- if (column && !file2) throw new UsageError("--column needs --file.", name);
23402
- if (action !== "create" && ["signal", "name", "company", "hiring", "topic", "source", "file", "column", "yes", "max-credits", "dry-run", "quote-id"].some((flag) => values[flag] !== void 0)) throw new UsageError("Creation flags need gtm watch create.", name);
24416
+ if (column2 && !file2) throw new UsageError("--column needs --file.", name);
24417
+ if (action !== "create" && ["signal", "name", "company", "person", "hiring", "topic", "source", "file", "column", "yes", "max-credits", "dry-run", "quote-id"].some((flag) => values[flag] !== void 0)) throw new UsageError("Creation flags need gtm watch create.", name);
23403
24418
  const topic = str(values, "topic"), sources = values.source;
23404
24419
  if (topic === void 0 && sources) throw new UsageError("--source needs --topic.", name);
23405
24420
  if (topic !== void 0 && (values.company || file2 || values.hiring !== void 0 || (str(values, "signal") ?? "topic") !== "topic")) throw new UsageError("A topic watch takes --topic and --source only, not companies, a role or another signal.", name);
24421
+ if (str(values, "signal") === "job-change" && (values.hiring !== void 0 || topic !== void 0)) throw new UsageError("A job-change watch takes LinkedIn profiles through --person or --file, not a role or a topic.", name);
23406
24422
  const chosen = sources ? sources.flatMap((source) => source === "both" ? ["x", "reddit"] : [source]) : ["x", "reddit"];
23407
24423
  if (chosen.some((source) => source !== "x" && source !== "reddit")) throw new UsageError("Use --source x, --source reddit or --source both.", name);
23408
- if (action !== "changes" && ["new", "csv", "since", "watch"].some((flag) => values[flag] !== void 0)) throw new UsageError("Feed flags need gtm watch changes.", name);
24424
+ if (action !== "changes" && ["new", "csv", "since", ...mutating ? [] : ["watch"]].some((flag) => values[flag] !== void 0)) throw new UsageError("Feed flags need gtm watch changes.", name);
23409
24425
  if (values.new && values.since !== void 0) throw new UsageError("Use --new or --since, not both.", name);
23410
24426
  const since = int2(values, "since", name), offset = int2(values, "offset", name);
23411
- return { kind: "watch", args: { action, ...topic !== void 0 ? { signal: "topic", topic, sources: [...new Set(chosen)] } : {}, ...str(values, "signal") && topic === void 0 ? { signal: str(values, "signal") } : {}, ...str(values, "url") ? { url: str(values, "url") } : {}, ...id ? { watch_id: id } : {}, ...str(values, "watch") ? { watch_id: str(values, "watch") } : {}, ...str(values, "name") ? { name: str(values, "name") } : {}, ...values.company ? { companies: values.company } : {}, ...str(values, "hiring") ? { role: str(values, "hiring") } : {}, ...str(values, "quote-id") ? { quote_id: str(values, "quote-id") } : {}, ...since !== void 0 ? { since } : {}, ...offset !== void 0 ? { offset } : {}, ...paid(values, name) }, yes: values.yes === true, fresh: values.new === true, csv: values.csv === true, ...file2 ? { file: file2 } : {}, ...column ? { column } : {} };
24427
+ return { kind: "watch", args: { action, ...topic !== void 0 ? { signal: "topic", topic, sources: [...new Set(chosen)] } : {}, ...str(values, "signal") && topic === void 0 ? { signal: str(values, "signal") } : {}, ...str(values, "url") ? { url: str(values, "url") } : {}, ...watchId ? { watch_id: watchId } : {}, ...!mutating && str(values, "watch") ? { watch_id: str(values, "watch") } : {}, ...str(values, "name") ? { name: str(values, "name") } : {}, ...values.company ? { companies: values.company } : {}, ...str(values, "hiring") ? { role: str(values, "hiring") } : {}, ...str(values, "quote-id") ? { quote_id: str(values, "quote-id") } : {}, ...since !== void 0 ? { since } : {}, ...offset !== void 0 ? { offset } : {}, ...paid(values, name) }, yes: values.yes === true, fresh: values.new === true, csv: values.csv === true, ...file2 ? { file: file2 } : {}, ...column2 ? { column: column2 } : {} };
23412
24428
  }
23413
24429
  case "login":
23414
24430
  none("gtm login takes no arguments.");
@@ -23439,9 +24455,9 @@ function build2(name, values, positionals) {
23439
24455
  ...values.verify ? { verify: true } : {},
23440
24456
  ...paid(values, name)
23441
24457
  };
23442
- const column = str(values, "column");
24458
+ const column2 = str(values, "column");
23443
24459
  const out = str(values, "out");
23444
- return { kind: "contacts", args, ...file2 !== void 0 ? { file: file2 } : {}, ...column !== void 0 ? { column } : {}, ...out !== void 0 ? { out } : {} };
24460
+ return { kind: "contacts", args, ...file2 !== void 0 ? { file: file2 } : {}, ...column2 !== void 0 ? { column: column2 } : {}, ...out !== void 0 ? { out } : {} };
23445
24461
  }
23446
24462
  case "list": {
23447
24463
  none("gtm list takes flags only, like --titles 'VP Sales'.");
@@ -23454,7 +24470,7 @@ function build2(name, values, positionals) {
23454
24470
  none("gtm leads takes flags only, like --titles 'Head of Sales' --target N.");
23455
24471
  const target2 = int2(values, "target", name);
23456
24472
  const perCompany = int2(values, "max-per-company", name);
23457
- return { kind: "tool", tool: "gtm_find_leads", args: { ...pick2(values, ["titles", "location", "industry", "size", "keywords", "hiring-role", "like", "post"]), ...values.funded ? { recently_funded: true } : {}, ...target2 !== void 0 ? { target: target2 } : {}, ...perCompany !== void 0 ? { max_per_company: perCompany } : {}, ...values.verify ? { verify: true } : {}, ...paid(values, name) } };
24473
+ return { kind: "tool", tool: "gtm_find_leads", args: { ...pick2(values, ["titles", "location", "industry", "size", "keywords", "hiring-role", "like", "post", "exclude-domain"]), ...values.funded ? { recently_funded: true } : {}, ...target2 !== void 0 ? { target: target2 } : {}, ...perCompany !== void 0 ? { max_per_company: perCompany } : {}, ...values.verify ? { verify: true } : {}, ...paid(values, name) } };
23458
24474
  }
23459
24475
  case "workspace": {
23460
24476
  const action = positionals[0] ?? "get";
@@ -23504,10 +24520,10 @@ function build2(name, values, positionals) {
23504
24520
  if (!input2 || typeof input2 !== "object" || Array.isArray(input2)) throw new UsageError("--input needs a JSON object.", name);
23505
24521
  }
23506
24522
  const file2 = str(values, "file");
23507
- const column = str(values, "column");
24523
+ const column2 = str(values, "column");
23508
24524
  const out = str(values, "out");
23509
- if (file2 === void 0 && (column !== void 0 || out !== void 0)) throw new UsageError("--column and --out need --file.", name);
23510
- if (file2 !== void 0) return { kind: "tool-file", capability: words[0], input: input2 ?? {}, args: budget, file: file2, ...column !== void 0 ? { column } : {}, ...out !== void 0 ? { out } : {} };
24525
+ if (file2 === void 0 && (column2 !== void 0 || out !== void 0)) throw new UsageError("--column and --out need --file.", name);
24526
+ if (file2 !== void 0) return { kind: "tool-file", capability: words[0], input: input2 ?? {}, args: budget, file: file2, ...column2 !== void 0 ? { column: column2 } : {}, ...out !== void 0 ? { out } : {} };
23511
24527
  return { kind: "tool", tool: "gtm_tools", args: { action, capability: words[0], ...input2 !== void 0 ? { input: input2 } : {}, ...budget } };
23512
24528
  }
23513
24529
  throw new UsageError("Use gtm tools search <words>, gtm tools describe <capability> or gtm tools run <capability>.", name);
@@ -23516,17 +24532,17 @@ function build2(name, values, positionals) {
23516
24532
  const [sub, capability, ...extra] = positionals;
23517
24533
  const count = int2(values, "count", name);
23518
24534
  const file2 = str(values, "file");
23519
- const column = str(values, "column");
24535
+ const column2 = str(values, "column");
23520
24536
  if (sub === void 0) {
23521
- if (count !== void 0 || file2 !== void 0 || column !== void 0) throw new UsageError("Use gtm account quote to price a batch.", name);
24537
+ if (count !== void 0 || file2 !== void 0 || column2 !== void 0) throw new UsageError("Use gtm account quote to price a batch.", name);
23522
24538
  return { kind: "tool", tool: "gtm_account", args: {} };
23523
24539
  }
23524
24540
  if (sub !== "quote" || extra.length) throw new UsageError("Use gtm account, or gtm account quote <capability> --count N, or gtm account quote --file leads.csv.", name);
23525
24541
  if (file2 !== void 0) {
23526
24542
  if (count !== void 0) throw new UsageError("Give --count or --file, not both.", name);
23527
- return { kind: "quote-file", capability: capability ?? "email-finder", file: file2, ...column !== void 0 ? { column } : {} };
24543
+ return { kind: "quote-file", capability: capability ?? "email-finder", file: file2, ...column2 !== void 0 ? { column: column2 } : {} };
23528
24544
  }
23529
- if (column !== void 0) throw new UsageError("--column needs --file.", name);
24545
+ if (column2 !== void 0) throw new UsageError("--column needs --file.", name);
23530
24546
  if (!capability || count === void 0) throw new UsageError("Give a capability and --count, like gtm account quote email-finder --count 500.", name);
23531
24547
  return { kind: "tool", tool: "gtm_account", args: { quote: { capability, count } } };
23532
24548
  }
@@ -23554,7 +24570,7 @@ function commandArgv(next) {
23554
24570
  case "gtm_watch": {
23555
24571
  const action = take("action");
23556
24572
  push(action);
23557
- if (["pause", "resume", "delete"].includes(String(action)) || String(action).startsWith("webhook_")) push(take("watch_id"));
24573
+ if (["show", "pause", "resume", "delete"].includes(String(action)) || String(action).startsWith("webhook_")) push(take("watch_id"));
23558
24574
  const companies = take("companies");
23559
24575
  if (Array.isArray(companies)) for (const company of companies) words.push("--company", String(company));
23560
24576
  if (action === "create" && args.quote_id !== void 0 && args.max_credits !== void 0) args.yes = true;
@@ -23664,16 +24680,16 @@ var HEADER_WORDS = /^(linkedin|linkedin[ _-]?(url|profile|profile[ _-]?url|handl
23664
24680
  function profileOf(value) {
23665
24681
  return cliProfileUrl(value);
23666
24682
  }
23667
- function profilesFromCsv(text5, column) {
24683
+ function profilesFromCsv(text5, column2) {
23668
24684
  const table = parseCsv(text5).filter((row) => row.some((cell2) => cell2.trim() !== ""));
23669
24685
  if (!table.length) throw new FileInputError("The file has no rows.");
23670
24686
  const first = table[0];
23671
24687
  const width = Math.max(...table.map((row) => row.length));
23672
24688
  let header = first.some((cell2) => PROFILE_URL.test(cell2)) ? null : first;
23673
24689
  let index;
23674
- if (column !== void 0) {
23675
- index = header ? header.findIndex((name) => name.trim().toLowerCase() === column.trim().toLowerCase()) : -1;
23676
- if (index < 0) throw new FileInputError(`No column named "${column}"; the columns are ${header ? header.map((name) => name.trim()).join(", ") : "not named in this file"}.`);
24690
+ if (column2 !== void 0) {
24691
+ index = header ? header.findIndex((name) => name.trim().toLowerCase() === column2.trim().toLowerCase()) : -1;
24692
+ if (index < 0) throw new FileInputError(`No column named "${column2}"; the columns are ${header ? header.map((name) => name.trim()).join(", ") : "not named in this file"}.`);
23677
24693
  } else {
23678
24694
  const counts = Array.from({ length: width }, (_, i) => table.filter((row) => PROFILE_URL.test(row[i] ?? "")).length);
23679
24695
  const best = Math.max(...counts);
@@ -23704,12 +24720,12 @@ function profilesFromCsv(text5, column) {
23704
24720
  }
23705
24721
  return list;
23706
24722
  }
23707
- function peopleFromCsv(text5, column, names) {
24723
+ function peopleFromCsv(text5, column2, names) {
23708
24724
  if (names === "only") return { ...nameListAsProfiles(namesFromCsv(text5)), named: true };
23709
24725
  try {
23710
- return { ...profilesFromCsv(text5, column), named: false };
24726
+ return { ...profilesFromCsv(text5, column2), named: false };
23711
24727
  } catch (error61) {
23712
- if (names === "never" || column !== void 0 || !(error61 instanceof FileInputError)) throw error61;
24728
+ if (names === "never" || column2 !== void 0 || !(error61 instanceof FileInputError)) throw error61;
23713
24729
  return { ...nameListAsProfiles(namesFromCsv(text5)), named: true };
23714
24730
  }
23715
24731
  }
@@ -23758,6 +24774,8 @@ function namesFromCsv(text5) {
23758
24774
  }
23759
24775
 
23760
24776
  // src/watch.ts
24777
+ var COMPANY_COLUMNS = ["domain", "company_domain", "website"];
24778
+ var PROFILE_COLUMNS = ["linkedin_url", "linkedin", "profile_url", "profile", "url"];
23761
24779
  async function watchCommand(session, command) {
23762
24780
  const args = { ...command.args };
23763
24781
  if (args.action === "create") {
@@ -23765,18 +24783,19 @@ async function watchCommand(session, command) {
23765
24783
  const [headers = [], ...rows] = parseCsv(
23766
24784
  await session.readInput(command.file, "watch")
23767
24785
  );
23768
- const column = command.column ?? headers.find(
23769
- (h) => ["domain", "company_domain", "website"].includes(h.toLowerCase())
24786
+ const people = args.signal === "job-change";
24787
+ const column2 = command.column ?? headers.find(
24788
+ (h) => (people ? PROFILE_COLUMNS : COMPANY_COLUMNS).includes(h.toLowerCase())
23770
24789
  );
23771
- const at = column ? headers.indexOf(column) : -1;
24790
+ const at = column2 ? headers.indexOf(column2) : -1;
23772
24791
  if (at < 0)
23773
24792
  throw new UsageError(
23774
- "Company CSV needs a domain column, or --column NAME.",
24793
+ people ? "People CSV needs a linkedin_url, profile or url column, or --column NAME." : "Company CSV needs a domain column, or --column NAME.",
23775
24794
  "watch"
23776
24795
  );
23777
24796
  args.companies = rows.map((row) => row[at]?.trim()).filter(Boolean);
23778
24797
  }
23779
- const validated = args.signal === "topic" ? topicWatchQuote.safeParse({ name: args.name, signal: "topic", topic: args.topic, sources: args.sources }) : hiringWatchQuote.safeParse({
24798
+ const validated = args.signal === "topic" ? topicWatchQuote.safeParse({ name: args.name, signal: "topic", topic: args.topic, sources: args.sources }) : args.signal === "job-change" ? jobChangeWatchQuote.safeParse({ name: args.name, signal: "job-change", companies: args.companies }) : hiringWatchQuote.safeParse({
23780
24799
  name: args.name,
23781
24800
  companies: args.companies,
23782
24801
  ...args.role ? { role: args.role } : {},
@@ -23784,7 +24803,7 @@ async function watchCommand(session, command) {
23784
24803
  });
23785
24804
  if (!validated.success)
23786
24805
  throw new UsageError(
23787
- args.signal === "topic" ? "Give --name and --topic as a phrase or search syntax that X and Reddit accept, with --source x, reddit or both." : "Give --name, up to 200 company domains through --company or --file, and --hiring ROLE or --signal headcount, tech-stack or funding.",
24806
+ args.signal === "topic" ? "Give --name and --topic as a phrase or search syntax that X and Reddit accept, with --source x, reddit or both." : args.signal === "job-change" ? "Give --name and up to 200 LinkedIn profile URLs through --person or --file, with --signal job-change." : "Give --name, up to 200 company domains through --company or --file, and --hiring ROLE or --signal headcount, tech-stack or funding.",
23788
24807
  "watch"
23789
24808
  );
23790
24809
  Object.assign(args, validated.data);
@@ -24048,7 +25067,7 @@ function errorAnswer(error61) {
24048
25067
 
24049
25068
  // src/contacts.ts
24050
25069
  var NOT_WRITTEN_RUNNING = "not written: still running";
24051
- var plural = (n2, one, many = `${one}s`) => `${n2} ${n2 === 1 ? one : many}`;
25070
+ var plural = (n3, one, many = `${one}s`) => `${n3} ${n3 === 1 ? one : many}`;
24052
25071
  async function contacts(session, command) {
24053
25072
  const args = { ...command.args };
24054
25073
  if (command.file === void 0) {
@@ -24161,7 +25180,7 @@ async function combined(session, command, run, total, budget, rerun, fileFields)
24161
25180
  const wantsEmail = find.includes("email");
24162
25181
  const wantsPhone = find.includes("phone");
24163
25182
  const foundText = [...wantsEmail ? [`${emails} of ${sent} emails`] : [], ...wantsPhone ? [`${phones} of ${sent} mobiles`] : []].join(" and ");
24164
- const verdicts = ["verified", "deliverable", "invalid"].map((verdict) => [verdict, table?.rows.filter((row) => row.verdict === verdict).length ?? 0]).filter(([, n2]) => n2 > 0);
25183
+ const verdicts = ["verified", "deliverable", "invalid"].map((verdict) => [verdict, table?.rows.filter((row) => row.verdict === verdict).length ?? 0]).filter(([, n3]) => n3 > 0);
24165
25184
  let summary;
24166
25185
  if (run.running) {
24167
25186
  summary = `Batch ${batches.length} is still running after ${sent} of ${total} people; rerun this command to wait and continue.`;
@@ -24172,7 +25191,7 @@ async function combined(session, command, run, total, budget, rerun, fileFields)
24172
25191
  summary = `Stopped ${why} after ${sent} of ${total} people${table ? `: found ${wantsEmail ? plural(emails, "email") : plural(phones, "mobile")}` : ""}; ${unsent} were not sent.`;
24173
25192
  } else if (table) {
24174
25193
  const misses = sent - found;
24175
- summary = `Found ${foundText} across ${batches.length} batches${verdicts.length ? `: ${verdicts.map(([verdict, n2]) => `${n2} ${verdict}`).join(", ")}` : ""}${misses ? `; ${plural(misses, "miss", "misses")} ${misses === 1 ? "was" : "were"} free` : ""}.`;
25194
+ summary = `Found ${foundText} across ${batches.length} batches${verdicts.length ? `: ${verdicts.map(([verdict, n3]) => `${n3} ${verdict}`).join(", ")}` : ""}${misses ? `; ${plural(misses, "miss", "misses")} ${misses === 1 ? "was" : "were"} free` : ""}.`;
24176
25195
  } else {
24177
25196
  summary = `Ran ${batches.length} batches of ${sent} people for ${plural(runCost, "credit")}; page each run with gtm results.`;
24178
25197
  }
@@ -24206,7 +25225,7 @@ async function combined(session, command, run, total, budget, rerun, fileFields)
24206
25225
  }
24207
25226
 
24208
25227
  // src/tools-file.ts
24209
- var plural2 = (n2, one, many = `${one}s`) => `${n2} ${n2 === 1 ? one : many}`;
25228
+ var plural2 = (n3, one, many = `${one}s`) => `${n3} ${n3 === 1 ? one : many}`;
24210
25229
  async function toolFile(session, command) {
24211
25230
  const definition = CAPABILITIES[command.capability];
24212
25231
  if (!definition?.batch) throw new UsageError(`gtm tools run ${command.capability} does not take --file; it runs one input at a time.`, "tools");
@@ -24311,7 +25330,7 @@ async function toolFile(session, command) {
24311
25330
  import { randomUUID } from "node:crypto";
24312
25331
 
24313
25332
  // src/version.ts
24314
- var VERSION = "0.1.9";
25333
+ var VERSION = "0.1.11";
24315
25334
 
24316
25335
  // src/gateway.ts
24317
25336
  var CliError = class extends Error {
@@ -24367,8 +25386,8 @@ var Gateway = class {
24367
25386
  */
24368
25387
  async watchCsv(since, watch) {
24369
25388
  if (!this.token) throw new CliError("not_signed_in", "Not signed in; run gtm login.");
24370
- const query = new URLSearchParams({ since: String(since), ...watch ? { watch_id: watch } : {} });
24371
- const { response } = await this.send(`/v1/agent/watches/changes.csv?${query}`, { headers: { authorization: `Bearer ${this.token}` } }, "safe");
25389
+ const query2 = new URLSearchParams({ since: String(since), ...watch ? { watch_id: watch } : {} });
25390
+ const { response } = await this.send(`/v1/agent/watches/changes.csv?${query2}`, { headers: { authorization: `Bearer ${this.token}` } }, "safe");
24372
25391
  if (!response.ok) throw await this.failure(response);
24373
25392
  const cursor = Number(response.headers.get("x-gtm-cursor"));
24374
25393
  if (!Number.isSafeInteger(cursor) || cursor < since) throw new CliError("invalid_response", "Invalid watch cursor.");
@@ -24411,18 +25430,18 @@ var Gateway = class {
24411
25430
  }
24412
25431
  /** A signed CSV link from gtm_results; the link is its own authorization, so no token is sent. */
24413
25432
  async download(link) {
24414
- let url2;
25433
+ let url3;
24415
25434
  try {
24416
- url2 = new URL(link);
25435
+ url3 = new URL(link);
24417
25436
  } catch {
24418
25437
  throw new CliError("export_failed", "The CSV link was not a URL; run gtm results with --link to see it.");
24419
25438
  }
24420
- if (url2.protocol !== "https:" && url2.protocol !== "http:") throw new CliError("export_failed", "The CSV link was not a web address.");
25439
+ if (url3.protocol !== "https:" && url3.protocol !== "http:") throw new CliError("export_failed", "The CSV link was not a web address.");
24421
25440
  let response;
24422
25441
  try {
24423
- ({ response } = await this.send(url2.toString(), { headers: { accept: "text/csv" } }, "safe"));
25442
+ ({ response } = await this.send(url3.toString(), { headers: { accept: "text/csv" } }, "safe"));
24424
25443
  } catch {
24425
- throw new CliError("network", `Could not reach ${url2.origin} to download the CSV.`, true);
25444
+ throw new CliError("network", `Could not reach ${url3.origin} to download the CSV.`, true);
24426
25445
  }
24427
25446
  if (!response.ok) throw new CliError("export_failed", "The CSV download failed; ask for a fresh link with gtm results.");
24428
25447
  return response.text();
@@ -24452,22 +25471,22 @@ var Gateway = class {
24452
25471
  * API; a full URL is a CSV link.
24453
25472
  */
24454
25473
  async send(path, init, replay) {
24455
- const url2 = /^https?:/.test(path) ? path : `${this.apiUrl}${path}`;
25474
+ const url3 = /^https?:/.test(path) ? path : `${this.apiUrl}${path}`;
24456
25475
  const tried = { limited: 0, failed: 0 };
24457
25476
  for (; ; ) {
24458
25477
  const resent = tried.limited + tried.failed > 0;
24459
25478
  let attempt;
24460
25479
  try {
24461
- attempt = { kind: "answered", response: await this.io.fetch(url2, { ...init, headers: { ...init.headers, "user-agent": `gtmmaxing-cli/${VERSION}` } }) };
25480
+ attempt = { kind: "answered", response: await this.io.fetch(url3, { ...init, headers: { ...init.headers, "user-agent": `gtmmaxing-cli/${VERSION}` } }) };
24462
25481
  } catch {
24463
25482
  attempt = { kind: "dropped" };
24464
25483
  }
24465
- const step = nextStep(attempt, replay, tried);
24466
- if (step.kind === "give_up") throw new CliError("network", `Could not reach ${this.apiUrl}; check the connection or --api-url.`, replay === "safe");
24467
- if (step.kind === "return") return { response: attempt.response, resent };
24468
- tried[step.counter] += 1;
25484
+ const step2 = nextStep(attempt, replay, tried);
25485
+ if (step2.kind === "give_up") throw new CliError("network", `Could not reach ${this.apiUrl}; check the connection or --api-url.`, replay === "safe");
25486
+ if (step2.kind === "return") return { response: attempt.response, resent };
25487
+ tried[step2.counter] += 1;
24469
25488
  if (attempt.kind === "answered") await attempt.response.body?.cancel();
24470
- await this.io.sleep(step.seconds * 1e3);
25489
+ await this.io.sleep(step2.seconds * 1e3);
24471
25490
  }
24472
25491
  }
24473
25492
  async failure(response) {
@@ -24506,16 +25525,39 @@ var DEPLOYMENT = {
24506
25525
  origin: "https://gtmmaxing.com",
24507
25526
  legacyOrigins: ["https://www.gtmmaxing.com", "https://gtm.getbags.app"],
24508
25527
  pagesOrigin: "https://found-web.pages.dev",
24509
- redirects: "/admin /admin/ 301\n/e/* /event/ 200\n"
25528
+ redirects: "/admin /admin/ 301\n/coverage /tools/ 301\n/coverage/ /tools/ 301\n/e/* /event/ 200\n"
24510
25529
  },
24511
25530
  api: API_ORIGINS,
24512
25531
  traction: { origin: "https://traction.gtmmaxing.com", pagesOrigin: "https://found-traction.pages.dev" },
24513
25532
  corsOrigins: ["https://gtmmaxing.com", "https://gtm.getbags.app", "https://found-web.pages.dev", "http://localhost:4321", "http://127.0.0.1:4321", "http://localhost:4322", "http://127.0.0.1:4322"],
24514
25533
  database: { binding: "DB", database_name: "found-lookup-db", database_id: "f8656765-79e1-4164-8c35-18108946c936" },
24515
25534
  telemetry: TELEMETRY_ROUTES,
25535
+ observability: {
25536
+ enabled: true,
25537
+ head_sampling_rate: 1,
25538
+ redact_query_string: true,
25539
+ issues: { enabled: true },
25540
+ logs: { enabled: true },
25541
+ traces: { enabled: true }
25542
+ },
25543
+ metrics: { binding: "METRICS", dataset: "gtm_metrics" },
25544
+ analyticsAccountId: "d5addfff98319ee236259e234106087d",
24516
25545
  agentGateway: { webFlag: "PUBLIC_AGENT_GATEWAY", webValue: "1", runtimeFlag: "AGENT_GATEWAY_ENABLED", runtimeValue: "true" },
24517
25546
  cache: { productionMode: "live", namespacePrefix: "mode:", historicalLiveNamespace: "mode:live:blitz" },
24518
25547
  watchWorkflow: { binding: "GTM_WATCH_WORKFLOW", name: "gtm-hiring-watches", class_name: "GtmWatchWorkflow" },
25548
+ x402Wallet: { lowUsd: "2" },
25549
+ payPerCall: { x402Network: "base" },
25550
+ fundsAlerts: {
25551
+ sender: "alerts@getbags.app",
25552
+ destination: "vedant@getbags.app",
25553
+ binding: { name: "ALERT_EMAIL", allowed_sender_addresses: ["alerts@getbags.app"] }
25554
+ },
25555
+ /** Email sign-in codes, sent from the auth.gtmmaxing.com sending subdomain (Cloudflare Email Sending), which leaves the apex Porkbun mail forwarding untouched. */
25556
+ signInEmail: {
25557
+ sender: "signin@auth.gtmmaxing.com",
25558
+ senderName: "GTMMAXING",
25559
+ binding: { name: "SIGN_IN_EMAIL", allowed_sender_addresses: ["signin@auth.gtmmaxing.com"] }
25560
+ },
24519
25561
  keeper: {
24520
25562
  crons: ["0 * * * *"],
24521
25563
  rpcUrls: BASE_RPC_URLS,
@@ -24566,8 +25608,8 @@ var COMMON = [
24566
25608
  var tool = (name) => `${OUTCOME_TOOLS[name].description} (Agent tool: ${name}.)`;
24567
25609
  var TOPICS = {
24568
25610
  watch: {
24569
- summary: "Company and topic watches; quote first, charge only changes",
24570
- lines: ["Usage:", " gtm watch create --name Sales --company acme.com --hiring SDR --dry-run", " gtm watch create --name Sales --file companies.csv --hiring SDR --max-credits N --yes", " gtm watch create --name Stack --company acme.com --signal tech-stack --max-credits N --yes", " gtm watch create --name Growth --company acme.com --signal headcount --max-credits N --yes", " gtm watch create --name Rounds --file companies.csv --signal funding --max-credits N --yes", " gtm watch create --name Buyers --topic 'CRM for agencies' [--source x|reddit|both] --max-credits N --yes", " gtm watch list [--offset N]", " gtm watch show ID", " gtm watch changes [--watch ID] [--since N | --new] [--csv]", " gtm watch pause|resume|delete ID", " gtm watch webhook_set ID --url https://hooks.acme.com/signals Save or replace the address; prints a signing secret once", " gtm watch webhook_show ID Show the address and whether delivery is active or failing; never the secret", " gtm watch webhook_test ID Send a signed test delivery that carries no changes", " gtm watch webhook_rotate ID Make a new signing secret, printed once", " gtm watch webhook_remove ID Stop delivering to the address", "", "Webhook deliveries and tests use no credits. Setup and signature check: docs/watch-webhooks.md.", "", tool("gtm_watch"), "A monthly limit is mandatory. The first check is a free baseline. No cadence option.", "A topic watch checks X and Reddit weekly and charges only new qualifying posts.", "--yes confirms after the free quote; without it, interactive terminals ask for confirmation.", "--new saves a cursor per server, credential and watch under GTM_CONFIG_DIR.", "CSV contains full rows; the ordinary answer is a compact preview."]
25611
+ summary: "Company, people and topic watches; quote first, charge only changes",
25612
+ lines: ["Usage:", " gtm watch create --name Sales --company acme.com --hiring SDR --dry-run", " gtm watch create --name Sales --file companies.csv --hiring SDR --max-credits N --yes", " gtm watch create --name Stack --company acme.com --signal tech-stack --max-credits N --yes", " gtm watch create --name Growth --company acme.com --signal headcount --max-credits N --yes", " gtm watch create --name Rounds --file companies.csv --signal funding --max-credits N --yes", " gtm watch create --name Champions --file people.csv --signal job-change --max-credits N --yes", " gtm watch create --name Buyers --topic 'CRM for agencies' [--source x|reddit|both] --max-credits N --yes", " gtm watch list [--offset N]", " gtm watch show ID", " gtm watch changes [--watch ID] [--since N | --new] [--csv]", " gtm watch pause|resume|delete ID", " gtm watch webhook_set ID --url https://hooks.acme.com/signals Save or replace the address; prints a signing secret once", " gtm watch webhook_show ID Show the address and whether delivery is active or failing; never the secret", " gtm watch webhook_test ID Send a signed test delivery that carries no changes", " gtm watch webhook_rotate ID Make a new signing secret, printed once", " gtm watch webhook_remove ID Stop delivering to the address", "", "Webhook deliveries and tests use no credits. Setup and signature check: docs/watch-webhooks.md.", "", tool("gtm_watch"), "A monthly limit is mandatory. The first check is a free baseline. No cadence option.", "A topic watch checks X and Reddit weekly and charges only new qualifying posts.", "A job-change watch saves LinkedIn profiles (--person URL, repeated, or --file) and checks them monthly; it charges only a person who changed company or title.", "--yes confirms after the free quote; without it, interactive terminals ask for confirmation.", "--new saves a cursor per server, credential and watch under GTM_CONFIG_DIR.", "CSV contains full rows; the ordinary answer is a compact preview."]
24571
25613
  },
24572
25614
  login: {
24573
25615
  summary: "Sign in with a code you confirm in the browser",
@@ -24658,6 +25700,7 @@ var TOPICS = {
24658
25700
  "",
24659
25701
  "Options:",
24660
25702
  " --titles TITLE Job titles of the people to reach; repeat for up to 5",
25703
+ " --exclude-domain DOMAIN Skip this company and its subdomains for this search; repeat",
24661
25704
  " --location PLACE Where they live: country or city",
24662
25705
  " --industry NAME Company industry, like SaaS; repeat for several",
24663
25706
  " --size RANGE Company employees, like 20-99; repeat for several",
@@ -24727,7 +25770,7 @@ var TOPICS = {
24727
25770
  "Usage:",
24728
25771
  " gtm tools search <words>",
24729
25772
  " gtm tools describe <capability>",
24730
- ` gtm tools run seo-aeo-audit --input '{"url":"example.com"}' --max-credits 35`,
25773
+ ` gtm tools run seo-aeo-audit --input '{"url":"example.com"}' --max-credits 39`,
24731
25774
  " gtm tools run <capability> --input '<json>' --max-credits N",
24732
25775
  ` gtm tools run linkedin-activity --file leads.csv --input '{"topics":["automation"]}' --max-credits N [--out activity.csv]`,
24733
25776
  "",
@@ -24758,10 +25801,10 @@ var TOPICS = {
24758
25801
  };
24759
25802
  var ORDER = ["login", "logout", "whoami", "auth-header", ...Object.values(TOOL_COMMANDS)];
24760
25803
  function helpText(topic) {
24761
- const entry = topic ? TOPICS[topic] : void 0;
24762
- if (entry) return `gtm ${topic}: ${entry.summary}
25804
+ const entry2 = topic ? TOPICS[topic] : void 0;
25805
+ if (entry2) return `gtm ${topic}: ${entry2.summary}
24763
25806
 
24764
- ${[...entry.lines, "", "Common options:", ...COMMON].join("\n")}
25807
+ ${[...entry2.lines, "", "Common options:", ...COMMON].join("\n")}
24765
25808
  `;
24766
25809
  return [
24767
25810
  "gtm: GTMMAXING from your terminal or coding agent",
@@ -24799,11 +25842,11 @@ async function login(session, browser) {
24799
25842
  };
24800
25843
  await store.savePending(pending);
24801
25844
  }
24802
- const step = `Open the link, check the page shows ${pending.user_code}, and click Approve.`;
24803
- io.stdout(session.options.json ? `${JSON.stringify({ code: pending.user_code, open: pending.verification_uri_complete, step })}
25845
+ const step2 = `Open the link, check the page shows ${pending.user_code}, and click Approve.`;
25846
+ io.stdout(session.options.json ? `${JSON.stringify({ code: pending.user_code, open: pending.verification_uri_complete, step: step2 })}
24804
25847
  ` : `code: ${pending.user_code}
24805
25848
  open: ${pending.verification_uri_complete}
24806
- step: ${step}
25849
+ step: ${step2}
24807
25850
  `);
24808
25851
  if (browser && !io.env.GTM_NO_BROWSER) await io.openUrl(pending.verification_uri_complete).catch(() => false);
24809
25852
  let interval = pending.interval;
@@ -24867,17 +25910,17 @@ async function authHeader(session) {
24867
25910
  return 0;
24868
25911
  }
24869
25912
  function sameService(target2, apiUrl) {
24870
- let url2;
25913
+ let url3;
24871
25914
  let api;
24872
25915
  try {
24873
- url2 = new URL(target2);
25916
+ url3 = new URL(target2);
24874
25917
  api = new URL(apiUrl);
24875
25918
  } catch {
24876
25919
  return false;
24877
25920
  }
24878
- if (url2.protocol !== api.protocol) return false;
25921
+ if (url3.protocol !== api.protocol) return false;
24879
25922
  const site = api.hostname.replace(/^api\./, "");
24880
- return url2.host === api.host || url2.hostname === site && url2.port === api.port;
25923
+ return url3.host === api.host || url3.hostname === site && url3.port === api.port;
24881
25924
  }
24882
25925
 
24883
25926
  // ../contracts/src/polling.ts
@@ -25065,14 +26108,14 @@ var DEFAULT_API_URL = DEPLOYMENT.api.origin;
25065
26108
  var LOOPBACK = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
25066
26109
  function resolveApiUrl(flag, env, saved) {
25067
26110
  const raw = flag ?? env ?? saved ?? DEFAULT_API_URL;
25068
- let url2;
26111
+ let url3;
25069
26112
  try {
25070
- url2 = new URL(raw);
26113
+ url3 = new URL(raw);
25071
26114
  } catch {
25072
26115
  throw new UsageError(`--api-url ${raw} is not a URL.`);
25073
26116
  }
25074
- if (url2.protocol !== "https:" && !(url2.protocol === "http:" && LOOPBACK.has(url2.hostname))) throw new UsageError("--api-url must use https, or http on localhost.");
25075
- return url2.origin + url2.pathname.replace(/\/+$/, "");
26117
+ if (url3.protocol !== "https:" && !(url3.protocol === "http:" && LOOPBACK.has(url3.hostname))) throw new UsageError("--api-url must use https, or http on localhost.");
26118
+ return url3.origin + url3.pathname.replace(/\/+$/, "");
25076
26119
  }
25077
26120
  var Session = class _Session {
25078
26121
  constructor(io, options, apiUrl, token2, tokenSource) {
@@ -25279,10 +26322,10 @@ import { createInterface } from "node:readline/promises";
25279
26322
  import { spawn } from "node:child_process";
25280
26323
  import { readFile as readFile2, writeFile as writeFile2 } from "node:fs/promises";
25281
26324
  import { homedir } from "node:os";
25282
- function openUrl(url2) {
26325
+ function openUrl(url3) {
25283
26326
  const env = process.env;
25284
26327
  if (process.platform === "linux" && !env.DISPLAY && !env.WAYLAND_DISPLAY) return Promise.resolve(false);
25285
- const [command, args] = process.platform === "darwin" ? ["open", [url2]] : process.platform === "win32" ? ["cmd", ["/c", "start", "", url2.replace(/&/g, "^&")]] : ["xdg-open", [url2]];
26328
+ const [command, args] = process.platform === "darwin" ? ["open", [url3]] : process.platform === "win32" ? ["cmd", ["/c", "start", "", url3.replace(/&/g, "^&")]] : ["xdg-open", [url3]];
25286
26329
  return new Promise((resolve) => {
25287
26330
  try {
25288
26331
  const child = spawn(command, args, { stdio: "ignore", detached: true });