@glasser-ai/cli 0.1.80 → 0.1.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/glasser.js +1176 -152
- package/package.json +1 -1
package/dist/glasser.js
CHANGED
|
@@ -4320,8 +4320,8 @@ var require_webidl = __commonJS({
|
|
|
4320
4320
|
message: `"${context3.value}" is an invalid ${context3.type}.`
|
|
4321
4321
|
});
|
|
4322
4322
|
};
|
|
4323
|
-
webidl.brandCheck = function(V,
|
|
4324
|
-
if (!FunctionPrototypeSymbolHasInstance(
|
|
4323
|
+
webidl.brandCheck = function(V, I2) {
|
|
4324
|
+
if (!FunctionPrototypeSymbolHasInstance(I2, V)) {
|
|
4325
4325
|
const err = new TypeError("Illegal invocation");
|
|
4326
4326
|
err.code = "ERR_INVALID_THIS";
|
|
4327
4327
|
throw err;
|
|
@@ -4351,8 +4351,8 @@ var require_webidl = __commonJS({
|
|
|
4351
4351
|
message: "Illegal constructor"
|
|
4352
4352
|
});
|
|
4353
4353
|
};
|
|
4354
|
-
webidl.util.MakeTypeAssertion = function(
|
|
4355
|
-
return (O) => FunctionPrototypeSymbolHasInstance(
|
|
4354
|
+
webidl.util.MakeTypeAssertion = function(I2) {
|
|
4355
|
+
return (O) => FunctionPrototypeSymbolHasInstance(I2, O);
|
|
4356
4356
|
};
|
|
4357
4357
|
webidl.util.Type = function(V) {
|
|
4358
4358
|
switch (typeof V) {
|
|
@@ -5198,11 +5198,11 @@ var require_util2 = __commonJS({
|
|
|
5198
5198
|
}
|
|
5199
5199
|
function tryUpgradeRequestToAPotentiallyTrustworthyURL(request5) {
|
|
5200
5200
|
}
|
|
5201
|
-
function sameOrigin(A,
|
|
5202
|
-
if (A.origin ===
|
|
5201
|
+
function sameOrigin(A, B2) {
|
|
5202
|
+
if (A.origin === B2.origin && A.origin === "null") {
|
|
5203
5203
|
return true;
|
|
5204
5204
|
}
|
|
5205
|
-
if (A.protocol ===
|
|
5205
|
+
if (A.protocol === B2.protocol && A.hostname === B2.hostname && A.port === B2.port) {
|
|
5206
5206
|
return true;
|
|
5207
5207
|
}
|
|
5208
5208
|
return false;
|
|
@@ -16695,9 +16695,9 @@ var require_cache = __commonJS({
|
|
|
16695
16695
|
if (typeof key !== "object") {
|
|
16696
16696
|
throw new TypeError(`expected key to be object, got ${typeof key}`);
|
|
16697
16697
|
}
|
|
16698
|
-
for (const
|
|
16699
|
-
if (typeof key[
|
|
16700
|
-
throw new TypeError(`expected key.${
|
|
16698
|
+
for (const property2 of ["origin", "method", "path"]) {
|
|
16699
|
+
if (typeof key[property2] !== "string") {
|
|
16700
|
+
throw new TypeError(`expected key.${property2} to be string, got ${typeof key[property2]}`);
|
|
16701
16701
|
}
|
|
16702
16702
|
}
|
|
16703
16703
|
if (key.headers !== void 0 && typeof key.headers !== "object") {
|
|
@@ -16708,9 +16708,9 @@ var require_cache = __commonJS({
|
|
|
16708
16708
|
if (typeof value3 !== "object") {
|
|
16709
16709
|
throw new TypeError(`expected value to be object, got ${typeof value3}`);
|
|
16710
16710
|
}
|
|
16711
|
-
for (const
|
|
16712
|
-
if (typeof value3[
|
|
16713
|
-
throw new TypeError(`expected value.${
|
|
16711
|
+
for (const property2 of ["statusCode", "cachedAt", "staleAt", "deleteAt"]) {
|
|
16712
|
+
if (typeof value3[property2] !== "number") {
|
|
16713
|
+
throw new TypeError(`expected value.${property2} to be number, got ${typeof value3[property2]}`);
|
|
16714
16714
|
}
|
|
16715
16715
|
}
|
|
16716
16716
|
if (typeof value3.statusMessage !== "string") {
|
|
@@ -22758,9 +22758,9 @@ var require_util3 = __commonJS({
|
|
|
22758
22758
|
var assert2 = __require("node:assert");
|
|
22759
22759
|
var { URLSerializer } = require_data_url();
|
|
22760
22760
|
var { isValidHeaderName } = require_util2();
|
|
22761
|
-
function urlEquals(A,
|
|
22761
|
+
function urlEquals(A, B2, excludeFragment = false) {
|
|
22762
22762
|
const serializedA = URLSerializer(A, excludeFragment);
|
|
22763
|
-
const serializedB = URLSerializer(
|
|
22763
|
+
const serializedB = URLSerializer(B2, excludeFragment);
|
|
22764
22764
|
return serializedA === serializedB;
|
|
22765
22765
|
}
|
|
22766
22766
|
function getFieldValues(header) {
|
|
@@ -27228,7 +27228,7 @@ function isObject(input) {
|
|
|
27228
27228
|
function isObjectKeyword(input) {
|
|
27229
27229
|
return typeof input === "object" && input !== null || isFunction(input);
|
|
27230
27230
|
}
|
|
27231
|
-
var hasProperty = /* @__PURE__ */ dual(2, (self,
|
|
27231
|
+
var hasProperty = /* @__PURE__ */ dual(2, (self, property2) => isObjectKeyword(self) && property2 in self);
|
|
27232
27232
|
var isTagged = /* @__PURE__ */ dual(2, (self, tag2) => hasProperty(self, "_tag") && self["_tag"] === tag2);
|
|
27233
27233
|
function isError(input) {
|
|
27234
27234
|
return input instanceof Error;
|
|
@@ -27586,7 +27586,7 @@ function format(input, options4) {
|
|
|
27586
27586
|
const space = options4?.space ?? 0;
|
|
27587
27587
|
const ancestors = /* @__PURE__ */ new WeakSet();
|
|
27588
27588
|
const gap = !space ? "" : typeof space === "number" ? " ".repeat(space) : space;
|
|
27589
|
-
const ind = (
|
|
27589
|
+
const ind = (d3) => gap.repeat(d3);
|
|
27590
27590
|
const wrap = (v, body) => {
|
|
27591
27591
|
const ctor = v?.constructor;
|
|
27592
27592
|
return ctor && ctor !== Object.prototype.constructor && ctor.name ? `${ctor.name}(${body})` : body;
|
|
@@ -27598,7 +27598,7 @@ function format(input, options4) {
|
|
|
27598
27598
|
return ["[ownKeys threw]"];
|
|
27599
27599
|
}
|
|
27600
27600
|
};
|
|
27601
|
-
function recur3(v,
|
|
27601
|
+
function recur3(v, d3 = 0) {
|
|
27602
27602
|
if (typeof v === "string") return JSON.stringify(v);
|
|
27603
27603
|
if (typeof v === "number" || v == null || typeof v === "boolean" || typeof v === "symbol") return String(v);
|
|
27604
27604
|
if (typeof v === "bigint") return String(v) + "n";
|
|
@@ -27607,27 +27607,27 @@ function format(input, options4) {
|
|
|
27607
27607
|
ancestors.add(v);
|
|
27608
27608
|
let output;
|
|
27609
27609
|
if (symbolRedactable in v) {
|
|
27610
|
-
output = recur3(getRedacted(v),
|
|
27610
|
+
output = recur3(getRedacted(v), d3);
|
|
27611
27611
|
} else if (Array.isArray(v)) {
|
|
27612
|
-
output = !gap || v.length <= 1 ? `[${v.map((x) => recur3(x,
|
|
27613
|
-
${ind(
|
|
27614
|
-
${ind(
|
|
27612
|
+
output = !gap || v.length <= 1 ? `[${v.map((x) => recur3(x, d3)).join(",")}]` : `[
|
|
27613
|
+
${ind(d3 + 1)}${v.map((x) => recur3(x, d3 + 1)).join(",\n" + ind(d3 + 1))}
|
|
27614
|
+
${ind(d3)}]`;
|
|
27615
27615
|
} else if (v instanceof Date) {
|
|
27616
27616
|
output = formatDate(v);
|
|
27617
27617
|
} else if (!options4?.ignoreToString && hasProperty(v, "toString") && typeof v["toString"] === "function" && v["toString"] !== Object.prototype.toString && v["toString"] !== Array.prototype.toString) {
|
|
27618
27618
|
const s = safeToString(v);
|
|
27619
|
-
output = v instanceof Error && v.cause ? `${s} (cause: ${recur3(v.cause,
|
|
27619
|
+
output = v instanceof Error && v.cause ? `${s} (cause: ${recur3(v.cause, d3)})` : s;
|
|
27620
27620
|
} else if (Symbol.iterator in v) {
|
|
27621
|
-
output = `${v.constructor.name}(${recur3(Array.from(v),
|
|
27621
|
+
output = `${v.constructor.name}(${recur3(Array.from(v), d3)})`;
|
|
27622
27622
|
} else {
|
|
27623
27623
|
const keys4 = ownKeys(v);
|
|
27624
27624
|
if (!gap || keys4.length <= 1) {
|
|
27625
|
-
const body = `{${keys4.map((k) => `${formatPropertyKey(k)}:${recur3(v[k],
|
|
27625
|
+
const body = `{${keys4.map((k) => `${formatPropertyKey(k)}:${recur3(v[k], d3)}`).join(",")}}`;
|
|
27626
27626
|
output = wrap(v, body);
|
|
27627
27627
|
} else {
|
|
27628
27628
|
const body = `{
|
|
27629
|
-
${keys4.map((k) => `${ind(
|
|
27630
|
-
${ind(
|
|
27629
|
+
${keys4.map((k) => `${ind(d3 + 1)}${formatPropertyKey(k)}: ${recur3(v[k], d3 + 1)}`).join(",\n")}
|
|
27630
|
+
${ind(d3)}}`;
|
|
27631
27631
|
output = wrap(v, body);
|
|
27632
27632
|
}
|
|
27633
27633
|
}
|
|
@@ -29691,10 +29691,10 @@ var parts = (self) => {
|
|
|
29691
29691
|
const sec = ms / bigint1e3;
|
|
29692
29692
|
const min6 = sec / bigint60;
|
|
29693
29693
|
const hr = min6 / bigint60;
|
|
29694
|
-
const
|
|
29694
|
+
const d3 = hr / bigint24;
|
|
29695
29695
|
const sign2 = neg ? -1 : 1;
|
|
29696
29696
|
return {
|
|
29697
|
-
days: sign2 * Number(
|
|
29697
|
+
days: sign2 * Number(d3),
|
|
29698
29698
|
hours: sign2 * Number(hr % bigint24),
|
|
29699
29699
|
minutes: sign2 * Number(min6 % bigint60),
|
|
29700
29700
|
seconds: sign2 * Number(sec % bigint60),
|
|
@@ -38752,9 +38752,9 @@ var Objects = class _Objects extends Base2 {
|
|
|
38752
38752
|
});
|
|
38753
38753
|
if (indexCount) return fallback;
|
|
38754
38754
|
const resume = (state, index2, pending) => {
|
|
38755
|
-
const
|
|
38755
|
+
const property2 = properties[index2];
|
|
38756
38756
|
return flatMap5(exit2(pending), (exit3) => {
|
|
38757
|
-
const terminal = stepProperty(state,
|
|
38757
|
+
const terminal = stepProperty(state, property2, exit3);
|
|
38758
38758
|
if (terminal) return terminal;
|
|
38759
38759
|
const done4 = () => succeed9(state.out);
|
|
38760
38760
|
const eff = parseProperties(state, properties.slice(index2 + 1));
|
|
@@ -38781,11 +38781,11 @@ var Objects = class _Objects extends Base2 {
|
|
|
38781
38781
|
};
|
|
38782
38782
|
try {
|
|
38783
38783
|
for (let index2 = 0; index2 < props.length; index2++) {
|
|
38784
|
-
const
|
|
38785
|
-
const name =
|
|
38784
|
+
const property2 = props[index2];
|
|
38785
|
+
const name = property2.name;
|
|
38786
38786
|
const hasKey = Object.hasOwn(record2, name);
|
|
38787
38787
|
const value3 = hasKey ? record2[name] : missing;
|
|
38788
|
-
const exit3 =
|
|
38788
|
+
const exit3 = property2.parser(value3, options4);
|
|
38789
38789
|
if (!effectIsExit(exit3)) {
|
|
38790
38790
|
return resume(state, index2, exit3);
|
|
38791
38791
|
}
|
|
@@ -38793,7 +38793,7 @@ var Objects = class _Objects extends Base2 {
|
|
|
38793
38793
|
if (hasKey) assignProperty(out, name, value3);
|
|
38794
38794
|
continue;
|
|
38795
38795
|
}
|
|
38796
|
-
const terminal = stepProperty(state,
|
|
38796
|
+
const terminal = stepProperty(state, property2, exit3);
|
|
38797
38797
|
if (terminal) return terminal;
|
|
38798
38798
|
}
|
|
38799
38799
|
} catch (error2) {
|
|
@@ -39411,9 +39411,9 @@ function isPattern(regExp, annotations2) {
|
|
|
39411
39411
|
});
|
|
39412
39412
|
}
|
|
39413
39413
|
function modifyOwnPropertyDescriptors(ast, f) {
|
|
39414
|
-
const
|
|
39415
|
-
f(
|
|
39416
|
-
return Object.create(Object.getPrototypeOf(ast),
|
|
39414
|
+
const d3 = Object.getOwnPropertyDescriptors(ast);
|
|
39415
|
+
f(d3);
|
|
39416
|
+
return Object.create(Object.getPrototypeOf(ast), d3);
|
|
39417
39417
|
}
|
|
39418
39418
|
var contextOwners = /* @__PURE__ */ new WeakMap();
|
|
39419
39419
|
function getContextOwner(ast) {
|
|
@@ -39423,8 +39423,8 @@ function replaceEncoding(ast, encoding) {
|
|
|
39423
39423
|
if (ast.encoding === encoding) {
|
|
39424
39424
|
return ast;
|
|
39425
39425
|
}
|
|
39426
|
-
return modifyOwnPropertyDescriptors(ast, (
|
|
39427
|
-
|
|
39426
|
+
return modifyOwnPropertyDescriptors(ast, (d3) => {
|
|
39427
|
+
d3.encoding.value = encoding;
|
|
39428
39428
|
});
|
|
39429
39429
|
}
|
|
39430
39430
|
function replaceContext(ast, context3) {
|
|
@@ -39435,8 +39435,8 @@ function replaceContext(ast, context3) {
|
|
|
39435
39435
|
if (owner.context === context3) {
|
|
39436
39436
|
return owner;
|
|
39437
39437
|
}
|
|
39438
|
-
const out = modifyOwnPropertyDescriptors(ast, (
|
|
39439
|
-
|
|
39438
|
+
const out = modifyOwnPropertyDescriptors(ast, (d3) => {
|
|
39439
|
+
d3.context.value = context3;
|
|
39440
39440
|
});
|
|
39441
39441
|
contextOwners.set(out, owner);
|
|
39442
39442
|
return out;
|
|
@@ -39449,9 +39449,9 @@ function annotate(ast, annotations2) {
|
|
|
39449
39449
|
const last = ast.checks[ast.checks.length - 1];
|
|
39450
39450
|
return replaceChecks(ast, append(ast.checks.slice(0, -1), last.annotate(annotations2)));
|
|
39451
39451
|
}
|
|
39452
|
-
return modifyOwnPropertyDescriptors(ast, (
|
|
39453
|
-
|
|
39454
|
-
...
|
|
39452
|
+
return modifyOwnPropertyDescriptors(ast, (d3) => {
|
|
39453
|
+
d3.annotations.value = {
|
|
39454
|
+
...d3.annotations.value,
|
|
39455
39455
|
...annotations2
|
|
39456
39456
|
};
|
|
39457
39457
|
});
|
|
@@ -39463,8 +39463,8 @@ function replaceChecks(ast, checks) {
|
|
|
39463
39463
|
if (ast.checks === checks) {
|
|
39464
39464
|
return ast;
|
|
39465
39465
|
}
|
|
39466
|
-
return modifyOwnPropertyDescriptors(ast, (
|
|
39467
|
-
|
|
39466
|
+
return modifyOwnPropertyDescriptors(ast, (d3) => {
|
|
39467
|
+
d3.checks.value = checks;
|
|
39468
39468
|
});
|
|
39469
39469
|
}
|
|
39470
39470
|
function appendChecks(ast, checks) {
|
|
@@ -39622,9 +39622,9 @@ var toType = /* @__PURE__ */ memoizeIdempotent((ast) => {
|
|
|
39622
39622
|
const encodingChecks = type.encodingChecks;
|
|
39623
39623
|
if (encodingChecks) {
|
|
39624
39624
|
const checks = type === ast ? encodingChecks : isArrays(type) || isObjects(type) || isDeclaration(type) && type.typeParameters.length > 0 ? extractStructuralChecks(encodingChecks) : void 0;
|
|
39625
|
-
return modifyOwnPropertyDescriptors(type, (
|
|
39626
|
-
|
|
39627
|
-
|
|
39625
|
+
return modifyOwnPropertyDescriptors(type, (d3) => {
|
|
39626
|
+
d3.encodingChecks.value = void 0;
|
|
39627
|
+
d3.checks.value = combineChecks(type.checks, checks);
|
|
39628
39628
|
});
|
|
39629
39629
|
}
|
|
39630
39630
|
return type;
|
|
@@ -44163,15 +44163,15 @@ function compileJsonSchema(representations, rootPaths, references, options4) {
|
|
|
44163
44163
|
const properties = {};
|
|
44164
44164
|
const required3 = [];
|
|
44165
44165
|
for (let index2 = 0; index2 < representation.propertySignatures.length; index2++) {
|
|
44166
|
-
const
|
|
44167
|
-
if (typeof
|
|
44166
|
+
const property2 = representation.propertySignatures[index2];
|
|
44167
|
+
if (typeof property2.name !== "string") {
|
|
44168
44168
|
throw errorWithPath("Invalid schema representation document", [...path10, "propertySignatures", index2, "name"]);
|
|
44169
44169
|
}
|
|
44170
|
-
const name =
|
|
44171
|
-
const compiled = recur3(
|
|
44172
|
-
const annotations2 = collectJsonSchemaAnnotations(
|
|
44170
|
+
const name = property2.name;
|
|
44171
|
+
const compiled = recur3(property2.type, [...path10, "propertySignatures", index2, "type"]);
|
|
44172
|
+
const annotations2 = collectJsonSchemaAnnotations(property2.annotations, options4);
|
|
44173
44173
|
assignProperty(properties, name, annotations2 === void 0 ? compiled : appendJsonSchema(compiled, annotations2));
|
|
44174
|
-
if (!
|
|
44174
|
+
if (!property2.isOptional) required3.push(name);
|
|
44175
44175
|
}
|
|
44176
44176
|
if (representation.propertySignatures.length > 0) out.properties = properties;
|
|
44177
44177
|
if (required3.length > 0) out.required = required3;
|
|
@@ -44537,12 +44537,12 @@ function toRepresentations(asts, options4) {
|
|
|
44537
44537
|
case "Objects":
|
|
44538
44538
|
return {
|
|
44539
44539
|
_tag: "Objects",
|
|
44540
|
-
propertySignatures: ast.propertySignatures.map((
|
|
44541
|
-
const projected = getLastEncoding(
|
|
44540
|
+
propertySignatures: ast.propertySignatures.map((property2) => {
|
|
44541
|
+
const projected = getLastEncoding(property2.type);
|
|
44542
44542
|
const annotations2 = projected.context?.annotations;
|
|
44543
44543
|
return {
|
|
44544
|
-
name:
|
|
44545
|
-
type: recur3(
|
|
44544
|
+
name: property2.name,
|
|
44545
|
+
type: recur3(property2.type),
|
|
44546
44546
|
isOptional: isOptional(projected),
|
|
44547
44547
|
isMutable: isMutable(projected),
|
|
44548
44548
|
...annotationsField(annotations2)
|
|
@@ -47595,7 +47595,7 @@ function causeReasonToArbitrary(error2, defect) {
|
|
|
47595
47595
|
const terminal = fc.constant(makeInterruptReason2());
|
|
47596
47596
|
const arbitrary = fc.oneof(terminal, fc.integer({
|
|
47597
47597
|
min: 1
|
|
47598
|
-
}).map(makeInterruptReason2), error2.arbitrary.map((e) => makeFailReason(e)), defect.arbitrary.map((
|
|
47598
|
+
}).map(makeInterruptReason2), error2.arbitrary.map((e) => makeFailReason(e)), defect.arbitrary.map((d3) => makeDieReason(d3)));
|
|
47599
47599
|
return withRecursion(fc, ctx, terminal, arbitrary);
|
|
47600
47600
|
};
|
|
47601
47601
|
}
|
|
@@ -53620,8 +53620,8 @@ var toConfigCursorAST = /* @__PURE__ */ memoize((root2) => {
|
|
|
53620
53620
|
}
|
|
53621
53621
|
const node = cursor.node;
|
|
53622
53622
|
const keys4 = /* @__PURE__ */ new Set();
|
|
53623
|
-
for (const
|
|
53624
|
-
if (typeof
|
|
53623
|
+
for (const property2 of ast.propertySignatures) {
|
|
53624
|
+
if (typeof property2.name === "string") keys4.add(property2.name);
|
|
53625
53625
|
}
|
|
53626
53626
|
if (matchesIndex.length > 0) {
|
|
53627
53627
|
for (const key of node.keys) {
|
|
@@ -60436,10 +60436,10 @@ var levenshtein = (a, b) => {
|
|
|
60436
60436
|
return dp[m][n];
|
|
60437
60437
|
};
|
|
60438
60438
|
var suggest = (input, candidates) => {
|
|
60439
|
-
const distances = candidates.map((c) => [levenshtein(input, c), c]).filter(([
|
|
60439
|
+
const distances = candidates.map((c) => [levenshtein(input, c), c]).filter(([d3]) => d3 <= 2).sort(([a], [b]) => a - b);
|
|
60440
60440
|
if (distances.length === 0) return [];
|
|
60441
60441
|
const minDistance = distances[0][0];
|
|
60442
|
-
return distances.filter(([
|
|
60442
|
+
return distances.filter(([d3]) => d3 === minDistance).map(([, c]) => c);
|
|
60443
60443
|
};
|
|
60444
60444
|
|
|
60445
60445
|
// ../../node_modules/effect/dist/unstable/cli/internal/parser.js
|
|
@@ -64937,18 +64937,186 @@ var RunIdParam = Schema_exports.Struct({
|
|
|
64937
64937
|
runId: RunId
|
|
64938
64938
|
});
|
|
64939
64939
|
|
|
64940
|
-
// ../../packages/contract/src/
|
|
64941
|
-
var
|
|
64942
|
-
|
|
64943
|
-
|
|
64944
|
-
"
|
|
64945
|
-
"
|
|
64946
|
-
"
|
|
64947
|
-
"
|
|
64948
|
-
"
|
|
64949
|
-
"
|
|
64940
|
+
// ../../packages/contract/src/seo-research-output.ts
|
|
64941
|
+
var SEO_RESEARCH_ACTIONS = [
|
|
64942
|
+
"keyword_overview",
|
|
64943
|
+
"keyword_ideas",
|
|
64944
|
+
"serp",
|
|
64945
|
+
"domain_overview",
|
|
64946
|
+
"ranked_keywords",
|
|
64947
|
+
"organic_competitors",
|
|
64948
|
+
"backlinks_overview",
|
|
64949
|
+
"backlinks",
|
|
64950
|
+
"referring_domains",
|
|
64951
|
+
"domain_rating",
|
|
64952
|
+
"site_audit",
|
|
64953
|
+
"ai_visibility",
|
|
64954
|
+
"keyword_gap",
|
|
64955
|
+
"backlink_gap",
|
|
64956
|
+
"page_audit",
|
|
64957
|
+
"visibility_history",
|
|
64958
|
+
"ai_citations"
|
|
64950
64959
|
];
|
|
64951
|
-
var
|
|
64960
|
+
var SEO_RESEARCH_PROVIDERS = [
|
|
64961
|
+
"semrush",
|
|
64962
|
+
"serpstat",
|
|
64963
|
+
"dataforseo",
|
|
64964
|
+
"ahrefs",
|
|
64965
|
+
"serper"
|
|
64966
|
+
];
|
|
64967
|
+
var SeoS = Schema_exports.NullOr(Schema_exports.String);
|
|
64968
|
+
var SeoN = Schema_exports.NullOr(Schema_exports.Number);
|
|
64969
|
+
var SeoI = Schema_exports.NullOr(Schema_exports.Int);
|
|
64970
|
+
var SeoB = Schema_exports.NullOr(Schema_exports.Boolean);
|
|
64971
|
+
var SeoCounts = Schema_exports.NullOr(Schema_exports.Record(Schema_exports.String, SeoI));
|
|
64972
|
+
var seoList = (fields) => Schema_exports.Struct({ items: Schema_exports.Array(Schema_exports.Struct(fields)) });
|
|
64973
|
+
var keywordRow = {
|
|
64974
|
+
keyword: SeoS,
|
|
64975
|
+
volume: SeoI,
|
|
64976
|
+
cpc_usd: SeoN,
|
|
64977
|
+
semrush_keyword_difficulty: SeoI,
|
|
64978
|
+
serpstat_keyword_difficulty: SeoI,
|
|
64979
|
+
dataforseo_keyword_difficulty: SeoI,
|
|
64980
|
+
ahrefs_keyword_difficulty: SeoI,
|
|
64981
|
+
intent: SeoS
|
|
64982
|
+
};
|
|
64983
|
+
var SeoKeywordOverviewOutput = seoList(keywordRow);
|
|
64984
|
+
var SeoKeywordIdeasOutput = seoList(keywordRow);
|
|
64985
|
+
var SeoSerpOutput = seoList({
|
|
64986
|
+
position: SeoI,
|
|
64987
|
+
url: SeoS,
|
|
64988
|
+
domain: SeoS,
|
|
64989
|
+
title: SeoS,
|
|
64990
|
+
snippet: SeoS
|
|
64991
|
+
});
|
|
64992
|
+
var SeoDomainOverviewOutput = Schema_exports.Struct({
|
|
64993
|
+
organic_keywords: SeoI,
|
|
64994
|
+
organic_traffic: SeoN,
|
|
64995
|
+
organic_traffic_value_usd: SeoN,
|
|
64996
|
+
paid_keywords: SeoI,
|
|
64997
|
+
paid_traffic: SeoN
|
|
64998
|
+
});
|
|
64999
|
+
var SeoRankedKeywordsOutput = seoList({
|
|
65000
|
+
keyword: SeoS,
|
|
65001
|
+
position: SeoI,
|
|
65002
|
+
url: SeoS,
|
|
65003
|
+
volume: SeoI,
|
|
65004
|
+
cpc_usd: SeoN,
|
|
65005
|
+
traffic: SeoN
|
|
65006
|
+
});
|
|
65007
|
+
var SeoOrganicCompetitorsOutput = seoList({
|
|
65008
|
+
domain: SeoS,
|
|
65009
|
+
common_keywords: SeoI,
|
|
65010
|
+
organic_keywords: SeoI,
|
|
65011
|
+
organic_traffic: SeoN
|
|
65012
|
+
});
|
|
65013
|
+
var SeoBacklinksOverviewOutput = Schema_exports.Struct({
|
|
65014
|
+
backlinks: SeoI,
|
|
65015
|
+
referring_domains: SeoI,
|
|
65016
|
+
semrush_authority_score: SeoI,
|
|
65017
|
+
dataforseo_rank: SeoI,
|
|
65018
|
+
serpstat_domain_rank: SeoI,
|
|
65019
|
+
dofollow_backlinks: SeoI,
|
|
65020
|
+
nofollow_backlinks: SeoI
|
|
65021
|
+
});
|
|
65022
|
+
var SeoBacklinksOutput = seoList({
|
|
65023
|
+
source_url: SeoS,
|
|
65024
|
+
target_url: SeoS,
|
|
65025
|
+
anchor: SeoS,
|
|
65026
|
+
source_ahrefs_domain_rating: SeoN,
|
|
65027
|
+
source_semrush_authority_score: SeoI,
|
|
65028
|
+
source_dataforseo_rank: SeoI,
|
|
65029
|
+
dofollow: SeoB,
|
|
65030
|
+
first_seen_at: SeoS
|
|
65031
|
+
});
|
|
65032
|
+
var SeoReferringDomainsOutput = seoList({
|
|
65033
|
+
domain: SeoS,
|
|
65034
|
+
ahrefs_domain_rating: SeoN,
|
|
65035
|
+
semrush_authority_score: SeoI,
|
|
65036
|
+
dataforseo_rank: SeoI,
|
|
65037
|
+
backlinks: SeoI,
|
|
65038
|
+
dofollow_backlinks: SeoI,
|
|
65039
|
+
first_seen_at: SeoS
|
|
65040
|
+
});
|
|
65041
|
+
var SeoDomainRatingOutput = Schema_exports.Struct({ ahrefs_domain_rating: SeoN });
|
|
65042
|
+
var SeoSiteAuditOutput = Schema_exports.Struct({
|
|
65043
|
+
dataforseo_task_id: SeoS,
|
|
65044
|
+
crawl_progress: SeoS,
|
|
65045
|
+
crawl_stop_reason: SeoS,
|
|
65046
|
+
pages_crawled: SeoI,
|
|
65047
|
+
dataforseo_onpage_score: SeoN,
|
|
65048
|
+
broken_links: SeoI,
|
|
65049
|
+
non_indexable: SeoI,
|
|
65050
|
+
duplicate_title: SeoI,
|
|
65051
|
+
duplicate_description: SeoI,
|
|
65052
|
+
duplicate_content: SeoI
|
|
65053
|
+
});
|
|
65054
|
+
var SeoKeywordGapOutput = seoList({
|
|
65055
|
+
keyword: SeoS,
|
|
65056
|
+
volume: SeoI,
|
|
65057
|
+
cpc_usd: SeoN,
|
|
65058
|
+
semrush_keyword_difficulty: SeoI,
|
|
65059
|
+
dataforseo_keyword_difficulty: SeoI,
|
|
65060
|
+
positions: Schema_exports.Record(Schema_exports.String, SeoI)
|
|
65061
|
+
});
|
|
65062
|
+
var SeoBacklinkGapOutput = seoList({
|
|
65063
|
+
domain: SeoS,
|
|
65064
|
+
dataforseo_rank: SeoI,
|
|
65065
|
+
backlinks_per_target: Schema_exports.Record(Schema_exports.String, SeoI)
|
|
65066
|
+
});
|
|
65067
|
+
var SeoPageAuditOutput = Schema_exports.Struct({
|
|
65068
|
+
url: SeoS,
|
|
65069
|
+
status_code: SeoI,
|
|
65070
|
+
title: SeoS,
|
|
65071
|
+
description: SeoS,
|
|
65072
|
+
canonical: SeoS,
|
|
65073
|
+
dataforseo_onpage_score: SeoN,
|
|
65074
|
+
internal_links: SeoI,
|
|
65075
|
+
external_links: SeoI
|
|
65076
|
+
});
|
|
65077
|
+
var SeoVisibilityHistoryOutput = seoList({
|
|
65078
|
+
month: SeoS,
|
|
65079
|
+
organic_keywords: SeoI,
|
|
65080
|
+
organic_traffic: SeoN,
|
|
65081
|
+
organic_traffic_value_usd: SeoN,
|
|
65082
|
+
paid_keywords: SeoI,
|
|
65083
|
+
paid_traffic: SeoN
|
|
65084
|
+
});
|
|
65085
|
+
var SeoAiCitationsOutput = seoList({
|
|
65086
|
+
url: SeoS,
|
|
65087
|
+
platform: SeoS,
|
|
65088
|
+
mentions: SeoI,
|
|
65089
|
+
ai_search_volume: SeoI,
|
|
65090
|
+
is_target_domain: SeoB
|
|
65091
|
+
});
|
|
65092
|
+
var SeoAiVisibilityOutput = Schema_exports.Struct({
|
|
65093
|
+
ahrefs_ai_citations: SeoI,
|
|
65094
|
+
ahrefs_ai_cited_pages: SeoI,
|
|
65095
|
+
ahrefs_ai_citations_by_platform: SeoCounts,
|
|
65096
|
+
dataforseo_ai_mentions_by_platform: SeoCounts,
|
|
65097
|
+
dataforseo_ai_search_volume_by_platform: SeoCounts
|
|
65098
|
+
});
|
|
65099
|
+
var SEO_RESEARCH_OUTPUT_FIELDS = {
|
|
65100
|
+
keyword_overview: "items[]: keyword, volume, cpc_usd, semrush_keyword_difficulty, serpstat_keyword_difficulty, dataforseo_keyword_difficulty, ahrefs_keyword_difficulty, intent",
|
|
65101
|
+
keyword_ideas: "items[]: same row as keyword_overview",
|
|
65102
|
+
serp: "items[]: position (organic position: 1 = first organic result; SERP features not counted), url, domain, title, snippet (organic results only)",
|
|
65103
|
+
domain_overview: "organic_keywords, organic_traffic, organic_traffic_value_usd, paid_keywords, paid_traffic",
|
|
65104
|
+
ranked_keywords: "items[]: keyword, position (organic position: 1 = first organic result; SERP features not counted), url, volume, cpc_usd, traffic",
|
|
65105
|
+
organic_competitors: "items[]: domain, common_keywords, organic_keywords (the competitor's total), organic_traffic (the target domain and its subdomains are left out)",
|
|
65106
|
+
backlinks_overview: "backlinks, referring_domains, semrush_authority_score, dataforseo_rank, serpstat_domain_rank, dofollow_backlinks, nofollow_backlinks",
|
|
65107
|
+
backlinks: "items[]: source_url, target_url, anchor, source_ahrefs_domain_rating, source_semrush_authority_score, source_dataforseo_rank, dofollow, first_seen_at (ISO 8601 UTC; Semrush: zone not stated, no Z suffix). One row per link from every Provider",
|
|
65108
|
+
referring_domains: "items[]: domain, ahrefs_domain_rating, semrush_authority_score, dataforseo_rank, backlinks, dofollow_backlinks, first_seen_at (ISO 8601 UTC; Semrush: zone not stated, no Z suffix)",
|
|
65109
|
+
domain_rating: "ahrefs_domain_rating",
|
|
65110
|
+
site_audit: "dataforseo_task_id (input to DataForSEO's OnPage report endpoints), crawl_progress, crawl_stop_reason (DataForSEO's vocabulary), pages_crawled, dataforseo_onpage_score, broken_links, non_indexable, duplicate_title, duplicate_description, duplicate_content",
|
|
65111
|
+
keyword_gap: "items[]: keyword, volume, cpc_usd, semrush_keyword_difficulty, dataforseo_keyword_difficulty, positions {domain: organic position; null = not in the top 100}, keyed by the domains sent. Semrush rows are keywords any of the domains ranks for (union); DataForSEO rows are keywords the competitor ranks for and you do not",
|
|
65112
|
+
backlink_gap: "items[]: domain, dataforseo_rank, backlinks_per_target {competitor domain: count}",
|
|
65113
|
+
page_audit: "url, status_code, title, description, canonical, dataforseo_onpage_score, internal_links, external_links",
|
|
65114
|
+
visibility_history: "items[]: month, organic_keywords, organic_traffic, organic_traffic_value_usd, paid_keywords, paid_traffic",
|
|
65115
|
+
ai_citations: "items[]: url, platform, mentions, ai_search_volume, is_target_domain (pages most cited in AI answers that mention the domain, from any site)",
|
|
65116
|
+
ai_visibility: "ahrefs_ai_citations, ahrefs_ai_cited_pages, ahrefs_ai_citations_by_platform {platform: citations}, dataforseo_ai_mentions_by_platform {platform: mentions}, dataforseo_ai_search_volume_by_platform {platform: AI search volume}. Each Provider fills only its own fields; no cross-Provider total"
|
|
65117
|
+
};
|
|
65118
|
+
|
|
65119
|
+
// ../../packages/contract/src/solutions-common.ts
|
|
64952
65120
|
var NonEmpty = Schema_exports.String.check(Schema_exports.isMinLength(1));
|
|
64953
65121
|
var StringList = Schema_exports.Array(NonEmpty.check(Schema_exports.isMaxLength(200))).check(
|
|
64954
65122
|
Schema_exports.isMinLength(1),
|
|
@@ -64994,6 +65162,8 @@ var commonFields = {
|
|
|
64994
65162
|
*/
|
|
64995
65163
|
metadata: Schema_exports.optional(MetadataInput)
|
|
64996
65164
|
};
|
|
65165
|
+
|
|
65166
|
+
// ../../packages/contract/src/solutions-web-research.ts
|
|
64997
65167
|
var WEB_RESEARCH_ACTIONS = [
|
|
64998
65168
|
"search",
|
|
64999
65169
|
"news",
|
|
@@ -65006,7 +65176,218 @@ var WEB_RESEARCH_ACTIONS = [
|
|
|
65006
65176
|
"scrape",
|
|
65007
65177
|
"similar"
|
|
65008
65178
|
];
|
|
65009
|
-
var WEB_RESEARCH_PROVIDERS = [
|
|
65179
|
+
var WEB_RESEARCH_PROVIDERS = [
|
|
65180
|
+
"serper",
|
|
65181
|
+
"serpapi",
|
|
65182
|
+
"exa",
|
|
65183
|
+
"dataforseo",
|
|
65184
|
+
"firecrawl"
|
|
65185
|
+
];
|
|
65186
|
+
var WEB_RESEARCH_TIME_RANGES = ["day", "week", "month", "year"];
|
|
65187
|
+
var WEB_FETCH_FORMATS = ["text", "markdown", "html", "raw_html"];
|
|
65188
|
+
var WebFetchFormat = Schema_exports.Literals(WEB_FETCH_FORMATS);
|
|
65189
|
+
var S = Schema_exports.NullOr(Schema_exports.String);
|
|
65190
|
+
var N = Schema_exports.NullOr(Schema_exports.Number);
|
|
65191
|
+
var I = Schema_exports.NullOr(Schema_exports.Int);
|
|
65192
|
+
var B = Schema_exports.NullOr(Schema_exports.Boolean);
|
|
65193
|
+
var PUBLISHED_AT = "ISO 8601 UTC timestamp, filled only when the Provider reports a machine timestamp (Exa publishedDate, SerpApi news iso_date); otherwise null.";
|
|
65194
|
+
var DATE_TEXT = "Google's display text exactly as the Provider returned it (Serper / SerpApi date). It may be relative to the Run's completed_at, such as '3 hours ago', and is never parsed.";
|
|
65195
|
+
var SOURCE = "Publisher or site name as the Provider shows it.";
|
|
65196
|
+
var RATING = "Google's average star rating, 1\u20135.";
|
|
65197
|
+
var REVIEWS = "Number of Google reviews behind the rating.";
|
|
65198
|
+
var WebScrapeOutput = Schema_exports.Struct({
|
|
65199
|
+
url: Schema_exports.String.annotate({
|
|
65200
|
+
description: "The requested URL, or the final URL when the Provider reports one."
|
|
65201
|
+
}),
|
|
65202
|
+
final_url: S.annotate({
|
|
65203
|
+
description: "The post-redirect URL as reported by the Provider (Firecrawl, Exa). Null when the Provider does not report one."
|
|
65204
|
+
}),
|
|
65205
|
+
title: S,
|
|
65206
|
+
text: S,
|
|
65207
|
+
markdown: S,
|
|
65208
|
+
html: S,
|
|
65209
|
+
raw_html: S,
|
|
65210
|
+
text_character_limit: I.annotate({
|
|
65211
|
+
description: "The character cap Glasser asked the Provider to apply to text (10000 for Exa), so text of exactly this length may be truncated. Null when no cap was applied."
|
|
65212
|
+
}),
|
|
65213
|
+
cached: B.annotate({
|
|
65214
|
+
description: "Whether the Provider served the page from its cache (Firecrawl cacheState, Exa status source). Null when the Provider does not say."
|
|
65215
|
+
}),
|
|
65216
|
+
fetched_at: S.annotate({
|
|
65217
|
+
description: "When the Provider fetched the page, ISO 8601 UTC (DataForSEO fetch_time). Null when the Provider does not report it."
|
|
65218
|
+
}),
|
|
65219
|
+
quality: Schema_exports.Literal("unverified").annotate({
|
|
65220
|
+
description: "Deprecated: always 'unverified'; no content check is applied. Kept for compatibility and will be removed in the next breaking revision."
|
|
65221
|
+
})
|
|
65222
|
+
});
|
|
65223
|
+
var WebSearchResult = Schema_exports.Struct({
|
|
65224
|
+
url: Schema_exports.String,
|
|
65225
|
+
title: S,
|
|
65226
|
+
snippet: S.annotate({
|
|
65227
|
+
description: "Google's short excerpt (Serper / SerpApi), or Exa's extracted highlight for Exa. Not the full page text."
|
|
65228
|
+
}),
|
|
65229
|
+
position: Schema_exports.Int,
|
|
65230
|
+
date: S.annotate({
|
|
65231
|
+
description: "Deprecated: use published_at or date_text. Holds Google's display text for Serper / SerpApi and Exa's raw publishedDate for Exa."
|
|
65232
|
+
}),
|
|
65233
|
+
published_at: S.annotate({ description: PUBLISHED_AT }),
|
|
65234
|
+
date_text: S.annotate({ description: DATE_TEXT })
|
|
65235
|
+
});
|
|
65236
|
+
var WebSearchOutput = Schema_exports.Struct({ results: Schema_exports.Array(WebSearchResult) });
|
|
65237
|
+
var listOf = (fields) => Schema_exports.Struct({ items: Schema_exports.Array(Schema_exports.Struct(fields)) });
|
|
65238
|
+
var WebNewsOutput = listOf({
|
|
65239
|
+
title: S,
|
|
65240
|
+
url: S,
|
|
65241
|
+
source: S.annotate({ description: SOURCE }),
|
|
65242
|
+
published_at: S.annotate({ description: PUBLISHED_AT }),
|
|
65243
|
+
date_text: S.annotate({ description: DATE_TEXT }),
|
|
65244
|
+
snippet: S
|
|
65245
|
+
});
|
|
65246
|
+
var WebPlacesOutput = listOf({
|
|
65247
|
+
name: S,
|
|
65248
|
+
address: S.annotate({
|
|
65249
|
+
description: "The Provider's address text, not parsed or completed. Serper may return only the street line."
|
|
65250
|
+
}),
|
|
65251
|
+
category: S,
|
|
65252
|
+
rating: N.annotate({ description: RATING }),
|
|
65253
|
+
reviews: I.annotate({ description: REVIEWS }),
|
|
65254
|
+
phone: S,
|
|
65255
|
+
website: S,
|
|
65256
|
+
latitude: N,
|
|
65257
|
+
longitude: N,
|
|
65258
|
+
google_cid: S.annotate({
|
|
65259
|
+
description: "Google Maps CID of the place (Serper cid, SerpApi data_cid)."
|
|
65260
|
+
})
|
|
65261
|
+
});
|
|
65262
|
+
var WebScholarOutput = listOf({
|
|
65263
|
+
title: S,
|
|
65264
|
+
url: S,
|
|
65265
|
+
snippet: S,
|
|
65266
|
+
publication: S,
|
|
65267
|
+
year: I,
|
|
65268
|
+
cited_by: I,
|
|
65269
|
+
pdf_url: S
|
|
65270
|
+
});
|
|
65271
|
+
var WebShoppingOutput = listOf({
|
|
65272
|
+
title: S,
|
|
65273
|
+
url: S.annotate({ description: "The Google Shopping product page." }),
|
|
65274
|
+
merchant_url: S.annotate({
|
|
65275
|
+
description: "The merchant's offer URL when the Provider reports one (SerpApi link); null for Serper."
|
|
65276
|
+
}),
|
|
65277
|
+
google_product_id: S.annotate({
|
|
65278
|
+
description: "Google Shopping catalog product id (Serper productId, SerpApi product_id)."
|
|
65279
|
+
}),
|
|
65280
|
+
price_text: S.annotate({
|
|
65281
|
+
description: "The Provider's display price, such as '$69.00'. Not parsed; the currency follows country."
|
|
65282
|
+
}),
|
|
65283
|
+
seller: S,
|
|
65284
|
+
rating: N.annotate({ description: RATING }),
|
|
65285
|
+
reviews: I.annotate({ description: REVIEWS }),
|
|
65286
|
+
image_url: S
|
|
65287
|
+
});
|
|
65288
|
+
var WebImagesOutput = listOf({
|
|
65289
|
+
title: S,
|
|
65290
|
+
image_url: S,
|
|
65291
|
+
thumbnail_url: S,
|
|
65292
|
+
source_url: S,
|
|
65293
|
+
source: S.annotate({ description: SOURCE }),
|
|
65294
|
+
width: I,
|
|
65295
|
+
height: I
|
|
65296
|
+
});
|
|
65297
|
+
var WebVideosOutput = listOf({
|
|
65298
|
+
title: S,
|
|
65299
|
+
url: S,
|
|
65300
|
+
channel: S,
|
|
65301
|
+
source: S.annotate({ description: "Video platform as the Provider shows it, such as YouTube." }),
|
|
65302
|
+
date_text: S.annotate({ description: DATE_TEXT }),
|
|
65303
|
+
duration_text: S.annotate({ description: "Display duration as returned, such as '4:39'." }),
|
|
65304
|
+
snippet: S,
|
|
65305
|
+
thumbnail_url: S
|
|
65306
|
+
});
|
|
65307
|
+
var WebSimilarOutput = listOf({
|
|
65308
|
+
url: S,
|
|
65309
|
+
title: S,
|
|
65310
|
+
exa_similarity_score: N.annotate({
|
|
65311
|
+
description: "Exa's own similarity score for this page. Compare it only within one response; it is not comparable to other Providers' scores."
|
|
65312
|
+
}),
|
|
65313
|
+
published_at: S.annotate({ description: PUBLISHED_AT }),
|
|
65314
|
+
author: S
|
|
65315
|
+
});
|
|
65316
|
+
var WebAnswerOutput = Schema_exports.Struct({
|
|
65317
|
+
answer: S,
|
|
65318
|
+
citations: Schema_exports.Array(
|
|
65319
|
+
Schema_exports.Struct({ url: S, title: S, published_at: S.annotate({ description: PUBLISHED_AT }) })
|
|
65320
|
+
)
|
|
65321
|
+
});
|
|
65322
|
+
var WEB_RESEARCH_OUTPUT_FIELDS = {
|
|
65323
|
+
search: "results[]: url, title, snippet (Google's excerpt; Exa's extracted highlight for Exa), position, published_at, date_text, date (deprecated)",
|
|
65324
|
+
news: "items[]: title, url, source, published_at, date_text, snippet",
|
|
65325
|
+
places: "items[]: name, address (Provider's text; may be the street line only), category, rating (1\u20135), reviews, phone, website, latitude, longitude, google_cid",
|
|
65326
|
+
scholar: "items[]: title, url, snippet, publication, year, cited_by, pdf_url",
|
|
65327
|
+
shopping: "items[]: title, url (Google Shopping page), merchant_url, google_product_id, price_text, seller, rating (1\u20135), reviews, image_url",
|
|
65328
|
+
images: "items[]: title, image_url, thumbnail_url, source_url, source, width, height",
|
|
65329
|
+
videos: "items[]: title, url, channel, source, date_text, duration_text, snippet, thumbnail_url",
|
|
65330
|
+
answer: "answer, citations[]: url, title, published_at",
|
|
65331
|
+
scrape: "url, final_url, title, text, markdown, html, raw_html, text_character_limit, cached, fetched_at, quality (deprecated)",
|
|
65332
|
+
similar: "items[]: url, title, exa_similarity_score, published_at, author"
|
|
65333
|
+
};
|
|
65334
|
+
var WEB_RESEARCH_FIELD_NOTES = [
|
|
65335
|
+
"published_at is ISO 8601 UTC and set only from a Provider's machine timestamp.",
|
|
65336
|
+
"date_text is Google's display text as returned; it may be relative to the Run's completed_at and is never parsed.",
|
|
65337
|
+
"rating is Google's 1\u20135 star average; reviews is a count.",
|
|
65338
|
+
"source is a publisher or site name.",
|
|
65339
|
+
"exa_similarity_score is Exa's own score and is comparable only within one response."
|
|
65340
|
+
].join(" ");
|
|
65341
|
+
var solutionResultFields = {
|
|
65342
|
+
error: Schema_exports.NullOr(Schema_exports.Struct({ code: Schema_exports.String, message: Schema_exports.String })),
|
|
65343
|
+
charge_usd: Schema_exports.NullOr(UsdAmount).annotate({
|
|
65344
|
+
description: "Total charge of runs in this Solution response. Null until all listed Runs settle. Each Run retains its own charge; failures can also be charged."
|
|
65345
|
+
}),
|
|
65346
|
+
charge_basis: Run.fields.charge_basis.annotate({
|
|
65347
|
+
description: "Single-Run charge basis, or null for a multi-Run total. Read runs[].charge_basis for each charge."
|
|
65348
|
+
}),
|
|
65349
|
+
runs: Schema_exports.Array(RunSummary),
|
|
65350
|
+
result_url: Schema_exports.String.annotate({
|
|
65351
|
+
description: "Authenticated, read-only URL path for polling this normalized result and total charge. Use with the API origin. Does not create Runs or resume fallback. GET /v1/runs/:id still returns the native, individual Run."
|
|
65352
|
+
})
|
|
65353
|
+
};
|
|
65354
|
+
var WebResearchResult = Schema_exports.Struct({
|
|
65355
|
+
...Run.fields,
|
|
65356
|
+
action: Schema_exports.Literals(WEB_RESEARCH_ACTIONS),
|
|
65357
|
+
output: Schema_exports.NullOr(
|
|
65358
|
+
Schema_exports.Union([
|
|
65359
|
+
WebScrapeOutput,
|
|
65360
|
+
WebSearchOutput,
|
|
65361
|
+
WebNewsOutput,
|
|
65362
|
+
WebPlacesOutput,
|
|
65363
|
+
WebScholarOutput,
|
|
65364
|
+
WebShoppingOutput,
|
|
65365
|
+
WebImagesOutput,
|
|
65366
|
+
WebVideosOutput,
|
|
65367
|
+
WebSimilarOutput,
|
|
65368
|
+
WebAnswerOutput
|
|
65369
|
+
])
|
|
65370
|
+
).annotate({
|
|
65371
|
+
description: `Normalized fields per action. The Provider's native output is not repeated here; it stays on the Run (GET /v1/runs/:id). Values a Provider does not report are null.
|
|
65372
|
+
|
|
65373
|
+
${Object.entries(
|
|
65374
|
+
WEB_RESEARCH_OUTPUT_FIELDS
|
|
65375
|
+
).map(([action2, fields]) => `- ${action2}: ${fields}`).join("\n")}
|
|
65376
|
+
|
|
65377
|
+
${WEB_RESEARCH_FIELD_NOTES}`
|
|
65378
|
+
}),
|
|
65379
|
+
result_status: Schema_exports.Literals(["success", "partial", "no_result", "error", "pending"]).annotate({
|
|
65380
|
+
description: "Business delivery status, independent of the final Run lifecycle in status. success is not a semantic content-quality verdict."
|
|
65381
|
+
}),
|
|
65382
|
+
missing_formats: Schema_exports.Array(WebFetchFormat),
|
|
65383
|
+
...solutionResultFields
|
|
65384
|
+
}).annotate({ identifier: "WebResearchResult" });
|
|
65385
|
+
var SolutionResultQuery = Schema_exports.Struct({
|
|
65386
|
+
token: Schema_exports.String.check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(16384)).annotate({
|
|
65387
|
+
description: "Opaque result context returned in result_url. Keep it unchanged and authenticate with a Key permitted to read every listed Run."
|
|
65388
|
+
})
|
|
65389
|
+
});
|
|
65390
|
+
var WebResearchResultQuery = SolutionResultQuery;
|
|
65010
65391
|
var WebResearchRequest = Schema_exports.Struct({
|
|
65011
65392
|
action: Schema_exports.optional(
|
|
65012
65393
|
Schema_exports.Literals(WEB_RESEARCH_ACTIONS).annotate({
|
|
@@ -65016,6 +65397,31 @@ var WebResearchRequest = Schema_exports.Struct({
|
|
|
65016
65397
|
provider: providerField(WEB_RESEARCH_PROVIDERS),
|
|
65017
65398
|
query: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(500))),
|
|
65018
65399
|
url: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(2048))),
|
|
65400
|
+
formats: Schema_exports.optionalKey(
|
|
65401
|
+
Schema_exports.Array(WebFetchFormat).check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(4)).annotate({
|
|
65402
|
+
description: "For scrape only. When omitted, use the selected Provider's native default: text for Serper/Exa, markdown for Firecrawl/DataForSEO. Requested formats guide routing and fallback; output exposes fixed text/markdown/html/raw_html fields. html means cleaned HTML; raw_html means original HTML. Auto uses Serper then Firecrawl. HTML requests go directly to Firecrawl. Read result_status and missing_formats for delivery; an unrequested null field is not a partial result. Firecrawl does not supply text; Glasser does not convert HTML to text. X/Twitter and enrichment routes are excluded from Firecrawl."
|
|
65403
|
+
})
|
|
65404
|
+
),
|
|
65405
|
+
timeout_ms: Schema_exports.optionalKey(
|
|
65406
|
+
Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 1e3, maximum: 12e4 })).annotate({
|
|
65407
|
+
description: "For scrape only. Default 30000. Execution budget for this API request, including serial fallback. A retry has a new request window and reuses existing Runs through Run idempotency. Firecrawl and Exa use the actual remaining time, reserving settlement and response time; less than 1 second of call time is refused."
|
|
65408
|
+
})
|
|
65409
|
+
),
|
|
65410
|
+
max_charge_usd: Schema_exports.optionalKey(
|
|
65411
|
+
UsdAmount.check(Schema_exports.isPattern(/^\d{1,12}\./)).annotate({
|
|
65412
|
+
description: "For scrape only. Maximum total Charge for Runs in this request, including replayed Runs. Before a new Run, settled Charges plus its maximum Charge must fit. An unsettled Run stops fallback. Omit for no caller cap; 0.00 allows no new paid Runs."
|
|
65413
|
+
})
|
|
65414
|
+
),
|
|
65415
|
+
cache_max_age_seconds: Schema_exports.optionalKey(
|
|
65416
|
+
Schema_exports.Int.check(Schema_exports.isBetween({ minimum: 0, maximum: 2592e3 })).annotate({
|
|
65417
|
+
description: "For scrape only. Maximum Provider cache age; 0 requires a live fetch. Routes without this control are excluded. Auto selects Firecrawl (milliseconds); explicit Exa receives whole hours rounded down. Unknown cache/fetch metadata remains null."
|
|
65418
|
+
})
|
|
65419
|
+
),
|
|
65420
|
+
time_range: Schema_exports.optionalKey(
|
|
65421
|
+
Schema_exports.Literals(WEB_RESEARCH_TIME_RANGES).annotate({
|
|
65422
|
+
description: "For search only: restrict results to the past day, week, month, or year using Google's time filter. Omit for any time. Auto uses only Providers that support this filter (Serper and SerpApi). Exa is refused when this field is supplied. This is a search-engine filter, not a verified publication date."
|
|
65423
|
+
})
|
|
65424
|
+
),
|
|
65019
65425
|
/**
|
|
65020
65426
|
* 搜索类 action 才有国家和语言;scrape / similar 是一个页面,没有。给了能用国家
|
|
65021
65427
|
* 的搜索却点名不看国家的 Provider(Exa、SerpApi 的 places / scholar)是 400,
|
|
@@ -65033,6 +65439,8 @@ var WebResearchRequest = Schema_exports.Struct({
|
|
|
65033
65439
|
),
|
|
65034
65440
|
...commonFields
|
|
65035
65441
|
});
|
|
65442
|
+
|
|
65443
|
+
// ../../packages/contract/src/solutions-company-intelligence.ts
|
|
65036
65444
|
var COMPANY_INTELLIGENCE_ACTIONS = [
|
|
65037
65445
|
"enrich",
|
|
65038
65446
|
"tech_stack",
|
|
@@ -65055,6 +65463,179 @@ var COMPANY_INTELLIGENCE_PROVIDERS = [
|
|
|
65055
65463
|
"exa",
|
|
65056
65464
|
"serper"
|
|
65057
65465
|
];
|
|
65466
|
+
var CiS = Schema_exports.NullOr(Schema_exports.String);
|
|
65467
|
+
var CiN = Schema_exports.NullOr(Schema_exports.Number);
|
|
65468
|
+
var CiI = Schema_exports.NullOr(Schema_exports.Int);
|
|
65469
|
+
var ciList = (fields) => Schema_exports.Struct({ items: Schema_exports.Array(Schema_exports.Struct(fields)) });
|
|
65470
|
+
var d = (schema2, description) => schema2.annotate({ description });
|
|
65471
|
+
var COMPANY_OWNERSHIP = [
|
|
65472
|
+
"public",
|
|
65473
|
+
"private",
|
|
65474
|
+
"nonprofit",
|
|
65475
|
+
"government",
|
|
65476
|
+
"education",
|
|
65477
|
+
"other"
|
|
65478
|
+
];
|
|
65479
|
+
var CompanyEnrichOutput = Schema_exports.Struct({
|
|
65480
|
+
name: d(CiS, "Company name as the Provider reports it."),
|
|
65481
|
+
website: d(CiS, "Company website as an http(s) URL."),
|
|
65482
|
+
description: d(CiS, "Short company description from the Provider."),
|
|
65483
|
+
industry: d(
|
|
65484
|
+
CiS,
|
|
65485
|
+
"Industry label in the answering Provider's own vocabulary (LinkedIn, GICS-style, ...). Not comparable across Providers; check `provider`."
|
|
65486
|
+
),
|
|
65487
|
+
employees: d(CiI, "Employee count. A Provider's own estimate, not an audited headcount."),
|
|
65488
|
+
employee_range_min: d(
|
|
65489
|
+
CiI,
|
|
65490
|
+
"Lower edge of the Provider's employee-size bucket (for example 10000 for 10K-50K)."
|
|
65491
|
+
),
|
|
65492
|
+
employee_range_max: d(
|
|
65493
|
+
CiI,
|
|
65494
|
+
"Upper edge of the Provider's employee-size bucket; null for an open-ended bucket such as 10000+."
|
|
65495
|
+
),
|
|
65496
|
+
founded_year: d(CiI, "Year the company was founded."),
|
|
65497
|
+
city: d(CiS, "Headquarters city."),
|
|
65498
|
+
region: d(CiS, "Headquarters state or region."),
|
|
65499
|
+
country: d(CiS, "Headquarters country as an English display name (never a code)."),
|
|
65500
|
+
country_code: d(CiS, "Headquarters country as an ISO 3166-1 alpha-2 code."),
|
|
65501
|
+
linkedin_url: d(CiS, "LinkedIn company page URL."),
|
|
65502
|
+
phone: d(CiS, "Headquarters phone number as the Provider reports it."),
|
|
65503
|
+
total_funding_usd: d(CiN, "Total funding raised, USD, as the Provider reports it."),
|
|
65504
|
+
revenue_usd: d(
|
|
65505
|
+
CiN,
|
|
65506
|
+
"Annual revenue as a single figure, USD: the Provider's estimate or reported number. Null when the Provider only gives a range (see revenue_range_min_usd / revenue_range_max_usd)."
|
|
65507
|
+
),
|
|
65508
|
+
revenue_range_min_usd: d(CiN, "Lower edge of the Provider's annual-revenue bucket, USD."),
|
|
65509
|
+
revenue_range_max_usd: d(
|
|
65510
|
+
CiN,
|
|
65511
|
+
"Upper edge of the Provider's annual-revenue bucket, USD; null for an open-ended bucket such as $10B+."
|
|
65512
|
+
),
|
|
65513
|
+
ownership: d(
|
|
65514
|
+
Schema_exports.NullOr(Schema_exports.Literals(COMPANY_OWNERSHIP)),
|
|
65515
|
+
"Ownership type mapped from the Provider's label. Null when the Provider does not say; private is never inferred."
|
|
65516
|
+
),
|
|
65517
|
+
ticker: d(CiS, "Stock ticker or public symbol, for public companies."),
|
|
65518
|
+
latest_funding_date: d(CiS, "Date of the latest funding round, YYYY-MM-DD.")
|
|
65519
|
+
});
|
|
65520
|
+
var CompanyTechStackOutput = ciList({
|
|
65521
|
+
name: d(Schema_exports.String, "Technology name."),
|
|
65522
|
+
categories: d(
|
|
65523
|
+
Schema_exports.Array(Schema_exports.String),
|
|
65524
|
+
"Category labels in the answering Provider's vocabulary (BuiltWith tag, DataForSEO group/category). Empty when the Provider gives none."
|
|
65525
|
+
),
|
|
65526
|
+
detection_source: d(
|
|
65527
|
+
Schema_exports.NullOr(Schema_exports.Literals(["website", "job_postings"])),
|
|
65528
|
+
"How the technology was detected: crawling the public website, or inferred from job postings (PredictLeads behind-the-firewall detections)."
|
|
65529
|
+
),
|
|
65530
|
+
predictleads_confidence: d(
|
|
65531
|
+
CiN,
|
|
65532
|
+
"PredictLeads detection confidence, 0-1. Null for other Providers."
|
|
65533
|
+
),
|
|
65534
|
+
first_detected_date: d(CiS, "First detection date, YYYY-MM-DD."),
|
|
65535
|
+
last_detected_date: d(CiS, "Latest detection date, YYYY-MM-DD.")
|
|
65536
|
+
});
|
|
65537
|
+
var CompanyTrafficOutput = Schema_exports.Struct({
|
|
65538
|
+
monthly_visits: d(
|
|
65539
|
+
CiI,
|
|
65540
|
+
"Monthly visits from all channels, worldwide (Similarweb panel estimate). Not scoped to country."
|
|
65541
|
+
),
|
|
65542
|
+
organic_traffic: d(
|
|
65543
|
+
CiN,
|
|
65544
|
+
"Estimated monthly organic search visits in the request country (default us); a search-model estimate."
|
|
65545
|
+
),
|
|
65546
|
+
paid_traffic: d(CiN, "Estimated monthly paid search visits in the request country (default us)."),
|
|
65547
|
+
organic_keywords: d(CiI, "Keywords the domain ranks for organically in the request country."),
|
|
65548
|
+
paid_keywords: d(CiI, "Keywords the domain bids on in the request country."),
|
|
65549
|
+
organic_traffic_value_usd: d(
|
|
65550
|
+
CiN,
|
|
65551
|
+
"Estimated monthly value of the organic traffic, USD (Ahrefs). Null for other Providers."
|
|
65552
|
+
),
|
|
65553
|
+
similarweb_global_rank: d(
|
|
65554
|
+
CiI,
|
|
65555
|
+
"Similarweb global rank (1 = most visited). Null for other Providers."
|
|
65556
|
+
),
|
|
65557
|
+
bounce_rate: d(CiN, "Bounce rate as a fraction 0-1 (Similarweb)."),
|
|
65558
|
+
pages_per_visit: d(CiN, "Pages per visit (Similarweb)."),
|
|
65559
|
+
avg_visit_duration_seconds: d(CiN, "Average visit duration in seconds (Similarweb).")
|
|
65560
|
+
});
|
|
65561
|
+
var CompanyCompetitorsOutput = ciList({
|
|
65562
|
+
domain: d(CiS, "The similar company's domain (hostname without www. or port)."),
|
|
65563
|
+
name: d(CiS, "The similar company's name. Null when the Provider returns web pages (Exa)."),
|
|
65564
|
+
page_title: d(CiS, "Title of the matched web page (Exa only); not a company name."),
|
|
65565
|
+
position: d(CiI, "1-based rank in the Provider's answer."),
|
|
65566
|
+
predictleads_similarity_score: d(
|
|
65567
|
+
CiN,
|
|
65568
|
+
"PredictLeads company-similarity score, 0-1. Null for other Providers."
|
|
65569
|
+
),
|
|
65570
|
+
exa_similarity_score: d(
|
|
65571
|
+
CiN,
|
|
65572
|
+
"Exa neural similarity between the company's website and the matched page. Null for other Providers."
|
|
65573
|
+
),
|
|
65574
|
+
reason: d(CiS, "Why the Provider considers the company similar (PredictLeads).")
|
|
65575
|
+
});
|
|
65576
|
+
var CompanyFundingOutput = Schema_exports.Struct({
|
|
65577
|
+
total_funding_usd: d(CiN, "Total funding raised, USD, as the Provider reports it."),
|
|
65578
|
+
items: Schema_exports.Array(
|
|
65579
|
+
Schema_exports.Struct({
|
|
65580
|
+
round_date: d(
|
|
65581
|
+
CiS,
|
|
65582
|
+
"Date of the round, YYYY-MM-DD. LeadMagic dates are month precision (day 01)."
|
|
65583
|
+
),
|
|
65584
|
+
round: d(CiS, "Round label in the answering Provider's vocabulary (seed, Series I, ...)."),
|
|
65585
|
+
amount_usd: d(CiN, "Amount raised in the round, USD. Null for other currencies."),
|
|
65586
|
+
investors: d(Schema_exports.Array(Schema_exports.String), "Investor names."),
|
|
65587
|
+
source_url: d(CiS, "Source article for the round (PredictLeads).")
|
|
65588
|
+
})
|
|
65589
|
+
)
|
|
65590
|
+
});
|
|
65591
|
+
var CompanyNewsOutput = ciList({
|
|
65592
|
+
title: d(CiS, "Headline."),
|
|
65593
|
+
url: d(CiS, "Article URL."),
|
|
65594
|
+
source: d(CiS, "Publisher name (Serper). Null when the Provider gives none."),
|
|
65595
|
+
published_at: d(CiS, "Article publication time, ISO 8601 UTC."),
|
|
65596
|
+
event_date: d(CiS, "Date the reported event happened, YYYY-MM-DD (PredictLeads)."),
|
|
65597
|
+
date_text: d(
|
|
65598
|
+
CiS,
|
|
65599
|
+
"The Provider's display date exactly as returned (Google News, may be relative to completed_at such as '3 hours ago'); never parsed."
|
|
65600
|
+
),
|
|
65601
|
+
category: d(CiS, "Event category in the Provider's vocabulary (PredictLeads)."),
|
|
65602
|
+
snippet: d(CiS, "Short excerpt.")
|
|
65603
|
+
});
|
|
65604
|
+
var COMPANY_INTELLIGENCE_OUTPUT_FIELDS = {
|
|
65605
|
+
enrich: "name, website, description, industry, employees, employee_range_min, employee_range_max, founded_year, city, region, country, country_code, linkedin_url, phone, total_funding_usd, revenue_usd, revenue_range_min_usd, revenue_range_max_usd, ownership, ticker, latest_funding_date",
|
|
65606
|
+
tech_stack: "items[]: name, categories[], detection_source, predictleads_confidence, first_detected_date, last_detected_date",
|
|
65607
|
+
traffic: "monthly_visits, organic_traffic, paid_traffic, organic_keywords, paid_keywords, organic_traffic_value_usd, similarweb_global_rank, bounce_rate, pages_per_visit, avg_visit_duration_seconds",
|
|
65608
|
+
competitors: "items[]: domain, name, page_title, position, predictleads_similarity_score, exa_similarity_score, reason",
|
|
65609
|
+
funding: "total_funding_usd, items[]: round_date, round, amount_usd, investors[], source_url",
|
|
65610
|
+
news: "items[]: title, url, source, published_at, event_date, date_text, category, snippet"
|
|
65611
|
+
};
|
|
65612
|
+
var CompanyIntelligenceResult = Schema_exports.Struct({
|
|
65613
|
+
...Run.fields,
|
|
65614
|
+
action: Schema_exports.Literals(COMPANY_INTELLIGENCE_ACTIONS),
|
|
65615
|
+
output: Schema_exports.NullOr(
|
|
65616
|
+
// 顺序有意义:编码取第一个匹配的成员,只有 items 的列表形状会吞掉 funding 的
|
|
65617
|
+
// total_funding_usd(items 为空时),所以带顶层字段的形状排在前面。
|
|
65618
|
+
Schema_exports.Union([
|
|
65619
|
+
CompanyEnrichOutput,
|
|
65620
|
+
CompanyTrafficOutput,
|
|
65621
|
+
CompanyFundingOutput,
|
|
65622
|
+
CompanyTechStackOutput,
|
|
65623
|
+
CompanyCompetitorsOutput,
|
|
65624
|
+
CompanyNewsOutput
|
|
65625
|
+
])
|
|
65626
|
+
).annotate({
|
|
65627
|
+
description: `Normalized fields per action. The Provider's native output is not repeated here; it stays on the Run (GET /v1/runs/:id). Values a Provider does not report are null; an empty answer is the action's shape with every field null, or items: [], with result_status no_result. Money is USD. Employees and revenue are the Provider's own estimates; *_range_min / *_range_max are the edges of the Provider's bucket. A score from a Provider's own model is named after the Provider (exa_similarity_score) and is null for the others. Labels such as industry, categories, round and category are in the answering Provider's vocabulary.
|
|
65628
|
+
|
|
65629
|
+
${Object.entries(
|
|
65630
|
+
COMPANY_INTELLIGENCE_OUTPUT_FIELDS
|
|
65631
|
+
).map(([action2, fields]) => `- ${action2}: ${fields}`).join("\n")}`
|
|
65632
|
+
}),
|
|
65633
|
+
result_status: Schema_exports.Literals(["success", "no_result", "error", "pending"]).annotate({
|
|
65634
|
+
description: "Business delivery status, independent of the final Run lifecycle in status. no_result is an empty but valid answer; error means the Provider output could not be delivered."
|
|
65635
|
+
}),
|
|
65636
|
+
...solutionResultFields
|
|
65637
|
+
}).annotate({ identifier: "CompanyIntelligenceResult" });
|
|
65638
|
+
var CompanyIntelligenceResultQuery = SolutionResultQuery;
|
|
65058
65639
|
var CompanyIntelligenceRequest = Schema_exports.Struct({
|
|
65059
65640
|
action: Schema_exports.optional(
|
|
65060
65641
|
Schema_exports.Literals(COMPANY_INTELLIGENCE_ACTIONS).annotate({
|
|
@@ -65072,6 +65653,177 @@ var CompanyIntelligenceRequest = Schema_exports.Struct({
|
|
|
65072
65653
|
),
|
|
65073
65654
|
...commonFields
|
|
65074
65655
|
});
|
|
65656
|
+
|
|
65657
|
+
// ../../packages/contract/src/solutions-market-data.ts
|
|
65658
|
+
var MARKET_DATA_ACTIONS = [
|
|
65659
|
+
"property_value",
|
|
65660
|
+
"property_rent",
|
|
65661
|
+
"property_search",
|
|
65662
|
+
"listings_sale",
|
|
65663
|
+
"listings_rental",
|
|
65664
|
+
"market_stats",
|
|
65665
|
+
"stock_quote"
|
|
65666
|
+
];
|
|
65667
|
+
var MARKET_DATA_PROVIDERS = ["rentcast", "serpapi"];
|
|
65668
|
+
var MdS = Schema_exports.NullOr(Schema_exports.String);
|
|
65669
|
+
var MdN = Schema_exports.NullOr(Schema_exports.Number);
|
|
65670
|
+
var MdI = Schema_exports.NullOr(Schema_exports.Int);
|
|
65671
|
+
var MdB = Schema_exports.NullOr(Schema_exports.Boolean);
|
|
65672
|
+
var property = {
|
|
65673
|
+
address: MdS,
|
|
65674
|
+
property_type: MdS,
|
|
65675
|
+
bedrooms: MdN,
|
|
65676
|
+
bathrooms: MdN,
|
|
65677
|
+
living_area_sqft: MdI,
|
|
65678
|
+
lot_size_sqft: MdI,
|
|
65679
|
+
year_built: MdI,
|
|
65680
|
+
latitude: MdN,
|
|
65681
|
+
longitude: MdN
|
|
65682
|
+
};
|
|
65683
|
+
var ListingContact = Schema_exports.NullOr(
|
|
65684
|
+
Schema_exports.Struct({ name: MdS, phone: MdS, email: MdS, website: MdS })
|
|
65685
|
+
);
|
|
65686
|
+
var PropertyValueOutput = Schema_exports.Struct({
|
|
65687
|
+
...property,
|
|
65688
|
+
estimated_value_usd: MdN,
|
|
65689
|
+
value_low_usd: MdN,
|
|
65690
|
+
value_high_usd: MdN,
|
|
65691
|
+
comparables_count: MdI
|
|
65692
|
+
});
|
|
65693
|
+
var PropertyRentOutput = Schema_exports.Struct({
|
|
65694
|
+
...property,
|
|
65695
|
+
estimated_rent_usd: MdN,
|
|
65696
|
+
rent_low_usd: MdN,
|
|
65697
|
+
rent_high_usd: MdN,
|
|
65698
|
+
comparables_count: MdI
|
|
65699
|
+
});
|
|
65700
|
+
var PropertySearchOutput = Schema_exports.Struct({
|
|
65701
|
+
items: Schema_exports.Array(
|
|
65702
|
+
Schema_exports.Struct({
|
|
65703
|
+
property_id: MdS,
|
|
65704
|
+
...property,
|
|
65705
|
+
last_sale_price_usd: MdN,
|
|
65706
|
+
last_sale_date: MdS,
|
|
65707
|
+
owner_names: Schema_exports.NullOr(Schema_exports.Array(Schema_exports.String)),
|
|
65708
|
+
owner_type: MdS,
|
|
65709
|
+
owner_mailing_address: MdS,
|
|
65710
|
+
owner_occupied: MdB
|
|
65711
|
+
})
|
|
65712
|
+
)
|
|
65713
|
+
});
|
|
65714
|
+
var listing = {
|
|
65715
|
+
listing_id: MdS,
|
|
65716
|
+
...property,
|
|
65717
|
+
status: MdS,
|
|
65718
|
+
listing_type: MdS,
|
|
65719
|
+
listed_date: MdS,
|
|
65720
|
+
days_on_market: MdI,
|
|
65721
|
+
hoa_fee_usd: MdN,
|
|
65722
|
+
mls_name: MdS,
|
|
65723
|
+
mls_number: MdS,
|
|
65724
|
+
agent: ListingContact,
|
|
65725
|
+
office: ListingContact
|
|
65726
|
+
};
|
|
65727
|
+
var SaleListingsOutput = Schema_exports.Struct({
|
|
65728
|
+
items: Schema_exports.Array(Schema_exports.Struct({ ...listing, price_usd: MdN }))
|
|
65729
|
+
});
|
|
65730
|
+
var RentalListingsOutput = Schema_exports.Struct({
|
|
65731
|
+
items: Schema_exports.Array(Schema_exports.Struct({ ...listing, monthly_rent_usd: MdN }))
|
|
65732
|
+
});
|
|
65733
|
+
var saleMarket = Schema_exports.Struct({
|
|
65734
|
+
average_price_usd: MdN,
|
|
65735
|
+
median_price_usd: MdN,
|
|
65736
|
+
average_price_per_sqft_usd: MdN,
|
|
65737
|
+
median_price_per_sqft_usd: MdN,
|
|
65738
|
+
average_days_on_market: MdN,
|
|
65739
|
+
median_days_on_market: MdN,
|
|
65740
|
+
total_listings: MdI,
|
|
65741
|
+
new_listings: MdI
|
|
65742
|
+
});
|
|
65743
|
+
var rentalMarket = Schema_exports.Struct({
|
|
65744
|
+
average_rent_usd: MdN,
|
|
65745
|
+
median_rent_usd: MdN,
|
|
65746
|
+
average_rent_per_sqft_usd: MdN,
|
|
65747
|
+
median_rent_per_sqft_usd: MdN,
|
|
65748
|
+
average_days_on_market: MdN,
|
|
65749
|
+
median_days_on_market: MdN,
|
|
65750
|
+
total_listings: MdI,
|
|
65751
|
+
new_listings: MdI
|
|
65752
|
+
});
|
|
65753
|
+
var MarketStatsOutput = Schema_exports.Struct({
|
|
65754
|
+
zip: MdS,
|
|
65755
|
+
updated_at: MdS,
|
|
65756
|
+
sale: Schema_exports.NullOr(saleMarket),
|
|
65757
|
+
rental: Schema_exports.NullOr(rentalMarket)
|
|
65758
|
+
});
|
|
65759
|
+
var StockQuoteOutput = Schema_exports.Struct({
|
|
65760
|
+
symbol: MdS,
|
|
65761
|
+
name: MdS,
|
|
65762
|
+
exchange: MdS,
|
|
65763
|
+
currency: MdS,
|
|
65764
|
+
price: MdN,
|
|
65765
|
+
change: MdN,
|
|
65766
|
+
change_percent: MdN,
|
|
65767
|
+
extended_hours_session: MdS,
|
|
65768
|
+
extended_hours_price: MdN,
|
|
65769
|
+
extended_hours_change: MdN,
|
|
65770
|
+
extended_hours_change_percent: MdN,
|
|
65771
|
+
as_of_text: MdS
|
|
65772
|
+
});
|
|
65773
|
+
var PROPERTY_FIELDS = "address, property_type, bedrooms, bathrooms, living_area_sqft (living area), lot_size_sqft, year_built, latitude, longitude";
|
|
65774
|
+
var LISTING_FIELDS = `listing_id, ${PROPERTY_FIELDS}, status, listing_type, listed_date (YYYY-MM-DD), days_on_market, hoa_fee_usd (monthly HOA fee), mls_name, mls_number, agent {name, phone, email, website}, office {name, phone, email, website}`;
|
|
65775
|
+
var MARKET_DATA_OUTPUT_FIELDS = {
|
|
65776
|
+
property_value: `${PROPERTY_FIELDS}, estimated_value_usd, value_low_usd, value_high_usd, comparables_count (number of comparable sales behind the estimate)`,
|
|
65777
|
+
property_rent: `${PROPERTY_FIELDS}, estimated_rent_usd (monthly), rent_low_usd, rent_high_usd, comparables_count (number of comparable rentals behind the estimate)`,
|
|
65778
|
+
property_search: `items[]: property_id, ${PROPERTY_FIELDS}, last_sale_price_usd, last_sale_date (YYYY-MM-DD), owner_names[], owner_type, owner_mailing_address, owner_occupied`,
|
|
65779
|
+
listings_sale: `items[]: ${LISTING_FIELDS}, price_usd (asking price)`,
|
|
65780
|
+
listings_rental: `items[]: ${LISTING_FIELDS}, monthly_rent_usd`,
|
|
65781
|
+
market_stats: "zip, updated_at (ISO 8601 UTC, when RentCast last refreshed the aggregate), sale {average_price_usd, median_price_usd, average_price_per_sqft_usd, median_price_per_sqft_usd, average_days_on_market, median_days_on_market, total_listings, new_listings}, rental {average_rent_usd, median_rent_usd, average_rent_per_sqft_usd, median_rent_per_sqft_usd (monthly rent), average_days_on_market, median_days_on_market, total_listings, new_listings}",
|
|
65782
|
+
stock_quote: "symbol, name, exchange, currency, price (regular-session last price, in currency; Google Finance quotes may be delayed), change (absolute, in currency, vs the previous regular close), change_percent (percent points vs the previous regular close: 1.5 = 1.5%), extended_hours_session (the session label as shown, e.g. Pre-market or After hours; null during regular hours), extended_hours_price, extended_hours_change and extended_hours_change_percent (the extended-hours quote vs the regular-session price, same units), as_of_text (the Google Finance page timestamp exactly as shown, not ISO and not the time of price)"
|
|
65783
|
+
};
|
|
65784
|
+
var MarketDataResult = Schema_exports.Struct({
|
|
65785
|
+
...Run.fields,
|
|
65786
|
+
action: Schema_exports.Literals(MARKET_DATA_ACTIONS),
|
|
65787
|
+
output: Schema_exports.NullOr(
|
|
65788
|
+
Schema_exports.Union([
|
|
65789
|
+
PropertyValueOutput,
|
|
65790
|
+
PropertyRentOutput,
|
|
65791
|
+
PropertySearchOutput,
|
|
65792
|
+
SaleListingsOutput,
|
|
65793
|
+
RentalListingsOutput,
|
|
65794
|
+
MarketStatsOutput,
|
|
65795
|
+
StockQuoteOutput
|
|
65796
|
+
])
|
|
65797
|
+
).annotate({
|
|
65798
|
+
description: `Normalized fields per action. The Provider's native output is not repeated here; it stays on the Run (GET /v1/runs/:id). Values a Provider does not report are null; an empty answer keeps the action's shape with every field null (or items: []) and result_status no_result. Money is USD unless the action carries a currency field. Dates named *_date are YYYY-MM-DD, *_at are ISO 8601 UTC, and *_text is display text exactly as returned.
|
|
65799
|
+
|
|
65800
|
+
${Object.entries(
|
|
65801
|
+
MARKET_DATA_OUTPUT_FIELDS
|
|
65802
|
+
).map(([action2, fields]) => `- ${action2}: ${fields}`).join("\n")}`
|
|
65803
|
+
}),
|
|
65804
|
+
result_status: Schema_exports.Literals(["success", "no_result", "error", "pending"]).annotate({
|
|
65805
|
+
description: "Business delivery status, independent of the final Run lifecycle in status. no_result is an empty but valid answer; error means the Provider output could not be delivered."
|
|
65806
|
+
}),
|
|
65807
|
+
...solutionResultFields
|
|
65808
|
+
}).annotate({ identifier: "MarketDataResult" });
|
|
65809
|
+
var MarketDataResultQuery = SolutionResultQuery;
|
|
65810
|
+
var MarketDataRequest = Schema_exports.Struct({
|
|
65811
|
+
action: Schema_exports.Literals(MARKET_DATA_ACTIONS).annotate({
|
|
65812
|
+
description: "Choose the data to retrieve:\n\n- property_value or property_rent: supply address.\n- property_search, listings_sale, or listings_rental: supply address, city plus state, or zip.\n- market_stats: supply zip.\n- stock_quote: supply symbol."
|
|
65813
|
+
}),
|
|
65814
|
+
provider: providerField(MARKET_DATA_PROVIDERS),
|
|
65815
|
+
/** 美国街道地址,如 "5500 Grand Lake Dr, San Antonio, TX 78244"。 */
|
|
65816
|
+
address: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(300))),
|
|
65817
|
+
city: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(100))),
|
|
65818
|
+
/** 两位州码。 */
|
|
65819
|
+
state: Schema_exports.optional(Schema_exports.String.check(Schema_exports.isPattern(/^[A-Za-z]{2}$/))),
|
|
65820
|
+
zip: Schema_exports.optional(Schema_exports.String.check(Schema_exports.isPattern(/^\d{5}$/))),
|
|
65821
|
+
/** 行情代码,如 "AAPL:NASDAQ"。 */
|
|
65822
|
+
symbol: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(40))),
|
|
65823
|
+
...commonFields
|
|
65824
|
+
});
|
|
65825
|
+
|
|
65826
|
+
// ../../packages/contract/src/solutions-people-search.ts
|
|
65075
65827
|
var PEOPLE_SEARCH_ACTIONS = ["search", "enrich", "find_email"];
|
|
65076
65828
|
var SENIORITIES = [
|
|
65077
65829
|
"owner",
|
|
@@ -65098,17 +65850,25 @@ var PEOPLE_SEARCH_PROVIDERS = [
|
|
|
65098
65850
|
var PeopleSearchRequest = Schema_exports.Struct({
|
|
65099
65851
|
action: Schema_exports.optional(
|
|
65100
65852
|
Schema_exports.Literals(PEOPLE_SEARCH_ACTIONS).annotate({
|
|
65101
|
-
description: "Default: search.\n\n- search: supply at least one of job_titles, seniorities, locations, company_domain, or keywords.\n- enrich: supply linkedin_url, email, or full_name plus company_domain.\n- find_email: supply full_name and company_domain.\n\nFilters are never silently dropped. With auto, Providers that cannot apply them are skipped; a named Provider that cannot apply them returns 400."
|
|
65853
|
+
description: "Default: search.\n\n- search: supply at least one of job_titles, seniorities, locations, company_domain, or keywords. Apollo and ZoomInfo rows carry no email or phone; PDL rows are full records; Hunter lists the personal addresses at company_domain.\n- enrich: supply linkedin_url, email, or full_name plus company_domain. Prospeo returns only people it holds a verified work email for.\n- find_email: supply full_name and company_domain. Apollo also accepts linkedin_url alone; an Apollo match without a real email is a miss and is not charged.\n\nFilters are never silently dropped. With auto, Providers that cannot apply them are skipped; a named Provider that cannot apply them returns 400.\n\nThe output is the answering Provider's native body, so its shape differs per Provider: read run.provider before parsing it."
|
|
65102
65854
|
})
|
|
65103
65855
|
),
|
|
65104
65856
|
provider: providerField(PEOPLE_SEARCH_PROVIDERS),
|
|
65105
|
-
job_titles: Schema_exports.optional(
|
|
65857
|
+
job_titles: Schema_exports.optional(
|
|
65858
|
+
StringList.annotate({
|
|
65859
|
+
description: "Job titles to match. PDL matches each title exactly as given, so 'CTO' does not match 'Co-founder & CTO'."
|
|
65860
|
+
})
|
|
65861
|
+
),
|
|
65106
65862
|
seniorities: Schema_exports.optional(
|
|
65107
65863
|
Schema_exports.Array(Seniority).check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(SENIORITIES.length)).annotate({
|
|
65108
|
-
description: `Seniority levels, one or more of ${SENIORITIES.join(", ")}.`
|
|
65864
|
+
description: `Seniority levels, one or more of ${SENIORITIES.join(", ")}. A Provider without a matching level returns 400 when named and is skipped under auto. ZoomInfo has no founder, owner, partner, head, entry or intern level; its senior is the whole Non Manager tier, which also includes junior individual contributors.`
|
|
65865
|
+
})
|
|
65866
|
+
),
|
|
65867
|
+
locations: Schema_exports.optional(
|
|
65868
|
+
StringList.annotate({
|
|
65869
|
+
description: "Locations as free text. PDL matches each as a substring of the person's location name, so 'london' also matches 'new london, connecticut'."
|
|
65109
65870
|
})
|
|
65110
65871
|
),
|
|
65111
|
-
locations: Schema_exports.optional(StringList),
|
|
65112
65872
|
company_domain: Schema_exports.optional(Domain),
|
|
65113
65873
|
keywords: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(300))),
|
|
65114
65874
|
full_name: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(200))),
|
|
@@ -65131,37 +65891,67 @@ var PeopleSearchRequest = Schema_exports.Struct({
|
|
|
65131
65891
|
),
|
|
65132
65892
|
...commonFields
|
|
65133
65893
|
});
|
|
65134
|
-
|
|
65135
|
-
|
|
65136
|
-
|
|
65137
|
-
|
|
65138
|
-
|
|
65139
|
-
|
|
65140
|
-
|
|
65141
|
-
|
|
65142
|
-
|
|
65143
|
-
|
|
65144
|
-
|
|
65145
|
-
|
|
65146
|
-
|
|
65147
|
-
|
|
65148
|
-
|
|
65149
|
-
|
|
65150
|
-
|
|
65151
|
-
|
|
65152
|
-
|
|
65894
|
+
|
|
65895
|
+
// ../../packages/contract/src/solutions-seo-research.ts
|
|
65896
|
+
var SeoResearchResult = Schema_exports.Struct({
|
|
65897
|
+
...Run.fields,
|
|
65898
|
+
action: Schema_exports.Literals(SEO_RESEARCH_ACTIONS),
|
|
65899
|
+
output: Schema_exports.NullOr(
|
|
65900
|
+
Schema_exports.Union([
|
|
65901
|
+
SeoKeywordOverviewOutput,
|
|
65902
|
+
SeoSerpOutput,
|
|
65903
|
+
SeoDomainOverviewOutput,
|
|
65904
|
+
SeoRankedKeywordsOutput,
|
|
65905
|
+
SeoOrganicCompetitorsOutput,
|
|
65906
|
+
SeoBacklinksOverviewOutput,
|
|
65907
|
+
SeoBacklinksOutput,
|
|
65908
|
+
SeoReferringDomainsOutput,
|
|
65909
|
+
SeoDomainRatingOutput,
|
|
65910
|
+
SeoSiteAuditOutput,
|
|
65911
|
+
SeoKeywordGapOutput,
|
|
65912
|
+
SeoBacklinkGapOutput,
|
|
65913
|
+
SeoPageAuditOutput,
|
|
65914
|
+
SeoVisibilityHistoryOutput,
|
|
65915
|
+
SeoAiCitationsOutput,
|
|
65916
|
+
SeoAiVisibilityOutput
|
|
65917
|
+
])
|
|
65918
|
+
).annotate({
|
|
65919
|
+
description: `Normalized fields per action. The Provider's native output is not repeated here; it stays on the Run (GET /v1/runs/:id). Values a Provider does not report are null. Money is USD. Authority scores keep the answering Provider's own metric and name and are never converted: ahrefs_domain_rating (Ahrefs Domain Rating, 0\u2013100), semrush_authority_score (Semrush Authority Score, 0\u2013100), dataforseo_rank (DataForSEO rank, 0\u20131000), serpstat_domain_rank (Serpstat Domain Rank, 0\u2013100). Keyword difficulty is split the same way (semrush_keyword_difficulty, serpstat_keyword_difficulty, dataforseo_keyword_difficulty, ahrefs_keyword_difficulty, each 0\u2013100 on its own model). Only the field of the Provider that answered is filled; the others are null. volume, traffic and cpc are the answering Provider's estimates; compare them only within one Provider (runs[].provider). An empty answer (result_status no_result) keeps the action's shape: items is [], or every field is null.
|
|
65920
|
+
|
|
65921
|
+
${Object.entries(
|
|
65922
|
+
SEO_RESEARCH_OUTPUT_FIELDS
|
|
65923
|
+
).map(([action2, fields]) => `- ${action2}: ${fields}`).join("\n")}`
|
|
65924
|
+
}),
|
|
65925
|
+
result_status: Schema_exports.Literals(["success", "no_result", "error", "pending"]).annotate({
|
|
65926
|
+
description: "Business delivery status, independent of the final Run lifecycle in status. no_result is an empty but valid answer; error means the Provider output could not be delivered."
|
|
65927
|
+
}),
|
|
65928
|
+
...solutionResultFields
|
|
65929
|
+
}).annotate({ identifier: "SeoResearchResult" });
|
|
65930
|
+
var SeoResearchResultQuery = SolutionResultQuery;
|
|
65153
65931
|
var SeoResearchRequest = Schema_exports.Struct({
|
|
65154
65932
|
action: Schema_exports.optional(
|
|
65155
65933
|
Schema_exports.Literals(SEO_RESEARCH_ACTIONS).annotate({
|
|
65156
|
-
description: "Default: keyword_overview.\n\n- keyword_overview: supply one or more keywords.\n- keyword_ideas or serp: supply exactly one keyword in keywords.\n- All other actions: supply domain. organic_competitors finds domains ranking for the same keywords."
|
|
65934
|
+
description: "Default: keyword_overview.\n\n- keyword_overview: supply one or more keywords.\n- keyword_ideas or serp: supply exactly one keyword in keywords.\n- site_audit: supply domain; limit is the number of pages to crawl (default 20, at most 100). The crawl runs asynchronously.\n- keyword_gap and backlink_gap: supply domain and one to four competitors.\n- page_audit: supply url (one page).\n- visibility_history: supply domain; limit is the number of months (default 12, at most 24).\n- All other actions: supply domain. organic_competitors finds domains ranking for the same keywords; ai_visibility: AI-answer visibility in the answering Provider's own metric (Ahrefs: citations of the domain's pages; DataForSEO: LLM mentions of the domain); ai_citations: pages most cited in AI answers that mention the domain, from any site.\n- keyword_gap rows differ by Provider: Semrush returns keywords any of the domains ranks for (union); DataForSEO returns keywords the competitor ranks for and you do not."
|
|
65157
65935
|
})
|
|
65158
65936
|
),
|
|
65159
65937
|
provider: providerField(SEO_RESEARCH_PROVIDERS),
|
|
65160
65938
|
keywords: Schema_exports.optional(StringList),
|
|
65161
65939
|
domain: Schema_exports.optional(Domain),
|
|
65940
|
+
competitors: Schema_exports.optional(
|
|
65941
|
+
Schema_exports.Array(Domain).check(Schema_exports.isMinLength(1), Schema_exports.isMaxLength(4)).annotate({
|
|
65942
|
+
description: "Competitor domains for keyword_gap and backlink_gap, one to four. Full URLs are reduced to their host."
|
|
65943
|
+
})
|
|
65944
|
+
),
|
|
65945
|
+
url: Schema_exports.optional(
|
|
65946
|
+
NonEmpty.check(Schema_exports.isMaxLength(2048)).annotate({
|
|
65947
|
+
description: "One page URL for page_audit, such as https://stripe.com/pricing."
|
|
65948
|
+
})
|
|
65949
|
+
),
|
|
65162
65950
|
country: Schema_exports.optional(CountryCode),
|
|
65163
65951
|
...commonFields
|
|
65164
65952
|
});
|
|
65953
|
+
|
|
65954
|
+
// ../../packages/contract/src/solutions-social-research.ts
|
|
65165
65955
|
var SOCIAL_PLATFORMS = [
|
|
65166
65956
|
"reddit",
|
|
65167
65957
|
"x",
|
|
@@ -65172,6 +65962,109 @@ var SOCIAL_PLATFORMS = [
|
|
|
65172
65962
|
];
|
|
65173
65963
|
var SOCIAL_MODES = ["search", "profile", "feed", "post", "find"];
|
|
65174
65964
|
var SOCIAL_RESEARCH_PROVIDERS = ["scrapecreators", "apify", "tikhub", "pdl"];
|
|
65965
|
+
var SoS = Schema_exports.NullOr(Schema_exports.String);
|
|
65966
|
+
var SoI = Schema_exports.NullOr(Schema_exports.Int);
|
|
65967
|
+
var d2 = (schema2, description) => schema2.annotate({ description });
|
|
65968
|
+
var socialPost = {
|
|
65969
|
+
id: d2(
|
|
65970
|
+
SoS,
|
|
65971
|
+
"The platform's post id. LinkedIn: the bare activity id (no urn:li:activity: prefix)."
|
|
65972
|
+
),
|
|
65973
|
+
url: SoS,
|
|
65974
|
+
title: d2(SoS, "Reddit and YouTube title; null on other platforms."),
|
|
65975
|
+
text: d2(
|
|
65976
|
+
SoS,
|
|
65977
|
+
"The post body: Reddit self-text, YouTube description, the tweet, caption or post text. Null when the Provider returns no body (a Reddit link post, a YouTube search result)."
|
|
65978
|
+
),
|
|
65979
|
+
author: d2(
|
|
65980
|
+
SoS,
|
|
65981
|
+
"Display name, or the handle where the platform shows no other name (X, TikTok, Instagram, Reddit)."
|
|
65982
|
+
),
|
|
65983
|
+
author_url: SoS,
|
|
65984
|
+
published_at: d2(SoS, "ISO 8601 UTC publish time; null when the Provider gives no exact time."),
|
|
65985
|
+
likes: d2(
|
|
65986
|
+
SoI,
|
|
65987
|
+
"Reddit: net score (upvotes minus downvotes, can be negative). X: favorites. TikTok: diggs. Others: likes or reactions."
|
|
65988
|
+
),
|
|
65989
|
+
comments: SoI,
|
|
65990
|
+
shares: d2(
|
|
65991
|
+
SoI,
|
|
65992
|
+
"X: retweets. TikTok: share count (share-sheet sends, not reposts). LinkedIn: reposts. Null on Reddit, YouTube and Instagram."
|
|
65993
|
+
),
|
|
65994
|
+
views: d2(
|
|
65995
|
+
SoI,
|
|
65996
|
+
"X: impressions. TikTok: plays. YouTube: views. Instagram: video views. Null on Reddit and LinkedIn."
|
|
65997
|
+
)
|
|
65998
|
+
};
|
|
65999
|
+
var SocialProfileOutput = Schema_exports.Struct({
|
|
66000
|
+
platform: SoS,
|
|
66001
|
+
handle: SoS,
|
|
66002
|
+
name: SoS,
|
|
66003
|
+
url: SoS,
|
|
66004
|
+
bio: d2(SoS, "Free-text description (LinkedIn: the About section)."),
|
|
66005
|
+
headline: d2(SoS, "LinkedIn person headline (job title line); null on other platforms."),
|
|
66006
|
+
website: d2(
|
|
66007
|
+
SoS,
|
|
66008
|
+
"The account's own website: LinkedIn company website, X profile link (expanded, never t.co); null elsewhere."
|
|
66009
|
+
),
|
|
66010
|
+
followers: d2(SoI, "Followers; Reddit: subreddit subscribers; YouTube: subscribers."),
|
|
66011
|
+
following: d2(SoI, "Accounts this account follows. Null on Reddit, YouTube and LinkedIn."),
|
|
66012
|
+
posts: SoI,
|
|
66013
|
+
verified: Schema_exports.NullOr(Schema_exports.Boolean)
|
|
66014
|
+
});
|
|
66015
|
+
var SocialPostsOutput = Schema_exports.Struct({ items: Schema_exports.Array(Schema_exports.Struct(socialPost)) });
|
|
66016
|
+
var SocialPostOutput = Schema_exports.Struct(socialPost);
|
|
66017
|
+
var SocialProfilesOutput = Schema_exports.Struct({
|
|
66018
|
+
profiles: Schema_exports.Array(
|
|
66019
|
+
Schema_exports.Struct({
|
|
66020
|
+
platform: d2(
|
|
66021
|
+
SoS,
|
|
66022
|
+
"Lower-case network name. The six social_research platforms use their request names (twitter is x); other networks (facebook, github, \u2026) pass through."
|
|
66023
|
+
),
|
|
66024
|
+
url: SoS,
|
|
66025
|
+
handle: d2(
|
|
66026
|
+
SoS,
|
|
66027
|
+
"The username on that network, usable as social_research `handle`; null when the Provider has none."
|
|
66028
|
+
),
|
|
66029
|
+
scrapecreators_confidence: d2(
|
|
66030
|
+
Schema_exports.NullOr(Schema_exports.Number),
|
|
66031
|
+
"ScrapeCreators' 0\u20131 confidence that this profile belongs to the account. Null on other Providers."
|
|
66032
|
+
),
|
|
66033
|
+
followers: d2(SoI, "reddit.find: subreddit subscribers. Null on other platforms.")
|
|
66034
|
+
})
|
|
66035
|
+
),
|
|
66036
|
+
pdl_likelihood: d2(
|
|
66037
|
+
SoI,
|
|
66038
|
+
"People Data Labs' 1\u201310 score for how well the person record matches the input; it covers the whole person, not one profile. linkedin.find only; null elsewhere."
|
|
66039
|
+
)
|
|
66040
|
+
});
|
|
66041
|
+
var SOCIAL_RESEARCH_OUTPUT_FIELDS = {
|
|
66042
|
+
profile: "platform, handle, name, url, bio, headline, website, followers, following, posts, verified",
|
|
66043
|
+
search: "items[]: id, url, title, text, author, author_url, published_at, likes, comments, shares, views",
|
|
66044
|
+
feed: "items[]: same post fields as search",
|
|
66045
|
+
post: "id, url, title, text, author, author_url, published_at, likes, comments, shares, views",
|
|
66046
|
+
find: "profiles[]: platform, url, handle, scrapecreators_confidence, followers (Reddit: matching subreddits); pdl_likelihood"
|
|
66047
|
+
};
|
|
66048
|
+
var SocialResearchResult = Schema_exports.Struct({
|
|
66049
|
+
...Run.fields,
|
|
66050
|
+
action: Schema_exports.String.check(Schema_exports.isPattern(/^[a-z]+\.[a-z]+$/)).annotate({
|
|
66051
|
+
description: "`<platform>.<mode>`; a LinkedIn company page in profile mode is linkedin.company."
|
|
66052
|
+
}),
|
|
66053
|
+
output: Schema_exports.NullOr(
|
|
66054
|
+
Schema_exports.Union([SocialProfileOutput, SocialPostsOutput, SocialPostOutput, SocialProfilesOutput])
|
|
66055
|
+
).annotate({
|
|
66056
|
+
description: `Normalized fields per mode, shared by every platform. The Provider's native output is not repeated here; it stays on the Run (GET /v1/runs/:id). Values a platform or Provider does not report are null.
|
|
66057
|
+
|
|
66058
|
+
${Object.entries(
|
|
66059
|
+
SOCIAL_RESEARCH_OUTPUT_FIELDS
|
|
66060
|
+
).map(([mode, fields]) => `- ${mode}: ${fields}`).join("\n")}`
|
|
66061
|
+
}),
|
|
66062
|
+
result_status: Schema_exports.Literals(["success", "no_result", "error", "pending"]).annotate({
|
|
66063
|
+
description: "Business delivery status, independent of the final Run lifecycle in status. no_result is an empty but valid answer; error means the Provider output could not be delivered."
|
|
66064
|
+
}),
|
|
66065
|
+
...solutionResultFields
|
|
66066
|
+
}).annotate({ identifier: "SocialResearchResult" });
|
|
66067
|
+
var SocialResearchResultQuery = SolutionResultQuery;
|
|
65175
66068
|
var SocialResearchRequest = Schema_exports.Struct({
|
|
65176
66069
|
platform: Schema_exports.Literals(SOCIAL_PLATFORMS),
|
|
65177
66070
|
mode: Schema_exports.optional(
|
|
@@ -65191,31 +66084,19 @@ var SocialResearchRequest = Schema_exports.Struct({
|
|
|
65191
66084
|
// 不用 commonFields(没有 limit),metadata 单独加;它也没有 task_id,那是另一个缺口。
|
|
65192
66085
|
metadata: commonFields.metadata
|
|
65193
66086
|
});
|
|
65194
|
-
|
|
65195
|
-
|
|
65196
|
-
|
|
65197
|
-
|
|
65198
|
-
|
|
65199
|
-
"
|
|
65200
|
-
"
|
|
65201
|
-
"
|
|
66087
|
+
|
|
66088
|
+
// ../../packages/contract/src/solutions.ts
|
|
66089
|
+
var SOLUTION_IDS = ["gtm"];
|
|
66090
|
+
var SolutionId = Schema_exports.Literals(SOLUTION_IDS);
|
|
66091
|
+
var GTM_CAPABILITIES = [
|
|
66092
|
+
"web_research",
|
|
66093
|
+
"company_intelligence",
|
|
66094
|
+
"people_search",
|
|
66095
|
+
"seo_research",
|
|
66096
|
+
"social_research",
|
|
66097
|
+
"market_data"
|
|
65202
66098
|
];
|
|
65203
|
-
var
|
|
65204
|
-
var MarketDataRequest = Schema_exports.Struct({
|
|
65205
|
-
action: Schema_exports.Literals(MARKET_DATA_ACTIONS).annotate({
|
|
65206
|
-
description: "Choose the data to retrieve:\n\n- property_value or property_rent: supply address.\n- property_search, listings_sale, or listings_rental: supply address, city plus state, or zip.\n- market_stats: supply zip.\n- stock_quote: supply symbol."
|
|
65207
|
-
}),
|
|
65208
|
-
provider: providerField(MARKET_DATA_PROVIDERS),
|
|
65209
|
-
/** 美国街道地址,如 "5500 Grand Lake Dr, San Antonio, TX 78244"。 */
|
|
65210
|
-
address: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(300))),
|
|
65211
|
-
city: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(100))),
|
|
65212
|
-
/** 两位州码。 */
|
|
65213
|
-
state: Schema_exports.optional(Schema_exports.String.check(Schema_exports.isPattern(/^[A-Za-z]{2}$/))),
|
|
65214
|
-
zip: Schema_exports.optional(Schema_exports.String.check(Schema_exports.isPattern(/^\d{5}$/))),
|
|
65215
|
-
/** 行情代码,如 "AAPL:NASDAQ"。 */
|
|
65216
|
-
symbol: Schema_exports.optional(NonEmpty.check(Schema_exports.isMaxLength(40))),
|
|
65217
|
-
...commonFields
|
|
65218
|
-
});
|
|
66099
|
+
var GtmCapability = Schema_exports.Literals(GTM_CAPABILITIES);
|
|
65219
66100
|
|
|
65220
66101
|
// ../../packages/contract/src/api.ts
|
|
65221
66102
|
var RunTerminal = Run.check(
|
|
@@ -65228,6 +66109,41 @@ var RunInFlight = Run.check(
|
|
|
65228
66109
|
description: "an in-flight run: QUEUED or RUNNING"
|
|
65229
66110
|
})
|
|
65230
66111
|
).pipe(HttpApiSchema_exports.status(202));
|
|
66112
|
+
var WebResearchResponse = Schema_exports.Union([WebResearchResult]);
|
|
66113
|
+
var WebResearchTerminal = WebResearchResponse.check(
|
|
66114
|
+
Schema_exports.makeFilter((result3) => isTerminalRunStatus(result3.status))
|
|
66115
|
+
).pipe(HttpApiSchema_exports.status(200));
|
|
66116
|
+
var WebResearchInFlight = WebResearchResponse.check(
|
|
66117
|
+
Schema_exports.makeFilter((result3) => !isTerminalRunStatus(result3.status))
|
|
66118
|
+
).pipe(HttpApiSchema_exports.status(202));
|
|
66119
|
+
var CompanyIntelligenceResponse = Schema_exports.Union([CompanyIntelligenceResult]);
|
|
66120
|
+
var CompanyIntelligenceTerminal = CompanyIntelligenceResponse.check(
|
|
66121
|
+
Schema_exports.makeFilter((result3) => isTerminalRunStatus(result3.status))
|
|
66122
|
+
).pipe(HttpApiSchema_exports.status(200));
|
|
66123
|
+
var CompanyIntelligenceInFlight = CompanyIntelligenceResponse.check(
|
|
66124
|
+
Schema_exports.makeFilter((result3) => !isTerminalRunStatus(result3.status))
|
|
66125
|
+
).pipe(HttpApiSchema_exports.status(202));
|
|
66126
|
+
var MarketDataResponse = Schema_exports.Union([MarketDataResult]);
|
|
66127
|
+
var MarketDataTerminal = MarketDataResponse.check(
|
|
66128
|
+
Schema_exports.makeFilter((result3) => isTerminalRunStatus(result3.status))
|
|
66129
|
+
).pipe(HttpApiSchema_exports.status(200));
|
|
66130
|
+
var MarketDataInFlight = MarketDataResponse.check(
|
|
66131
|
+
Schema_exports.makeFilter((result3) => !isTerminalRunStatus(result3.status))
|
|
66132
|
+
).pipe(HttpApiSchema_exports.status(202));
|
|
66133
|
+
var SocialResearchResponse = Schema_exports.Union([SocialResearchResult]);
|
|
66134
|
+
var SocialResearchTerminal = SocialResearchResponse.check(
|
|
66135
|
+
Schema_exports.makeFilter((result3) => isTerminalRunStatus(result3.status))
|
|
66136
|
+
).pipe(HttpApiSchema_exports.status(200));
|
|
66137
|
+
var SocialResearchInFlight = SocialResearchResponse.check(
|
|
66138
|
+
Schema_exports.makeFilter((result3) => !isTerminalRunStatus(result3.status))
|
|
66139
|
+
).pipe(HttpApiSchema_exports.status(202));
|
|
66140
|
+
var SeoResearchResponse = Schema_exports.Union([SeoResearchResult]);
|
|
66141
|
+
var SeoResearchTerminal = SeoResearchResponse.check(
|
|
66142
|
+
Schema_exports.makeFilter((result3) => isTerminalRunStatus(result3.status))
|
|
66143
|
+
).pipe(HttpApiSchema_exports.status(200));
|
|
66144
|
+
var SeoResearchInFlight = SeoResearchResponse.check(
|
|
66145
|
+
Schema_exports.makeFilter((result3) => !isTerminalRunStatus(result3.status))
|
|
66146
|
+
).pipe(HttpApiSchema_exports.status(202));
|
|
65231
66147
|
var IdempotencyKeyHeaders = Schema_exports.Struct({
|
|
65232
66148
|
"idempotency-key": Schema_exports.String.check(Schema_exports.isMinLength(1)).annotate({
|
|
65233
66149
|
description: "Generate a unique value for each intended execution (a UUID is recommended). Retry with the same key and execution parameters to retrieve the original Run without a second charge. Changing execution parameters with the same key returns 409; changing task_id or metadata does not update the original Run."
|
|
@@ -65333,26 +66249,54 @@ var solutions = HttpApiGroup_exports.make("Solutions").add(
|
|
|
65333
66249
|
HttpApiEndpoint_exports.post("gtm-web-research", "/v1/solutions/gtm/web_research", {
|
|
65334
66250
|
payload: WebResearchRequest,
|
|
65335
66251
|
headers: IdempotencyKeyHeaders,
|
|
65336
|
-
success: [
|
|
66252
|
+
success: [WebResearchTerminal, WebResearchInFlight],
|
|
65337
66253
|
error: solutionRunErrors
|
|
65338
66254
|
}).annotateMerge(
|
|
65339
66255
|
operation(
|
|
65340
66256
|
"gtm-web-research",
|
|
65341
66257
|
"Web research",
|
|
65342
|
-
|
|
66258
|
+
"Search and retrieve public web content. Every action returns normalized output with the last Run's id, provider and lifecycle status: search gives output.results[], news / places / scholar / shopping / images / videos / similar give output.items[] with fixed fields per row, answer gives output.answer plus citations[], and scrape gives fixed content fields.\n\nFor scrape, read output.text, output.markdown, output.html and output.raw_html. Missing formats are null; no HTML-to-text conversion is performed. The Provider's native output is not repeated in output; read it from the Run with GET /v1/runs/:id. For search, read output.results[].\n\nRead result_status separately from status: success, partial, no_result, error or pending. COMPLETED means the final Run settled with a Provider response; it does not prove usable content. output is null on delivery failure or while pending. partial lists missing_formats. Content semantics remain unverified; text wording and length do not judge quality.\n\ncharge_usd is the total of this response's runs, including paid failures and empty results. It is null until every listed Run settles. runs[] contains individual charges, statuses and charge_basis without duplicate bodies. A multi-Run total has charge_basis=null. The response is a Solution result, not the stored Run. GET /v1/runs/:id remains native and has an individual charge.\n\nFor QUEUED/RUNNING (HTTP 202), poll the authenticated result_url on the API origin. That read returns the same normalized contract and total, creates no Runs and does not resume fallback. Terminal results return HTTP 200, including business errors; inspect result_status and error. Reuse the same Idempotency-Key and execution parameters for an intentional retry.\n\nScrape auto uses Serper then Firecrawl within a default 30000 ms request budget. HTML or explicit cache age goes directly to Firecrawl. X/Twitter and LinkedIn enrichment exclude Firecrawl; Exa and DataForSEO are explicit-only. A named Provider never falls back. Empty/invalid output, Provider errors, timeout and missing supported formats can trigger fallback when another route can improve delivery. No cross-Provider content merge. If no Run is admitted, return the admission error.\n\nWhen formats is omitted, Serper/Exa check text and Firecrawl/DataForSEO check markdown; all available native formats are mapped into output. max_charge_usd covers all Runs in this request, including replays. Budgets are held only in request memory; retrying starts a new time window but cannot change an existing Run deadline.\n\nSearch time_range supports day, week, month and year. Auto selects a Provider that supports the filter. Empty search results do not trigger paid fallback."
|
|
66259
|
+
)
|
|
66260
|
+
)
|
|
66261
|
+
).add(
|
|
66262
|
+
HttpApiEndpoint_exports.get("gtm-web-research-result", "/v1/solutions/gtm/web_research/result", {
|
|
66263
|
+
query: WebResearchResultQuery,
|
|
66264
|
+
success: WebResearchResult,
|
|
66265
|
+
error: [ERROR_WIRE.ValidationFailed, ERROR_WIRE.NotFound]
|
|
66266
|
+
}).annotateMerge(
|
|
66267
|
+
operation(
|
|
66268
|
+
"gtm-web-research-result",
|
|
66269
|
+
"Read a web research result",
|
|
66270
|
+
"Follow result_url from search or scrape to read normalized output, business result_status and the total charge of the same Runs. HTTP 200 may still contain result_status=pending. This authenticated read creates no Runs, calls no Providers and does not resume fallback or reset budgets. GET /v1/runs/:id remains the native individual Run. The result context is signed, bound to the Workspace and checked against the current Key policy for every Run."
|
|
65343
66271
|
)
|
|
65344
66272
|
)
|
|
65345
66273
|
).add(
|
|
65346
66274
|
HttpApiEndpoint_exports.post("gtm-company-intelligence", "/v1/solutions/gtm/company_intelligence", {
|
|
65347
66275
|
payload: CompanyIntelligenceRequest,
|
|
65348
66276
|
headers: IdempotencyKeyHeaders,
|
|
65349
|
-
success: [
|
|
66277
|
+
success: [CompanyIntelligenceTerminal, CompanyIntelligenceInFlight],
|
|
65350
66278
|
error: solutionRunErrors
|
|
65351
66279
|
}).annotateMerge(
|
|
65352
66280
|
operation(
|
|
65353
66281
|
"gtm-company-intelligence",
|
|
65354
66282
|
"Company intelligence",
|
|
65355
|
-
|
|
66283
|
+
"Look up a company by domain: profile and firmographics, technology stack, website traffic, similar businesses, funding history and news. Choose an action and supply the domain.\n\nEvery action returns normalized output with the last Run's id, provider and lifecycle status: enrich and traffic give fixed top-level fields, tech_stack / competitors / news give output.items[] with fixed fields per row, funding gives total_funding_usd plus items[]. The Provider's native output is not repeated in output; it stays on the Run and is readable with GET /v1/runs/:id. A value the selected Provider does not report is null; money is always USD.\n\nRead result_status separately from status: success, no_result, error or pending. charge_usd is the total of this response's runs and is null until every listed Run settles; runs[] carries each Run's charge. provider=auto selects the first eligible Provider and tries the next only on PROVIDER_ERROR, TIMED_OUT, or a 503 at admission; a named Provider never falls back. For QUEUED/RUNNING (HTTP 202, today only traffic via Apify), poll the authenticated result_url on the API origin. Reuse the same Idempotency-Key and execution parameters for an intentional retry."
|
|
66284
|
+
)
|
|
66285
|
+
)
|
|
66286
|
+
).add(
|
|
66287
|
+
HttpApiEndpoint_exports.get(
|
|
66288
|
+
"gtm-company-intelligence-result",
|
|
66289
|
+
"/v1/solutions/gtm/company_intelligence/result",
|
|
66290
|
+
{
|
|
66291
|
+
query: CompanyIntelligenceResultQuery,
|
|
66292
|
+
success: CompanyIntelligenceResult,
|
|
66293
|
+
error: [ERROR_WIRE.ValidationFailed, ERROR_WIRE.NotFound]
|
|
66294
|
+
}
|
|
66295
|
+
).annotateMerge(
|
|
66296
|
+
operation(
|
|
66297
|
+
"gtm-company-intelligence-result",
|
|
66298
|
+
"Read a company intelligence result",
|
|
66299
|
+
"Follow result_url from a company intelligence call to read normalized output, business result_status and the total charge of the same Runs. HTTP 200 may still contain result_status=pending. This authenticated read creates no Runs, calls no Providers and does not resume fallback. GET /v1/runs/:id remains the native individual Run. The result context is signed, bound to the Workspace and checked against the current Key policy for every Run."
|
|
65356
66300
|
)
|
|
65357
66301
|
)
|
|
65358
66302
|
).add(
|
|
@@ -65372,39 +66316,75 @@ var solutions = HttpApiGroup_exports.make("Solutions").add(
|
|
|
65372
66316
|
HttpApiEndpoint_exports.post("gtm-seo-research", "/v1/solutions/gtm/seo_research", {
|
|
65373
66317
|
payload: SeoResearchRequest,
|
|
65374
66318
|
headers: IdempotencyKeyHeaders,
|
|
65375
|
-
success: [
|
|
66319
|
+
success: [SeoResearchTerminal, SeoResearchInFlight],
|
|
65376
66320
|
error: solutionRunErrors
|
|
65377
66321
|
}).annotateMerge(
|
|
65378
66322
|
operation(
|
|
65379
66323
|
"gtm-seo-research",
|
|
65380
66324
|
"SEO research",
|
|
65381
|
-
|
|
66325
|
+
"Research keyword volume and difficulty, search rankings, backlinks, keyword and backlink gaps against competitors, ranking history, site crawls, single-page checks, and AI answer citations. Choose an action and supply keywords, a domain, or a page URL.\n\nEvery action returns normalized output with the last Run's id, provider and lifecycle status. List actions (keyword_ideas, serp, ranked_keywords, organic_competitors, backlinks, referring_domains, keyword_gap, backlink_gap, visibility_history, ai_citations, and keyword_overview with one row per keyword) expose output.items[] with fixed fields per row; overview actions (domain_overview, backlinks_overview, domain_rating, ai_visibility, page_audit, site_audit) expose fixed top-level fields. The Provider's native output is not repeated in output; it stays on the Run and is readable with GET /v1/runs/:id. A value the selected Provider does not report is null. Values are the answering Provider's own figures (volume, traffic and cpc are its estimates; compare them only within one Provider). Scores from a Provider's own model carry the Provider's name, such as ahrefs_domain_rating or semrush_keyword_difficulty, and are never converted between Providers. Money is always USD.\n\nRead result_status separately from status: success, no_result, error or pending. COMPLETED means the final Run settled with a Provider response; an empty but valid answer is no_result and keeps the action's shape (items is [], or every field is null). output is null on error or while pending.\n\ncharge_usd is the total of this response's runs, including charged empty results and failures, and is null until every listed Run settles. runs[] carries each Run's charge and charge_basis without bodies; a multi-Run total has charge_basis=null. GET /v1/runs/:id remains native with an individual charge.\n\nprovider=auto selects the first eligible Provider and tries the next only on PROVIDER_ERROR, TIMED_OUT, or a 503 at admission. No-result and in-flight Runs do not trigger fallback. A named Provider never falls back. Each admitted fallback is a separate Run; use task_id to find related Runs.\n\nFor QUEUED/RUNNING (HTTP 202, today only site_audit), poll the authenticated result_url on the API origin. That read returns the same normalized contract and total, creates no Runs and does not resume fallback. Reuse the same Idempotency-Key and execution parameters for an intentional retry."
|
|
66326
|
+
)
|
|
66327
|
+
)
|
|
66328
|
+
).add(
|
|
66329
|
+
HttpApiEndpoint_exports.get("gtm-seo-research-result", "/v1/solutions/gtm/seo_research/result", {
|
|
66330
|
+
query: SeoResearchResultQuery,
|
|
66331
|
+
success: SeoResearchResult,
|
|
66332
|
+
error: [ERROR_WIRE.ValidationFailed, ERROR_WIRE.NotFound]
|
|
66333
|
+
}).annotateMerge(
|
|
66334
|
+
operation(
|
|
66335
|
+
"gtm-seo-research-result",
|
|
66336
|
+
"Read an SEO research result",
|
|
66337
|
+
"Follow result_url from an SEO research call to read normalized output, business result_status and the total charge of the same Runs. HTTP 200 may still contain result_status=pending. This authenticated read creates no Runs, calls no Providers and does not resume fallback. GET /v1/runs/:id remains the native individual Run. The result context is signed, bound to the Workspace and checked against the current Key policy for every Run."
|
|
65382
66338
|
)
|
|
65383
66339
|
)
|
|
65384
66340
|
).add(
|
|
65385
66341
|
HttpApiEndpoint_exports.post("gtm-social-research", "/v1/solutions/gtm/social_research", {
|
|
65386
66342
|
payload: SocialResearchRequest,
|
|
65387
66343
|
headers: IdempotencyKeyHeaders,
|
|
65388
|
-
success: [
|
|
66344
|
+
success: [SocialResearchTerminal, SocialResearchInFlight],
|
|
65389
66345
|
error: solutionRunErrors
|
|
65390
66346
|
}).annotateMerge(
|
|
65391
66347
|
operation(
|
|
65392
66348
|
"gtm-social-research",
|
|
65393
66349
|
"Social research",
|
|
65394
|
-
|
|
66350
|
+
"Public social media data on Reddit, X, YouTube, TikTok, Instagram and LinkedIn: search posts, read an account, its recent posts or one post, and find the same account on other platforms. Choose a platform and a mode and supply a query, handle or url.\n\nEvery mode returns normalized output shared by all six platforms, with the last Run's id, provider and lifecycle status: profile gives one account (platform, handle, name, url, bio, headline, website, followers, following, posts, verified), search and feed give output.items[] of posts (id, url, title, text, author, author_url, published_at, likes, comments, shares, views), post gives one post with the same fields, find gives output.profiles[] (platform, url, handle, scrapecreators_confidence, followers; for Reddit the matching subreddits) plus pdl_likelihood. The Provider's native output is not repeated in output; it stays on the Run and is readable with GET /v1/runs/:id. A value a platform or Provider does not report is null.\n\nRead result_status separately from status: success, no_result, error or pending. An empty but valid answer is no_result and keeps the mode's shape (items or profiles is [], or every field is null). charge_usd is the total of this response's runs and is null until every listed Run settles. provider=auto selects the first eligible Provider and tries the next only on PROVIDER_ERROR, TIMED_OUT, or a 503 at admission; a named Provider never falls back. For QUEUED/RUNNING (HTTP 202, the Apify routes), poll the authenticated result_url on the API origin. Reuse the same Idempotency-Key and execution parameters for an intentional retry."
|
|
66351
|
+
)
|
|
66352
|
+
)
|
|
66353
|
+
).add(
|
|
66354
|
+
HttpApiEndpoint_exports.get("gtm-social-research-result", "/v1/solutions/gtm/social_research/result", {
|
|
66355
|
+
query: SocialResearchResultQuery,
|
|
66356
|
+
success: SocialResearchResult,
|
|
66357
|
+
error: [ERROR_WIRE.ValidationFailed, ERROR_WIRE.NotFound]
|
|
66358
|
+
}).annotateMerge(
|
|
66359
|
+
operation(
|
|
66360
|
+
"gtm-social-research-result",
|
|
66361
|
+
"Read a social research result",
|
|
66362
|
+
"Follow result_url from a social research call to read normalized output, business result_status and the total charge of the same Runs. HTTP 200 may still contain result_status=pending. This authenticated read creates no Runs, calls no Providers and does not resume fallback. GET /v1/runs/:id remains the native individual Run. The result context is signed, bound to the Workspace and checked against the current Key policy for every Run."
|
|
65395
66363
|
)
|
|
65396
66364
|
)
|
|
65397
66365
|
).add(
|
|
65398
66366
|
HttpApiEndpoint_exports.post("gtm-market-data", "/v1/solutions/gtm/market_data", {
|
|
65399
66367
|
payload: MarketDataRequest,
|
|
65400
66368
|
headers: IdempotencyKeyHeaders,
|
|
65401
|
-
success: [
|
|
66369
|
+
success: [MarketDataTerminal, MarketDataInFlight],
|
|
65402
66370
|
error: solutionRunErrors
|
|
65403
66371
|
}).annotateMerge(
|
|
65404
66372
|
operation(
|
|
65405
66373
|
"gtm-market-data",
|
|
65406
66374
|
"Market data",
|
|
65407
|
-
|
|
66375
|
+
"US property values, rent estimates, property records, sale and rental listings, ZIP-level market statistics, and stock quotes. Choose an action and supply an address, a city plus state, a ZIP, or a ticker symbol.\n\nEvery action returns normalized output with the last Run's id, provider and lifecycle status: property_value, property_rent, market_stats and stock_quote give fixed top-level fields; property_search, listings_sale and listings_rental give output.items[] with fixed fields per row. The Provider's native output is not repeated in output; it stays on the Run and is readable with GET /v1/runs/:id. A value the Provider does not report is null; property money is USD, a stock quote carries its currency.\n\nRead result_status separately from status: success, no_result, error or pending. charge_usd is the total of this response's runs and is null until every listed Run settles; runs[] carries each Run's charge. A named Provider never falls back. For QUEUED/RUNNING (HTTP 202), poll the authenticated result_url on the API origin. Reuse the same Idempotency-Key and execution parameters for an intentional retry."
|
|
66376
|
+
)
|
|
66377
|
+
)
|
|
66378
|
+
).add(
|
|
66379
|
+
HttpApiEndpoint_exports.get("gtm-market-data-result", "/v1/solutions/gtm/market_data/result", {
|
|
66380
|
+
query: MarketDataResultQuery,
|
|
66381
|
+
success: MarketDataResult,
|
|
66382
|
+
error: [ERROR_WIRE.ValidationFailed, ERROR_WIRE.NotFound]
|
|
66383
|
+
}).annotateMerge(
|
|
66384
|
+
operation(
|
|
66385
|
+
"gtm-market-data-result",
|
|
66386
|
+
"Read a market data result",
|
|
66387
|
+
"Follow result_url from a market data call to read normalized output, business result_status and the total charge of the same Runs. HTTP 200 may still contain result_status=pending. This authenticated read creates no Runs, calls no Providers and does not resume fallback. GET /v1/runs/:id remains the native individual Run. The result context is signed, bound to the Workspace and checked against the current Key policy for every Run."
|
|
65408
66388
|
)
|
|
65409
66389
|
)
|
|
65410
66390
|
);
|
|
@@ -65451,6 +66431,7 @@ var glasserApi = HttpApi_exports.make("glasser").add(solutions).add(endpoints).a
|
|
|
65451
66431
|
// src/config.ts
|
|
65452
66432
|
import os from "node:os";
|
|
65453
66433
|
import path5 from "node:path";
|
|
66434
|
+
import { isatty } from "node:tty";
|
|
65454
66435
|
|
|
65455
66436
|
// ../../packages/lib/src/api-key-format.ts
|
|
65456
66437
|
var API_KEY_PREFIX = "gl_";
|
|
@@ -65466,38 +66447,75 @@ function isValidApiKeyFormat(token) {
|
|
|
65466
66447
|
|
|
65467
66448
|
// src/agent.ts
|
|
65468
66449
|
var RULES = [
|
|
66450
|
+
// 这三家会顺带设别家的变量,所以排在被冒认的那一家前面:
|
|
66451
|
+
// Amp 设 CLAUDECODE,Kilo(opencode 的分支)设 OPENCODE,Grok 兼容 Claude Code 插件。
|
|
66452
|
+
{ agent: "amp", vars: ["AMP_CURRENT_THREAD_ID"] },
|
|
66453
|
+
{ agent: "kilo", vars: ["KILO", "KILO_PID"] },
|
|
66454
|
+
{
|
|
66455
|
+
agent: "grok",
|
|
66456
|
+
// GROK_AGENT 用户也会自己设来选 agent;grok 给子进程设的值是 1。
|
|
66457
|
+
vars: [{ name: "GROK_AGENT", equals: "1" }, "GROK_SESSION_ID", "GROK_PLUGIN_ROOT"]
|
|
66458
|
+
},
|
|
65469
66459
|
{ agent: "claude-code", vars: ["CLAUDECODE"] },
|
|
65470
66460
|
{
|
|
65471
66461
|
agent: "codex",
|
|
65472
66462
|
vars: ["CODEX_SANDBOX", "CODEX_THREAD_ID", "CODEX_SANDBOX_NETWORK_DISABLED", "CODEX_CI"]
|
|
65473
66463
|
},
|
|
65474
|
-
{
|
|
66464
|
+
{
|
|
66465
|
+
agent: "cursor",
|
|
66466
|
+
vars: ["CURSOR_AGENT", { name: "CURSOR_EXTENSION_HOST_ROLE", equals: "agent-exec" }]
|
|
66467
|
+
},
|
|
65475
66468
|
{ agent: "gemini-cli", vars: ["GEMINI_CLI"] },
|
|
65476
|
-
|
|
65477
|
-
{ agent: "
|
|
65478
|
-
{
|
|
66469
|
+
// Qwen Code 是 Gemini CLI 的分支,但不设 GEMINI_CLI。
|
|
66470
|
+
{ agent: "qwen-code", vars: ["QWEN_CODE"] },
|
|
66471
|
+
{
|
|
66472
|
+
agent: "hermes",
|
|
66473
|
+
// HERMES_AGENT 会被 execute_code 的环境白名单删掉;HERMES_SESSION_ID 每个入口都设,
|
|
66474
|
+
// HERMES_RPC_SOCKET / HERMES_KERNEL_SENTINEL 只在 execute_code 的内核里有。
|
|
66475
|
+
vars: ["HERMES_AGENT", "HERMES_SESSION_ID", "HERMES_RPC_SOCKET", "HERMES_KERNEL_SENTINEL"]
|
|
66476
|
+
},
|
|
66477
|
+
// 人在 OpenClaw TUI 里开的本地 shell 是 `tui-local`,agent 的命令是 `exec`。
|
|
66478
|
+
{ agent: "openclaw", vars: [{ name: "OPENCLAW_SHELL", equals: "exec" }] },
|
|
66479
|
+
{ agent: "opencode", vars: ["OPENCODE", "OPENCODE_CLIENT"] },
|
|
65479
66480
|
{ agent: "cline", vars: ["CLINE_ACTIVE"] },
|
|
65480
|
-
{ agent: "
|
|
66481
|
+
{ agent: "roo-code", vars: ["ROO_ACTIVE"] },
|
|
66482
|
+
{ agent: "copilot", vars: ["COPILOT_CLI", "COPILOT_AGENT_SESSION_ID", "COPILOT_AGENT"] },
|
|
66483
|
+
{ agent: "augment", vars: ["AUGMENT_AGENT"] },
|
|
66484
|
+
{ agent: "droid", vars: ["FACTORY_SESSION_ID"] },
|
|
66485
|
+
{ agent: "junie", vars: ["MATTERHORN_SESSION_ID", "JUNIE_DATA"] },
|
|
66486
|
+
{ agent: "crush", vars: ["CRUSH"] },
|
|
66487
|
+
{ agent: "pi", vars: ["PI_CODING_AGENT"] },
|
|
66488
|
+
{ agent: "goose", vars: ["GOOSE_TERMINAL"] },
|
|
66489
|
+
{ agent: "warp", vars: ["OZ_RUN_ID", "WARP_RUN_ID"] },
|
|
65481
66490
|
{ agent: "kiro", vars: ["KIRO_SESSION_ID"] },
|
|
65482
|
-
{ agent: "antigravity", vars: ["
|
|
66491
|
+
{ agent: "antigravity", vars: ["ANTIGRAVITY_AGENT"] },
|
|
65483
66492
|
// 宿主变量:Claude Code 的 SDK / 托管入口不一定设 CLAUDECODE;
|
|
65484
66493
|
// 全权限的 Codex Desktop 可能一个 CODEX_* 都不设,只留这一个。
|
|
65485
66494
|
{ agent: "claude-code", vars: ["CLAUDE_CODE_ENTRYPOINT"] },
|
|
65486
|
-
{ agent: "codex", vars: ["CODEX_INTERNAL_ORIGINATOR_OVERRIDE"] }
|
|
66495
|
+
{ agent: "codex", vars: ["CODEX_INTERNAL_ORIGINATOR_OVERRIDE"] },
|
|
66496
|
+
// IDE 终端整体都有的弱信号:人在 Kiro / Antigravity 的终端里手敲也有它们。
|
|
66497
|
+
{ agent: "kiro", vars: [{ name: "TERM_PROGRAM", equals: "kiro" }], noTty: true },
|
|
66498
|
+
{ agent: "antigravity", vars: ["ANTIGRAVITY_CLI_ALIAS"], noTty: true }
|
|
65487
66499
|
];
|
|
65488
66500
|
var SELF_REPORTED = ["AI_AGENT", "AGENT"];
|
|
66501
|
+
var ANONYMOUS_SELF_REPORTS = /* @__PURE__ */ new Set(["1", "true", "yes"]);
|
|
66502
|
+
var nameOf = (signal) => typeof signal === "string" ? signal : signal.name;
|
|
65489
66503
|
var AGENT_ENV_VARS = [
|
|
65490
|
-
.../* @__PURE__ */ new Set([...RULES.flatMap((rule) => rule.vars), ...SELF_REPORTED])
|
|
66504
|
+
.../* @__PURE__ */ new Set([...RULES.flatMap((rule) => rule.vars.map(nameOf)), ...SELF_REPORTED])
|
|
65491
66505
|
];
|
|
65492
66506
|
var MAX_SELF_REPORTED = 32;
|
|
65493
66507
|
var cleanSelfReported = (raw2) => {
|
|
65494
66508
|
const value3 = raw2.trim().toLowerCase().replaceAll(/[^a-z0-9._-]/g, "").slice(0, MAX_SELF_REPORTED);
|
|
65495
|
-
return value3 === "" ? void 0 : value3;
|
|
66509
|
+
return value3 === "" || ANONYMOUS_SELF_REPORTS.has(value3) ? void 0 : value3;
|
|
65496
66510
|
};
|
|
65497
|
-
function detectAgent(env) {
|
|
65498
|
-
const
|
|
66511
|
+
function detectAgent(env, stdinIsTty2) {
|
|
66512
|
+
const matches = (signal) => {
|
|
66513
|
+
const value3 = env(nameOf(signal)) ?? "";
|
|
66514
|
+
return typeof signal === "string" ? value3 !== "" : value3 === signal.equals;
|
|
66515
|
+
};
|
|
65499
66516
|
for (const rule of RULES) {
|
|
65500
|
-
if (rule.
|
|
66517
|
+
if (rule.noTty && stdinIsTty2) continue;
|
|
66518
|
+
if (rule.vars.some(matches)) return rule.agent;
|
|
65501
66519
|
}
|
|
65502
66520
|
for (const name of SELF_REPORTED) {
|
|
65503
66521
|
const value3 = env(name);
|
|
@@ -65559,13 +66577,14 @@ var apiKeyFromEnv = Effect_exports.gen(function* () {
|
|
|
65559
66577
|
}
|
|
65560
66578
|
return Option_exports.some(value3);
|
|
65561
66579
|
});
|
|
66580
|
+
var stdinIsTty = Effect_exports.sync(() => isatty(0));
|
|
65562
66581
|
var codingAgent = Effect_exports.gen(function* () {
|
|
65563
66582
|
const values3 = /* @__PURE__ */ new Map();
|
|
65564
66583
|
for (const name of AGENT_ENV_VARS) {
|
|
65565
66584
|
const raw2 = yield* Config_exports.option(Config_exports.string(name)).pipe(Effect_exports.orDie);
|
|
65566
66585
|
if (Option_exports.isSome(raw2)) values3.set(name, raw2.value);
|
|
65567
66586
|
}
|
|
65568
|
-
return detectAgent((name) => values3.get(name));
|
|
66587
|
+
return detectAgent((name) => values3.get(name), yield* stdinIsTty);
|
|
65569
66588
|
});
|
|
65570
66589
|
var loginCampaignFromEnv = Effect_exports.gen(function* () {
|
|
65571
66590
|
const read2 = (name) => Config_exports.option(Config_exports.string(name)).pipe(
|
|
@@ -66946,7 +67965,7 @@ import os3 from "node:os";
|
|
|
66946
67965
|
import { existsSync as existsSync2, mkdirSync as mkdirSync3, writeFileSync as writeFileSync4 } from "node:fs";
|
|
66947
67966
|
import os2 from "node:os";
|
|
66948
67967
|
import path8 from "node:path";
|
|
66949
|
-
var SKILL_MARKDOWN = true ? "---\nname: glasser\nversion: 0.1.80\ndescription: >\n Reach for this when a task needs external or paid data \u2014 person or company\n enrichment, person/company search, job-posting search, contact unlock, web,\n news, image, video, maps, places, scholar or shopping search, US property\n and rental data, SEC filings, company financials and stock prices, webpage\n scraping, lead lookup, or any\n other paid data API \u2014 and check the data sources before writing a scraper or\n telling the user something is inaccessible. 1,500+ paid,\n high-quality endpoints across many providers behind one Key: search, inspect\n the price, run, pay per call, no signup at each vendor. Works through the\n glasser CLI, or through the Glasser MCP server where the runtime cannot\n shell out. If the user already has their own key or integration for a\n specific provider, use that first.\n---\n\n# Glasser\n\nGlasser is a broker: it sells runnable third-party API operations\n(\"Endpoints\") under a single Key. You search the data sources, inspect an\nEndpoint's contract and Price, and run it \u2014 the response is the provider's\nown output, nothing renamed or reshaped.\n\n## Identify your surface FIRST\n\nDecide by the actual execution environment, not the product name and not\nwhether a terminal exists. The wrong setup cannot work.\n\n- **`glasser` MCP tools already loaded** (`search`, `inspect`, `run`,\n `runs_get`, `runs_list`, `runs_stop`, `balance`): nothing to install. The\n verbs map one to one onto the CLI commands below; only `run` differs, in\n that it needs an `idempotency_key` you generate (a UUID). Call `balance`;\n if it succeeds, skip to **First run**. The rules in this file apply either\n way.\n\n- **Hosted assistant** (claude.ai, Claude Desktop chat, Cowork, ChatGPT,\n Gemini \u2014 even with a code sandbox: it runs in the provider's cloud, not on\n the human's machine, and resets between tasks): do NOT install anything.\n Tell the human to add Glasser as a custom MCP connector, then stop. In\n Claude, give them this link; it opens the Add custom connector dialog\n with the name and URL filled in:\n https://api.glasser.ai/connect/claude\n Then Continue \u2192 Add \u2192 sign in to Glasser, choose the Workspace, Allow.\n Glasser is on in the next chat. Other products: the server URL is\n `https://api.glasser.ai/mcp`; steps per client at\n https://glasser.ai/docs/mcp-server.md. If the product has no custom\n connectors, say so and point to the same account's coding agent\n (ChatGPT \u2192 Codex, Gemini \u2192 Gemini CLI, Claude \u2192 Claude Code).\n\n- **Local coding agent** (Claude Code, Codex, Cursor, Copilot, Gemini CLI,\n OpenClaw, Hermes on the user's machine): the human authorized the whole\n flow by pasting this. If your runtime asks permission for shell commands,\n request it ONCE and work straight through. Continue to **Setup**.\n\n- **Sandboxed agent** (cloud container, restricted egress): run\n `curl -sI https://api.glasser.ai/health` first. A proxy 403, DNS failure\n or timeout means an egress allowlist. Do not retry, do not try other\n hosts. Tell the human `api.glasser.ai` is blocked by the environment's\n network policy, offer the MCP connector or an allowlist for `glasser.ai`\n and `api.glasser.ai` on 443, then stop.\n\nNever ask the human to paste a Key into chat.\n\n## Setup\n\n```sh\nglasser --version 2>/dev/null || npm install -g @glasser-ai/cli@latest\n```\n\nOne command when the CLI is missing, and it installs the current version.\nWithout npm, `curl -fsSL https://glasser.ai/install.sh | sh` does the same\njob. A fresh install selects the latest version, so no separate registry\nversion check is needed. The installer reports what it needs and where it\nwrote the binary \u2014 read its output rather than guessing. If the CLI was\nalready installed, the server tells you when to upgrade (see **Upgrading**).\n\nFor agents with persistent skills, run `glasser skill install`. It saves\nthis file for every coding agent it finds (Claude Code, Codex, Cursor, Gemini\nCLI, Copilot and others), so future sessions load it; the installer already\nran it. For any other agent, save the complete file from\nhttps://glasser.ai/SKILL.md in your user-level skill directory and enable it\nfor future sessions. Do this only during setup or CLI upgrades.\n\n## Authentication\n\nRun `glasser balance`. Exit 0 means authentication works; continue to\n**First run**. A missing or rejected Key needs one. Handle other failures\nfrom the error message instead of starting another login.\n\n**Where a Key comes from.** Two sources, and the environment takes precedence\nover the local store. `GLASSER_API_KEY` needs no file on disk, so it is what\nCI, scripts and scheduled jobs use, and it is the source that still works on a\nmachine whose own store will not outlive the session \u2014 a cloud session, a\ncontainer. Mint that Key in the console. The local store is what `glasser\nlogin` writes and what `glasser keys add --label <l> --key <k>` fills by hand;\nit lives on the machine the CLI ran on, and lasts as long as that machine does.\n\n**With a user present**, in this order:\n\n1. Run `glasser login` with your shell tool's background execution support.\n The CLI opens the sign-in page when possible and prints a fallback URL and\n a matching code.\n2. Relay that URL and code exactly as printed \u2014 a plain URL, readable in a\n terminal \u2014 with a brief explanation of the next step. Nothing else starts\n until this message is out.\n3. Wait for that same command to finish, using the shell tool's wait or output\n operation with short waits. A pending result means wait again, not return\n a final reply. Browser approval needs no further chat message. Give brief\n progress updates during the wait; the CLI polls for up to 15 minutes.\n Stop waiting when login succeeds, fails, expires, or the user cancels.\n\nOnce login succeeds, use the available balance in its output and continue to\n**First run**, unless login warns that `GLASSER_API_KEY` overrides the saved\nKey or the summary has no available balance. In either case, run\n`glasser balance` in the environment subsequent commands will use. Login's\nsummary uses the new Key directly; it does not verify an environment Key.\n\nIf that check rejects an environment Key, another login will not fix it.\nPreserve runtime-managed authentication: changing the variable or bypassing\nit for a command needs the user's authorization. When the user requires it\nto stay unchanged, report the blocker and the runtime correction needed.\nFor other failures, report the actual error; a network failure does not show\nthat a Key is invalid. If authorization expires, a new login needs a new\nURL and code relayed before waiting again.\nNever ask the user to paste a Key. `glasser login --json` is a usage error by\ndesign \u2014 that flow needs a human.\n\n## First run\n\nSetup is finished when login succeeds and reports the available balance\nwithout an environment Key override, or `glasser balance` exits 0 in the\nenvironment subsequent commands will use \u2014 with the MCP tools, when\n`balance` succeeds.\nIf setup is blocked, give a brief status, the confirmed cause, and the next\nstep needed to resolve it. You may state which steps succeeded, but do not\nclaim readiness or offer task prompts while authentication is blocked.\nLogin's balance is not usable evidence for commands that use a rejected Key.\n\nOnce setup is finished, if the user already gave you a task, continue it.\nFor a setup-only request, reply briefly in the user's language: confirm\nGlasser is ready, report the available balance from login or the balance\ncheck, then offer three ready-to-send task prompts, one per bullet.\nUse a conversational lead-in that explains how the suggestions can help\nthe user, rather than a generic list heading. Connect it to their goals\nwhen known, or briefly describe what they could accomplish with Glasser.\n\nBase the prompts on the user's project, interests or goals when that context\nis available. Otherwise, choose three varied examples from Glasser's\ncapabilities. Give each prompt a concrete subject and a clear result the\nuser can ask for.\n\nFor both completed and blocked setup, omit Workspace names/slugs, Key\nlabels/values/prefixes, and installation details such as versions, paths or\npackage-manager output. Name a configuration variable when it explains the\nblocker. Report useful status, not a transcript of the setup commands.\nSetup is not approval to spend: wait for the user to choose before starting\na paid Run.\n\n## Upgrading\n\nThe server tells you when to upgrade \u2014 you do not have to compare versions\nby hand. Upgrade when any of these appears:\n\n- a response carries a `client` block. It is present only when this CLI is\n behind, and it says everything needed to act: `client_version`,\n `minimum_version`, `latest_version`, a runnable `upgrade_command`, and a\n `reason`. It rides in the response body,\n so it reaches `-j` output like any other field;\n- a command fails with `control: \"client.version_unsupported\"`. This CLI is\n too old to read part of the catalog, and `search` and `inspect` are refused\n rather than answered with a shortened list \u2014 a missing row would be\n invisible to you. Run the `upgrade_command` from `details`, then retry;\n- a command printed an `Update available` notice \u2014 the CLI asks the npm\n registry at most once every three hours and prints this on stderr. This one\n never\n appears in `-j` mode, because both streams stay machine-clean; the `client`\n block above is the `-j` signal.\n\nAfter upgrading, refresh the installed Skill as described in **Setup**.\nThe Skill and the CLI update together. Never downgrade. An available update\nnever interrupts work: finish the task at hand, then upgrade before the\nnext one. If the registry is unreachable, proceed with the installed\nversion \u2014 do not block the task on an upgrade check.\n\n## When to use\n\n- The task needs a capability (enrich a person or company, search the web,\n etc.) and no key or integration for it exists in the environment.\n- Workflow, in order:\n 0. Every search needs `--use-case \"<what they asked for>\"`, a browse with no\n query included: the user's own request, in their words, with the subject\n in it. Search refuses to run without it. One piece of the user's work is\n one **task**. Search prints a task id; pass it back\n with `--task <id>` on every later search, inspect and run for that same\n piece of work. Run that first search on its own and wait for the id:\n searches started in parallel before you have it each open a separate\n task. After that, search in parallel as much as you like, each with\n `--task <id>`. Every command that prints a follow-up command already\n carries the id in it, so working from what you are given keeps a task\n together with no bookkeeping.\n\n The use case and the task id cost nothing. The task id lets you list one\n task's Runs together with `glasser runs list --task <id>`.\n 1. `glasser search \"<capability>\" --use-case \"<what they asked for>\"` \u2014 find candidate Endpoints. The\n Provider column reads `pdl (People Data Labs)`: the first word is the\n slug every `-p` flag takes, the name in parentheses is who the data\n comes from \u2014 use it when the user names a vendor, and when you report\n the source back. Several Providers may sell the same capability: the\n list is ranked by relevance only, the Price sits beside each row, and\n the choice is yours.\n - A page holds 5 rows and the footer says how many matches there are in\n total. Pass the printed cursor with `--cursor` to see the rest.\n - The Score column is the cosine similarity between your words and that\n Endpoint's description, in [-1, 1], shown as `-` when semantic scoring\n did not run. It is a similarity signal for comparing rows on one page,\n not a verdict: the row order comes from fusing a keyword and a semantic\n ranking, and the ranking always returns its nearest candidates.\n - **Neither a page of low scores nor reaching the last page shows that\n the catalog lacks a capability.** Before you tell the user something is\n unavailable: read the total, page through with `--cursor`, search again\n with different words (the catalog is indexed on how each Endpoint\n describes itself, which may not be your phrasing), and inspect every\n candidate whose name is close to the task \u2014 `inspect` is free.\n 2. `glasser inspect -p <provider> -e <endpoint>` \u2014 **read the Price and\n the charge clauses BEFORE running.** The Price is what a normal\n COMPLETED call costs; the charge clauses list the exceptions (e.g.\n `NO_RESULT $0.00` means an empty answer is free). For any given\n endpoint the clauses are authoritative. Also identify which input\n fields control result volume (`num`, `size`, `limit`, arrays of\n queries) \u2014 the charge rule may read the input, so volume parameters\n can change what a call costs. Start small; raise only when the user\n needs more.\n 3. `glasser run -p <provider> -e <endpoint> -i '<json>'` \u2014 execute.\n 4. Report the result AND the charge to the user (run output includes the\n charged amount). Every Run also prints a `Run URL` (the `run_url` field\n in `-j`; absent from the `-o` file): the Workspace console page holding\n that Run's records exactly as the Provider returned them, private to\n Workspace members. When your answer relies on a Run, cite that URL as\n its source \u2014 the Run id alone opens nothing for the user.\n\n## When NOT to use\n\n- **Precedence: an explicit user instruction > the user's own integrations\n and keys > Glasser.** If the user has their own key, client, or\n integration for the capability, use that instead.\n- **Runs spend the Workspace balance.** Do not run Endpoints speculatively,\n in loops, or for bulk operations without telling the user the per-call\n Price and getting their go-ahead.\n- Do not use it for capabilities the environment already provides for free.\n- **The catalog changes often** \u2014 Endpoints and Providers are added weekly.\n Search every time you need one; never cache or reuse a listing from an\n earlier session, and never answer \"what can Glasser do\" from memory.\n\n## Adding funds\n\nOnly the user can add funds, in the console at https://app.glasser.ai/balance \u2014\nno command or tool does it. Raise this only when a Run fails with\n`insufficient balance` or the user asks.\n\n- **Top up** on the Balance page.\n- **Grants** are free balance; users often call them \"credits\". The Balance\n page lists the Grants a Workspace can receive and their terms. Send the\n user there.\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `glasser login` | Browser device authorization; stores a Key |\n| `glasser search [\"<query>\"] --use-case \"<sentence>\" [--limit N] [--cursor C] [--task T]` | Search Endpoints, 5 per page (max 20); `--use-case` is required on every search; `-q`/`--query` takes the same query; use `--query=<query>` when it starts with `-`; the footer prints the match total, the task id, the next-page cursor for `--cursor`, and a search-again command that carries the task and the use case |\n| `glasser inspect -p <provider> -e <endpoint> [--endpoint-version N] [--task T]` | Schemas, current Price, charge clauses, supported version |\n| `glasser run -p <provider> -e <endpoint> [-i '<json>' \\| -f <file>] [--idempotency-key K] [--task T] [--wait] [--wait-timeout s] [-o file]` | Execute an Endpoint |\n| `glasser runs list [--limit --cursor --status --provider --endpoint --task]` | List past Runs; `--task` is an exact match |\n| `glasser runs get -r <runId> [--wait] [-o file]` | Fetch one Run |\n| `glasser runs stop -r <runId>` | Stop a queued/running Run |\n| `glasser balance` | Balance, held and available; doubles as the auth probe |\n| `glasser balance history [--limit --cursor --kind]` | Ledger of charges, refunds, top-ups and Grants |\n| `glasser keys add/list/activate/remove` | Manage Keys stored on this machine |\n\nGlobal flags: `-j/--json` (raw JSON to stdout, errors as a single JSON\nobject on stderr), `--help`, `--version`.\n\nFacts that matter when scripting:\n\n- Exit codes: `0` success, `1` runtime failure, `2` usage error, `130`\n interrupted.\n- In `-j` mode, stdout is data only; parse stderr for the error object.\n- For large outputs, prefer `-o <file>` and read the file selectively \u2014\n dumping a full provider payload into your context wastes it.\n- Money is always an **exact decimal string** (e.g. `\"0.0125\"`), never a\n float. Do not do float arithmetic on it.\n- Env: `GLASSER_API_KEY`, `GLASSER_API_BASE_URL` (default\n `https://api.glasser.ai`; point it elsewhere and that stack's Workspace\n is what gets billed), `NO_COLOR`.\n\n## Run statuses and waiting\n\n| Status | Meaning |\n|---|---|\n| `QUEUED` | Accepted, not yet dispatched to the provider |\n| `RUNNING` | Dispatched, provider has not answered yet |\n| `COMPLETED` | Terminal \u2014 the provider answered (its answer may still be a \"not found\") |\n| `FAILED` | Terminal \u2014 no usable provider answer; the failure block says why |\n| `STOPPED` | Terminal \u2014 stopped via `runs stop`. Dispatch wins the race: a Run already sent to the provider completes and is charged |\n\nInspect shows each Endpoint's run mode: a `sync` Endpoint returns the\nfinished Run in the same response (its timeout is printed next to the\nmode) \u2014 `--wait` on those adds nothing. For anything still `QUEUED` or\n`RUNNING`, either pass `--wait` up front or poll with\n`glasser runs get -r <runId> --wait`; interactive sessions that want to\nkeep talking can fire without `--wait` and poll between replies.\n\n## Troubleshooting\n\n| Symptom | Meaning / action |\n|---|---|\n| `Invalid or missing API key` | Check the Key source. If `GLASSER_API_KEY` is set, correct it through its owner; login does not replace it. With no environment Key, use `glasser login` to replace a missing or rejected local Key |\n| Exit `2` | Your command line is wrong \u2014 fix it from the message; nothing reached the API and nothing was charged |\n| `Input does not match the endpoint's input schema` | Read the `issues:` lines under the error \u2014 they name the exact field and constraint. No Run was created and nothing was charged; fix the input and run again |\n| `insufficient balance` | The Workspace cannot cover the Price. Tell the user to add funds in the console (see **Adding funds**) \u2014 do not retry |\n| `rate_limited` | The Workspace or the endpoint is at its limit. Wait `retry_after_ms` (the error carries it; the hint prints it), then retry the same command once \u2014 do not loop |\n| Transport error / timeout with a retry hint | Outcome unknown \u2014 a Run may exist. Retry with the SAME Idempotency-Key exactly as the hint prints it |\n| `FAILED` with a charge shown | Legitimate when the charge clauses say so \u2014 report both the failure and the charge |\n| `Update available` notice | Finish the current task, re-run the installer, then update the installed skill as described in **Upgrading** |\n\n## Running safely\n\n- `run` prints `Charge: $X (rule)` \u2014 the amount billed under the\n endpoint's charge rule. Report that number to the user.\n- `run` prints the Idempotency-Key it used (auto-generated when omitted;\n `--json` mode requires an explicit `--idempotency-key`). On an ambiguous\n failure \u2014 timeout, dropped connection, nonzero exit with no clear answer \u2014\n **retry with the SAME key**: it returns the original Run instead of\n charging again.\n- **Two indicators, not one.** A Run's status and the provider's response\n are separate. `COMPLETED` means the provider answered \u2014 a `COMPLETED` Run\n whose payload is a provider 404 (\"person not found\") is a normal outcome,\n not an error. Whether it is charged follows the endpoint's charge clauses\n from inspect. Report both the Run status and what the provider actually\n said.\n- Use `--wait` to block until the Run settles; without it, poll with\n `glasser runs get -r <runId> --wait`.\n\n## Rules for agents\n\n1. The user's own keys, integrations and explicit instructions outrank\n Glasser \u2014 it fills gaps, never routes around what the user has.\n2. Always inspect before running; never guess input parameters \u2014 the input\n schema and charge clauses from `inspect` are the source of truth.\n3. Runs spend the Workspace balance: no speculative, looped, or bulk runs\n without naming the per-call Price and getting the user's go-ahead.\n4. Start with small volume parameters; raise them only on request.\n5. Interactive auth is `glasser login` \u2014 never ask the user to paste a Key.\n6. On an ambiguous failure, retry with the SAME Idempotency-Key.\n7. Carry the SAME `--task` through one piece of work, the way you carry that\n key \u2014 search prints it, inspect and run take it.\n8. Report two indicators after every run \u2014 the Run status and what the\n provider said \u2014 plus the printed `Charge:` amount; cite the `Run URL`,\n never the bare Run id, as the source of what your answer used.\n9. Money is an exact decimal string; never do float arithmetic on it.\n10. Prefer `-o <file>` for large outputs; `-j` when you parse.\n11. When any command prints an `Update available` notice: finish the task,\n re-run the installer, then update the installed skill as described in\n **Upgrading**.\n12. The CLI is the source of truth for flags \u2014 run `glasser <command>\n --help` when unsure.\n13. `rate_limited` means back off: wait `retry_after_ms`, then retry the\n same command once; never loop on it.\n\n`--endpoint-version` selects a supported compatible contract. It does not lock Price.\nCompatible updates keep the version; older versions work until explicitly retired.\nNew Runs use the selected version's Price at admission. Accepted Runs keep their original Price.\n" : readFileSync4(new URL("../../api/src/http/skill/SKILL.md", import.meta.url), "utf8");
|
|
67968
|
+
var SKILL_MARKDOWN = true ? "---\nname: glasser\nversion: 0.1.88\ndescription: >\n Reach for this when a task needs external or paid data \u2014 person or company\n enrichment, person/company search, job-posting search, contact unlock, web,\n news, image, video, maps, places, scholar or shopping search, US property\n and rental data, SEC filings, company financials and stock prices, webpage\n scraping, lead lookup, or any\n other paid data API \u2014 and check the data sources before writing a scraper or\n telling the user something is inaccessible. 1,500+ paid,\n high-quality endpoints across many providers behind one Key: search, inspect\n the price, run, pay per call, no signup at each vendor. Works through the\n glasser CLI, or through the Glasser MCP server where the runtime cannot\n shell out. If the user already has their own key or integration for a\n specific provider, use that first.\n---\n\n# Glasser\n\nGlasser is a broker: it sells runnable third-party API operations\n(\"Endpoints\") under a single Key. You search the data sources, inspect an\nEndpoint's contract and Price, and run it \u2014 the response is the provider's\nown output, nothing renamed or reshaped.\n\n## Identify your surface FIRST\n\nDecide by the actual execution environment, not the product name and not\nwhether a terminal exists. The wrong setup cannot work.\n\n- **`glasser` MCP tools already loaded** (`search`, `inspect`, `run`,\n `runs_get`, `runs_list`, `runs_stop`, `balance`): nothing to install. The\n verbs map one to one onto the CLI commands below; only `run` differs, in\n that it needs an `idempotency_key` you generate (a UUID). Call `balance`;\n if it succeeds, skip to **First run**. The rules in this file apply either\n way.\n\n- **Hosted assistant** (claude.ai, Claude Desktop chat, Cowork, ChatGPT,\n Gemini \u2014 even with a code sandbox: it runs in the provider's cloud, not on\n the human's machine, and resets between tasks): do NOT install anything.\n Tell the human to add Glasser as a custom MCP connector, then stop. In\n Claude, give them this link; it opens the Add custom connector dialog\n with the name and URL filled in:\n https://api.glasser.ai/connect/claude\n Then Continue \u2192 Add \u2192 sign in to Glasser, choose the Workspace, Allow.\n Glasser is on in the next chat. Other products: the server URL is\n `https://api.glasser.ai/mcp`; steps per client at\n https://glasser.ai/docs/mcp-server.md. If the product has no custom\n connectors, say so and point to the same account's coding agent\n (ChatGPT \u2192 Codex, Gemini \u2192 Gemini CLI, Claude \u2192 Claude Code).\n\n- **Local coding agent** (Claude Code, Codex, Cursor, Copilot, Gemini CLI,\n OpenClaw, Hermes on the user's machine): the human authorized the whole\n flow by pasting this. If your runtime asks permission for shell commands,\n request it ONCE and work straight through. Continue to **Setup**.\n\n- **Sandboxed agent** (cloud container, restricted egress): run\n `curl -sI https://api.glasser.ai/health` first. A proxy 403, DNS failure\n or timeout means an egress allowlist. Do not retry, do not try other\n hosts. Tell the human `api.glasser.ai` is blocked by the environment's\n network policy, offer the MCP connector or an allowlist for `glasser.ai`\n and `api.glasser.ai` on 443, then stop.\n\nNever ask the human to paste a Key into chat.\n\n## Setup\n\n```sh\nglasser --version 2>/dev/null || npm install -g @glasser-ai/cli@latest\n```\n\nOne command when the CLI is missing, and it installs the current version.\nWithout npm, `curl -fsSL https://glasser.ai/install.sh | sh` does the same\njob. A fresh install selects the latest version, so no separate registry\nversion check is needed. The installer reports what it needs and where it\nwrote the binary \u2014 read its output rather than guessing. If the CLI was\nalready installed, the server tells you when to upgrade (see **Upgrading**).\n\nFor agents with persistent skills, run `glasser skill install`. It saves\nthis file for every coding agent it finds (Claude Code, Codex, Cursor, Gemini\nCLI, Copilot and others), so future sessions load it; the installer already\nran it. For any other agent, save the complete file from\nhttps://glasser.ai/SKILL.md in your user-level skill directory and enable it\nfor future sessions. Do this only during setup or CLI upgrades.\n\n## Authentication\n\nRun `glasser balance`. Exit 0 means authentication works; continue to\n**First run**. A missing or rejected Key needs one. Handle other failures\nfrom the error message instead of starting another login.\n\n**Where a Key comes from.** Two sources, and the environment takes precedence\nover the local store. `GLASSER_API_KEY` needs no file on disk, so it is what\nCI, scripts and scheduled jobs use, and it is the source that still works on a\nmachine whose own store will not outlive the session \u2014 a cloud session, a\ncontainer. Mint that Key in the console. The local store is what `glasser\nlogin` writes and what `glasser keys add --label <l> --key <k>` fills by hand;\nit lives on the machine the CLI ran on, and lasts as long as that machine does.\n\n**With a user present**, in this order:\n\n1. Run `glasser login` with your shell tool's background execution support.\n The CLI opens the sign-in page when possible and prints a fallback URL and\n a matching code.\n2. Relay that URL and code exactly as printed \u2014 a plain URL, readable in a\n terminal \u2014 with a brief explanation of the next step. Nothing else starts\n until this message is out.\n3. Wait for that same command to finish, using the shell tool's wait or output\n operation with short waits. A pending result means wait again, not return\n a final reply. Browser approval needs no further chat message. Give brief\n progress updates during the wait; the CLI polls for up to 15 minutes.\n Stop waiting when login succeeds, fails, expires, or the user cancels.\n\nOnce login succeeds, use the available balance in its output and continue to\n**First run**, unless login warns that `GLASSER_API_KEY` overrides the saved\nKey or the summary has no available balance. In either case, run\n`glasser balance` in the environment subsequent commands will use. Login's\nsummary uses the new Key directly; it does not verify an environment Key.\n\nIf that check rejects an environment Key, another login will not fix it.\nPreserve runtime-managed authentication: changing the variable or bypassing\nit for a command needs the user's authorization. When the user requires it\nto stay unchanged, report the blocker and the runtime correction needed.\nFor other failures, report the actual error; a network failure does not show\nthat a Key is invalid. If authorization expires, a new login needs a new\nURL and code relayed before waiting again.\nNever ask the user to paste a Key. `glasser login --json` is a usage error by\ndesign \u2014 that flow needs a human.\n\n## First run\n\nSetup is finished when login succeeds and reports the available balance\nwithout an environment Key override, or `glasser balance` exits 0 in the\nenvironment subsequent commands will use \u2014 with the MCP tools, when\n`balance` succeeds.\nIf setup is blocked, give a brief status, the confirmed cause, and the next\nstep needed to resolve it. You may state which steps succeeded, but do not\nclaim readiness or offer task prompts while authentication is blocked.\nLogin's balance is not usable evidence for commands that use a rejected Key.\n\nOnce setup is finished, if the user already gave you a task, continue it.\nFor a setup-only request, reply briefly in the user's language: confirm\nGlasser is ready, report the available balance from login or the balance\ncheck, then offer three ready-to-send task prompts, one per bullet.\nUse a conversational lead-in that explains how the suggestions can help\nthe user, rather than a generic list heading. Connect it to their goals\nwhen known, or briefly describe what they could accomplish with Glasser.\n\nBase the prompts on the user's project, interests or goals when that context\nis available. Otherwise, choose three varied examples from Glasser's\ncapabilities. Give each prompt a concrete subject and a clear result the\nuser can ask for.\n\nFor both completed and blocked setup, omit Workspace names/slugs, Key\nlabels/values/prefixes, and installation details such as versions, paths or\npackage-manager output. Name a configuration variable when it explains the\nblocker. Report useful status, not a transcript of the setup commands.\nSetup is not approval to spend: wait for the user to choose before starting\na paid Run.\n\n## Upgrading\n\nThe server tells you when to upgrade \u2014 you do not have to compare versions\nby hand. Upgrade when any of these appears:\n\n- a response carries a `client` block. It is present only when this CLI is\n behind, and it says everything needed to act: `client_version`,\n `minimum_version`, `latest_version`, a runnable `upgrade_command`, and a\n `reason`. It rides in the response body,\n so it reaches `-j` output like any other field;\n- a command fails with `control: \"client.version_unsupported\"`. This CLI is\n too old to read part of the catalog, and `search` and `inspect` are refused\n rather than answered with a shortened list \u2014 a missing row would be\n invisible to you. Run the `upgrade_command` from `details`, then retry;\n- a command printed an `Update available` notice \u2014 the CLI asks the npm\n registry at most once every three hours and prints this on stderr. This one\n never\n appears in `-j` mode, because both streams stay machine-clean; the `client`\n block above is the `-j` signal.\n\nAfter upgrading, refresh the installed Skill as described in **Setup**.\nThe Skill and the CLI update together. Never downgrade. An available update\nnever interrupts work: finish the task at hand, then upgrade before the\nnext one. If the registry is unreachable, proceed with the installed\nversion \u2014 do not block the task on an upgrade check.\n\n## When to use\n\n- The task needs a capability (enrich a person or company, search the web,\n etc.) and no key or integration for it exists in the environment.\n- Workflow, in order:\n 0. Every search needs `--use-case \"<what they asked for>\"`, a browse with no\n query included: the user's own request, in their words, with the subject\n in it. Search refuses to run without it. One piece of the user's work is\n one **task**. Search prints a task id; pass it back\n with `--task <id>` on every later search, inspect and run for that same\n piece of work. Run that first search on its own and wait for the id:\n searches started in parallel before you have it each open a separate\n task. After that, search in parallel as much as you like, each with\n `--task <id>`. Every command that prints a follow-up command already\n carries the id in it, so working from what you are given keeps a task\n together with no bookkeeping.\n\n The use case and the task id cost nothing. The task id lets you list one\n task's Runs together with `glasser runs list --task <id>`.\n 1. `glasser search \"<capability>\" --use-case \"<what they asked for>\"` \u2014 find candidate Endpoints. The\n Provider column reads `pdl (People Data Labs)`: the first word is the\n slug every `-p` flag takes, the name in parentheses is who the data\n comes from \u2014 use it when the user names a vendor, and when you report\n the source back. Several Providers may sell the same capability: the\n list is ranked by relevance only, the Price sits beside each row, and\n the choice is yours.\n - A page holds 5 rows and the footer says how many matches there are in\n total. Pass the printed cursor with `--cursor` to see the rest.\n - The Score column is the cosine similarity between your words and that\n Endpoint's description, in [-1, 1], shown as `-` when semantic scoring\n did not run. It is a similarity signal for comparing rows on one page,\n not a verdict: the row order comes from fusing a keyword and a semantic\n ranking, and the ranking always returns its nearest candidates.\n - **Neither a page of low scores nor reaching the last page shows that\n the catalog lacks a capability.** Before you tell the user something is\n unavailable: read the total, page through with `--cursor`, search again\n with different words (the catalog is indexed on how each Endpoint\n describes itself, which may not be your phrasing), and inspect every\n candidate whose name is close to the task \u2014 `inspect` is free.\n 2. `glasser inspect -p <provider> -e <endpoint>` \u2014 **read the Price and\n the charge clauses BEFORE running.** The Price is what a normal\n COMPLETED call costs; the charge clauses list the exceptions (e.g.\n `NO_RESULT $0.00` means an empty answer is free). For any given\n endpoint the clauses are authoritative. Also identify which input\n fields control result volume (`num`, `size`, `limit`, arrays of\n queries) \u2014 the charge rule may read the input, so volume parameters\n can change what a call costs. Start small; raise only when the user\n needs more.\n 3. `glasser run -p <provider> -e <endpoint> -i '<json>'` \u2014 execute.\n 4. Report the result AND the charge to the user (run output includes the\n charged amount). Every Run also prints a `Run URL` (the `run_url` field\n in `-j`; absent from the `-o` file): the Workspace console page holding\n that Run's records exactly as the Provider returned them, private to\n Workspace members. When your answer relies on a Run, cite that URL as\n its source \u2014 the Run id alone opens nothing for the user.\n\n## When NOT to use\n\n- **Precedence: an explicit user instruction > the user's own integrations\n and keys > Glasser.** If the user has their own key, client, or\n integration for the capability, use that instead.\n- **Runs spend the Workspace balance.** Do not run Endpoints speculatively,\n in loops, or for bulk operations without telling the user the per-call\n Price and getting their go-ahead.\n- Do not use it for capabilities the environment already provides for free.\n- **The catalog changes often** \u2014 Endpoints and Providers are added weekly.\n Search every time you need one; never cache or reuse a listing from an\n earlier session, and never answer \"what can Glasser do\" from memory.\n\n## Adding funds\n\nOnly the user can add funds, in the console at https://app.glasser.ai/balance \u2014\nno command or tool does it. Raise this only when a Run fails with\n`insufficient balance` or the user asks.\n\n- **Top up** on the Balance page.\n- **Grants** are free balance; users often call them \"credits\". The Balance\n page lists the Grants a Workspace can receive and their terms. Send the\n user there.\n\n## Commands\n\n| Command | Purpose |\n|---|---|\n| `glasser login` | Browser device authorization; stores a Key |\n| `glasser search [\"<query>\"] --use-case \"<sentence>\" [--limit N] [--cursor C] [--task T]` | Search Endpoints, 5 per page (max 20); `--use-case` is required on every search; `-q`/`--query` takes the same query; use `--query=<query>` when it starts with `-`; the footer prints the match total, the task id, the next-page cursor for `--cursor`, and a search-again command that carries the task and the use case |\n| `glasser inspect -p <provider> -e <endpoint> [--endpoint-version N] [--task T]` | Schemas, current Price, charge clauses, supported version |\n| `glasser run -p <provider> -e <endpoint> [-i '<json>' \\| -f <file>] [--idempotency-key K] [--task T] [--wait] [--wait-timeout s] [-o file]` | Execute an Endpoint |\n| `glasser runs list [--limit --cursor --status --provider --endpoint --task]` | List past Runs; `--task` is an exact match |\n| `glasser runs get -r <runId> [--wait] [-o file]` | Fetch one Run |\n| `glasser runs stop -r <runId>` | Stop a queued/running Run |\n| `glasser balance` | Balance, held and available; doubles as the auth probe |\n| `glasser balance history [--limit --cursor --kind]` | Ledger of charges, refunds, top-ups and Grants |\n| `glasser keys add/list/activate/remove` | Manage Keys stored on this machine |\n\nGlobal flags: `-j/--json` (raw JSON to stdout, errors as a single JSON\nobject on stderr), `--help`, `--version`.\n\nFacts that matter when scripting:\n\n- Exit codes: `0` success, `1` runtime failure, `2` usage error, `130`\n interrupted.\n- In `-j` mode, stdout is data only; parse stderr for the error object.\n- For large outputs, prefer `-o <file>` and read the file selectively \u2014\n dumping a full provider payload into your context wastes it.\n- Money is always an **exact decimal string** (e.g. `\"0.0125\"`), never a\n float. Do not do float arithmetic on it.\n- Env: `GLASSER_API_KEY`, `GLASSER_API_BASE_URL` (default\n `https://api.glasser.ai`; point it elsewhere and that stack's Workspace\n is what gets billed), `NO_COLOR`.\n\n## Run statuses and waiting\n\n| Status | Meaning |\n|---|---|\n| `QUEUED` | Accepted, not yet dispatched to the provider |\n| `RUNNING` | Dispatched, provider has not answered yet |\n| `COMPLETED` | Terminal \u2014 the provider answered (its answer may still be a \"not found\") |\n| `FAILED` | Terminal \u2014 no usable provider answer; the failure block says why |\n| `STOPPED` | Terminal \u2014 stopped via `runs stop`. Dispatch wins the race: a Run already sent to the provider completes and is charged |\n\nInspect shows each Endpoint's run mode: a `sync` Endpoint returns the\nfinished Run in the same response (its timeout is printed next to the\nmode) \u2014 `--wait` on those adds nothing. For anything still `QUEUED` or\n`RUNNING`, either pass `--wait` up front or poll with\n`glasser runs get -r <runId> --wait`; interactive sessions that want to\nkeep talking can fire without `--wait` and poll between replies.\n\n## Troubleshooting\n\n| Symptom | Meaning / action |\n|---|---|\n| `Invalid or missing API key` | Check the Key source. If `GLASSER_API_KEY` is set, correct it through its owner; login does not replace it. With no environment Key, use `glasser login` to replace a missing or rejected local Key |\n| Exit `2` | Your command line is wrong \u2014 fix it from the message; nothing reached the API and nothing was charged |\n| `Input does not match the endpoint's input schema` | Read the `issues:` lines under the error \u2014 they name the exact field and constraint. No Run was created and nothing was charged; fix the input and run again |\n| `insufficient balance` | The Workspace cannot cover the Price. Tell the user to add funds in the console (see **Adding funds**) \u2014 do not retry |\n| `rate_limited` | The Workspace or the endpoint is at its limit. Wait `retry_after_ms` (the error carries it; the hint prints it), then retry the same command once \u2014 do not loop |\n| Transport error / timeout with a retry hint | Outcome unknown \u2014 a Run may exist. Retry with the SAME Idempotency-Key exactly as the hint prints it |\n| `FAILED` with a charge shown | Legitimate when the charge clauses say so \u2014 report both the failure and the charge |\n| `Update available` notice | Finish the current task, re-run the installer, then update the installed skill as described in **Upgrading** |\n\n## Running safely\n\n- `run` prints `Charge: $X (rule)` \u2014 the amount billed under the\n endpoint's charge rule. Report that number to the user.\n- `run` prints the Idempotency-Key it used (auto-generated when omitted;\n `--json` mode requires an explicit `--idempotency-key`). On an ambiguous\n failure \u2014 timeout, dropped connection, nonzero exit with no clear answer \u2014\n **retry with the SAME key**: it returns the original Run instead of\n charging again.\n- **Two indicators, not one.** A Run's status and the provider's response\n are separate. `COMPLETED` means the provider answered \u2014 a `COMPLETED` Run\n whose payload is a provider 404 (\"person not found\") is a normal outcome,\n not an error. Whether it is charged follows the endpoint's charge clauses\n from inspect. Report both the Run status and what the provider actually\n said.\n- Use `--wait` to block until the Run settles; without it, poll with\n `glasser runs get -r <runId> --wait`.\n\n## Rules for agents\n\n1. The user's own keys, integrations and explicit instructions outrank\n Glasser \u2014 it fills gaps, never routes around what the user has.\n2. Always inspect before running; never guess input parameters \u2014 the input\n schema and charge clauses from `inspect` are the source of truth.\n3. Runs spend the Workspace balance: no speculative, looped, or bulk runs\n without naming the per-call Price and getting the user's go-ahead.\n4. Start with small volume parameters; raise them only on request.\n5. Interactive auth is `glasser login` \u2014 never ask the user to paste a Key.\n6. On an ambiguous failure, retry with the SAME Idempotency-Key.\n7. Carry the SAME `--task` through one piece of work, the way you carry that\n key \u2014 search prints it, inspect and run take it.\n8. Report two indicators after every run \u2014 the Run status and what the\n provider said \u2014 plus the printed `Charge:` amount; cite the `Run URL`,\n never the bare Run id, as the source of what your answer used.\n9. Money is an exact decimal string; never do float arithmetic on it.\n10. Prefer `-o <file>` for large outputs; `-j` when you parse.\n11. When any command prints an `Update available` notice: finish the task,\n re-run the installer, then update the installed skill as described in\n **Upgrading**.\n12. The CLI is the source of truth for flags \u2014 run `glasser <command>\n --help` when unsure.\n13. `rate_limited` means back off: wait `retry_after_ms`, then retry the\n same command once; never loop on it.\n\n`--endpoint-version` selects a supported compatible contract. It does not lock Price.\nCompatible updates keep the version; older versions work until explicitly retired.\nNew Runs use the selected version's Price at admission. Accepted Runs keep their original Price.\n" : readFileSync4(new URL("../../api/src/http/skill/SKILL.md", import.meta.url), "utf8");
|
|
66950
67969
|
var SKILL_NAME = "glasser";
|
|
66951
67970
|
var absolute = (value3, fallback) => value3 !== void 0 && path8.isAbsolute(value3) ? value3 : fallback;
|
|
66952
67971
|
function agents(env) {
|
|
@@ -67056,7 +68075,7 @@ var skill = Command_exports.make("skill").pipe(
|
|
|
67056
68075
|
// package.json
|
|
67057
68076
|
var package_default = {
|
|
67058
68077
|
name: "@glasser-ai/cli",
|
|
67059
|
-
version: "0.1.
|
|
68078
|
+
version: "0.1.88",
|
|
67060
68079
|
description: "Search, inspect and run paid API endpoints with one Key \u2014 the Glasser CLI",
|
|
67061
68080
|
license: "MIT",
|
|
67062
68081
|
type: "module",
|
|
@@ -67124,7 +68143,11 @@ var CLI_VERSION = package_default.version;
|
|
|
67124
68143
|
|
|
67125
68144
|
// src/http.ts
|
|
67126
68145
|
var USER_AGENT = `@glasser-ai/cli/${CLI_VERSION}`;
|
|
67127
|
-
var userAgentFor = (agent) =>
|
|
68146
|
+
var userAgentFor = (agent, stdinIsTty2) => [
|
|
68147
|
+
USER_AGENT,
|
|
68148
|
+
...agent === void 0 ? [] : [`AIAgent/${agent}`],
|
|
68149
|
+
`tty/${stdinIsTty2 ? 1 : 0}`
|
|
68150
|
+
].join(" ");
|
|
67128
68151
|
var withClientIdentity = (client, userAgent = USER_AGENT, channel) => client.pipe(
|
|
67129
68152
|
HttpClient_exports.mapRequest((request5) => {
|
|
67130
68153
|
const identified = HttpClientRequest_exports.setHeader(request5, "user-agent", userAgent);
|
|
@@ -67136,8 +68159,9 @@ var HttpClientLayer = HttpClient_exports.layerMergedContext(
|
|
|
67136
68159
|
Effect_exports.gen(function* () {
|
|
67137
68160
|
const client = yield* HttpClient_exports.HttpClient;
|
|
67138
68161
|
const agent = yield* codingAgent;
|
|
68162
|
+
const tty = yield* stdinIsTty;
|
|
67139
68163
|
const dir2 = yield* configDir;
|
|
67140
|
-
return withClientIdentity(client, userAgentFor(agent), channelHeader(readChannel(dir2)));
|
|
68164
|
+
return withClientIdentity(client, userAgentFor(agent, tty), channelHeader(readChannel(dir2)));
|
|
67141
68165
|
})
|
|
67142
68166
|
).pipe(Layer_exports.provide(NodeHttpClient_exports.layerUndici));
|
|
67143
68167
|
|