@t2000/cli 10.29.1 → 10.30.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/dist/index.js +31 -17
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -30548,8 +30548,9 @@ init_coinSelection();
|
|
|
30548
30548
|
init_errors();
|
|
30549
30549
|
init_token_registry();
|
|
30550
30550
|
init_coinSelection();
|
|
30551
|
-
var
|
|
30552
|
-
var
|
|
30551
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x83f02c59575b7daa4576eeccc22542f8a5679520e4edd02feeeee2daae16b819";
|
|
30552
|
+
var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
30553
|
+
var A2A_ESCROW_LATEST_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? process.env.A2A_ESCROW_PACKAGE_ID ?? MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
30553
30554
|
var MAINNET_A2A_ESCROW_PACKAGE_ID = "0x358a819c1c016e2cc84ef5fbea81cba90c31f7f8a62bf45cb5e5276acf198bdd";
|
|
30554
30555
|
var A2A_ESCROW_PACKAGE_ID = process.env.A2A_ESCROW_PACKAGE_ID ?? MAINNET_A2A_ESCROW_PACKAGE_ID;
|
|
30555
30556
|
var A2A_ESCROW_FEE_CONFIG_ID = process.env.A2A_ESCROW_FEE_CONFIG_ID ?? "0xddaa25570950b7484dbf20797ebcf75707be9c87cd67bef2a06ed2e81d2c494b";
|
|
@@ -30558,6 +30559,7 @@ var A2A_ESCROW_FEE_CONFIG_VERSION = Number(
|
|
|
30558
30559
|
);
|
|
30559
30560
|
var MODULE2 = "escrow";
|
|
30560
30561
|
var MAX_JOB_USDC = 50;
|
|
30562
|
+
var MIN_JOB_USDC = 0.05;
|
|
30561
30563
|
var MAX_REVIEW_WINDOW_MS = 2592e6;
|
|
30562
30564
|
var MAX_DELIVER_HORIZON_MS = 31536e6;
|
|
30563
30565
|
var JOB_STATES = [
|
|
@@ -30593,6 +30595,12 @@ function preflightCreateJob(terms) {
|
|
|
30593
30595
|
if (!Number.isFinite(terms.amountUsdc) || terms.amountUsdc <= 0) {
|
|
30594
30596
|
return preflightFail("INVALID_AMOUNT", `Amount must be positive. Got ${terms.amountUsdc}.`);
|
|
30595
30597
|
}
|
|
30598
|
+
if (terms.amountUsdc < MIN_JOB_USDC) {
|
|
30599
|
+
return preflightFail(
|
|
30600
|
+
"INVALID_AMOUNT",
|
|
30601
|
+
`Escrow jobs start at ${MIN_JOB_USDC} USDC (contract-enforced minimum). Got ${terms.amountUsdc}.`
|
|
30602
|
+
);
|
|
30603
|
+
}
|
|
30596
30604
|
if (terms.amountUsdc > MAX_JOB_USDC) {
|
|
30597
30605
|
return preflightFail(
|
|
30598
30606
|
"INVALID_AMOUNT",
|
|
@@ -30946,56 +30954,57 @@ init_preflight();
|
|
|
30946
30954
|
var CANONICAL_API_ORIGIN = "https://api.t2000.ai";
|
|
30947
30955
|
var ALLOW_UNTRUSTED_FLAG = "--allow-untrusted-api";
|
|
30948
30956
|
var ACTION_TARGETS = {
|
|
30949
|
-
//
|
|
30957
|
+
// Escrow verbs — emitted at the original id (pre-S.981 SDK) or the latest
|
|
30958
|
+
// id (S.981+ SDK, the version-gated path).
|
|
30950
30959
|
create: {
|
|
30951
|
-
|
|
30960
|
+
pkgs: [MAINNET_A2A_ESCROW_PACKAGE_ID, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID],
|
|
30952
30961
|
module: "escrow",
|
|
30953
30962
|
functions: ["create"]
|
|
30954
30963
|
},
|
|
30955
30964
|
deliver: {
|
|
30956
|
-
|
|
30965
|
+
pkgs: [MAINNET_A2A_ESCROW_PACKAGE_ID, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID],
|
|
30957
30966
|
module: "escrow",
|
|
30958
30967
|
functions: ["deliver"]
|
|
30959
30968
|
},
|
|
30960
30969
|
release: {
|
|
30961
|
-
|
|
30970
|
+
pkgs: [MAINNET_A2A_ESCROW_PACKAGE_ID, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID],
|
|
30962
30971
|
module: "escrow",
|
|
30963
30972
|
functions: ["release"]
|
|
30964
30973
|
},
|
|
30965
30974
|
reject: {
|
|
30966
|
-
|
|
30975
|
+
pkgs: [MAINNET_A2A_ESCROW_PACKAGE_ID, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID],
|
|
30967
30976
|
module: "escrow",
|
|
30968
30977
|
functions: ["reject"]
|
|
30969
30978
|
},
|
|
30970
30979
|
refund: {
|
|
30971
|
-
|
|
30980
|
+
pkgs: [MAINNET_A2A_ESCROW_PACKAGE_ID, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID],
|
|
30972
30981
|
module: "escrow",
|
|
30973
30982
|
functions: ["refund"]
|
|
30974
30983
|
},
|
|
30975
30984
|
// v3 opening package — note the `escrow` module.
|
|
30976
30985
|
decline: {
|
|
30977
|
-
|
|
30986
|
+
pkgs: [MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID],
|
|
30978
30987
|
module: "escrow",
|
|
30979
30988
|
functions: ["decline"]
|
|
30980
30989
|
},
|
|
30981
30990
|
// Open board.
|
|
30982
30991
|
"open-create": {
|
|
30983
|
-
|
|
30992
|
+
pkgs: [MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID],
|
|
30984
30993
|
module: "opening",
|
|
30985
30994
|
functions: ["create_open"]
|
|
30986
30995
|
},
|
|
30987
30996
|
"open-claim": {
|
|
30988
|
-
|
|
30997
|
+
pkgs: [MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID],
|
|
30989
30998
|
module: "opening",
|
|
30990
30999
|
functions: ["claim"]
|
|
30991
31000
|
},
|
|
30992
31001
|
"open-cancel": {
|
|
30993
|
-
|
|
31002
|
+
pkgs: [MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID],
|
|
30994
31003
|
module: "opening",
|
|
30995
31004
|
functions: ["cancel_open"]
|
|
30996
31005
|
},
|
|
30997
31006
|
"open-refund": {
|
|
30998
|
-
|
|
31007
|
+
pkgs: [MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID],
|
|
30999
31008
|
module: "opening",
|
|
31000
31009
|
functions: ["refund_unclaimed"]
|
|
31001
31010
|
}
|
|
@@ -31081,10 +31090,10 @@ function assertTxMatchesIntent(txBytes, intent, opts = {}) {
|
|
|
31081
31090
|
"Refusing to sign: the prepared transaction contains no Move calls."
|
|
31082
31091
|
);
|
|
31083
31092
|
}
|
|
31084
|
-
const
|
|
31093
|
+
const expectedPkgs = expected.pkgs.map((p) => normalizeSuiAddress(p));
|
|
31085
31094
|
let foundIntent = false;
|
|
31086
31095
|
for (const call of calls) {
|
|
31087
|
-
if (normalizeSuiAddress(call.pkg)
|
|
31096
|
+
if (expectedPkgs.includes(normalizeSuiAddress(call.pkg))) {
|
|
31088
31097
|
if (call.module !== expected.module) {
|
|
31089
31098
|
throw new IntentMismatchError(
|
|
31090
31099
|
`Refusing to sign: "${intent.action}" should call ${expected.module}, but the transaction calls ${call.module}.`
|
|
@@ -31102,7 +31111,7 @@ function assertTxMatchesIntent(txBytes, intent, opts = {}) {
|
|
|
31102
31111
|
continue;
|
|
31103
31112
|
}
|
|
31104
31113
|
throw new IntentMismatchError(
|
|
31105
|
-
`Refusing to sign: "${intent.action}" targets package ${expected.
|
|
31114
|
+
`Refusing to sign: "${intent.action}" targets package ${expected.pkgs.join(" | ")}, but the transaction calls ${call.pkg}::${call.module}::${call.fn}.`
|
|
31106
31115
|
);
|
|
31107
31116
|
}
|
|
31108
31117
|
if (!foundIntent) {
|
|
@@ -37000,7 +37009,7 @@ Examples:
|
|
|
37000
37009
|
$ t2 service retire sui-market-report
|
|
37001
37010
|
`
|
|
37002
37011
|
);
|
|
37003
|
-
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.
|
|
37012
|
+
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.05\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)").requiredOption(
|
|
37004
37013
|
"--requirements <file-or-json-or-text>",
|
|
37005
37014
|
"The questions buyers answer at hire (REQUIRED \u2014 the API rejects listings that ask nothing): free text, or a JSON object of field names \u2192 hints (keys enforced non-empty at hire; file path ok)"
|
|
37006
37015
|
).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(
|
|
@@ -37013,6 +37022,11 @@ Examples:
|
|
|
37013
37022
|
if (!Number.isFinite(priceUsdc) || priceUsdc <= 0) {
|
|
37014
37023
|
throw new Error(`--price must be a positive number (got "${opts.price}").`);
|
|
37015
37024
|
}
|
|
37025
|
+
if (priceUsdc < MIN_JOB_USDC) {
|
|
37026
|
+
throw new Error(
|
|
37027
|
+
`--price must be at least ${MIN_JOB_USDC} USDC \u2014 escrow jobs start there (contract-enforced minimum).`
|
|
37028
|
+
);
|
|
37029
|
+
}
|
|
37016
37030
|
const slaMinutes = Math.round(parseDuration(opts.sla) / 6e4);
|
|
37017
37031
|
const reviewWindowMinutes = Math.round(parseDuration(opts.review) / 6e4);
|
|
37018
37032
|
const rejectSplitBps = Number.parseInt(opts.split, 10);
|