@ixo/asks-mcp 1.12.2-dev.1 → 2.0.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asks-mcp.mjs +785 -817
- package/package.json +1 -1
package/dist/asks-mcp.mjs
CHANGED
|
@@ -7520,14 +7520,13 @@ function answerPage(site, collectionId, claimId, facts) {
|
|
|
7520
7520
|
function inviteLink(site, token, review) {
|
|
7521
7521
|
return review ? `${site.replace(/\/+$/, "")}/pro/i/${token}` : `${site.replace(/\/+$/, "")}/opencall/i/${token}`;
|
|
7522
7522
|
}
|
|
7523
|
-
var isReviewTitle, proPage,
|
|
7523
|
+
var isReviewTitle, proPage, roomPage;
|
|
7524
7524
|
var init_world = __esm({
|
|
7525
7525
|
"src/world.ts"() {
|
|
7526
7526
|
"use strict";
|
|
7527
7527
|
init_callTag();
|
|
7528
7528
|
isReviewTitle = (title) => /^Expert review:/.test(title ?? "");
|
|
7529
7529
|
proPage = (site, handle2) => `${site.replace(/\/+$/, "")}/pro/pros/${handle2}`;
|
|
7530
|
-
marketplacePage = (site, slug) => `${site.replace(/\/+$/, "")}/pro/marketplaces/${slug}`;
|
|
7531
7530
|
roomPage = (site, collectionId, pro) => `${site.replace(/\/+$/, "")}/pro/reviews/${collectionId}/with/${encodeURIComponent(pro.replace(/^@/, ""))}`;
|
|
7532
7531
|
}
|
|
7533
7532
|
});
|
|
@@ -8094,18 +8093,18 @@ function formAnswersOf(envelope) {
|
|
|
8094
8093
|
for (const key of keys) {
|
|
8095
8094
|
const value = doc[key];
|
|
8096
8095
|
const isFiles = Array.isArray(value) && value.every((one) => one && typeof one === "object" && typeof one.name === "string");
|
|
8097
|
-
const
|
|
8098
|
-
if (
|
|
8099
|
-
let found = deliverable.indexOf(`: ${
|
|
8100
|
-
while (found !== -1 && !(found + 2 +
|
|
8096
|
+
const said4 = isFiles ? value.map((one) => one.name).join(", ") : typeof value === "boolean" ? value ? "yes" : "no" : typeof value === "string" || typeof value === "number" ? String(value) : null;
|
|
8097
|
+
if (said4 === null) return null;
|
|
8098
|
+
let found = deliverable.indexOf(`: ${said4}`, at);
|
|
8099
|
+
while (found !== -1 && !(found + 2 + said4.length === deliverable.length || deliverable[found + 2 + said4.length] === "\n")) found = deliverable.indexOf(`: ${said4}`, found + 1);
|
|
8101
8100
|
if (found === -1) return null;
|
|
8102
8101
|
const label = deliverable.slice(at, found).trim();
|
|
8103
8102
|
if (!label || label.includes("\n")) return null;
|
|
8104
|
-
at = found + 2 +
|
|
8103
|
+
at = found + 2 + said4.length + 1;
|
|
8105
8104
|
if (isFiles) {
|
|
8106
8105
|
const files = value.filter((one) => isStoredFile(one.content)).map((one) => ({ name: one.name.replace(/\s+/g, " ").trim().slice(0, 80) || "file", mediaType: typeof one.type === "string" ? one.type.slice(0, 80) : "application/octet-stream", url: one.content }));
|
|
8107
8106
|
out.push({ label, files });
|
|
8108
|
-
} else out.push({ label, value:
|
|
8107
|
+
} else out.push({ label, value: said4 });
|
|
8109
8108
|
}
|
|
8110
8109
|
return at >= deliverable.length ? out : null;
|
|
8111
8110
|
}
|
|
@@ -8159,12 +8158,12 @@ var init_report = __esm({
|
|
|
8159
8158
|
|
|
8160
8159
|
// ../../packages/openhands-sdk/src/rubric/survey.ts
|
|
8161
8160
|
function surveyOptionsProblem(options) {
|
|
8162
|
-
const
|
|
8161
|
+
const L4 = SURVEY_LIMITS;
|
|
8163
8162
|
if (!Array.isArray(options)) return "A survey needs its options.";
|
|
8164
|
-
if (options.length <
|
|
8163
|
+
if (options.length < L4.optionsMin || options.length > L4.optionsMax) return `A survey has ${L4.optionsMin} to ${L4.optionsMax} options.`;
|
|
8165
8164
|
const seen2 = /* @__PURE__ */ new Set();
|
|
8166
8165
|
for (const option of options) {
|
|
8167
|
-
if (typeof option !== "string" || !option.trim() || option.trim().length >
|
|
8166
|
+
if (typeof option !== "string" || !option.trim() || option.trim().length > L4.optionMax) return `Every option is 1 to ${L4.optionMax} characters.`;
|
|
8168
8167
|
if (/[\n\r]/.test(option)) return "An option is one line.";
|
|
8169
8168
|
const key = option.trim().toLowerCase();
|
|
8170
8169
|
if (seen2.has(key)) return `"${option.trim()}" is listed twice.`;
|
|
@@ -8389,31 +8388,31 @@ function chainOf(raw) {
|
|
|
8389
8388
|
function blockOf(raw) {
|
|
8390
8389
|
const block2 = raw;
|
|
8391
8390
|
if (!block2 || typeof block2 !== "object") return null;
|
|
8392
|
-
const
|
|
8391
|
+
const L4 = CALL_LIMITS;
|
|
8393
8392
|
const picture2 = (one) => {
|
|
8394
8393
|
const it2 = one;
|
|
8395
|
-
return Boolean(it2) && https(it2.url) && line(it2.alt,
|
|
8394
|
+
return Boolean(it2) && https(it2.url) && line(it2.alt, L4.alt) && maybe(it2.caption, L4.caption);
|
|
8396
8395
|
};
|
|
8397
8396
|
const file3 = (one) => {
|
|
8398
8397
|
const it2 = one;
|
|
8399
|
-
return Boolean(it2) && https(it2.url) && line(it2.name,
|
|
8398
|
+
return Boolean(it2) && https(it2.url) && line(it2.name, L4.name) && maybe(it2.note, L4.note);
|
|
8400
8399
|
};
|
|
8401
8400
|
const step = (one) => {
|
|
8402
8401
|
const it2 = one;
|
|
8403
|
-
return Boolean(it2) && line(it2.title,
|
|
8402
|
+
return Boolean(it2) && line(it2.title, L4.stepTitle) && maybe(it2.text, L4.stepText);
|
|
8404
8403
|
};
|
|
8405
|
-
const paragraph = (one) => line(one,
|
|
8404
|
+
const paragraph = (one) => line(one, L4.paragraph);
|
|
8406
8405
|
const withCaption = (value, caption) => caption === void 0 ? value : { ...value, caption };
|
|
8407
8406
|
const withNote = (value, note) => note === void 0 ? value : { ...value, note };
|
|
8408
8407
|
switch (block2.kind) {
|
|
8409
8408
|
case "story":
|
|
8410
|
-
return someOf(block2.paragraphs,
|
|
8409
|
+
return someOf(block2.paragraphs, L4.paragraphs, paragraph) ? { kind: "story", paragraphs: [...block2.paragraphs] } : null;
|
|
8411
8410
|
case "cover":
|
|
8412
|
-
return https(block2.url) && line(block2.alt,
|
|
8411
|
+
return https(block2.url) && line(block2.alt, L4.alt) && maybe(block2.caption, L4.caption) ? withCaption({ kind: "cover", url: block2.url, alt: block2.alt }, block2.caption) : null;
|
|
8413
8412
|
case "pictures":
|
|
8414
|
-
return someOf(block2.items,
|
|
8413
|
+
return someOf(block2.items, L4.items, picture2) ? { kind: "pictures", items: block2.items.map((one) => withCaption({ url: one.url, alt: one.alt }, one.caption)) } : null;
|
|
8415
8414
|
case "diagram":
|
|
8416
|
-
if (!line(block2.title,
|
|
8415
|
+
if (!line(block2.title, L4.title) || !someOf(block2.steps, L4.steps, step) || !(block2.source === void 0 || lines(block2.source, L4.source))) return null;
|
|
8417
8416
|
return {
|
|
8418
8417
|
kind: "diagram",
|
|
8419
8418
|
title: block2.title,
|
|
@@ -8421,33 +8420,33 @@ function blockOf(raw) {
|
|
|
8421
8420
|
...block2.source === void 0 ? {} : { source: block2.source }
|
|
8422
8421
|
};
|
|
8423
8422
|
case "data":
|
|
8424
|
-
return line(block2.title,
|
|
8423
|
+
return line(block2.title, L4.title) && lines(block2.csv, L4.csv) && maybe(block2.note, L4.note) ? withNote({ kind: "data", title: block2.title, csv: block2.csv }, block2.note) : null;
|
|
8425
8424
|
case "files":
|
|
8426
|
-
return someOf(block2.items,
|
|
8425
|
+
return someOf(block2.items, L4.items, file3) ? { kind: "files", items: block2.items.map((one) => withNote({ url: one.url, name: one.name }, one.note)) } : null;
|
|
8427
8426
|
case "start":
|
|
8428
|
-
return lines(block2.prompt,
|
|
8427
|
+
return lines(block2.prompt, L4.start) ? { kind: "start", prompt: block2.prompt } : null;
|
|
8429
8428
|
}
|
|
8430
8429
|
return null;
|
|
8431
8430
|
}
|
|
8432
8431
|
function callOf(raw) {
|
|
8433
|
-
const
|
|
8434
|
-
if (!
|
|
8435
|
-
const
|
|
8436
|
-
if (typeof
|
|
8437
|
-
if (!CALL_LEGS.includes(
|
|
8438
|
-
if (!line(
|
|
8439
|
-
if (!Array.isArray(
|
|
8440
|
-
const money2 =
|
|
8432
|
+
const call3 = raw;
|
|
8433
|
+
if (!call3 || typeof call3 !== "object") return null;
|
|
8434
|
+
const L4 = CALL_LIMITS;
|
|
8435
|
+
if (typeof call3.slug !== "string" || !CALL_SLUG.test(call3.slug)) return null;
|
|
8436
|
+
if (!CALL_LEGS.includes(call3.leg)) return null;
|
|
8437
|
+
if (!line(call3.title, L4.title) || !line(call3.lede, L4.lede) || !line(call3.poster, L4.poster)) return null;
|
|
8438
|
+
if (!Array.isArray(call3.points) || call3.points.length === 0 || call3.points.length > L4.lines || !call3.points.every((one) => finite(one) && one >= 0 && one <= 100)) return null;
|
|
8439
|
+
const money2 = call3.money;
|
|
8441
8440
|
if (!money2 || typeof money2 !== "object") return null;
|
|
8442
8441
|
if (!amount(money2.prize) || !whole(money2.runnersN, 0, 5) || !amount(money2.runnersEach) || !amount(money2.entryEach) || !whole(money2.entryUpTo, 1, 1e4)) return null;
|
|
8443
|
-
const share =
|
|
8442
|
+
const share = call3.share;
|
|
8444
8443
|
if (share !== void 0 && (!share || typeof share !== "object" || !nonNegative(share.network) || !nonNegative(share.node) || share.network + share.node >= 100)) return null;
|
|
8445
|
-
const
|
|
8446
|
-
|
|
8447
|
-
if (!date5(
|
|
8444
|
+
const named = call3.sponsor;
|
|
8445
|
+
const sponsor = named && typeof named === "object" && typeof named.slug === "string" && CALL_SLUG.test(named.slug) && line(named.name, L4.sponsorName) && typeof named.node === "string" && ENTITY_DID.test(named.node) ? named : void 0;
|
|
8446
|
+
if (!date5(call3.closes) || !date5(call3.drop) || !date5(call3.pick)) return null;
|
|
8448
8447
|
let legs;
|
|
8449
|
-
if (
|
|
8450
|
-
const raw2 =
|
|
8448
|
+
if (call3.legs !== void 0) {
|
|
8449
|
+
const raw2 = call3.legs;
|
|
8451
8450
|
if (!raw2 || typeof raw2 !== "object") return null;
|
|
8452
8451
|
legs = {};
|
|
8453
8452
|
for (const name8 of CALL_LEGS) {
|
|
@@ -8457,42 +8456,42 @@ function callOf(raw) {
|
|
|
8457
8456
|
legs[name8] = id;
|
|
8458
8457
|
}
|
|
8459
8458
|
}
|
|
8460
|
-
if (!Array.isArray(
|
|
8461
|
-
const blocks =
|
|
8459
|
+
if (!Array.isArray(call3.blocks) || call3.blocks.length > L4.blocks) return null;
|
|
8460
|
+
const blocks = call3.blocks.map(blockOf);
|
|
8462
8461
|
if (blocks.some((block2) => block2 === null)) return null;
|
|
8463
8462
|
let review = null;
|
|
8464
|
-
if (
|
|
8465
|
-
if (
|
|
8466
|
-
const subject =
|
|
8463
|
+
if (call3.kind !== void 0) {
|
|
8464
|
+
if (call3.kind !== "review" || call3.mode !== "hire") return null;
|
|
8465
|
+
const subject = call3.subject;
|
|
8467
8466
|
if (subject !== void 0) {
|
|
8468
|
-
if (!subject || typeof subject !== "object" || !line(subject.name,
|
|
8469
|
-
if (subject.version !== void 0 && !line(subject.version,
|
|
8470
|
-
if (subject.where !== void 0 && !line(subject.where,
|
|
8467
|
+
if (!subject || typeof subject !== "object" || !line(subject.name, L4.subjectName)) return null;
|
|
8468
|
+
if (subject.version !== void 0 && !line(subject.version, L4.version)) return null;
|
|
8469
|
+
if (subject.where !== void 0 && !line(subject.where, L4.where)) return null;
|
|
8471
8470
|
}
|
|
8472
|
-
if (
|
|
8471
|
+
if (call3.scenarios !== void 0 && (!Array.isArray(call3.scenarios) || call3.scenarios.length === 0 || call3.scenarios.length > L4.scenarios || !call3.scenarios.every((one) => line(one, L4.scenario)))) return null;
|
|
8473
8472
|
review = {
|
|
8474
8473
|
kind: "review",
|
|
8475
8474
|
...subject ? { subject: { name: subject.name, ...subject.version !== void 0 ? { version: subject.version } : {}, ...subject.where !== void 0 ? { where: subject.where } : {} } } : {},
|
|
8476
|
-
...
|
|
8475
|
+
...call3.scenarios !== void 0 ? { scenarios: [...call3.scenarios] } : {}
|
|
8477
8476
|
};
|
|
8478
8477
|
}
|
|
8479
8478
|
return {
|
|
8480
8479
|
call: {
|
|
8481
|
-
slug:
|
|
8482
|
-
leg:
|
|
8480
|
+
slug: call3.slug,
|
|
8481
|
+
leg: call3.leg,
|
|
8483
8482
|
/* The one literal: anything else is a competition, as every call before it was. */
|
|
8484
|
-
...
|
|
8483
|
+
...call3.mode === "hire" ? { mode: "hire" } : {},
|
|
8485
8484
|
...review ?? {},
|
|
8486
|
-
title:
|
|
8487
|
-
lede:
|
|
8488
|
-
poster:
|
|
8489
|
-
points: [...
|
|
8485
|
+
title: call3.title,
|
|
8486
|
+
lede: call3.lede,
|
|
8487
|
+
poster: call3.poster,
|
|
8488
|
+
points: [...call3.points],
|
|
8490
8489
|
money: { prize: money2.prize, runnersN: money2.runnersN, runnersEach: money2.runnersEach, entryEach: money2.entryEach, entryUpTo: money2.entryUpTo },
|
|
8491
8490
|
...share ? { share: { network: share.network, node: share.node } } : {},
|
|
8492
8491
|
...sponsor ? { sponsor: { slug: sponsor.slug, name: sponsor.name, node: sponsor.node } } : {},
|
|
8493
|
-
closes:
|
|
8494
|
-
drop:
|
|
8495
|
-
pick:
|
|
8492
|
+
closes: call3.closes,
|
|
8493
|
+
drop: call3.drop,
|
|
8494
|
+
pick: call3.pick,
|
|
8496
8495
|
...legs ? { legs } : {},
|
|
8497
8496
|
blocks
|
|
8498
8497
|
}
|
|
@@ -9081,7 +9080,7 @@ function toEngineRubric(terms, binding, options = {}) {
|
|
|
9081
9080
|
const screens = [];
|
|
9082
9081
|
if (PHOTOGRAPH.has(normalized.deliverable.type)) {
|
|
9083
9082
|
const photos = pair && !normalized.site ? [PHOTO, BEFORE_PHOTO] : [PHOTO];
|
|
9084
|
-
const
|
|
9083
|
+
const said4 = (photo) => photos.length === 1 ? "The photograph" : photo === BEFORE_PHOTO ? "The before photograph" : "The after photograph";
|
|
9085
9084
|
const screened2 = (sourced) => {
|
|
9086
9085
|
pending.push(sourced);
|
|
9087
9086
|
screens.push({ ...sourced.gate, when: extRef(sourced.name) });
|
|
@@ -9091,7 +9090,7 @@ function toEngineRubric(terms, binding, options = {}) {
|
|
|
9091
9090
|
screened2({
|
|
9092
9091
|
name: PHOTO_CHECKS.notMarkedGenerated,
|
|
9093
9092
|
send: { photo },
|
|
9094
|
-
gate: { "@type": "Gate", code: codeFor(extra, "not-generated"), reason: `${
|
|
9093
|
+
gate: { "@type": "Gate", code: codeFor(extra, "not-generated"), reason: `${said4(photo)} says of itself that an AI generator made it`, onFail: "reject", class: "invalid_evidence" }
|
|
9095
9094
|
});
|
|
9096
9095
|
}
|
|
9097
9096
|
const judged = normalized.criteria.filter((criterion) => criterion.kind === "judge").length;
|
|
@@ -9118,7 +9117,7 @@ function toEngineRubric(terms, binding, options = {}) {
|
|
|
9118
9117
|
gate: {
|
|
9119
9118
|
"@type": "Gate",
|
|
9120
9119
|
code: codeFor(extra, "not-elsewhere"),
|
|
9121
|
-
reason: `${
|
|
9120
|
+
reason: `${said4(photo)}'s own GPS puts it far from the place reported. Take the photograph at the place you are reporting`,
|
|
9122
9121
|
onFail: "reject",
|
|
9123
9122
|
class: "invalid_evidence"
|
|
9124
9123
|
}
|
|
@@ -10088,8 +10087,8 @@ var init_engine = __esm({
|
|
|
10088
10087
|
num = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
10089
10088
|
obj2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
10090
10089
|
withPerson = (gate, verdict, reasonCodes) => {
|
|
10091
|
-
const
|
|
10092
|
-
return
|
|
10090
|
+
const said4 = personGate(gate.code, verdict, reasonCodes);
|
|
10091
|
+
return said4 ? { ...gate, ...said4, joined: true } : gate;
|
|
10093
10092
|
};
|
|
10094
10093
|
codesOf = (raw) => Array.isArray(raw) ? raw.filter((one) => typeof one === "string") : [];
|
|
10095
10094
|
engineStatusOf = (decision) => decision.outcome ?? (decision.verdict === "approve" || decision.verdict === "partial" ? 1 : decision.verdict === "reject" ? 2 : 5);
|
|
@@ -27772,7 +27771,7 @@ function bech32Polymod(pre) {
|
|
|
27772
27771
|
}
|
|
27773
27772
|
return chk;
|
|
27774
27773
|
}
|
|
27775
|
-
function bechChecksum(prefix,
|
|
27774
|
+
function bechChecksum(prefix, words4, encodingConst = 1) {
|
|
27776
27775
|
const len = prefix.length;
|
|
27777
27776
|
let chk = 1;
|
|
27778
27777
|
for (let i = 0; i < len; i++) {
|
|
@@ -27784,7 +27783,7 @@ function bechChecksum(prefix, words5, encodingConst = 1) {
|
|
|
27784
27783
|
chk = bech32Polymod(chk);
|
|
27785
27784
|
for (let i = 0; i < len; i++)
|
|
27786
27785
|
chk = bech32Polymod(chk) ^ prefix.charCodeAt(i) & 31;
|
|
27787
|
-
for (let v of
|
|
27786
|
+
for (let v of words4)
|
|
27788
27787
|
chk = bech32Polymod(chk) ^ v;
|
|
27789
27788
|
for (let i = 0; i < 6; i++)
|
|
27790
27789
|
chk = bech32Polymod(chk);
|
|
@@ -27798,20 +27797,20 @@ function genBech32(encoding) {
|
|
|
27798
27797
|
const fromWords = _words.decode;
|
|
27799
27798
|
const toWords = _words.encode;
|
|
27800
27799
|
const fromWordsUnsafe = unsafeWrapper(fromWords);
|
|
27801
|
-
function encode29(prefix,
|
|
27800
|
+
function encode29(prefix, words4, limit = 90) {
|
|
27802
27801
|
astr("bech32.encode prefix", prefix);
|
|
27803
|
-
if (isBytes2(
|
|
27804
|
-
|
|
27805
|
-
anumArr("bech32.encode",
|
|
27802
|
+
if (isBytes2(words4))
|
|
27803
|
+
words4 = Array.from(words4);
|
|
27804
|
+
anumArr("bech32.encode", words4);
|
|
27806
27805
|
const plen = prefix.length;
|
|
27807
27806
|
if (plen === 0)
|
|
27808
27807
|
throw new TypeError(`Invalid prefix length ${plen}`);
|
|
27809
|
-
const actualLength = plen + 7 +
|
|
27808
|
+
const actualLength = plen + 7 + words4.length;
|
|
27810
27809
|
if (limit !== false && actualLength > limit)
|
|
27811
27810
|
throw new TypeError(`Length ${actualLength} exceeds limit ${limit}`);
|
|
27812
27811
|
const lowered = prefix.toLowerCase();
|
|
27813
|
-
const sum2 = bechChecksum(lowered,
|
|
27814
|
-
return `${lowered}1${BECH_ALPHABET.encode(
|
|
27812
|
+
const sum2 = bechChecksum(lowered, words4, ENCODING_CONST);
|
|
27813
|
+
return `${lowered}1${BECH_ALPHABET.encode(words4)}${sum2}`;
|
|
27815
27814
|
}
|
|
27816
27815
|
function decode33(str6, limit = 90) {
|
|
27817
27816
|
astr("bech32.decode input", str6);
|
|
@@ -27828,19 +27827,19 @@ function genBech32(encoding) {
|
|
|
27828
27827
|
const data = lowered.slice(sepIndex + 1);
|
|
27829
27828
|
if (data.length < 6)
|
|
27830
27829
|
throw new Error("Data must be at least 6 characters long");
|
|
27831
|
-
const
|
|
27832
|
-
const sum2 = bechChecksum(prefix,
|
|
27830
|
+
const words4 = BECH_ALPHABET.decode(data).slice(0, -6);
|
|
27831
|
+
const sum2 = bechChecksum(prefix, words4, ENCODING_CONST);
|
|
27833
27832
|
if (!data.endsWith(sum2))
|
|
27834
27833
|
throw new Error(`Invalid checksum in ${str6}: expected "${sum2}"`);
|
|
27835
|
-
return { prefix, words:
|
|
27834
|
+
return { prefix, words: words4 };
|
|
27836
27835
|
}
|
|
27837
27836
|
const decodeUnsafe = unsafeWrapper(decode33);
|
|
27838
27837
|
function decodeToBytes(str6) {
|
|
27839
|
-
const { prefix, words:
|
|
27838
|
+
const { prefix, words: words4 } = decode33(str6, false);
|
|
27840
27839
|
return {
|
|
27841
27840
|
prefix,
|
|
27842
|
-
words:
|
|
27843
|
-
bytes: fromWords(
|
|
27841
|
+
words: words4,
|
|
27842
|
+
bytes: fromWords(words4)
|
|
27844
27843
|
};
|
|
27845
27844
|
}
|
|
27846
27845
|
function encodeFromBytes(prefix, bytes3) {
|
|
@@ -28346,18 +28345,18 @@ function waysIn(org, oracle, sourceId) {
|
|
|
28346
28345
|
`In Claude Code: eval-oracle api review-billing enable --source ${sourceId ?? "<source id>"} --kit ${oracle.url.replace(/\/$/, "")} --cap <dollars> (it previews first; add --yes to sign).`
|
|
28347
28346
|
];
|
|
28348
28347
|
}
|
|
28349
|
-
async function sourceCall(oracleUrl2, audience, mint,
|
|
28348
|
+
async function sourceCall(oracleUrl2, audience, mint, call3, options = {}) {
|
|
28350
28349
|
try {
|
|
28351
|
-
const response = await (options.fetch ?? fetch)(`${base3(oracleUrl2)}${
|
|
28352
|
-
method:
|
|
28350
|
+
const response = await (options.fetch ?? fetch)(`${base3(oracleUrl2)}${call3.path}`, {
|
|
28351
|
+
method: call3.method ?? "GET",
|
|
28353
28352
|
headers: {
|
|
28354
28353
|
accept: "application/json",
|
|
28355
|
-
authorization: `Bearer ${await mint(audience,
|
|
28354
|
+
authorization: `Bearer ${await mint(audience, call3.can, call3.sourceId)}`,
|
|
28356
28355
|
"x-auth-type": "ucan",
|
|
28357
|
-
...
|
|
28358
|
-
...
|
|
28356
|
+
...call3.sourceId ? { "x-source-id": call3.sourceId } : {},
|
|
28357
|
+
...call3.body !== void 0 ? { "content-type": "application/json" } : {}
|
|
28359
28358
|
},
|
|
28360
|
-
...
|
|
28359
|
+
...call3.body !== void 0 ? { body: JSON.stringify(call3.body) } : {},
|
|
28361
28360
|
signal: AbortSignal.timeout(TIMEOUT2)
|
|
28362
28361
|
});
|
|
28363
28362
|
const body = await response.json().catch(() => null);
|
|
@@ -28555,8 +28554,8 @@ function parseChecks(raw) {
|
|
|
28555
28554
|
return raw.flatMap((one) => {
|
|
28556
28555
|
const c = one;
|
|
28557
28556
|
if (!c || typeof c.name !== "string" || c.status !== "ok" && c.status !== "error") return [];
|
|
28558
|
-
const
|
|
28559
|
-
return [{ name: c.name, status: c.status, value: c.value ?? null, reason:
|
|
28557
|
+
const said4 = typeof c.reason === "string" ? c.reason.trim() : "";
|
|
28558
|
+
return [{ name: c.name, status: c.status, value: c.value ?? null, reason: said4 ? said4.length > REASON_MAX ? `${said4.slice(0, REASON_MAX).trimEnd()}\u2026` : said4 : null }];
|
|
28560
28559
|
});
|
|
28561
28560
|
}
|
|
28562
28561
|
function parseReviewerNote(raw) {
|
|
@@ -29697,14 +29696,14 @@ function rulesOf(rubric, manifest) {
|
|
|
29697
29696
|
const work = manifest && typeof manifest === "object" ? manifest : {};
|
|
29698
29697
|
const ai = listOf(rub.aiChecks).length ? listOf(rub.aiChecks) : listOf(work.ai && typeof work.ai === "object" ? Object.values(work.ai) : []);
|
|
29699
29698
|
const tasks = listOf(rub.review?.tasks).length ? listOf(rub.review?.tasks) : listOf(work.review?.taskDetails);
|
|
29700
|
-
const
|
|
29699
|
+
const said4 = (kind) => (raw) => {
|
|
29701
29700
|
const text4 = clampText(raw, 300);
|
|
29702
29701
|
return text4 ? [{ text: text4, kind }] : [];
|
|
29703
29702
|
};
|
|
29704
29703
|
return [
|
|
29705
|
-
...listOf(rub.gates).flatMap((gate) =>
|
|
29706
|
-
...ai.flatMap((check2) => (Array.isArray(check2.instructions) ? check2.instructions : []).flatMap(
|
|
29707
|
-
...tasks.flatMap((task) =>
|
|
29704
|
+
...listOf(rub.gates).flatMap((gate) => said4("measure")(gate.reason)),
|
|
29705
|
+
...ai.flatMap((check2) => (Array.isArray(check2.instructions) ? check2.instructions : []).flatMap(said4("judge"))),
|
|
29706
|
+
...tasks.flatMap((task) => said4("attest")(task.prompt))
|
|
29708
29707
|
].slice(0, RULES_MAX);
|
|
29709
29708
|
}
|
|
29710
29709
|
async function readProven(resource2, fetchImpl) {
|
|
@@ -30054,7 +30053,7 @@ function checkEnvelope(input) {
|
|
|
30054
30053
|
if (problems.length) throw new Error(problems.join(" "));
|
|
30055
30054
|
const answered = input.fields.filter((field2) => !isEmpty2(input.values[field2.name]));
|
|
30056
30055
|
const answers = Object.fromEntries(answered.map((field2) => [field2.name, answerOf(field2, input.values[field2.name])]));
|
|
30057
|
-
const
|
|
30056
|
+
const said4 = (field2) => {
|
|
30058
30057
|
const value = input.values[field2.name];
|
|
30059
30058
|
if (field2.type === "file") return filesOf(value).map((file3) => file3.name).join(", ");
|
|
30060
30059
|
if (field2.type === "boolean") return value ? "yes" : "no";
|
|
@@ -30068,7 +30067,7 @@ function checkEnvelope(input) {
|
|
|
30068
30067
|
...input.delegate ? { delegate: input.delegate } : {},
|
|
30069
30068
|
...input.alias ? { alias: input.alias } : {},
|
|
30070
30069
|
...input.via ? { via: input.via } : {},
|
|
30071
|
-
deliverable: answered.map((field2) => `${field2.label}: ${
|
|
30070
|
+
deliverable: answered.map((field2) => `${field2.label}: ${said4(field2)}`).join("\n"),
|
|
30072
30071
|
/* Last: a form question that shares an envelope field's name keeps the person's answer, which is what the checker reads. */
|
|
30073
30072
|
...answers
|
|
30074
30073
|
};
|
|
@@ -35612,10 +35611,10 @@ function nfkd(str6) {
|
|
|
35612
35611
|
}
|
|
35613
35612
|
function normalize2(str6) {
|
|
35614
35613
|
const norm = nfkd(str6);
|
|
35615
|
-
const
|
|
35616
|
-
if (![12, 15, 18, 21, 24].includes(
|
|
35614
|
+
const words4 = norm.split(" ");
|
|
35615
|
+
if (![12, 15, 18, 21, 24].includes(words4.length))
|
|
35617
35616
|
throw new Error("Invalid mnemonic");
|
|
35618
|
-
return { nfkd: norm, words:
|
|
35617
|
+
return { nfkd: norm, words: words4 };
|
|
35619
35618
|
}
|
|
35620
35619
|
function aentropy(ent) {
|
|
35621
35620
|
abytes4(ent);
|
|
@@ -35638,15 +35637,15 @@ function getCoder(wordlist2) {
|
|
|
35638
35637
|
return utils2.chain(utils2.checksum(1, calcChecksum), utils2.radix2(11, true), utils2.alphabet(wordlist2));
|
|
35639
35638
|
}
|
|
35640
35639
|
function mnemonicToEntropy(mnemonic, wordlist2) {
|
|
35641
|
-
const { words:
|
|
35642
|
-
const entropy = getCoder(wordlist2).decode(
|
|
35640
|
+
const { words: words4 } = normalize2(mnemonic);
|
|
35641
|
+
const entropy = getCoder(wordlist2).decode(words4);
|
|
35643
35642
|
aentropy(entropy);
|
|
35644
35643
|
return entropy;
|
|
35645
35644
|
}
|
|
35646
35645
|
function entropyToMnemonic(entropy, wordlist2) {
|
|
35647
35646
|
aentropy(entropy);
|
|
35648
|
-
const
|
|
35649
|
-
return
|
|
35647
|
+
const words4 = getCoder(wordlist2).encode(entropy);
|
|
35648
|
+
return words4.join(isJapanese(wordlist2) ? "\u3000" : " ");
|
|
35650
35649
|
}
|
|
35651
35650
|
function validateMnemonic(mnemonic, wordlist2) {
|
|
35652
35651
|
try {
|
|
@@ -39961,15 +39960,15 @@ function poly(field2, roots, create11, fft, length3) {
|
|
|
39961
39960
|
};
|
|
39962
39961
|
const checkLength = (a, b) => {
|
|
39963
39962
|
checkPoly("a", a);
|
|
39964
|
-
const
|
|
39963
|
+
const L4 = a.length;
|
|
39965
39964
|
if (b !== void 0) {
|
|
39966
39965
|
checkPoly("b", b);
|
|
39967
|
-
if (b.length !==
|
|
39968
|
-
throw new Error(`poly: mismatched lengths ${
|
|
39966
|
+
if (b.length !== L4)
|
|
39967
|
+
throw new Error(`poly: mismatched lengths ${L4} vs ${b.length}`);
|
|
39969
39968
|
}
|
|
39970
|
-
if (length3 !== void 0 &&
|
|
39971
|
-
throw new Error(`poly: expected fixed length ${length3}, got ${
|
|
39972
|
-
return
|
|
39969
|
+
if (length3 !== void 0 && L4 !== length3)
|
|
39970
|
+
throw new Error(`poly: expected fixed length ${length3}, got ${L4}`);
|
|
39971
|
+
return L4;
|
|
39973
39972
|
};
|
|
39974
39973
|
function findOmegaIndex(x, n, brp = false, weights) {
|
|
39975
39974
|
if (!isPowerOfTwo(n))
|
|
@@ -40124,11 +40123,11 @@ function poly(field2, roots, create11, fft, length3) {
|
|
|
40124
40123
|
const idx = findOmegaIndex(x, a.length, brp);
|
|
40125
40124
|
if (idx !== -1)
|
|
40126
40125
|
return a[idx];
|
|
40127
|
-
const
|
|
40126
|
+
const L4 = this.basis(x, a.length, brp);
|
|
40128
40127
|
let acc = F.ZERO;
|
|
40129
40128
|
for (let i = 0; i < a.length; i++)
|
|
40130
40129
|
if (!F.is0(a[i]))
|
|
40131
|
-
acc = F.add(acc, F.mul(a[i],
|
|
40130
|
+
acc = F.add(acc, F.mul(a[i], L4[i]));
|
|
40132
40131
|
return acc;
|
|
40133
40132
|
}
|
|
40134
40133
|
},
|
|
@@ -40254,8 +40253,8 @@ function hash_to_field(msg, count2, options) {
|
|
|
40254
40253
|
if (k < 0)
|
|
40255
40254
|
throw new Error("hash_to_field: invalid k");
|
|
40256
40255
|
const log2p = p.toString(2).length;
|
|
40257
|
-
const
|
|
40258
|
-
const len_in_bytes = count2 * m *
|
|
40256
|
+
const L4 = Math.ceil((log2p + k) / 8);
|
|
40257
|
+
const len_in_bytes = count2 * m * L4;
|
|
40259
40258
|
let prb;
|
|
40260
40259
|
if (expand2 === "xmd") {
|
|
40261
40260
|
prb = expand_message_xmd(msg, DST, len_in_bytes, hash2);
|
|
@@ -40270,8 +40269,8 @@ function hash_to_field(msg, count2, options) {
|
|
|
40270
40269
|
for (let i = 0; i < count2; i++) {
|
|
40271
40270
|
const e = new Array(m);
|
|
40272
40271
|
for (let j = 0; j < m; j++) {
|
|
40273
|
-
const elm_offset =
|
|
40274
|
-
const tv = prb.subarray(elm_offset, elm_offset +
|
|
40272
|
+
const elm_offset = L4 * (j + i * m);
|
|
40273
|
+
const tv = prb.subarray(elm_offset, elm_offset + L4);
|
|
40275
40274
|
e[j] = mod2(os2ip(tv), p);
|
|
40276
40275
|
}
|
|
40277
40276
|
u[i] = e;
|
|
@@ -40613,18 +40612,18 @@ function createFROST(opts) {
|
|
|
40613
40612
|
throw new Error("empty coefficients");
|
|
40614
40613
|
return Poly.monomial.eval(coeffs, x);
|
|
40615
40614
|
};
|
|
40616
|
-
const deriveInterpolatingValue = (
|
|
40615
|
+
const deriveInterpolatingValue = (L4, xi) => {
|
|
40617
40616
|
const err = "invalid parameters";
|
|
40618
|
-
if (!
|
|
40617
|
+
if (!L4.some((x) => Fn2.eql(x, xi)))
|
|
40619
40618
|
throw new Error(err);
|
|
40620
|
-
const Lset = new Set(
|
|
40621
|
-
if (Lset.size !==
|
|
40619
|
+
const Lset = new Set(L4);
|
|
40620
|
+
if (Lset.size !== L4.length)
|
|
40622
40621
|
throw new Error(err);
|
|
40623
40622
|
if (!Lset.has(xi))
|
|
40624
40623
|
throw new Error(err);
|
|
40625
40624
|
let num5 = Fn2.ONE;
|
|
40626
40625
|
let den = Fn2.ONE;
|
|
40627
|
-
for (const x of
|
|
40626
|
+
for (const x of L4) {
|
|
40628
40627
|
if (Fn2.eql(x, xi))
|
|
40629
40628
|
continue;
|
|
40630
40629
|
num5 = Fn2.mul(num5, x);
|
|
@@ -42707,9 +42706,9 @@ var init_legacy = __esm({
|
|
|
42707
42706
|
Id160 = /* @__PURE__ */ (() => Uint8Array.from(new Array(16).fill(0).map((_, i) => i)))();
|
|
42708
42707
|
Pi160 = /* @__PURE__ */ (() => Id160.map((i) => (9 * i + 5) % 16))();
|
|
42709
42708
|
idxLR = /* @__PURE__ */ (() => {
|
|
42710
|
-
const
|
|
42709
|
+
const L4 = [Id160];
|
|
42711
42710
|
const R = [Pi160];
|
|
42712
|
-
const res = [
|
|
42711
|
+
const res = [L4, R];
|
|
42713
42712
|
for (let i = 0; i < 4; i++)
|
|
42714
42713
|
for (let j of res)
|
|
42715
42714
|
j.push(j[i].map((k) => Rho160[k]));
|
|
@@ -43145,9 +43144,9 @@ function weierstrass(params, extraOpts = {}) {
|
|
|
43145
43144
|
y = Fp2.neg(y);
|
|
43146
43145
|
return { x, y };
|
|
43147
43146
|
} else if (length3 === uncomp && head === 4) {
|
|
43148
|
-
const
|
|
43149
|
-
const x = Fp2.fromBytes(tail.subarray(0,
|
|
43150
|
-
const y = Fp2.fromBytes(tail.subarray(
|
|
43147
|
+
const L4 = Fp2.BYTES;
|
|
43148
|
+
const x = Fp2.fromBytes(tail.subarray(0, L4));
|
|
43149
|
+
const y = Fp2.fromBytes(tail.subarray(L4, L4 * 2));
|
|
43151
43150
|
if (!isValidXY(x, y))
|
|
43152
43151
|
throw new Error("bad point: is not on curve");
|
|
43153
43152
|
return { x, y };
|
|
@@ -43672,9 +43671,9 @@ function ecdsa(Point2, hash2, ecdsaOpts = {}) {
|
|
|
43672
43671
|
format11 = "compact";
|
|
43673
43672
|
bytes3 = bytes3.subarray(1);
|
|
43674
43673
|
}
|
|
43675
|
-
const
|
|
43676
|
-
const r = bytes3.subarray(0,
|
|
43677
|
-
const s = bytes3.subarray(
|
|
43674
|
+
const L4 = lengths.signature / 2;
|
|
43675
|
+
const r = bytes3.subarray(0, L4);
|
|
43676
|
+
const s = bytes3.subarray(L4, L4 * 2);
|
|
43678
43677
|
return new Signature3(Fn2.fromBytes(r), Fn2.fromBytes(s), recid);
|
|
43679
43678
|
}
|
|
43680
43679
|
static fromHex(hex5, format11) {
|
|
@@ -51744,7 +51743,7 @@ var require_minimal = __commonJS({
|
|
|
51744
51743
|
configurable: true
|
|
51745
51744
|
},
|
|
51746
51745
|
name: {
|
|
51747
|
-
get: function
|
|
51746
|
+
get: function get2() {
|
|
51748
51747
|
return name8;
|
|
51749
51748
|
},
|
|
51750
51749
|
set: void 0,
|
|
@@ -112985,15 +112984,15 @@ var require_xstream = __commonJS({
|
|
|
112985
112984
|
Merge2.prototype._start = function(out) {
|
|
112986
112985
|
this.out = out;
|
|
112987
112986
|
var s = this.insArr;
|
|
112988
|
-
var
|
|
112989
|
-
this.ac =
|
|
112990
|
-
for (var i = 0; i <
|
|
112987
|
+
var L4 = s.length;
|
|
112988
|
+
this.ac = L4;
|
|
112989
|
+
for (var i = 0; i < L4; i++)
|
|
112991
112990
|
s[i]._add(this);
|
|
112992
112991
|
};
|
|
112993
112992
|
Merge2.prototype._stop = function() {
|
|
112994
112993
|
var s = this.insArr;
|
|
112995
|
-
var
|
|
112996
|
-
for (var i = 0; i <
|
|
112994
|
+
var L4 = s.length;
|
|
112995
|
+
for (var i = 0; i < L4; i++)
|
|
112997
112996
|
s[i]._remove(this);
|
|
112998
112997
|
this.out = NO;
|
|
112999
112998
|
};
|
|
@@ -113726,16 +113725,16 @@ var require_xstream = __commonJS({
|
|
|
113726
113725
|
}
|
|
113727
113726
|
Stream2.prototype._n = function(t) {
|
|
113728
113727
|
var a = this._ils;
|
|
113729
|
-
var
|
|
113728
|
+
var L4 = a.length;
|
|
113730
113729
|
if (this._d)
|
|
113731
113730
|
this._dl._n(t);
|
|
113732
|
-
if (
|
|
113731
|
+
if (L4 == 1)
|
|
113733
113732
|
a[0]._n(t);
|
|
113734
|
-
else if (
|
|
113733
|
+
else if (L4 == 0)
|
|
113735
113734
|
return;
|
|
113736
113735
|
else {
|
|
113737
113736
|
var b = cp(a);
|
|
113738
|
-
for (var i = 0; i <
|
|
113737
|
+
for (var i = 0; i < L4; i++)
|
|
113739
113738
|
b[i]._n(t);
|
|
113740
113739
|
}
|
|
113741
113740
|
};
|
|
@@ -113744,35 +113743,35 @@ var require_xstream = __commonJS({
|
|
|
113744
113743
|
return;
|
|
113745
113744
|
this._err = err;
|
|
113746
113745
|
var a = this._ils;
|
|
113747
|
-
var
|
|
113746
|
+
var L4 = a.length;
|
|
113748
113747
|
this._x();
|
|
113749
113748
|
if (this._d)
|
|
113750
113749
|
this._dl._e(err);
|
|
113751
|
-
if (
|
|
113750
|
+
if (L4 == 1)
|
|
113752
113751
|
a[0]._e(err);
|
|
113753
|
-
else if (
|
|
113752
|
+
else if (L4 == 0)
|
|
113754
113753
|
return;
|
|
113755
113754
|
else {
|
|
113756
113755
|
var b = cp(a);
|
|
113757
|
-
for (var i = 0; i <
|
|
113756
|
+
for (var i = 0; i < L4; i++)
|
|
113758
113757
|
b[i]._e(err);
|
|
113759
113758
|
}
|
|
113760
|
-
if (!this._d &&
|
|
113759
|
+
if (!this._d && L4 == 0)
|
|
113761
113760
|
throw this._err;
|
|
113762
113761
|
};
|
|
113763
113762
|
Stream2.prototype._c = function() {
|
|
113764
113763
|
var a = this._ils;
|
|
113765
|
-
var
|
|
113764
|
+
var L4 = a.length;
|
|
113766
113765
|
this._x();
|
|
113767
113766
|
if (this._d)
|
|
113768
113767
|
this._dl._c();
|
|
113769
|
-
if (
|
|
113768
|
+
if (L4 == 1)
|
|
113770
113769
|
a[0]._c();
|
|
113771
|
-
else if (
|
|
113770
|
+
else if (L4 == 0)
|
|
113772
113771
|
return;
|
|
113773
113772
|
else {
|
|
113774
113773
|
var b = cp(a);
|
|
113775
|
-
for (var i = 0; i <
|
|
113774
|
+
for (var i = 0; i < L4; i++)
|
|
113776
113775
|
b[i]._c();
|
|
113777
113776
|
}
|
|
113778
113777
|
};
|
|
@@ -114764,7 +114763,7 @@ var require_http = __commonJS({
|
|
|
114764
114763
|
}
|
|
114765
114764
|
return res;
|
|
114766
114765
|
}
|
|
114767
|
-
async function http3(method, url4, headers, request,
|
|
114766
|
+
async function http3(method, url4, headers, request, timeout2) {
|
|
114768
114767
|
const settings = {
|
|
114769
114768
|
method,
|
|
114770
114769
|
body: request ? JSON.stringify(request) : void 0,
|
|
@@ -114772,7 +114771,7 @@ var require_http = __commonJS({
|
|
|
114772
114771
|
"Content-Type": "application/json",
|
|
114773
114772
|
...headers
|
|
114774
114773
|
},
|
|
114775
|
-
signal:
|
|
114774
|
+
signal: timeout2 ? AbortSignal.timeout(timeout2) : void 0
|
|
114776
114775
|
};
|
|
114777
114776
|
return fetch(url4, settings).then(filterBadStatus).then((res) => res.json());
|
|
114778
114777
|
}
|
|
@@ -114903,7 +114902,7 @@ var require_httpclient = __commonJS({
|
|
|
114903
114902
|
url;
|
|
114904
114903
|
headers;
|
|
114905
114904
|
timeout;
|
|
114906
|
-
constructor(endpoint,
|
|
114905
|
+
constructor(endpoint, timeout2) {
|
|
114907
114906
|
if (typeof endpoint === "string") {
|
|
114908
114907
|
if (!(0, rpcclient_1.hasProtocol)(endpoint)) {
|
|
114909
114908
|
throw new Error("Endpoint URL is missing a protocol. Expected 'https://' or 'http://'.");
|
|
@@ -114913,7 +114912,7 @@ var require_httpclient = __commonJS({
|
|
|
114913
114912
|
this.url = endpoint.url;
|
|
114914
114913
|
this.headers = endpoint.headers;
|
|
114915
114914
|
}
|
|
114916
|
-
this.timeout =
|
|
114915
|
+
this.timeout = timeout2;
|
|
114917
114916
|
}
|
|
114918
114917
|
disconnect() {
|
|
114919
114918
|
}
|
|
@@ -117309,7 +117308,7 @@ var require_websocket = __commonJS({
|
|
|
117309
117308
|
const isSecure = parsedUrl.protocol === "wss:" || parsedUrl.protocol === "https:";
|
|
117310
117309
|
const defaultPort = isSecure ? 443 : 80;
|
|
117311
117310
|
const key = randomBytes8(16).toString("base64");
|
|
117312
|
-
const
|
|
117311
|
+
const get2 = isSecure ? https4.get : http3.get;
|
|
117313
117312
|
let perMessageDeflate;
|
|
117314
117313
|
opts.createConnection = isSecure ? tlsConnect : netConnect;
|
|
117315
117314
|
opts.defaultPort = opts.defaultPort || defaultPort;
|
|
@@ -117377,7 +117376,7 @@ var require_websocket = __commonJS({
|
|
|
117377
117376
|
options.headers.authorization = "Basic " + Buffer.from(opts.auth).toString("base64");
|
|
117378
117377
|
}
|
|
117379
117378
|
}
|
|
117380
|
-
let req = websocket._req =
|
|
117379
|
+
let req = websocket._req = get2(opts);
|
|
117381
117380
|
if (opts.timeout) {
|
|
117382
117381
|
req.on("timeout", () => {
|
|
117383
117382
|
abortHandshake(websocket, req, "Opening handshake has timed out");
|
|
@@ -118095,7 +118094,7 @@ var require_socketwrapper = __commonJS({
|
|
|
118095
118094
|
openHandler;
|
|
118096
118095
|
closeHandler;
|
|
118097
118096
|
timeout;
|
|
118098
|
-
constructor(url4, messageHandler, errorHandler, openHandler, closeHandler,
|
|
118097
|
+
constructor(url4, messageHandler, errorHandler, openHandler, closeHandler, timeout2 = 1e4) {
|
|
118099
118098
|
this.connected = new Promise((resolve2, reject) => {
|
|
118100
118099
|
this.connectedResolver = resolve2;
|
|
118101
118100
|
this.connectedRejecter = reject;
|
|
@@ -118105,7 +118104,7 @@ var require_socketwrapper = __commonJS({
|
|
|
118105
118104
|
this.errorHandler = errorHandler;
|
|
118106
118105
|
this.openHandler = openHandler;
|
|
118107
118106
|
this.closeHandler = closeHandler;
|
|
118108
|
-
this.timeout =
|
|
118107
|
+
this.timeout = timeout2;
|
|
118109
118108
|
}
|
|
118110
118109
|
/**
|
|
118111
118110
|
* returns a promise that resolves when connection is open
|
|
@@ -118238,7 +118237,7 @@ var require_streamingsocket = __commonJS({
|
|
|
118238
118237
|
events;
|
|
118239
118238
|
eventProducerListener;
|
|
118240
118239
|
socket;
|
|
118241
|
-
constructor(url4,
|
|
118240
|
+
constructor(url4, timeout2 = 1e4) {
|
|
118242
118241
|
this.socket = new socketwrapper_1.SocketWrapper(url4, (event) => {
|
|
118243
118242
|
if (this.eventProducerListener) {
|
|
118244
118243
|
this.eventProducerListener.next(event);
|
|
@@ -118256,7 +118255,7 @@ var require_streamingsocket = __commonJS({
|
|
|
118256
118255
|
this.eventProducerListener.error("Socket was closed unclean");
|
|
118257
118256
|
}
|
|
118258
118257
|
}
|
|
118259
|
-
},
|
|
118258
|
+
}, timeout2);
|
|
118260
118259
|
this.connected = this.socket.connected;
|
|
118261
118260
|
const eventProducer = {
|
|
118262
118261
|
start: (listener) => this.eventProducerListener = listener,
|
|
@@ -118305,9 +118304,9 @@ var require_queueingstreamingsocket = __commonJS({
|
|
|
118305
118304
|
eventProducerListener;
|
|
118306
118305
|
connectionStatusProducer;
|
|
118307
118306
|
reconnectedHandler;
|
|
118308
|
-
constructor(url4,
|
|
118307
|
+
constructor(url4, timeout2 = 1e4, reconnectedHandler) {
|
|
118309
118308
|
this.url = url4;
|
|
118310
|
-
this.timeout =
|
|
118309
|
+
this.timeout = timeout2;
|
|
118311
118310
|
this.reconnectedHandler = reconnectedHandler;
|
|
118312
118311
|
const eventProducer = {
|
|
118313
118312
|
start: (listener) => this.eventProducerListener = listener,
|
|
@@ -118411,13 +118410,13 @@ var require_reconnectingsocket = __commonJS({
|
|
|
118411
118410
|
disconnected = false;
|
|
118412
118411
|
timeoutIndex = 0;
|
|
118413
118412
|
reconnectTimeout = null;
|
|
118414
|
-
constructor(url4,
|
|
118413
|
+
constructor(url4, timeout2 = 1e4, reconnectedHandler) {
|
|
118415
118414
|
const eventProducer = {
|
|
118416
118415
|
start: (listener) => this.eventProducerListener = listener,
|
|
118417
118416
|
stop: () => this.eventProducerListener = void 0
|
|
118418
118417
|
};
|
|
118419
118418
|
this.events = xstream_1.Stream.create(eventProducer);
|
|
118420
|
-
this.socket = new queueingstreamingsocket_1.QueueingStreamingSocket(url4,
|
|
118419
|
+
this.socket = new queueingstreamingsocket_1.QueueingStreamingSocket(url4, timeout2, reconnectedHandler);
|
|
118421
118420
|
this.socket.events.subscribe({
|
|
118422
118421
|
next: (event) => {
|
|
118423
118422
|
if (this.eventProducerListener) {
|
|
@@ -236883,10 +236882,10 @@ var init_fromMm = __esm({
|
|
|
236883
236882
|
if (!_EnglishMnemonic.mnemonicMatcher.test(mnemonic)) {
|
|
236884
236883
|
throw new Error("Invalid mnemonic format");
|
|
236885
236884
|
}
|
|
236886
|
-
const
|
|
236885
|
+
const words4 = mnemonic.split(" ");
|
|
236887
236886
|
const allowedWordsLengths = [12, 15, 18, 21, 24];
|
|
236888
|
-
if (allowedWordsLengths.indexOf(
|
|
236889
|
-
throw new Error(`Invalid word count in mnemonic (allowed: ${allowedWordsLengths} got: ${
|
|
236887
|
+
if (allowedWordsLengths.indexOf(words4.length) === -1) {
|
|
236888
|
+
throw new Error(`Invalid word count in mnemonic (allowed: ${allowedWordsLengths} got: ${words4.length})`);
|
|
236890
236889
|
}
|
|
236891
236890
|
if (!validateMnemonic(mnemonic, wordlist)) {
|
|
236892
236891
|
throw new Error("Mnemonic is invalid.");
|
|
@@ -250659,10 +250658,10 @@ var require_get_proto = __commonJS({
|
|
|
250659
250658
|
var require_hasown = __commonJS({
|
|
250660
250659
|
"../../node_modules/.pnpm/hasown@2.0.4/node_modules/hasown/index.js"(exports, module) {
|
|
250661
250660
|
"use strict";
|
|
250662
|
-
var
|
|
250661
|
+
var call3 = Function.prototype.call;
|
|
250663
250662
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
250664
250663
|
var bind2 = require_function_bind();
|
|
250665
|
-
module.exports = bind2.call(
|
|
250664
|
+
module.exports = bind2.call(call3, $hasOwn);
|
|
250666
250665
|
}
|
|
250667
250666
|
});
|
|
250668
250667
|
|
|
@@ -253861,14 +253860,14 @@ var require_follow_redirects = __commonJS({
|
|
|
253861
253860
|
debug("options", options);
|
|
253862
253861
|
return new RedirectableRequest(options, callback);
|
|
253863
253862
|
}
|
|
253864
|
-
function
|
|
253863
|
+
function get2(input, options, callback) {
|
|
253865
253864
|
var wrappedRequest = wrappedProtocol.request(input, options, callback);
|
|
253866
253865
|
wrappedRequest.end();
|
|
253867
253866
|
return wrappedRequest;
|
|
253868
253867
|
}
|
|
253869
253868
|
Object.defineProperties(wrappedProtocol, {
|
|
253870
253869
|
request: { value: request, configurable: true, enumerable: true, writable: true },
|
|
253871
|
-
get: { value:
|
|
253870
|
+
get: { value: get2, configurable: true, enumerable: true, writable: true }
|
|
253872
253871
|
});
|
|
253873
253872
|
});
|
|
253874
253873
|
return exports2;
|
|
@@ -255712,8 +255711,8 @@ var init_http2 = __esm({
|
|
|
255712
255711
|
boundSockets.clear();
|
|
255713
255712
|
});
|
|
255714
255713
|
if (own2("timeout")) {
|
|
255715
|
-
const
|
|
255716
|
-
if (Number.isNaN(
|
|
255714
|
+
const timeout2 = parseInt(own2("timeout"), 10);
|
|
255715
|
+
if (Number.isNaN(timeout2)) {
|
|
255717
255716
|
abort(
|
|
255718
255717
|
new AxiosError_default(
|
|
255719
255718
|
"error trying to parse `config.timeout` to int",
|
|
@@ -255728,10 +255727,10 @@ var init_http2 = __esm({
|
|
|
255728
255727
|
if (isDone) return;
|
|
255729
255728
|
abort(createTimeoutError());
|
|
255730
255729
|
};
|
|
255731
|
-
if (isNativeTransport &&
|
|
255732
|
-
connectPhaseTimer = setTimeout(handleTimeout,
|
|
255730
|
+
if (isNativeTransport && timeout2 > 0) {
|
|
255731
|
+
connectPhaseTimer = setTimeout(handleTimeout, timeout2);
|
|
255733
255732
|
}
|
|
255734
|
-
req.setTimeout(
|
|
255733
|
+
req.setTimeout(timeout2, handleTimeout);
|
|
255735
255734
|
} else {
|
|
255736
255735
|
req.setTimeout(0);
|
|
255737
255736
|
}
|
|
@@ -256249,9 +256248,9 @@ var init_composeSignals = __esm({
|
|
|
256249
256248
|
init_CanceledError();
|
|
256250
256249
|
init_AxiosError();
|
|
256251
256250
|
init_utils7();
|
|
256252
|
-
composeSignals = (signals,
|
|
256251
|
+
composeSignals = (signals, timeout2) => {
|
|
256253
256252
|
signals = signals ? signals.filter(Boolean) : [];
|
|
256254
|
-
if (!
|
|
256253
|
+
if (!timeout2 && !signals.length) {
|
|
256255
256254
|
return;
|
|
256256
256255
|
}
|
|
256257
256256
|
const controller = new AbortController();
|
|
@@ -256266,10 +256265,10 @@ var init_composeSignals = __esm({
|
|
|
256266
256265
|
);
|
|
256267
256266
|
}
|
|
256268
256267
|
};
|
|
256269
|
-
let timer =
|
|
256268
|
+
let timer = timeout2 && setTimeout(() => {
|
|
256270
256269
|
timer = null;
|
|
256271
|
-
onabort(new AxiosError_default(`timeout of ${
|
|
256272
|
-
},
|
|
256270
|
+
onabort(new AxiosError_default(`timeout of ${timeout2}ms exceeded`, AxiosError_default.ETIMEDOUT));
|
|
256271
|
+
}, timeout2);
|
|
256273
256272
|
const unsubscribe = () => {
|
|
256274
256273
|
if (!signals) {
|
|
256275
256274
|
return;
|
|
@@ -256514,7 +256513,7 @@ var init_fetch = __esm({
|
|
|
256514
256513
|
data,
|
|
256515
256514
|
signal,
|
|
256516
256515
|
cancelToken,
|
|
256517
|
-
timeout:
|
|
256516
|
+
timeout: timeout2,
|
|
256518
256517
|
onDownloadProgress,
|
|
256519
256518
|
onUploadProgress,
|
|
256520
256519
|
responseType,
|
|
@@ -256531,7 +256530,7 @@ var init_fetch = __esm({
|
|
|
256531
256530
|
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
256532
256531
|
let composedSignal = composeSignals_default(
|
|
256533
256532
|
[signal, cancelToken && cancelToken.toAbortSignal()],
|
|
256534
|
-
|
|
256533
|
+
timeout2
|
|
256535
256534
|
);
|
|
256536
256535
|
let request = null;
|
|
256537
256536
|
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
@@ -258586,6 +258585,10 @@ function loadSession() {
|
|
|
258586
258585
|
if (!raw) return null;
|
|
258587
258586
|
const parsed = JSON.parse(raw);
|
|
258588
258587
|
if (!parsed.address) return null;
|
|
258588
|
+
if (parsed.matrix && "mnemonic" in parsed.matrix) {
|
|
258589
|
+
delete parsed.matrix.mnemonic;
|
|
258590
|
+
window.localStorage.setItem(KEY, JSON.stringify(parsed));
|
|
258591
|
+
}
|
|
258589
258592
|
return kindOf2(parsed) === "passkey" ? parsed.credentialId && parsed.authenticatorId ? parsed : null : parsed;
|
|
258590
258593
|
} catch {
|
|
258591
258594
|
return null;
|
|
@@ -260046,8 +260049,8 @@ async function uploadToLane(bytes3, contentType3, args) {
|
|
|
260046
260049
|
signal: args.signal ?? AbortSignal.timeout(6e4)
|
|
260047
260050
|
});
|
|
260048
260051
|
if (!response.ok) {
|
|
260049
|
-
const
|
|
260050
|
-
throw new LaneRefused(response.status, `the private store refused the file (${response.status}${
|
|
260052
|
+
const said4 = await response.text().catch(() => "");
|
|
260053
|
+
throw new LaneRefused(response.status, `the private store refused the file (${response.status}${said4 ? `: ${said4.slice(0, 160)}` : ""})`);
|
|
260051
260054
|
}
|
|
260052
260055
|
const meta4 = await response.json();
|
|
260053
260056
|
if (typeof meta4.cid !== "string" || !meta4.cid) throw new LaneRefused(502, "the private store gave no address for the file");
|
|
@@ -260227,8 +260230,8 @@ async function readPrivateAnswer(args) {
|
|
|
260227
260230
|
try {
|
|
260228
260231
|
const envelope = JSON.parse(new TextDecoder().decode(bytes3));
|
|
260229
260232
|
const names = (Array.isArray(envelope.files) ? envelope.files : []).map((one) => one?.name).filter((name8) => typeof name8 === "string");
|
|
260230
|
-
const
|
|
260231
|
-
return [
|
|
260233
|
+
const words4 = typeof envelope.deliverable === "string" ? envelope.deliverable : "";
|
|
260234
|
+
return [words4, names.length ? `Files kept privately: ${names.join(", ")}` : ""].filter(Boolean).join("\n\n") || "failed";
|
|
260232
260235
|
} catch {
|
|
260233
260236
|
return "failed";
|
|
260234
260237
|
}
|
|
@@ -260324,8 +260327,8 @@ async function allowOperatorAmounts(collectionId, owner, options) {
|
|
|
260324
260327
|
signal: AbortSignal.timeout(1e4)
|
|
260325
260328
|
});
|
|
260326
260329
|
if (response.ok) return { ok: true };
|
|
260327
|
-
const
|
|
260328
|
-
const message = typeof
|
|
260330
|
+
const said4 = await response.json().catch(() => null) ?? null;
|
|
260331
|
+
const message = typeof said4?.error === "string" ? said4.error : said4?.error?.message ?? said4?.message ?? "";
|
|
260329
260332
|
why = `the oracle answered ${response.status}${message ? ` (${String(message).slice(0, 160)})` : ""}`;
|
|
260330
260333
|
if (response.status === 401 || response.status === 403 || response.status === 400) break;
|
|
260331
260334
|
} catch (error54) {
|
|
@@ -260686,11 +260689,11 @@ async function publishJson(doc, label = "document") {
|
|
|
260686
260689
|
}
|
|
260687
260690
|
async function withinDeadline(task, ms2, label) {
|
|
260688
260691
|
let deadline;
|
|
260689
|
-
const
|
|
260692
|
+
const timeout2 = new Promise((_, reject) => {
|
|
260690
260693
|
deadline = setTimeout(() => reject(new Error(`${label} timed out after ${ms2} ms`)), ms2);
|
|
260691
260694
|
});
|
|
260692
260695
|
try {
|
|
260693
|
-
return await Promise.race([task,
|
|
260696
|
+
return await Promise.race([task, timeout2]);
|
|
260694
260697
|
} finally {
|
|
260695
260698
|
clearTimeout(deadline);
|
|
260696
260699
|
}
|
|
@@ -260754,15 +260757,15 @@ function dominantWaste(wastes) {
|
|
|
260754
260757
|
}
|
|
260755
260758
|
function wastesOf(assessment) {
|
|
260756
260759
|
if (!assessment) return [];
|
|
260757
|
-
const
|
|
260760
|
+
const said4 = Array.isArray(assessment.wastes) && assessment.wastes.length > 0 ? assessment.wastes : [assessment.waste];
|
|
260758
260761
|
const kept = [];
|
|
260759
|
-
for (const key of ORDERED_WASTE) if (
|
|
260762
|
+
for (const key of ORDERED_WASTE) if (said4.includes(key) && !kept.includes(key)) kept.push(key);
|
|
260760
260763
|
return kept;
|
|
260761
260764
|
}
|
|
260762
260765
|
function listSays(wastes) {
|
|
260763
|
-
const
|
|
260764
|
-
if (
|
|
260765
|
-
return `${
|
|
260766
|
+
const words4 = wastes.map((key) => WASTE[key].says);
|
|
260767
|
+
if (words4.length <= 1) return words4[0] ?? "";
|
|
260768
|
+
return `${words4.slice(0, -1).join(", ")} and ${words4[words4.length - 1]}`;
|
|
260766
260769
|
}
|
|
260767
260770
|
function isAssessment(value) {
|
|
260768
260771
|
const doc = value;
|
|
@@ -261562,8 +261565,8 @@ function broadcastTimeoutId(error54) {
|
|
|
261562
261565
|
const txId = error54.txId;
|
|
261563
261566
|
if (typeof txId !== "string" || !txId) return null;
|
|
261564
261567
|
const named = error54.name === "TimeoutError";
|
|
261565
|
-
const
|
|
261566
|
-
return named ||
|
|
261568
|
+
const said4 = /was submitted but was not yet found on the chain/i.test(String(error54.message ?? ""));
|
|
261569
|
+
return named || said4 ? txId : null;
|
|
261567
261570
|
}
|
|
261568
261571
|
function refusedAtCheckTx(error54) {
|
|
261569
261572
|
if (!error54 || typeof error54 !== "object") return false;
|
|
@@ -262920,11 +262923,11 @@ async function readAllowanceBase(granter, agent, denom = askDenom()) {
|
|
|
262920
262923
|
return 0;
|
|
262921
262924
|
})();
|
|
262922
262925
|
let deadline;
|
|
262923
|
-
const
|
|
262926
|
+
const timeout2 = new Promise((_, reject) => {
|
|
262924
262927
|
deadline = setTimeout(() => reject(new Error(`allowance read for ${granter.slice(0, 12)}\u2026 timed out`)), 8e3);
|
|
262925
262928
|
});
|
|
262926
262929
|
try {
|
|
262927
|
-
return await Promise.race([asked,
|
|
262930
|
+
return await Promise.race([asked, timeout2]);
|
|
262928
262931
|
} finally {
|
|
262929
262932
|
clearTimeout(deadline);
|
|
262930
262933
|
}
|
|
@@ -263202,7 +263205,7 @@ function ledeOf(trace) {
|
|
|
263202
263205
|
}
|
|
263203
263206
|
function gatheredDetail(checks) {
|
|
263204
263207
|
const ext = checks.filter((check2) => check2.kind === "ext");
|
|
263205
|
-
const named = [...new Set(ext.map((check2) => words3(check2.name)).filter((
|
|
263208
|
+
const named = [...new Set(ext.map((check2) => words3(check2.name)).filter((said4) => Boolean(said4)))];
|
|
263206
263209
|
const unknown3 = ext.filter((check2) => !words3(check2.name)).length;
|
|
263207
263210
|
const measured = unknown3 ? [...named, unknown3 === 1 ? "one other thing" : `${unknown3} other things`] : named;
|
|
263208
263211
|
const duplicates = checks.some((check2) => check2.kind === "unique");
|
|
@@ -263238,8 +263241,8 @@ function rulesSummary(rules, verdict) {
|
|
|
263238
263241
|
const unreached = total - met - failed;
|
|
263239
263242
|
if (!total) return verdict === "approve" ? "Approved against rules fixed before the work began." : "Decided against rules fixed before the work began.";
|
|
263240
263243
|
if (!failed && !unreached) return `${met} of ${total} ${total === 1 ? "rule" : "rules"} met, against rules fixed before the work began.`;
|
|
263241
|
-
const
|
|
263242
|
-
return `Of ${total} rules, ${list6(
|
|
263244
|
+
const said4 = [`${met} met`, `${failed} not met`, ...unreached ? [`${unreached} not reached`] : []];
|
|
263245
|
+
return `Of ${total} rules, ${list6(said4)}.`;
|
|
263243
263246
|
}
|
|
263244
263247
|
function signedDetail(step) {
|
|
263245
263248
|
const host = issuerHost(step.issuer);
|
|
@@ -263311,8 +263314,8 @@ function sentence3(step) {
|
|
|
263311
263314
|
return `${face ? `${face.text} released` : "released"} to ${step.to}. ${paidDetail(step)}${fee}`;
|
|
263312
263315
|
}
|
|
263313
263316
|
case "recorded": {
|
|
263314
|
-
const
|
|
263315
|
-
return `${
|
|
263317
|
+
const said4 = recordedLine(step.status);
|
|
263318
|
+
return `${said4.line}. ${said4.detail}`;
|
|
263316
263319
|
}
|
|
263317
263320
|
}
|
|
263318
263321
|
}
|
|
@@ -263359,23 +263362,23 @@ function lineSentence(line2) {
|
|
|
263359
263362
|
if (sentence4.length > 300) throw new Error(`a judged line is ${sentence4.length} characters with its failure; the jury reads 300 at most`);
|
|
263360
263363
|
return sentence4;
|
|
263361
263364
|
}
|
|
263362
|
-
function legCall(
|
|
263363
|
-
const read9 = callOf({ ...
|
|
263365
|
+
function legCall(call3, leg) {
|
|
263366
|
+
const read9 = callOf({ ...call3, leg });
|
|
263364
263367
|
if (!read9) throw new Error("the call does not read back: a field is missing, too long, or not an https address");
|
|
263365
263368
|
return read9.call;
|
|
263366
263369
|
}
|
|
263367
263370
|
function taskFor(title, leg, kind) {
|
|
263368
263371
|
const named = title.replace(/\s+/g, " ").trim();
|
|
263369
|
-
const
|
|
263370
|
-
return
|
|
263372
|
+
const said4 = leg === "entries" ? `${kind === "review" ? "Expert review" : "Open call"}: ${named}` : leg === "prize" ? `The pick of the open call: ${named}` : `A runner-up of the open call: ${named}`;
|
|
263373
|
+
return said4.length <= 140 ? said4 : `${said4.slice(0, 139)}\u2026`;
|
|
263371
263374
|
}
|
|
263372
263375
|
function callEntriesTerms(input) {
|
|
263373
263376
|
if (input.lines.length !== CALL_LIMITS.lines) throw new Error(`a call is judged on exactly ${CALL_LIMITS.lines} lines`);
|
|
263374
263377
|
if (input.judge.kind !== "oracle" || !input.judge.address) throw new Error("the entries are judged by the oracle, and it has to be named");
|
|
263375
|
-
const
|
|
263376
|
-
if (
|
|
263377
|
-
if (
|
|
263378
|
-
if (
|
|
263378
|
+
const call3 = legCall(input.call, "entries");
|
|
263379
|
+
if (call3.points.length !== CALL_LIMITS.lines) throw new Error("one score per judged line");
|
|
263380
|
+
if (call3.kind === "review" && !input.report) throw new Error("a review call's entries are reports: say report (the extra sections, or none)");
|
|
263381
|
+
if (call3.kind !== "review" && input.report) throw new Error("only a review call is answered as a report");
|
|
263379
263382
|
if (input.approver !== void 0 && !/^ixo1[a-z0-9]{38,64}$/.test(input.approver)) throw new Error("approver is an ixo1 address");
|
|
263380
263383
|
const criteria = [
|
|
263381
263384
|
{ id: "present", kind: "measure", gate: { id: "non-empty" } },
|
|
@@ -263384,11 +263387,11 @@ function callEntriesTerms(input) {
|
|
|
263384
263387
|
];
|
|
263385
263388
|
const terms = {
|
|
263386
263389
|
v: 2,
|
|
263387
|
-
task: taskFor(
|
|
263390
|
+
task: taskFor(call3.title, "entries", call3.kind),
|
|
263388
263391
|
deliverable: { type: "text", prompt: input.report ? REVIEW_DELIVERABLE_PROMPT : "One page, in your own words, covering all five requirements" },
|
|
263389
|
-
campaign: callTag(
|
|
263392
|
+
campaign: callTag(call3.slug),
|
|
263390
263393
|
...input.access ? { access: input.access } : {},
|
|
263391
|
-
call:
|
|
263394
|
+
call: call3,
|
|
263392
263395
|
criteria,
|
|
263393
263396
|
judge: input.judge,
|
|
263394
263397
|
...input.approver ? { approver: input.approver } : {}
|
|
@@ -263396,17 +263399,17 @@ function callEntriesTerms(input) {
|
|
|
263396
263399
|
return input.report ? withReport(terms, input.report, input.approver ? { v: 2 } : void 0) : terms;
|
|
263397
263400
|
}
|
|
263398
263401
|
function callPickTerms(input) {
|
|
263399
|
-
const
|
|
263400
|
-
if (
|
|
263402
|
+
const call3 = legCall(input.call, input.leg);
|
|
263403
|
+
if (call3.mode === "hire") throw new Error("a hiring call has no pick: the entries are the whole call");
|
|
263401
263404
|
const which = input.leg === "prize" ? "the pick" : "a runner-up";
|
|
263402
263405
|
return {
|
|
263403
263406
|
v: 2,
|
|
263404
|
-
task: taskFor(
|
|
263407
|
+
task: taskFor(call3.title, input.leg),
|
|
263405
263408
|
deliverable: { type: "text", prompt: "Quote the number of your entry, nothing else" },
|
|
263406
|
-
campaign: callTag(
|
|
263409
|
+
campaign: callTag(call3.slug),
|
|
263407
263410
|
...input.access ? { access: input.access } : {},
|
|
263408
|
-
call:
|
|
263409
|
-
criteria: [{ id: "picked", kind: "attest", text: `The poster chose this entry as ${which} of call ${
|
|
263411
|
+
call: call3,
|
|
263412
|
+
criteria: [{ id: "picked", kind: "attest", text: `The poster chose this entry as ${which} of call ${call3.slug}` }],
|
|
263410
263413
|
judge: { kind: "poster" }
|
|
263411
263414
|
};
|
|
263412
263415
|
}
|
|
@@ -263418,8 +263421,8 @@ function callDates(openDays, now3 = Date.now(), mode) {
|
|
|
263418
263421
|
}
|
|
263419
263422
|
return { closes: new Date(closes).toISOString(), drop: new Date(closes + DAY_MS2).toISOString(), pick: new Date(closes + 4 * DAY_MS2).toISOString() };
|
|
263420
263423
|
}
|
|
263421
|
-
function legDays(
|
|
263422
|
-
const until = leg === "entries" ? Date.parse(
|
|
263424
|
+
function legDays(call3, leg, now3 = Date.now()) {
|
|
263425
|
+
const until = leg === "entries" ? Date.parse(call3.closes) : Date.parse(call3.pick) + 7 * DAY_MS2;
|
|
263423
263426
|
return Math.max(1, Math.ceil((until - now3) / DAY_MS2));
|
|
263424
263427
|
}
|
|
263425
263428
|
var ENTRY_MIN_CHARS, REVIEW_LINES, REVIEW_DELIVERABLE_PROMPT, DAY_MS2, legsOf, pickQuota;
|
|
@@ -263439,7 +263442,7 @@ var init_call = __esm({
|
|
|
263439
263442
|
];
|
|
263440
263443
|
REVIEW_DELIVERABLE_PROMPT = "A review report: what you tested, your steps per scenario, each finding with its evidence, how to reproduce it and its severity, what to change, and the limitations";
|
|
263441
263444
|
DAY_MS2 = 24 * 3600 * 1e3;
|
|
263442
|
-
legsOf = (
|
|
263445
|
+
legsOf = (call3) => call3.mode === "hire" ? ["entries"] : ["prize", ...call3.money.runnersN > 0 ? ["runnersUp"] : [], "entries"];
|
|
263443
263446
|
pickQuota = (winners) => winners + 2;
|
|
263444
263447
|
}
|
|
263445
263448
|
});
|
|
@@ -263500,12 +263503,6 @@ function callChecker(network2, review, deployment2) {
|
|
|
263500
263503
|
function missingOf(fields, ctx) {
|
|
263501
263504
|
const out = [];
|
|
263502
263505
|
const review = fields.kind === "review";
|
|
263503
|
-
if (review && !fields.sponsor)
|
|
263504
|
-
out.push({
|
|
263505
|
-
field: "sponsor",
|
|
263506
|
-
question: `Which Zone is this pro ask through? ${ctx.marketplaces ? `On asks.world today: ${ctx.marketplaces}.` : "list_marketplaces names them."} The pros you invite are LinkedIn verified, and it earns the Zone's share of each approved report. Ask the person, even when there is one.`,
|
|
263507
|
-
example: '"ixo"'
|
|
263508
|
-
});
|
|
263509
263506
|
if (!fields.title) out.push({ field: "title", question: review ? "What is being reviewed, as one sentence a pro reads first?" : "What is the call, in one sentence?", example: review ? "Try Qi Portal 2.3 as a first-time project owner and tell us where it fails" : "How should a city pay strangers to fix what they find?" });
|
|
263510
263507
|
if (review && !fields.subject) out.push({ field: "subject", question: "What is reviewed: its name, the version to test, and where a pro finds it (a public address). Put test accounts and anything private in the invitation, not here: the pro ask is readable by everyone on its list.", example: '{ "name": "Qi Portal", "version": "2.3.0", "where": "https://staging.qi.space" }' });
|
|
263511
263508
|
if (review && !fields.scenarios?.length) out.push({ field: "scenarios", question: "The scenarios to try, one line each, up to eight: the tasks a real user comes to do. Every report must cover each with a step.", example: '["Sign up with the invite link on a phone that has never seen the app", "Create a project and add two members", "Export the project and open it on a laptop"]' });
|
|
@@ -263583,7 +263580,7 @@ function blocksOf(fields) {
|
|
|
263583
263580
|
else if (fields.kind === "review") blocks.push({ kind: "start", prompt: reviewStart(fields.title) });
|
|
263584
263581
|
return blocks;
|
|
263585
263582
|
}
|
|
263586
|
-
function callOfDraft(draft, poster, dates, legs, share
|
|
263583
|
+
function callOfDraft(draft, poster, dates, legs, share) {
|
|
263587
263584
|
const f = draft.fields;
|
|
263588
263585
|
if (!isReady(f) || !f.money) throw new Error("the draft is not ready to post");
|
|
263589
263586
|
return {
|
|
@@ -263596,7 +263593,6 @@ function callOfDraft(draft, poster, dates, legs, share, sponsor) {
|
|
|
263596
263593
|
points: linesOf(f).map(() => 100 / L2.lines),
|
|
263597
263594
|
money: f.mode === "hire" ? { ...f.money, prize: 0, runnersN: 0, runnersEach: 0 } : f.money,
|
|
263598
263595
|
...share ? { share: { network: share.network, node: share.node } } : {},
|
|
263599
|
-
...sponsor ? { sponsor: { slug: sponsor.slug, name: sponsor.name, node: sponsor.node } } : {},
|
|
263600
263596
|
...dates,
|
|
263601
263597
|
...legs && Object.keys(legs).length ? { legs } : {},
|
|
263602
263598
|
blocks: blocksOf(f)
|
|
@@ -263628,7 +263624,7 @@ function legTerms(draft, leg, ctx) {
|
|
|
263628
263624
|
const review = draft.fields.kind === "review";
|
|
263629
263625
|
return {
|
|
263630
263626
|
...callEntriesTerms({
|
|
263631
|
-
call: callOfDraft(draft, ctx.poster, ctx.dates, legs, ctx.share
|
|
263627
|
+
call: callOfDraft(draft, ctx.poster, ctx.dates, legs, ctx.share),
|
|
263632
263628
|
lines: linesOf(draft.fields),
|
|
263633
263629
|
judge: ctx.oracle,
|
|
263634
263630
|
access: access2,
|
|
@@ -263638,12 +263634,12 @@ function legTerms(draft, leg, ctx) {
|
|
|
263638
263634
|
via: "mcp"
|
|
263639
263635
|
};
|
|
263640
263636
|
}
|
|
263641
|
-
return { ...callPickTerms({ call: callOfDraft(draft, ctx.poster, ctx.dates, void 0, ctx.share
|
|
263637
|
+
return { ...callPickTerms({ call: callOfDraft(draft, ctx.poster, ctx.dates, void 0, ctx.share), leg, access: access2 }), via: "mcp" };
|
|
263642
263638
|
}
|
|
263643
263639
|
function callPlan(draft, ctx, now3 = Date.now()) {
|
|
263644
263640
|
if (callShares(draft.fields) !== Boolean(ctx.share)) throw new Error(ctx.share ? "only a private call carries the network's share" : "a private call is priced with the network's share: read the split first (callShare)");
|
|
263645
263641
|
const dates = draft.dates ?? callDates(draft.fields.openDays, now3, draft.fields.mode === "hire" ? "hire" : void 0);
|
|
263646
|
-
const entries2 = legTerms(draft, "entries", { poster: ctx.poster, dates, oracle: { kind: "oracle", address: ctx.oracle }, share: ctx.share
|
|
263642
|
+
const entries2 = legTerms(draft, "entries", { poster: ctx.poster, dates, oracle: { kind: "oracle", address: ctx.oracle }, share: ctx.share });
|
|
263647
263643
|
const checkBase = ctx.checkerLegBase(entries2);
|
|
263648
263644
|
const legs = legOrder(draft.fields).map((leg) => legPlan(draft.fields, leg, checkBase, ctx.share, ctx.feeInReward));
|
|
263649
263645
|
return { legs, totalBase: legs.reduce((sum2, one) => sum2 + one.escrowBase, 0), dates, share: ctx.share };
|
|
@@ -263683,7 +263679,7 @@ __export(feeLine_exports, {
|
|
|
263683
263679
|
feeLine: () => feeLine
|
|
263684
263680
|
});
|
|
263685
263681
|
function feeLine(args) {
|
|
263686
|
-
const { split: split3,
|
|
263682
|
+
const { split: split3, symbol: symbol2 } = args;
|
|
263687
263683
|
const leg = grossFor(Math.round(args.net * 1e6), split3);
|
|
263688
263684
|
const receives = `Each pro receives ${amountWords(args.net, symbol2)}.`;
|
|
263689
263685
|
const locked2 = `${amountWords(leg / 1e6, symbol2)} is locked per report`;
|
|
@@ -263691,8 +263687,7 @@ function feeLine(args) {
|
|
|
263691
263687
|
if (args.network === "mainnet") return `${receives} Nothing is taken on top: ${locked2}.`;
|
|
263692
263688
|
return `${receives} In the sandbox nothing is added: ${amountWords(leg / 1e6, symbol2)} is held per report; on the real network the fee is ${percentWords(MAINNET_SPLIT.network + MAINNET_SPLIT.node)} on top.`;
|
|
263693
263689
|
}
|
|
263694
|
-
|
|
263695
|
-
return `${receives} On top, the network takes ${part(split3.network)} and ${sponsorName}, the Zone, ${part(split3.node)}: ${locked2}.`;
|
|
263690
|
+
return `${receives} ${locked2}: ${percentWords(split3.network + split3.node)} on top of what the pro receives.`;
|
|
263696
263691
|
}
|
|
263697
263692
|
var MAINNET_SPLIT, percentWords, amountWords;
|
|
263698
263693
|
var init_feeLine = __esm({
|
|
@@ -263716,12 +263711,12 @@ __export(callRead_exports, {
|
|
|
263716
263711
|
sharedPay: () => sharedPay,
|
|
263717
263712
|
stageWords: () => stageWords
|
|
263718
263713
|
});
|
|
263719
|
-
function stageWords(
|
|
263720
|
-
if (now3 < Date.parse(
|
|
263721
|
-
if (
|
|
263722
|
-
if (now3 < Date.parse(
|
|
263723
|
-
if (now3 < Date.parse(
|
|
263724
|
-
return `closed; the pick was due ${day(
|
|
263714
|
+
function stageWords(call3, now3 = Date.now()) {
|
|
263715
|
+
if (now3 < Date.parse(call3.closes)) return `open until ${day(call3.closes)}`;
|
|
263716
|
+
if (call3.mode === "hire") return `closed ${day(call3.closes)}; every entry that passed is paid as it is judged`;
|
|
263717
|
+
if (now3 < Date.parse(call3.drop)) return `closed ${day(call3.closes)}; the shortlist shows ${day(call3.drop)}`;
|
|
263718
|
+
if (now3 < Date.parse(call3.pick)) return `closed; the shortlist is out; the pick by ${day(call3.pick)}`;
|
|
263719
|
+
return `closed; the pick was due ${day(call3.pick)}`;
|
|
263725
263720
|
}
|
|
263726
263721
|
function sharedPay(quote, share) {
|
|
263727
263722
|
const leg = grossFor(Math.round(quote * 1e6), share);
|
|
@@ -263754,36 +263749,35 @@ ${block2.prompt}`;
|
|
|
263754
263749
|
}
|
|
263755
263750
|
function callReadout(terms, ctx) {
|
|
263756
263751
|
const amount3 = (value, symbol2) => dollarsOfValue(value, symbol2, ctx.network ?? "mainnet");
|
|
263757
|
-
const
|
|
263758
|
-
const m =
|
|
263759
|
-
const hire =
|
|
263752
|
+
const call3 = terms.call;
|
|
263753
|
+
const m = call3.money;
|
|
263754
|
+
const hire = call3.mode === "hire";
|
|
263760
263755
|
const lines2 = terms.criteria.filter((one) => one.kind === "judge").map((one) => one.text);
|
|
263761
263756
|
const n = countWords(lines2.length || 5);
|
|
263762
|
-
const entriesId =
|
|
263757
|
+
const entriesId = call3.leg === "entries" ? ctx.id : call3.legs?.entries;
|
|
263763
263758
|
const money2 = hire ? [`every entry that passes all ${n} lines is paid ${amount3(m.entryEach, ctx.symbol)}, up to ${m.entryUpTo} ${m.entryUpTo === 1 ? "entry" : "entries"}; there is no pick`] : [
|
|
263764
263759
|
`the pick gets ${amount3(m.prize, ctx.symbol)}`,
|
|
263765
263760
|
m.runnersN > 0 ? `${m.runnersN} runner${m.runnersN === 1 ? "-up gets" : "s-up get"} ${amount3(m.runnersEach, ctx.symbol)} each` : "",
|
|
263766
263761
|
`every entry that passes all ${n} lines is paid ${amount3(m.entryEach, ctx.symbol)}, up to ${m.entryUpTo}`
|
|
263767
263762
|
].filter(Boolean);
|
|
263768
263763
|
const who = terms.access === "invite" ? "By invitation: only the people the poster put on the list can enter. If you were sent a link, pass it as submit_work's `invite`; if your address or page was named, nothing more is needed." : terms.access === "apply" ? "By application: apply_to_call first, with a short note; when the poster says yes, submit_work is admitted." : "Open to anyone.";
|
|
263769
|
-
const review =
|
|
263770
|
-
const shared =
|
|
263771
|
-
const shareLine2 = shared &&
|
|
263772
|
-
const proMoney =
|
|
263764
|
+
const review = call3.kind === "review";
|
|
263765
|
+
const shared = call3.share ? sharedPay(m.entryEach, call3.share) : null;
|
|
263766
|
+
const shareLine2 = shared && call3.share ? `each ${review ? "pro" : hire ? "hired person" : "entry paid"} receives ${amount3(shared.receives, ctx.symbol)} (the leg is ${amount3(shared.leg, ctx.symbol)}; the network keeps ${amount3(shared.keeps, ctx.symbol)}: ${shareWords(call3.share, "as posted")})${hire ? "" : "; the pick's and the runners-up's legs carry the same share on top of theirs"}` : "";
|
|
263767
|
+
const proMoney = review && call3.share && hire ? `Money: ${feeLine({ split: call3.share, net: m.entryEach, symbol: ctx.symbol, network: ctx.network ?? "mainnet" })} Up to ${m.entryUpTo} ${m.entryUpTo === 1 ? "report is" : "reports are"} paid, each one that passes all ${n} lines; there is no pick. Held on the ask's own account before anyone enters.` : null;
|
|
263773
263768
|
const out = [
|
|
263774
|
-
`${review ? "Pro ask" : hire ? "Hiring call" : "Open call"} "${
|
|
263769
|
+
`${review ? "Pro ask" : hire ? "Hiring call" : "Open call"} "${call3.slug}" \xB7 posted by ${call3.poster} \xB7 ${stageWords(call3, ctx.now)}`,
|
|
263775
263770
|
...review && ctx.site ? [`Its page: ${ctx.site.replace(/\/+$/, "")}/pro/reviews/${ctx.id}`] : [],
|
|
263776
|
-
|
|
263777
|
-
|
|
263778
|
-
|
|
263779
|
-
...review &&
|
|
263780
|
-
...review && call2.scenarios?.length ? ["Scenarios, each one a step in your report:", ...call2.scenarios.map((one, index) => ` S${index + 1}. ${one}`)] : [],
|
|
263771
|
+
call3.title,
|
|
263772
|
+
call3.lede,
|
|
263773
|
+
...review && call3.subject ? [`Reviewing: ${call3.subject.name}${call3.subject.version ? ` ${call3.subject.version}` : ""}${call3.subject.where ? ` \xB7 ${call3.subject.where}` : ""}. Access details, if any, are in your invitation.`] : [],
|
|
263774
|
+
...review && call3.scenarios?.length ? ["Scenarios, each one a step in your report:", ...call3.scenarios.map((one, index) => ` S${index + 1}. ${one}`)] : [],
|
|
263781
263775
|
proMoney ?? `Money: ${[...money2, shareLine2].filter(Boolean).join("; ")}. Locked in ${hire ? "the ask's own account" : "each leg's own account"} before anyone enters.`,
|
|
263782
263776
|
who,
|
|
263783
|
-
|
|
263777
|
+
call3.leg === "entries" ? review ? `Enter: a review report with screenshots, as submit_work's report and files, collectionId "${ctx.id}"${terms.approver ? `; the AI checks it against the requirements, then ${terms.approver} gives final approval to release payment` : "; the AI checks it against the requirements and a passing report is paid"}. One report per account.` : `Enter: one page of text, in your own words: submit_work collectionId "${ctx.id}". One entry per account.` : `The pick's leg: only the entry the poster picked may claim here, with one line naming it. ${entriesId ? `The entries are ask ${entriesId}.` : "The entries are the call's own ask."}`,
|
|
263784
263778
|
hire ? `Judged: ${n} requirements that every entry must meet. Pass all ${n} and the entry is paid on approval; nobody is picked.` : `Judged: ${n} requirements that every entry must meet. Pass all ${n} and the entry is paid; how clearly it meets each requirement ranks the entries for the pick.`,
|
|
263785
263779
|
"",
|
|
263786
|
-
...
|
|
263780
|
+
...call3.blocks.map(blockText).flatMap((text4) => [text4, ""]),
|
|
263787
263781
|
`The ${n} requirements:`,
|
|
263788
263782
|
...lines2.length ? lines2.map((text4, index) => `${index + 1}. ${text4}`) : ["(on the entries ask)"]
|
|
263789
263783
|
];
|
|
@@ -263814,7 +263808,6 @@ __export(call_exports2, {
|
|
|
263814
263808
|
INVITES_MAX: () => INVITES_MAX,
|
|
263815
263809
|
InFlightError: () => InFlightError,
|
|
263816
263810
|
PRO_ASK_INVITE_ONLY: () => PRO_ASK_INVITE_ONLY,
|
|
263817
|
-
PRO_ASK_NEEDS_MARKETPLACE: () => PRO_ASK_NEEDS_MARKETPLACE,
|
|
263818
263811
|
PostRefused: () => PostRefused,
|
|
263819
263812
|
SETTLE_MS: () => SETTLE_MS,
|
|
263820
263813
|
SHARE_UNREAD: () => SHARE_UNREAD,
|
|
@@ -264013,10 +264006,6 @@ function mergeDraft(draft, input, now3 = /* @__PURE__ */ new Date()) {
|
|
|
264013
264006
|
if (fields.kind === "review" && fields.mode === void 0) fields.mode = "hire";
|
|
264014
264007
|
if (fields.kind === "review" && fields.access === void 0) fields.access = "invite";
|
|
264015
264008
|
}
|
|
264016
|
-
if (input.sponsor !== void 0) {
|
|
264017
|
-
const slug = input.sponsor.trim().toLowerCase();
|
|
264018
|
-
take("sponsor", slug, fields.kind !== "review" ? 'sponsor names the Zone of a pro ask (kind "review"); an open call has none' : CALL_SLUG.test(slug) ? null : `"${slug.slice(0, 40)}" is not a Zone's name: list_marketplaces gives each one's`);
|
|
264019
|
-
}
|
|
264020
264009
|
if (input.subject !== void 0) {
|
|
264021
264010
|
const subject = { name: oneLine(input.subject.name), ...input.subject.version?.trim() ? { version: oneLine(input.subject.version) } : {}, ...input.subject.where?.trim() ? { where: oneLine(input.subject.where) } : {} };
|
|
264022
264011
|
take("subject", subject, within(subject.name, L3.subjectName, "What is reviewed") ?? (subject.version ? within(subject.version, L3.version, "The version") : null) ?? (subject.where ? within(subject.where, L3.where, "Where it is") : null));
|
|
@@ -264162,9 +264151,9 @@ async function settleInFlight(slug, lookup, now3 = Date.now(), txs = chainCheck)
|
|
|
264162
264151
|
const draft = readDraft(slug);
|
|
264163
264152
|
const inFlight2 = draft?.inFlight;
|
|
264164
264153
|
if (!draft || !inFlight2) return null;
|
|
264165
|
-
const
|
|
264154
|
+
const words4 = `checking whether the earlier post of the ${inFlight2.leg === "runnersUp" ? "runners-up" : inFlight2.leg} leg (started ${inFlight2.startedAt}) landed`;
|
|
264166
264155
|
const seen2 = await settleMarker(inFlight2, lookup, now3, txs);
|
|
264167
|
-
if (seen2.state === "pending") return { state: "pending", words: `Still ${
|
|
264156
|
+
if (seen2.state === "pending") return { state: "pending", words: `Still ${words4}: ${seen2.why}. Nothing new was posted. Call post_call again in a minute.` };
|
|
264168
264157
|
const at = new Date(now3).toISOString();
|
|
264169
264158
|
if (seen2.state === "landed") {
|
|
264170
264159
|
const next2 = { ...draft, updatedAt: at, inFlight: null, posted: { ...draft.posted, [inFlight2.leg]: { id: seen2.id, at, ...inFlight2.txHash ? { tx: inFlight2.txHash } : {} } } };
|
|
@@ -264241,8 +264230,6 @@ async function postNextLeg(slug, ctx) {
|
|
|
264241
264230
|
async function postNextLegNow(slug, ctx) {
|
|
264242
264231
|
const found = readDraft(slug);
|
|
264243
264232
|
if (!found) throw new Error(`no draft called "${slug}"`);
|
|
264244
|
-
if (found.fields.kind === "review" && nextLeg(found) && (!found.fields.sponsor || !ctx.sponsor)) throw new PostRefused(`${PRO_ASK_NEEDS_MARKETPLACE} Nothing was posted.`);
|
|
264245
|
-
if (ctx.sponsor && ctx.sponsor.slug !== found.fields.sponsor) throw new PostRefused(`Refused: the Zone resolved ("${ctx.sponsor.slug}") is not the one the draft names. Nothing was posted.`);
|
|
264246
264233
|
if (!isReady(found.fields)) throw new Error("the draft is not ready to post");
|
|
264247
264234
|
const settled = found.inFlight ? await settleInFlight(slug, ctx.lookup ?? indexLookup, ctx.now, ctx.txs) : null;
|
|
264248
264235
|
if (settled?.state === "pending") throw new InFlightError(settled.words);
|
|
@@ -264258,7 +264245,7 @@ async function postNextLegNow(slug, ctx) {
|
|
|
264258
264245
|
const priced = callShare(draft.fields, split3);
|
|
264259
264246
|
if ("unread" in priced) throw new PostRefused(SHARE_UNREAD);
|
|
264260
264247
|
const feeDenom = checkerFeeDenom2(network2());
|
|
264261
|
-
const { legs, dates } = callPlan(draft, { poster: shortPoster, checkerLegBase: (terms2) => ctx.fee ? ctx.fee.base : ctx.perCheck ? 0 : checkerLegBase2(feeDenom, terms2, ctx.checkReward), oracle: ctx.checker, share: priced.share, feeInReward: Boolean(ctx.fee) || ctx.askDenom === feeDenom
|
|
264248
|
+
const { legs, dates } = callPlan(draft, { poster: shortPoster, checkerLegBase: (terms2) => ctx.fee ? ctx.fee.base : ctx.perCheck ? 0 : checkerLegBase2(feeDenom, terms2, ctx.checkReward), oracle: ctx.checker, share: priced.share, feeInReward: Boolean(ctx.fee) || ctx.askDenom === feeDenom }, ctx.now);
|
|
264262
264249
|
if (settled?.state === "landed") {
|
|
264263
264250
|
ctx.nudge?.("hire", settled.id);
|
|
264264
264251
|
return { leg: settled.leg, id: settled.id, tx: null, plan: legs.find((one) => one.leg === settled.leg), terms: null, draft, resumed: true };
|
|
@@ -264270,7 +264257,7 @@ async function postNextLegNow(slug, ctx) {
|
|
|
264270
264257
|
if (ctx.acting && legs.some((one) => one.feeBase > 0)) throw new Error(callTwoCoins);
|
|
264271
264258
|
const plan = legs.find((one) => one.leg === leg);
|
|
264272
264259
|
const oracle = { kind: "oracle", address: ctx.checker, rewardUixo: plan.checkBase || legs.find((one) => one.leg === "entries").checkBase };
|
|
264273
|
-
const terms = legTerms(draft, leg, { poster: shortPoster, dates, oracle, approver: ctx.approver ?? null, share: priced.share
|
|
264260
|
+
const terms = legTerms(draft, leg, { poster: shortPoster, dates, oracle, approver: ctx.approver ?? null, share: priced.share });
|
|
264274
264261
|
const screen = await steps.screen(ctx.site, terms.task, terms);
|
|
264275
264262
|
if (screen?.verdict === "refuse") throw new Error(refusedWords(screen.reason));
|
|
264276
264263
|
await steps.fund(actor.address, ctx.site, ctx.acting?.principal);
|
|
@@ -264332,8 +264319,6 @@ async function postNextLegNow(slug, ctx) {
|
|
|
264332
264319
|
doneMeans: published,
|
|
264333
264320
|
/* The leg, not the quote: on a private call it is grossed up, and the approval leg carries the chain's split (openAskMessages). */
|
|
264334
264321
|
amountUixo: plan.legBase,
|
|
264335
|
-
/* A pro ask's entities are relayed by its marketplace's node, so the chain pays the marketplace the node share. */
|
|
264336
|
-
...ctx.sponsor ? { relayerNode: ctx.sponsor.node } : {},
|
|
264337
264322
|
quota: plan.quota,
|
|
264338
264323
|
days: legDays(dates, leg, ctx.now),
|
|
264339
264324
|
denom: ctx.askDenom,
|
|
@@ -264377,13 +264362,13 @@ function callServerEnv(site, env) {
|
|
|
264377
264362
|
OPENHANDS_MAX_PER_DAY_USD: env.OPENHANDS_MAX_PER_DAY_USD?.trim() || "100"
|
|
264378
264363
|
};
|
|
264379
264364
|
}
|
|
264380
|
-
function confirms(
|
|
264381
|
-
const named = /USDC|PAY|IXO/i.exec(
|
|
264365
|
+
function confirms(said4, totalBase, symbol2) {
|
|
264366
|
+
const named = /USDC|PAY|IXO/i.exec(said4)?.[0]?.toUpperCase();
|
|
264382
264367
|
if (symbol2 && named && named !== symbol2.toUpperCase()) return false;
|
|
264383
|
-
const figure =
|
|
264368
|
+
const figure = said4.replace(/[$,\s]|USDC|PAY|IXO/gi, "");
|
|
264384
264369
|
return /^\d+(\.\d+)?$/.test(figure) && Math.round(Number(figure) * MICRO5) === totalBase;
|
|
264385
264370
|
}
|
|
264386
|
-
var MICRO5, callsDir, fileOf, askInvitesFile, freshDraft, L3, ENTRIES_MAX, INVITES_MAX, INVITE_NOTE_MAX, ADDRESS2, HANDLE_ITEM, isInviteItem, PRO_ASK_INVITE_ONLY,
|
|
264371
|
+
var MICRO5, callsDir, fileOf, askInvitesFile, freshDraft, L3, ENTRIES_MAX, INVITES_MAX, INVITE_NOTE_MAX, ADDRESS2, HANDLE_ITEM, isInviteItem, PRO_ASK_INVITE_ONLY, manyLines, overCap, callTwoCoins, SETTLE_MS, chainCheck, InFlightError, PostRefused, feeUnpaid, said2, indexLookupWith, indexLookup, posting, isAskPending, isTxFailed, tagOf, TESTNET_CALL_DEFAULTS, payWords;
|
|
264387
264372
|
var init_call2 = __esm({
|
|
264388
264373
|
"src/call.ts"() {
|
|
264389
264374
|
"use strict";
|
|
@@ -264418,8 +264403,7 @@ var init_call2 = __esm({
|
|
|
264418
264403
|
ADDRESS2 = /^ixo1[a-z0-9]{38}$/;
|
|
264419
264404
|
HANDLE_ITEM = /^@?[a-z][a-z0-9-]{2,29}$/;
|
|
264420
264405
|
isInviteItem = (one) => one === "link" || ADDRESS2.test(one) || HANDLE_ITEM.test(one);
|
|
264421
|
-
PRO_ASK_INVITE_ONLY =
|
|
264422
|
-
PRO_ASK_NEEDS_MARKETPLACE = "A pro ask names its Zone: call draft_call with sponsor.";
|
|
264406
|
+
PRO_ASK_INVITE_ONLY = 'A pro ask is by invitation only (access "invite").';
|
|
264423
264407
|
manyLines = (value) => value.replace(/\r\n?/g, "\n").replace(/\t/g, ",").trim();
|
|
264424
264408
|
overCap = (leg, capBase) => leg.escrowBase > capBase;
|
|
264425
264409
|
callTwoCoins = "this call's reviews are held in review credit beside its rewards, and the connection's allowance covers the rewards only. Use a verifier that bills per check (Pay for reviews)";
|
|
@@ -264561,6 +264545,14 @@ function readLinkedinMessage(message, expected, now3 = Date.now(), maxAgeMs = ST
|
|
|
264561
264545
|
if (parts.length !== 5 || parts[0] !== "linkedin" || parts[1] !== expected.act || parts[2] !== expected.signer || parts[4] !== expected.digest) return "mismatch";
|
|
264562
264546
|
return fresh(parts[3], now3, maxAgeMs);
|
|
264563
264547
|
}
|
|
264548
|
+
async function cashoutWords(act, signer2, body, now3 = Date.now()) {
|
|
264549
|
+
return cashoutMessage(act, signer2, now3, await digestOf(linkedinBody(body)));
|
|
264550
|
+
}
|
|
264551
|
+
function readCashoutMessage(message, expected, now3 = Date.now(), maxAgeMs = STAFF_PROOF_MAX_AGE_MS) {
|
|
264552
|
+
const parts = message.split(":");
|
|
264553
|
+
if (parts.length !== 5 || parts[0] !== "cashout" || parts[1] !== expected.act || parts[2] !== expected.signer || parts[4] !== expected.digest) return "mismatch";
|
|
264554
|
+
return fresh(parts[3], now3, maxAgeMs);
|
|
264555
|
+
}
|
|
264564
264556
|
async function roomWords(act, signer2, body, now3 = Date.now()) {
|
|
264565
264557
|
return roomMessage(act, signer2, now3, await digestOf(roomBody(body)));
|
|
264566
264558
|
}
|
|
@@ -264657,8 +264649,8 @@ function readHandsRemoveMessage(message, expected) {
|
|
|
264657
264649
|
if (parts.length !== 3 || parts[0] !== "hands-remove" || parts[1] !== expected.address) return "mismatch";
|
|
264658
264650
|
return Number(parts[2]) === expected.prefAt ? "ok" : "mismatch";
|
|
264659
264651
|
}
|
|
264660
|
-
function fresh(
|
|
264661
|
-
const at = Number(
|
|
264652
|
+
function fresh(said4, now3, maxAgeMs) {
|
|
264653
|
+
const at = Number(said4);
|
|
264662
264654
|
if (!Number.isFinite(at)) return "mismatch";
|
|
264663
264655
|
return Math.abs(now3 - at) <= maxAgeMs ? "ok" : "stale";
|
|
264664
264656
|
}
|
|
@@ -264678,7 +264670,7 @@ async function digestOf(value) {
|
|
|
264678
264670
|
const bytes3 = new Uint8Array(await crypto.subtle.digest("SHA-256", new TextEncoder().encode(canonicalJson2(value))));
|
|
264679
264671
|
return Array.from(bytes3, (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
264680
264672
|
}
|
|
264681
|
-
var PROOF_MAX_AGE_MS2, INVITE_OPS, INVITE_WRITES, inviteOpBody, inviteOpMessage, applyMessage, invitedMessage, answersMessage, READ_PROOF_MAX_AGE_MS, FUTURE_SKEW_MS, LEGACY_WORDS_UNTIL, callsMessage, noticesMessage, tellMessage, NOTICE_KINDS, handsMessage, vettingMineMessage, vettingQueueMessage, STAFF_PROOF_MAX_AGE_MS, vetRequestBody, vetRequestMessage, vetBody, vetMessage, handsRemoveMessage, handsMineMessage, LINKEDIN_ACTS, linkedinBody, linkedinMessage, ROOM_ACTS, roomBody, roomMessage, ROOM_SEND_MAX_AGE_MS, SPONSOR_ACTS, sponsorBody, sponsorMessage, HANDS_SHARE_ACTS, handsShareMessage;
|
|
264673
|
+
var PROOF_MAX_AGE_MS2, INVITE_OPS, INVITE_WRITES, inviteOpBody, inviteOpMessage, applyMessage, invitedMessage, answersMessage, READ_PROOF_MAX_AGE_MS, FUTURE_SKEW_MS, LEGACY_WORDS_UNTIL, callsMessage, noticesMessage, tellMessage, NOTICE_KINDS, handsMessage, vettingMineMessage, vettingQueueMessage, STAFF_PROOF_MAX_AGE_MS, vetRequestBody, vetRequestMessage, vetBody, vetMessage, handsRemoveMessage, handsMineMessage, LINKEDIN_ACTS, linkedinBody, linkedinMessage, CASHOUT_ACTS, cashoutMessage, ROOM_ACTS, roomBody, roomMessage, ROOM_SEND_MAX_AGE_MS, SPONSOR_ACTS, sponsorBody, sponsorMessage, HANDS_SHARE_ACTS, handsShareMessage;
|
|
264682
264674
|
var init_inviteMessages = __esm({
|
|
264683
264675
|
"../../packages/openhands-sdk/src/chain/inviteMessages.ts"() {
|
|
264684
264676
|
"use strict";
|
|
@@ -264713,6 +264705,8 @@ var init_inviteMessages = __esm({
|
|
|
264713
264705
|
return rest;
|
|
264714
264706
|
};
|
|
264715
264707
|
linkedinMessage = (act, signer2, now3 = Date.now(), digest2 = "") => `linkedin:${act}:${signer2}:${now3}:${digest2}`;
|
|
264708
|
+
CASHOUT_ACTS = ["quote", "draft", "status"];
|
|
264709
|
+
cashoutMessage = (act, signer2, now3 = Date.now(), digest2 = "") => `cashout:${act}:${signer2}:${now3}:${digest2}`;
|
|
264716
264710
|
ROOM_ACTS = ["mine", "read", "send", "bring", "export"];
|
|
264717
264711
|
roomBody = (body) => {
|
|
264718
264712
|
const { address: _address, proof: _proof, ...rest } = body;
|
|
@@ -264759,6 +264753,7 @@ var init_inviteAnswer = __esm({
|
|
|
264759
264753
|
var inviteProof_exports = {};
|
|
264760
264754
|
__export(inviteProof_exports, {
|
|
264761
264755
|
AVAILABILITY: () => AVAILABILITY,
|
|
264756
|
+
CASHOUT_ACTS: () => CASHOUT_ACTS,
|
|
264762
264757
|
DOES: () => DOES,
|
|
264763
264758
|
FUTURE_SKEW_MS: () => FUTURE_SKEW_MS,
|
|
264764
264759
|
HANDLE: () => HANDLE,
|
|
@@ -264786,6 +264781,8 @@ __export(inviteProof_exports, {
|
|
|
264786
264781
|
applyMessage: () => applyMessage,
|
|
264787
264782
|
callsMessage: () => callsMessage,
|
|
264788
264783
|
canonicalJson: () => canonicalJson2,
|
|
264784
|
+
cashoutMessage: () => cashoutMessage,
|
|
264785
|
+
cashoutWords: () => cashoutWords,
|
|
264789
264786
|
digestOf: () => digestOf,
|
|
264790
264787
|
fresh: () => fresh,
|
|
264791
264788
|
handsMessage: () => handsMessage,
|
|
@@ -264800,10 +264797,12 @@ __export(inviteProof_exports, {
|
|
|
264800
264797
|
linkedinMessage: () => linkedinMessage,
|
|
264801
264798
|
linkedinWords: () => linkedinWords,
|
|
264802
264799
|
noticesMessage: () => noticesMessage,
|
|
264800
|
+
openToWork: () => openToWork,
|
|
264803
264801
|
readAcceptMessage: () => readAcceptMessage,
|
|
264804
264802
|
readAnswersMessage: () => readAnswersMessage,
|
|
264805
264803
|
readApplyMessage: () => readApplyMessage,
|
|
264806
264804
|
readCallsMessage: () => readCallsMessage,
|
|
264805
|
+
readCashoutMessage: () => readCashoutMessage,
|
|
264807
264806
|
readHandBlock: () => readHandBlock,
|
|
264808
264807
|
readHandProfile: () => readHandProfile,
|
|
264809
264808
|
readHandsMessage: () => readHandsMessage,
|
|
@@ -264836,8 +264835,13 @@ __export(inviteProof_exports, {
|
|
|
264836
264835
|
vetRequestWords: () => vetRequestWords,
|
|
264837
264836
|
vetWords: () => vetWords,
|
|
264838
264837
|
vettingMineMessage: () => vettingMineMessage,
|
|
264839
|
-
vettingQueueMessage: () => vettingQueueMessage
|
|
264838
|
+
vettingQueueMessage: () => vettingQueueMessage,
|
|
264839
|
+
withListed: () => withListed
|
|
264840
264840
|
});
|
|
264841
|
+
function withListed(profile, listed) {
|
|
264842
|
+
const { listed: _was, ...rest } = profile;
|
|
264843
|
+
return listed ? rest : { ...rest, listed: false };
|
|
264844
|
+
}
|
|
264841
264845
|
function readHandProfile(raw) {
|
|
264842
264846
|
const it2 = raw;
|
|
264843
264847
|
if (!it2 || typeof it2 !== "object") return { problem: "a page is an object" };
|
|
@@ -264873,37 +264877,37 @@ function readHandProfile(raw) {
|
|
|
264873
264877
|
const invitable = it2.invitable === void 0 ? true : it2.invitable;
|
|
264874
264878
|
if (typeof invitable !== "boolean") return { problem: "invitable is true or false" };
|
|
264875
264879
|
if (it2.listed !== void 0 && typeof it2.listed !== "boolean") return { problem: "listed is true or false" };
|
|
264876
|
-
const
|
|
264880
|
+
const L4 = HAND_LIMITS;
|
|
264877
264881
|
const pictureUrl = (value, what) => value === void 0 || value === null || value === "" ? void 0 : https3(value) ? value : { problem: `${what} is an https address` };
|
|
264878
264882
|
const avatar = pictureUrl(it2.avatar, "avatar");
|
|
264879
264883
|
if (avatar && typeof avatar === "object") return avatar;
|
|
264880
264884
|
const banner = pictureUrl(it2.banner, "banner");
|
|
264881
264885
|
if (banner && typeof banner === "object") return banner;
|
|
264882
|
-
const location = it2.location === void 0 || it2.location === null || it2.location === "" ? void 0 : oneLine2(it2.location,
|
|
264883
|
-
if (location === null) return { problem: `location is one line, up to ${
|
|
264884
|
-
const timezone = it2.timezone === void 0 || it2.timezone === null || it2.timezone === "" ? void 0 : oneLine2(it2.timezone,
|
|
264886
|
+
const location = it2.location === void 0 || it2.location === null || it2.location === "" ? void 0 : oneLine2(it2.location, L4.location);
|
|
264887
|
+
if (location === null) return { problem: `location is one line, up to ${L4.location} characters` };
|
|
264888
|
+
const timezone = it2.timezone === void 0 || it2.timezone === null || it2.timezone === "" ? void 0 : oneLine2(it2.timezone, L4.timezone);
|
|
264885
264889
|
if (timezone === null || timezone && !/^[A-Za-z_+\-\/0-9: ]{1,64}$/.test(timezone)) return { problem: "timezone is an IANA name, e.g. Europe/Ljubljana, or UTC+2" };
|
|
264886
264890
|
const when3 = (value) => typeof value === "string" && /^\d{4}(-(0[1-9]|1[0-2]))?$/.test(value);
|
|
264887
264891
|
const experience = [];
|
|
264888
264892
|
if (it2.experience !== void 0 && it2.experience !== null) {
|
|
264889
|
-
if (!Array.isArray(it2.experience) || it2.experience.length >
|
|
264893
|
+
if (!Array.isArray(it2.experience) || it2.experience.length > L4.experience) return { problem: `experience is up to ${L4.experience} rows` };
|
|
264890
264894
|
for (const [at, raw2] of it2.experience.entries()) {
|
|
264891
|
-
const title = oneLine2(raw2?.title,
|
|
264892
|
-
const org = oneLine2(raw2?.org,
|
|
264895
|
+
const title = oneLine2(raw2?.title, L4.title);
|
|
264896
|
+
const org = oneLine2(raw2?.org, L4.org);
|
|
264893
264897
|
if (!title || !org) return { problem: `experience row ${at + 1} needs a title and an org` };
|
|
264894
264898
|
if (!when3(raw2?.from)) return { problem: `experience row ${at + 1}: from is "YYYY" or "YYYY-MM"` };
|
|
264895
264899
|
if (!(raw2?.to === null || raw2?.to === void 0 || raw2?.to === "" || when3(raw2?.to))) return { problem: `experience row ${at + 1}: to is "YYYY", "YYYY-MM", or null for now` };
|
|
264896
|
-
const where2 = raw2?.where === void 0 || raw2?.where === null || raw2?.where === "" ? void 0 : oneLine2(raw2.where,
|
|
264900
|
+
const where2 = raw2?.where === void 0 || raw2?.where === null || raw2?.where === "" ? void 0 : oneLine2(raw2.where, L4.where);
|
|
264897
264901
|
if (where2 === null) return { problem: `experience row ${at + 1}: where is one line` };
|
|
264898
264902
|
let what;
|
|
264899
264903
|
if (raw2?.what !== void 0 && raw2?.what !== null && raw2?.what !== "") {
|
|
264900
|
-
if (typeof raw2.what !== "string" || raw2.what.length >
|
|
264904
|
+
if (typeof raw2.what !== "string" || raw2.what.length > L4.what) return { problem: `experience row ${at + 1}: what is up to ${L4.what} characters` };
|
|
264901
264905
|
what = raw2.what.replace(/\s+/g, " ").trim();
|
|
264902
264906
|
}
|
|
264903
264907
|
experience.push({ title, org, from: raw2.from, to: when3(raw2?.to) ? raw2.to : null, ...where2 ? { where: where2 } : {}, ...what ? { what } : {} });
|
|
264904
264908
|
}
|
|
264905
264909
|
}
|
|
264906
|
-
const
|
|
264910
|
+
const words4 = (value, max, each, what) => {
|
|
264907
264911
|
if (value === void 0 || value === null) return [];
|
|
264908
264912
|
if (!Array.isArray(value) || value.length > max) return { problem: `${what} is up to ${max} entries` };
|
|
264909
264913
|
const out = [];
|
|
@@ -264914,16 +264918,16 @@ function readHandProfile(raw) {
|
|
|
264914
264918
|
}
|
|
264915
264919
|
return [...new Set(out)];
|
|
264916
264920
|
};
|
|
264917
|
-
const skills =
|
|
264921
|
+
const skills = words4(it2.skills, L4.skills, L4.skill, "skills");
|
|
264918
264922
|
if (!Array.isArray(skills)) return skills;
|
|
264919
|
-
const languages =
|
|
264923
|
+
const languages = words4(it2.languages, L4.languages, L4.language, "languages");
|
|
264920
264924
|
if (!Array.isArray(languages)) return languages;
|
|
264921
264925
|
const education = [];
|
|
264922
264926
|
if (it2.education !== void 0 && it2.education !== null) {
|
|
264923
|
-
if (!Array.isArray(it2.education) || it2.education.length >
|
|
264927
|
+
if (!Array.isArray(it2.education) || it2.education.length > L4.education) return { problem: `education is up to ${L4.education} rows` };
|
|
264924
264928
|
for (const [at, raw2] of it2.education.entries()) {
|
|
264925
|
-
const title = oneLine2(raw2?.title,
|
|
264926
|
-
const org = oneLine2(raw2?.org,
|
|
264929
|
+
const title = oneLine2(raw2?.title, L4.title);
|
|
264930
|
+
const org = oneLine2(raw2?.org, L4.org);
|
|
264927
264931
|
if (!title || !org) return { problem: `education row ${at + 1} needs a title and an org` };
|
|
264928
264932
|
if (!(raw2?.year === void 0 || raw2?.year === null || raw2?.year === "" || typeof raw2?.year === "string" && /^\d{4}$/.test(raw2.year))) return { problem: `education row ${at + 1}: year is "YYYY"` };
|
|
264929
264933
|
education.push({ title, org, ...typeof raw2?.year === "string" && raw2.year ? { year: raw2.year } : {} });
|
|
@@ -264931,7 +264935,7 @@ function readHandProfile(raw) {
|
|
|
264931
264935
|
}
|
|
264932
264936
|
const blocks = [];
|
|
264933
264937
|
if (it2.blocks !== void 0 && it2.blocks !== null) {
|
|
264934
|
-
if (!Array.isArray(it2.blocks) || it2.blocks.length >
|
|
264938
|
+
if (!Array.isArray(it2.blocks) || it2.blocks.length > L4.blocks) return { problem: `blocks is up to ${L4.blocks}` };
|
|
264935
264939
|
for (const [at, raw2] of it2.blocks.entries()) {
|
|
264936
264940
|
const block2 = readHandBlock(raw2);
|
|
264937
264941
|
if ("problem" in block2) return { problem: `block ${at + 1}: ${block2.problem}` };
|
|
@@ -264968,39 +264972,39 @@ function readHandProfile(raw) {
|
|
|
264968
264972
|
function readHandBlock(raw) {
|
|
264969
264973
|
const it2 = raw;
|
|
264970
264974
|
if (!it2 || typeof it2 !== "object") return { problem: "a block is an object" };
|
|
264971
|
-
const
|
|
264975
|
+
const L4 = HAND_LIMITS;
|
|
264972
264976
|
switch (it2.kind) {
|
|
264973
264977
|
case "story": {
|
|
264974
|
-
if (!Array.isArray(it2.paragraphs) || it2.paragraphs.length === 0 || it2.paragraphs.length >
|
|
264978
|
+
if (!Array.isArray(it2.paragraphs) || it2.paragraphs.length === 0 || it2.paragraphs.length > L4.paragraphs) return { problem: `a story is 1 to ${L4.paragraphs} paragraphs` };
|
|
264975
264979
|
const paragraphs = [];
|
|
264976
264980
|
for (const one of it2.paragraphs) {
|
|
264977
|
-
const line2 = oneLine2(one,
|
|
264978
|
-
if (!line2) return { problem: `a paragraph is one line, up to ${
|
|
264981
|
+
const line2 = oneLine2(one, L4.paragraph);
|
|
264982
|
+
if (!line2) return { problem: `a paragraph is one line, up to ${L4.paragraph} characters` };
|
|
264979
264983
|
paragraphs.push(line2);
|
|
264980
264984
|
}
|
|
264981
264985
|
return { block: { kind: "story", paragraphs } };
|
|
264982
264986
|
}
|
|
264983
264987
|
case "pictures": {
|
|
264984
|
-
if (!Array.isArray(it2.items) || it2.items.length === 0 || it2.items.length >
|
|
264988
|
+
if (!Array.isArray(it2.items) || it2.items.length === 0 || it2.items.length > L4.items) return { problem: `pictures are 1 to ${L4.items}` };
|
|
264985
264989
|
const items = [];
|
|
264986
264990
|
for (const one of it2.items) {
|
|
264987
264991
|
if (!https3(one?.url)) return { problem: "a picture's url is an https address" };
|
|
264988
|
-
const alt = oneLine2(one?.alt,
|
|
264992
|
+
const alt = oneLine2(one?.alt, L4.alt);
|
|
264989
264993
|
if (!alt) return { problem: "a picture needs words (alt)" };
|
|
264990
|
-
const caption = one?.caption === void 0 || one?.caption === null || one?.caption === "" ? void 0 : oneLine2(one.caption,
|
|
264994
|
+
const caption = one?.caption === void 0 || one?.caption === null || one?.caption === "" ? void 0 : oneLine2(one.caption, L4.caption);
|
|
264991
264995
|
if (caption === null) return { problem: "a caption is one line" };
|
|
264992
264996
|
items.push({ url: one.url, alt, ...caption ? { caption } : {} });
|
|
264993
264997
|
}
|
|
264994
264998
|
return { block: { kind: "pictures", items } };
|
|
264995
264999
|
}
|
|
264996
265000
|
case "files": {
|
|
264997
|
-
if (!Array.isArray(it2.items) || it2.items.length === 0 || it2.items.length >
|
|
265001
|
+
if (!Array.isArray(it2.items) || it2.items.length === 0 || it2.items.length > L4.items) return { problem: `files are 1 to ${L4.items}` };
|
|
264998
265002
|
const items = [];
|
|
264999
265003
|
for (const one of it2.items) {
|
|
265000
265004
|
if (!https3(one?.url)) return { problem: "a file's url is an https address" };
|
|
265001
|
-
const name8 = oneLine2(one?.name,
|
|
265005
|
+
const name8 = oneLine2(one?.name, L4.fileName);
|
|
265002
265006
|
if (!name8) return { problem: "a file needs a name" };
|
|
265003
|
-
const note = one?.note === void 0 || one?.note === null || one?.note === "" ? void 0 : oneLine2(one.note,
|
|
265007
|
+
const note = one?.note === void 0 || one?.note === null || one?.note === "" ? void 0 : oneLine2(one.note, L4.note);
|
|
265004
265008
|
if (note === null) return { problem: "a file's note is one line" };
|
|
265005
265009
|
items.push({ url: one.url, name: name8, ...note ? { note } : {} });
|
|
265006
265010
|
}
|
|
@@ -265010,7 +265014,7 @@ function readHandBlock(raw) {
|
|
|
265010
265014
|
return { problem: 'kind is "story", "pictures" or "files"' };
|
|
265011
265015
|
}
|
|
265012
265016
|
}
|
|
265013
|
-
var HANDLE, RESERVED_HANDLES, HAND_LIMITS, DOES, RATE_UNITS, RATE_COINS, AVAILABILITY, oneLine2, https3;
|
|
265017
|
+
var HANDLE, RESERVED_HANDLES, HAND_LIMITS, DOES, RATE_UNITS, RATE_COINS, AVAILABILITY, oneLine2, https3, openToWork;
|
|
265014
265018
|
var init_inviteProof = __esm({
|
|
265015
265019
|
"../../packages/openhands-sdk/src/chain/inviteProof.ts"() {
|
|
265016
265020
|
"use strict";
|
|
@@ -265098,6 +265102,7 @@ var init_inviteProof = __esm({
|
|
|
265098
265102
|
return false;
|
|
265099
265103
|
}
|
|
265100
265104
|
};
|
|
265105
|
+
openToWork = (profile) => profile.invitable !== false && profile.availability === "open";
|
|
265101
265106
|
}
|
|
265102
265107
|
});
|
|
265103
265108
|
|
|
@@ -265105,6 +265110,7 @@ var init_inviteProof = __esm({
|
|
|
265105
265110
|
var invites_exports = {};
|
|
265106
265111
|
__export(invites_exports, {
|
|
265107
265112
|
NOT_KNOWN_YET: () => NOT_KNOWN_YET,
|
|
265113
|
+
NOT_VERIFIED: () => NOT_VERIFIED,
|
|
265108
265114
|
OFF_ROSTER: () => OFF_ROSTER,
|
|
265109
265115
|
TERMS_UNREAD: () => TERMS_UNREAD,
|
|
265110
265116
|
acceptInvitation: () => acceptInvitation,
|
|
@@ -265135,7 +265141,6 @@ __export(invites_exports, {
|
|
|
265135
265141
|
removePage: () => removePage,
|
|
265136
265142
|
revokeInvite: () => revokeInvite,
|
|
265137
265143
|
rowAnswerWords: () => rowAnswerWords,
|
|
265138
|
-
setMarketplacePage: () => setMarketplacePage,
|
|
265139
265144
|
setPage: () => setPage,
|
|
265140
265145
|
sharePage: () => sharePage,
|
|
265141
265146
|
standingWords: () => standingWords,
|
|
@@ -265143,10 +265148,10 @@ __export(invites_exports, {
|
|
|
265143
265148
|
writeInvites: () => writeInvites,
|
|
265144
265149
|
writeInvitesPatiently: () => writeInvitesPatiently
|
|
265145
265150
|
});
|
|
265146
|
-
function inviteItemsOf(
|
|
265151
|
+
function inviteItemsOf(words4) {
|
|
265147
265152
|
const items = [];
|
|
265148
265153
|
const problems = [];
|
|
265149
|
-
for (const raw of
|
|
265154
|
+
for (const raw of words4) {
|
|
265150
265155
|
const one = raw.trim();
|
|
265151
265156
|
if (one === "link") items.push({ link: true });
|
|
265152
265157
|
else if (/^ixo1[a-z0-9]{38}$/.test(one)) items.push({ address: one });
|
|
@@ -265337,8 +265342,8 @@ function standingWords(standing, context) {
|
|
|
265337
265342
|
function doorLine(collectionId, sources) {
|
|
265338
265343
|
const door2 = sources.worker ?? sources.draft ?? sources.terms ?? null;
|
|
265339
265344
|
if (!door2) return `#${collectionId} \xB7 who may enter is not known yet: the board has not read this ask's terms (it does within a minute of posting). The list below already gates; call again shortly.`;
|
|
265340
|
-
const
|
|
265341
|
-
return `#${collectionId} \xB7 ${
|
|
265345
|
+
const words4 = door2 === "invite" ? "by invitation" : door2 === "apply" ? "by application" : "open to anyone";
|
|
265346
|
+
return `#${collectionId} \xB7 ${words4}${!sources.worker && door2 !== "public" ? " (the board reads the terms within a minute; the list already gates)" : ""}`;
|
|
265342
265347
|
}
|
|
265343
265348
|
async function setPage(site, signer2, profile, fetchImpl) {
|
|
265344
265349
|
const owner = signer2.principal ?? signer2.address;
|
|
@@ -265352,14 +265357,6 @@ async function setPage(site, signer2, profile, fetchImpl) {
|
|
|
265352
265357
|
);
|
|
265353
265358
|
return answer.ok ? { handle: String(answer.body.handle), address: String(answer.body.address) } : { refused: refusalOf(answer) };
|
|
265354
265359
|
}
|
|
265355
|
-
async function setMarketplacePage(site, signer2, page, fetchImpl) {
|
|
265356
|
-
const body = { ...signer2.principal ? { onBehalfOf: signer2.principal } : {}, page };
|
|
265357
|
-
const message = await sponsorWords("page", signer2.address, body);
|
|
265358
|
-
const answer = await post(site, "/api/marketplaces/page", { address: signer2.address, ...body, proof: { kind: "adr36", message, ...await signWords(signer2.mnemonic, message) } }, fetchImpl);
|
|
265359
|
-
if (answer.ok && typeof answer.body.slug === "string") return { slug: answer.body.slug };
|
|
265360
|
-
if (answer.status === 404 && !answer.body.code) return { refused: "this site does not take Zone pages yet" };
|
|
265361
|
-
return { refused: refusalOf(answer), ...codeOf2(answer) ? { code: codeOf2(answer) } : {} };
|
|
265362
|
-
}
|
|
265363
265360
|
async function removePage(site, signer2, fetchImpl) {
|
|
265364
265361
|
const owner = signer2.principal ?? signer2.address;
|
|
265365
265362
|
const prefAt = Date.now();
|
|
@@ -265408,7 +265405,7 @@ function pageWords(page, site) {
|
|
|
265408
265405
|
page.linkedin ? `LinkedIn verified since ${page.linkedin.verifiedAt.slice(0, 10)}${page.linkedin.profileUrl ? ` \xB7 ${page.linkedin.profileUrl}` : ""}` : "Not LinkedIn verified yet",
|
|
265409
265406
|
page.linkedin?.credentialUrl ? `LinkedIn credential (it shows this account logged in to this LinkedIn account; any app can check it): ${page.linkedin.credentialUrl}${page.linkedin.verifyUrl ? ` \xB7 check it: ${page.linkedin.verifyUrl}` : ""}` : "",
|
|
265410
265407
|
`Address: ${page.address}${p.location ? ` \xB7 ${p.location}` : ""}${p.timezone ? ` (${p.timezone})` : ""}`,
|
|
265411
|
-
`Does: ${p.does.length ? p.does.join(", ") : "not said"} \xB7 Rate: ${rate} \xB7 Availability: ${p.availability} \xB7
|
|
265408
|
+
`Does: ${p.does.length ? p.does.join(", ") : "not said"} \xB7 Rate: ${rate} \xB7 Availability: ${p.availability} \xB7 Can be invited: ${openToWork(p) ? "yes" : "no, not taking work right now"}`,
|
|
265412
265409
|
p.listed === false ? "Private: not shown on asks.world or in search; only someone who types the exact handle or address can invite them." : "Public: shown on asks.world, anyone can find it.",
|
|
265413
265410
|
"Profile claims are supplied by the owner. Check what independent providers signed against your own requirements.",
|
|
265414
265411
|
...(p.verificationCredentials ?? []).map((one) => `Signed record cited (not verified): ${one.title} \xB7 ${one.issuerDid} \xB7 ${one.url}`),
|
|
@@ -265445,7 +265442,7 @@ async function linkedinStatus(site, id, fetchImpl = fetch) {
|
|
|
265445
265442
|
if (response.ok && typeof body.state === "string") return body;
|
|
265446
265443
|
return { refused: refusalOf({ status: response.status, body }) };
|
|
265447
265444
|
}
|
|
265448
|
-
var refusalOf, codeOf2, NOT_KNOWN_YET, TERMS_UNREAD, OFF_ROSTER, NO_ANSWER_MS, dayOf, acceptInvitation, declineInvitation, utc, rateWords;
|
|
265445
|
+
var refusalOf, codeOf2, NOT_KNOWN_YET, TERMS_UNREAD, OFF_ROSTER, NOT_VERIFIED, NO_ANSWER_MS, dayOf, acceptInvitation, declineInvitation, utc, rateWords;
|
|
265449
265446
|
var init_invites = __esm({
|
|
265450
265447
|
"src/invites.ts"() {
|
|
265451
265448
|
"use strict";
|
|
@@ -265457,7 +265454,8 @@ var init_invites = __esm({
|
|
|
265457
265454
|
codeOf2 = (answer) => typeof answer.body.code === "string" && answer.body.code ? answer.body.code : void 0;
|
|
265458
265455
|
NOT_KNOWN_YET = "unknown-collection";
|
|
265459
265456
|
TERMS_UNREAD = "terms-unread";
|
|
265460
|
-
OFF_ROSTER = /Only LinkedIn-verified pros can be invited to this pro ask/;
|
|
265457
|
+
OFF_ROSTER = /Only (?:LinkedIn-)?verified pros can be invited to (?:a|this) pro ask/;
|
|
265458
|
+
NOT_VERIFIED = "Only verified pros can be invited to a pro ask.";
|
|
265461
265459
|
NO_ANSWER_MS = 7 * 864e5;
|
|
265462
265460
|
dayOf = (iso) => {
|
|
265463
265461
|
const at = iso ? new Date(iso) : null;
|
|
@@ -266207,13 +266205,13 @@ function shortTitle(task, max = TITLE_MAX) {
|
|
|
266207
266205
|
return `${(space > max / 2 ? cut.slice(0, space) : cut).replace(/[\s,;:.-]+$/, "")}\u2026`;
|
|
266208
266206
|
}
|
|
266209
266207
|
function askHead(name8, task) {
|
|
266210
|
-
const
|
|
266208
|
+
const said4 = placeJoined((task ?? "").trim());
|
|
266211
266209
|
const named = (name8 ?? "").trim();
|
|
266212
|
-
if (!
|
|
266210
|
+
if (!said4 || said4 === named) return { title: null, task: null };
|
|
266213
266211
|
const stem = named.replace(/…$/, "").trimEnd();
|
|
266214
|
-
const cut = (named.endsWith("\u2026") || named.length >= 140) &&
|
|
266215
|
-
const heading = cut ? shortTitle(
|
|
266216
|
-
const rest = /[.?!]$/.test(heading) &&
|
|
266212
|
+
const cut = (named.endsWith("\u2026") || named.length >= 140) && said4.startsWith(stem);
|
|
266213
|
+
const heading = cut ? shortTitle(said4) : named;
|
|
266214
|
+
const rest = /[.?!]$/.test(heading) && said4.startsWith(heading) ? said4.slice(heading.length).trim() : said4;
|
|
266217
266215
|
return { title: cut ? heading : null, task: rest || null };
|
|
266218
266216
|
}
|
|
266219
266217
|
var TITLE_MAX, placeJoined;
|
|
@@ -266448,10 +266446,10 @@ function clean5(raw) {
|
|
|
266448
266446
|
return text4.length <= MAX_LENGTH ? text4 : `${text4.slice(0, MAX_LENGTH - 1).trimEnd()}\u2026`;
|
|
266449
266447
|
}
|
|
266450
266448
|
async function placeName(point, zoom, reach = {}) {
|
|
266451
|
-
const
|
|
266449
|
+
const call3 = reach.fetch ?? globalThis.fetch;
|
|
266452
266450
|
const url4 = `${ENDPOINT}?lat=${encodeURIComponent(point.lat)}&lon=${encodeURIComponent(point.lon)}&format=jsonv2&zoom=${encodeURIComponent(zoom)}`;
|
|
266453
266451
|
try {
|
|
266454
|
-
const response = await
|
|
266452
|
+
const response = await call3(url4, {
|
|
266455
266453
|
headers: { "user-agent": USER_AGENT, accept: "application/json" },
|
|
266456
266454
|
signal: AbortSignal.timeout(TIMEOUT_MS6)
|
|
266457
266455
|
});
|
|
@@ -266848,6 +266846,129 @@ var init_takeBack = __esm({
|
|
|
266848
266846
|
}
|
|
266849
266847
|
});
|
|
266850
266848
|
|
|
266849
|
+
// src/cashout.ts
|
|
266850
|
+
var cashout_exports = {};
|
|
266851
|
+
__export(cashout_exports, {
|
|
266852
|
+
cashOut: () => cashOut,
|
|
266853
|
+
cashOutStatus: () => cashOutStatus
|
|
266854
|
+
});
|
|
266855
|
+
async function call2(deps, path, body) {
|
|
266856
|
+
try {
|
|
266857
|
+
const response = await deps.fetch(`${deps.site.replace(/\/+$/, "")}${path}`, {
|
|
266858
|
+
method: body === void 0 ? "GET" : "POST",
|
|
266859
|
+
headers: { accept: "application/json", ...body === void 0 ? {} : { "content-type": "application/json" } },
|
|
266860
|
+
...body === void 0 ? {} : { body: JSON.stringify(body) },
|
|
266861
|
+
signal: AbortSignal.timeout(2e4)
|
|
266862
|
+
});
|
|
266863
|
+
return { status: response.status, body: await response.json().catch(() => ({})) ?? {} };
|
|
266864
|
+
} catch {
|
|
266865
|
+
return { status: 0, body: { error: "asks.world did not answer. Try again shortly." } };
|
|
266866
|
+
}
|
|
266867
|
+
}
|
|
266868
|
+
async function signedCall(deps, act, fields) {
|
|
266869
|
+
const full = { ...fields, ...deps.signer.principal ? { onBehalfOf: deps.signer.principal } : {} };
|
|
266870
|
+
const message = await cashoutWords(act, deps.signer.address, full);
|
|
266871
|
+
return call2(deps, `/api/cashout/${act}`, { address: deps.signer.address, ...full, proof: { kind: "adr36", message, ...await signWords(deps.signer.mnemonic, message) } });
|
|
266872
|
+
}
|
|
266873
|
+
async function cashOut(deps, input) {
|
|
266874
|
+
const person = deps.signer.principal ?? deps.signer.address;
|
|
266875
|
+
const [ready, payBase] = await Promise.all([signedCall(deps, "status", {}), deps.payBase(person)]);
|
|
266876
|
+
if (ready.status !== 200) return said3(ready);
|
|
266877
|
+
const kyc = ready.body.kyc;
|
|
266878
|
+
if (!ready.body.linkedin) return "Cash-out needs your LinkedIn connected first. Next: connect_linkedin (about a minute), then cash_out again.";
|
|
266879
|
+
const available = payBase / 1e6;
|
|
266880
|
+
if (available <= 0) return "You have no PAY to cash out yet.";
|
|
266881
|
+
const kycLine = kyc?.status === "verified" ? "" : kyc?.status === "expired" ? `Your identity check has expired. Renew it first: ${deps.site.replace(/\/+$/, "")}/me/identity` : `Cash-out needs an identity check. If you haven't done it yet, do it first: ${deps.site.replace(/\/+$/, "")}/me/identity`;
|
|
266882
|
+
if (kyc?.status === "expired") return kycLine;
|
|
266883
|
+
const country = input.country?.trim().toUpperCase();
|
|
266884
|
+
if (!country || !/^[A-Z]{2}$/.test(country)) return [`You have $${available.toFixed(2)} in PAY to cash out.`, kycLine, 'Which country are you in? (Ask the person; then call cash_out with country, like "NG" or "DE".)'].filter(Boolean).join("\n");
|
|
266885
|
+
const info = await call2(deps, `/api/cashout/info?country=${country}`);
|
|
266886
|
+
if (info.status !== 200) return said3(info);
|
|
266887
|
+
const methods = info.body.methods ?? [];
|
|
266888
|
+
const fee = info.body.fee;
|
|
266889
|
+
if (!methods.length) return `There's no way to cash out in ${country} yet.`;
|
|
266890
|
+
const chosen2 = methods.find((one) => one.method === input.method);
|
|
266891
|
+
if (!chosen2)
|
|
266892
|
+
return [
|
|
266893
|
+
`You have $${available.toFixed(2)} in PAY. Ways to get paid in ${country}:`,
|
|
266894
|
+
...methods.map((one) => `- ${WAYS[one.method] ?? one.method} (method "${one.method}"): $${one.minUsd} to $${one.maxUsd}`),
|
|
266895
|
+
`Fee: ${fee?.bps ? `${fee.bps / 100}%` : "none"}${fee?.minUsd && Number(fee.minUsd) > 0 ? `, at least $${fee.minUsd}` : ""}.`,
|
|
266896
|
+
kycLine,
|
|
266897
|
+
"(Ask which way and how much; then call cash_out with method and amount_usd.)"
|
|
266898
|
+
].filter(Boolean).join("\n");
|
|
266899
|
+
const amount3 = input.amount_usd?.trim().replace(/^\$/, "");
|
|
266900
|
+
if (!amount3 || !/^\d+(\.\d{1,2})?$/.test(amount3)) return `How much do you want to cash out? You have $${available.toFixed(2)}; this way takes $${chosen2.minUsd} to $${chosen2.maxUsd}. (Then call cash_out with amount_usd, like "25".)`;
|
|
266901
|
+
if (Number(amount3) > available) return `You have $${available.toFixed(2)} in PAY, less than $${amount3}. Pick a smaller amount.`;
|
|
266902
|
+
if (Number(amount3) < Number(chosen2.minUsd)) return `The smallest you can cash out this way is $${chosen2.minUsd}.`;
|
|
266903
|
+
if (Number(amount3) > Number(chosen2.maxUsd)) return `The largest you can cash out this way is $${chosen2.maxUsd}.`;
|
|
266904
|
+
const to = input.to?.trim();
|
|
266905
|
+
if (chosen2.fields.includes("address") && !(to && BASE_ADDRESS.test(to))) return "Which Base address should receive the USDC? (An 0x\u2026 address on Base; then call cash_out with to.)";
|
|
266906
|
+
const quote = await signedCall(deps, "quote", { method: chosen2.method, country, amountUsd: amount3 });
|
|
266907
|
+
if (quote.status !== 201) return said3(quote);
|
|
266908
|
+
const q = quote.body;
|
|
266909
|
+
const receive = `You'll receive $${q.receive?.amount ?? q.amountUsd}${q.receive?.currency && q.receive.currency !== "USD" ? ` in ${q.receive.currency}` : ""} (fee $${q.feeUsd ?? "0.00"}).`;
|
|
266910
|
+
const named = chosen2.fields.includes("accountHolder") ? NAME_LINE : "";
|
|
266911
|
+
if (!input.confirm) return [`Cash out $${q.amountUsd} by ${WAYS[chosen2.method] ?? chosen2.method}${to ? ` to ${to}` : ""}.`, receive, named, kycLine, "Nothing is sent yet. To go ahead, call cash_out again with the same answers and confirm: true."].filter(Boolean).join("\n");
|
|
266912
|
+
const link5 = new URL(`${deps.site.replace(/\/+$/, "")}/me/cash-out`);
|
|
266913
|
+
link5.searchParams.set("quote", String(q.quoteId));
|
|
266914
|
+
link5.searchParams.set("method", chosen2.method);
|
|
266915
|
+
link5.searchParams.set("amount", amount3);
|
|
266916
|
+
link5.searchParams.set("country", country);
|
|
266917
|
+
if (to) link5.searchParams.set("to", to);
|
|
266918
|
+
return [receive, named, `Open this and confirm with one tap: ${link5.toString()}`, "Your money leaves only when you confirm there. I signed nothing. (Later, cash_out_status with the id that page shows says where it stands.)"].filter(Boolean).join("\n");
|
|
266919
|
+
}
|
|
266920
|
+
async function cashOutStatus(deps, id) {
|
|
266921
|
+
const answer = await signedCall(deps, "status", { id });
|
|
266922
|
+
if (answer.status === 404) return `No cash-out "${id}" for you on this network.`;
|
|
266923
|
+
if (answer.status !== 200) return said3(answer);
|
|
266924
|
+
const v = answer.body;
|
|
266925
|
+
const lapsed = id.startsWith("cd_") && (v.state === "open" || v.state === "signing") && Date.parse(v.expiresAt ?? "") <= Date.now();
|
|
266926
|
+
const money2 = v.receive?.amount ? `$${v.receive.amount}${v.receive.currency && v.receive.currency !== "USD" ? ` ${v.receive.currency}` : ""}` : v.quote?.amountUsd ? `$${v.quote.amountUsd}` : "your cash-out";
|
|
266927
|
+
switch (lapsed ? "expired" : v.state) {
|
|
266928
|
+
case "open":
|
|
266929
|
+
case "signing":
|
|
266930
|
+
return `Not confirmed yet: open the confirm link and tap confirm (${money2}).`;
|
|
266931
|
+
case "sent":
|
|
266932
|
+
return "Confirmed. The payout is starting.";
|
|
266933
|
+
case "expired":
|
|
266934
|
+
case "failed":
|
|
266935
|
+
return "This cash-out expired before it was confirmed. Nothing was taken. Start a new one with cash_out.";
|
|
266936
|
+
case "converting":
|
|
266937
|
+
case "taking":
|
|
266938
|
+
case "paying":
|
|
266939
|
+
return `On its way: ${money2}.`;
|
|
266940
|
+
case "paid":
|
|
266941
|
+
return `Paid: ${money2}.`;
|
|
266942
|
+
case "needs_attention":
|
|
266943
|
+
return `Your payout didn't go through: ${v.reason ?? "the payout failed"}. Check your details or pick another way: ${v.fixUrl ?? ""}
|
|
266944
|
+
${NAME_LINE}`;
|
|
266945
|
+
case "not_converted":
|
|
266946
|
+
case "cancelled":
|
|
266947
|
+
return "This cash-out didn't go through, and nothing was taken.";
|
|
266948
|
+
case "refunded":
|
|
266949
|
+
return "Your PAY was sent back to you.";
|
|
266950
|
+
default:
|
|
266951
|
+
return `State: ${v.state ?? "unknown"}.`;
|
|
266952
|
+
}
|
|
266953
|
+
}
|
|
266954
|
+
var WAYS, BASE_ADDRESS, NAME_LINE, said3;
|
|
266955
|
+
var init_cashout = __esm({
|
|
266956
|
+
"src/cashout.ts"() {
|
|
266957
|
+
"use strict";
|
|
266958
|
+
init_accountProof();
|
|
266959
|
+
init_inviteProof();
|
|
266960
|
+
WAYS = {
|
|
266961
|
+
usdc_base: "USDC on Base (any country)",
|
|
266962
|
+
stripe_bank: "Bank account, through Stripe",
|
|
266963
|
+
yellowcard_bank: "Bank account, through Yellow Card",
|
|
266964
|
+
yellowcard_momo: "Mobile money, through Yellow Card"
|
|
266965
|
+
};
|
|
266966
|
+
BASE_ADDRESS = /^0x[0-9a-fA-F]{40}$/;
|
|
266967
|
+
NAME_LINE = "The payout account name must match the name on your ID.";
|
|
266968
|
+
said3 = (answer) => answer.status === 503 && answer.body.code === "not-open" ? "Cash-out isn't open on this network yet." : String(answer.body.error ?? `Cash-out refused this (${answer.status}).`);
|
|
266969
|
+
}
|
|
266970
|
+
});
|
|
266971
|
+
|
|
266851
266972
|
// src/pairing.ts
|
|
266852
266973
|
var pairing_exports = {};
|
|
266853
266974
|
__export(pairing_exports, {
|
|
@@ -266955,6 +267076,51 @@ var init_onAsks = __esm({
|
|
|
266955
267076
|
}
|
|
266956
267077
|
});
|
|
266957
267078
|
|
|
267079
|
+
// ../../app/lib/meRooms.ts
|
|
267080
|
+
var meRooms_exports = {};
|
|
267081
|
+
__export(meRooms_exports, {
|
|
267082
|
+
ROOMS: () => ROOMS,
|
|
267083
|
+
roomLines: () => roomLines,
|
|
267084
|
+
roomRows: () => roomRows
|
|
267085
|
+
});
|
|
267086
|
+
function roomRows(counts) {
|
|
267087
|
+
return ROOMS.map((room) => {
|
|
267088
|
+
switch (room.key) {
|
|
267089
|
+
case "page":
|
|
267090
|
+
return { ...room, figure: null, after: null, ...counts.page === "listed" ? { chip: "Listed" } : counts.page === "private" ? { chip: "Private" } : counts.page === "verify" ? { verify: true } : {} };
|
|
267091
|
+
case "work":
|
|
267092
|
+
return { ...room, ...counted(counts.work, "waiting") };
|
|
267093
|
+
case "messages":
|
|
267094
|
+
return { ...room, ...counted(counts.unread, "unread") };
|
|
267095
|
+
case "inbox":
|
|
267096
|
+
return { ...room, ...counted(counts.inbox, null) };
|
|
267097
|
+
case "money":
|
|
267098
|
+
return { ...room, figure: counts.money.available, money: true, after: counts.money.onAsks ? `${counts.money.onAsks} on asks` : null };
|
|
267099
|
+
case "agents":
|
|
267100
|
+
return { ...room, ...counted(counts.agents, null) };
|
|
267101
|
+
default:
|
|
267102
|
+
return { ...room, figure: null, after: null };
|
|
267103
|
+
}
|
|
267104
|
+
});
|
|
267105
|
+
}
|
|
267106
|
+
var ROOMS, counted, roomLines;
|
|
267107
|
+
var init_meRooms = __esm({
|
|
267108
|
+
"../../app/lib/meRooms.ts"() {
|
|
267109
|
+
"use strict";
|
|
267110
|
+
ROOMS = [
|
|
267111
|
+
{ key: "page", word: "Your page", href: "/me/page" },
|
|
267112
|
+
{ key: "work", word: "Work", href: "/me/work" },
|
|
267113
|
+
{ key: "messages", word: "Messages", href: "/me/messages" },
|
|
267114
|
+
{ key: "inbox", word: "Inbox", href: "/me/check" },
|
|
267115
|
+
{ key: "money", word: "Money", href: "/me/money" },
|
|
267116
|
+
{ key: "agents", word: "Agents", href: "/me/agents" },
|
|
267117
|
+
{ key: "settings", word: "Settings", href: "/me/settings" }
|
|
267118
|
+
];
|
|
267119
|
+
counted = (value, after) => value ? { figure: String(value), after } : { figure: null, after: null };
|
|
267120
|
+
roomLines = (counts) => roomRows(counts).map((row) => `${row.word}: ${row.chip ?? (row.verify ? "not verified yet" : [row.figure, row.after].filter(Boolean).join(row.money ? " \xB7 " : " ") || (row.key === "settings" ? "sign-in, recovery, currency, identity" : "nothing waiting"))}`);
|
|
267121
|
+
}
|
|
267122
|
+
});
|
|
267123
|
+
|
|
266958
267124
|
// src/verdictSource.ts
|
|
266959
267125
|
var verdictSource_exports = {};
|
|
266960
267126
|
__export(verdictSource_exports, {
|
|
@@ -267172,96 +267338,6 @@ var init_spot = __esm({
|
|
|
267172
267338
|
}
|
|
267173
267339
|
});
|
|
267174
267340
|
|
|
267175
|
-
// ../../packages/openhands-sdk/src/data/sponsors.ts
|
|
267176
|
-
var sponsors_exports = {};
|
|
267177
|
-
__export(sponsors_exports, {
|
|
267178
|
-
SPONSOR_METHOD_MAX: () => SPONSOR_METHOD_MAX,
|
|
267179
|
-
SPONSOR_PAGE_LIMITS: () => SPONSOR_PAGE_LIMITS,
|
|
267180
|
-
SPONSOR_SLUG: () => SPONSOR_SLUG,
|
|
267181
|
-
checkSponsorPage: () => checkSponsorPage,
|
|
267182
|
-
slugOf: () => slugOf,
|
|
267183
|
-
sponsorAccounts: () => sponsorAccounts,
|
|
267184
|
-
sponsorBlocks: () => sponsorBlocks,
|
|
267185
|
-
sponsorBySlug: () => sponsorBySlug,
|
|
267186
|
-
sponsorNode: () => sponsorNode,
|
|
267187
|
-
tidySponsorPage: () => tidySponsorPage
|
|
267188
|
-
});
|
|
267189
|
-
function checkSponsorPage(page) {
|
|
267190
|
-
if (!record2(page)) return "A page is its deck line, logo, cover, story, steps, pictures and links";
|
|
267191
|
-
const stray = Object.keys(page).find((key) => !PAGE_FIELDS.has(key));
|
|
267192
|
-
if (stray) return `A page has no "${stray.slice(0, 40)}"; it carries a deck line, logo, cover, story, steps, pictures and links`;
|
|
267193
|
-
return maybeWords(page.deck, SPONSOR_PAGE_LIMITS.deck, "The deck line") ?? (page.logo === void 0 ? null : typeof page.logo === "string" && isHttps2(page.logo) ? null : `The logo: "${String(page.logo).slice(0, 80)}" is not an https address`) ?? (page.cover === void 0 ? null : pictureOf(page.cover, "The cover")) ?? many(page.story, L4.paragraphs, "paragraphs", (one, index) => typeof one === "string" ? within(one, L4.paragraph, `Paragraph ${index + 1}`, true) : `Paragraph ${index + 1} is not words`) ?? many(page.steps, L4.steps, "steps", (one, index) => record2(one) ? words4(one.title, L4.stepTitle, `Step ${index + 1}'s title`) ?? maybeWords(one.text, L4.stepText, `Step ${index + 1}'s words`) : `Step ${index + 1} needs a title`) ?? many(page.pictures, L4.items, "pictures", (one, index) => pictureOf(one, `Picture ${index + 1}`)) ?? many(page.links, SPONSOR_PAGE_LIMITS.links, "links", (one, index) => {
|
|
267194
|
-
if (!record2(one) || typeof one.url !== "string") return `Link ${index + 1} needs an address and a name`;
|
|
267195
|
-
if (!isHttps2(one.url)) return `Link ${index + 1}: "${one.url.slice(0, 80)}" is not an https address`;
|
|
267196
|
-
return words4(one.name, L4.name, `Link ${index + 1}'s name`) ?? maybeWords(one.note, L4.note, `Link ${index + 1}'s note`);
|
|
267197
|
-
});
|
|
267198
|
-
}
|
|
267199
|
-
function tidySponsorPage(page) {
|
|
267200
|
-
const out = {};
|
|
267201
|
-
if (page.deck?.trim()) out.deck = oneLine(page.deck);
|
|
267202
|
-
if (page.logo?.trim()) out.logo = page.logo.trim();
|
|
267203
|
-
if (page.cover && (page.cover.url.trim() || page.cover.alt.trim())) out.cover = tidyPicture(page.cover);
|
|
267204
|
-
const story = (page.story ?? []).map((one) => one.trim()).filter(Boolean);
|
|
267205
|
-
if (story.length) out.story = story;
|
|
267206
|
-
const steps = (page.steps ?? []).filter((one) => one.title.trim() || one.text?.trim()).map((one) => ({ title: oneLine(one.title), ...one.text?.trim() ? { text: oneLine(one.text) } : {} }));
|
|
267207
|
-
if (steps.length) out.steps = steps;
|
|
267208
|
-
const pictures = (page.pictures ?? []).filter((one) => one.url.trim() || one.alt.trim()).map(tidyPicture);
|
|
267209
|
-
if (pictures.length) out.pictures = pictures;
|
|
267210
|
-
const links = (page.links ?? []).filter((one) => one.url.trim() || one.name.trim()).map((one) => ({ url: one.url.trim(), name: oneLine(one.name), ...one.note?.trim() ? { note: oneLine(one.note) } : {} }));
|
|
267211
|
-
if (links.length) out.links = links;
|
|
267212
|
-
return out;
|
|
267213
|
-
}
|
|
267214
|
-
function sponsorBlocks(page, name8) {
|
|
267215
|
-
const blocks = [];
|
|
267216
|
-
if (page.cover) blocks.push({ kind: "cover", ...tidyPicture(page.cover) });
|
|
267217
|
-
if (page.story?.length) blocks.push({ kind: "story", paragraphs: page.story });
|
|
267218
|
-
if (page.steps?.length) blocks.push({ kind: "diagram", title: `How ${name8} verifies`, steps: page.steps.map((one) => ({ title: oneLine(one.title), ...one.text ? { text: oneLine(one.text) } : {} })) });
|
|
267219
|
-
if (page.pictures?.length) blocks.push({ kind: "pictures", items: page.pictures.map(tidyPicture) });
|
|
267220
|
-
if (page.links?.length) blocks.push({ kind: "files", items: page.links.map((one) => ({ url: one.url, name: oneLine(one.name), ...one.note ? { note: oneLine(one.note) } : {} })) });
|
|
267221
|
-
return blocks;
|
|
267222
|
-
}
|
|
267223
|
-
var SPONSOR_METHOD_MAX, sponsorBySlug, SPONSOR_SLUG, slugOf, sponsorNode, sponsorAccounts, SPONSOR_PAGE_LIMITS, PAGE_FIELDS, L4, words4, maybeWords, record2, many, pictureOf, tidyPicture;
|
|
267224
|
-
var init_sponsors = __esm({
|
|
267225
|
-
"../../packages/openhands-sdk/src/data/sponsors.ts"() {
|
|
267226
|
-
"use strict";
|
|
267227
|
-
init_entityShape();
|
|
267228
|
-
init_env();
|
|
267229
|
-
init_callChecks();
|
|
267230
|
-
init_callLimits();
|
|
267231
|
-
SPONSOR_METHOD_MAX = 600;
|
|
267232
|
-
sponsorBySlug = (list7, slug) => list7.find((s) => s.slug === slug) ?? null;
|
|
267233
|
-
SPONSOR_SLUG = /^[a-z][a-z0-9-]{2,39}$/;
|
|
267234
|
-
slugOf = (org) => org.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 40).replace(/-+$/, "");
|
|
267235
|
-
sponsorNode = (sponsor, network2) => {
|
|
267236
|
-
if (sponsor.state !== "approved") return null;
|
|
267237
|
-
const own2 = sponsor.node[network2];
|
|
267238
|
-
return isEntityDid(own2) ? own2 : chainEndpointsFor(network2)?.relayerNodeDid ?? null;
|
|
267239
|
-
};
|
|
267240
|
-
sponsorAccounts = (list7) => new Set(list7.filter((s) => s.state === "approved").map((s) => s.account));
|
|
267241
|
-
SPONSOR_PAGE_LIMITS = { deck: 120, links: 6 };
|
|
267242
|
-
PAGE_FIELDS = /* @__PURE__ */ new Set(["deck", "logo", "cover", "story", "steps", "pictures", "links"]);
|
|
267243
|
-
L4 = CALL_LIMITS;
|
|
267244
|
-
words4 = (value, max, what) => typeof value === "string" ? within(oneLine(value), max, what) : `${what} is not words`;
|
|
267245
|
-
maybeWords = (value, max, what) => value === void 0 ? null : words4(value, max, what);
|
|
267246
|
-
record2 = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
267247
|
-
many = (value, max, what, each) => {
|
|
267248
|
-
if (value === void 0) return null;
|
|
267249
|
-
if (!Array.isArray(value)) return `The ${what} are not a list`;
|
|
267250
|
-
if (value.length > max) return `${value.length} ${what}; the most is ${max}`;
|
|
267251
|
-
for (const [index, one] of value.entries()) {
|
|
267252
|
-
const problem = each(one, index);
|
|
267253
|
-
if (problem) return problem;
|
|
267254
|
-
}
|
|
267255
|
-
return null;
|
|
267256
|
-
};
|
|
267257
|
-
pictureOf = (one, what) => {
|
|
267258
|
-
if (!record2(one) || typeof one.url !== "string" || typeof one.alt !== "string" || one.caption !== void 0 && typeof one.caption !== "string") return `${what} needs an address and words for it`;
|
|
267259
|
-
return picture({ url: one.url, alt: one.alt, ...one.caption === void 0 ? {} : { caption: one.caption } }, what);
|
|
267260
|
-
};
|
|
267261
|
-
tidyPicture = (one) => ({ url: one.url.trim(), alt: oneLine(one.alt), ...one.caption?.trim() ? { caption: oneLine(one.caption) } : {} });
|
|
267262
|
-
}
|
|
267263
|
-
});
|
|
267264
|
-
|
|
267265
267341
|
// ../../app/lib/floor.ts
|
|
267266
267342
|
var TRACE_URL, MONTHS, dayOf2;
|
|
267267
267343
|
var init_floor = __esm({
|
|
@@ -267273,64 +267349,26 @@ var init_floor = __esm({
|
|
|
267273
267349
|
}
|
|
267274
267350
|
});
|
|
267275
267351
|
|
|
267276
|
-
// src/
|
|
267277
|
-
var
|
|
267278
|
-
__export(
|
|
267352
|
+
// src/pros.ts
|
|
267353
|
+
var pros_exports = {};
|
|
267354
|
+
__export(pros_exports, {
|
|
267279
267355
|
FIND_PRO_MAX: () => FIND_PRO_MAX,
|
|
267280
|
-
|
|
267356
|
+
PRIVATE_LINE: () => PRIVATE_LINE,
|
|
267281
267357
|
linkedinWords: () => linkedinWords2,
|
|
267282
|
-
marketplaceChoices: () => marketplaceChoices,
|
|
267283
|
-
marketplacePageWords: () => marketplacePageWords,
|
|
267284
|
-
marketplacesWords: () => marketplacesWords,
|
|
267285
|
-
notAMarketplace: () => notAMarketplace,
|
|
267286
267358
|
proWords: () => proWords,
|
|
267359
|
+
prosWords: () => prosWords,
|
|
267287
267360
|
readDirectory: () => readDirectory,
|
|
267288
|
-
|
|
267289
|
-
|
|
267290
|
-
readMarketplaces: () => readMarketplaces,
|
|
267291
|
-
resolveMarketplace: () => resolveMarketplace,
|
|
267292
|
-
rosterOf: () => rosterOf,
|
|
267293
|
-
rosterWords: () => rosterWords
|
|
267294
|
-
});
|
|
267295
|
-
async function readMarketplaces(site, fetchImpl = fetch) {
|
|
267296
|
-
const response = await get2(site, "/api/marketplaces", fetchImpl);
|
|
267297
|
-
if (!response?.ok) return { unavailable: REGISTRY_DOWN };
|
|
267298
|
-
const body = await response.json().catch(() => null);
|
|
267299
|
-
return Array.isArray(body?.sponsors) ? { sponsors: body.sponsors.filter(isSponsor) } : { unavailable: REGISTRY_DOWN };
|
|
267300
|
-
}
|
|
267301
|
-
async function readMarketplace(site, slug, fetchImpl = fetch) {
|
|
267302
|
-
const response = await get2(site, `/api/marketplaces/${encodeURIComponent(slug)}`, fetchImpl);
|
|
267303
|
-
const body = await response?.json().catch(() => null);
|
|
267304
|
-
if (response?.ok && isSponsor(body?.sponsor)) return { sponsor: body.sponsor, counts: typeof body.counts?.checked === "number" ? { checked: body.counts.checked } : null };
|
|
267305
|
-
if (response?.status === 404 && body?.code === "no-sponsor") return { missing: true };
|
|
267306
|
-
return { unavailable: REGISTRY_DOWN };
|
|
267307
|
-
}
|
|
267308
|
-
async function readMarketplacePage(site, slug, fetchImpl = fetch) {
|
|
267309
|
-
const response = await get2(site, `/api/marketplaces/${encodeURIComponent(slug)}`, fetchImpl);
|
|
267310
|
-
if (!response?.ok) return null;
|
|
267311
|
-
const body = await response.json().catch(() => null);
|
|
267312
|
-
const page = body?.page?.page;
|
|
267313
|
-
return page && typeof page === "object" && !Array.isArray(page) ? page : null;
|
|
267314
|
-
}
|
|
267315
|
-
async function resolveMarketplace(site, slug, network2, fetchImpl = fetch) {
|
|
267316
|
-
const one = await readMarketplace(site, slug, fetchImpl);
|
|
267317
|
-
if ("unavailable" in one) return { refused: `${REGISTRY_DOWN}, so the Zone "${slug}" cannot be confirmed. Try again in a minute.`, unavailable: true };
|
|
267318
|
-
if ("missing" in one) return { refused: notAMarketplace(slug) };
|
|
267319
|
-
const { sponsor } = one;
|
|
267320
|
-
if (sponsor.state !== "approved") return { refused: `${sponsor.name} is paused: it takes no new pro Asks right now.` };
|
|
267321
|
-
const node = sponsorNode(sponsor, network2);
|
|
267322
|
-
if (!node) return { refused: `${sponsor.name} cannot take pro Asks here yet: it has not set up where its share is paid on this network.` };
|
|
267323
|
-
return { sponsor: { slug: sponsor.slug, name: sponsor.name, node }, account: sponsor.account };
|
|
267324
|
-
}
|
|
267361
|
+
verifiedOf: () => verifiedOf
|
|
267362
|
+
});
|
|
267325
267363
|
async function readDirectory(site, q, fetchImpl = fetch) {
|
|
267326
267364
|
const query = new URLSearchParams({ limit: "100" });
|
|
267327
267365
|
if (q?.trim()) query.set("q", q.trim().slice(0, 60));
|
|
267328
|
-
const response = await
|
|
267366
|
+
const response = await fetchImpl(`${base5(site)}/api/hands?${query}`, { headers: { accept: "application/json" }, signal: AbortSignal.timeout(15e3) }).catch(() => null);
|
|
267329
267367
|
if (!response?.ok) return null;
|
|
267330
267368
|
const body = await response.json().catch(() => null);
|
|
267331
267369
|
return Array.isArray(body?.hands) ? body.hands.filter((one) => typeof one?.address === "string" && typeof one?.profile?.handle === "string") : null;
|
|
267332
267370
|
}
|
|
267333
|
-
function
|
|
267371
|
+
function verifiedOf(rows2, options = {}) {
|
|
267334
267372
|
const out = [];
|
|
267335
267373
|
for (const row of rows2) {
|
|
267336
267374
|
if (!row.linkedin?.verifiedAt) continue;
|
|
@@ -267348,81 +267386,34 @@ function proWords(one, site, index) {
|
|
|
267348
267386
|
` Page and record: ${proPage(site, p.handle)}`
|
|
267349
267387
|
].join("\n");
|
|
267350
267388
|
}
|
|
267351
|
-
function
|
|
267352
|
-
const whose2 = ctx.marketplace ? `${ctx.marketplace}'s roster` : "a Zone's roster";
|
|
267389
|
+
function prosWords(found, ctx) {
|
|
267353
267390
|
const narrowed = [ctx.q ? `for "${ctx.q}"` : "", ctx.available ? "open to work now" : ""].filter(Boolean).join(", ");
|
|
267354
267391
|
const shown2 = found.slice(0, FIND_PRO_MAX);
|
|
267355
267392
|
if (shown2.length === 0)
|
|
267356
|
-
return
|
|
267393
|
+
return `${narrowed ? `Nobody matches ${narrowed}. Widen q, or leave available out, and ask again.` : "No pros listed yet."} Nothing ranks pros here. ${PRIVATE_LINE}`;
|
|
267357
267394
|
const lines2 = [
|
|
267358
|
-
`
|
|
267395
|
+
`Verified pros${narrowed ? `, ${narrowed}` : ""}: ${shown2.length} of ${found.length}, newest verification first. Nothing ranks them: the order is the date each was verified, and the person chooses.`,
|
|
267359
267396
|
"",
|
|
267360
267397
|
asData("pros", shown2.map((one, index) => proWords(one, ctx.site, index)).join("\n\n")),
|
|
267361
267398
|
""
|
|
267362
267399
|
];
|
|
267363
267400
|
if (shown2.length < 3) lines2.push(`Only ${shown2.length} ${shown2.length === 1 ? "matches" : "match"}; wider words find more.`);
|
|
267401
|
+
lines2.push(PRIVATE_LINE);
|
|
267364
267402
|
lines2.push(`Show these to the person and let them choose. Then invite_to_call with the pro ask's slug (or its number) and invite: ["@handle", \u2026]; each one invited reads the pro ask with read_ask.`);
|
|
267365
267403
|
return lines2.join("\n");
|
|
267366
267404
|
}
|
|
267367
|
-
|
|
267368
|
-
|
|
267369
|
-
|
|
267370
|
-
`Zones on asks.world: ${rows2.length}. A pro ask names one: the pros invited are LinkedIn verified, and it earns the Zone's share of each approved report. The order is when each was approved; nothing ranks them.`,
|
|
267371
|
-
"",
|
|
267372
|
-
...rows2.flatMap((one, index) => [
|
|
267373
|
-
`${index + 1}. ${one.sponsor.name} \xB7 sponsor: "${one.sponsor.slug}" \xB7 since ${dayOf2(new Date(one.sponsor.since))}`,
|
|
267374
|
-
` Pros on its roster: ${one.roster === null ? "not answering right now" : `${one.roster}, LinkedIn verified`}`,
|
|
267375
|
-
` Its page: ${marketplacePage(site, one.sponsor.slug)}`,
|
|
267376
|
-
asData("marketplace", `What ${one.sponsor.name} verifies, in its words: ${one.sponsor.method}`),
|
|
267377
|
-
""
|
|
267378
|
-
]),
|
|
267379
|
-
'Draft a pro ask through one: draft_call with kind: "review" and sponsor: "<slug>". Suggest pros from its roster: find_pro with sponsor: "<slug>". A pro gets on every roster with connect_linkedin.'
|
|
267380
|
-
].join("\n");
|
|
267381
|
-
}
|
|
267382
|
-
function marketplacePageWords(sponsor, page, site, before = null) {
|
|
267383
|
-
const picture2 = (one) => `${one.url} \u2014 ${one.alt}${one.caption ? ` (${one.caption})` : ""}`;
|
|
267384
|
-
const theirs = [
|
|
267385
|
-
page.deck ? `Under it: ${page.deck}` : "",
|
|
267386
|
-
page.logo ? `Logo: ${page.logo}` : "",
|
|
267387
|
-
page.cover ? `Cover: ${picture2(page.cover)}` : "",
|
|
267388
|
-
...page.story?.length ? ["Story:", ...page.story.map((one, index) => ` ${index + 1}. ${one}`)] : [],
|
|
267389
|
-
...page.steps?.length ? [`How ${sponsor.name} verifies:`, ...page.steps.map((one, index) => ` ${index + 1}. ${one.title}${one.text ? ` \u2014 ${one.text}` : ""}`)] : [],
|
|
267390
|
-
...page.pictures?.length ? ["Pictures:", ...page.pictures.map((one, index) => ` ${index + 1}. ${picture2(one)}`)] : [],
|
|
267391
|
-
...page.links?.length ? ["Links:", ...page.links.map((one, index) => ` ${index + 1}. ${one.name} \u2014 ${one.url}${one.note ? ` (${one.note})` : ""}`)] : []
|
|
267392
|
-
].filter(Boolean);
|
|
267393
|
-
const gone = before ? Object.keys(PAGE_PARTS).filter((key) => before[key] !== void 0 && page[key] === void 0).map((key) => PAGE_PARTS[key]) : [];
|
|
267394
|
-
return [
|
|
267395
|
-
`${sponsor.name}'s page, as ${marketplacePage(site, sponsor.slug)} will show it:`,
|
|
267396
|
-
"",
|
|
267397
|
-
`${sponsor.name} stands behind these professionals. (ours: every Zone's page opens with it)`,
|
|
267398
|
-
...theirs.length ? theirs : ["(nothing of its own: the page draws from the list of Zones alone)"],
|
|
267399
|
-
"Around it, the same on every Zone's page and not changed here: the pros it verified, its numbers and the deal.",
|
|
267400
|
-
"",
|
|
267401
|
-
`This replaces the page whole.${gone.length ? ` Taken off: ${gone.join(", ")}.` : ""} Pictures and the logo are read from their addresses each time the page is read, so a changed file changes the page.`
|
|
267402
|
-
].join("\n");
|
|
267403
|
-
}
|
|
267404
|
-
var REGISTRY_DOWN, FIND_PRO_MAX, base5, timeout2, get2, isSponsor, notAMarketplace, marketplaceChoices, linkedinWords2, PAGE_PARTS;
|
|
267405
|
-
var init_marketplaces = __esm({
|
|
267406
|
-
"src/marketplaces.ts"() {
|
|
267405
|
+
var FIND_PRO_MAX, base5, linkedinWords2, PRIVATE_LINE;
|
|
267406
|
+
var init_pros = __esm({
|
|
267407
|
+
"src/pros.ts"() {
|
|
267407
267408
|
"use strict";
|
|
267408
|
-
init_sponsors();
|
|
267409
267409
|
init_floor();
|
|
267410
267410
|
init_invites();
|
|
267411
267411
|
init_safety();
|
|
267412
267412
|
init_world();
|
|
267413
|
-
REGISTRY_DOWN = "The Zones list is not answering right now";
|
|
267414
267413
|
FIND_PRO_MAX = 5;
|
|
267415
267414
|
base5 = (site) => site.replace(/\/+$/, "");
|
|
267416
|
-
timeout2 = () => AbortSignal.timeout(15e3);
|
|
267417
|
-
get2 = (site, path, fetchImpl) => fetchImpl(`${base5(site)}${path}`, { headers: { accept: "application/json" }, signal: timeout2() }).catch(() => null);
|
|
267418
|
-
isSponsor = (one) => {
|
|
267419
|
-
const row = one;
|
|
267420
|
-
return Boolean(row) && typeof row.slug === "string" && typeof row.name === "string" && typeof row.account === "string" && typeof row.state === "string" && typeof row.node === "object" && row.node !== null;
|
|
267421
|
-
};
|
|
267422
|
-
notAMarketplace = (slug) => `"${slug}" is not a Zone on asks.world: list_marketplaces names them.`;
|
|
267423
|
-
marketplaceChoices = (list7) => list7.map((one) => `${one.name} (sponsor: "${one.slug}")`).join("; ");
|
|
267424
267415
|
linkedinWords2 = (badge) => `LinkedIn verified \xB7 ${dayOf2(new Date(badge.verifiedAt))}${badge.profileUrl ? ` \xB7 ${badge.profileUrl}` : ""}`;
|
|
267425
|
-
|
|
267416
|
+
PRIVATE_LINE = "A private pro is in no list: any verified pro can be invited by their exact @handle or ixo1 address.";
|
|
267426
267417
|
}
|
|
267427
267418
|
});
|
|
267428
267419
|
|
|
@@ -267458,8 +267449,8 @@ var init_marketPlan = __esm({
|
|
|
267458
267449
|
return match6 ? match6[1] : null;
|
|
267459
267450
|
};
|
|
267460
267451
|
planSlug = (text4, suffix = "") => {
|
|
267461
|
-
const
|
|
267462
|
-
const start =
|
|
267452
|
+
const words4 = text4.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
267453
|
+
const start = words4.replace(/^[^a-z]+/, "") || "plan";
|
|
267463
267454
|
const tail = suffix ? `-${suffix}` : "";
|
|
267464
267455
|
const room = 40 - tail.length;
|
|
267465
267456
|
const body = start.slice(0, room).replace(/-+$/, "");
|
|
@@ -267652,43 +267643,43 @@ ${where2}`)) {
|
|
|
267652
267643
|
askAt = (place) => ` At ${place.name}.`;
|
|
267653
267644
|
askOverrun = (check2, place) => Math.max(0, askWords(check2).length + askAt(place).length - PLAN_LIMITS.textMax);
|
|
267654
267645
|
shapeOfCheck = (check2) => {
|
|
267655
|
-
const
|
|
267646
|
+
const L4 = PLAN_LIMITS;
|
|
267656
267647
|
const out = [];
|
|
267657
267648
|
const bad = (why) => out.push({ rule: "shape", check: check2.id, why });
|
|
267658
267649
|
if (!PLAN_ACTS.includes(check2.act)) bad(`The act must be one of ${PLAN_ACTS.join(", ")}.`);
|
|
267659
267650
|
const text4 = check2.text.trim();
|
|
267660
|
-
if (text4.length <
|
|
267651
|
+
if (text4.length < L4.textMin || text4.length > L4.textMax) bad(`The check's words must be ${L4.textMin} to ${L4.textMax} characters.`);
|
|
267661
267652
|
else {
|
|
267662
267653
|
const named = check2.places.filter((place) => place.name?.trim());
|
|
267663
267654
|
const worst = named.reduce((most2, place) => !most2 || askOverrun(check2, place) > askOverrun(check2, most2) ? place : most2, null);
|
|
267664
267655
|
const over = worst ? askOverrun(check2, worst) : 0;
|
|
267665
267656
|
if (worst && over > 0) {
|
|
267666
|
-
bad(`Each ask adds "${askAt(worst).trim()}" after the words, which takes them ${over} characters past the ${
|
|
267657
|
+
bad(`Each ask adds "${askAt(worst).trim()}" after the words, which takes them ${over} characters past the ${L4.textMax} an ask carries. Cut ${over} characters from the words, or shorten that place's name.`);
|
|
267667
267658
|
}
|
|
267668
267659
|
}
|
|
267669
267660
|
if (!check2.places.length) bad("A check needs at least one place.");
|
|
267670
|
-
if (check2.places.length >
|
|
267661
|
+
if (check2.places.length > L4.placesPerCheck) bad(`A check holds at most ${L4.placesPerCheck} places.`);
|
|
267671
267662
|
for (const place of check2.places) {
|
|
267672
267663
|
if (!place.name?.trim()) bad("Every place needs a name a person recognises.");
|
|
267673
267664
|
if (!(Math.abs(place.lat) <= 90) || !(Math.abs(place.lon) <= 180) || place.lat === 0 && place.lon === 0) bad(`"${place.name}" has no usable coordinates.`);
|
|
267674
|
-
if (!(place.withinM >=
|
|
267665
|
+
if (!(place.withinM >= L4.withinMin && place.withinM <= L4.withinMax)) bad(`"${place.name}": the distance must be ${L4.withinMin} to ${L4.withinMax} m.`);
|
|
267675
267666
|
}
|
|
267676
|
-
const most = check2.act === "survey" ?
|
|
267667
|
+
const most = check2.act === "survey" ? L4.surveyPerPlace : L4.perPlace;
|
|
267677
267668
|
if (!Number.isInteger(check2.perPlace) || check2.perPlace < 1 || check2.perPlace > most) bad(`Answers per place must be a whole number from 1 to ${most}.`);
|
|
267678
267669
|
if (check2.act === "survey") {
|
|
267679
267670
|
const problem = surveyOptionsProblem(check2.options);
|
|
267680
267671
|
if (problem) bad(problem);
|
|
267681
267672
|
} else if (check2.options !== void 0) bad("Only a survey has options.");
|
|
267682
267673
|
for (const [name8, line2] of [["why", check2.why], ["how it is read", check2.readAs]]) {
|
|
267683
|
-
if (line2 !== void 0 && (line2.trim().length <
|
|
267674
|
+
if (line2 !== void 0 && (line2.trim().length < L4.lineMin || line2.trim().length > L4.lineMax)) bad(`The check's ${name8} line is ${L4.lineMin} to ${L4.lineMax} characters.`);
|
|
267684
267675
|
}
|
|
267685
|
-
if (!(check2.payUsd >=
|
|
267686
|
-
if (!(check2.hours >=
|
|
267687
|
-
if (check2.beats.trim().length >
|
|
267676
|
+
if (!(check2.payUsd >= L4.payFloorUsd)) bad(`The pay must be at least $${L4.payFloorUsd.toFixed(2)} an answer.`);
|
|
267677
|
+
if (!(check2.hours >= L4.hoursMin && check2.hours <= L4.hoursMax)) bad(`A check stays open ${L4.hoursMin} to ${L4.hoursMax} hours.`);
|
|
267678
|
+
if (check2.beats.trim().length > L4.lineMax) bad(`What the check beats fits in ${L4.lineMax} characters.`);
|
|
267688
267679
|
return out;
|
|
267689
267680
|
};
|
|
267690
267681
|
validatePlan = (plan) => {
|
|
267691
|
-
const
|
|
267682
|
+
const L4 = PLAN_LIMITS;
|
|
267692
267683
|
const refusals = [...screenMarket(plan.market)];
|
|
267693
267684
|
const shape = (why) => refusals.push({ rule: "shape", check: null, why });
|
|
267694
267685
|
if (plan.kind !== MARKET_PLAN_KIND || plan.v !== 1) shape("This is not a version 1 plan.");
|
|
@@ -267696,15 +267687,15 @@ ${where2}`)) {
|
|
|
267696
267687
|
if (!/^https?:\/\//.test(plan.market.url)) shape("The market needs its link.");
|
|
267697
267688
|
if (plan.market.question.trim().length < 8) shape("The market needs its question.");
|
|
267698
267689
|
if (!plan.checks.length) shape("A plan needs at least one check.");
|
|
267699
|
-
if (plan.checks.length >
|
|
267700
|
-
if (planAskCount(plan) >
|
|
267690
|
+
if (plan.checks.length > L4.checks) shape(`A plan holds at most ${L4.checks} checks.`);
|
|
267691
|
+
if (planAskCount(plan) > L4.asksPerPlan) shape(`A plan posts at most ${L4.asksPerPlan} Asks (one per place per check).`);
|
|
267701
267692
|
const ids = /* @__PURE__ */ new Set();
|
|
267702
267693
|
for (const check2 of plan.checks) {
|
|
267703
267694
|
if (ids.has(check2.id)) shape(`Two checks share the id ${check2.id}.`);
|
|
267704
267695
|
ids.add(check2.id);
|
|
267705
267696
|
}
|
|
267706
|
-
if (plan.thesis !== void 0 && (plan.thesis.trim().length <
|
|
267707
|
-
if (plan.cannotTell.trim().length <
|
|
267697
|
+
if (plan.thesis !== void 0 && (plan.thesis.trim().length < L4.lineMin || plan.thesis.trim().length > L4.thesisMax)) shape(`The thesis is ${L4.lineMin} to ${L4.thesisMax} characters.`);
|
|
267698
|
+
if (plan.cannotTell.trim().length < L4.lineMin) {
|
|
267708
267699
|
refusals.push({ rule: "no-cannot-tell", check: null, why: "Say what this plan cannot tell the trader. A plan without its limit reads as a promise." });
|
|
267709
267700
|
}
|
|
267710
267701
|
for (const check2 of plan.checks) refusals.push(...shapeOfCheck(check2), ...screenCheck(check2));
|
|
@@ -272809,12 +272800,12 @@ function az_default() {
|
|
|
272809
272800
|
}
|
|
272810
272801
|
|
|
272811
272802
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/be.js
|
|
272812
|
-
function getBelarusianPlural(count2, one, few,
|
|
272803
|
+
function getBelarusianPlural(count2, one, few, many) {
|
|
272813
272804
|
const absCount = Math.abs(count2);
|
|
272814
272805
|
const lastDigit = absCount % 10;
|
|
272815
272806
|
const lastTwoDigits = absCount % 100;
|
|
272816
272807
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
272817
|
-
return
|
|
272808
|
+
return many;
|
|
272818
272809
|
}
|
|
272819
272810
|
if (lastDigit === 1) {
|
|
272820
272811
|
return one;
|
|
@@ -272822,7 +272813,7 @@ function getBelarusianPlural(count2, one, few, many2) {
|
|
|
272822
272813
|
if (lastDigit >= 2 && lastDigit <= 4) {
|
|
272823
272814
|
return few;
|
|
272824
272815
|
}
|
|
272825
|
-
return
|
|
272816
|
+
return many;
|
|
272826
272817
|
}
|
|
272827
272818
|
var error3 = () => {
|
|
272828
272819
|
const Sizable = {
|
|
@@ -274888,8 +274879,8 @@ function hu_default() {
|
|
|
274888
274879
|
}
|
|
274889
274880
|
|
|
274890
274881
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/hy.js
|
|
274891
|
-
function getArmenianPlural(count2, one,
|
|
274892
|
-
return Math.abs(count2) === 1 ? one :
|
|
274882
|
+
function getArmenianPlural(count2, one, many) {
|
|
274883
|
+
return Math.abs(count2) === 1 ? one : many;
|
|
274893
274884
|
}
|
|
274894
274885
|
function withDefiniteArticle(word) {
|
|
274895
274886
|
if (!word)
|
|
@@ -277017,12 +277008,12 @@ function ro_default() {
|
|
|
277017
277008
|
}
|
|
277018
277009
|
|
|
277019
277010
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/locales/ru.js
|
|
277020
|
-
function getRussianPlural(count2, one, few,
|
|
277011
|
+
function getRussianPlural(count2, one, few, many) {
|
|
277021
277012
|
const absCount = Math.abs(count2);
|
|
277022
277013
|
const lastDigit = absCount % 10;
|
|
277023
277014
|
const lastTwoDigits = absCount % 100;
|
|
277024
277015
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
277025
|
-
return
|
|
277016
|
+
return many;
|
|
277026
277017
|
}
|
|
277027
277018
|
if (lastDigit === 1) {
|
|
277028
277019
|
return one;
|
|
@@ -277030,7 +277021,7 @@ function getRussianPlural(count2, one, few, many2) {
|
|
|
277030
277021
|
if (lastDigit >= 2 && lastDigit <= 4) {
|
|
277031
277022
|
return few;
|
|
277032
277023
|
}
|
|
277033
|
-
return
|
|
277024
|
+
return many;
|
|
277034
277025
|
}
|
|
277035
277026
|
var error38 = () => {
|
|
277036
277027
|
const Sizable = {
|
|
@@ -289873,11 +289864,11 @@ var Protocol = class {
|
|
|
289873
289864
|
const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
|
|
289874
289865
|
controller?.abort(notification.params.reason);
|
|
289875
289866
|
}
|
|
289876
|
-
_setupTimeout(messageId,
|
|
289867
|
+
_setupTimeout(messageId, timeout2, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
|
|
289877
289868
|
this._timeoutInfo.set(messageId, {
|
|
289878
|
-
timeoutId: setTimeout(onTimeout,
|
|
289869
|
+
timeoutId: setTimeout(onTimeout, timeout2),
|
|
289879
289870
|
startTime: Date.now(),
|
|
289880
|
-
timeout:
|
|
289871
|
+
timeout: timeout2,
|
|
289881
289872
|
maxTotalTimeout,
|
|
289882
289873
|
resetTimeoutOnProgress,
|
|
289883
289874
|
onTimeout
|
|
@@ -290339,9 +290330,9 @@ var Protocol = class {
|
|
|
290339
290330
|
options?.signal?.addEventListener("abort", () => {
|
|
290340
290331
|
cancel(options?.signal?.reason);
|
|
290341
290332
|
});
|
|
290342
|
-
const
|
|
290343
|
-
const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, "Request timed out", { timeout:
|
|
290344
|
-
this._setupTimeout(messageId,
|
|
290333
|
+
const timeout2 = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;
|
|
290334
|
+
const timeoutHandler = () => cancel(McpError.fromError(ErrorCode.RequestTimeout, "Request timed out", { timeout: timeout2 }));
|
|
290335
|
+
this._setupTimeout(messageId, timeout2, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false);
|
|
290345
290336
|
const relatedTaskId = relatedTask?.taskId;
|
|
290346
290337
|
if (relatedTaskId) {
|
|
290347
290338
|
const responseResolver = (response) => {
|
|
@@ -292290,7 +292281,7 @@ import { randomBytes as randomBytes7 } from "node:crypto";
|
|
|
292290
292281
|
// package.json
|
|
292291
292282
|
var package_default = {
|
|
292292
292283
|
name: "@ixo/asks-mcp",
|
|
292293
|
-
version: "
|
|
292284
|
+
version: "2.0.0-dev.2",
|
|
292294
292285
|
description: "The Openhands Network MCP server: read the board, answer asks, post work and get paid on the ixo chain, with a key of its own on your machine.",
|
|
292295
292286
|
license: "Apache-2.0",
|
|
292296
292287
|
repository: {
|
|
@@ -292512,9 +292503,23 @@ var TOOLS = {
|
|
|
292512
292503
|
/* A second sweep finds nothing to send: the first one emptied the key. */
|
|
292513
292504
|
annotations: { ...acts, idempotentHint: true }
|
|
292514
292505
|
},
|
|
292506
|
+
cash_out: {
|
|
292507
|
+
title: "Cash out your PAY",
|
|
292508
|
+
description: `Turn the PAY the person earned into money: USDC on Base, or a bank account where offered. One step per call: it reads their PAY, their LinkedIn and identity check, then asks the country, the way to get paid, the amount and (for USDC) the Base address, and shows the quote in plain words ("You'll receive $X (fee $0)"). With confirm: true it gives ONE link: the person opens it and confirms with one tap; that page checks their identity and they sign there. Limits and fees come from IXO's cash-out service, never from here. No LinkedIn: say connect_linkedin first. Signs no money and holds no key of theirs.`,
|
|
292509
|
+
spends: false,
|
|
292510
|
+
hosted: false,
|
|
292511
|
+
annotations: acts
|
|
292512
|
+
},
|
|
292513
|
+
cash_out_status: {
|
|
292514
|
+
title: "Where a cash-out stands",
|
|
292515
|
+
description: "Given a cash-out's id (cd_\u2026 or wd_\u2026, from the confirm page), says where it stands in plain words: waiting for the tap, on its way, paid, or that it didn't go through and where to fix it. Spends nothing.",
|
|
292516
|
+
spends: false,
|
|
292517
|
+
hosted: false,
|
|
292518
|
+
annotations: reads
|
|
292519
|
+
},
|
|
292515
292520
|
my_status: {
|
|
292516
292521
|
title: "This participant's standing",
|
|
292517
|
-
description: "Address, what is available and what is on your asks, answers sent, and rewards still owed.",
|
|
292522
|
+
description: "Address, the account area as seven lines (Your page, Work waiting, Messages unread, Inbox, Money, Agents, Settings, as asks.world/me draws them), what is available and what is on your asks, answers sent, and rewards still owed.",
|
|
292518
292523
|
spends: false,
|
|
292519
292524
|
hosted: false,
|
|
292520
292525
|
annotations: reads
|
|
@@ -292566,7 +292571,7 @@ var TOOLS = {
|
|
|
292566
292571
|
},
|
|
292567
292572
|
draft_call: {
|
|
292568
292573
|
title: "Set up an open call or a pro ask",
|
|
292569
|
-
description: 'Draft an open call or a pro ask. An open call is a brief people answer with their own AI, checked against five requirements: a competition picks a winner; a hire pays every entry that passes, up to a number, and picks nobody; open to anyone, by application (you say yes to each), or by invitation (your list: addresses, @handles, single-use links). A software-review Ask (`kind: "review"`) is one specialised work type on Pro Asks:
|
|
292574
|
+
description: 'Draft an open call or a pro ask. An open call is a brief people answer with their own AI, checked against five requirements: a competition picks a winner; a hire pays every entry that passes, up to a number, and picks nobody; open to anyone, by application (you say yes to each), or by invitation (your list: addresses, @handles, single-use links). A software-review Ask (`kind: "review"`) is one specialised work type on Pro Asks: verified pros you invite try the scenarios and send reports; always a hire, by invitation only; Asky Pro Checker, the verifier, checks each report. Interviews in order: give what the person said, and the answer lists what is still missing, each with the question to ask them. Kept on disk between calls, so never re-send what was already taken. When nothing is missing it shows the whole call, what each leg holds (a pro ask\'s money in one sentence: what each pro receives, what is held per report, and the fee: 20 % on top of what the pro receives) and the clock, for the person to approve. Spends nothing.',
|
|
292570
292575
|
spends: false,
|
|
292571
292576
|
hosted: false,
|
|
292572
292577
|
/* It writes the draft file, and nothing else anywhere. */
|
|
@@ -292574,7 +292579,7 @@ var TOOLS = {
|
|
|
292574
292579
|
},
|
|
292575
292580
|
post_call: {
|
|
292576
292581
|
title: "Post an open call or a pro ask (spends money)",
|
|
292577
|
-
description: `Post a drafted open call or pro ask as the account you act for: a competition is three Asks under one tag (the prize, the runners-up, the entries), a hire (every pro ask is one) is the entries alone; each holds its money until approval. One leg per call; call again until it says everything is posted. A
|
|
292582
|
+
description: `Post a drafted open call or pro ask as the account you act for: a competition is three Asks under one tag (the prize, the runners-up, the entries), a hire (every pro ask is one) is the entries alone; each holds its money until approval. One leg per call; call again until it says everything is posted. A call by invitation writes its list the moment the entries post, and prints the invite links. Pays in this network's own coin, said in dollars. With \`pay_by: "card"\` nothing is spent here: the whole call is saved and you get a link where the person pays by card and posts it. Requires \`confirm\` to restate the exact total from the preview. ${ASK_RULES}`,
|
|
292578
292583
|
spends: true,
|
|
292579
292584
|
hosted: false,
|
|
292580
292585
|
annotations: acts
|
|
@@ -292589,7 +292594,7 @@ var TOOLS = {
|
|
|
292589
292594
|
},
|
|
292590
292595
|
invite_to_call: {
|
|
292591
292596
|
title: "Invite pros or people to an ask",
|
|
292592
|
-
description:
|
|
292597
|
+
description: 'Put people on the list of an ask after it is posted (one by invitation or by application): ixo1 addresses, @handles of people with a page, and "link" once per single-use link to mint. Each link admits one new person, whoever opens it first. A pro ask takes only verified pros: find_pro suggests them. For an ask posted with post_ask, pass its number as collectionId. Answers with the links to hand out and what was written. Only the poster, or the agent they connected, can. Spends nothing.',
|
|
292593
292598
|
spends: false,
|
|
292594
292599
|
hosted: false,
|
|
292595
292600
|
annotations: acts
|
|
@@ -292624,7 +292629,7 @@ var TOOLS = {
|
|
|
292624
292629
|
},
|
|
292625
292630
|
accept_invitation: {
|
|
292626
292631
|
title: "Accept an invitation to a pro ask",
|
|
292627
|
-
description: "Accept an invitation to a pro ask: a link or the ask's number. As the account you act for when connected, else as this key. The builder hears you accepted, and your room with them opens with their note first; a link becomes yours, so nobody else can use it.
|
|
292632
|
+
description: "Accept an invitation to a pro ask: a link or the ask's number. As the account you act for when connected, else as this key. The builder hears you accepted, and your room with them opens with their note first; a link becomes yours, so nobody else can use it. Someone who is not a verified pro is refused, and the link stays open. Previews; `confirm: true` accepts, once the person says yes. Spends nothing.",
|
|
292628
292633
|
spends: false,
|
|
292629
292634
|
hosted: false,
|
|
292630
292635
|
annotations: { ...acts, idempotentHint: true }
|
|
@@ -292653,7 +292658,7 @@ var TOOLS = {
|
|
|
292653
292658
|
},
|
|
292654
292659
|
set_my_page: {
|
|
292655
292660
|
title: "Write your pro page",
|
|
292656
|
-
description: "Make or change the pro page of the person you act for (or this key's own): the page posters find and invite them by, on Pro Asks and across asks.world. A handle, a name, a headline, what they do, a rate, links, availability
|
|
292661
|
+
description: "Make or change the pro page of the person you act for (or this key's own): the page posters find and invite them by, on Pro Asks and across asks.world. A handle, a name, a headline, what they do, a rate, links, availability (open means they can be invited to a pro ask; busy or closed, they are shown but not invited), and `listed`: public (the default, anyone can find the page) or private (off asks.world and search; only someone who types the exact handle or address can invite them). Ask once, plainly, which they want. A private page can have a secret link (`share_link`: create, or replace to switch the old one off), said once on confirm. Previews by default; call again with confirm: true to sign. For guided setup, follow /pro/mcp.md#create-your-pro-profile on the matching Pro Asks host. Start with connect_linkedin: its verified profile pre-fills the name, headline, LinkedIn link and handle; ask only for what LinkedIn lacks (the work they take, rate, availability, a line about them). This tool reads no site itself, so build the rest from what the person tells you or pastes. Spends nothing.",
|
|
292657
292662
|
spends: false,
|
|
292658
292663
|
hosted: false,
|
|
292659
292664
|
annotations: { ...acts, idempotentHint: true }
|
|
@@ -292672,34 +292677,20 @@ var TOOLS = {
|
|
|
292672
292677
|
hosted: false,
|
|
292673
292678
|
annotations: { ...acts, destructiveHint: true, idempotentHint: true }
|
|
292674
292679
|
},
|
|
292675
|
-
list_marketplaces: {
|
|
292676
|
-
title: "List Zones",
|
|
292677
|
-
description: "The Zones of Pro Asks: a pro ask names one (draft_call's `sponsor`): the pros invited are LinkedIn verified, and it earns the Zone's share of each approved report. For each: its name and slug, what it does, since when, and how many LinkedIn-verified pros are on its roster. A pro gets on every roster with connect_linkedin. Nothing ranks them. Spends nothing.",
|
|
292678
|
-
spends: false,
|
|
292679
|
-
hosted: false,
|
|
292680
|
-
annotations: reads
|
|
292681
|
-
},
|
|
292682
292680
|
connect_linkedin: {
|
|
292683
292681
|
title: "Verify your pro page with LinkedIn",
|
|
292684
|
-
description: "Give the person you act for (or this key's own page) a link to log in to LinkedIn. Logging in puts a LinkedIn-verified tick on their pro page (it means: this person logged in to this LinkedIn account), and that is what lets them be invited to
|
|
292682
|
+
description: "Give the person you act for (or this key's own page) a link to log in to LinkedIn. Logging in puts a LinkedIn-verified tick on their pro page (it means: this person logged in to this LinkedIn account), and that is what lets them be invited to a pro ask. Show the link and say: open it and log in to LinkedIn. asks.world reads their LinkedIn profile once and keeps no access. Then call again with the `id` it gave: it says whether they are verified and, once they are, gives the name, headline, LinkedIn link and a handle to pre-fill set_my_page. One LinkedIn account verifies one asks.world account. Spends nothing.",
|
|
292685
292683
|
spends: false,
|
|
292686
292684
|
hosted: false,
|
|
292687
292685
|
annotations: acts
|
|
292688
292686
|
},
|
|
292689
292687
|
find_pro: {
|
|
292690
292688
|
title: "Find pros, or one person's page",
|
|
292691
|
-
description:
|
|
292689
|
+
description: 'Suggest three to five verified pros to invite to a pro ask: the listed ones, by field. Narrow by `q` (what the pro ask needs, or any words: Android, payments, a name) and `available` (open to work now). Each row: who they are, "LinkedIn verified \xB7 date" with their LinkedIn, their rate, their page with their record, and how to invite them. Newest verification first; nothing ranks them, and the person chooses. Then invite_to_call. A private page is in no list, yet any verified pro can be invited by their exact @handle or ixo1 address. With `handle` (an exact @handle or an ixo1 address) it reads that one person\'s public page instead: who they are, what they do, their rate, and the address to invite. Spends nothing.',
|
|
292692
292690
|
spends: false,
|
|
292693
292691
|
hosted: true,
|
|
292694
292692
|
annotations: reads
|
|
292695
292693
|
},
|
|
292696
|
-
set_marketplace_page: {
|
|
292697
|
-
title: "Write your Zone's page",
|
|
292698
|
-
description: "Write the page of the Zone the person you act for hosts (or this key's own, when it is the Zone's account) on Pro Asks: its own words, under the line every Zone's page opens with. A deck line, a logo, a cover, its story in paragraphs, how it verifies pros as steps, pictures and links; every picture, logo and link is an https address on its own site, and nothing is uploaded. It replaces the page whole. Previews the page as text by default: show it to the person, and call again with confirm: true to sign and publish it only once they say yes. Only an approved Zone's account, or the agent it connected, can. Answers with the page's address. Spends nothing.",
|
|
292699
|
-
spends: false,
|
|
292700
|
-
hosted: false,
|
|
292701
|
-
annotations: { ...acts, idempotentHint: true }
|
|
292702
|
-
},
|
|
292703
292694
|
create_campaign: {
|
|
292704
292695
|
title: "Create a campaign with its own requirements",
|
|
292705
292696
|
description: "Mint a campaign: a campaign protocol plus its shared claim protocol carrying the requirements every answer in it is checked against. Minted and owned by the connected person (the organisation's owner or admin, via connect_account), never by this server's key. Previews by default; call again with the same values and confirm: true to mint. Then post its Asks with `post_ask campaign: <the campaign's id>`. Spends only network fees.",
|
|
@@ -293109,17 +293100,17 @@ function measureOf(reason) {
|
|
|
293109
293100
|
function reasonText(reason) {
|
|
293110
293101
|
const rest = reason.detail.startsWith(`${reason.label}: `) ? reason.detail.slice(reason.label.length + 2) : reason.detail;
|
|
293111
293102
|
const measure = measureOf(reason);
|
|
293112
|
-
const
|
|
293113
|
-
const sayMeasured = reason.value !== void 0 &&
|
|
293114
|
-
return [sayMeasured ? "" : measure,
|
|
293103
|
+
const said4 = rest === reason.label || rest === RESULT_WORD[reason.result] || rest === "Did not pass" ? "" : rest;
|
|
293104
|
+
const sayMeasured = reason.value !== void 0 && said4.startsWith(num2(reason.value, reason.unit));
|
|
293105
|
+
return [sayMeasured ? "" : measure, said4].filter(Boolean).join(". ");
|
|
293115
293106
|
}
|
|
293116
293107
|
var evidenceLine = (why) => why.evidenceGrade ? `Time/place: ${why.evidenceGrade}` : null;
|
|
293117
293108
|
function whyLines(why, indent3 = "") {
|
|
293118
293109
|
if (!why) return [`${indent3}${WHY_UNREADABLE}.`];
|
|
293119
293110
|
const lines2 = [`${indent3}${why.summary}`];
|
|
293120
293111
|
for (const reason of why.reasons) {
|
|
293121
|
-
const
|
|
293122
|
-
lines2.push(`${indent3} ${RESULT_WORD[reason.result]}: ${reason.label}${
|
|
293112
|
+
const said4 = reasonText(reason);
|
|
293113
|
+
lines2.push(`${indent3} ${RESULT_WORD[reason.result]}: ${reason.label}${said4 ? ` \u2014 ${said4}` : ""}`);
|
|
293123
293114
|
}
|
|
293124
293115
|
const evidence = evidenceLine(why);
|
|
293125
293116
|
if (evidence) lines2.push(`${indent3}${evidence}`);
|
|
@@ -293166,8 +293157,8 @@ var FACT_LABELS = {
|
|
|
293166
293157
|
};
|
|
293167
293158
|
var humanise = (s) => s.replace(/^\$/, "").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[._-]+/g, " ").trim().replace(/^./, (c) => c.toUpperCase()).replace(/(?<=\s)([A-Z])(?=[a-z])/g, (c) => c.toLowerCase());
|
|
293168
293159
|
function codeLabel(code10) {
|
|
293169
|
-
const
|
|
293170
|
-
return
|
|
293160
|
+
const words4 = /^[A-Z0-9]+-\d+-([A-Z0-9-]+)$/.exec(code10)?.[1];
|
|
293161
|
+
return words4 ? humanise(words4.toLowerCase()) : humanise(code10);
|
|
293171
293162
|
}
|
|
293172
293163
|
function leaves(node, out = []) {
|
|
293173
293164
|
if (Array.isArray(node)) for (const n of node) leaves(n, out);
|
|
@@ -293871,10 +293862,10 @@ ${problems.map((one) => `- ${one}`).join("\n")}`;
|
|
|
293871
293862
|
async function sendOnce(send, world, report, files, manifest, digest2) {
|
|
293872
293863
|
const prior = await priorSend(world, digest2, send.collectionId, "report");
|
|
293873
293864
|
if ("said" in prior) return prior.said;
|
|
293874
|
-
let
|
|
293875
|
-
const
|
|
293865
|
+
let record2 = prior.record;
|
|
293866
|
+
const words4 = storeWords(world.private);
|
|
293876
293867
|
let prepared = false;
|
|
293877
|
-
if (!
|
|
293868
|
+
if (!record2) {
|
|
293878
293869
|
await world.put(digest2, { state: "previewed" });
|
|
293879
293870
|
return [
|
|
293880
293871
|
`Not sent yet. Show the person this whole report and these files, then call submit_work again with exactly the same report and files: they approve it in a dialog before anything is sent.`,
|
|
@@ -293882,7 +293873,7 @@ async function sendOnce(send, world, report, files, manifest, digest2) {
|
|
|
293882
293873
|
JSON.stringify(report, null, 2),
|
|
293883
293874
|
"",
|
|
293884
293875
|
...summaryOf2(report, manifest, digest2).slice(7),
|
|
293885
|
-
|
|
293876
|
+
words4.preview
|
|
293886
293877
|
].join("\n");
|
|
293887
293878
|
}
|
|
293888
293879
|
const stopped = stoppedWords(world.site, send.collectionId, "report");
|
|
@@ -293890,12 +293881,12 @@ async function sendOnce(send, world, report, files, manifest, digest2) {
|
|
|
293890
293881
|
const no2 = stopped(
|
|
293891
293882
|
await world.ask(`Use what I remember about you in this report?
|
|
293892
293883
|
|
|
293893
|
-
Parts of this report for ask #${send.collectionId} came from what Claude remembers about you or from earlier chats. ${
|
|
293884
|
+
Parts of this report for ask #${send.collectionId} came from what Claude remembers about you or from earlier chats. ${words4.memory}`, "memory"),
|
|
293894
293885
|
"Nothing was sent: leave out what came from memory, then call again with uses_memory: false."
|
|
293895
293886
|
);
|
|
293896
293887
|
if (no2) return no2;
|
|
293897
293888
|
}
|
|
293898
|
-
let stored =
|
|
293889
|
+
let stored = record2?.files;
|
|
293899
293890
|
if (!stored && files.length) {
|
|
293900
293891
|
const no2 = stopped(
|
|
293901
293892
|
await world.ask(
|
|
@@ -293903,7 +293894,7 @@ Parts of this report for ask #${send.collectionId} came from what Claude remembe
|
|
|
293903
293894
|
`Upload these ${files.length} ${files.length === 1 ? "file" : "files"} for ask #${send.collectionId}?`,
|
|
293904
293895
|
...manifest.map((one) => `- ${one.path} (${one.mediaType}, ${Math.ceil(one.bytes / 1024)} KB) sha256 ${one.sha256}`),
|
|
293905
293896
|
"",
|
|
293906
|
-
`${
|
|
293897
|
+
`${words4.upload} The report itself is asked about next.`,
|
|
293907
293898
|
`Digest: ${digest2}`
|
|
293908
293899
|
].join("\n"),
|
|
293909
293900
|
"upload"
|
|
@@ -293919,8 +293910,8 @@ Parts of this report for ask #${send.collectionId} came from what Claude remembe
|
|
|
293919
293910
|
const up = await uploadAll(world, files);
|
|
293920
293911
|
if (typeof up === "string") return up;
|
|
293921
293912
|
stored = up;
|
|
293922
|
-
|
|
293923
|
-
await world.put(digest2,
|
|
293913
|
+
record2 = { state: "uploaded", files: stored };
|
|
293914
|
+
await world.put(digest2, record2);
|
|
293924
293915
|
}
|
|
293925
293916
|
stored ??= [];
|
|
293926
293917
|
const no = stopped(
|
|
@@ -293929,11 +293920,11 @@ Parts of this report for ask #${send.collectionId} came from what Claude remembe
|
|
|
293929
293920
|
`Send this review report to ask #${send.collectionId}, as ${send.submitter}?`,
|
|
293930
293921
|
"",
|
|
293931
293922
|
...summaryOf2(report, manifest, digest2),
|
|
293932
|
-
`The full report was shown in the conversation before this. ${
|
|
293923
|
+
`The full report was shown in the conversation before this. ${words4.sent}`
|
|
293933
293924
|
].join("\n"),
|
|
293934
293925
|
"publish"
|
|
293935
293926
|
),
|
|
293936
|
-
files.length ? `Nothing was sent (${
|
|
293927
|
+
files.length ? `Nothing was sent (${words4.filesKept}).` : "Nothing was sent."
|
|
293937
293928
|
);
|
|
293938
293929
|
if (no) return no;
|
|
293939
293930
|
const unprepared = prepared ? null : await world.prepare();
|
|
@@ -293941,7 +293932,7 @@ Parts of this report for ask #${send.collectionId} came from what Claude remembe
|
|
|
293941
293932
|
const primary = files.find((one) => one.mediaType === "application/pdf") ?? files[0];
|
|
293942
293933
|
const primaryAt = primary ? stored.find((one) => one.id === primary.id) : void 0;
|
|
293943
293934
|
const primaryCid = primaryAt ? primaryAt.url.split("/").pop() ?? null : null;
|
|
293944
|
-
const envelope =
|
|
293935
|
+
const envelope = record2?.envelope ?? await sealText(world, {
|
|
293945
293936
|
collectionId: send.collectionId,
|
|
293946
293937
|
ts: world.now(),
|
|
293947
293938
|
submitter: send.submitter,
|
|
@@ -293954,34 +293945,34 @@ Parts of this report for ask #${send.collectionId} came from what Claude remembe
|
|
|
293954
293945
|
...reportEnvelope(report, stored)
|
|
293955
293946
|
});
|
|
293956
293947
|
if (typeof envelope !== "string") return envelope.refused;
|
|
293957
|
-
const sealed = await publishOnce(world, digest2, { ...
|
|
293948
|
+
const sealed = await publishOnce(world, digest2, { ...record2 ?? { state: "uploaded" }, files: stored }, envelope);
|
|
293958
293949
|
if (typeof sealed === "string") return sealed;
|
|
293959
293950
|
return broadcastOnce(world, digest2, sealed, send.collectionId, "report", `Answered #${send.collectionId} with a review report as ${send.submitter}.`);
|
|
293960
293951
|
}
|
|
293961
293952
|
async function priorSend(world, digest2, collectionId, what) {
|
|
293962
|
-
let
|
|
293953
|
+
let record2;
|
|
293963
293954
|
try {
|
|
293964
|
-
|
|
293955
|
+
record2 = await world.get(digest2);
|
|
293965
293956
|
} catch {
|
|
293966
293957
|
return { said: `Refused: the record of an earlier send of this exact ${what} (digest ${digest2}, in the answers folder under OPENHANDS_HOME) cannot be read. Nothing was sent. Look at the ask's receipt page first; remove the record only if you are sure it never went.` };
|
|
293967
293958
|
}
|
|
293968
|
-
if (
|
|
293969
|
-
const seen2 = await world.onChain(
|
|
293959
|
+
if (record2?.claimId && (record2.state === "submitting" || record2.state === "submitted")) {
|
|
293960
|
+
const seen2 = await world.onChain(record2.claimId);
|
|
293970
293961
|
if (seen2) {
|
|
293971
|
-
await world.put(digest2, { ...
|
|
293962
|
+
await world.put(digest2, { ...record2, state: "submitted" });
|
|
293972
293963
|
return { said: `Already sent: this exact ${what} is recorded for #${collectionId}.
|
|
293973
|
-
answer ${
|
|
293974
|
-
transaction ${
|
|
293975
|
-
${receiptLine(world.site, collectionId,
|
|
293964
|
+
answer ${record2.claimId}${record2.tx ? `
|
|
293965
|
+
transaction ${record2.tx}` : ""}
|
|
293966
|
+
${receiptLine(world.site, collectionId, record2.claimId, world.reviewSlug)}` };
|
|
293976
293967
|
}
|
|
293977
293968
|
return {
|
|
293978
293969
|
said: [
|
|
293979
293970
|
`Not sent again: an earlier send of this exact ${what} (digest ${digest2}) may already be recorded, and ${seen2 === null ? "the ledger could not be read just now" : "the index has not shown it yet"}.`,
|
|
293980
|
-
`Look at ${receiptLine(world.site, collectionId,
|
|
293971
|
+
`Look at ${receiptLine(world.site, collectionId, record2.claimId, world.reviewSlug).slice("Receipt: ".length)} in a few minutes. This tool never sends the same ${what} twice.`
|
|
293981
293972
|
].join("\n")
|
|
293982
293973
|
};
|
|
293983
293974
|
}
|
|
293984
|
-
return { record:
|
|
293975
|
+
return { record: record2 };
|
|
293985
293976
|
}
|
|
293986
293977
|
var stoppedWords = (site, collectionId, what) => (approval, tail) => approval.answer === "approved" ? null : approval.answer === "unsupported" ? `Refused: sending ${what === "report" ? "a report" : "an answer"} needs your OK in a dialog, and this client cannot show one. Use Claude Code in a terminal, or answer on the website: ${site}/submit/${collectionId}. Nothing was sent.` : `${tail} ${approval.answer === "declined" ? "The person said no" : approval.answer === "cancelled" ? "The client closed the dialog without the person's answer" : "No answer came back from the person"}. Change the ${what} and call again, or answer on the website: ${site}/submit/${collectionId}.`;
|
|
293987
293978
|
var sealText = async (world, envelope) => world.private && world.fit ? world.fit(envelope) : JSON.stringify(envelope);
|
|
@@ -293998,18 +293989,18 @@ async function uploadAll(world, files) {
|
|
|
293998
293989
|
}
|
|
293999
293990
|
return stored;
|
|
294000
293991
|
}
|
|
294001
|
-
async function publishOnce(world, digest2,
|
|
294002
|
-
if (
|
|
293992
|
+
async function publishOnce(world, digest2, record2, envelope) {
|
|
293993
|
+
if (record2.envelope && record2.claimId) return record2;
|
|
294003
293994
|
const published = await world.publish(envelope);
|
|
294004
293995
|
if (!published) return storeWords(world.private).refusedEnvelope;
|
|
294005
293996
|
if (published.cid !== cidOfText2(envelope)) return "The store gave it another address than its own bytes. Nothing was sent.";
|
|
294006
|
-
const next = { ...
|
|
293997
|
+
const next = { ...record2, state: "published", envelope, claimId: published.cid };
|
|
294007
293998
|
await world.put(digest2, next);
|
|
294008
293999
|
return next;
|
|
294009
294000
|
}
|
|
294010
|
-
async function broadcastOnce(world, digest2,
|
|
294011
|
-
const claimId =
|
|
294012
|
-
await world.put(digest2, { ...
|
|
294001
|
+
async function broadcastOnce(world, digest2, record2, collectionId, what, done) {
|
|
294002
|
+
const claimId = record2.claimId;
|
|
294003
|
+
await world.put(digest2, { ...record2, state: "submitting" });
|
|
294013
294004
|
let tx;
|
|
294014
294005
|
try {
|
|
294015
294006
|
tx = await world.submit(claimId);
|
|
@@ -294021,10 +294012,10 @@ async function broadcastOnce(world, digest2, record3, collectionId, what, done)
|
|
|
294021
294012
|
].filter(Boolean).join("\n");
|
|
294022
294013
|
}
|
|
294023
294014
|
if (typeof tx !== "string") {
|
|
294024
|
-
await world.put(digest2, { ...
|
|
294015
|
+
await world.put(digest2, { ...record2, state: "published" });
|
|
294025
294016
|
return [`The network refused the answer, so nothing was sent: ${tx.failed}. Fix what it says, then call submit_work again with the same ${what}.`, storeWords(world.private).kept].filter(Boolean).join(" ");
|
|
294026
294017
|
}
|
|
294027
|
-
await world.put(digest2, { ...
|
|
294018
|
+
await world.put(digest2, { ...record2, state: "submitted", tx });
|
|
294028
294019
|
return [`${done}
|
|
294029
294020
|
answer ${claimId}
|
|
294030
294021
|
transaction ${tx}
|
|
@@ -294042,11 +294033,11 @@ function answersStore(dir) {
|
|
|
294042
294033
|
const text4 = await (await fs2()).readFile(path(digest2), "utf8").catch((error54) => error54.code === "ENOENT" ? null : Promise.reject(error54));
|
|
294043
294034
|
return text4 === null ? null : JSON.parse(text4);
|
|
294044
294035
|
},
|
|
294045
|
-
async put(digest2,
|
|
294036
|
+
async put(digest2, record2) {
|
|
294046
294037
|
const { mkdir, rename, writeFile } = await fs2();
|
|
294047
294038
|
await mkdir(dir, { recursive: true, mode: 448 });
|
|
294048
294039
|
const tmp = `${path(digest2)}.${process.pid}.tmp`;
|
|
294049
|
-
await writeFile(tmp, JSON.stringify(
|
|
294040
|
+
await writeFile(tmp, JSON.stringify(record2), { mode: 384 });
|
|
294050
294041
|
await rename(tmp, path(digest2));
|
|
294051
294042
|
}
|
|
294052
294043
|
};
|
|
@@ -294066,7 +294057,7 @@ init_checkers();
|
|
|
294066
294057
|
init_format();
|
|
294067
294058
|
import { basename as basename2, isAbsolute as isAbsolute2 } from "node:path";
|
|
294068
294059
|
var questionsLine = (fields) => fields.map((field2) => `${field2.name} (${field2.label}${field2.required ? ", needed" : ""}${field2.type === "file" ? ", a file path" : field2.enum ? `: ${field2.enum.join(" | ")}` : field2.type === "string" ? "" : `, ${field2.type}`})`).join("; ");
|
|
294069
|
-
var sentence2 = (
|
|
294060
|
+
var sentence2 = (words4) => `${words4.trim().replace(/[.\s]+$/, "")}.`;
|
|
294070
294061
|
function checkersListing(experts, network2) {
|
|
294071
294062
|
const priceWords = (base6, denom) => base6 === null || !denom ? "no published fee" : `${coinWords(base6, denom, network2 !== "mainnet")} per check`;
|
|
294072
294063
|
return [
|
|
@@ -294122,8 +294113,8 @@ async function sendFields(send, world) {
|
|
|
294122
294113
|
try {
|
|
294123
294114
|
const prior = await priorSend(world, digest2, send.collectionId, "answer");
|
|
294124
294115
|
if ("said" in prior) return prior.said;
|
|
294125
|
-
let
|
|
294126
|
-
if (!
|
|
294116
|
+
let record2 = prior.record;
|
|
294117
|
+
if (!record2) {
|
|
294127
294118
|
await world.put(digest2, { state: "previewed" });
|
|
294128
294119
|
return [
|
|
294129
294120
|
"Not sent yet. Show the person these answers and files, then call submit_work again with exactly the same fields: they approve the files and then the answer in dialogs before anything is sent.",
|
|
@@ -294138,9 +294129,9 @@ async function sendFields(send, world) {
|
|
|
294138
294129
|
].join("\n");
|
|
294139
294130
|
}
|
|
294140
294131
|
const stopped = stoppedWords(world.site, send.collectionId, "answer");
|
|
294141
|
-
const
|
|
294132
|
+
const words4 = storeWords(world.private);
|
|
294142
294133
|
let prepared = false;
|
|
294143
|
-
let stored =
|
|
294134
|
+
let stored = record2.files;
|
|
294144
294135
|
if (!stored && files.length) {
|
|
294145
294136
|
const no2 = stopped(
|
|
294146
294137
|
await world.ask(
|
|
@@ -294148,7 +294139,7 @@ async function sendFields(send, world) {
|
|
|
294148
294139
|
`Upload these ${files.length} ${files.length === 1 ? "file" : "files"} for ask #${send.collectionId}?`,
|
|
294149
294140
|
...fileLines,
|
|
294150
294141
|
"",
|
|
294151
|
-
`${
|
|
294142
|
+
`${words4.upload} The answer itself is asked about next.`,
|
|
294152
294143
|
`Digest: ${digest2}`
|
|
294153
294144
|
].join("\n"),
|
|
294154
294145
|
"upload"
|
|
@@ -294164,25 +294155,25 @@ async function sendFields(send, world) {
|
|
|
294164
294155
|
const up = await uploadAll(world, files);
|
|
294165
294156
|
if (typeof up === "string") return up;
|
|
294166
294157
|
stored = up;
|
|
294167
|
-
|
|
294168
|
-
await world.put(digest2,
|
|
294158
|
+
record2 = { state: "uploaded", files: stored };
|
|
294159
|
+
await world.put(digest2, record2);
|
|
294169
294160
|
}
|
|
294170
294161
|
stored ??= [];
|
|
294171
294162
|
const no = stopped(
|
|
294172
294163
|
await world.ask(
|
|
294173
|
-
[`Send this answer to ask #${send.collectionId}, as ${send.submitter}?`, "", ...answerLines, "", files.length ? "Files:" : "Files: none", ...fileLines, "", `Digest: ${digest2}`,
|
|
294164
|
+
[`Send this answer to ask #${send.collectionId}, as ${send.submitter}?`, "", ...answerLines, "", files.length ? "Files:" : "Files: none", ...fileLines, "", `Digest: ${digest2}`, words4.sent].join("\n"),
|
|
294174
294165
|
"answer"
|
|
294175
294166
|
),
|
|
294176
|
-
files.length ? `Nothing was sent (${
|
|
294167
|
+
files.length ? `Nothing was sent (${words4.filesKept}).` : "Nothing was sent."
|
|
294177
294168
|
);
|
|
294178
294169
|
if (no) return no;
|
|
294179
294170
|
const unprepared = prepared ? null : await world.prepare();
|
|
294180
294171
|
if (unprepared) return unprepared;
|
|
294181
294172
|
const values = { ...send.values };
|
|
294182
294173
|
for (const field2 of fileFields) values[field2.name] = stored.filter((one) => one.id === field2.name).map((one) => ({ name: one.name, type: one.mediaType, url: one.url }));
|
|
294183
|
-
const envelope =
|
|
294174
|
+
const envelope = record2.envelope ?? await sealText(world, checkEnvelope({ fields: send.fields, values, collectionId: send.collectionId, submitter: send.submitter, ts: world.now(), ...send.delegate ? { delegate: send.delegate } : {}, ...send.alias ? { alias: send.alias } : {}, via: "mcp" }));
|
|
294184
294175
|
if (typeof envelope !== "string") return envelope.refused;
|
|
294185
|
-
const sealed = await publishOnce(world, digest2, { ...
|
|
294176
|
+
const sealed = await publishOnce(world, digest2, { ...record2, files: stored }, envelope);
|
|
294186
294177
|
if (typeof sealed === "string") return sealed;
|
|
294187
294178
|
return broadcastOnce(world, digest2, sealed, send.collectionId, "answer", `Answered #${send.collectionId} as ${send.submitter}.`);
|
|
294188
294179
|
} finally {
|
|
@@ -294528,10 +294519,10 @@ To go ahead, call again with confirm: "${token}".`;
|
|
|
294528
294519
|
return chargeDay(args.bucket, args.total);
|
|
294529
294520
|
}
|
|
294530
294521
|
const withNotes = (guard, notes) => {
|
|
294531
|
-
const
|
|
294532
|
-
return guard.startsWith("Refused") ||
|
|
294522
|
+
const said4 = notes.filter((note) => Boolean(note));
|
|
294523
|
+
return guard.startsWith("Refused") || said4.length === 0 ? guard : `${guard}
|
|
294533
294524
|
|
|
294534
|
-
${
|
|
294525
|
+
${said4.join("\n")}`;
|
|
294535
294526
|
};
|
|
294536
294527
|
const principal2 = async () => actingFor2(await address2());
|
|
294537
294528
|
const unchosen = async () => {
|
|
@@ -294700,18 +294691,18 @@ Each is its own ask and pays on its own. Read one with read_ask before deciding.
|
|
|
294700
294691
|
calls.set(tag, { slug, entries: entries2, shared });
|
|
294701
294692
|
})
|
|
294702
294693
|
);
|
|
294703
|
-
const callLine = (row,
|
|
294694
|
+
const callLine = (row, call3) => {
|
|
294704
294695
|
const summary = row.campaignSummary;
|
|
294705
|
-
const review = isReviewTitle(
|
|
294706
|
-
const title =
|
|
294696
|
+
const review = isReviewTitle(call3.entries?.title);
|
|
294697
|
+
const title = call3.entries?.title.replace(/^(Open call|Expert review): /, "") ?? null;
|
|
294707
294698
|
if (title) taint2(title);
|
|
294708
294699
|
const facts = row.callSummary;
|
|
294709
|
-
const shares =
|
|
294710
|
-
const entryPays = shares && facts?.entryEach !== void 0 &&
|
|
294700
|
+
const shares = call3.shared;
|
|
294701
|
+
const entryPays = shares && facts?.entryEach !== void 0 && call3.entries?.pays ? `${faceOf2({ value: facts.entryEach, symbol: call3.entries.pays.symbol }, SANDBOX)?.text} (the network's share is on top of it)` : call3.entries?.pays ? `${faceOf2(call3.entries.pays, SANDBOX)?.text}${shares ? ", less the network's share" : ""}` : void 0;
|
|
294711
294702
|
return [
|
|
294712
|
-
`${review ? "Expert review" : "Open call"} "${
|
|
294703
|
+
`${review ? "Expert review" : "Open call"} "${call3.slug}" \xB7 ${summary.open} of ${summary.places} legs open${entryPays ? ` \xB7 every ${review ? "report" : "entry"} that meets the bar is paid ${entryPays}` : ""} \xB7 needs-a-human`,
|
|
294713
294704
|
title ? asData("ask-title", title) : "",
|
|
294714
|
-
`${review ? "A specialist's report on the review's scenarios, assessed against its requirements. A report that meets them
|
|
294705
|
+
`${review ? "A specialist's report on the review's scenarios, assessed against its requirements. A report that meets them is paid, after the builder's final approval when they give one." : "A written entry assessed against five requirements. Entries that meet all five are paid. For competitions, the poster also chooses a prize winner."} ${call3.entries ? `Read it with read_ask "${call3.entries.id}"; the page is` : "Read its legs on the page:"} ${review ? `${EXPERT_SITE}/pro/reviews/${call3.entries?.id ?? call3.slug}` : `${SITE}/opencall/${call3.slug}`}`
|
|
294715
294706
|
].filter(Boolean).join("\n");
|
|
294716
294707
|
};
|
|
294717
294708
|
const lines2 = board.rows.filter(within2).map((row) => {
|
|
@@ -294729,8 +294720,8 @@ Each is its own ask and pays on its own. Read one with read_ask before deciding.
|
|
|
294729
294720
|
}
|
|
294730
294721
|
if ((row.card === "campaign" || row.card === "call") && row.campaignSummary) {
|
|
294731
294722
|
const summary = row.campaignSummary;
|
|
294732
|
-
const
|
|
294733
|
-
if (
|
|
294723
|
+
const call3 = calls.get(summary.tag);
|
|
294724
|
+
if (call3) return callLine(row, call3);
|
|
294734
294725
|
const low = summary.low ? faceOf2(summary.low, SANDBOX)?.text : void 0;
|
|
294735
294726
|
const high = summary.high ? faceOf2(summary.high, SANDBOX)?.text : void 0;
|
|
294736
294727
|
const range = summary.pool || !low ? "paid from pools" : high && high !== low ? `${low} to ${high} a place` : `${low} a place`;
|
|
@@ -294797,7 +294788,7 @@ ${notes.join("\n")}${notes.length ? "\n\n" : ""}Read one with read_ask before de
|
|
|
294797
294788
|
const { callReadout: callReadout2 } = await Promise.resolve().then(() => (init_call2(), call_exports2));
|
|
294798
294789
|
terms = callReadout2(read9, { id: collectionId, symbol: shown2?.symbol ?? ASK_SYMBOL, site: SITE, network: NETWORK2 });
|
|
294799
294790
|
postedShare = read9.call.share ?? null;
|
|
294800
|
-
proAsk =
|
|
294791
|
+
proAsk = read9.call.kind === "review";
|
|
294801
294792
|
}
|
|
294802
294793
|
}
|
|
294803
294794
|
}
|
|
@@ -294951,7 +294942,7 @@ You cannot complete it, and trying would spend the gate's network fee to be reje
|
|
|
294951
294942
|
lane = opened;
|
|
294952
294943
|
}
|
|
294953
294944
|
let acceptedFirst = "";
|
|
294954
|
-
const withAccepted = (
|
|
294945
|
+
const withAccepted = (words4) => [acceptedFirst, words4].filter(Boolean).join("\n");
|
|
294955
294946
|
const answerFirst = async () => {
|
|
294956
294947
|
const invitesModule = await Promise.resolve().then(() => (init_invites(), invites_exports));
|
|
294957
294948
|
const signer3 = await inviteSigner(acting);
|
|
@@ -294981,13 +294972,13 @@ You cannot complete it, and trying would spend the gate's network fee to be reje
|
|
|
294981
294972
|
});
|
|
294982
294973
|
if (!granted.ok) {
|
|
294983
294974
|
const body = await granted.text();
|
|
294984
|
-
let
|
|
294975
|
+
let said4 = body.slice(0, 200);
|
|
294985
294976
|
try {
|
|
294986
294977
|
const parsed = JSON.parse(body);
|
|
294987
|
-
if (typeof parsed.error === "string" && parsed.error)
|
|
294978
|
+
if (typeof parsed.error === "string" && parsed.error) said4 = parsed.error.replace(/\.?$/, ".");
|
|
294988
294979
|
} catch {
|
|
294989
294980
|
}
|
|
294990
|
-
return `The gate refused: ${
|
|
294981
|
+
return `The gate refused: ${said4}`;
|
|
294991
294982
|
}
|
|
294992
294983
|
return null;
|
|
294993
294984
|
};
|
|
@@ -295032,9 +295023,9 @@ You cannot complete it, and trying would spend the gate's network fee to be reje
|
|
|
295032
295023
|
...lane ? { private: true, fit: lane.fit, upload: lane.store.upload, fetchBack: lane.store.fetchBack, publish: lane.store.publish } : {}
|
|
295033
295024
|
};
|
|
295034
295025
|
const who = { submitter, ...acting ? { delegate: actor.address } : {}, ...alias ? { alias } : {} };
|
|
295035
|
-
const
|
|
295036
|
-
if (
|
|
295037
|
-
return text4(withAccepted(expertAsk &&
|
|
295026
|
+
const said4 = report ? await sendReport({ collectionId, report, paths: files ?? [], requirement, ...uses_memory ? { usesMemory: true } : {}, ...who }, world) : await sendFields({ fields: expertAsk.check.fields, values: fields, collectionId, ...who }, world);
|
|
295027
|
+
if (said4.startsWith("Answered")) nudge("scan", collectionId, expertAsk?.checker ?? (await Promise.resolve().then(() => (init_call2(), call_exports2))).nudgeAtFor(NETWORK2, judgeAddress));
|
|
295028
|
+
return text4(withAccepted(expertAsk && said4.startsWith("Answered") ? said4.replace(/^(Answered #\d+ as \S+)\./, `$1, for ${expertAsk.checker.name} to check.`) : said4));
|
|
295038
295029
|
}
|
|
295039
295030
|
const refusedToPrepare = await prepare2();
|
|
295040
295031
|
if (refusedToPrepare) return text4(withAccepted(refusedToPrepare));
|
|
@@ -295444,12 +295435,12 @@ ${SITE}/t/${earlier.id}`);
|
|
|
295444
295435
|
const { netOf: netOf2 } = await Promise.resolve().then(() => (init_share(), share_exports));
|
|
295445
295436
|
const { shareWords: shareWords2 } = await Promise.resolve().then(() => (init_callRead(), callRead_exports));
|
|
295446
295437
|
const { denom, amount: amount3 } = leg.amount[0];
|
|
295447
|
-
const
|
|
295438
|
+
const said4 = (base6) => faceOf2(coinDisplay2([{ denom, amount: String(base6) }]), SANDBOX)?.text ?? "see the record";
|
|
295448
295439
|
const split3 = posted ?? await callSplit();
|
|
295449
|
-
if (!split3) return `${
|
|
295440
|
+
if (!split3) return `${said4(Number(amount3))} less the network's share (the fee split could not be read just now)`;
|
|
295450
295441
|
const receives = netOf2(Number(amount3), split3);
|
|
295451
|
-
if (bare) return
|
|
295452
|
-
return `${
|
|
295442
|
+
if (bare) return said4(receives);
|
|
295443
|
+
return `${said4(receives)} (the leg is ${said4(Number(amount3))}; the network keeps ${said4(Number(amount3) - receives)}: ${shareWords2(split3, posted ? "as posted" : "today")})`;
|
|
295453
295444
|
}
|
|
295454
295445
|
const callLocks = (rewardBase, feeBase, symbol2 = ASK_SYMBOL) => `${pays(rewardBase, symbol2)}${feeBase > 0 ? ` and ${feeWords(feeBase)} for reviews` : ""}`;
|
|
295455
295446
|
function escrowTotal(pay, spots, legBase, symbol2 = ASK_SYMBOL, sameCoin = true, feeSymbol = FEE_SYMBOL) {
|
|
@@ -295678,7 +295669,7 @@ ${SITE}/t/${earlier.id}`);
|
|
|
295678
295669
|
const image = work?.image ? work.image.startsWith("/") ? `${SITE}${work.image}` : work.image : void 0;
|
|
295679
295670
|
if (work?.text || image) artifact = work?.text ? { kind: image ? "submission" : "text", body: work.text, url: image } : { kind: "image", url: image };
|
|
295680
295671
|
}
|
|
295681
|
-
const
|
|
295672
|
+
const record2 = await fetch2(`${SITE}/api/waiting?address=${encodeURIComponent(approved.agentAddress)}`, { signal: AbortSignal.timeout(15e3) }).then((response) => response.ok ? response.json() : null).catch(() => null);
|
|
295682
295673
|
const terms = receipt.doneMeansCid ? await participant.readDocJson(receipt.doneMeansCid, { timeoutMs: 15e3, fetchImpl: fetch2, at: receipt.doneMeansUrl }) : null;
|
|
295683
295674
|
const { isPrivateTerms: isPrivateTerms2 } = await Promise.resolve().then(() => (init_lane(), lane_exports));
|
|
295684
295675
|
if (receipt.access || isPrivateTerms2(terms)) {
|
|
@@ -295721,7 +295712,7 @@ ${SITE}/t/${earlier.id}`);
|
|
|
295721
295712
|
if (!where2 && mode !== "url-check") mode = mode === "photo" ? "photo-anywhere" : "written";
|
|
295722
295713
|
const followsUp = Boolean(terms?.followUp);
|
|
295723
295714
|
const { evidenceFrom: evidenceFrom2, evidenceLines: evidenceLines2, WORTH: WORTH2 } = await Promise.resolve().then(() => (init_confidence(), confidence_exports));
|
|
295724
|
-
const verifiedHere =
|
|
295715
|
+
const verifiedHere = record2?.record?.approved ?? 0;
|
|
295725
295716
|
const evidence = evidenceFrom2(
|
|
295726
295717
|
[
|
|
295727
295718
|
{
|
|
@@ -296057,11 +296048,42 @@ Left on this key: ${skipped.length === 1 ? "a coin" : `${skipped.length} coins`}
|
|
|
296057
296048
|
],
|
|
296058
296049
|
"earnings home"
|
|
296059
296050
|
);
|
|
296060
|
-
const
|
|
296061
|
-
return text4(`Sent ${
|
|
296051
|
+
const said4 = coinsSaid(moving);
|
|
296052
|
+
return text4(`Sent ${said4} to ${home}.
|
|
296062
296053
|
tx ${result.transactionHash}${leftWords}`);
|
|
296063
296054
|
}
|
|
296064
296055
|
);
|
|
296056
|
+
const cashoutDeps = async () => {
|
|
296057
|
+
const acting = await principal2();
|
|
296058
|
+
const key = await loadKey2();
|
|
296059
|
+
return { site: SITE, signer: { address: await address2(), mnemonic: key.mnemonic, principal: acting?.principal ?? null }, fetch: fetch2 };
|
|
296060
|
+
};
|
|
296061
|
+
if (offered("cash_out")) server2.registerTool(
|
|
296062
|
+
"cash_out",
|
|
296063
|
+
{
|
|
296064
|
+
...meta3("cash_out"),
|
|
296065
|
+
inputSchema: {
|
|
296066
|
+
country: external_exports.string().max(2).optional().describe("Where the person lives: two letters, like NG or DE."),
|
|
296067
|
+
method: external_exports.string().max(40).optional().describe("The way to get paid, as cash_out listed it (like usdc_base)."),
|
|
296068
|
+
amount_usd: external_exports.string().max(12).optional().describe('How much, in dollars, like "25" or "25.50".'),
|
|
296069
|
+
to: external_exports.string().max(64).optional().describe("USDC on Base only: the 0x\u2026 address that receives it."),
|
|
296070
|
+
confirm: external_exports.boolean().optional().describe("true, after the person said yes to the quote: gives the one link to confirm.")
|
|
296071
|
+
}
|
|
296072
|
+
},
|
|
296073
|
+
async (args) => {
|
|
296074
|
+
const { cashOut: cashOut2 } = await Promise.resolve().then(() => (init_cashout(), cashout_exports));
|
|
296075
|
+
const participant = await Promise.resolve().then(() => (init_src5(), src_exports4));
|
|
296076
|
+
return text4(await cashOut2({ ...await cashoutDeps(), payBase: async (who) => Number((await participant.balancesOf(who)).upay ?? 0) }, args));
|
|
296077
|
+
}
|
|
296078
|
+
);
|
|
296079
|
+
if (offered("cash_out_status")) server2.registerTool(
|
|
296080
|
+
"cash_out_status",
|
|
296081
|
+
{ ...meta3("cash_out_status"), inputSchema: { id: external_exports.string().regex(/^(cd|wd)_[a-z2-7]{24}$/).describe("The cash-out's id, cd_\u2026 or wd_\u2026.") } },
|
|
296082
|
+
async ({ id }) => {
|
|
296083
|
+
const { cashOutStatus: cashOutStatus2 } = await Promise.resolve().then(() => (init_cashout(), cashout_exports));
|
|
296084
|
+
return text4(await cashOutStatus2(await cashoutDeps(), id));
|
|
296085
|
+
}
|
|
296086
|
+
);
|
|
296065
296087
|
if (offered("set_payout_settings")) {
|
|
296066
296088
|
server2.registerTool("set_payout_settings", { ...meta3("set_payout_settings"), inputSchema: settingsInput }, async (args) => {
|
|
296067
296089
|
const { readOrgPayouts: readOrgPayouts2, facilitatorHealth: facilitatorHealth2, oracleResolves: oracleResolves2 } = await Promise.resolve().then(() => (init_orgPayouts(), orgPayouts_exports));
|
|
@@ -296332,12 +296354,41 @@ ${pending.link}`);
|
|
|
296332
296354
|
return [];
|
|
296333
296355
|
}
|
|
296334
296356
|
})();
|
|
296357
|
+
const rooms = await (async () => {
|
|
296358
|
+
try {
|
|
296359
|
+
const [{ roomLines: roomLines2 }, invitesModule, roomsModule] = await Promise.all([Promise.resolve().then(() => (init_meRooms(), meRooms_exports)), Promise.resolve().then(() => (init_invites(), invites_exports)), Promise.resolve().then(() => (init_rooms(), rooms_exports))]);
|
|
296360
|
+
const signer3 = await inviteSigner(await principal2());
|
|
296361
|
+
const [page, invited, mineRooms, waiting, agents] = await Promise.all([
|
|
296362
|
+
invitesModule.readMyPage(SITE, signer3).catch(() => void 0),
|
|
296363
|
+
invitesModule.myInvitations(SITE, signer3).catch(() => null),
|
|
296364
|
+
roomsModule.myRooms(SITE, signer3).catch(() => null),
|
|
296365
|
+
fetch2(`${SITE}/api/waiting?address=${encodeURIComponent(signer3.address)}`, { signal: AbortSignal.timeout(2e4) }).then((r) => r.ok ? r.json() : null).catch(() => null),
|
|
296366
|
+
fetch2(`${SITE}/api/connect?principal=${encodeURIComponent(signer3.address)}`, { signal: AbortSignal.timeout(2e4) }).then((r) => r.ok ? r.json() : null).catch(() => null)
|
|
296367
|
+
]);
|
|
296368
|
+
const verified = page?.linkedin?.verifiedAt;
|
|
296369
|
+
return [
|
|
296370
|
+
"You, as the account area says it:",
|
|
296371
|
+
...roomLines2({
|
|
296372
|
+
page: page === void 0 ? null : page === null ? "none" : !verified ? "verify" : page.profile.listed === false ? "private" : "listed",
|
|
296373
|
+
work: invited && "invited" in invited ? invited.invited.filter((one) => one.answer === "sent").length : null,
|
|
296374
|
+
unread: mineRooms && "rooms" in mineRooms ? mineRooms.rooms.reduce((sum2, one) => sum2 + one.unread, 0) : null,
|
|
296375
|
+
inbox: Array.isArray(waiting?.waiting) ? waiting.waiting.length : null,
|
|
296376
|
+
money: { available: pays(Number(held[ASK_DENOM] ?? 0), ASK_DENOM), onAsks: onAsks ? pays(onAsks, "upay") : null },
|
|
296377
|
+
agents: Array.isArray(agents?.delegations) ? agents.delegations.length : null
|
|
296378
|
+
}).map((line2) => ` ${line2}`),
|
|
296379
|
+
""
|
|
296380
|
+
];
|
|
296381
|
+
} catch {
|
|
296382
|
+
return [];
|
|
296383
|
+
}
|
|
296384
|
+
})();
|
|
296335
296385
|
return text4(
|
|
296336
296386
|
[
|
|
296337
296387
|
`Address: ${mine}`,
|
|
296338
296388
|
actingNote(connection.acting) ?? connection.problem ?? "",
|
|
296339
296389
|
candidateWords2(connection.candidates) ?? "",
|
|
296340
296390
|
...news,
|
|
296391
|
+
...rooms,
|
|
296341
296392
|
/* The two places money lives, as the site says them: Available is this key's own, On your asks what its asks hold.
|
|
296342
296393
|
The review fee's coin, where it is not the reward's (mainnet: USDC rewards, PAY fees), is what covers the next
|
|
296343
296394
|
ask's checks, so it is said when there is any. In dollars, as every amount. The network fee is the gate's to
|
|
@@ -296390,7 +296441,7 @@ ${pending.link}`);
|
|
|
296390
296441
|
const { needsChain: needsChain2, verdictFacts: verdictFacts2 } = await Promise.resolve().then(() => (init_verdictSource(), verdictSource_exports));
|
|
296391
296442
|
const onChain = needsChain2(ours.evaluationByClaimId) ? await (await Promise.resolve().then(() => (init_claimVerdict(), claimVerdict_exports))).claimVerdictOnChain(ours.claimId) : null;
|
|
296392
296443
|
const facts = verdictFacts2(ours.evaluationByClaimId, onChain);
|
|
296393
|
-
const
|
|
296444
|
+
const said4 = verdictSays2(facts.status);
|
|
296394
296445
|
const paid = faceOf2(coinDisplay2(facts.amount ?? void 0), SANDBOX);
|
|
296395
296446
|
const arrived = paid && facts.amount?.length ? await sharedPays({ amount: facts.amount, is_oracle_payment: receipt.payments?.["approval"]?.is_oracle_payment }, null) : null;
|
|
296396
296447
|
const proofRaw = facts.verificationProof;
|
|
@@ -296407,7 +296458,7 @@ ${pending.link}`);
|
|
|
296407
296458
|
return checkFailed2(await readHeldClaim2(ask.oracle.url, key, ours.claimId));
|
|
296408
296459
|
} : void 0;
|
|
296409
296460
|
const why = await whyBlock(ours.claimId, proofRaw, ours.agentAddress === mine ? mint : void 0, failed ? { failed } : {});
|
|
296410
|
-
return text4([`#${collectionId}: ${
|
|
296461
|
+
return text4([`#${collectionId}: ${said4}.${paid ? ` Paid ${arrived ?? paid.text}.` : ""}`, `answer ${ours.claimId}`, `${SITE}/r/${collectionId}/trace/${encodeURIComponent(ours.claimId)}`, ...why, ...steps, ...tail].join("\n"));
|
|
296411
296462
|
}
|
|
296412
296463
|
if (local) {
|
|
296413
296464
|
server2.registerTool(
|
|
@@ -296462,7 +296513,7 @@ claude mcp add ${MCP_SERVER} ${Object.entries(callEnv).map(([name8, value]) => `
|
|
|
296462
296513
|
...npxCacheLines(),
|
|
296463
296514
|
...plugin,
|
|
296464
296515
|
...blocks,
|
|
296465
|
-
`Each agent makes its own key on first run and earns to its own address. This board (${SITE}) pays every reward in this network's own coin, said in dollars. The server reads the default, the deployment's addresses
|
|
296516
|
+
`Each agent makes its own key on first run and earns to its own address. This board (${SITE}) pays every reward in this network's own coin, said in dollars. The server reads the default, the deployment's addresses and the claim form every ask's rules bind to, from ${SITE}/api/config at boot (and again on a later call if that read failed), so nothing else needs setting.`,
|
|
296466
296517
|
/* A server that cannot post says so here, with what to set, before anyone tries. */
|
|
296467
296518
|
CLAIM_FORM ? bindingDetail() : `${bindingDetail()}
|
|
296468
296519
|
Set all three, ${CLAIM_FORM_ENV.join(", ")}, in this server's environment, to the values the deployment published (scripts/publish-vct.ts prints them).${callLine ? " The open-call line below carries the sandbox's." : ""}`,
|
|
@@ -296574,8 +296625,7 @@ Mapping pays for the report. What happens to a mapped pin afterwards is a separa
|
|
|
296574
296625
|
brief: external_exports.array(external_exports.string().max(1500)).max(8).optional().describe("The story, up to eight short paragraphs, in the person's words."),
|
|
296575
296626
|
lines: external_exports.array(external_exports.object({ text: external_exports.string().max(300), fail: external_exports.string().max(300).optional() })).max(5).optional().describe('The five requirements the jury reviews. For each, write the requirement in `text` and the condition that fails it in `fail`. Write `fail` as a clause completing "Fail this only if \u2026", for example "it names no page". Include all five.'),
|
|
296576
296627
|
mode: external_exports.enum(["competition", "hire"]).optional().describe("competition: a pick and runners-up beside the paid entries. hire: every entry that passes is paid the same, up to a number, and nobody is picked."),
|
|
296577
|
-
kind: external_exports.literal("review").optional().describe("review: a pro ask on Pro Asks, a review of an app or an agent.
|
|
296578
|
-
sponsor: external_exports.string().max(40).optional().describe("A pro ask: the Zone's slug, as list_marketplaces gives it. The pros you invite come from its roster; it earns the Zone's share."),
|
|
296628
|
+
kind: external_exports.literal("review").optional().describe("review: a pro ask on Pro Asks, a review of an app or an agent. Verified pros you invite try the scenarios and hand in review reports; every report that passes the lines is paid the same (a hire); by invitation only; the five lines default to the review's own unless given. Asky Pro Checker, the verifier, checks each report for its own fee per check, held with the reward."),
|
|
296579
296629
|
subject: external_exports.object({ name: external_exports.string().max(120), version: external_exports.string().max(40).optional(), where: external_exports.string().max(2048).optional() }).optional().describe("A review: what is reviewed, the version to test, and where a specialist finds it (a public address). Private access goes in the invitation note, never here."),
|
|
296580
296630
|
scenarios: external_exports.array(external_exports.string().max(300)).max(8).optional().describe("A review: the scenarios to try, one line each; every report must cover each with a step."),
|
|
296581
296631
|
report: external_exports.array(external_exports.string().max(60)).max(5).optional().describe("A review: extra section headings every report must have, besides the standard summary, steps, findings, recommendations and limitations. Empty is fine."),
|
|
@@ -296600,39 +296650,27 @@ Mapping pays for the report. What happens to a mapped pin afterwards is a separa
|
|
|
296600
296650
|
}
|
|
296601
296651
|
},
|
|
296602
296652
|
async ({ slug: named, clear, ...input }) => {
|
|
296603
|
-
const
|
|
296653
|
+
const call3 = await Promise.resolve().then(() => (init_call2(), call_exports2));
|
|
296604
296654
|
const { CALL_SLUG: CALL_SLUG2 } = await Promise.resolve().then(() => (init_terms(), terms_exports));
|
|
296605
|
-
if (
|
|
296606
|
-
const slug = named?.trim() ||
|
|
296655
|
+
if (call3.typedText(input).some((one) => isTainted(one))) return text4(TAINT_REFUSAL);
|
|
296656
|
+
const slug = named?.trim() || call3.nextSlug();
|
|
296607
296657
|
if (!CALL_SLUG2.test(slug)) return text4(`"${slug}" cannot name a call: lowercase letters, digits and dashes, starting with a letter, 3 to 40 long. Nothing was saved.`);
|
|
296608
|
-
const existing =
|
|
296658
|
+
const existing = call3.readDraft(slug);
|
|
296609
296659
|
const posted = existing ? Object.values(existing.posted).some(Boolean) || Boolean(existing.inFlight) : false;
|
|
296610
296660
|
const changing = clear || Object.values(input).some((value) => value !== void 0);
|
|
296611
296661
|
if (posted && changing) return text4(`Call "${slug}" is already posted: its terms were frozen with the money. Start a new call with another slug.`);
|
|
296612
|
-
const start = clear || !existing ?
|
|
296613
|
-
const
|
|
296614
|
-
|
|
296615
|
-
const notTaken = [];
|
|
296616
|
-
const namedSponsor = input.sponsor?.trim().toLowerCase();
|
|
296617
|
-
if (namedSponsor && CALL_SLUG2.test(namedSponsor)) {
|
|
296618
|
-
const checked = await marketplaces.resolveMarketplace(SITE, namedSponsor, NETWORK2, fetch2);
|
|
296619
|
-
if ("refused" in checked && !checked.unavailable) {
|
|
296620
|
-
notTaken.push(checked.refused);
|
|
296621
|
-
given2 = { ...input, sponsor: void 0 };
|
|
296622
|
-
}
|
|
296623
|
-
}
|
|
296624
|
-
const merged = call2.mergeDraft(start, given2);
|
|
296625
|
-
const coin = call2.callCoin(merged.draft, NETWORK2, ASK_DENOM);
|
|
296662
|
+
const start = clear || !existing ? call3.freshDraft(slug) : existing;
|
|
296663
|
+
const merged = call3.mergeDraft(start, input);
|
|
296664
|
+
const coin = call3.callCoin(merged.draft, NETWORK2, ASK_DENOM);
|
|
296626
296665
|
if (typeof coin !== "string") return text4(`Refused: ${coin.refused}. Nothing was saved.`);
|
|
296627
|
-
const refused2 =
|
|
296666
|
+
const refused2 = merged.refused;
|
|
296628
296667
|
const draft = coin !== ASK_DENOM ? { ...merged.draft, coin } : merged.draft;
|
|
296629
|
-
|
|
296668
|
+
call3.writeDraft(draft);
|
|
296630
296669
|
const coinSymbol = symbolOf(coin);
|
|
296631
296670
|
const acting = await principal2();
|
|
296632
296671
|
const held = await heldBy(acting, coin);
|
|
296633
296672
|
const holds = held === null ? null : pays(held.reward, coinSymbol);
|
|
296634
|
-
const
|
|
296635
|
-
const missing2 = call2.missingOf(draft.fields, { symbol: coinSymbol, holds, marketplaces: choices && "sponsors" in choices ? marketplaces.marketplaceChoices(choices.sponsors) : null });
|
|
296673
|
+
const missing2 = call3.missingOf(draft.fields, { symbol: coinSymbol, holds });
|
|
296636
296674
|
const out = [`Draft "${slug}" saved${posted ? " (posted)" : ""}.`];
|
|
296637
296675
|
if (refused2.length) out.push("", "Not taken:", ...refused2.map((one) => ` - ${one}`));
|
|
296638
296676
|
if (missing2.length) {
|
|
@@ -296641,7 +296679,7 @@ Mapping pays for the report. What happens to a mapped pin afterwards is a separa
|
|
|
296641
296679
|
"Still needed, in this order. Ask the person, a group at a time, in their words; never write the brief for them:",
|
|
296642
296680
|
...missing2.flatMap((one, index) => [` ${index + 1}. ${one.field}: ${one.question}`, ` e.g. ${one.example}`])
|
|
296643
296681
|
);
|
|
296644
|
-
const optional5 =
|
|
296682
|
+
const optional5 = call3.optionalOf(draft.fields, originOf(NETWORK2));
|
|
296645
296683
|
if (optional5.length) out.push("", "Optional, not given yet:", ...optional5.map((one) => ` - ${one}`));
|
|
296646
296684
|
return text4(out.join("\n"));
|
|
296647
296685
|
}
|
|
@@ -296651,28 +296689,25 @@ Mapping pays for the report. What happens to a mapped pin afterwards is a separa
|
|
|
296651
296689
|
const checker = await callChecker2(draft.fields.kind === "review");
|
|
296652
296690
|
if (checker.fee && checker.fee.denom !== coin) return text4(`Refused: ${checker.name} is paid in another coin than this call pays in, and a review pays in its verifier's coin. Start a new review.`);
|
|
296653
296691
|
const perCheck = checker.fee ? false : await callPerCheck(checker.address);
|
|
296654
|
-
const priced =
|
|
296692
|
+
const priced = call3.callShare(draft.fields, call3.callShares(draft.fields) ? await callSplit() : null);
|
|
296655
296693
|
if ("unread" in priced) {
|
|
296656
296694
|
out.push("", "Not priced yet: this call is a hire by invitation or application, which carries the network's share, and the fee split could not be read just now. The draft is saved; call draft_call again in a minute.");
|
|
296657
296695
|
return text4(out.join("\n"));
|
|
296658
296696
|
}
|
|
296659
296697
|
const proAsk = draft.fields.kind === "review";
|
|
296660
|
-
const
|
|
296661
|
-
const sponsor = resolved && "sponsor" in resolved ? resolved.sponsor : null;
|
|
296662
|
-
const sponsorProblem = resolved && "refused" in resolved ? resolved : null;
|
|
296663
|
-
const plan = call2.callPlan(draft, { poster: shortPoster, checkerLegBase: (terms) => checker.fee ? checker.fee.base : perCheck ? 0 : checkerLegBase2(FEE_DENOM, terms, CHECK_REWARD), oracle: checker.address || "the verifier", share: priced.share, feeInReward: Boolean(checker.fee) || coin === FEE_DENOM, sponsor });
|
|
296698
|
+
const plan = call3.callPlan(draft, { poster: shortPoster, checkerLegBase: (terms) => checker.fee ? checker.fee.base : perCheck ? 0 : checkerLegBase2(FEE_DENOM, terms, CHECK_REWARD), oracle: checker.address || "the verifier", share: priced.share, feeInReward: Boolean(checker.fee) || coin === FEE_DENOM });
|
|
296664
296699
|
const feeTotal = plan.legs.reduce((sum2, one) => sum2 + one.feeBase, 0);
|
|
296665
296700
|
const finalOk = draft.fields.kind === "review" ? acting?.principal ?? null : null;
|
|
296666
|
-
const preview =
|
|
296667
|
-
const twoCoins = acting && feeTotal > 0 ? `Can't post as ${acting.principal}: ${
|
|
296701
|
+
const preview = call3.legTerms(draft, "entries", { poster: shortPoster, dates: plan.dates, oracle: { kind: "oracle", address: checker.address || "the verifier" }, approver: finalOk, share: plan.share });
|
|
296702
|
+
const twoCoins = acting && feeTotal > 0 ? `Can't post as ${acting.principal}: ${call3.callTwoCoins}.` : null;
|
|
296668
296703
|
const { capCoinRefusal: capCoinRefusal2, capIn: capIn2 } = await Promise.resolve().then(() => (init_hq(), hq_exports));
|
|
296669
296704
|
const otherCoin = capCoinRefusal2(acting, coin, checker.fee ? `${SITE}/connect` : void 0);
|
|
296670
|
-
const capped4 =
|
|
296705
|
+
const capped4 = call3.capWords(plan.legs, CAP_BASE, coinSymbol, NETWORK2);
|
|
296671
296706
|
const keyOnly = !acting && feeTotal > 0;
|
|
296672
|
-
const blocked = capped4.length > 0 || Boolean(otherCoin) || Boolean(twoCoins) && draft.fields.kind !== "review"
|
|
296707
|
+
const blocked = capped4.length > 0 || Boolean(otherCoin) || Boolean(twoCoins) && draft.fields.kind !== "review";
|
|
296673
296708
|
const m = draft.fields.money;
|
|
296674
296709
|
const { shareWords: shareWords2 } = await Promise.resolve().then(() => (init_callRead(), callRead_exports));
|
|
296675
|
-
const proMoney =
|
|
296710
|
+
const proMoney = proAsk && Boolean(plan.share);
|
|
296676
296711
|
const who = draft.fields.kind === "review" ? "pro" : "hired person";
|
|
296677
296712
|
const onTop = (leg) => plan.share && !proMoney ? `; the network's share (${shareWords2(plan.share, "today")}) is added on top, so the leg pays ${pays(leg.legBase, coinSymbol)}` : "";
|
|
296678
296713
|
const legRows = plan.legs.map(
|
|
@@ -296685,18 +296720,17 @@ Mapping pays for the report. What happens to a mapped pin afterwards is a separa
|
|
|
296685
296720
|
twoCoins ?? "",
|
|
296686
296721
|
otherCoin ? `Can't post as it stands: ${otherCoin}.` : "",
|
|
296687
296722
|
!hire && m.prize < m.entryEach ? `The prize (${face(m.prize, coinSymbol)}) is less than one entry earns (${face(m.entryEach, coinSymbol)}).` : "",
|
|
296688
|
-
|
|
296689
|
-
draft.fields.access === "invite" && !draft.fields.invite?.length ? proAsk ? `Nobody invited yet: find_pro${draft.fields.sponsor ? ` with sponsor: "${draft.fields.sponsor}"` : ""} suggests pros from ${sponsor ? `${sponsor.name}'s` : "the Zone's"} roster; add them with invite now, or invite_to_call after it posts.` : 'By invitation, and nobody invited yet: add invite (addresses, @handles, "link") now, or invite_to_call after it posts.' : "",
|
|
296723
|
+
draft.fields.access === "invite" && !draft.fields.invite?.length ? proAsk ? "Nobody invited yet: find_pro suggests verified pros; add them with invite now, or invite_to_call after it posts." : 'By invitation, and nobody invited yet: add invite (addresses, @handles, "link") now, or invite_to_call after it posts.' : "",
|
|
296690
296724
|
draft.fields.access === "apply" ? "By application: people apply on the call's page or with apply_to_call; you say yes with decide_application before they can enter." : "",
|
|
296691
|
-
...
|
|
296725
|
+
...call3.balanceWarnings(held, { totalBase: plan.totalBase, feeTotal, symbol: coinSymbol, network: NETWORK2, feeWords }),
|
|
296692
296726
|
acting?.cap && !otherCoin && Number(capIn2(acting, coin)?.remainingBase ?? 0) < plan.totalBase ? `Their cap has ${pays(Number(capIn2(acting, coin)?.remainingBase ?? 0), coinSymbol)} left; the call locks ${pays(plan.totalBase, coinSymbol)}. They raise it at ${SITE}/connect.` : "",
|
|
296693
|
-
keyOnly ? `Not connected, and a connection would not carry this call: ${
|
|
296727
|
+
keyOnly ? `Not connected, and a connection would not carry this call: ${call3.callTwoCoins}. With plain_key: true it posts as this key itself, ${await address2()}, from its own money.` : !acting ? `Not connected: post_call refuses until the person connects this key (connect_account gives them the link). For a rehearsal, plain_key: true posts as this key itself, ${await address2()}, from its own money.` : ""
|
|
296694
296728
|
].filter(Boolean);
|
|
296695
296729
|
out.push(
|
|
296696
296730
|
"",
|
|
296697
296731
|
blocked ? "Drafted, but post_call would refuse it as it stands (the warnings say why). This is the call as an entrant's AI will read it:" : "Ready. This is the call as an entrant's AI will read it:",
|
|
296698
296732
|
"",
|
|
296699
|
-
|
|
296733
|
+
call3.callReadout(preview, { id: "(the entries ask, once posted)", symbol: coinSymbol, network: NETWORK2 }),
|
|
296700
296734
|
"",
|
|
296701
296735
|
"What each leg locks:",
|
|
296702
296736
|
...legRows,
|
|
@@ -296733,17 +296767,17 @@ Mapping pays for the report. What happens to a mapped pin afterwards is a separa
|
|
|
296733
296767
|
},
|
|
296734
296768
|
async ({ slug, confirm, plain_key, pay_by }) => {
|
|
296735
296769
|
const card = pay_by === "card";
|
|
296736
|
-
const
|
|
296737
|
-
const found =
|
|
296770
|
+
const call3 = await Promise.resolve().then(() => (init_call2(), call_exports2));
|
|
296771
|
+
const found = call3.readDraft(slug);
|
|
296738
296772
|
if (!found) return text4(`No draft called "${slug}". Start one with draft_call.`);
|
|
296739
296773
|
const review = found.fields.kind === "review";
|
|
296740
296774
|
const checker = await callChecker2(review);
|
|
296741
296775
|
const linkOf = (posted2) => review ? `${EXPERT_SITE}/pro/reviews/${posted2.entries?.id ?? slug}` : `${SITE}/opencall/${slug}`;
|
|
296742
|
-
const settled = found.inFlight ? await
|
|
296776
|
+
const settled = found.inFlight ? await call3.settleInFlight(slug, call3.indexLookup) : null;
|
|
296743
296777
|
if (settled?.state === "pending") return text4(settled.words);
|
|
296744
296778
|
if (settled?.state === "landed") {
|
|
296745
296779
|
nudge("hire", settled.id, checker.at);
|
|
296746
|
-
const after2 =
|
|
296780
|
+
const after2 = call3.nextLeg(settled.draft);
|
|
296747
296781
|
return text4(
|
|
296748
296782
|
[
|
|
296749
296783
|
`The earlier post landed: ${LEG_WORDS[settled.leg]} is #${settled.id}. It is recorded, and nothing was posted twice.`,
|
|
@@ -296752,21 +296786,17 @@ Mapping pays for the report. What happens to a mapped pin afterwards is a separa
|
|
|
296752
296786
|
);
|
|
296753
296787
|
}
|
|
296754
296788
|
const draft = settled?.draft ?? found;
|
|
296755
|
-
const coin =
|
|
296789
|
+
const coin = call3.callCoin(draft, NETWORK2, ASK_DENOM);
|
|
296756
296790
|
if (typeof coin !== "string") return text4(`Refused: ${coin.refused}. Nothing was posted.`);
|
|
296757
296791
|
const coinSymbol = symbolOf(coin);
|
|
296758
|
-
const next =
|
|
296792
|
+
const next = call3.nextLeg(draft);
|
|
296759
296793
|
const ids = ["prize", "runnersUp", "entries"].flatMap((leg2) => draft.posted[leg2] ? [`${LEG_WORDS[leg2]} #${draft.posted[leg2].id}`] : []);
|
|
296760
296794
|
if (!next) return text4(`Everything is posted: ${ids.join(", ")}.
|
|
296761
296795
|
The call: ${linkOf(draft.posted)}`);
|
|
296762
|
-
if (
|
|
296763
|
-
if (!call2.isReady(draft.fields)) return text4(`"${slug}" is not ready: ${call2.missingOf(draft.fields, { symbol: coinSymbol, holds: null }).map((one) => one.field).join(", ")} still missing. Finish it with draft_call.`);
|
|
296796
|
+
if (!call3.isReady(draft.fields)) return text4(`"${slug}" is not ready: ${call3.missingOf(draft.fields, { symbol: coinSymbol, holds: null }).map((one) => one.field).join(", ")} still missing. Finish it with draft_call.`);
|
|
296764
296797
|
const cannot = await unjudged();
|
|
296765
296798
|
if (cannot) return text4(cannot);
|
|
296766
296799
|
if (!checker.address) return text4("No verifier is configured on this deployment, so nothing could judge the entries. Refusing rather than posting a call nobody can settle.");
|
|
296767
|
-
const marketplace = review ? await (await Promise.resolve().then(() => (init_marketplaces(), marketplaces_exports))).resolveMarketplace(SITE, draft.fields.sponsor, NETWORK2, fetch2) : null;
|
|
296768
|
-
if (marketplace && "refused" in marketplace) return text4(`Refused: ${marketplace.refused} Nothing was posted.`);
|
|
296769
|
-
const sponsor = marketplace?.sponsor ?? null;
|
|
296770
296800
|
const acting = card || plain_key && review ? null : await principal2();
|
|
296771
296801
|
const pick2 = acting || card || confirm ? null : await unchosen();
|
|
296772
296802
|
if (!acting && !plain_key && !card) {
|
|
@@ -296778,15 +296808,15 @@ Then call post_call again. Nothing was posted.`);
|
|
|
296778
296808
|
const poster = acting?.principal ?? await address2();
|
|
296779
296809
|
if (checker.fee && checker.fee.denom !== coin) return text4(`Refused: ${checker.name} is paid in another coin than this call pays in, and a review pays in its verifier's coin. Start a new review. Nothing was posted.`);
|
|
296780
296810
|
const perCheck = checker.fee ? false : await callPerCheck(checker.address);
|
|
296781
|
-
const split3 =
|
|
296782
|
-
const priced =
|
|
296783
|
-
if ("unread" in priced) return text4(
|
|
296784
|
-
const plan =
|
|
296811
|
+
const split3 = call3.callShares(draft.fields) ? await callSplit() : null;
|
|
296812
|
+
const priced = call3.callShare(draft.fields, split3);
|
|
296813
|
+
if ("unread" in priced) return text4(call3.SHARE_UNREAD);
|
|
296814
|
+
const plan = call3.callPlan(draft, { poster: `${poster.slice(0, 10)}\u2026${poster.slice(-4)}`, checkerLegBase: (terms) => checker.fee ? checker.fee.base : perCheck ? 0 : checkerLegBase2(FEE_DENOM, terms, CHECK_REWARD), oracle: checker.address, share: priced.share, feeInReward: Boolean(checker.fee) || coin === FEE_DENOM });
|
|
296785
296815
|
const feeTotal = plan.legs.reduce((sum2, one) => sum2 + one.feeBase, 0);
|
|
296786
296816
|
const total = pays(plan.totalBase, coinSymbol);
|
|
296787
296817
|
const { feeLine: feeLine2 } = await Promise.resolve().then(() => (init_feeLine(), feeLine_exports));
|
|
296788
|
-
const moneySentence =
|
|
296789
|
-
if (acting && feeTotal > 0) return text4(`Refused: ${
|
|
296818
|
+
const moneySentence = review && plan.share ? feeLine2({ split: plan.share, net: draft.fields.money.entryEach, symbol: coinSymbol, network: NETWORK2 }) : null;
|
|
296819
|
+
if (acting && feeTotal > 0) return text4(`Refused: ${call3.callTwoCoins}.${review ? ` ${PLAIN_REVIEW}` : ""} Nothing was posted.`);
|
|
296790
296820
|
const approver = review && acting ? acting.principal : null;
|
|
296791
296821
|
if (approver) {
|
|
296792
296822
|
const notReady = await approverRefusal(approver, async (who) => (await Promise.resolve().then(() => (init_personReview(), personReview_exports))).approverReady(who, { self: true }));
|
|
@@ -296800,11 +296830,11 @@ Then call post_call again. Nothing was posted.`);
|
|
|
296800
296830
|
const payDraft = await Promise.resolve().then(() => (init_payDraft(), payDraft_exports));
|
|
296801
296831
|
const rewardBase = plan.legs.reduce((sum2, one) => sum2 + one.payBase * one.escrowSpots, 0);
|
|
296802
296832
|
const quote = payDraft.quoteOf(rewardBase, plan.totalBase + feeTotal - rewardBase);
|
|
296803
|
-
const
|
|
296804
|
-
if (typeof
|
|
296805
|
-
if (!confirm) return text4([`Call "${slug}" is ${order2.length} Asks: ${order2.map((one) => LEG_WORDS[one]).join(", then ")}.`, ...moneySentence ? [moneySentence] : [],
|
|
296833
|
+
const words4 = payDraft.cardPreview(quote);
|
|
296834
|
+
if (typeof words4 !== "string") return text4(`${words4.refused} Nothing was posted.`);
|
|
296835
|
+
if (!confirm) return text4([`Call "${slug}" is ${order2.length} Asks: ${order2.map((one) => LEG_WORDS[one]).join(", then ")}.`, ...moneySentence ? [moneySentence] : [], words4].join("\n"));
|
|
296806
296836
|
if (confirm.trim() !== payDraft.confirmToken(quote)) return text4(`Refused: confirm said "${confirm}" but the person pays ${payDraft.confirmToken(quote)}. Preview it again.`);
|
|
296807
|
-
const terms = { slug, fields: draft.fields, dates: plan.dates, legs: plan.legs, checker: checker.address, perCheck, ...checker.fee ? { fee: checker.fee } : {}, ...plan.share ? { share: plan.share } : {}
|
|
296837
|
+
const terms = { slug, fields: draft.fields, dates: plan.dates, legs: plan.legs, checker: checker.address, perCheck, ...checker.fee ? { fee: checker.fee } : {}, ...plan.share ? { share: plan.share } : {} };
|
|
296808
296838
|
return text4(await payDraft.saveDraft(SITE, { kind: "call", terms, quote, network: NETWORK2 }, fetch2));
|
|
296809
296839
|
}
|
|
296810
296840
|
if (!confirm) {
|
|
@@ -296820,21 +296850,21 @@ Then call post_call again. Nothing was posted.`);
|
|
|
296820
296850
|
actingNote(acting) ?? (review ? "Posting from your own account (this key), not the person's account; the AI decides each report alone, with no final OK from the person." : `Posting as this key, ${poster}.`),
|
|
296821
296851
|
...pick2 ? [pick2] : [],
|
|
296822
296852
|
`Spent today (call): ${spentWords("call", coinSymbol)}. Every tool together: ${spentAllWords()}.`,
|
|
296823
|
-
...
|
|
296824
|
-
...
|
|
296853
|
+
...call3.capWords(plan.legs.filter((one) => !draft.posted[one.leg]), CAP_BASE, coinSymbol, NETWORK2),
|
|
296854
|
+
...call3.balanceWarnings(held2, { totalBase: plan.totalBase, feeTotal, symbol: coinSymbol, network: NETWORK2, feeWords }),
|
|
296825
296855
|
"",
|
|
296826
296856
|
`To go ahead, call again with confirm: "${total}".`
|
|
296827
296857
|
].join("\n")
|
|
296828
296858
|
);
|
|
296829
296859
|
}
|
|
296830
|
-
if (!
|
|
296831
|
-
if (
|
|
296860
|
+
if (!call3.confirms(confirm, plan.totalBase, coinSymbol)) return text4(`Refused: confirm said "${confirm}" but the call locks ${total}. Preview it again.`);
|
|
296861
|
+
if (call3.overCap(leg, CAP_BASE)) return text4(`Refused: this leg locks ${pays(leg.escrowBase, coinSymbol)}, over your own ${face(MAX_PER_ASK, coinSymbol)} per-ask cap (OPENHANDS_MAX_PER_ASK_USD, which you set: raise or remove it where you set it). Paying by card (pay_by "card") is not capped.`);
|
|
296832
296862
|
if (ids.length === 0) {
|
|
296833
|
-
const taken = await fetch2(`${SITE}/api/board?campaign=${encodeURIComponent(
|
|
296863
|
+
const taken = await fetch2(`${SITE}/api/board?campaign=${encodeURIComponent(call3.tagOf(draft))}&size=5`, { signal: AbortSignal.timeout(15e3) }).then((response) => response.ok ? response.json() : null).catch(() => null);
|
|
296834
296864
|
if (taken?.rows?.length) return text4(`Refused: "${slug}" already names a call with open Asks on this board. Draft it under another slug with draft_call. Nothing was posted.`);
|
|
296835
296865
|
}
|
|
296836
296866
|
const { balancesOfStrict: balancesOfStrict2 } = await Promise.resolve().then(() => (init_balance(), balance_exports));
|
|
296837
|
-
const refusedBefore = await
|
|
296867
|
+
const refusedBefore = await call3.preCheck(leg, {
|
|
296838
296868
|
acting,
|
|
296839
296869
|
poster,
|
|
296840
296870
|
askDenom: coin,
|
|
@@ -296851,7 +296881,7 @@ Then call post_call again. Nothing was posted.`);
|
|
|
296851
296881
|
const key = await loadKey2();
|
|
296852
296882
|
let posted;
|
|
296853
296883
|
try {
|
|
296854
|
-
posted = await
|
|
296884
|
+
posted = await call3.postNextLeg(slug, {
|
|
296855
296885
|
site: SITE,
|
|
296856
296886
|
askDenom: coin,
|
|
296857
296887
|
checker: checker.address,
|
|
@@ -296864,14 +296894,13 @@ Then call post_call again. Nothing was posted.`);
|
|
|
296864
296894
|
mnemonic: key.mnemonic,
|
|
296865
296895
|
nudge: (event, id) => nudge(event, id, checker.at),
|
|
296866
296896
|
charge: (escrowBase) => chargeDay("call", escrowBase / MICRO6),
|
|
296867
|
-
feeSplit: split3
|
|
296868
|
-
sponsor
|
|
296897
|
+
feeSplit: split3
|
|
296869
296898
|
});
|
|
296870
296899
|
} catch (error54) {
|
|
296871
|
-
if (error54 instanceof
|
|
296900
|
+
if (error54 instanceof call3.InFlightError || error54 instanceof call3.PostRefused) return text4(error54.message);
|
|
296872
296901
|
if (isUnanchored(error54)) return text4(unanchoredWords(error54));
|
|
296873
296902
|
if (error54 instanceof Error && error54.name === "TxFailed") {
|
|
296874
|
-
if (
|
|
296903
|
+
if (call3.feeUnpaid(error54, coin)) return text4(`Nothing moved: this agent's key could not pay the network fee for ${LEG_WORDS[next]}. Call post_call again in a minute; it arranges the fee before it signs anything. If it is refused again, tell the person the network fee could not be arranged just now.`);
|
|
296875
296904
|
return text4(`The network refused ${LEG_WORDS[next]}: ${error54.message}. Nothing moved. Fix that (often what the account holds, or its cap) and call post_call again.`);
|
|
296876
296905
|
}
|
|
296877
296906
|
return text4(
|
|
@@ -296881,14 +296910,14 @@ Then call post_call again. Nothing was posted.`);
|
|
|
296881
296910
|
if ("done" in posted) return text4(`Everything is posted.
|
|
296882
296911
|
The call: ${linkOf(posted.draft.posted)}`);
|
|
296883
296912
|
const done = order2.filter((one) => posted.draft.posted[one]).length;
|
|
296884
|
-
const after =
|
|
296913
|
+
const after = call3.nextLeg(posted.draft);
|
|
296885
296914
|
const hire = posted.draft.fields.mode === "hire";
|
|
296886
296915
|
const held = posted.screen?.verdict === "hold" ? heldWords(posted.screen.reason) : null;
|
|
296887
296916
|
const invited = !after && posted.draft.fields.access && posted.draft.fields.access !== "public" ? await writeDraftInvites(posted.draft, posted.id, acting) : null;
|
|
296888
296917
|
return text4(
|
|
296889
296918
|
[
|
|
296890
296919
|
`${done} of ${order2.length} posted: ${LEG_WORDS[posted.leg]}, #${posted.id}${acting ? `, as ${acting.principal}` : ""}, locking ${pays(posted.plan.escrowBase, coinSymbol)}.`,
|
|
296891
|
-
|
|
296920
|
+
moneySentence ?? "",
|
|
296892
296921
|
held ?? "",
|
|
296893
296922
|
after ? `Call post_call again for ${LEG_WORDS[after]}.` : [
|
|
296894
296923
|
held ? `The call is posted but not yet open: ${linkOf(posted.draft.posted)} says so until a person clears the entries. Once it is open:` : await liveLine(posted.id, linkOf(posted.draft.posted)),
|
|
@@ -296912,15 +296941,15 @@ ${allowLine(SITE, posted.id, approver, acting?.principal ?? null)}` : `Every rep
|
|
|
296912
296941
|
async function writeDraftInvites(draft, entriesId, acting) {
|
|
296913
296942
|
const invitesModule = await Promise.resolve().then(() => (init_invites(), invites_exports));
|
|
296914
296943
|
const callModule = await Promise.resolve().then(() => (init_call2(), call_exports2));
|
|
296915
|
-
const
|
|
296916
|
-
if (
|
|
296944
|
+
const words4 = draft.fields.invite ?? [];
|
|
296945
|
+
if (words4.length === 0)
|
|
296917
296946
|
return [
|
|
296918
|
-
draft.fields.kind === "review"
|
|
296947
|
+
draft.fields.kind === "review" ? `Nobody is on the list yet: find_pro suggests verified pros; then invite_to_call slug "${draft.slug}" with the @handles the person chooses.` : draft.fields.access === "invite" ? `Nobody is on the list yet: invite_to_call slug "${draft.slug}" with addresses, @handles, or "link" for each single-use link.` : ""
|
|
296919
296948
|
].filter(Boolean);
|
|
296920
|
-
const { items, problems } = invitesModule.inviteItemsOf(
|
|
296949
|
+
const { items, problems } = invitesModule.inviteItemsOf(words4);
|
|
296921
296950
|
const answer = items.length ? await invitesModule.writeInvitesPatiently(SITE, await inviteSigner(acting), entriesId, items, draft.fields.inviteNote ? { note: draft.fields.inviteNote } : {}) : { written: [], problems: [], tries: 0 };
|
|
296922
296951
|
if ("refused" in answer) {
|
|
296923
|
-
const again = `invite_to_call slug "${draft.slug}" invite ${JSON.stringify(
|
|
296952
|
+
const again = `invite_to_call slug "${draft.slug}" invite ${JSON.stringify(words4)}${draft.fields.inviteNote ? ` note ${JSON.stringify(draft.fields.inviteNote)}` : ""}`;
|
|
296924
296953
|
return [
|
|
296925
296954
|
answer.code === invitesModule.NOT_KNOWN_YET ? `Nobody is on the list yet: asked ${answer.tries} times, the board could not name #${entriesId}'s poster (${answer.refused}). The names are kept in the draft. In a minute, run ${again}; until then nobody can enter.` : `The list could not be written: ${answer.refused}. Nobody is on it yet; run ${again}.`
|
|
296926
296955
|
];
|
|
@@ -296945,12 +296974,12 @@ ${allowLine(SITE, posted.id, approver, acting?.principal ?? null)}` : `Every rep
|
|
|
296945
296974
|
return " Copy the links now: they could not be kept on this machine, and only you have them. You can always make a new link with invite_to_call.";
|
|
296946
296975
|
}
|
|
296947
296976
|
}
|
|
296948
|
-
async function writeAskInvites(askId,
|
|
296949
|
-
if (
|
|
296977
|
+
async function writeAskInvites(askId, words4, acting) {
|
|
296978
|
+
if (words4.length === 0) return ['Nobody is on the list yet: invite_to_call with addresses, @handles, or "link" for each single-use link.'];
|
|
296950
296979
|
const invitesModule = await Promise.resolve().then(() => (init_invites(), invites_exports));
|
|
296951
|
-
const { items, problems } = invitesModule.inviteItemsOf(
|
|
296980
|
+
const { items, problems } = invitesModule.inviteItemsOf(words4);
|
|
296952
296981
|
const answer = await invitesModule.writeInvitesPatiently(SITE, await inviteSigner(acting), askId, items);
|
|
296953
|
-
if ("refused" in answer) return [`The list could not be written: ${answer.refused}. Nobody is on it yet; in a minute run invite_to_call collectionId "${askId}" invite ${JSON.stringify(
|
|
296982
|
+
if ("refused" in answer) return [`The list could not be written: ${answer.refused}. Nobody is on it yet; in a minute run invite_to_call collectionId "${askId}" invite ${JSON.stringify(words4)}.`];
|
|
296954
296983
|
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
296955
296984
|
const kept = answer.written.map((one) => ({ via: one.via, collectionId: askId, at, ...one.id !== void 0 ? { id: one.id } : {}, ...one.token ? { token: one.token } : {}, ...one.address ? { address: one.address } : {}, ...one.handle ? { handle: one.handle } : {} }));
|
|
296956
296985
|
const saved = kept.length ? await keptOnMachine(askId, kept) : "";
|
|
@@ -297011,8 +297040,8 @@ ${allowLine(SITE, posted.id, approver, acting?.principal ?? null)}` : `Every rep
|
|
|
297011
297040
|
`Invited on #${entriesId} (${kept.length}):`,
|
|
297012
297041
|
...inviteLines(kept, await isReview(draft, entriesId)),
|
|
297013
297042
|
...[...problems, ...answer.problems].map((one) => ` not invited: ${one}`),
|
|
297014
|
-
/* A pro ask takes only
|
|
297015
|
-
answer.problems.some((one) => invitesModule.OFF_ROSTER.test(one)) ?
|
|
297043
|
+
/* A pro ask takes only verified pros; say so once, and where they are found. */
|
|
297044
|
+
answer.problems.some((one) => invitesModule.OFF_ROSTER.test(one)) ? `${invitesModule.NOT_VERIFIED} find_pro suggests them; connect_linkedin verifies a pro.` : "",
|
|
297016
297045
|
kept.some((one) => one.via === "link") ? `Hand each link to one person.${saved}` : ""
|
|
297017
297046
|
].filter(Boolean).join("\n")
|
|
297018
297047
|
);
|
|
@@ -297231,14 +297260,14 @@ ${allowLine(SITE, posted.id, approver, acting?.principal ?? null)}` : `Every rep
|
|
|
297231
297260
|
confirm: external_exports.boolean().optional().describe("false (the default) previews what would be sent; true sends it, once the person has said yes to the preview.")
|
|
297232
297261
|
}
|
|
297233
297262
|
},
|
|
297234
|
-
async ({ collectionId, with: who, text:
|
|
297263
|
+
async ({ collectionId, with: who, text: words4, confirm }) => {
|
|
297235
297264
|
if (!confirm)
|
|
297236
297265
|
return text4(
|
|
297237
297266
|
[
|
|
297238
297267
|
`This is what would happen in the room on pro ask #${collectionId}${who ? ` with ${who.startsWith("ixo1") ? who : `@${who.replace(/^@/, "").toLowerCase()}`}` : ""}:`,
|
|
297239
297268
|
"- This message is sent, and the other side of the room gets a notice:",
|
|
297240
297269
|
"",
|
|
297241
|
-
|
|
297270
|
+
words4,
|
|
297242
297271
|
"",
|
|
297243
297272
|
"Show this to the person. Then call again with the same values and confirm: true. Nothing was sent."
|
|
297244
297273
|
].join("\n")
|
|
@@ -297246,7 +297275,7 @@ ${allowLine(SITE, posted.id, approver, acting?.principal ?? null)}` : `Every rep
|
|
|
297246
297275
|
const roomsModule = await Promise.resolve().then(() => (init_rooms(), rooms_exports));
|
|
297247
297276
|
const invitesModule = await Promise.resolve().then(() => (init_invites(), invites_exports));
|
|
297248
297277
|
const signer3 = await inviteSigner(await principal2());
|
|
297249
|
-
const sent = await roomsModule.sendToRoom(SITE, signer3, collectionId,
|
|
297278
|
+
const sent = await roomsModule.sendToRoom(SITE, signer3, collectionId, words4, who ? { with: who } : {});
|
|
297250
297279
|
if ("refused" in sent) return text4(await roomRefusal(sent, collectionId, who, "send_message", signer3));
|
|
297251
297280
|
const toPoster = sent.pro === roomsModule.actorOf(signer3);
|
|
297252
297281
|
const page = await invitesModule.readPage(SITE, { address: sent.pro }).catch(() => null);
|
|
@@ -297266,7 +297295,6 @@ The room's page: ${roomPage(SITE, collectionId, page?.profile.handle ?? sent.pro
|
|
|
297266
297295
|
rate: external_exports.object({ amount: external_exports.number().positive(), unit: external_exports.enum(["hour", "day", "deliverable"]), coin: external_exports.enum(["USDC", "IXO"]) }).nullable().optional(),
|
|
297267
297296
|
links: external_exports.array(external_exports.string().url().max(2048)).max(6).optional(),
|
|
297268
297297
|
availability: external_exports.enum(["open", "busy", "closed"]).optional(),
|
|
297269
|
-
invitable: external_exports.boolean().optional().describe("May posters invite them by handle? Default true."),
|
|
297270
297298
|
listed: external_exports.boolean().optional().describe("Public (true) or private (false): a private page is off asks.world, the directory and search, and only someone who types the exact handle or address can invite them. Left out, the page keeps what it says now (public for a new page)."),
|
|
297271
297299
|
avatar: external_exports.string().max(2048).optional().describe("Their picture: a file on this machine (png, jpg or webp, up to 5 MB) or an https address. Uploaded for them; square works best."),
|
|
297272
297300
|
banner: external_exports.string().max(2048).optional().describe("A wide picture across the top of the page: a file on this machine or an https address. About 3:1."),
|
|
@@ -297325,7 +297353,8 @@ The room's page: ${roomPage(SITE, collectionId, page?.profile.handle ?? sent.pro
|
|
|
297325
297353
|
does: page.does ?? [],
|
|
297326
297354
|
links: page.links ?? [],
|
|
297327
297355
|
availability: page.availability ?? "open",
|
|
297328
|
-
|
|
297356
|
+
/* D3: "may posters invite them" is Open to work, said once: the signed field follows availability. */
|
|
297357
|
+
invitable: (page.availability ?? "open") === "open",
|
|
297329
297358
|
rate: page.rate ?? null,
|
|
297330
297359
|
...avatar ? { avatar: /^https:\/\//.test(avatar) ? avatar : void 0 } : {},
|
|
297331
297360
|
...banner ? { banner: /^https:\/\//.test(banner) ? banner : void 0 } : {},
|
|
@@ -297369,93 +297398,32 @@ ${page.linkedin?.credentialUrl || page.linkedin?.credential ? `${credentialWords
|
|
|
297369
297398
|
|
|
297370
297399
|
` : ""}Edit the profile at ${EXPERT_SITE}/pro/profile.${page.linkedin ? "" : " Next: connect_linkedin verifies it, so you can be invited to pro asks."}`);
|
|
297371
297400
|
});
|
|
297372
|
-
if (offered("list_marketplaces")) server2.registerTool("list_marketplaces", { ...meta3("list_marketplaces"), inputSchema: {} }, async () => {
|
|
297373
|
-
const marketplaces = await Promise.resolve().then(() => (init_marketplaces(), marketplaces_exports));
|
|
297374
|
-
const list7 = await marketplaces.readMarketplaces(SITE, fetch2);
|
|
297375
|
-
if ("unavailable" in list7) return text4(`${list7.unavailable}. Try again in a minute; nothing about the Zones is known until it answers.`);
|
|
297376
|
-
const rows2 = await Promise.all(list7.sponsors.map(async (sponsor) => {
|
|
297377
|
-
const one = await marketplaces.readMarketplace(SITE, sponsor.slug, fetch2);
|
|
297378
|
-
return { sponsor, roster: "sponsor" in one && one.counts ? one.counts.checked : null };
|
|
297379
|
-
}));
|
|
297380
|
-
return text4(marketplaces.marketplacesWords(rows2, SITE));
|
|
297381
|
-
});
|
|
297382
297401
|
if (offered("find_pro")) server2.registerTool(
|
|
297383
297402
|
"find_pro",
|
|
297384
297403
|
{
|
|
297385
297404
|
...meta3("find_pro"),
|
|
297386
297405
|
inputSchema: {
|
|
297387
|
-
|
|
297388
|
-
q: external_exports.string().max(60).optional().describe("What the pro ask needs, or any words (Android, payments, a name): searched across each pro's page, as the directory's search box does."),
|
|
297406
|
+
q: external_exports.string().max(60).optional().describe("What the pro ask needs, or any words (Android, payments, a name): searched across each listed pro's page, as the directory's search box does."),
|
|
297389
297407
|
available: external_exports.boolean().optional().describe("true: only pros open to work now."),
|
|
297390
|
-
handle: external_exports.string().max(64).optional().describe("One person's page instead: their @handle or ixo1 address.")
|
|
297408
|
+
handle: external_exports.string().max(64).optional().describe("One person's public page instead: their exact @handle or ixo1 address.")
|
|
297391
297409
|
}
|
|
297392
297410
|
},
|
|
297393
|
-
async ({
|
|
297394
|
-
const marketplaces = await Promise.resolve().then(() => (init_marketplaces(), marketplaces_exports));
|
|
297411
|
+
async ({ q, available, handle: handle2 }) => {
|
|
297395
297412
|
if (handle2) {
|
|
297396
297413
|
const invitesModule = await Promise.resolve().then(() => (init_invites(), invites_exports));
|
|
297397
297414
|
const who = handle2.trim();
|
|
297415
|
+
const named = who.startsWith("ixo1") ? who : `@${who.replace(/^@/, "")}`;
|
|
297398
297416
|
const page = await invitesModule.readPage(SITE, who.startsWith("ixo1") ? { address: who } : { handle: who });
|
|
297399
|
-
if (!page) return text4(
|
|
297417
|
+
if (!page) return text4(`No public page for ${named}. A private page is not shown; if ${named} is a verified pro, invite_to_call with "${named}" still reaches them.`);
|
|
297400
297418
|
taint2(page.profile.about ?? "");
|
|
297401
297419
|
return text4(asData("page", invitesModule.pageWords(page, SITE)));
|
|
297402
297420
|
}
|
|
297403
|
-
const
|
|
297404
|
-
const
|
|
297405
|
-
if ("unavailable" in read9) return text4(`${read9.unavailable}, so no roster can be read. Try again in a minute.`);
|
|
297406
|
-
if ("missing" in read9) return text4(marketplaces.notAMarketplace(slug));
|
|
297407
|
-
const chosen2 = "sponsor" in read9 ? read9.sponsor : null;
|
|
297408
|
-
const open = ("sponsors" in read9 ? read9.sponsors : [read9.sponsor]).some((one) => one.state === "approved");
|
|
297409
|
-
const rows2 = await marketplaces.readDirectory(SITE, q, fetch2);
|
|
297421
|
+
const pros = await Promise.resolve().then(() => (init_pros(), pros_exports));
|
|
297422
|
+
const rows2 = await pros.readDirectory(SITE, q, fetch2);
|
|
297410
297423
|
if (!rows2) return text4("The directory could not be read just now. Try again shortly.");
|
|
297411
|
-
const found =
|
|
297412
|
-
for (const pro of found.slice(0,
|
|
297413
|
-
return text4(
|
|
297414
|
-
}
|
|
297415
|
-
);
|
|
297416
|
-
const sitePicture = external_exports.object({ url: external_exports.string().max(2048).describe("An https address on the Zone's own site."), alt: external_exports.string().max(400).describe("What the picture shows, for someone who cannot see it."), caption: external_exports.string().max(400).optional() });
|
|
297417
|
-
const marketplacePageInput = external_exports.object({
|
|
297418
|
-
deck: external_exports.string().max(400).optional().describe("One line under the line every Zone's page opens with: what it is, in its words (up to 120 characters)."),
|
|
297419
|
-
logo: external_exports.string().max(2048).optional().describe("Its mark: an https address of a square picture on its own site. Left out, its account's mark."),
|
|
297420
|
-
cover: sitePicture.optional().describe("A wide picture across the top."),
|
|
297421
|
-
story: external_exports.array(external_exports.string().max(4e3)).max(20).optional().describe("Who it is and why it verifies pros, in paragraphs."),
|
|
297422
|
-
steps: external_exports.array(external_exports.object({ title: external_exports.string().max(400), text: external_exports.string().max(1e3).optional() })).max(20).optional().describe('How it verifies a pro, as steps: drawn as "How <name> verifies".'),
|
|
297423
|
-
pictures: external_exports.array(sitePicture).max(20).optional().describe("Pictures of its work and its people, with captions that say what is shown. No stock or generated photographs."),
|
|
297424
|
-
links: external_exports.array(external_exports.object({ url: external_exports.string().max(2048), name: external_exports.string().max(400), note: external_exports.string().max(400).optional() })).max(20).optional().describe("Its site, its published method, press: https addresses.")
|
|
297425
|
-
});
|
|
297426
|
-
if (offered("set_marketplace_page")) server2.registerTool(
|
|
297427
|
-
"set_marketplace_page",
|
|
297428
|
-
{
|
|
297429
|
-
...meta3("set_marketplace_page"),
|
|
297430
|
-
inputSchema: { page: marketplacePageInput, confirm: external_exports.boolean().optional().describe("false (the default) previews; true signs and publishes, once the person has said yes to the preview.") }
|
|
297431
|
-
},
|
|
297432
|
-
async ({ page, confirm }) => {
|
|
297433
|
-
const { checkSponsorPage: checkSponsorPage2, tidySponsorPage: tidySponsorPage2 } = await Promise.resolve().then(() => (init_sponsors(), sponsors_exports));
|
|
297434
|
-
const marketplaces = await Promise.resolve().then(() => (init_marketplaces(), marketplaces_exports));
|
|
297435
|
-
const words5 = [page.deck, ...page.story ?? [], ...(page.steps ?? []).flatMap((one) => [one.title, one.text]), ...[page.cover, ...page.pictures ?? []].flatMap((one) => [one?.alt, one?.caption]), ...(page.links ?? []).flatMap((one) => [one.name, one.note])];
|
|
297436
|
-
if (words5.some((one) => one && isTainted(one))) return text4(TAINT_REFUSAL);
|
|
297437
|
-
const acting = await principal2();
|
|
297438
|
-
const owner = acting?.principal ?? await address2();
|
|
297439
|
-
const list7 = await marketplaces.readMarketplaces(SITE, fetch2);
|
|
297440
|
-
if ("unavailable" in list7) return text4(`${list7.unavailable}, so whose page this is cannot be confirmed. Try again in a minute. Nothing was published.`);
|
|
297441
|
-
const mine = list7.sponsors.find((one) => one.account === owner);
|
|
297442
|
-
if (!mine)
|
|
297443
|
-
return text4(
|
|
297444
|
-
`${owner} hosts no Zone on asks.world, so it has no page to write. A Zone's page is written by its own account, or by the agent that account connected${acting ? "" : " (connect_account with the Zone's account first)"}. To host one: ${EXPERT_SITE}/pro/marketplaces/host. Nothing was published.`
|
|
297445
|
-
);
|
|
297446
|
-
const tidy = tidySponsorPage2(page);
|
|
297447
|
-
const problem = checkSponsorPage2(tidy);
|
|
297448
|
-
if (problem) return text4(`Not a page yet: ${problem}. Nothing was published.`);
|
|
297449
|
-
if (!confirm) {
|
|
297450
|
-
const before = await marketplaces.readMarketplacePage(SITE, mine.slug, fetch2);
|
|
297451
|
-
return text4(`${marketplaces.marketplacePageWords(mine, tidy, SITE, before)}
|
|
297452
|
-
|
|
297453
|
-
Show it to the person. Then call again with the same page and confirm: true to sign and publish it as ${mine.name}'s page${acting ? `, for ${owner}` : ""}.`);
|
|
297454
|
-
}
|
|
297455
|
-
const invitesModule = await Promise.resolve().then(() => (init_invites(), invites_exports));
|
|
297456
|
-
const answer = await invitesModule.setMarketplacePage(SITE, await inviteSigner(acting), tidy);
|
|
297457
|
-
if ("refused" in answer) return text4(`Refused: ${answer.refused}. Nothing changed.`);
|
|
297458
|
-
return text4(`Published ${mine.name}'s page: ${marketplacePage(SITE, answer.slug)}. Signed ${acting ? `for ${owner} by this agent` : `by ${owner}`}. Pages refresh within five minutes.`);
|
|
297424
|
+
const found = pros.verifiedOf(rows2, { available });
|
|
297425
|
+
for (const pro of found.slice(0, pros.FIND_PRO_MAX)) taint2([pro.row.profile.headline, pro.row.profile.about].filter(Boolean).join("\n"));
|
|
297426
|
+
return text4(pros.prosWords(found, { site: SITE, q, available }));
|
|
297459
297427
|
}
|
|
297460
297428
|
);
|
|
297461
297429
|
const credentialWords = (linkedin, listed) => linkedin?.credentialUrl && listed ? `You also have a LinkedIn credential: it shows you logged in to this LinkedIn account, and any app can check it. Its public link: ${linkedin.credentialUrl}. Download it at ${EXPERT_SITE}/pro/profile.` : `You also have a LinkedIn credential: it shows you logged in to this LinkedIn account, and any app can check it. ${listed && !linkedin?.credential && !linkedin?.credentialUrl ? "It appears on your page once the page is published." : "Only you can see it while your page is private; it goes public when the page does."} Download it at ${EXPERT_SITE}/pro/profile.`;
|