@arp-protocol/cli 0.0.3 → 0.0.4
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/CHANGELOG.md +25 -1
- package/README.md +3 -0
- package/dist/chunks/{backfill-awengrsd.js → backfill-5zmh0t43.js} +3 -1
- package/dist/chunks/check-k4qnc9ee.js +2011 -0
- package/dist/chunks/cli-7c393v47.js +173 -0
- package/dist/chunks/{cli-10wacn76.js → cli-8m56jsfx.js} +15 -173
- package/dist/chunks/cli-kda5hz4w.js +23 -0
- package/dist/chunks/{cli-wev0jgf7.js → cli-wer26exb.js} +905 -974
- package/dist/chunks/cli-zehr6kdx.js +719 -0
- package/dist/chunks/{commands-157bms70.js → commands-t5a0w785.js} +12 -2
- package/dist/chunks/{line-691gbaha.js → line-kvm1ew55.js} +54 -5
- package/dist/chunks/{node-init-rcepfyeh.js → node-init-amedveja.js} +2 -1
- package/dist/chunks/{node-m0mx4y5k.js → node-x35ncwhq.js} +2 -1
- package/dist/chunks/{server-59zry2jp.js → server-ek7fet5m.js} +190 -90
- package/dist/chunks/{share-vtbkzs5f.js → share-ax2k8805.js} +3 -1
- package/dist/cli.js +34 -11
- package/dist/hook.js +746 -148
- package/package.json +2 -2
|
@@ -1,4 +1,48 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
AGENT_EDGE_LIMIT,
|
|
4
|
+
AGENT_IDENTITIES_QUERY,
|
|
5
|
+
ALL_HIERARCHY_QUERY,
|
|
6
|
+
ATTACHED_DOCUMENTS_QUERY,
|
|
7
|
+
ATTESTED_TOOL_USAGE_QUERY,
|
|
8
|
+
BY_URL_QUERY,
|
|
9
|
+
CAPABILITIES_QUERY,
|
|
10
|
+
COHORT_ORDER_BY,
|
|
11
|
+
COHORT_QUERY,
|
|
12
|
+
DEFAULT_MAX_BODY_BYTES,
|
|
13
|
+
DEFAULT_TIMEOUT_MS,
|
|
14
|
+
ENDPOINT_SUBJECTS_QUERY,
|
|
15
|
+
FIND_AGENTS_QUERY,
|
|
16
|
+
HttpError,
|
|
17
|
+
IDENTITY_CLAIMS_QUERY,
|
|
18
|
+
IDENTITY_SAMPLE_LIMIT,
|
|
19
|
+
OUR_HIERARCHY_QUERY,
|
|
20
|
+
PULSE_ATOMS_QUERY,
|
|
21
|
+
PULSE_DOMAIN_EDGES_QUERY,
|
|
22
|
+
PULSE_EDGE_TOOLS_QUERY,
|
|
23
|
+
PULSE_EDGE_WRITERS_QUERY,
|
|
24
|
+
PULSE_QUALIFIERS_QUERY,
|
|
25
|
+
PULSE_USES_QUERY,
|
|
26
|
+
REGISTERED_TOOLS_QUERY,
|
|
27
|
+
RESOLVE_AGENT_QUERY,
|
|
28
|
+
SPONSORED_WALLETS_QUERY,
|
|
29
|
+
TAGGED_QUERY,
|
|
30
|
+
TOOL_LISTING_QUERY,
|
|
31
|
+
TOOL_LISTING_SPONSORED_QUERY,
|
|
32
|
+
TOOL_USAGE_QUERY,
|
|
33
|
+
TRUST_SURFACE_QUERY,
|
|
34
|
+
createGraphqlTransport,
|
|
35
|
+
defaultFetch,
|
|
36
|
+
isRecord,
|
|
37
|
+
isTimeoutError,
|
|
38
|
+
readArray,
|
|
39
|
+
readBigInt,
|
|
40
|
+
readBodyText,
|
|
41
|
+
readCount,
|
|
42
|
+
readNumber,
|
|
43
|
+
readRecord,
|
|
44
|
+
readString
|
|
45
|
+
} from "./cli-zehr6kdx.js";
|
|
2
46
|
import {
|
|
3
47
|
AtomicReadyWalletRejectedUpgradeError,
|
|
4
48
|
AtomicityNotSupportedError,
|
|
@@ -7701,6 +7745,10 @@ async function recoverTypedDataAddress2(parameters) {
|
|
|
7701
7745
|
signature
|
|
7702
7746
|
});
|
|
7703
7747
|
}
|
|
7748
|
+
// ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/signature/verifyMessage.js
|
|
7749
|
+
async function verifyMessage3({ address, message, signature }) {
|
|
7750
|
+
return isAddressEqual(getAddress(address), await recoverMessageAddress2({ message, signature }));
|
|
7751
|
+
}
|
|
7704
7752
|
// ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/unit.js
|
|
7705
7753
|
class InvalidDecimalNumberError extends BaseError {
|
|
7706
7754
|
constructor({ value }) {
|
|
@@ -7770,6 +7818,56 @@ function isTransactionAbsent(error) {
|
|
|
7770
7818
|
return error.walk((cause) => cause instanceof TransactionNotFoundError || cause instanceof TransactionReceiptNotFoundError) !== null;
|
|
7771
7819
|
}
|
|
7772
7820
|
|
|
7821
|
+
// ../../packages/protocol/dist/endpoint-redaction.js
|
|
7822
|
+
var REDACTED_SEGMENT = ":id";
|
|
7823
|
+
|
|
7824
|
+
class EndpointNotRedactableError extends Error {
|
|
7825
|
+
input;
|
|
7826
|
+
constructor(input, why) {
|
|
7827
|
+
super(`${JSON.stringify(input)} cannot be written as an endpoint: ${why}`);
|
|
7828
|
+
this.name = "EndpointNotRedactableError";
|
|
7829
|
+
this.input = input;
|
|
7830
|
+
}
|
|
7831
|
+
}
|
|
7832
|
+
var PARTS = /^([A-Za-z][A-Za-z0-9+.-]*:\/\/)([^/?#]*)([^?#]*)(?:\?([^#]*))?(?:#.*)?$/;
|
|
7833
|
+
var PERSONAL = [
|
|
7834
|
+
(s) => s.includes("@"),
|
|
7835
|
+
(s) => /0x[0-9a-f]{40}/i.test(s),
|
|
7836
|
+
(s) => /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i.test(s),
|
|
7837
|
+
(s) => /\d{6}/.test(s),
|
|
7838
|
+
(s) => (s.match(/[0-9a-f]{16,}/gi) ?? []).some((run) => /\d/.test(run)),
|
|
7839
|
+
(s) => /^[\d\s+().-]+$/.test(s) && (s.match(/\d/g) ?? []).length >= 7,
|
|
7840
|
+
(s) => /\s/.test(s),
|
|
7841
|
+
(s) => s.length > 20 && /^[A-Za-z0-9+/=_-]+$/.test(s) && /[A-Z]/.test(s) && /[a-z]/.test(s) && /\d/.test(s)
|
|
7842
|
+
];
|
|
7843
|
+
function looksPersonal(segment) {
|
|
7844
|
+
if (segment === REDACTED_SEGMENT)
|
|
7845
|
+
return false;
|
|
7846
|
+
let decoded = segment;
|
|
7847
|
+
try {
|
|
7848
|
+
decoded = decodeURIComponent(segment);
|
|
7849
|
+
} catch {}
|
|
7850
|
+
return [segment, decoded].some((form) => PERSONAL.some((test) => test(form)));
|
|
7851
|
+
}
|
|
7852
|
+
var reduce = (segment) => segment !== "" && looksPersonal(segment) ? REDACTED_SEGMENT : segment;
|
|
7853
|
+
function redactEndpointUrl(url) {
|
|
7854
|
+
const match = PARTS.exec(url);
|
|
7855
|
+
if (match === null)
|
|
7856
|
+
throw new EndpointNotRedactableError(url, "not a URL with a scheme and a host");
|
|
7857
|
+
const scheme = match[1];
|
|
7858
|
+
const authority = match[2];
|
|
7859
|
+
if (!/^https?:\/\/$/i.test(scheme))
|
|
7860
|
+
throw new EndpointNotRedactableError(url, `scheme ${scheme} is not http or https`);
|
|
7861
|
+
if (authority.includes("@"))
|
|
7862
|
+
throw new EndpointNotRedactableError(url, "it carries credentials (user:pass@)");
|
|
7863
|
+
if (authority === "" || authority.startsWith(":"))
|
|
7864
|
+
throw new EndpointNotRedactableError(url, "no host");
|
|
7865
|
+
const path = match[3].split("/").map(reduce).join("/");
|
|
7866
|
+
const names = (match[4] ?? "").split("&").filter((part) => part.indexOf("=") > 0).map((part) => reduce(part.slice(0, part.indexOf("="))));
|
|
7867
|
+
const query = names.length === 0 ? "" : `?${names.map((name) => `${name}=`).join("&")}`;
|
|
7868
|
+
return `${scheme}${authority}${path}${query}`;
|
|
7869
|
+
}
|
|
7870
|
+
|
|
7773
7871
|
// ../../packages/protocol/dist/declare/label.js
|
|
7774
7872
|
function normaliseCategoryLabel(raw) {
|
|
7775
7873
|
return raw.normalize("NFKC").normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase().trim().replace(/\s+/g, " ");
|
|
@@ -8282,897 +8380,239 @@ async function prepareMarketExit(params) {
|
|
|
8282
8380
|
]
|
|
8283
8381
|
};
|
|
8284
8382
|
}
|
|
8285
|
-
// ../../packages/
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
this.kind = kind;
|
|
8296
|
-
this.timeoutMs = timeoutMs;
|
|
8297
|
-
}
|
|
8383
|
+
// ../../packages/protocol/dist/declare/thing-cid.js
|
|
8384
|
+
function thingDocument(thing) {
|
|
8385
|
+
return JSON.stringify({
|
|
8386
|
+
"@context": "https://schema.org",
|
|
8387
|
+
"@type": "Thing",
|
|
8388
|
+
description: thing.description,
|
|
8389
|
+
image: thing.image,
|
|
8390
|
+
name: thing.name,
|
|
8391
|
+
url: thing.url
|
|
8392
|
+
});
|
|
8298
8393
|
}
|
|
8299
|
-
function
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8394
|
+
function base32(bytes) {
|
|
8395
|
+
const alphabet = "abcdefghijklmnopqrstuvwxyz234567";
|
|
8396
|
+
let bits = 0;
|
|
8397
|
+
let value = 0;
|
|
8398
|
+
let out = "";
|
|
8399
|
+
for (const byte of bytes) {
|
|
8400
|
+
value = value << 8 | byte;
|
|
8401
|
+
bits += 8;
|
|
8402
|
+
while (bits >= 5) {
|
|
8403
|
+
out += alphabet[value >>> bits - 5 & 31];
|
|
8404
|
+
bits -= 5;
|
|
8405
|
+
}
|
|
8305
8406
|
}
|
|
8306
|
-
|
|
8407
|
+
if (bits > 0)
|
|
8408
|
+
out += alphabet[value << 5 - bits & 31];
|
|
8409
|
+
return out;
|
|
8307
8410
|
}
|
|
8308
|
-
|
|
8309
|
-
const
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
const
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
-
|
|
8340
|
-
|
|
8341
|
-
|
|
8342
|
-
return text + decoder.decode();
|
|
8343
|
-
} catch (error) {
|
|
8344
|
-
reader.cancel().catch(() => {
|
|
8345
|
-
return;
|
|
8346
|
-
});
|
|
8347
|
-
if (error instanceof HttpError)
|
|
8348
|
-
throw error;
|
|
8349
|
-
throw new HttpError("network", error instanceof Error ? error.message : String(error), timeoutMs, error);
|
|
8350
|
-
} finally {
|
|
8351
|
-
if (signal !== undefined && onAbort !== null)
|
|
8352
|
-
signal.removeEventListener("abort", onAbort);
|
|
8411
|
+
function thingUriOfDigest(digest) {
|
|
8412
|
+
const cid = new Uint8Array(4 + digest.length);
|
|
8413
|
+
cid.set([1, 85, 18, 32]);
|
|
8414
|
+
cid.set(digest, 4);
|
|
8415
|
+
return `ipfs://b${base32(cid)}`;
|
|
8416
|
+
}
|
|
8417
|
+
|
|
8418
|
+
// ../../packages/protocol/dist/declare/agent-atom.js
|
|
8419
|
+
function canonicalAgentThing(chainId, tokenId, registration) {
|
|
8420
|
+
const normalize = (value) => {
|
|
8421
|
+
if (typeof value !== "string")
|
|
8422
|
+
return null;
|
|
8423
|
+
const trimmed = value.trim();
|
|
8424
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
8425
|
+
};
|
|
8426
|
+
const agentKey = `${chainId}:${tokenId}`;
|
|
8427
|
+
return {
|
|
8428
|
+
name: normalize(registration?.name) ?? `Agent ${agentKey}`,
|
|
8429
|
+
description: normalize(registration?.description) ?? `ERC-8004 agent ${agentKey}`,
|
|
8430
|
+
image: normalize(registration?.image) ?? "",
|
|
8431
|
+
url: normalize(registration?.webEndpoint) ?? `https://8004scan.io/agents/${chainId}/${tokenId}`
|
|
8432
|
+
};
|
|
8433
|
+
}
|
|
8434
|
+
function thingUri(thing) {
|
|
8435
|
+
return thingUriOfDigest(toBytes(sha256(toBytes(thingDocument(thing)))));
|
|
8436
|
+
}
|
|
8437
|
+
|
|
8438
|
+
// ../../packages/protocol/dist/declare/tool-thing.js
|
|
8439
|
+
class InvalidToolUrlError extends Error {
|
|
8440
|
+
input;
|
|
8441
|
+
constructor(input, why) {
|
|
8442
|
+
super(`${JSON.stringify(input)} is not a usable tool URL: ${why}`);
|
|
8443
|
+
this.name = "InvalidToolUrlError";
|
|
8444
|
+
this.input = input;
|
|
8353
8445
|
}
|
|
8354
8446
|
}
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
const
|
|
8358
|
-
|
|
8447
|
+
var TOOL_THING_DESCRIPTION = "A tool identified by its URL, so every declaration of its use lands on one atom.";
|
|
8448
|
+
function normaliseToolUrl(input) {
|
|
8449
|
+
const trimmed = input.trim();
|
|
8450
|
+
if (trimmed.length === 0)
|
|
8451
|
+
throw new InvalidToolUrlError(input, "empty");
|
|
8452
|
+
const withScheme = /^[a-z][a-z0-9+.-]*:/i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
8453
|
+
let url;
|
|
8359
8454
|
try {
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
} catch (error) {
|
|
8364
|
-
if (controller.signal.aborted) {
|
|
8365
|
-
throw new HttpError("timeout", `timed out after ${timeoutMs}ms: ${url}`, timeoutMs);
|
|
8366
|
-
}
|
|
8367
|
-
throw new HttpError("network", error instanceof Error ? error.message : String(error), timeoutMs, error);
|
|
8368
|
-
}
|
|
8369
|
-
const text = await readBodyText(response, {
|
|
8370
|
-
signal: controller.signal,
|
|
8371
|
-
timeoutMs,
|
|
8372
|
-
...options.maxBytes === undefined ? {} : { maxBytes: options.maxBytes }
|
|
8373
|
-
});
|
|
8374
|
-
return { response, text };
|
|
8375
|
-
} finally {
|
|
8376
|
-
clearTimeout(timer);
|
|
8455
|
+
url = new URL(withScheme);
|
|
8456
|
+
} catch {
|
|
8457
|
+
throw new InvalidToolUrlError(input, "not parseable as a URL");
|
|
8377
8458
|
}
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
if (typeof globalThis.fetch !== "function") {
|
|
8381
|
-
throw new TypeError("no global fetch available — pass one via createErc8004Client({fetch})");
|
|
8459
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
8460
|
+
throw new InvalidToolUrlError(input, `scheme ${url.protocol} is not http or https`);
|
|
8382
8461
|
}
|
|
8383
|
-
|
|
8462
|
+
if (url.hostname.length === 0)
|
|
8463
|
+
throw new InvalidToolUrlError(input, "no host");
|
|
8464
|
+
const host = url.hostname.replace(/\.+$/, "").replace(/^(?:www\.)+/, "");
|
|
8465
|
+
const path = url.pathname.replace(/(?:\.git|\/)+$/, "");
|
|
8466
|
+
const params = [...new URLSearchParams(url.search).entries()].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
8467
|
+
const query = params.length === 0 ? "" : `?${new URLSearchParams(params).toString()}`;
|
|
8468
|
+
const port = url.port === "" || url.port === "80" || url.port === "443" ? "" : `:${url.port}`;
|
|
8469
|
+
return `https://${host}${port}${path}${query}`;
|
|
8470
|
+
}
|
|
8471
|
+
function toolThing(url) {
|
|
8472
|
+
const normalised = normaliseToolUrl(url);
|
|
8473
|
+
return {
|
|
8474
|
+
name: normalised.slice("https://".length),
|
|
8475
|
+
description: TOOL_THING_DESCRIPTION,
|
|
8476
|
+
image: "",
|
|
8477
|
+
url: normalised
|
|
8478
|
+
};
|
|
8384
8479
|
}
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8480
|
+
function toolAtomUri(url) {
|
|
8481
|
+
return thingUri(toolThing(url));
|
|
8388
8482
|
}
|
|
8389
|
-
function
|
|
8390
|
-
|
|
8391
|
-
return null;
|
|
8392
|
-
const child = source[key];
|
|
8393
|
-
return isRecord(child) ? child : null;
|
|
8483
|
+
function toolThingDocument(url) {
|
|
8484
|
+
return thingDocument(toolThing(url));
|
|
8394
8485
|
}
|
|
8395
|
-
function
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8399
|
-
|
|
8486
|
+
function isToolUrl(uri) {
|
|
8487
|
+
try {
|
|
8488
|
+
normaliseToolUrl(uri);
|
|
8489
|
+
return true;
|
|
8490
|
+
} catch {
|
|
8491
|
+
return false;
|
|
8492
|
+
}
|
|
8400
8493
|
}
|
|
8401
|
-
|
|
8402
|
-
|
|
8403
|
-
|
|
8404
|
-
|
|
8405
|
-
|
|
8494
|
+
|
|
8495
|
+
// ../../packages/protocol/dist/tool-url-values.js
|
|
8496
|
+
var GITHUB = /^https?:\/\/(?:www\.)?github\.com(?:[/?#]|$)/i;
|
|
8497
|
+
function publishableToolUrl(url) {
|
|
8498
|
+
if (GITHUB.test(url)) {
|
|
8499
|
+
let parsed;
|
|
8500
|
+
try {
|
|
8501
|
+
parsed = new URL(url);
|
|
8502
|
+
} catch {
|
|
8503
|
+
return { ok: false, why: "it is not a URL", listable: null };
|
|
8504
|
+
}
|
|
8505
|
+
const names = [...parsed.searchParams.keys()];
|
|
8506
|
+
const others = [...new Set(names.filter((name) => name !== "skill"))];
|
|
8507
|
+
if (others.length === 0 && names.length <= 1 && parsed.hash === "")
|
|
8508
|
+
return { ok: true };
|
|
8509
|
+
const skill = parsed.searchParams.get("skill");
|
|
8510
|
+
const listable = normaliseToolUrl(`${parsed.origin}${parsed.pathname}${skill === null ? "" : `?skill=${encodeURIComponent(skill)}`}`);
|
|
8511
|
+
const why = others.length > 0 ? `its query carries ${others.join(", ")}` : "its query repeats skill";
|
|
8512
|
+
return { ok: false, why, listable };
|
|
8513
|
+
}
|
|
8514
|
+
let redacted;
|
|
8515
|
+
try {
|
|
8516
|
+
redacted = redactEndpointUrl(url);
|
|
8517
|
+
} catch (error) {
|
|
8518
|
+
if (error instanceof EndpointNotRedactableError)
|
|
8519
|
+
return { ok: false, why: error.message, listable: null };
|
|
8520
|
+
throw error;
|
|
8521
|
+
}
|
|
8522
|
+
if (redacted === url)
|
|
8523
|
+
return { ok: true };
|
|
8524
|
+
const valued = new Set((url.split("#")[0] ?? "").split("?").slice(1).join("?").split("&").filter((part) => part.indexOf("=") > 0 && part.slice(part.indexOf("=") + 1) !== "").map((part) => part.slice(0, part.indexOf("="))));
|
|
8525
|
+
const parts = [];
|
|
8526
|
+
if (valued.size > 0)
|
|
8527
|
+
parts.push(`a value for ${[...valued].join(", ")}`);
|
|
8528
|
+
const pathOf = (u) => u.split(/[?#]/)[0];
|
|
8529
|
+
if (pathOf(redacted) !== pathOf(url))
|
|
8530
|
+
parts.push("a path segment or name that looks personal");
|
|
8531
|
+
if (url.includes("#"))
|
|
8532
|
+
parts.push("a fragment");
|
|
8533
|
+
return { ok: false, why: `it carries ${parts.length === 0 ? "a value" : parts.join(" and ")}`, listable: redacted };
|
|
8406
8534
|
}
|
|
8407
|
-
|
|
8408
|
-
|
|
8409
|
-
|
|
8410
|
-
|
|
8411
|
-
|
|
8535
|
+
|
|
8536
|
+
class ToolUrlCarriesValuesError extends Error {
|
|
8537
|
+
listable;
|
|
8538
|
+
constructor(why, listable) {
|
|
8539
|
+
super(`This tool URL cannot be listed: ${why}. A tool's URL is written publicly and for good, so remove it` + (listable === null ? "." : ` and list ${listable}.`));
|
|
8540
|
+
this.name = "ToolUrlCarriesValuesError";
|
|
8541
|
+
this.listable = listable;
|
|
8542
|
+
}
|
|
8412
8543
|
}
|
|
8413
|
-
function
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
if (typeof value === "bigint")
|
|
8418
|
-
return value;
|
|
8419
|
-
if (typeof value === "number")
|
|
8420
|
-
return Number.isInteger(value) ? BigInt(value) : null;
|
|
8421
|
-
if (typeof value !== "string" || !/^-?\d+$/.test(value))
|
|
8422
|
-
return null;
|
|
8423
|
-
return BigInt(value);
|
|
8544
|
+
function assertPublishableToolUrl(url) {
|
|
8545
|
+
const verdict = publishableToolUrl(url);
|
|
8546
|
+
if (!verdict.ok)
|
|
8547
|
+
throw new ToolUrlCarriesValuesError(verdict.why, verdict.listable);
|
|
8424
8548
|
}
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
const
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
}
|
|
8432
|
-
|
|
8433
|
-
class GraphqlError extends Error {
|
|
8434
|
-
url;
|
|
8435
|
-
httpStatus;
|
|
8436
|
-
constructor(message, url, httpStatus, cause) {
|
|
8437
|
-
super(message, cause === undefined ? undefined : { cause });
|
|
8438
|
-
this.name = "GraphqlError";
|
|
8439
|
-
this.url = url;
|
|
8440
|
-
this.httpStatus = httpStatus;
|
|
8441
|
-
}
|
|
8442
|
-
}
|
|
8443
|
-
function createGraphqlTransport(config) {
|
|
8444
|
-
const timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
8549
|
+
|
|
8550
|
+
// ../../packages/protocol/dist/declare/tool-atom.js
|
|
8551
|
+
function intuitionToolAtomLookup(config) {
|
|
8552
|
+
const transport = config.transport ?? createGraphqlTransport({
|
|
8553
|
+
url: config.graphqlUrl,
|
|
8554
|
+
fetch: config.fetch ?? defaultFetch(),
|
|
8555
|
+
...config.timeoutMs === undefined ? {} : { timeoutMs: config.timeoutMs }
|
|
8556
|
+
});
|
|
8445
8557
|
return {
|
|
8446
|
-
async
|
|
8447
|
-
|
|
8448
|
-
|
|
8449
|
-
|
|
8450
|
-
|
|
8451
|
-
|
|
8452
|
-
|
|
8453
|
-
|
|
8454
|
-
|
|
8455
|
-
|
|
8456
|
-
|
|
8457
|
-
|
|
8458
|
-
|
|
8459
|
-
|
|
8460
|
-
})
|
|
8461
|
-
} catch (error) {
|
|
8462
|
-
const message = error instanceof HttpError ? error.message : String(error);
|
|
8463
|
-
throw new GraphqlError(message, config.url, null, error);
|
|
8464
|
-
}
|
|
8465
|
-
if (!response.ok) {
|
|
8466
|
-
throw new GraphqlError(`HTTP ${response.status} ${response.statusText}`, config.url, response.status);
|
|
8467
|
-
}
|
|
8468
|
-
let body = null;
|
|
8469
|
-
try {
|
|
8470
|
-
body = JSON.parse(text);
|
|
8471
|
-
} catch {
|
|
8472
|
-
body = null;
|
|
8473
|
-
}
|
|
8474
|
-
if (!isRecord(body)) {
|
|
8475
|
-
throw new GraphqlError("response body is not a JSON object", config.url, 200);
|
|
8476
|
-
}
|
|
8477
|
-
const errors = readArray(body, "errors");
|
|
8478
|
-
if (errors.length > 0) {
|
|
8479
|
-
const messages = errors.map((entry) => readString(entry, "message") ?? "unknown error").join("; ");
|
|
8480
|
-
throw new GraphqlError(messages, config.url, 200);
|
|
8481
|
-
}
|
|
8482
|
-
const data = body["data"];
|
|
8483
|
-
if (!isRecord(data)) {
|
|
8484
|
-
throw new GraphqlError("response carries no data object", config.url, 200);
|
|
8558
|
+
async findByUrl(url) {
|
|
8559
|
+
const data = await transport.request(BY_URL_QUERY, { url });
|
|
8560
|
+
const rows = Array.isArray(data["atoms"]) ? data["atoms"] : [];
|
|
8561
|
+
const candidates = [];
|
|
8562
|
+
for (const row of rows) {
|
|
8563
|
+
if (!isRecord(row))
|
|
8564
|
+
continue;
|
|
8565
|
+
const termId = readString(row, "term_id");
|
|
8566
|
+
if (termId === null)
|
|
8567
|
+
continue;
|
|
8568
|
+
candidates.push({
|
|
8569
|
+
termId,
|
|
8570
|
+
label: readString(row, "label"),
|
|
8571
|
+
uri: readString(row, "data")
|
|
8572
|
+
});
|
|
8485
8573
|
}
|
|
8486
|
-
return
|
|
8487
|
-
}
|
|
8488
|
-
};
|
|
8489
|
-
}
|
|
8490
|
-
// ../../packages/graphql/dist/queries/agent.js
|
|
8491
|
-
var THING = `value { thing { name description image url } }`;
|
|
8492
|
-
var MARKET_SIDE = `
|
|
8493
|
-
total_market_cap
|
|
8494
|
-
total_assets
|
|
8495
|
-
vaults(where: {curve_id: {_eq: $curveId}}, limit: 1) {
|
|
8496
|
-
market_cap
|
|
8497
|
-
total_assets
|
|
8498
|
-
total_shares
|
|
8499
|
-
current_share_price
|
|
8500
|
-
position_count
|
|
8501
|
-
}`;
|
|
8502
|
-
var RESOLVE_AGENT_QUERY = `
|
|
8503
|
-
query ResolveAgentByCaip($sameAsPredicateId: String!, $caipId: String!) {
|
|
8504
|
-
triples(
|
|
8505
|
-
where: {
|
|
8506
|
-
predicate_id: {_eq: $sameAsPredicateId}
|
|
8507
|
-
object: {value: {thing: {name: {_eq: $caipId}}}}
|
|
8574
|
+
return candidates;
|
|
8508
8575
|
}
|
|
8509
|
-
|
|
8510
|
-
|
|
8511
|
-
|
|
8576
|
+
};
|
|
8577
|
+
}
|
|
8578
|
+
function derivesItsOwnAtom(uri) {
|
|
8579
|
+
return /^(ipfs|ar):\/\//i.test(uri.trim());
|
|
8580
|
+
}
|
|
8581
|
+
|
|
8582
|
+
// ../../packages/protocol/dist/declare/plan.js
|
|
8583
|
+
class EmptyPlanError extends Error {
|
|
8584
|
+
constructor(what) {
|
|
8585
|
+
super(`nothing to plan: ${what}`);
|
|
8586
|
+
this.name = "EmptyPlanError";
|
|
8512
8587
|
}
|
|
8513
|
-
}
|
|
8514
|
-
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
) {
|
|
8522
|
-
term_id
|
|
8523
|
-
predicate { term_id label }
|
|
8524
|
-
object { term_id label data ${THING} }
|
|
8525
|
-
term {${MARKET_SIDE}
|
|
8526
|
-
}
|
|
8527
|
-
counter_term {${MARKET_SIDE}
|
|
8528
|
-
}
|
|
8588
|
+
}
|
|
8589
|
+
|
|
8590
|
+
class NonPositiveAmountError extends Error {
|
|
8591
|
+
tripleId;
|
|
8592
|
+
constructor(tripleId, amount) {
|
|
8593
|
+
super(`a deposit of ${amount} on ${tripleId} would put nothing behind the claim; ` + `an edge with no stake carries no weight at all (docs/14)`);
|
|
8594
|
+
this.name = "NonPositiveAmountError";
|
|
8595
|
+
this.tripleId = tripleId;
|
|
8529
8596
|
}
|
|
8530
|
-
}
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
object { term_id label ${THING} }
|
|
8597
|
+
}
|
|
8598
|
+
|
|
8599
|
+
class AmbiguousToolAtomError extends Error {
|
|
8600
|
+
uri;
|
|
8601
|
+
candidates;
|
|
8602
|
+
constructor(uri, candidates) {
|
|
8603
|
+
super(`${candidates.length} atoms already claim ${uri} — ` + candidates.map((c) => `${c.termId} (${c.label ?? "no label"})`).join(", ") + `. Refusing to choose: a \`uses\` edge on the wrong one is permanent. ` + `Pass the \`ipfs://\` URI of the atom you mean.`);
|
|
8604
|
+
this.name = "AmbiguousToolAtomError";
|
|
8605
|
+
this.uri = uri;
|
|
8606
|
+
this.candidates = candidates;
|
|
8541
8607
|
}
|
|
8542
|
-
}
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
aggregate { count }
|
|
8551
|
-
}
|
|
8552
|
-
triples(
|
|
8553
|
-
where: $where
|
|
8554
|
-
order_by: $orderBy
|
|
8555
|
-
limit: $limit
|
|
8556
|
-
offset: $offset
|
|
8557
|
-
) {
|
|
8558
|
-
subject {
|
|
8559
|
-
term_id
|
|
8560
|
-
label
|
|
8561
|
-
${THING}
|
|
8562
|
-
as_subject_triples_aggregate { aggregate { count } }
|
|
8563
|
-
term {
|
|
8564
|
-
total_market_cap
|
|
8565
|
-
vaults_aggregate { aggregate { count sum { position_count } } }
|
|
8566
|
-
}
|
|
8567
|
-
identityCount: as_subject_triples_aggregate(
|
|
8568
|
-
where: {predicate_id: {_eq: $sameAsPredicateId}}
|
|
8569
|
-
) {
|
|
8570
|
-
aggregate { count }
|
|
8571
|
-
}
|
|
8572
|
-
identity: as_subject_triples(
|
|
8573
|
-
where: {predicate_id: {_eq: $sameAsPredicateId}}
|
|
8574
|
-
limit: ${IDENTITY_SAMPLE_LIMIT}
|
|
8575
|
-
) {
|
|
8576
|
-
object { label ${THING} }
|
|
8577
|
-
}
|
|
8578
|
-
capabilities: as_subject_triples(
|
|
8579
|
-
where: {predicate_id: {_in: $capabilityPredicateIds}}
|
|
8580
|
-
limit: ${CAPABILITY_SAMPLE_LIMIT}
|
|
8581
|
-
) {
|
|
8582
|
-
predicate_id
|
|
8583
|
-
object { term_id label }
|
|
8584
|
-
}
|
|
8585
|
-
}
|
|
8586
|
-
}
|
|
8587
|
-
}`;
|
|
8588
|
-
var COHORT_ORDER_BY = {
|
|
8589
|
-
"evidence-quantity": [
|
|
8590
|
-
{ subject: { as_subject_triples_aggregate: { count: "desc" } } },
|
|
8591
|
-
{ subject_id: "asc" }
|
|
8592
|
-
],
|
|
8593
|
-
"economic-conviction": [{ subject: { term: { total_market_cap: "desc" } } }, { subject_id: "asc" }]
|
|
8594
|
-
};
|
|
8595
|
-
// ../../packages/graphql/dist/queries/atom-standing.js
|
|
8596
|
-
var VAULT_SIDE = `
|
|
8597
|
-
total_market_cap
|
|
8598
|
-
total_assets
|
|
8599
|
-
vaults(where: {curve_id: {_eq: $curveId}}, limit: 1) {
|
|
8600
|
-
market_cap
|
|
8601
|
-
total_assets
|
|
8602
|
-
total_shares
|
|
8603
|
-
current_share_price
|
|
8604
|
-
position_count
|
|
8605
|
-
}`;
|
|
8606
|
-
var ATOM_STANDING_QUERY = `
|
|
8607
|
-
query AtomStanding($atomId: String!, $curveId: numeric!, $limit: Int!, $attestor: [String!]!) {
|
|
8608
|
-
atom: atoms(where: {term_id: {_eq: $atomId}}, limit: 1) {
|
|
8609
|
-
term_id
|
|
8610
|
-
label
|
|
8611
|
-
data
|
|
8612
|
-
type
|
|
8613
|
-
value { thing { url } }
|
|
8614
|
-
term { ${VAULT_SIDE} }
|
|
8615
|
-
}
|
|
8616
|
-
triples(
|
|
8617
|
-
where: {object_id: {_eq: $atomId}}
|
|
8618
|
-
order_by: {term: {total_assets: desc}}
|
|
8619
|
-
limit: $limit
|
|
8620
|
-
) {
|
|
8621
|
-
term_id
|
|
8622
|
-
predicate { term_id label }
|
|
8623
|
-
subject { term_id label type }
|
|
8624
|
-
term { ${VAULT_SIDE} }
|
|
8625
|
-
counter_term { ${VAULT_SIDE} }
|
|
8626
|
-
}
|
|
8627
|
-
claims: triples(
|
|
8628
|
-
where: {subject_id: {_eq: $atomId}}
|
|
8629
|
-
order_by: {term: {total_assets: desc}}
|
|
8630
|
-
limit: $limit
|
|
8631
|
-
) {
|
|
8632
|
-
term_id
|
|
8633
|
-
predicate { term_id label }
|
|
8634
|
-
object { term_id label type }
|
|
8635
|
-
term {
|
|
8636
|
-
${VAULT_SIDE}
|
|
8637
|
-
vaults(where: {curve_id: {_eq: $curveId}}, limit: 1) {
|
|
8638
|
-
positions(where: {account_id: {_in: $attestor}, shares: {_gt: "0"}}, limit: 1) { shares }
|
|
8639
|
-
}
|
|
8640
|
-
}
|
|
8641
|
-
}
|
|
8642
|
-
}`;
|
|
8643
|
-
var LISTED_CAPABILITIES_FOR_QUERY = `query ListedCapabilitiesFor($subject: String!, $predicates: [String!]) {
|
|
8644
|
-
atoms(where: {term_id: {_eq: $subject}}, limit: 1) {
|
|
8645
|
-
capabilities: as_subject_triples(
|
|
8646
|
-
where: {predicate_id: {_in: $predicates}}
|
|
8647
|
-
limit: ${CAPABILITY_SAMPLE_LIMIT}
|
|
8648
|
-
) { object { term_id } }
|
|
8649
|
-
}
|
|
8650
|
-
}`;
|
|
8651
|
-
// ../../packages/graphql/dist/queries/discover.js
|
|
8652
|
-
var FIND_AGENTS_QUERY = `
|
|
8653
|
-
query FindAgents($domain: String!, $predicates: [String!], $sameAs: String!, $curveId: numeric!, $limit: Int!) {
|
|
8654
|
-
triples(
|
|
8655
|
-
where: {
|
|
8656
|
-
predicate_id: {_in: $predicates}
|
|
8657
|
-
object: {label: {_ilike: $domain}}
|
|
8658
|
-
subject: {as_subject_triples: {predicate_id: {_eq: $sameAs}}}
|
|
8659
|
-
}
|
|
8660
|
-
limit: $limit
|
|
8661
|
-
) {
|
|
8662
|
-
predicate_id
|
|
8663
|
-
object { label }
|
|
8664
|
-
subject {
|
|
8665
|
-
term_id
|
|
8666
|
-
label
|
|
8667
|
-
term { vaults(where: {curve_id: {_eq: $curveId}}, limit: 1) { position_count total_assets } }
|
|
8668
|
-
}
|
|
8669
|
-
}
|
|
8670
|
-
}`;
|
|
8671
|
-
// ../../packages/graphql/dist/queries/domains.js
|
|
8672
|
-
var OUR_HIERARCHY_QUERY = `query($pid: String!, $who: [String!]!, $curveId: numeric!, $limit: Int!, $offset: Int!) {
|
|
8673
|
-
positions(
|
|
8674
|
-
where: {
|
|
8675
|
-
account_id: {_in: $who}
|
|
8676
|
-
curve_id: {_eq: $curveId}
|
|
8677
|
-
shares: {_gt: "0"}
|
|
8678
|
-
term: {triple: {predicate_id: {_eq: $pid}}}
|
|
8679
|
-
}
|
|
8680
|
-
limit: $limit
|
|
8681
|
-
offset: $offset
|
|
8682
|
-
order_by: {id: asc}
|
|
8683
|
-
) {
|
|
8684
|
-
shares
|
|
8685
|
-
term {
|
|
8686
|
-
triple {
|
|
8687
|
-
term_id
|
|
8688
|
-
subject { term_id data label }
|
|
8689
|
-
object { term_id data label }
|
|
8690
|
-
}
|
|
8691
|
-
}
|
|
8692
|
-
}
|
|
8693
|
-
}`;
|
|
8694
|
-
var ALL_HIERARCHY_QUERY = `query($pid: String!, $limit: Int!, $offset: Int!) {
|
|
8695
|
-
triples(where: {predicate_id: {_eq: $pid}}, limit: $limit, offset: $offset, order_by: {term_id: asc}) {
|
|
8696
|
-
term_id
|
|
8697
|
-
subject { term_id data label }
|
|
8698
|
-
object { term_id data label }
|
|
8699
|
-
term { vaults { curve_id position_count total_shares } }
|
|
8700
|
-
}
|
|
8701
|
-
}`;
|
|
8702
|
-
var TAGGED_QUERY = `query($pid: String!, $domains: [String!], $limit: Int!, $offset: Int!, $who: [String!]!) {
|
|
8703
|
-
triples(
|
|
8704
|
-
where: {predicate_id: {_eq: $pid}, object: {data: {_in: $domains}}}
|
|
8705
|
-
limit: $limit
|
|
8706
|
-
offset: $offset
|
|
8707
|
-
order_by: {term_id: asc}
|
|
8708
|
-
) {
|
|
8709
|
-
term_id
|
|
8710
|
-
subject { term_id label value { thing { url name } } }
|
|
8711
|
-
object { data }
|
|
8712
|
-
term {
|
|
8713
|
-
vaults {
|
|
8714
|
-
curve_id
|
|
8715
|
-
position_count
|
|
8716
|
-
total_shares
|
|
8717
|
-
positions(where: {account_id: {_in: $who}, shares: {_gt: "0"}}) { shares }
|
|
8718
|
-
}
|
|
8719
|
-
}
|
|
8720
|
-
}
|
|
8721
|
-
}`;
|
|
8722
|
-
// ../../packages/graphql/dist/queries/registered-tools.js
|
|
8723
|
-
var REGISTERED_TOOLS_QUERY = `
|
|
8724
|
-
query RegisteredTools($description: String!, $uses: String!, $sameAs: String!, $curveId: numeric!, $limit: Int!, $offset: Int!) {
|
|
8725
|
-
atoms(
|
|
8726
|
-
where: {value: {thing: {description: {_eq: $description}}}}
|
|
8727
|
-
limit: $limit
|
|
8728
|
-
offset: $offset
|
|
8729
|
-
order_by: {term_id: asc}
|
|
8730
|
-
) {
|
|
8731
|
-
term_id
|
|
8732
|
-
label
|
|
8733
|
-
data
|
|
8734
|
-
value { thing { url } }
|
|
8735
|
-
term {
|
|
8736
|
-
vaults(where: {curve_id: {_eq: $curveId}}, limit: 1) { position_count total_assets }
|
|
8737
|
-
}
|
|
8738
|
-
as_object_triples_aggregate(
|
|
8739
|
-
where: {
|
|
8740
|
-
predicate_id: {_eq: $uses}
|
|
8741
|
-
subject: {as_subject_triples: {predicate_id: {_eq: $sameAs}}}
|
|
8742
|
-
}
|
|
8743
|
-
) { aggregate { count } }
|
|
8744
|
-
}
|
|
8745
|
-
}`;
|
|
8746
|
-
// ../../packages/graphql/dist/queries/tool-atom.js
|
|
8747
|
-
var BY_URL_QUERY = `
|
|
8748
|
-
query ToolAtomByUrl($url: String!) {
|
|
8749
|
-
atoms(where: {value: {thing: {url: {_eq: $url}}}}, limit: 10) {
|
|
8750
|
-
term_id
|
|
8751
|
-
label
|
|
8752
|
-
type
|
|
8753
|
-
data
|
|
8754
|
-
}
|
|
8755
|
-
}`;
|
|
8756
|
-
// ../../packages/graphql/dist/queries/tool-listing.js
|
|
8757
|
-
function toolListingQuery(sponsored) {
|
|
8758
|
-
const variables = sponsored ? "$uses: String!, $sameAs: String!, $curveId: numeric!, $limit: Int!, $sponsor: String!" : "$uses: String!, $sameAs: String!, $curveId: numeric!, $limit: Int!";
|
|
8759
|
-
const sponsoredCount = sponsored ? `
|
|
8760
|
-
sponsored: deposits_aggregate(where: {sender_id: {_ilike: $sponsor}, receiver_id: {_nilike: $sponsor}}) { aggregate { count } }` : "";
|
|
8761
|
-
return `
|
|
8762
|
-
query ToolListing(${variables}) {
|
|
8763
|
-
triples(
|
|
8764
|
-
where: {
|
|
8765
|
-
predicate_id: {_eq: $uses}
|
|
8766
|
-
subject: {as_subject_triples: {predicate_id: {_eq: $sameAs}}}
|
|
8767
|
-
}
|
|
8768
|
-
limit: $limit
|
|
8769
|
-
) {
|
|
8770
|
-
term_id
|
|
8771
|
-
subject_id
|
|
8772
|
-
object {
|
|
8773
|
-
term_id
|
|
8774
|
-
label
|
|
8775
|
-
data
|
|
8776
|
-
type
|
|
8777
|
-
value { thing { url } }
|
|
8778
|
-
}
|
|
8779
|
-
term {
|
|
8780
|
-
total_assets
|
|
8781
|
-
vaults(where: {curve_id: {_eq: $curveId}}, limit: 1) { position_count total_assets }
|
|
8782
|
-
deposits: deposits_aggregate { aggregate { count } }${sponsoredCount}
|
|
8783
|
-
}
|
|
8784
|
-
counter_term {
|
|
8785
|
-
total_assets
|
|
8786
|
-
vaults(where: {curve_id: {_eq: $curveId}}, limit: 1) { position_count total_assets }
|
|
8787
|
-
}
|
|
8788
|
-
}
|
|
8789
|
-
}`;
|
|
8790
|
-
}
|
|
8791
|
-
var TOOL_LISTING_QUERY = toolListingQuery(false);
|
|
8792
|
-
var TOOL_LISTING_SPONSORED_QUERY = toolListingQuery(true);
|
|
8793
|
-
var SPONSORED_WALLETS_QUERY = `
|
|
8794
|
-
query SponsoredWallets($uses: String!, $sponsor: String!, $limit: Int!) {
|
|
8795
|
-
deposits(
|
|
8796
|
-
where: {sender_id: {_eq: $sponsor}, receiver_id: {_neq: $sponsor}, term: {triple: {predicate_id: {_eq: $uses}}}}
|
|
8797
|
-
distinct_on: [term_id, receiver_id]
|
|
8798
|
-
limit: $limit
|
|
8799
|
-
) { term_id receiver_id }
|
|
8800
|
-
}`;
|
|
8801
|
-
// ../../packages/graphql/dist/queries/pulse-usage.js
|
|
8802
|
-
var PULSE_USES_QUERY = `query PulseUses($tools: [String!]!, $uses: String!, $limit: Int!) {
|
|
8803
|
-
triples(where: {object_id: {_in: $tools}, predicate_id: {_eq: $uses}}, limit: $limit) {
|
|
8804
|
-
term_id
|
|
8805
|
-
object_id
|
|
8806
|
-
creator_id
|
|
8807
|
-
created_at
|
|
8808
|
-
subject {
|
|
8809
|
-
term_id
|
|
8810
|
-
label
|
|
8811
|
-
}
|
|
8812
|
-
positions(where: {shares: {_gt: "0"}}) {
|
|
8813
|
-
account_id
|
|
8814
|
-
}
|
|
8815
|
-
}
|
|
8816
|
-
}`;
|
|
8817
|
-
var PULSE_QUALIFIERS_QUERY = `query PulseQualifiers($edges: [String!]!, $predicates: [String!]!, $writers: [String!]!, $limit: Int!) {
|
|
8818
|
-
triples(where: {subject_id: {_in: $edges}, predicate_id: {_in: $predicates}}, limit: $limit) {
|
|
8819
|
-
term_id
|
|
8820
|
-
subject_id
|
|
8821
|
-
predicate_id
|
|
8822
|
-
creator_id
|
|
8823
|
-
created_at
|
|
8824
|
-
object {
|
|
8825
|
-
label
|
|
8826
|
-
}
|
|
8827
|
-
positions(where: {shares: {_gt: "0"}, account_id: {_in: $writers}}) {
|
|
8828
|
-
account_id
|
|
8829
|
-
}
|
|
8830
|
-
}
|
|
8831
|
-
}`;
|
|
8832
|
-
var PULSE_ATOMS_QUERY = `query PulseAtoms($uris: [String!]!, $limit: Int!) {
|
|
8833
|
-
atoms(where: {data: {_in: $uris}}, limit: $limit) {
|
|
8834
|
-
term_id
|
|
8835
|
-
data
|
|
8836
|
-
}
|
|
8837
|
-
}`;
|
|
8838
|
-
var PULSE_DOMAIN_EDGES_QUERY = `query PulseDomainEdges($domains: [String!]!, $predicate: String!, $limit: Int!) {
|
|
8839
|
-
triples(where: {predicate_id: {_eq: $predicate}, object: {label: {_in: $domains}}}, order_by: {created_at: desc}, limit: $limit) {
|
|
8840
|
-
subject_id
|
|
8841
|
-
}
|
|
8842
|
-
}`;
|
|
8843
|
-
var PULSE_EDGE_TOOLS_QUERY = `query PulseEdgeTools($edges: [String!]!, $uses: String!, $limit: Int!) {
|
|
8844
|
-
triples(where: {term_id: {_in: $edges}, predicate_id: {_eq: $uses}}, limit: $limit) {
|
|
8845
|
-
object {
|
|
8846
|
-
term_id
|
|
8847
|
-
label
|
|
8848
|
-
data
|
|
8849
|
-
}
|
|
8850
|
-
}
|
|
8851
|
-
}`;
|
|
8852
|
-
var AGENT_IDENTITIES_QUERY = `query AgentIdentities($atoms: [String!]!, $sameAs: String!, $limit: Int!) {
|
|
8853
|
-
triples(where: {subject_id: {_in: $atoms}, predicate_id: {_eq: $sameAs}}, limit: $limit) {
|
|
8854
|
-
subject_id
|
|
8855
|
-
subject {
|
|
8856
|
-
data
|
|
8857
|
-
}
|
|
8858
|
-
object {
|
|
8859
|
-
label
|
|
8860
|
-
value {
|
|
8861
|
-
thing {
|
|
8862
|
-
name
|
|
8863
|
-
}
|
|
8864
|
-
}
|
|
8865
|
-
}
|
|
8866
|
-
}
|
|
8867
|
-
}`;
|
|
8868
|
-
var ATTACHED_DOCUMENTS_QUERY = `query AttachedDocuments($term: String!, $inContextOf: String!, $creators: [String!]!, $limit: Int!) {
|
|
8869
|
-
others: triples_aggregate(where: {predicate_id: {_eq: $inContextOf}, object_id: {_eq: $term}, creator_id: {_nin: $creators}}) {
|
|
8870
|
-
aggregate {
|
|
8871
|
-
count
|
|
8872
|
-
}
|
|
8873
|
-
}
|
|
8874
|
-
triples(where: {predicate_id: {_eq: $inContextOf}, object_id: {_eq: $term}, creator_id: {_in: $creators}}, order_by: {created_at: asc}, limit: $limit) {
|
|
8875
|
-
creator_id
|
|
8876
|
-
subject {
|
|
8877
|
-
data
|
|
8878
|
-
value {
|
|
8879
|
-
json_object {
|
|
8880
|
-
data
|
|
8881
|
-
}
|
|
8882
|
-
}
|
|
8883
|
-
}
|
|
8884
|
-
}
|
|
8885
|
-
}`;
|
|
8886
|
-
var IDENTITY_CLAIMS_QUERY = `query IdentityClaims($caip19: String!, $sameAs: String!, $limit: Int!) {
|
|
8887
|
-
triples(where: {predicate_id: {_eq: $sameAs}, object: {label: {_eq: $caip19}}}, limit: $limit) {
|
|
8888
|
-
creator_id
|
|
8889
|
-
subject {
|
|
8890
|
-
term_id
|
|
8891
|
-
data
|
|
8892
|
-
}
|
|
8893
|
-
}
|
|
8894
|
-
}`;
|
|
8895
|
-
var PULSE_EDGE_WRITERS_QUERY = `query PulseEdgeWriters($edges: [String!]!, $limit: Int!) {
|
|
8896
|
-
triples(where: {term_id: {_in: $edges}}, limit: $limit) {
|
|
8897
|
-
term_id
|
|
8898
|
-
creator_id
|
|
8899
|
-
}
|
|
8900
|
-
}`;
|
|
8901
|
-
var ENDPOINT_SUBJECTS_QUERY = `query EndpointSubjects($hasEndpoint: String!, $limit: Int!) {
|
|
8902
|
-
triples(where: {predicate_id: {_eq: $hasEndpoint}}, order_by: {created_at: desc}, limit: $limit) {
|
|
8903
|
-
subject_id
|
|
8904
|
-
subject {
|
|
8905
|
-
label
|
|
8906
|
-
}
|
|
8907
|
-
}
|
|
8908
|
-
}`;
|
|
8909
|
-
// ../../packages/graphql/dist/queries/tool-usage.js
|
|
8910
|
-
var VAULT_SIDE2 = `
|
|
8911
|
-
total_market_cap
|
|
8912
|
-
total_assets
|
|
8913
|
-
vaults(where: {curve_id: {_eq: $curveId}}, limit: 1) {
|
|
8914
|
-
market_cap
|
|
8915
|
-
total_assets
|
|
8916
|
-
total_shares
|
|
8917
|
-
current_share_price
|
|
8918
|
-
position_count
|
|
8919
|
-
}`;
|
|
8920
|
-
var TOOL_USAGE_QUERY = `
|
|
8921
|
-
query ToolUsage($toolId: String!, $uses: String!, $curveId: numeric!) {
|
|
8922
|
-
tool: atoms(where: {term_id: {_eq: $toolId}}, limit: 1) {
|
|
8923
|
-
term_id
|
|
8924
|
-
label
|
|
8925
|
-
data
|
|
8926
|
-
}
|
|
8927
|
-
triples(where: {predicate_id: {_eq: $uses}, object_id: {_eq: $toolId}}, limit: 200) {
|
|
8928
|
-
term_id
|
|
8929
|
-
subject {
|
|
8930
|
-
term_id
|
|
8931
|
-
label
|
|
8932
|
-
type
|
|
8933
|
-
}
|
|
8934
|
-
term { ${VAULT_SIDE2} }
|
|
8935
|
-
counter_term { ${VAULT_SIDE2} }
|
|
8936
|
-
}
|
|
8937
|
-
}`;
|
|
8938
|
-
var ATTESTED_TOOL_USAGE_QUERY = `
|
|
8939
|
-
query AttestedToolUsage($toolId: String!, $uses: String!, $curveId: numeric!, $attestor: String!) {
|
|
8940
|
-
tool: atoms(where: {term_id: {_eq: $toolId}}, limit: 1) {
|
|
8941
|
-
term_id
|
|
8942
|
-
label
|
|
8943
|
-
data
|
|
8944
|
-
}
|
|
8945
|
-
triples(where: {
|
|
8946
|
-
predicate_id: {_eq: $uses},
|
|
8947
|
-
object_id: {_eq: $toolId},
|
|
8948
|
-
term: {positions: {account_id: {_eq: $attestor}}}
|
|
8949
|
-
}, limit: 200) {
|
|
8950
|
-
term_id
|
|
8951
|
-
subject {
|
|
8952
|
-
term_id
|
|
8953
|
-
label
|
|
8954
|
-
type
|
|
8955
|
-
}
|
|
8956
|
-
term { ${VAULT_SIDE2} }
|
|
8957
|
-
counter_term { ${VAULT_SIDE2} }
|
|
8958
|
-
}
|
|
8959
|
-
}`;
|
|
8960
|
-
// ../../packages/graphql/dist/queries/x402-feed.js
|
|
8961
|
-
var LEVEL = `term_id
|
|
8962
|
-
subject_id
|
|
8963
|
-
predicate_id
|
|
8964
|
-
creator_id
|
|
8965
|
-
created_at
|
|
8966
|
-
subject {
|
|
8967
|
-
term_id
|
|
8968
|
-
label
|
|
8969
|
-
}
|
|
8970
|
-
object {
|
|
8971
|
-
term_id
|
|
8972
|
-
label
|
|
8973
|
-
data
|
|
8974
|
-
value {
|
|
8975
|
-
thing {
|
|
8976
|
-
url
|
|
8977
|
-
}
|
|
8978
|
-
}
|
|
8979
|
-
}
|
|
8980
|
-
positions(where: {shares: {_gt: "0"}}) {
|
|
8981
|
-
account_id
|
|
8982
|
-
}`;
|
|
8983
|
-
var X402_PAYMENT_LEVELS_QUERY = `query X402PaymentLevels($paidWith: String!, $limit: Int!, $offset: Int!) {
|
|
8984
|
-
triples(where: {predicate_id: {_eq: $paidWith}}, order_by: {term_id: asc}, limit: $limit, offset: $offset) {
|
|
8985
|
-
${LEVEL}
|
|
8986
|
-
}
|
|
8987
|
-
}`;
|
|
8988
|
-
var X402_LEVELS_BY_ID_QUERY = `query X402LevelsById($ids: [String!]!, $limit: Int!) {
|
|
8989
|
-
triples(where: {term_id: {_in: $ids}}, limit: $limit) {
|
|
8990
|
-
${LEVEL}
|
|
8991
|
-
}
|
|
8992
|
-
}`;
|
|
8993
|
-
var X402_REASONS_QUERY = `query X402Reasons($ids: [String!]!, $because: String!, $limit: Int!) {
|
|
8994
|
-
triples(where: {subject_id: {_in: $ids}, predicate_id: {_eq: $because}}, order_by: {term_id: asc}, limit: $limit) {
|
|
8995
|
-
${LEVEL}
|
|
8996
|
-
}
|
|
8997
|
-
}`;
|
|
8998
|
-
// ../../packages/protocol/dist/declare/tool-atom.js
|
|
8999
|
-
function intuitionToolAtomLookup(config) {
|
|
9000
|
-
const transport = config.transport ?? createGraphqlTransport({
|
|
9001
|
-
url: config.graphqlUrl,
|
|
9002
|
-
fetch: config.fetch ?? defaultFetch(),
|
|
9003
|
-
...config.timeoutMs === undefined ? {} : { timeoutMs: config.timeoutMs }
|
|
9004
|
-
});
|
|
9005
|
-
return {
|
|
9006
|
-
async findByUrl(url) {
|
|
9007
|
-
const data = await transport.request(BY_URL_QUERY, { url });
|
|
9008
|
-
const rows = Array.isArray(data["atoms"]) ? data["atoms"] : [];
|
|
9009
|
-
const candidates = [];
|
|
9010
|
-
for (const row of rows) {
|
|
9011
|
-
if (!isRecord(row))
|
|
9012
|
-
continue;
|
|
9013
|
-
const termId = readString(row, "term_id");
|
|
9014
|
-
if (termId === null)
|
|
9015
|
-
continue;
|
|
9016
|
-
candidates.push({
|
|
9017
|
-
termId,
|
|
9018
|
-
label: readString(row, "label"),
|
|
9019
|
-
uri: readString(row, "data")
|
|
9020
|
-
});
|
|
9021
|
-
}
|
|
9022
|
-
return candidates;
|
|
9023
|
-
}
|
|
9024
|
-
};
|
|
9025
|
-
}
|
|
9026
|
-
function derivesItsOwnAtom(uri) {
|
|
9027
|
-
return /^(ipfs|ar):\/\//i.test(uri.trim());
|
|
9028
|
-
}
|
|
9029
|
-
|
|
9030
|
-
// ../../packages/protocol/dist/declare/thing-cid.js
|
|
9031
|
-
function thingDocument(thing) {
|
|
9032
|
-
return JSON.stringify({
|
|
9033
|
-
"@context": "https://schema.org",
|
|
9034
|
-
"@type": "Thing",
|
|
9035
|
-
description: thing.description,
|
|
9036
|
-
image: thing.image,
|
|
9037
|
-
name: thing.name,
|
|
9038
|
-
url: thing.url
|
|
9039
|
-
});
|
|
9040
|
-
}
|
|
9041
|
-
function base32(bytes) {
|
|
9042
|
-
const alphabet = "abcdefghijklmnopqrstuvwxyz234567";
|
|
9043
|
-
let bits = 0;
|
|
9044
|
-
let value = 0;
|
|
9045
|
-
let out = "";
|
|
9046
|
-
for (const byte of bytes) {
|
|
9047
|
-
value = value << 8 | byte;
|
|
9048
|
-
bits += 8;
|
|
9049
|
-
while (bits >= 5) {
|
|
9050
|
-
out += alphabet[value >>> bits - 5 & 31];
|
|
9051
|
-
bits -= 5;
|
|
9052
|
-
}
|
|
9053
|
-
}
|
|
9054
|
-
if (bits > 0)
|
|
9055
|
-
out += alphabet[value << 5 - bits & 31];
|
|
9056
|
-
return out;
|
|
9057
|
-
}
|
|
9058
|
-
function thingUriOfDigest(digest) {
|
|
9059
|
-
const cid = new Uint8Array(4 + digest.length);
|
|
9060
|
-
cid.set([1, 85, 18, 32]);
|
|
9061
|
-
cid.set(digest, 4);
|
|
9062
|
-
return `ipfs://b${base32(cid)}`;
|
|
9063
|
-
}
|
|
9064
|
-
|
|
9065
|
-
// ../../packages/protocol/dist/declare/agent-atom.js
|
|
9066
|
-
function canonicalAgentThing(chainId, tokenId, registration) {
|
|
9067
|
-
const normalize = (value) => {
|
|
9068
|
-
if (typeof value !== "string")
|
|
9069
|
-
return null;
|
|
9070
|
-
const trimmed = value.trim();
|
|
9071
|
-
return trimmed.length > 0 ? trimmed : null;
|
|
9072
|
-
};
|
|
9073
|
-
const agentKey = `${chainId}:${tokenId}`;
|
|
9074
|
-
return {
|
|
9075
|
-
name: normalize(registration?.name) ?? `Agent ${agentKey}`,
|
|
9076
|
-
description: normalize(registration?.description) ?? `ERC-8004 agent ${agentKey}`,
|
|
9077
|
-
image: normalize(registration?.image) ?? "",
|
|
9078
|
-
url: normalize(registration?.webEndpoint) ?? `https://8004scan.io/agents/${chainId}/${tokenId}`
|
|
9079
|
-
};
|
|
9080
|
-
}
|
|
9081
|
-
function thingUri(thing) {
|
|
9082
|
-
return thingUriOfDigest(toBytes(sha256(toBytes(thingDocument(thing)))));
|
|
9083
|
-
}
|
|
9084
|
-
|
|
9085
|
-
// ../../packages/protocol/dist/declare/tool-thing.js
|
|
9086
|
-
class InvalidToolUrlError extends Error {
|
|
9087
|
-
input;
|
|
9088
|
-
constructor(input, why) {
|
|
9089
|
-
super(`${JSON.stringify(input)} is not a usable tool URL: ${why}`);
|
|
9090
|
-
this.name = "InvalidToolUrlError";
|
|
9091
|
-
this.input = input;
|
|
9092
|
-
}
|
|
9093
|
-
}
|
|
9094
|
-
var TOOL_THING_DESCRIPTION = "A tool identified by its URL, so every declaration of its use lands on one atom.";
|
|
9095
|
-
function normaliseToolUrl(input) {
|
|
9096
|
-
const trimmed = input.trim();
|
|
9097
|
-
if (trimmed.length === 0)
|
|
9098
|
-
throw new InvalidToolUrlError(input, "empty");
|
|
9099
|
-
const withScheme = /^[a-z][a-z0-9+.-]*:/i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
9100
|
-
let url;
|
|
9101
|
-
try {
|
|
9102
|
-
url = new URL(withScheme);
|
|
9103
|
-
} catch {
|
|
9104
|
-
throw new InvalidToolUrlError(input, "not parseable as a URL");
|
|
9105
|
-
}
|
|
9106
|
-
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
9107
|
-
throw new InvalidToolUrlError(input, `scheme ${url.protocol} is not http or https`);
|
|
9108
|
-
}
|
|
9109
|
-
if (url.hostname.length === 0)
|
|
9110
|
-
throw new InvalidToolUrlError(input, "no host");
|
|
9111
|
-
const host = url.hostname.replace(/\.+$/, "").replace(/^(?:www\.)+/, "");
|
|
9112
|
-
const path = url.pathname.replace(/(?:\.git|\/)+$/, "");
|
|
9113
|
-
const params = [...new URLSearchParams(url.search).entries()].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
|
|
9114
|
-
const query = params.length === 0 ? "" : `?${new URLSearchParams(params).toString()}`;
|
|
9115
|
-
const port = url.port === "" || url.port === "80" || url.port === "443" ? "" : `:${url.port}`;
|
|
9116
|
-
return `https://${host}${port}${path}${query}`;
|
|
9117
|
-
}
|
|
9118
|
-
function toolThing(url) {
|
|
9119
|
-
const normalised = normaliseToolUrl(url);
|
|
9120
|
-
return {
|
|
9121
|
-
name: normalised.slice("https://".length),
|
|
9122
|
-
description: TOOL_THING_DESCRIPTION,
|
|
9123
|
-
image: "",
|
|
9124
|
-
url: normalised
|
|
9125
|
-
};
|
|
9126
|
-
}
|
|
9127
|
-
function toolAtomUri(url) {
|
|
9128
|
-
return thingUri(toolThing(url));
|
|
9129
|
-
}
|
|
9130
|
-
function toolThingDocument(url) {
|
|
9131
|
-
return thingDocument(toolThing(url));
|
|
9132
|
-
}
|
|
9133
|
-
function isToolUrl(uri) {
|
|
9134
|
-
try {
|
|
9135
|
-
normaliseToolUrl(uri);
|
|
9136
|
-
return true;
|
|
9137
|
-
} catch {
|
|
9138
|
-
return false;
|
|
9139
|
-
}
|
|
9140
|
-
}
|
|
9141
|
-
|
|
9142
|
-
// ../../packages/protocol/dist/declare/plan.js
|
|
9143
|
-
class EmptyPlanError extends Error {
|
|
9144
|
-
constructor(what) {
|
|
9145
|
-
super(`nothing to plan: ${what}`);
|
|
9146
|
-
this.name = "EmptyPlanError";
|
|
9147
|
-
}
|
|
9148
|
-
}
|
|
9149
|
-
|
|
9150
|
-
class NonPositiveAmountError extends Error {
|
|
9151
|
-
tripleId;
|
|
9152
|
-
constructor(tripleId, amount) {
|
|
9153
|
-
super(`a deposit of ${amount} on ${tripleId} would put nothing behind the claim; ` + `an edge with no stake carries no weight at all (docs/14)`);
|
|
9154
|
-
this.name = "NonPositiveAmountError";
|
|
9155
|
-
this.tripleId = tripleId;
|
|
9156
|
-
}
|
|
9157
|
-
}
|
|
9158
|
-
|
|
9159
|
-
class AmbiguousToolAtomError extends Error {
|
|
9160
|
-
uri;
|
|
9161
|
-
candidates;
|
|
9162
|
-
constructor(uri, candidates) {
|
|
9163
|
-
super(`${candidates.length} atoms already claim ${uri} — ` + candidates.map((c) => `${c.termId} (${c.label ?? "no label"})`).join(", ") + `. Refusing to choose: a \`uses\` edge on the wrong one is permanent. ` + `Pass the \`ipfs://\` URI of the atom you mean.`);
|
|
9164
|
-
this.name = "AmbiguousToolAtomError";
|
|
9165
|
-
this.uri = uri;
|
|
9166
|
-
this.candidates = candidates;
|
|
9167
|
-
}
|
|
9168
|
-
}
|
|
9169
|
-
|
|
9170
|
-
class BelowMinDepositError extends Error {
|
|
9171
|
-
tripleId;
|
|
9172
|
-
constructor(tripleId, amount, minDeposit) {
|
|
9173
|
-
super(`a deposit of ${amount} wei on ${tripleId} is below the protocol's minimum of ` + `${minDeposit} wei on this chain. The floor is chain state and differs 10× between ` + `mainnet and testnet, so an amount that works on one may not on the other.`);
|
|
9174
|
-
this.name = "BelowMinDepositError";
|
|
9175
|
-
this.tripleId = tripleId;
|
|
8608
|
+
}
|
|
8609
|
+
|
|
8610
|
+
class BelowMinDepositError extends Error {
|
|
8611
|
+
tripleId;
|
|
8612
|
+
constructor(tripleId, amount, minDeposit) {
|
|
8613
|
+
super(`a deposit of ${amount} wei on ${tripleId} is below the protocol's minimum of ` + `${minDeposit} wei on this chain. The floor is chain state and differs 10× between ` + `mainnet and testnet, so an amount that works on one may not on the other.`);
|
|
8614
|
+
this.name = "BelowMinDepositError";
|
|
8615
|
+
this.tripleId = tripleId;
|
|
9176
8616
|
}
|
|
9177
8617
|
}
|
|
9178
8618
|
|
|
@@ -9211,6 +8651,7 @@ async function resolveToolAtom(uri, reads, lookup) {
|
|
|
9211
8651
|
});
|
|
9212
8652
|
}
|
|
9213
8653
|
const normalised = normaliseToolUrl(uri);
|
|
8654
|
+
assertPublishableToolUrl(normalised);
|
|
9214
8655
|
if (lookup !== undefined) {
|
|
9215
8656
|
const candidates = await findExistingToolAtoms(lookup, uri, normalised);
|
|
9216
8657
|
if (candidates.length > 1)
|
|
@@ -9834,50 +9275,6 @@ async function resolveIdentityAtomStrict(params) {
|
|
|
9834
9275
|
throw error;
|
|
9835
9276
|
}
|
|
9836
9277
|
}
|
|
9837
|
-
// ../../packages/protocol/dist/arp/x402-networks.js
|
|
9838
|
-
var X402_DEFAULT_NETWORKS = new Map([
|
|
9839
|
-
[
|
|
9840
|
-
"eip155:8453",
|
|
9841
|
-
{ assets: [getAddress("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")], rpcUrl: "https://mainnet.base.org" }
|
|
9842
|
-
]
|
|
9843
|
-
]);
|
|
9844
|
-
|
|
9845
|
-
// ../../packages/protocol/dist/arp/chains.js
|
|
9846
|
-
var intuitionTestnet = defineChain2({
|
|
9847
|
-
id: 13579,
|
|
9848
|
-
name: "Intuition Testnet",
|
|
9849
|
-
nativeCurrency: { decimals: 18, name: "Test Trust", symbol: "tTRUST" },
|
|
9850
|
-
rpcUrls: {
|
|
9851
|
-
default: { http: ["https://testnet.rpc.intuition.systems/http"] }
|
|
9852
|
-
},
|
|
9853
|
-
blockExplorers: {
|
|
9854
|
-
default: {
|
|
9855
|
-
name: "Intuition Testnet Explorer",
|
|
9856
|
-
url: "https://testnet.explorer.intuition.systems"
|
|
9857
|
-
}
|
|
9858
|
-
},
|
|
9859
|
-
testnet: true
|
|
9860
|
-
});
|
|
9861
|
-
var intuitionMainnet = defineChain2({
|
|
9862
|
-
id: 1155,
|
|
9863
|
-
name: "Intuition",
|
|
9864
|
-
nativeCurrency: { decimals: 18, name: "Intuition", symbol: "TRUST" },
|
|
9865
|
-
rpcUrls: {
|
|
9866
|
-
default: { http: ["https://rpc.intuition.systems/http"] }
|
|
9867
|
-
},
|
|
9868
|
-
blockExplorers: {
|
|
9869
|
-
default: {
|
|
9870
|
-
name: "Intuition Explorer",
|
|
9871
|
-
url: "https://explorer.intuition.systems"
|
|
9872
|
-
}
|
|
9873
|
-
}
|
|
9874
|
-
});
|
|
9875
|
-
// ../../packages/protocol/dist/arp/attestors.js
|
|
9876
|
-
var ARP_DOMAIN_ATTESTORS = [
|
|
9877
|
-
"0x906f3A52ec089f8D4E9127F91C6bE5Ae0d18f91f",
|
|
9878
|
-
"0xE596096F4176b682E300d73963e7B04B383C1AA1",
|
|
9879
|
-
"0x77939A4c276f3E549276CEB3A09CDa1fF58b7ec9"
|
|
9880
|
-
];
|
|
9881
9278
|
// ../../packages/protocol/dist/x402-payment.js
|
|
9882
9279
|
var PAID_WITH_LABEL = "paid with";
|
|
9883
9280
|
var TRANSFER_TOPIC = keccak256(stringToBytes("Transfer(address,address,uint256)"));
|
|
@@ -9965,6 +9362,56 @@ function x402Reading(networks, env) {
|
|
|
9965
9362
|
};
|
|
9966
9363
|
}
|
|
9967
9364
|
|
|
9365
|
+
// ../../packages/protocol/dist/arp/x402-networks.js
|
|
9366
|
+
var X402_DEFAULT_NETWORKS = new Map([
|
|
9367
|
+
[
|
|
9368
|
+
"eip155:8453",
|
|
9369
|
+
{ assets: [getAddress("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")], rpcUrl: "https://mainnet.base.org" }
|
|
9370
|
+
]
|
|
9371
|
+
]);
|
|
9372
|
+
var X402_TEST_NETWORKS = new Map([
|
|
9373
|
+
[
|
|
9374
|
+
"eip155:84532",
|
|
9375
|
+
{ assets: [getAddress("0x036CbD53842c5426634e7929541eC2318f3dCF7e")], rpcUrl: "https://sepolia.base.org" }
|
|
9376
|
+
]
|
|
9377
|
+
]);
|
|
9378
|
+
|
|
9379
|
+
// ../../packages/protocol/dist/arp/chains.js
|
|
9380
|
+
var intuitionTestnet = defineChain2({
|
|
9381
|
+
id: 13579,
|
|
9382
|
+
name: "Intuition Testnet",
|
|
9383
|
+
nativeCurrency: { decimals: 18, name: "Test Trust", symbol: "tTRUST" },
|
|
9384
|
+
rpcUrls: {
|
|
9385
|
+
default: { http: ["https://testnet.rpc.intuition.systems/http"] }
|
|
9386
|
+
},
|
|
9387
|
+
blockExplorers: {
|
|
9388
|
+
default: {
|
|
9389
|
+
name: "Intuition Testnet Explorer",
|
|
9390
|
+
url: "https://testnet.explorer.intuition.systems"
|
|
9391
|
+
}
|
|
9392
|
+
},
|
|
9393
|
+
testnet: true
|
|
9394
|
+
});
|
|
9395
|
+
var intuitionMainnet = defineChain2({
|
|
9396
|
+
id: 1155,
|
|
9397
|
+
name: "Intuition",
|
|
9398
|
+
nativeCurrency: { decimals: 18, name: "Intuition", symbol: "TRUST" },
|
|
9399
|
+
rpcUrls: {
|
|
9400
|
+
default: { http: ["https://rpc.intuition.systems/http"] }
|
|
9401
|
+
},
|
|
9402
|
+
blockExplorers: {
|
|
9403
|
+
default: {
|
|
9404
|
+
name: "Intuition Explorer",
|
|
9405
|
+
url: "https://explorer.intuition.systems"
|
|
9406
|
+
}
|
|
9407
|
+
}
|
|
9408
|
+
});
|
|
9409
|
+
// ../../packages/protocol/dist/arp/attestors.js
|
|
9410
|
+
var ARP_DOMAIN_ATTESTORS = [
|
|
9411
|
+
"0x906f3A52ec089f8D4E9127F91C6bE5Ae0d18f91f",
|
|
9412
|
+
"0xE596096F4176b682E300d73963e7B04B383C1AA1",
|
|
9413
|
+
"0x77939A4c276f3E549276CEB3A09CDa1fF58b7ec9"
|
|
9414
|
+
];
|
|
9968
9415
|
// ../../packages/protocol/dist/tool-listing.js
|
|
9969
9416
|
var INTUITION_MAX_PAGE = 250;
|
|
9970
9417
|
var DEFAULT_EDGE_LIMIT = INTUITION_MAX_PAGE;
|
|
@@ -12654,9 +12101,45 @@ var COMMON = new Set(("awk bash break bun case cat cd chmod command continue cp
|
|
|
12654
12101
|
var INSTALL = /\b(?:npm\s+(?:i|install)\s+(?:-g|--global)|pnpm\s+add\s+-g|yarn\s+global\s+add|brew\s+install|pipx\s+install|pip3?\s+install|cargo\s+install)\s+([@a-z0-9][@\w./-]*)/i;
|
|
12655
12102
|
var PROBE = /\b(?:command\s+-v|which)\s+([a-z][\w-]*)/i;
|
|
12656
12103
|
var COMMAND = /^[a-z][a-z0-9_-]*$/;
|
|
12104
|
+
function shellSegments(line) {
|
|
12105
|
+
const segments = [];
|
|
12106
|
+
let current = "";
|
|
12107
|
+
let quote = null;
|
|
12108
|
+
for (let index2 = 0;index2 < line.length; index2 += 1) {
|
|
12109
|
+
const char = line[index2] ?? "";
|
|
12110
|
+
if (char === "\\" && quote !== "'") {
|
|
12111
|
+
current += char + (line[index2 + 1] ?? "");
|
|
12112
|
+
index2 += 1;
|
|
12113
|
+
continue;
|
|
12114
|
+
}
|
|
12115
|
+
if (quote !== null) {
|
|
12116
|
+
if (char === quote)
|
|
12117
|
+
quote = null;
|
|
12118
|
+
current += char;
|
|
12119
|
+
continue;
|
|
12120
|
+
}
|
|
12121
|
+
if (char === '"' || char === "'") {
|
|
12122
|
+
quote = char;
|
|
12123
|
+
current += char;
|
|
12124
|
+
continue;
|
|
12125
|
+
}
|
|
12126
|
+
if (char === "#" && (index2 === 0 || /\s/.test(line[index2 - 1] ?? "")))
|
|
12127
|
+
break;
|
|
12128
|
+
if (char === "|" || char === ";" || char === "&" && line[index2 + 1] === "&") {
|
|
12129
|
+
segments.push(current);
|
|
12130
|
+
current = "";
|
|
12131
|
+
if (line[index2 + 1] === char)
|
|
12132
|
+
index2 += 1;
|
|
12133
|
+
continue;
|
|
12134
|
+
}
|
|
12135
|
+
current += char;
|
|
12136
|
+
}
|
|
12137
|
+
segments.push(current);
|
|
12138
|
+
return segments;
|
|
12139
|
+
}
|
|
12657
12140
|
function commandsIn(shell, explicitOnly) {
|
|
12658
12141
|
const found = [];
|
|
12659
|
-
for (const segment of shell
|
|
12142
|
+
for (const segment of shellSegments(shell)) {
|
|
12660
12143
|
const line = segment.trim().replace(/^\$\s+/, "");
|
|
12661
12144
|
if (line === "" || line.startsWith("#"))
|
|
12662
12145
|
continue;
|
|
@@ -12691,7 +12174,7 @@ function shellLinesRun(lines) {
|
|
|
12691
12174
|
run.push(line);
|
|
12692
12175
|
continued = line.trimEnd().endsWith("\\");
|
|
12693
12176
|
heredocEnd = /<<-?\s*['"]?([A-Za-z_]+)/.exec(line)?.[1] ?? null;
|
|
12694
|
-
for (const char of line) {
|
|
12177
|
+
for (const char of quote === null ? shellSegments(line).join(";") : line) {
|
|
12695
12178
|
if (quote === null && (char === '"' || char === "'"))
|
|
12696
12179
|
quote = char;
|
|
12697
12180
|
else if (char === quote)
|
|
@@ -12744,6 +12227,223 @@ function readRequires(markdown) {
|
|
|
12744
12227
|
return { cli, runs, login: null, description };
|
|
12745
12228
|
}
|
|
12746
12229
|
|
|
12230
|
+
// ../../packages/protocol/dist/skill-needs.js
|
|
12231
|
+
var MARKDOWN = /\.(md|mdx|markdown)$/i;
|
|
12232
|
+
var SCRIPT = /\.(sh|bash|zsh|py|js|mjs|cjs|ts|rb|pl|ps1|php|lua)$/i;
|
|
12233
|
+
var COMMENT_LINE = /^\s*(?:#|\/\/|\*|--|;|rem\s)/i;
|
|
12234
|
+
function isTestFile(path) {
|
|
12235
|
+
return /(^|\/)(tests?|__tests__|spec|fixtures?)\/|\.(test|spec)\.[a-z]+$|(^|\/)test_[^/]+\.py$|_test\.(py|go|rb)$/i.test(path);
|
|
12236
|
+
}
|
|
12237
|
+
function isSecretName(name) {
|
|
12238
|
+
return /(^|_)(API_?KEY|KEY|TOKEN|SECRET|PASSWORD|PASSWD|PASS|CREDENTIALS|CREDS)$/.test(name);
|
|
12239
|
+
}
|
|
12240
|
+
var SET_IN_SKILL_MD = /(?:^|\s|`)(?:export\s+|set\s+|\$env:)?([A-Z][A-Z0-9_]{2,})=/g;
|
|
12241
|
+
function lineAt(text, index2) {
|
|
12242
|
+
let line = 1;
|
|
12243
|
+
for (let at = text.indexOf(`
|
|
12244
|
+
`);at !== -1 && at < index2; at = text.indexOf(`
|
|
12245
|
+
`, at + 1))
|
|
12246
|
+
line += 1;
|
|
12247
|
+
return line;
|
|
12248
|
+
}
|
|
12249
|
+
function keysIn(files, settings) {
|
|
12250
|
+
const skillMd = files.find((file) => file.path === "SKILL.md");
|
|
12251
|
+
const toSet = new Set;
|
|
12252
|
+
if (skillMd !== undefined)
|
|
12253
|
+
for (const match of skillMd.text.matchAll(SET_IN_SKILL_MD))
|
|
12254
|
+
toSet.add(match[1] ?? "");
|
|
12255
|
+
const wanted = new Set(settings.filter((name) => isSecretName(name) || toSet.has(name)));
|
|
12256
|
+
const ordered = [
|
|
12257
|
+
...skillMd === undefined ? [] : [skillMd],
|
|
12258
|
+
...files.filter((file) => file.path !== "SKILL.md" && !isTestFile(file.path))
|
|
12259
|
+
];
|
|
12260
|
+
const found = new Map;
|
|
12261
|
+
for (const file of ordered) {
|
|
12262
|
+
for (const [index2, line] of file.text.split(`
|
|
12263
|
+
`).entries()) {
|
|
12264
|
+
for (const match of line.matchAll(/\b[A-Z][A-Z0-9_]{2,}\b/g)) {
|
|
12265
|
+
const name = match[0];
|
|
12266
|
+
if (!wanted.has(name) || found.has(name))
|
|
12267
|
+
continue;
|
|
12268
|
+
found.set(name, { name, why: isSecretName(name) ? "secret" : "set in SKILL.md", file: file.path, line: index2 + 1 });
|
|
12269
|
+
}
|
|
12270
|
+
}
|
|
12271
|
+
}
|
|
12272
|
+
return [...found.values()].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
12273
|
+
}
|
|
12274
|
+
var EVERYWHERE = new Set("sh bash zsh dash env cat ls echo printf mkdir rm cp mv ln grep sed awk tr cut head tail sort uniq wc find xargs test true false base64 date sleep chmod touch tee kill ps uname which open xdg-open cmd powershell pwsh taskkill taskkill.exe where where.exe".split(" "));
|
|
12275
|
+
var ALIASES = {
|
|
12276
|
+
soffice: "LibreOffice",
|
|
12277
|
+
libreoffice: "LibreOffice",
|
|
12278
|
+
"google-chrome": "Chrome",
|
|
12279
|
+
chromium: "Chrome",
|
|
12280
|
+
"chromium-browser": "Chrome",
|
|
12281
|
+
magick: "ImageMagick",
|
|
12282
|
+
convert: "ImageMagick",
|
|
12283
|
+
pdftoppm: "poppler",
|
|
12284
|
+
pdftotext: "poppler",
|
|
12285
|
+
python: "python3",
|
|
12286
|
+
docker: "Docker"
|
|
12287
|
+
};
|
|
12288
|
+
var SPAWNS = [
|
|
12289
|
+
/\b(?:execFileSync|execFile|spawnSync|spawn|execaSync|execa)\(\s*["'`]([a-z][\w.+-]*)["'`]/g,
|
|
12290
|
+
/\b(?:execSync|exec)\(\s*["'`]([a-z][\w.+-]*)[\s"'`]/g,
|
|
12291
|
+
/\bBun\.spawn(?:Sync)?\(\s*\[\s*["'`]([a-z][\w.+-]*)["'`]/g,
|
|
12292
|
+
/\bnew\s+Deno\.Command\(\s*["'`]([a-z][\w.+-]*)["'`]/g,
|
|
12293
|
+
/\bsubprocess\.(?:run|call|check_call|check_output|Popen)\(\s*\[\s*["']([a-z][\w.+-]*)["']/g,
|
|
12294
|
+
/\bsubprocess\.(?:run|call|check_call|check_output|Popen)\(\s*["']([a-z][\w.+-]*)[\s"']/g,
|
|
12295
|
+
/\bos\.(?:system|popen)\(\s*["']([a-z][\w.+-]*)[\s"']/g
|
|
12296
|
+
];
|
|
12297
|
+
var DRIVES = {
|
|
12298
|
+
puppeteer: "Chrome",
|
|
12299
|
+
"puppeteer-core": "Chrome",
|
|
12300
|
+
"chrome-launcher": "Chrome",
|
|
12301
|
+
"chrome-remote-interface": "Chrome",
|
|
12302
|
+
pyppeteer: "Chrome",
|
|
12303
|
+
playwright: "a Playwright browser",
|
|
12304
|
+
"playwright-core": "a Playwright browser",
|
|
12305
|
+
"@playwright/test": "a Playwright browser",
|
|
12306
|
+
"selenium-webdriver": "a browser and its driver",
|
|
12307
|
+
selenium: "a browser and its driver",
|
|
12308
|
+
"fluent-ffmpeg": "ffmpeg",
|
|
12309
|
+
"ffmpeg-python": "ffmpeg",
|
|
12310
|
+
ffmpeg: "ffmpeg",
|
|
12311
|
+
pydub: "ffmpeg",
|
|
12312
|
+
moviepy: "ffmpeg",
|
|
12313
|
+
"openai-whisper": "ffmpeg",
|
|
12314
|
+
whisper: "ffmpeg",
|
|
12315
|
+
pytesseract: "tesseract",
|
|
12316
|
+
"node-tesseract-ocr": "tesseract",
|
|
12317
|
+
pdf2image: "poppler",
|
|
12318
|
+
"pdf-poppler": "poppler",
|
|
12319
|
+
wand: "ImageMagick",
|
|
12320
|
+
gm: "ImageMagick",
|
|
12321
|
+
pypandoc: "pandoc",
|
|
12322
|
+
"node-pandoc": "pandoc",
|
|
12323
|
+
docker: "Docker",
|
|
12324
|
+
dockerode: "Docker"
|
|
12325
|
+
};
|
|
12326
|
+
var IMPORTS = [
|
|
12327
|
+
/\bfrom\s+["']([@\w./-]+)["']/g,
|
|
12328
|
+
/\bimport\s*\(\s*["']([@\w./-]+)["']\s*\)/g,
|
|
12329
|
+
/\bimport\s+["']([@\w./-]+)["']/g,
|
|
12330
|
+
/\brequire\(\s*["']([@\w./-]+)["']\s*\)/g,
|
|
12331
|
+
/^\s*(?:from\s+([\w.]+)\s+import|import\s+([\w.]+))/gm
|
|
12332
|
+
];
|
|
12333
|
+
function packageRoot(specifier) {
|
|
12334
|
+
if (specifier.startsWith("@"))
|
|
12335
|
+
return specifier.split("/").slice(0, 2).join("/");
|
|
12336
|
+
return specifier.split("/")[0]?.split(".")[0] ?? specifier;
|
|
12337
|
+
}
|
|
12338
|
+
var NAMED_PROGRAMS = [
|
|
12339
|
+
{ name: "ffmpeg", pattern: /\bffmpeg\b/i },
|
|
12340
|
+
{ name: "ffprobe", pattern: /\bffprobe\b/i },
|
|
12341
|
+
{ name: "Chrome", pattern: /\b(?:Google Chrome|Chrome|Chromium|chrome-headless-shell|google-chrome|chromium-browser)\b/ },
|
|
12342
|
+
{ name: "Docker", pattern: /\b[Dd]ocker\b/ },
|
|
12343
|
+
{ name: "git", pattern: /\bgit\b(?!\s*(?:hub|lab))/ },
|
|
12344
|
+
{ name: "jq", pattern: /\bjq\b/ },
|
|
12345
|
+
{ name: "pandoc", pattern: /\bpandoc\b/i },
|
|
12346
|
+
{ name: "ImageMagick", pattern: /\b(?:ImageMagick|imagemagick|magick)\b/ },
|
|
12347
|
+
{ name: "yt-dlp", pattern: /\byt-dlp\b/ },
|
|
12348
|
+
{ name: "tesseract", pattern: /\btesseract\b/i },
|
|
12349
|
+
{ name: "poppler", pattern: /\b(?:poppler|pdftoppm|pdftotext)\b/i },
|
|
12350
|
+
{ name: "LibreOffice", pattern: /\b(?:LibreOffice|libreoffice|soffice)\b/ },
|
|
12351
|
+
{ name: "sox", pattern: /\bsox\b/ },
|
|
12352
|
+
{ name: "exiftool", pattern: /\bexiftool\b/i },
|
|
12353
|
+
{ name: "ollama", pattern: /\b[Oo]llama\b/ },
|
|
12354
|
+
{ name: "gh", pattern: /\bgh\s+(?:CLI|cli)\b|\bGitHub CLI\b/ },
|
|
12355
|
+
{ name: "python3", pattern: /\b[Pp]ython\s?3?\b(?![-.\w])/ },
|
|
12356
|
+
{ name: "node", pattern: /\b(?:Node\.js|node)\b(?![-.\w])/ },
|
|
12357
|
+
{ name: "Java", pattern: /\b(?:Java|JDK|JRE)\b/ }
|
|
12358
|
+
];
|
|
12359
|
+
var NEEDED = /\b(?:requires?|required|requirements?|needs?|needed|prerequisites?|depends on|must (?:be )?install(?:ed)?|must have|install(?:ed)? first|has to be installed|be installed)\b/i;
|
|
12360
|
+
var NEEDED_GLOBAL = new RegExp(NEEDED.source, "gi");
|
|
12361
|
+
var NOT_NEEDED = /\b(?:no|not|never|without|doesn't|don't|isn't|aren't|zero)\b[^.;]{0,30}\b(?:requires?|required|needs?|needed|install)/i;
|
|
12362
|
+
var NOT_AFTER = /\b(?:requires?|needs?)\s+(?:no|nothing|neither)\b/i;
|
|
12363
|
+
function saysWhatItNeeds(path, isScript) {
|
|
12364
|
+
if (isScript)
|
|
12365
|
+
return true;
|
|
12366
|
+
if (!MARKDOWN.test(path))
|
|
12367
|
+
return false;
|
|
12368
|
+
const base2 = path.slice(path.lastIndexOf("/") + 1).toLowerCase();
|
|
12369
|
+
return base2 === "skill.md" || /^(readme|requirements?|prerequisites?|setup|install(ation)?|dependencies|getting-started)\b/.test(base2);
|
|
12370
|
+
}
|
|
12371
|
+
var COMMENT_OR_STRING = /^\s*(?:#|\/\/|\*|\/\*|"""|''')|["'`][^"'`]*\b(?:requires?|needs?|install)/i;
|
|
12372
|
+
function namedAfterVerb(line, program) {
|
|
12373
|
+
for (const verb of line.matchAll(NEEDED_GLOBAL)) {
|
|
12374
|
+
const at = verb.index;
|
|
12375
|
+
const after = line.slice(at + verb[0].length).slice(0, 40).split(/[.;:!?](?:\s|$)/)[0] ?? "";
|
|
12376
|
+
const before = line.slice(Math.max(0, at - 30), at).split(/[.;:!?](?:\s|$)/).at(-1) ?? "";
|
|
12377
|
+
if (program.test(after) || program.test(before))
|
|
12378
|
+
return true;
|
|
12379
|
+
}
|
|
12380
|
+
return false;
|
|
12381
|
+
}
|
|
12382
|
+
function programsNeededIn(files) {
|
|
12383
|
+
const out = new Map;
|
|
12384
|
+
const add = (program) => {
|
|
12385
|
+
if (!out.has(program.name))
|
|
12386
|
+
out.set(program.name, program);
|
|
12387
|
+
};
|
|
12388
|
+
for (const file of files) {
|
|
12389
|
+
if (isTestFile(file.path))
|
|
12390
|
+
continue;
|
|
12391
|
+
const lines = file.text.split(`
|
|
12392
|
+
`);
|
|
12393
|
+
const isScript = SCRIPT.test(file.path) || lines[0]?.startsWith("#!") === true;
|
|
12394
|
+
if (isScript && !/\.(sh|bash|zsh)$/i.test(file.path)) {
|
|
12395
|
+
for (const pattern of SPAWNS) {
|
|
12396
|
+
for (const match of file.text.matchAll(pattern)) {
|
|
12397
|
+
const name = match[1] ?? "";
|
|
12398
|
+
const line = lineAt(file.text, match.index);
|
|
12399
|
+
if (name === "" || EVERYWHERE.has(name) || COMMENT_LINE.test(lines[line - 1] ?? ""))
|
|
12400
|
+
continue;
|
|
12401
|
+
add({ name: ALIASES[name] ?? name, from: "spawned", file: file.path, line });
|
|
12402
|
+
}
|
|
12403
|
+
}
|
|
12404
|
+
for (const pattern of IMPORTS) {
|
|
12405
|
+
for (const match of file.text.matchAll(pattern)) {
|
|
12406
|
+
const root2 = packageRoot(match[1] ?? match[2] ?? "");
|
|
12407
|
+
const driven = DRIVES[root2];
|
|
12408
|
+
const line = lineAt(file.text, match.index);
|
|
12409
|
+
if (driven === undefined || COMMENT_LINE.test(lines[line - 1] ?? ""))
|
|
12410
|
+
continue;
|
|
12411
|
+
add({ name: driven, from: "package", file: file.path, line, via: root2 });
|
|
12412
|
+
}
|
|
12413
|
+
}
|
|
12414
|
+
}
|
|
12415
|
+
if (/(^|\/)package\.json$/.test(file.path)) {
|
|
12416
|
+
for (const [index2, line] of lines.entries()) {
|
|
12417
|
+
const name = /^\s*"(@?[\w./-]+)"\s*:\s*"/.exec(line)?.[1];
|
|
12418
|
+
const driven = name === undefined ? undefined : DRIVES[name];
|
|
12419
|
+
if (driven !== undefined)
|
|
12420
|
+
add({ name: driven, from: "package", file: file.path, line: index2 + 1, via: name ?? "" });
|
|
12421
|
+
}
|
|
12422
|
+
}
|
|
12423
|
+
if (/(^|\/)requirements[\w.-]*\.txt$/i.test(file.path)) {
|
|
12424
|
+
for (const [index2, line] of lines.entries()) {
|
|
12425
|
+
const name = /^\s*([A-Za-z0-9][\w.-]*)/.exec(line.replace(/#.*/, ""))?.[1]?.toLowerCase();
|
|
12426
|
+
const driven = name === undefined ? undefined : DRIVES[name];
|
|
12427
|
+
if (driven !== undefined)
|
|
12428
|
+
add({ name: driven, from: "package", file: file.path, line: index2 + 1, via: name ?? "" });
|
|
12429
|
+
}
|
|
12430
|
+
}
|
|
12431
|
+
if (saysWhatItNeeds(file.path, isScript)) {
|
|
12432
|
+
for (const [index2, line] of lines.entries()) {
|
|
12433
|
+
if (NOT_NEEDED.test(line) || NOT_AFTER.test(line))
|
|
12434
|
+
continue;
|
|
12435
|
+
if (isScript && !COMMENT_OR_STRING.test(line))
|
|
12436
|
+
continue;
|
|
12437
|
+
for (const { name, pattern } of NAMED_PROGRAMS) {
|
|
12438
|
+
if (namedAfterVerb(line, pattern))
|
|
12439
|
+
add({ name, from: "named as needed", file: file.path, line: index2 + 1 });
|
|
12440
|
+
}
|
|
12441
|
+
}
|
|
12442
|
+
}
|
|
12443
|
+
}
|
|
12444
|
+
return [...out.values()];
|
|
12445
|
+
}
|
|
12446
|
+
|
|
12747
12447
|
// ../../packages/protocol/dist/skill-contents.js
|
|
12748
12448
|
var CONTENTS_LIMITS = {
|
|
12749
12449
|
files: 200,
|
|
@@ -12751,8 +12451,8 @@ var CONTENTS_LIMITS = {
|
|
|
12751
12451
|
items: 40,
|
|
12752
12452
|
lineChars: 160
|
|
12753
12453
|
};
|
|
12754
|
-
var
|
|
12755
|
-
var
|
|
12454
|
+
var SCRIPT2 = /\.(sh|bash|zsh|py|js|mjs|cjs|ts|rb|pl|ps1|php|lua)$/i;
|
|
12455
|
+
var MARKDOWN2 = /\.(md|mdx|markdown)$/i;
|
|
12756
12456
|
var FENCE = /^\s*(?:```|~~~)/;
|
|
12757
12457
|
function contentsFileOf(path, bytes) {
|
|
12758
12458
|
if (bytes.subarray(0, 8192).includes(0))
|
|
@@ -12777,10 +12477,10 @@ function interpreterOf(firstLine) {
|
|
|
12777
12477
|
}
|
|
12778
12478
|
var SCRIPT_PROBE = /(?:^|[;&|(!{]|\bif|\bthen|\$\()\s*(?:!\s*)?(?:command\s+-v|which|type\s+-p|hash)\s+([a-z][\w.+-]*)/g;
|
|
12779
12479
|
var SYSTEM_INSTALL = /\b(?:brew|apt-get|apt|dnf|yum|apk|pacman|choco|winget|scoop|port)\s+(?:install|add|-S)\s+(?:-\S+\s+)*([a-z][\w.+-]*)/g;
|
|
12780
|
-
var
|
|
12480
|
+
var COMMENT_LINE2 = /^\s*(?:#|\/\/|\*|--|;|rem\s)/i;
|
|
12781
12481
|
var PYTHON_PROBE = /\bshutil\.which\(\s*["']([a-z][\w.+-]*)["']/g;
|
|
12782
12482
|
function programsInScriptLine(line, shell) {
|
|
12783
|
-
if (
|
|
12483
|
+
if (COMMENT_LINE2.test(line))
|
|
12784
12484
|
return [];
|
|
12785
12485
|
const matches = shell ? [...line.matchAll(SCRIPT_PROBE), ...line.matchAll(SYSTEM_INSTALL)] : [...line.matchAll(PYTHON_PROBE)];
|
|
12786
12486
|
return matches.map((match) => match[1] ?? "").filter((name) => name !== "");
|
|
@@ -12844,7 +12544,7 @@ function settingsIn(path, text, code) {
|
|
|
12844
12544
|
for (const match of text.matchAll(pattern))
|
|
12845
12545
|
found.add((match[1] ?? "").toUpperCase());
|
|
12846
12546
|
}
|
|
12847
|
-
if (
|
|
12547
|
+
if (MARKDOWN2.test(path)) {
|
|
12848
12548
|
for (const match of text.matchAll(EXPORT_IN_PROSE))
|
|
12849
12549
|
found.add(match[1] ?? "");
|
|
12850
12550
|
for (const match of text.matchAll(KEY_NAMED))
|
|
@@ -12860,7 +12560,7 @@ function codeOf(path, text, isScript) {
|
|
|
12860
12560
|
`);
|
|
12861
12561
|
if (isScript)
|
|
12862
12562
|
return lines;
|
|
12863
|
-
if (!
|
|
12563
|
+
if (!MARKDOWN2.test(path))
|
|
12864
12564
|
return [];
|
|
12865
12565
|
const out = [];
|
|
12866
12566
|
let fenced = false;
|
|
@@ -13033,7 +12733,7 @@ function readSkillContents(input) {
|
|
|
13033
12733
|
if (files.length >= CONTENTS_LIMITS.files)
|
|
13034
12734
|
skipped.push({ path: file.path, why: "over the file limit" });
|
|
13035
12735
|
else if (file.text === null)
|
|
13036
|
-
skipped.push({ path: file.path, why: file.notFetched === true ? "not fetched" : "binary" });
|
|
12736
|
+
skipped.push({ path: file.path, why: file.tooLarge === true ? "too large" : file.notFetched === true ? "not fetched" : "binary" });
|
|
13037
12737
|
else if (file.text.length > CONTENTS_LIMITS.fileChars)
|
|
13038
12738
|
skipped.push({ path: file.path, why: "too large" });
|
|
13039
12739
|
else
|
|
@@ -13044,7 +12744,7 @@ function readSkillContents(input) {
|
|
|
13044
12744
|
const programs = new Map;
|
|
13045
12745
|
const add = (name, from14) => {
|
|
13046
12746
|
if (!programs.has(name))
|
|
13047
|
-
programs.set(name, from14);
|
|
12747
|
+
programs.set(name, { name, from: from14 });
|
|
13048
12748
|
};
|
|
13049
12749
|
const requires = readRequires(skillMd);
|
|
13050
12750
|
for (const name of requires.cli)
|
|
@@ -13056,11 +12756,11 @@ function readSkillContents(input) {
|
|
|
13056
12756
|
const domains = new Set;
|
|
13057
12757
|
const fetchAndRun = [];
|
|
13058
12758
|
const hidden = [];
|
|
13059
|
-
const scripts = skipped.filter((file) => file.why === "not fetched" &&
|
|
12759
|
+
const scripts = skipped.filter((file) => file.why === "not fetched" && SCRIPT2.test(file.path)).map((file) => ({ path: file.path, namedInSkillMd: namesFile(skillMd, file.path) }));
|
|
13060
12760
|
for (const file of files) {
|
|
13061
12761
|
const lines = file.text.split(`
|
|
13062
12762
|
`);
|
|
13063
|
-
const isScript =
|
|
12763
|
+
const isScript = SCRIPT2.test(file.path) || lines[0]?.startsWith("#!") === true;
|
|
13064
12764
|
const code = codeOf(file.path, file.text, isScript);
|
|
13065
12765
|
const shell = isShell(file.path, file.text);
|
|
13066
12766
|
for (const line of code) {
|
|
@@ -13093,18 +12793,22 @@ function readSkillContents(input) {
|
|
|
13093
12793
|
if (run !== undefined)
|
|
13094
12794
|
fetchAndRun.push({ kind: run.kind, file: file.path, line: index2 + 1, text: cap(line) });
|
|
13095
12795
|
}
|
|
13096
|
-
if (
|
|
12796
|
+
if (MARKDOWN2.test(file.path))
|
|
13097
12797
|
hidden.push(...hiddenInMarkdown(file.path, file.text));
|
|
13098
12798
|
}
|
|
13099
12799
|
const packageNames = new Set([...packages.values()].map((pkg) => pkg.name));
|
|
13100
|
-
for (const [name,
|
|
13101
|
-
if (
|
|
12800
|
+
for (const [name, program] of programs)
|
|
12801
|
+
if (program.from !== "declared" && packageNames.has(name))
|
|
13102
12802
|
programs.delete(name);
|
|
12803
|
+
for (const needed of programsNeededIn(files))
|
|
12804
|
+
if (!programs.has(needed.name))
|
|
12805
|
+
programs.set(needed.name, needed);
|
|
13103
12806
|
const cut = [];
|
|
13104
12807
|
return {
|
|
13105
|
-
programs: bounded("programs", [...programs.
|
|
12808
|
+
programs: bounded("programs", [...programs.values()].sort((a, b) => compare(a.name, b.name)), cut),
|
|
13106
12809
|
packages: bounded("packages", [...packages.values()].sort((a, b) => compare(`${a.manager} ${a.name}`, `${b.manager} ${b.name}`)), cut),
|
|
13107
12810
|
settings: bounded("settings", [...settings].sort(compare), cut),
|
|
12811
|
+
keys: bounded("keys", keysIn(files, [...settings]), cut),
|
|
13108
12812
|
scripts: bounded("scripts", scripts.sort((a, b) => compare(a.path, b.path)), cut),
|
|
13109
12813
|
fetchAndRun: bounded("fetchAndRun", fetchAndRun, cut),
|
|
13110
12814
|
domains: bounded("domains", [...domains].sort(compare), cut),
|
|
@@ -13117,24 +12821,12 @@ function readSkillContents(input) {
|
|
|
13117
12821
|
cut
|
|
13118
12822
|
};
|
|
13119
12823
|
}
|
|
13120
|
-
function contentsLines(contents, perList = 6) {
|
|
13121
|
-
const list = (items, cut) => items.length === 0 ? "none found" : `${items.slice(0, perList).join(", ")}${items.length > perList || cut ? `, and ${Math.max(0, items.length - perList)}${cut ? "+" : ""} more` : ""}`;
|
|
13122
|
-
const at = (rows, name) => list(rows.map((row) => `${row.kind} at ${row.file}:${row.line} "${row.text}"`), contents.cut.includes(name));
|
|
13123
|
-
return [
|
|
13124
|
-
`Programs: ${list(contents.programs.map((p) => `${p.name} (${p.from})`), contents.cut.includes("programs"))}`,
|
|
13125
|
-
...contents.packages.length === 0 ? [] : [`Packages: ${list(contents.packages.map((p) => `${p.manager} ${p.name}`), contents.cut.includes("packages"))}`],
|
|
13126
|
-
`Keys and settings it reads: ${list(contents.settings, contents.cut.includes("settings"))}`,
|
|
13127
|
-
`Scripts: ${list(contents.scripts.map((s) => s.namedInSkillMd ? `${s.path} (named in SKILL.md)` : s.path), contents.cut.includes("scripts"))}`,
|
|
13128
|
-
`Fetches and runs code: ${at(contents.fetchAndRun, "fetchAndRun")}`,
|
|
13129
|
-
`Domains named: ${list(contents.domains, contents.cut.includes("domains"))}`,
|
|
13130
|
-
`Hidden or encoded text: ${at(contents.hidden, "hidden")}`,
|
|
13131
|
-
...contents.read.skipped.length === 0 ? [] : [`Not read: ${list(contents.read.skipped.map((s) => `${s.path} (${s.why})`), false)}`]
|
|
13132
|
-
];
|
|
13133
|
-
}
|
|
13134
12824
|
|
|
13135
12825
|
// ../../packages/protocol/dist/pulse.js
|
|
13136
12826
|
var MAX_SKILL_FILES_READ = 200;
|
|
13137
12827
|
var MAX_SCRIPTS_READ = 5;
|
|
12828
|
+
var MAX_DIRECTORY_FILES_READ = 80;
|
|
12829
|
+
var NOT_TEXT = /\.(png|jpe?g|gif|webp|ico|bmp|tiff?|avif|svgz|pdf|zip|gz|tgz|bz2|xz|7z|rar|jar|woff2?|ttf|otf|eot|mp[34]|m4a|wav|ogg|flac|aac|mov|webm|avi|mkv|pptx|docx|xlsx|psd|ai|sketch|fig|db|sqlite|bin|exe|dll|so|dylib|wasm|pyc|class|hdr|exr|glb|ktx2?)$/i;
|
|
13138
12830
|
var GITHUB_READ_TIMEOUT_MS = 1e4;
|
|
13139
12831
|
var INSTALLER_ORDER = [
|
|
13140
12832
|
"",
|
|
@@ -13254,7 +12946,7 @@ var PAID_WORD = /\b(pricing|paid|subscription|credits?|billing|free tier|per min
|
|
|
13254
12946
|
var HOST = /https?:\/\/([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/g;
|
|
13255
12947
|
var NOT_A_SERVICE = /(^|\.)(github\.com|githubusercontent\.com|example\.(com|org|net))$/;
|
|
13256
12948
|
var LOOKS_LIKE_A_FILE = /\.(jpe?g|png|gif|webp|mp[34]|wav|mov|webm|pdf|md|json|txt)$/;
|
|
13257
|
-
var
|
|
12949
|
+
var SCRIPT3 = /\.(sh|bash|py|js|mjs|cjs|ts|rb|pl)$/i;
|
|
13258
12950
|
var RUNS_FILE = /\b(?:node|bun|deno|tsx|python3?|bash|sh)\s+((?:~|\.{1,2})?\/?[\w.@-]+(?:\/[\w.@-]+)*\.(?:mjs|cjs|js|ts|py|sh))\b/g;
|
|
13259
12951
|
var PLACEHOLDER = /(^|\/)(path|your|my|foo|example|script|file|input|output)(\/|\.|$)/i;
|
|
13260
12952
|
function filesItRuns(markdown, repositoryFiles) {
|
|
@@ -13284,7 +12976,7 @@ function readSkillFacts(markdown, filesInDirectory, repositoryFiles = filesInDir
|
|
|
13284
12976
|
return {
|
|
13285
12977
|
files: filesInDirectory.length,
|
|
13286
12978
|
bytes: filesInDirectory.reduce((total, file) => total + file.size, 0),
|
|
13287
|
-
scripts: filesInDirectory.filter((file) =>
|
|
12979
|
+
scripts: filesInDirectory.filter((file) => SCRIPT3.test(file.path)).length,
|
|
13288
12980
|
keys: [...new Set(markdown.match(KEY_NAME3) ?? [])],
|
|
13289
12981
|
paidWords: [...new Set((markdown.match(PAID_WORD) ?? []).map((word) => word.toLowerCase()))],
|
|
13290
12982
|
hosts: [...new Set(hosts)],
|
|
@@ -13298,6 +12990,14 @@ function parentOf(path) {
|
|
|
13298
12990
|
const at = path.lastIndexOf("/");
|
|
13299
12991
|
return at === -1 ? "" : path.slice(0, at);
|
|
13300
12992
|
}
|
|
12993
|
+
var MAX_NAME_READS = 12;
|
|
12994
|
+
var NAME_BATCH = 6;
|
|
12995
|
+
var wordsOf = (text) => text.toLowerCase().split(/[^a-z0-9]+/).filter((word) => word.length > 1);
|
|
12996
|
+
function byNearness(files, wanted) {
|
|
12997
|
+
const words = new Set(wordsOf(wanted));
|
|
12998
|
+
const shared = (file) => wordsOf(parentOf(file.path)).filter((word) => words.has(word)).length;
|
|
12999
|
+
return files.map((file) => ({ file, shared: shared(file) })).sort((a, b) => b.shared - a.shared || (a.file.path < b.file.path ? -1 : a.file.path > b.file.path ? 1 : 0));
|
|
13000
|
+
}
|
|
13301
13001
|
async function locate(source, repo, skill, listing) {
|
|
13302
13002
|
const wanted = normaliseName2(skill);
|
|
13303
13003
|
const candidates = listing.files.filter((file) => skillFilesIn([file]).length === 1);
|
|
@@ -13309,12 +13009,18 @@ async function locate(source, repo, skill, listing) {
|
|
|
13309
13009
|
if (others.length > MAX_SKILL_FILES_READ) {
|
|
13310
13010
|
return { status: "incomplete", reason: "too_many_skill_files" };
|
|
13311
13011
|
}
|
|
13312
|
-
|
|
13313
|
-
|
|
13012
|
+
const nearest = byNearness(others, wanted).slice(0, MAX_NAME_READS);
|
|
13013
|
+
const sharing = nearest.filter((entry) => entry.shared > 0).length;
|
|
13014
|
+
let readTo = 0;
|
|
13015
|
+
while (readTo < nearest.length && named.length === 0) {
|
|
13016
|
+
const size7 = readTo < sharing ? sharing - readTo : NAME_BATCH;
|
|
13017
|
+
named = await read(nearest.slice(readTo, readTo + size7).map((entry) => entry.file));
|
|
13018
|
+
readTo += size7;
|
|
13314
13019
|
}
|
|
13315
13020
|
if (named.length > 0) {
|
|
13316
|
-
|
|
13317
|
-
|
|
13021
|
+
named = [...named, ...await read(nearest.slice(readTo, sharing).map((entry) => entry.file))];
|
|
13022
|
+
} else if (nearest.length < others.length) {
|
|
13023
|
+
return { status: "incomplete", reason: "too_many_skill_files" };
|
|
13318
13024
|
}
|
|
13319
13025
|
}
|
|
13320
13026
|
if (named.length === 0) {
|
|
@@ -13354,7 +13060,24 @@ async function readFileOnly(result, source) {
|
|
|
13354
13060
|
}
|
|
13355
13061
|
return null;
|
|
13356
13062
|
}
|
|
13357
|
-
|
|
13063
|
+
var SCRIPT_READ_CAP = { files: MAX_SCRIPTS_READ, bytesEach: 256 * 1024, bytes: 512 * 1024 };
|
|
13064
|
+
var NOT_CODE_DIRECTORY = /(^|\/)(examples?|assets?|fonts?|images?|media|samples?|fixtures?)\//i;
|
|
13065
|
+
function withinReadCap(paths, listed) {
|
|
13066
|
+
const sizeOf = new Map(listed.map((file) => [file.path, file.size]));
|
|
13067
|
+
const kept = [];
|
|
13068
|
+
let bytes = 0;
|
|
13069
|
+
for (const path of paths) {
|
|
13070
|
+
const size7 = sizeOf.get(path) ?? 0;
|
|
13071
|
+
if (kept.length >= SCRIPT_READ_CAP.files || NOT_CODE_DIRECTORY.test(path))
|
|
13072
|
+
continue;
|
|
13073
|
+
if (size7 > SCRIPT_READ_CAP.bytesEach || bytes + size7 > SCRIPT_READ_CAP.bytes)
|
|
13074
|
+
continue;
|
|
13075
|
+
kept.push(path);
|
|
13076
|
+
bytes += size7;
|
|
13077
|
+
}
|
|
13078
|
+
return kept;
|
|
13079
|
+
}
|
|
13080
|
+
async function readPulse(result, source, depth) {
|
|
13358
13081
|
if (!/^(?!\.{1,2}\/)[\w.-]+\/(?!\.{1,2}$)[\w.-]+$/.test(result.source))
|
|
13359
13082
|
return { ...result, status: "not_github" };
|
|
13360
13083
|
const listing = await source.listing(result.source);
|
|
@@ -13372,15 +13095,20 @@ async function readPulse(result, source) {
|
|
|
13372
13095
|
const directory = parentOf(located.file.path);
|
|
13373
13096
|
const prefix = directory === "" ? "" : `${directory}/`;
|
|
13374
13097
|
const inDirectory = listing.files.filter((file) => file.path.startsWith(prefix));
|
|
13375
|
-
const scripts = filesItRuns(located.markdown, listing.files)
|
|
13098
|
+
const scripts = withinReadCap(filesItRuns(located.markdown, listing.files), listing.files);
|
|
13376
13099
|
const scriptTexts = await Promise.all(scripts.map(async (file) => ({ file, text: await source.file(result.source, file) })));
|
|
13377
13100
|
const keysInScriptsItRuns = scriptTexts.map(({ file, text }) => ({ file, keys: [...new Set(text?.match(KEY_NAME3) ?? [])] })).filter((entry) => entry.keys.length > 0);
|
|
13378
13101
|
const relative = (path) => path.startsWith(prefix) ? path.slice(prefix.length) : path;
|
|
13379
13102
|
const fetched = new Set(scriptTexts.filter((entry) => entry.text !== null).map((entry) => entry.file));
|
|
13103
|
+
const others = depth === undefined ? [] : await readDirectory(source, result.source, inDirectory, new Set([located.file.path, ...fetched]), depth.directory.by);
|
|
13104
|
+
for (const file of others)
|
|
13105
|
+
if (file.text !== null)
|
|
13106
|
+
fetched.add(file.path);
|
|
13380
13107
|
const contains = readSkillContents([
|
|
13381
13108
|
{ path: "SKILL.md", text: located.markdown },
|
|
13382
13109
|
...scriptTexts.flatMap(({ file, text }) => text === null ? [] : [{ path: relative(file), text }]),
|
|
13383
|
-
...
|
|
13110
|
+
...others.flatMap(({ path, text }) => text === null ? [] : [{ path: relative(path), text }]),
|
|
13111
|
+
...inDirectory.filter((file) => !fetched.has(file.path) && file.path !== located.file.path && (depth !== undefined || SCRIPT3.test(file.path))).map((file) => NOT_TEXT.test(file.path) ? { path: relative(file.path), text: null } : file.size > CONTENTS_LIMITS.fileChars ? { path: relative(file.path), text: null, notFetched: true, tooLarge: true } : { path: relative(file.path), text: null, notFetched: true })
|
|
13384
13112
|
]);
|
|
13385
13113
|
return {
|
|
13386
13114
|
...result,
|
|
@@ -13397,6 +13125,22 @@ async function readPulse(result, source) {
|
|
|
13397
13125
|
contains
|
|
13398
13126
|
};
|
|
13399
13127
|
}
|
|
13128
|
+
async function readDirectory(source, repo, inDirectory, done, by) {
|
|
13129
|
+
let late = false;
|
|
13130
|
+
by.then(() => {
|
|
13131
|
+
late = true;
|
|
13132
|
+
});
|
|
13133
|
+
const plan = inDirectory.filter((file) => !done.has(file.path) && !NOT_TEXT.test(file.path) && file.size <= CONTENTS_LIMITS.fileChars).slice(0, MAX_DIRECTORY_FILES_READ);
|
|
13134
|
+
const out = [];
|
|
13135
|
+
for (let at = 0;at < plan.length && !late; at += 8) {
|
|
13136
|
+
const batch = Promise.all(plan.slice(at, at + 8).map(async (file) => ({ path: file.path, text: await source.file(repo, file.path).catch(() => null) })));
|
|
13137
|
+
const settled = await Promise.race([batch, by.then(() => null)]);
|
|
13138
|
+
if (settled === null)
|
|
13139
|
+
break;
|
|
13140
|
+
out.push(...settled);
|
|
13141
|
+
}
|
|
13142
|
+
return out;
|
|
13143
|
+
}
|
|
13400
13144
|
function groupByContent(pulses) {
|
|
13401
13145
|
const groups = new Map;
|
|
13402
13146
|
for (const pulse of pulses) {
|
|
@@ -13420,6 +13164,7 @@ function githubPulseSource(options = {}) {
|
|
|
13420
13164
|
};
|
|
13421
13165
|
const listings = new Map;
|
|
13422
13166
|
const repositories = new Map;
|
|
13167
|
+
const fileReads = new Map;
|
|
13423
13168
|
const quota = { apiRequests: 0, limited: false, resetsAt: null };
|
|
13424
13169
|
const noteLimit = (response) => {
|
|
13425
13170
|
const hit = response.status === 429 || response.status === 403 && (response.headers.get("x-ratelimit-remaining") === "0" || response.headers.has("retry-after"));
|
|
@@ -13492,10 +13237,20 @@ function githubPulseSource(options = {}) {
|
|
|
13492
13237
|
return {
|
|
13493
13238
|
listing: (repo) => once2(listings, repo, readListing),
|
|
13494
13239
|
repository: (repo) => once2(repositories, repo, readRepository),
|
|
13495
|
-
file:
|
|
13496
|
-
const
|
|
13497
|
-
|
|
13498
|
-
|
|
13240
|
+
file: (repo, path) => {
|
|
13241
|
+
const key = `${repo}
|
|
13242
|
+
${path}`;
|
|
13243
|
+
const kept = options.files?.get(key);
|
|
13244
|
+
if (kept !== undefined)
|
|
13245
|
+
return Promise.resolve(kept);
|
|
13246
|
+
return once2(fileReads, key, async () => {
|
|
13247
|
+
const encoded = path.split("/").map(encodeURIComponent).join("/");
|
|
13248
|
+
const response = await get(`https://raw.githubusercontent.com/${repo}/HEAD/${encoded}`, { signal: bounded2() });
|
|
13249
|
+
const text = response.ok ? await response.text() : null;
|
|
13250
|
+
if (response.ok || response.status === 404)
|
|
13251
|
+
options.files?.set(key, text);
|
|
13252
|
+
return text;
|
|
13253
|
+
});
|
|
13499
13254
|
},
|
|
13500
13255
|
quota: () => ({ ...quota })
|
|
13501
13256
|
};
|
|
@@ -14749,6 +14504,171 @@ function renderSkillPrompt(review, installPath, maxLines = 3) {
|
|
|
14749
14504
|
confirmHelp: "Nothing is written unless you tick this and press Accept."
|
|
14750
14505
|
};
|
|
14751
14506
|
}
|
|
14507
|
+
// ../../packages/protocol/dist/before-install.js
|
|
14508
|
+
var PAID_SERVICES = [
|
|
14509
|
+
{ name: "Anthropic", hosts: ["api.anthropic.com"], keyPrefixes: ["ANTHROPIC_"] },
|
|
14510
|
+
{ name: "AssemblyAI", hosts: ["api.assemblyai.com"], keyPrefixes: ["ASSEMBLYAI_"] },
|
|
14511
|
+
{ name: "Azure OpenAI", hosts: ["openai.azure.com"], keyPrefixes: ["AZURE_OPENAI_"] },
|
|
14512
|
+
{ name: "Brave Search", hosts: ["api.search.brave.com"], keyPrefixes: ["BRAVE_"] },
|
|
14513
|
+
{ name: "Browserbase", hosts: ["api.browserbase.com"], keyPrefixes: ["BROWSERBASE_"] },
|
|
14514
|
+
{ name: "Cohere", hosts: ["api.cohere.ai", "api.cohere.com"], keyPrefixes: ["COHERE_", "CO_API_"] },
|
|
14515
|
+
{ name: "Deepgram", hosts: ["api.deepgram.com"], keyPrefixes: ["DEEPGRAM_"] },
|
|
14516
|
+
{ name: "DeepSeek", hosts: ["api.deepseek.com"], keyPrefixes: ["DEEPSEEK_"] },
|
|
14517
|
+
{ name: "ElevenLabs", hosts: ["api.elevenlabs.io"], keyPrefixes: ["ELEVENLABS_", "ELEVEN_"] },
|
|
14518
|
+
{ name: "Exa", hosts: ["api.exa.ai"], keyPrefixes: ["EXA_"] },
|
|
14519
|
+
{ name: "fal", hosts: ["fal.run", "queue.fal.run"], keyPrefixes: ["FAL_"] },
|
|
14520
|
+
{ name: "Firecrawl", hosts: ["api.firecrawl.dev"], keyPrefixes: ["FIRECRAWL_"] },
|
|
14521
|
+
{ name: "Fireworks AI", hosts: ["api.fireworks.ai"], keyPrefixes: ["FIREWORKS_"] },
|
|
14522
|
+
{ name: "Google Gemini", hosts: ["generativelanguage.googleapis.com"], keyPrefixes: ["GEMINI_"] },
|
|
14523
|
+
{ name: "Google Vertex AI", hosts: ["aiplatform.googleapis.com"], keyPrefixes: ["VERTEX_"] },
|
|
14524
|
+
{ name: "Groq", hosts: ["api.groq.com"], keyPrefixes: ["GROQ_"] },
|
|
14525
|
+
{ name: "HeyGen", hosts: ["api.heygen.com"], keyPrefixes: ["HEYGEN_"] },
|
|
14526
|
+
{ name: "Mistral", hosts: ["api.mistral.ai"], keyPrefixes: ["MISTRAL_"] },
|
|
14527
|
+
{ name: "OpenAI", hosts: ["api.openai.com"], keyPrefixes: ["OPENAI_"] },
|
|
14528
|
+
{ name: "OpenRouter", hosts: ["openrouter.ai"], keyPrefixes: ["OPENROUTER_"] },
|
|
14529
|
+
{ name: "Perplexity", hosts: ["api.perplexity.ai"], keyPrefixes: ["PERPLEXITY_", "PPLX_"] },
|
|
14530
|
+
{ name: "Replicate", hosts: ["api.replicate.com"], keyPrefixes: ["REPLICATE_"] },
|
|
14531
|
+
{ name: "Resend", hosts: ["api.resend.com"], keyPrefixes: ["RESEND_"] },
|
|
14532
|
+
{ name: "Runway", hosts: ["api.dev.runwayml.com", "api.runwayml.com"], keyPrefixes: ["RUNWAY_", "RUNWAYML_"] },
|
|
14533
|
+
{ name: "SerpApi", hosts: ["serpapi.com"], keyPrefixes: ["SERPAPI_", "SERP_API_"] },
|
|
14534
|
+
{ name: "Stability AI", hosts: ["api.stability.ai"], keyPrefixes: ["STABILITY_"] },
|
|
14535
|
+
{ name: "Tavily", hosts: ["api.tavily.com"], keyPrefixes: ["TAVILY_"] },
|
|
14536
|
+
{ name: "Together AI", hosts: ["api.together.xyz", "api.together.ai"], keyPrefixes: ["TOGETHER_"] },
|
|
14537
|
+
{ name: "Twilio", hosts: ["api.twilio.com"], keyPrefixes: ["TWILIO_"] },
|
|
14538
|
+
{ name: "xAI", hosts: ["api.x.ai"], keyPrefixes: ["XAI_"] }
|
|
14539
|
+
];
|
|
14540
|
+
var STATIC_HOSTS = [
|
|
14541
|
+
"fonts.googleapis.com",
|
|
14542
|
+
"gstatic.com",
|
|
14543
|
+
"cdn.jsdelivr.net",
|
|
14544
|
+
"unpkg.com",
|
|
14545
|
+
"cdnjs.cloudflare.com",
|
|
14546
|
+
"esm.sh",
|
|
14547
|
+
"cdn.skypack.dev",
|
|
14548
|
+
"ga.jspm.io",
|
|
14549
|
+
"githubusercontent.com",
|
|
14550
|
+
"cdn.tailwindcss.com",
|
|
14551
|
+
"code.jquery.com",
|
|
14552
|
+
"use.typekit.net",
|
|
14553
|
+
"fonts.bunny.net",
|
|
14554
|
+
"rsms.me",
|
|
14555
|
+
"cartocdn.com",
|
|
14556
|
+
"tile.openstreetmap.org",
|
|
14557
|
+
"server.arcgisonline.com",
|
|
14558
|
+
"images.unsplash.com"
|
|
14559
|
+
];
|
|
14560
|
+
var STATIC_SHAPE = /^(?:cdn|static|fonts?|tiles?|assets|img|images|media)\d*[.-]|(?:^|[.-])cdn(?:[.-]|$)|\.cdn\./;
|
|
14561
|
+
var API_SHAPE = /^api\d*[.-]|[.-]api\.|^.*\.googleapis\.com$/;
|
|
14562
|
+
function under(host, base2) {
|
|
14563
|
+
return host === base2 || host.endsWith(`.${base2}`);
|
|
14564
|
+
}
|
|
14565
|
+
var ASSET = /\.(woff2?|ttf|otf|eot|png|jpe?g|gif|webp|svgz?|ico|bmp|tiff?|avif|heic|hdr|exr|mp[34]|m4a|wav|ogg|flac|aac|mov|webm|avi|mkv|psd|ai|sketch|fig|glb|gltf|fbx|blend|ktx2?|basis|pdf|zip|gz|tgz)$|(^|\/)\.(gitkeep|keep|DS_Store)$/i;
|
|
14566
|
+
function beforeInstall(input) {
|
|
14567
|
+
const services = new Map;
|
|
14568
|
+
const service = (name) => {
|
|
14569
|
+
const found2 = services.get(name) ?? { name, hosts: [], keys: [] };
|
|
14570
|
+
services.set(name, found2);
|
|
14571
|
+
return found2;
|
|
14572
|
+
};
|
|
14573
|
+
const apiHosts = [];
|
|
14574
|
+
const staticHosts = [];
|
|
14575
|
+
const otherHosts = [];
|
|
14576
|
+
for (const host of input.domains) {
|
|
14577
|
+
const known = PAID_SERVICES.find((entry) => entry.hosts.some((base2) => under(host, base2)));
|
|
14578
|
+
if (known !== undefined) {
|
|
14579
|
+
service(known.name).hosts.push(host);
|
|
14580
|
+
apiHosts.push(host);
|
|
14581
|
+
} else if (STATIC_HOSTS.some((base2) => under(host, base2)) || STATIC_SHAPE.test(host))
|
|
14582
|
+
staticHosts.push(host);
|
|
14583
|
+
else if (API_SHAPE.test(host))
|
|
14584
|
+
apiHosts.push(host);
|
|
14585
|
+
else
|
|
14586
|
+
otherHosts.push(host);
|
|
14587
|
+
}
|
|
14588
|
+
for (const key of input.keys) {
|
|
14589
|
+
if (key.why !== "secret")
|
|
14590
|
+
continue;
|
|
14591
|
+
const known = PAID_SERVICES.find((entry) => entry.keyPrefixes.some((prefix) => key.name.startsWith(prefix)));
|
|
14592
|
+
if (known !== undefined)
|
|
14593
|
+
service(known.name).keys.push(key.name);
|
|
14594
|
+
}
|
|
14595
|
+
const asked = new Set(input.keys.map((key) => key.name));
|
|
14596
|
+
return {
|
|
14597
|
+
fetchAndRun: [...input.fetchAndRun],
|
|
14598
|
+
keys: [...input.keys],
|
|
14599
|
+
otherSettings: input.settings.filter((name) => !asked.has(name)).length,
|
|
14600
|
+
services: [...services.values()].sort((a, b) => a.name < b.name ? -1 : 1),
|
|
14601
|
+
programs: [...input.programs],
|
|
14602
|
+
scripts: [...input.scripts],
|
|
14603
|
+
apiHosts,
|
|
14604
|
+
staticHosts,
|
|
14605
|
+
otherHosts,
|
|
14606
|
+
hidden: [...input.hidden],
|
|
14607
|
+
notRead: input.skipped.filter((file) => file.why !== "binary" && !ASSET.test(file.path)),
|
|
14608
|
+
cut: [...input.cut]
|
|
14609
|
+
};
|
|
14610
|
+
}
|
|
14611
|
+
var plural = (count, one, many = `${one}s`) => `${count} ${count === 1 ? one : many}`;
|
|
14612
|
+
function programNames(programs, shown = 4) {
|
|
14613
|
+
const names = programs.map((program) => program.name);
|
|
14614
|
+
return names.length <= shown ? names.join(", ") : `${names.slice(0, shown).join(", ")} +${names.length - shown}`;
|
|
14615
|
+
}
|
|
14616
|
+
function beforeInstallSummary(view) {
|
|
14617
|
+
const secrets = view.keys.filter((key) => key.why === "secret").length;
|
|
14618
|
+
const toSet = view.keys.length - secrets;
|
|
14619
|
+
const asks = secrets + toSet === 0 ? "no keys" : [secrets === 0 ? null : plural(secrets, "key"), toSet === 0 ? null : plural(toSet, "setting")].filter((part) => part !== null).join(", ");
|
|
14620
|
+
return [
|
|
14621
|
+
...view.fetchAndRun.length === 0 ? [] : ["fetches and runs code"],
|
|
14622
|
+
asks,
|
|
14623
|
+
view.services.length === 0 ? "no paid services" : plural(view.services.length, "paid service"),
|
|
14624
|
+
view.programs.length === 0 ? "nothing to install named" : `needs ${programNames(view.programs)}`,
|
|
14625
|
+
view.scripts.length === 0 ? "no scripts" : plural(view.scripts.length, "script"),
|
|
14626
|
+
...view.hidden.length === 0 ? [] : [plural(view.hidden.length, "hidden text", "hidden texts")],
|
|
14627
|
+
...view.notRead.length === 0 ? [] : [`${plural(view.notRead.length, "file")} not read`]
|
|
14628
|
+
].join(" · ");
|
|
14629
|
+
}
|
|
14630
|
+
function programSourceText(program) {
|
|
14631
|
+
const at = program.file === undefined ? "" : `${program.file}${program.line === undefined ? "" : `:${program.line}`}`;
|
|
14632
|
+
switch (program.from) {
|
|
14633
|
+
case "declared":
|
|
14634
|
+
return "declared in SKILL.md";
|
|
14635
|
+
case "runs":
|
|
14636
|
+
return "run in SKILL.md";
|
|
14637
|
+
case "interpreter":
|
|
14638
|
+
return "script interpreter";
|
|
14639
|
+
case "script":
|
|
14640
|
+
return "a script checks for it or installs it";
|
|
14641
|
+
case "spawned":
|
|
14642
|
+
return `run by ${at}`;
|
|
14643
|
+
case "package":
|
|
14644
|
+
return `via ${program.via ?? "a package"}, ${at}`;
|
|
14645
|
+
case "named as needed":
|
|
14646
|
+
return `said to be needed, ${at}`;
|
|
14647
|
+
}
|
|
14648
|
+
}
|
|
14649
|
+
function contentsLines(contents, perList = 6) {
|
|
14650
|
+
const view = beforeInstall({ ...contents, skipped: contents.read.skipped });
|
|
14651
|
+
const list = (items, cut2) => `${items.slice(0, perList).join(", ")}${items.length > perList || cut2 ? `, and ${Math.max(0, items.length - perList)}${cut2 ? "+" : ""} more` : ""}`;
|
|
14652
|
+
const cut = (name) => view.cut.includes(name);
|
|
14653
|
+
const at = (rows, name) => list(rows.map((row) => `${row.kind} at ${row.file}:${row.line} "${row.text}"`), cut(name));
|
|
14654
|
+
const others = view.otherSettings === 0 ? "" : `; ${plural(view.otherSettings, "other setting")} it reads`;
|
|
14655
|
+
const hostParts = [
|
|
14656
|
+
view.apiHosts.length === 0 ? "no API host" : list(view.apiHosts, false),
|
|
14657
|
+
...view.staticHosts.length === 0 ? [] : [`fonts, CDNs and map tiles: ${view.staticHosts.length}`],
|
|
14658
|
+
...view.otherHosts.length === 0 ? [] : [`other sites named: ${view.otherHosts.length}`]
|
|
14659
|
+
];
|
|
14660
|
+
return [
|
|
14661
|
+
`Before you install: ${beforeInstallSummary(view)}`,
|
|
14662
|
+
...view.fetchAndRun.length === 0 ? [] : [`Fetches and runs code: ${at(view.fetchAndRun, "fetchAndRun")}`],
|
|
14663
|
+
`Asks for: ${view.keys.length === 0 ? `no keys${others}` : `${list(view.keys.map((key) => `${key.name} (${key.why === "secret" ? "" : "set in SKILL.md, "}${key.file}:${key.line})`), cut("keys"))}${others}`}`,
|
|
14664
|
+
`Paid services: ${view.services.length === 0 ? "none named" : list(view.services.map((entry) => `${entry.name} (${[...entry.hosts, ...entry.keys].join(", ")})`), false)}`,
|
|
14665
|
+
`Needs installed: ${view.programs.length === 0 ? "none named" : list(view.programs.map((program) => `${program.name} (${programSourceText(program)})`), cut("programs"))}`,
|
|
14666
|
+
`Runs on your machine: ${view.scripts.length === 0 ? "no scripts" : `${plural(view.scripts.length, "script")}: ${list(view.scripts.map((script) => script.namedInSkillMd ? `${script.path} (named in SKILL.md)` : script.path), cut("scripts"))}`}${view.fetchAndRun.length === 0 ? "; fetches and runs no code" : ""}`,
|
|
14667
|
+
`Sends data to (hosts its files name, not shown to be contacted): ${hostParts.join("; ")}`,
|
|
14668
|
+
...view.hidden.length === 0 ? [] : [`Hidden or encoded text: ${at(view.hidden, "hidden")}`],
|
|
14669
|
+
...view.notRead.length === 0 ? [] : [`Not read: ${list(view.notRead.map((file) => `${file.path} (${file.why})`), false)}`]
|
|
14670
|
+
];
|
|
14671
|
+
}
|
|
14752
14672
|
// ../../packages/protocol/dist/outside-signals.js
|
|
14753
14673
|
var TRUST_INDEX_LOOKUP = "https://x402-doctor.fizzl.eu/api/trust?url=";
|
|
14754
14674
|
var FAILURE_WORDS = ["error", "fail", "failed", "broken", "crash"];
|
|
@@ -14796,7 +14716,7 @@ function outsideIndex(file) {
|
|
|
14796
14716
|
}
|
|
14797
14717
|
};
|
|
14798
14718
|
}
|
|
14799
|
-
var
|
|
14719
|
+
var plural2 = (count, one, many) => `${count} ${count === 1 ? one : many}`;
|
|
14800
14720
|
function repoFacts(file, label, skill) {
|
|
14801
14721
|
const index2 = outsideIndex(file);
|
|
14802
14722
|
const repoLabel = repoLabelOf(label);
|
|
@@ -14818,7 +14738,7 @@ function repoFacts(file, label, skill) {
|
|
|
14818
14738
|
const { total, open } = signals.issues;
|
|
14819
14739
|
const named = skill === undefined ? null : index2.skill(label);
|
|
14820
14740
|
facts.push({
|
|
14821
|
-
says: `${
|
|
14741
|
+
says: `${plural2(total, "issue title names", "issue titles name")} a failure (${open} open)` + (named === null ? "" : `; ${named.named} among the newest read name this skill`),
|
|
14822
14742
|
per: "GitHub search",
|
|
14823
14743
|
on: issuesRead,
|
|
14824
14744
|
check: failureIssueSearchUrl(repo)
|
|
@@ -14837,7 +14757,7 @@ function endpointFacts(file, url) {
|
|
|
14837
14757
|
if (found2.entry !== null) {
|
|
14838
14758
|
const { verdict, daysChecked, daysPayable, reasons } = found2.entry;
|
|
14839
14759
|
facts.push({
|
|
14840
|
-
says: `${verdict}, payable on ${daysPayable} of ${
|
|
14760
|
+
says: `${verdict}, payable on ${daysPayable} of ${plural2(daysChecked, "day", "days")} checked` + (reasons.length === 0 ? "" : ` (${reasons.join(", ")})`),
|
|
14841
14761
|
per: credit,
|
|
14842
14762
|
on,
|
|
14843
14763
|
check,
|
|
@@ -14846,7 +14766,7 @@ function endpointFacts(file, url) {
|
|
|
14846
14766
|
} else if (found2.host !== null) {
|
|
14847
14767
|
const { endpoints, go, caution, noGo, error } = found2.host;
|
|
14848
14768
|
facts.push({
|
|
14849
|
-
says: `this address is not listed; its host has ${
|
|
14769
|
+
says: `this address is not listed; its host has ${plural2(endpoints, "listed endpoint", "listed endpoints")}: ${go} go, ${caution} caution, ${noGo} no_go${error === 0 ? "" : `, ${error} unreachable`}`,
|
|
14850
14770
|
per: credit,
|
|
14851
14771
|
on,
|
|
14852
14772
|
check,
|
|
@@ -14870,16 +14790,21 @@ var BINDINGS_QUERY = `query EndpointBindings($subject: String!, $hasEndpoint: St
|
|
|
14870
14790
|
object { term_id data label }
|
|
14871
14791
|
}
|
|
14872
14792
|
}`;
|
|
14873
|
-
|
|
14874
|
-
|
|
14875
|
-
|
|
14793
|
+
function contextsQuery(claims) {
|
|
14794
|
+
const variables = Array.from({ length: claims }, (_, at) => `$t${at}: String!`).join(", ");
|
|
14795
|
+
const fields = Array.from({ length: claims }, (_, at) => ` c${at}: triples(
|
|
14796
|
+
where: {predicate_id: {_eq: $inContextOf}, object_id: {_eq: $t${at}}}
|
|
14876
14797
|
order_by: {created_at: asc}
|
|
14877
14798
|
limit: $limit
|
|
14878
14799
|
) {
|
|
14879
14800
|
object_id
|
|
14880
14801
|
subject { term_id data value { json_object { data } } }
|
|
14881
|
-
}
|
|
14802
|
+
}`).join(`
|
|
14803
|
+
`);
|
|
14804
|
+
return `query EndpointProofs($inContextOf: String!, $limit: Int!, ${variables}) {
|
|
14805
|
+
${fields}
|
|
14882
14806
|
}`;
|
|
14807
|
+
}
|
|
14883
14808
|
var DEFAULT_MAX_PROOFS_PER_CLAIM = 5;
|
|
14884
14809
|
var RANK = { bound: 0, transferred: 1, unknown: 2, unproven: 3 };
|
|
14885
14810
|
function gatewayFetch(fetchLike, timeoutMs) {
|
|
@@ -14927,12 +14852,13 @@ async function getAgentEndpoints(subject, config) {
|
|
|
14927
14852
|
if (claims.length === 0)
|
|
14928
14853
|
return [];
|
|
14929
14854
|
const maxProofs = config.maxProofsPerClaim ?? DEFAULT_MAX_PROOFS_PER_CLAIM;
|
|
14930
|
-
|
|
14931
|
-
|
|
14932
|
-
|
|
14933
|
-
|
|
14934
|
-
|
|
14935
|
-
|
|
14855
|
+
const allContexts = await transport.request(contextsQuery(claims.length), {
|
|
14856
|
+
inContextOf: config.predicates.inContextOf,
|
|
14857
|
+
limit: maxProofs,
|
|
14858
|
+
...Object.fromEntries(claims.map((claim, at) => [`t${at}`, claim.tripleId]))
|
|
14859
|
+
});
|
|
14860
|
+
return Promise.all(claims.map(async (claim, at) => {
|
|
14861
|
+
const contexts = { triples: allContexts[`c${at}`] };
|
|
14936
14862
|
const uris = [];
|
|
14937
14863
|
for (const row of Array.isArray(contexts["triples"]) ? contexts["triples"] : []) {
|
|
14938
14864
|
if (!isRecord(row))
|
|
@@ -15123,16 +15049,21 @@ var LINE_REQUEST_TYPES = {
|
|
|
15123
15049
|
{ name: "payment", type: "string" },
|
|
15124
15050
|
{ name: "endpoint", type: "string" },
|
|
15125
15051
|
{ name: "need", type: "string" },
|
|
15052
|
+
{ name: "payTo", type: "string" },
|
|
15053
|
+
{ name: "asset", type: "string" },
|
|
15054
|
+
{ name: "price", type: "string" },
|
|
15055
|
+
{ name: "termsAt", type: "uint256" },
|
|
15126
15056
|
{ name: "nonce", type: "bytes32" },
|
|
15127
15057
|
{ name: "expiresAt", type: "uint256" }
|
|
15128
15058
|
]
|
|
15129
15059
|
};
|
|
15060
|
+
var LINE_REQUEST_VERSION = "5";
|
|
15130
15061
|
function lineRequestTypedData(request, chainId) {
|
|
15131
15062
|
return {
|
|
15132
|
-
domain: { name: "ARP Line Request", version:
|
|
15063
|
+
domain: { name: "ARP Line Request", version: LINE_REQUEST_VERSION, chainId },
|
|
15133
15064
|
types: LINE_REQUEST_TYPES,
|
|
15134
15065
|
primaryType: "LineRequest",
|
|
15135
|
-
message: { ...request, expiresAt: BigInt(request.expiresAt) }
|
|
15066
|
+
message: { ...request, termsAt: BigInt(request.termsAt), expiresAt: BigInt(request.expiresAt) }
|
|
15136
15067
|
};
|
|
15137
15068
|
}
|
|
15138
15069
|
async function signLineRequest(request, chainId, signer) {
|
|
@@ -15271,4 +15202,4 @@ var RUNG_NAMES = {
|
|
|
15271
15202
|
};
|
|
15272
15203
|
var API_NAMES = new Set(["api", "rest", "openai", "jsonrpc", "grpc"]);
|
|
15273
15204
|
var ANSWERED = new Set(["live", "serves-declared-protocol", "declared-protocol-not-served"]);
|
|
15274
|
-
export { decodeEventLog, createPublicClient, createWalletClient, http, parseEther2 as parseEther, resolveRef, toCaip19, parseCaip19, isTransactionAbsent, HAS_TAG, IS_A_SUB_DOMAIN_OF, USES, intuitionSource, createErc8004Client, IPFS_GATEWAYS, privateProbeTarget, guardedFetchText, probeEndpoint, resolveAgent, listAgents, readDeclaredEndpoints, partitionByCheckability, getToolUsage, multiVaultDeclareAbi, multiVaultReads, prepareMarketPosition, prepareMarketExit,
|
|
15205
|
+
export { decodeEventLog, createPublicClient, createWalletClient, http, verifyMessage3 as verifyMessage, parseEther2 as parseEther, resolveRef, toCaip19, parseCaip19, isTransactionAbsent, HAS_TAG, IS_A_SUB_DOMAIN_OF, USES, intuitionSource, createErc8004Client, IPFS_GATEWAYS, privateProbeTarget, guardedFetchText, probeEndpoint, resolveAgent, listAgents, readDeclaredEndpoints, partitionByCheckability, getToolUsage, multiVaultDeclareAbi, multiVaultReads, prepareMarketPosition, prepareMarketExit, toolAtomUri, redactEndpointUrl, intuitionToolAtomLookup, prepareDeclareUsed, prepareStakeOnUsed, resolveDeclarationSubject, normaliseCategoryLabel, isCategoryIn, intuitionTestnet, ARP_DOMAIN_ATTESTORS, chainIdOfNetwork, paymentAtomLabel, isExactEndpointUrl, transfersIn, x402NetworksFrom, x402Reading, X402_DEFAULT_NETWORKS, listTools, listRegisteredTools, verdictOf, readReachabilityState2 as readReachabilityState, planReachability2 as planReachability, readDomainTree, toolsInDomain, findAgents, parseSessionLog, resolveInvocations, skillRefFromUrl, resolveContentPath, readRequires, contentsFileOf, readSkillContents, parseSkillsFind, fuseSearches, readPulse, groupByContent, githubPulseSource, resolveDomain, domainInText, SHARE_OFFER, NEEDS_LABEL2 as NEEDS_LABEL, WITH_LABEL2 as WITH_LABEL, needKindOfReason2 as needKindOfReason, publishableNeed2 as publishableNeed, needShapeProblem2 as needShapeProblem, HAS_OUTCOME_LABEL2 as HAS_OUTCOME_LABEL, USAGE_REASONS2 as USAGE_REASONS, BECAUSE_LABEL2 as BECAUSE_LABEL, isUsageOutcome2 as isUsageOutcome, isUsageReason2 as isUsageReason, prepareUsageContext2 as prepareUsageContext, budgetRefusal2 as budgetRefusal, parseLocalFailures, yourFailures, parseLocalOutcomes, isSharingOn, installedFromSkillLock, installedFromReceipts, sharedLineKey, decideShare, SCORE_VERSION, WALLETS_TO_MOVE, signalOf, entersList, unconfirmedNote, scoreSkill, findToolAtoms, findDeclaredTools, readThingUrl, workedInDomain, readEdgeWriters, getPulseUsage, HIRE_RECEIPT_VERSION, hireDigest, signHireReceipt, atomIsCanonicalFor, resolveAgentAtom, walletControlsSubject, findAgentsInDomains, findAgentsWithEndpoints, wordsMatchingOffer, readLineReceipts, receiptHolds, contentRequestTypedData, recoverContentRequester, verifyContentReceipt, corroborationOf, receiptMatchesContent, serveContent, contentIndexOf, bundleMatchesReceipt, serveSkillBundle, reviewSkill, renderSkillPrompt, contentsLines, repoFacts, endpointFacts, parseAgentRegistry, normaliseEndpoint, validateHandshakeRequest, asEndpointBinding, endpointBindingDocument, getAgentEndpoints, encodeApproveDeposit, sponsorProofDigest, signSponsorRequest, signMintGasRequest, signListToolRequest, signLineRequest, CATEGORY_REQUEST_TYPES, categoryRequestTypedData, signCategoryRequest, verifyCategoryRequest, searchSkillsIndex, RUNG_NAMES };
|