@ixo/asks-mcp 1.12.0 → 1.12.1-dev.1
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 +35 -29
- package/package.json +1 -1
package/dist/asks-mcp.mjs
CHANGED
|
@@ -263835,6 +263835,7 @@ __export(call_exports2, {
|
|
|
263835
263835
|
confirms: () => confirms,
|
|
263836
263836
|
doorOf: () => doorOf,
|
|
263837
263837
|
draftOfEntries: () => draftOfEntries,
|
|
263838
|
+
feeUnpaid: () => feeUnpaid,
|
|
263838
263839
|
freshDraft: () => freshDraft,
|
|
263839
263840
|
indexLookup: () => indexLookup,
|
|
263840
263841
|
indexLookupWith: () => indexLookupWith,
|
|
@@ -264262,6 +264263,13 @@ async function postNextLegNow(slug, ctx) {
|
|
|
264262
264263
|
if (!leg) return { done: true, draft };
|
|
264263
264264
|
if (draft.coin && draft.coin !== ctx.askDenom && Object.values(draft.posted).some(Boolean)) throw new PostRefused("Refused: this call's posted legs pay in another coin than this network pays in now; every leg of a call pays in one. Nothing was posted.");
|
|
264264
264265
|
draft = { ...draft, coin: ctx.askDenom };
|
|
264266
|
+
if (ctx.acting && legs.some((one) => one.feeBase > 0)) throw new Error(callTwoCoins);
|
|
264267
|
+
const plan = legs.find((one) => one.leg === leg);
|
|
264268
|
+
const oracle = { kind: "oracle", address: ctx.checker, rewardUixo: plan.checkBase || legs.find((one) => one.leg === "entries").checkBase };
|
|
264269
|
+
const terms = legTerms(draft, leg, { poster: shortPoster, dates, oracle, approver: ctx.approver ?? null, share: priced.share, sponsor: ctx.sponsor });
|
|
264270
|
+
const screen = await steps.screen(ctx.site, terms.task, terms);
|
|
264271
|
+
if (screen?.verdict === "refuse") throw new Error(refusedWords(screen.reason));
|
|
264272
|
+
await steps.fund(actor.address, ctx.site, ctx.acting?.principal);
|
|
264265
264273
|
if (!draft.campaign && steps.createCampaign && !ctx.acting) {
|
|
264266
264274
|
const remember2 = async (made2) => {
|
|
264267
264275
|
draft = { ...draft, campaign: made2, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
@@ -264283,13 +264291,6 @@ async function postNextLegNow(slug, ctx) {
|
|
|
264283
264291
|
if (!draft.campaign) await remember2(made);
|
|
264284
264292
|
}
|
|
264285
264293
|
const campaign = draft.campaign ? { protocolDid: draft.campaign.protocolDid, claimProtocolDid: null } : null;
|
|
264286
|
-
if (ctx.acting && legs.some((one) => one.feeBase > 0)) throw new Error(callTwoCoins);
|
|
264287
|
-
const plan = legs.find((one) => one.leg === leg);
|
|
264288
|
-
const oracle = { kind: "oracle", address: ctx.checker, rewardUixo: plan.checkBase || legs.find((one) => one.leg === "entries").checkBase };
|
|
264289
|
-
const terms = legTerms(draft, leg, { poster: shortPoster, dates, oracle, approver: ctx.approver ?? null, share: priced.share, sponsor: ctx.sponsor });
|
|
264290
|
-
const screen = await steps.screen(ctx.site, terms.task, terms);
|
|
264291
|
-
if (screen?.verdict === "refuse") throw new Error(refusedWords(screen.reason));
|
|
264292
|
-
await steps.fund(actor.address, ctx.site, ctx.acting?.principal);
|
|
264293
264294
|
const published = await steps.publish(terms);
|
|
264294
264295
|
if (!published) throw new Error("the store would not take the terms. Nothing was posted. Try again shortly");
|
|
264295
264296
|
let inFlight2 = { leg, poster, doneMeansCid: published.cid, startedAt: new Date(ctx.now ?? Date.now()).toISOString() };
|
|
@@ -264378,7 +264379,7 @@ function confirms(said3, totalBase, symbol2) {
|
|
|
264378
264379
|
const figure = said3.replace(/[$,\s]|USDC|PAY|IXO/gi, "");
|
|
264379
264380
|
return /^\d+(\.\d+)?$/.test(figure) && Math.round(Number(figure) * MICRO5) === totalBase;
|
|
264380
264381
|
}
|
|
264381
|
-
var MICRO5, callsDir, fileOf, askInvitesFile, freshDraft, L3, ENTRIES_MAX, INVITES_MAX, INVITE_NOTE_MAX, ADDRESS2, HANDLE_ITEM, isInviteItem, PRO_ASK_INVITE_ONLY, PRO_ASK_NEEDS_MARKETPLACE, manyLines, overCap, callTwoCoins, SETTLE_MS, chainCheck, InFlightError, PostRefused, said2, indexLookupWith, indexLookup, posting, isAskPending, isTxFailed, tagOf, TESTNET_CALL_DEFAULTS, payWords;
|
|
264382
|
+
var MICRO5, callsDir, fileOf, askInvitesFile, freshDraft, L3, ENTRIES_MAX, INVITES_MAX, INVITE_NOTE_MAX, ADDRESS2, HANDLE_ITEM, isInviteItem, PRO_ASK_INVITE_ONLY, PRO_ASK_NEEDS_MARKETPLACE, manyLines, overCap, callTwoCoins, SETTLE_MS, chainCheck, InFlightError, PostRefused, feeUnpaid, said2, indexLookupWith, indexLookup, posting, isAskPending, isTxFailed, tagOf, TESTNET_CALL_DEFAULTS, payWords;
|
|
264382
264383
|
var init_call2 = __esm({
|
|
264383
264384
|
"src/call.ts"() {
|
|
264384
264385
|
"use strict";
|
|
@@ -264435,6 +264436,7 @@ var init_call2 = __esm({
|
|
|
264435
264436
|
this.name = "PostRefused";
|
|
264436
264437
|
}
|
|
264437
264438
|
};
|
|
264439
|
+
feeUnpaid = (error54, askDenom2) => askDenom2 !== "uixo" && /spendable balance \d+uixo is smaller than \d+uixo/i.test(error54 instanceof Error ? error54.message : String(error54));
|
|
264438
264440
|
said2 = (error54) => error54 instanceof Error ? error54.message : String(error54);
|
|
264439
264441
|
indexLookupWith = (fetchImpl = fetch) => async (inFlight2) => {
|
|
264440
264442
|
const { resolveAsk: resolveAsk2 } = await Promise.resolve().then(() => (init_ask(), ask_exports));
|
|
@@ -292284,7 +292286,7 @@ import { randomBytes as randomBytes7 } from "node:crypto";
|
|
|
292284
292286
|
// package.json
|
|
292285
292287
|
var package_default = {
|
|
292286
292288
|
name: "@ixo/asks-mcp",
|
|
292287
|
-
version: "1.12.
|
|
292289
|
+
version: "1.12.1-dev.1",
|
|
292288
292290
|
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.",
|
|
292289
292291
|
license: "Apache-2.0",
|
|
292290
292292
|
repository: {
|
|
@@ -294936,7 +294938,7 @@ You cannot complete it, and trying would spend the gate's network fee to be reje
|
|
|
294936
294938
|
let lane = null;
|
|
294937
294939
|
if (isPrivate) {
|
|
294938
294940
|
const kit = await laneKit();
|
|
294939
|
-
const opened = await kit.lanes.openLane({ connectLink:
|
|
294941
|
+
const opened = await kit.lanes.openLane({ connectLink: acting ? "" : await codeLink(), acting: acting?.principal ?? null, entityDid: receipt.entityDid, collectionId, desk: kit.desk, agent: kit.agent });
|
|
294940
294942
|
if ("said" in opened) return text4(opened.said);
|
|
294941
294943
|
lane = opened;
|
|
294942
294944
|
}
|
|
@@ -296176,18 +296178,19 @@ tx ${result.transactionHash}${leftWords}`);
|
|
|
296176
296178
|
}
|
|
296177
296179
|
return { code: live.code, link: pairing.connectLinkWithCode(pairing.pairingSite(SITE, live), agent, live.code), account, done: () => store2.write({ ...live, used: true }) };
|
|
296178
296180
|
};
|
|
296181
|
+
const codeLink = async (reviews = false) => {
|
|
296182
|
+
const mine = await address2();
|
|
296183
|
+
const pairing = await Promise.resolve().then(() => (init_pairing(), pairing_exports));
|
|
296184
|
+
const store2 = await pairingFile();
|
|
296185
|
+
let { pairing: code10 } = pairing.currentPairing(store2, mine);
|
|
296186
|
+
if (reviews && !code10.reviews) store2.write(code10 = { ...code10, reviews: true });
|
|
296187
|
+
return pairing.connectLinkWithCode(pairing.pairingSite(SITE, code10), mine, code10.code);
|
|
296188
|
+
};
|
|
296179
296189
|
if (offered("get_connect_link")) server2.registerTool(
|
|
296180
296190
|
"get_connect_link",
|
|
296181
296191
|
{ ...meta3("get_connect_link"), inputSchema: { reviews: external_exports.boolean().optional().describe("true when the person is a builder or specialist on Pro Asks: the link opens the same connect page inside that world.") } },
|
|
296182
|
-
async ({ reviews }) => {
|
|
296183
|
-
|
|
296184
|
-
const pairing = await Promise.resolve().then(() => (init_pairing(), pairing_exports));
|
|
296185
|
-
const store2 = await pairingFile();
|
|
296186
|
-
let { pairing: code10 } = pairing.currentPairing(store2, mine);
|
|
296187
|
-
if (reviews && !code10.reviews) store2.write(code10 = { ...code10, reviews: true });
|
|
296188
|
-
return text4(`${pairing.connectLinkWithCode(pairing.pairingSite(SITE, code10), mine, code10.code)}
|
|
296189
|
-
Open this, sign in with Google, tap Connect. Then tell me 'done'.`);
|
|
296190
|
-
}
|
|
296192
|
+
async ({ reviews }) => text4(`${await codeLink(reviews)}
|
|
296193
|
+
Open this, sign in with Google, tap Connect. Then tell me 'done'.`)
|
|
296191
296194
|
);
|
|
296192
296195
|
if (offered("connection_status")) server2.registerTool("connection_status", { ...meta3("connection_status"), inputSchema: {} }, async () => {
|
|
296193
296196
|
const pairing = await pairingNow(await address2(), 0);
|
|
@@ -296216,6 +296219,7 @@ ${pairing.link}`);
|
|
|
296216
296219
|
was?.principal === "self" ? "Forgotten: this key is no longer pinned to act as itself. It still does, until connect_account pins the person's address; my_status names any account that has connected." : was ? `Forgotten: this key no longer acts for ${was.principal}. Asks it posts now are its own, paid from what it has itself. Their grants stay in place until they revoke them at ${SITE}/connect.` : "This key was not pinned to any account. Nothing changed."
|
|
296217
296220
|
);
|
|
296218
296221
|
}
|
|
296222
|
+
let pending = { code: null, link: "" };
|
|
296219
296223
|
if (!chosen2) {
|
|
296220
296224
|
const pairing = await pairingNow(mine, wait_seconds ?? 0);
|
|
296221
296225
|
if (pairing.account) {
|
|
@@ -296226,12 +296230,10 @@ ${pairing.link}`);
|
|
|
296226
296230
|
const { shortStr: shortStr2 } = await Promise.resolve().then(() => (init_format(), format_exports));
|
|
296227
296231
|
return text4(`Connected as ${shortStr2(pairing.account, 8, 4)}. They can disconnect at ${SITE}/connect.`);
|
|
296228
296232
|
}
|
|
296229
|
-
} else if (pairing.code) {
|
|
296230
|
-
return text4(`Nobody has approved the link yet. Ask the person to open it, sign in with Google and tap Connect, then call connect_account again:
|
|
296231
|
-
${pairing.link}`);
|
|
296232
296233
|
}
|
|
296234
|
+
pending = pairing;
|
|
296233
296235
|
}
|
|
296234
|
-
const deadline = Date.now() + (wait_seconds ?? 0) * 1e3;
|
|
296236
|
+
const deadline = Date.now() + (pending.code ? 0 : wait_seconds ?? 0) * 1e3;
|
|
296235
296237
|
let found = await connectAs2(mine, chosen2);
|
|
296236
296238
|
while ((found.kind === "none" || found.kind === "gone") && Date.now() < deadline) {
|
|
296237
296239
|
await new Promise((resolve2) => setTimeout(resolve2, 3e3));
|
|
@@ -296264,16 +296266,19 @@ They can disconnect at ${SITE}/connect.`);
|
|
|
296264
296266
|
return text4(
|
|
296265
296267
|
[
|
|
296266
296268
|
`${found.principals.length === 1 ? "An account has" : `${found.principals.length} accounts have`} connected this key: ${found.principals.join(", ")}.`,
|
|
296267
|
-
"Anybody can grant to a public address, so this server pins nobody it was not told to.
|
|
296269
|
+
"Anybody can grant to a public address, so this server pins nobody it was not told to. Ask the person you work for to open this one-time link and sign in with Google. If it says this agent is already connected, they disconnect it there and tap Connect again. Then call connect_account. Until then this key acts as itself:",
|
|
296270
|
+
pending.link || await codeLink()
|
|
296268
296271
|
].join("\n")
|
|
296269
296272
|
);
|
|
296270
296273
|
}
|
|
296274
|
+
if (pending.code) return text4(`Nobody has approved the link yet. Ask the person to open it, sign in with Google and tap Connect, then call connect_account again:
|
|
296275
|
+
${pending.link}`);
|
|
296271
296276
|
return text4(
|
|
296272
296277
|
[
|
|
296273
|
-
"Not connected yet. Ask the person you work for to open this link
|
|
296274
|
-
|
|
296278
|
+
"Not connected yet. Ask the person you work for to open this link, sign in with Google and tap Connect:",
|
|
296279
|
+
await codeLink(),
|
|
296275
296280
|
"",
|
|
296276
|
-
`It names this key's address (${mine}) and
|
|
296281
|
+
`It names this key's address (${mine}) and a one-time code that lasts 30 minutes, so this server connects exactly the account that taps Connect. They set a cap and tap once. Then call connect_account again. Nothing is spent by this.`
|
|
296277
296282
|
].join("\n")
|
|
296278
296283
|
);
|
|
296279
296284
|
}
|
|
@@ -296754,8 +296759,8 @@ The call: ${linkOf(draft.posted)}`);
|
|
|
296754
296759
|
const sponsor = marketplace?.sponsor ?? null;
|
|
296755
296760
|
const acting = card || plain_key && review ? null : await principal2();
|
|
296756
296761
|
if (!acting && !plain_key && !card) {
|
|
296757
|
-
return text4(`Not connected. A call uses the connected account as its poster and funding source. Ask them to
|
|
296758
|
-
${
|
|
296762
|
+
return text4(`Not connected. A call uses the connected account as its poster and funding source. Ask them to open this link, sign in with Google and tap Connect, then call connect_account:
|
|
296763
|
+
${await codeLink(review)}
|
|
296759
296764
|
Then call post_call again. Nothing was posted.`);
|
|
296760
296765
|
}
|
|
296761
296766
|
const { checkerLegBase: checkerLegBase2 } = await Promise.resolve().then(() => (init_leg(), leg_exports));
|
|
@@ -296854,6 +296859,7 @@ Then call post_call again. Nothing was posted.`);
|
|
|
296854
296859
|
if (error54 instanceof call2.InFlightError || error54 instanceof call2.PostRefused) return text4(error54.message);
|
|
296855
296860
|
if (isUnanchored(error54)) return text4(unanchoredWords(error54));
|
|
296856
296861
|
if (error54 instanceof Error && error54.name === "TxFailed") {
|
|
296862
|
+
if (call2.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.`);
|
|
296857
296863
|
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.`);
|
|
296858
296864
|
}
|
|
296859
296865
|
return text4(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ixo/asks-mcp",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.1-dev.1",
|
|
4
4
|
"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.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|