@t2000/cli 9.13.0 → 9.14.0
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/README.md +2 -2
- package/dist/{chunk-XPCTSCTS.js → chunk-W2YJBW55.js} +1 -1
- package/dist/{chunk-XPCTSCTS.js.map → chunk-W2YJBW55.js.map} +1 -1
- package/dist/{dist-WU4EKM5J.js → dist-ST4GSMNB.js} +7 -7
- package/dist/{dist-WU4EKM5J.js.map → dist-ST4GSMNB.js.map} +1 -1
- package/dist/{dist-ZIRF2Q6M.js → dist-XPUF4ETZ.js} +2 -2
- package/dist/index.js +32 -31
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- /package/dist/{dist-ZIRF2Q6M.js.map → dist-XPUF4ETZ.js.map} +0 -0
|
@@ -171,7 +171,7 @@ import {
|
|
|
171
171
|
verifyReceipt,
|
|
172
172
|
walletExists,
|
|
173
173
|
writeLimitsFile
|
|
174
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-W2YJBW55.js";
|
|
175
175
|
import "./chunk-634W6JCI.js";
|
|
176
176
|
import "./chunk-BHQGGFE6.js";
|
|
177
177
|
import "./chunk-GCC33SG5.js";
|
|
@@ -357,4 +357,4 @@ export {
|
|
|
357
357
|
walletExists,
|
|
358
358
|
writeLimitsFile
|
|
359
359
|
};
|
|
360
|
-
//# sourceMappingURL=dist-
|
|
360
|
+
//# sourceMappingURL=dist-XPUF4ETZ.js.map
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
verifyJobForSeller,
|
|
29
29
|
verifyReceipt,
|
|
30
30
|
walletExists
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-W2YJBW55.js";
|
|
32
32
|
import "./chunk-634W6JCI.js";
|
|
33
33
|
import "./chunk-BHQGGFE6.js";
|
|
34
34
|
import "./chunk-GCC33SG5.js";
|
|
@@ -22281,7 +22281,7 @@ async function runEstimate(url, opts) {
|
|
|
22281
22281
|
let req = accepts.find((a) => a.scheme === "exact" && a.network?.startsWith("sui:")) ?? accepts[0];
|
|
22282
22282
|
let dialect = "x402";
|
|
22283
22283
|
if (!req) {
|
|
22284
|
-
const { parseMppSuiChallenge } = await import("./dist-
|
|
22284
|
+
const { parseMppSuiChallenge } = await import("./dist-XPUF4ETZ.js");
|
|
22285
22285
|
const challenge = await parseMppSuiChallenge(response);
|
|
22286
22286
|
if (!challenge) {
|
|
22287
22287
|
throw new Error(
|
|
@@ -23373,7 +23373,7 @@ function registerMcpStart(parent) {
|
|
|
23373
23373
|
parent.command("start", { isDefault: true }).description("Start MCP server (stdio transport \u2014 for AI client integration)").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").action(async (opts) => {
|
|
23374
23374
|
let mod;
|
|
23375
23375
|
try {
|
|
23376
|
-
mod = await import("./dist-
|
|
23376
|
+
mod = await import("./dist-ST4GSMNB.js");
|
|
23377
23377
|
} catch {
|
|
23378
23378
|
console.error("MCP server not installed. Run:\n npm install -g @t2000/mcp");
|
|
23379
23379
|
process.exit(1);
|
|
@@ -24636,14 +24636,14 @@ Typical flow:
|
|
|
24636
24636
|
either $ t2 job watch 0xJOB
|
|
24637
24637
|
seller $ t2 job watch --mine (the provider inbox \u2014 all your jobs)
|
|
24638
24638
|
|
|
24639
|
-
Buying
|
|
24639
|
+
Buying a SERVICE (t2 ACP) \u2014 price + terms come from the listing:
|
|
24640
24640
|
buyer $ t2 browse "market report"
|
|
24641
|
-
buyer $ t2 job create --agent 0xSELLER --
|
|
24641
|
+
buyer $ t2 job create --agent 0xSELLER --service sui-market-report \\
|
|
24642
24642
|
--requirements '{"token":"DEEP"}'
|
|
24643
24643
|
seller $ t2 job spec 0xJOB (read the buyer's requirements)
|
|
24644
24644
|
`
|
|
24645
24645
|
);
|
|
24646
|
-
group.command("create").argument("[amount]", `USDC to escrow (max ${MAX_JOB_USDC}; omit when buying
|
|
24646
|
+
group.command("create").argument("[amount]", `USDC to escrow (max ${MAX_JOB_USDC}; omit when buying a --service)`).argument("[seller]", "The seller's Sui address (omit when buying a --service)").description("Create + fund an escrow job in one transaction (buyer)").option("--spec <file-or-text>", "Job spec \u2014 a file path or inline text (hashed on-chain), or a 0x\u2026 hash").option("--agent <address>", "Buy a service: the seller's agent address").option("--service <slug>", "The service slug (see t2 browse / t2 service list <agent>)").option("--offering <slug>", "Alias for --service (compat)").option("--requirements <file-or-json-or-text>", "Your requirements for the service (what the seller asked for)").option("--deadline <duration>", "Time the seller has to deliver (e.g. 30m, 24h, 7d)", "24h").option("--review <duration>", "Your accept/reject window after delivery", "24h").option("--split <bps>", "Your share in bps if you reject (0\u201310000)", String(DEFAULT_REJECT_SPLIT_BPS)).option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").option("--api <url>", `API base URL (default ${DEFAULT_API_BASE5})`).action(
|
|
24647
24647
|
async (amountArg, sellerArg, opts) => {
|
|
24648
24648
|
try {
|
|
24649
24649
|
const base = opts.api ?? DEFAULT_API_BASE5;
|
|
@@ -24654,17 +24654,18 @@ Buying an OFFERING (t2 ACP) \u2014 price + terms come from the listing:
|
|
|
24654
24654
|
let reviewWindowMs;
|
|
24655
24655
|
let rejectSplitBps;
|
|
24656
24656
|
let offeringSlug;
|
|
24657
|
-
|
|
24658
|
-
|
|
24659
|
-
|
|
24657
|
+
const serviceSlugOpt = opts.service ?? opts.offering;
|
|
24658
|
+
if (serviceSlugOpt || opts.agent) {
|
|
24659
|
+
if (!(serviceSlugOpt && opts.agent)) {
|
|
24660
|
+
throw new Error("--agent and --service go together.");
|
|
24660
24661
|
}
|
|
24661
24662
|
if (amountArg || sellerArg) {
|
|
24662
24663
|
throw new Error(
|
|
24663
|
-
"Omit the amount/seller arguments when buying
|
|
24664
|
+
"Omit the amount/seller arguments when buying a service \u2014 the listing sets the price and the seller."
|
|
24664
24665
|
);
|
|
24665
24666
|
}
|
|
24666
24667
|
const sellerAgent = validateAddress(opts.agent);
|
|
24667
|
-
const offering = await fetchOffering(base, sellerAgent,
|
|
24668
|
+
const offering = await fetchOffering(base, sellerAgent, serviceSlugOpt);
|
|
24668
24669
|
offeringSlug = offering.slug;
|
|
24669
24670
|
let requirements = null;
|
|
24670
24671
|
if (opts.requirements) {
|
|
@@ -24682,12 +24683,12 @@ Buying an OFFERING (t2 ACP) \u2014 price + terms come from the listing:
|
|
|
24682
24683
|
if (offering.requirements != null && requirements == null) {
|
|
24683
24684
|
const want = typeof offering.requirements === "string" ? offering.requirements : `JSON matching: ${JSON.stringify(offering.requirements)}`;
|
|
24684
24685
|
throw new Error(
|
|
24685
|
-
`This
|
|
24686
|
+
`This service needs --requirements. The seller asks for: ${want}`
|
|
24686
24687
|
);
|
|
24687
24688
|
}
|
|
24688
24689
|
if (offering.requirements != null && typeof offering.requirements === "object" && (typeof requirements !== "object" || requirements === null)) {
|
|
24689
24690
|
throw new Error(
|
|
24690
|
-
`This
|
|
24691
|
+
`This service expects JSON requirements matching: ${JSON.stringify(offering.requirements)}`
|
|
24691
24692
|
);
|
|
24692
24693
|
}
|
|
24693
24694
|
const buyer = (await withAgent({ keyPath: opts.key })).address();
|
|
@@ -24713,7 +24714,7 @@ Buying an OFFERING (t2 ACP) \u2014 price + terms come from the listing:
|
|
|
24713
24714
|
} else {
|
|
24714
24715
|
if (!(amountArg && sellerArg)) {
|
|
24715
24716
|
throw new Error(
|
|
24716
|
-
"Provide <amount> <seller> (direct job) or --agent + --
|
|
24717
|
+
"Provide <amount> <seller> (direct job) or --agent + --service (buy a listing)."
|
|
24717
24718
|
);
|
|
24718
24719
|
}
|
|
24719
24720
|
if (!opts.spec) {
|
|
@@ -24755,7 +24756,7 @@ Buying an OFFERING (t2 ACP) \u2014 price + terms come from the listing:
|
|
|
24755
24756
|
return;
|
|
24756
24757
|
}
|
|
24757
24758
|
printBlank();
|
|
24758
|
-
printSuccess(`Escrowed $${amountUsdc.toFixed(2)} USDC \u2192 job for ${truncateAddress(seller)}${offeringSlug ? ` (
|
|
24759
|
+
printSuccess(`Escrowed $${amountUsdc.toFixed(2)} USDC \u2192 job for ${truncateAddress(seller)}${offeringSlug ? ` (service: ${offeringSlug})` : ""}`);
|
|
24759
24760
|
if (jobId) printKeyValue("Job", jobId);
|
|
24760
24761
|
printKeyValue("Spec hash", specHash);
|
|
24761
24762
|
printKeyValue("Deliver by", new Date(deliverByMs).toISOString());
|
|
@@ -25087,29 +25088,29 @@ function printOffering(o) {
|
|
|
25087
25088
|
}
|
|
25088
25089
|
printKeyValue(
|
|
25089
25090
|
"Buy",
|
|
25090
|
-
`t2 job create --agent ${o.agent} --
|
|
25091
|
+
`t2 job create --agent ${o.agent} --service ${o.slug}`
|
|
25091
25092
|
);
|
|
25092
25093
|
}
|
|
25093
25094
|
function registerOffering(program3) {
|
|
25094
|
-
const group = program3.command("offering").description(
|
|
25095
|
+
const group = program3.command("service").alias("offering").description(
|
|
25095
25096
|
"Sell deliverable work \u2014 list what you do, at what price, on what SLA (t2 ACP)"
|
|
25096
25097
|
).addHelpText(
|
|
25097
25098
|
"after",
|
|
25098
25099
|
`
|
|
25099
|
-
|
|
25100
|
+
A service needs NO server and NO endpoint: buyers fund an on-chain escrow
|
|
25100
25101
|
Job against it, you deliver with \`t2 job deliver\`, the escrow settles. Your
|
|
25101
25102
|
catalog lives on your Agent ID and shows on agents.t2000.ai.
|
|
25102
25103
|
|
|
25103
25104
|
Examples:
|
|
25104
|
-
$ t2
|
|
25105
|
+
$ t2 service create --name "Sui market report" --price 5 --sla 24h \\
|
|
25105
25106
|
--description "Daily research report on any Sui token" \\
|
|
25106
25107
|
--deliverable "PDF report, 2+ pages, sources cited" \\
|
|
25107
25108
|
--requirements "Token symbol or coin type to analyze"
|
|
25108
|
-
$ t2
|
|
25109
|
-
$ t2
|
|
25109
|
+
$ t2 service list
|
|
25110
|
+
$ t2 service retire sui-market-report
|
|
25110
25111
|
`
|
|
25111
25112
|
);
|
|
25112
|
-
group.command("create").description("List
|
|
25113
|
+
group.command("create").description("List a service under your Agent ID (re-run to update it)").requiredOption("--name <name>", "Service name (max 80 chars)").requiredOption("--price <usdc>", "Fixed price in USDC (0.01\u201350)").requiredOption("--sla <duration>", "Delivery SLA \u2014 e.g. 30m, 24h, 7d").requiredOption("--description <text>", "What this service is (max 2000 chars)").requiredOption("--deliverable <text>", "What the buyer receives (max 1000 chars)").option("--slug <slug>", "Machine name (default: derived from --name)").option(
|
|
25113
25114
|
"--requirements <file-or-json-or-text>",
|
|
25114
25115
|
"What the buyer must provide \u2014 free text or a JSON schema (file path ok)"
|
|
25115
25116
|
).option("--review <duration>", "Buyer's accept/reject window after delivery", "24h").option("--split <bps>", "Buyer's share in bps if they reject (0\u201310000)", "8000").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").option("--api <url>", `API base URL (default ${DEFAULT_API_BASE6})`).action(
|
|
@@ -25150,7 +25151,7 @@ Examples:
|
|
|
25150
25151
|
printSuccess(`"${payload.name}" is listed \u2014 $${priceUsdc.toFixed(2)} USDC, delivery within ${formatSla(slaMinutes)}`);
|
|
25151
25152
|
printKeyValue("Slug", slug);
|
|
25152
25153
|
printKeyValue("Storefront", `https://agents.t2000.ai/${address}`);
|
|
25153
|
-
printKeyValue("Buyers run", `t2 job create --agent ${address} --
|
|
25154
|
+
printKeyValue("Buyers run", `t2 job create --agent ${address} --service ${slug}`);
|
|
25154
25155
|
printBlank();
|
|
25155
25156
|
printInfo("Watch for incoming jobs with: t2 job watch <jobId> (buyers hand you the job id)");
|
|
25156
25157
|
printBlank();
|
|
@@ -25159,7 +25160,7 @@ Examples:
|
|
|
25159
25160
|
}
|
|
25160
25161
|
}
|
|
25161
25162
|
);
|
|
25162
|
-
group.command("list").argument("[agent]", "Agent address (default: this wallet's)").description("An agent's
|
|
25163
|
+
group.command("list").argument("[agent]", "Agent address (default: this wallet's)").description("An agent's services \u2014 yours by default, retired included").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").option("--api <url>", `API base URL (default ${DEFAULT_API_BASE6})`).action(async (agentArg, opts) => {
|
|
25163
25164
|
try {
|
|
25164
25165
|
const base = opts.api ?? DEFAULT_API_BASE6;
|
|
25165
25166
|
const agent = agentArg ? validateAddress(agentArg) : (await withAgent({ keyPath: opts.key })).address();
|
|
@@ -25173,7 +25174,7 @@ Examples:
|
|
|
25173
25174
|
}
|
|
25174
25175
|
printBlank();
|
|
25175
25176
|
if (rows.length === 0) {
|
|
25176
|
-
printInfo(`No
|
|
25177
|
+
printInfo(`No services for ${truncateAddress(agent)} \u2014 list one with: t2 service create`);
|
|
25177
25178
|
printBlank();
|
|
25178
25179
|
return;
|
|
25179
25180
|
}
|
|
@@ -25185,7 +25186,7 @@ Examples:
|
|
|
25185
25186
|
handleError(error);
|
|
25186
25187
|
}
|
|
25187
25188
|
});
|
|
25188
|
-
group.command("retire").argument("<slug>", "The
|
|
25189
|
+
group.command("retire").argument("<slug>", "The service slug to retire").description("Take a service off the board (funded jobs still settle on-chain)").option("--key <path>", "Custom wallet path (default ~/.t2000/wallet.key)").option("--api <url>", `API base URL (default ${DEFAULT_API_BASE6})`).action(async (slug, opts) => {
|
|
25189
25190
|
try {
|
|
25190
25191
|
const base = opts.api ?? DEFAULT_API_BASE6;
|
|
25191
25192
|
const { address } = await signedOfferingAction({
|
|
@@ -25199,7 +25200,7 @@ Examples:
|
|
|
25199
25200
|
return;
|
|
25200
25201
|
}
|
|
25201
25202
|
printBlank();
|
|
25202
|
-
printSuccess(`
|
|
25203
|
+
printSuccess(`Service "${slug}" retired. Re-run t2 service create with the same slug to relist.`);
|
|
25203
25204
|
printBlank();
|
|
25204
25205
|
} catch (error) {
|
|
25205
25206
|
handleError(error);
|
|
@@ -25207,7 +25208,7 @@ Examples:
|
|
|
25207
25208
|
});
|
|
25208
25209
|
}
|
|
25209
25210
|
function registerBrowse(program3) {
|
|
25210
|
-
program3.command("browse").argument("[query]", "What you need \u2014 free-text search (empty = everything)").description("Browse
|
|
25211
|
+
program3.command("browse").argument("[query]", "What you need \u2014 free-text search (empty = everything)").description("Browse agent services \u2014 find work to buy (t2 ACP)").option("--api <url>", `API base URL (default ${DEFAULT_API_BASE6})`).action(async (query, opts) => {
|
|
25211
25212
|
try {
|
|
25212
25213
|
const base = opts.api ?? DEFAULT_API_BASE6;
|
|
25213
25214
|
const params = query ? `?q=${encodeURIComponent(query)}` : "";
|
|
@@ -25219,7 +25220,7 @@ function registerBrowse(program3) {
|
|
|
25219
25220
|
}
|
|
25220
25221
|
printBlank();
|
|
25221
25222
|
if (rows.length === 0) {
|
|
25222
|
-
printInfo(query ? `No
|
|
25223
|
+
printInfo(query ? `No services match "${query}".` : "No services listed yet.");
|
|
25223
25224
|
printBlank();
|
|
25224
25225
|
return;
|
|
25225
25226
|
}
|
|
@@ -25256,8 +25257,8 @@ Examples:
|
|
|
25256
25257
|
$ t2 services search "image" Discover x402 services in the gateway catalog
|
|
25257
25258
|
$ t2 check <url> Validate your paid API against the listing gates (add --list to sell it)
|
|
25258
25259
|
$ t2 job create 5 0xSELLER --spec brief.md --deadline 24h Escrow USDC for deliverable work (A2A)
|
|
25259
|
-
$ t2
|
|
25260
|
-
$ t2 browse "market report" Find
|
|
25260
|
+
$ t2 service create --name "Report" --price 5 --sla 24h ... Sell deliverable work (no server needed)
|
|
25261
|
+
$ t2 browse "market report" Find agent services to buy
|
|
25261
25262
|
$ t2 agents Look up the agent directory (agents.t2000.ai)
|
|
25262
25263
|
$ t2 limit set --daily 100 Change the daily spend cap (default $100/day)
|
|
25263
25264
|
$ t2 mcp install Connect Claude / Cursor / Windsurf
|