xytara 2.0.0 → 2.1.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/.env.example +2 -0
- package/BSV_TERANODE_SETUP.md +30 -1
- package/FINAL_CONTRACT.md +6 -6
- package/PUBLISH_PLAN.md +12 -0
- package/README.md +76 -6
- package/RELEASE_CHECKLIST.md +10 -0
- package/RELEASE_NOTES.md +19 -0
- package/SERVICE_CONTRACT.md +4 -4
- package/bin/xytara-release.js +169 -0
- package/bin/xytara-run.js +186 -0
- package/index.js +81 -1
- package/lib/announcement_pack.js +61 -0
- package/lib/commerce_artifacts.js +3 -0
- package/lib/commerce_economics.js +14 -0
- package/lib/commerce_reports.js +26 -1
- package/lib/commerce_shell.js +18 -2
- package/lib/ecosystem_entry.js +64 -0
- package/lib/launch_narrative.js +53 -0
- package/lib/outreach_proof.js +71 -0
- package/lib/publish_plan.js +51 -0
- package/lib/release_candidate.js +50 -0
- package/lib/release_center.js +115 -0
- package/lib/release_history.js +72 -0
- package/lib/release_manifest.js +114 -0
- package/lib/release_pack.js +454 -0
- package/lib/runtime_state_store.js +169 -0
- package/lib/settlement_bsv_live.js +262 -13
- package/package.json +12 -2
- package/server.js +547 -8
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const crypto = require("crypto");
|
|
5
|
+
|
|
6
|
+
function parseArgs(argv) {
|
|
7
|
+
const args = {};
|
|
8
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
9
|
+
const token = argv[index];
|
|
10
|
+
if (!token.startsWith("--")) continue;
|
|
11
|
+
const key = token.slice(2);
|
|
12
|
+
const next = argv[index + 1];
|
|
13
|
+
if (!next || next.startsWith("--")) {
|
|
14
|
+
args[key] = true;
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
args[key] = next;
|
|
18
|
+
index += 1;
|
|
19
|
+
}
|
|
20
|
+
return args;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function printUsage() {
|
|
24
|
+
process.stdout.write([
|
|
25
|
+
"Usage: xytara-run --url <service_url> --account <account_id> --command <intent> --task <task_ref> [options]",
|
|
26
|
+
"",
|
|
27
|
+
"Options:",
|
|
28
|
+
" --body-json <json> JSON body for the task payload",
|
|
29
|
+
" --wallet-id <id> Wallet id for local_signed x402 payment",
|
|
30
|
+
" --wallet-secret <secret> Shared secret for local_signed payment",
|
|
31
|
+
" --txid <txid> Existing BSV txid for bsv_teranode settlement",
|
|
32
|
+
" --raw-tx <hex> Raw BSV transaction for arc submission flows",
|
|
33
|
+
" --quote-only Stop after returning the payment challenge",
|
|
34
|
+
" --pretty Pretty-print JSON output",
|
|
35
|
+
" --help Show this help message"
|
|
36
|
+
].join("\n"));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function parseJson(value, label) {
|
|
40
|
+
if (value == null || value === "") return {};
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse(value);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
throw new Error(`${label}_must_be_valid_json`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function postJson(url, payload, headers = {}) {
|
|
49
|
+
const response = await fetch(url, {
|
|
50
|
+
method: "POST",
|
|
51
|
+
headers: {
|
|
52
|
+
"content-type": "application/json",
|
|
53
|
+
...headers
|
|
54
|
+
},
|
|
55
|
+
body: JSON.stringify(payload)
|
|
56
|
+
});
|
|
57
|
+
const text = await response.text();
|
|
58
|
+
let json = null;
|
|
59
|
+
try {
|
|
60
|
+
json = text ? JSON.parse(text) : null;
|
|
61
|
+
} catch (_) {
|
|
62
|
+
json = null;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
status: response.status,
|
|
66
|
+
ok: response.ok,
|
|
67
|
+
json,
|
|
68
|
+
text
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function buildLocalSignedPaymentSignature({ quote, accountId, walletId, walletSecret, txid, rawTx }) {
|
|
73
|
+
const payment = {
|
|
74
|
+
account_id: accountId,
|
|
75
|
+
wallet_id: walletId,
|
|
76
|
+
quote_id: quote.quote_id,
|
|
77
|
+
amount_minor: quote.amount_minor,
|
|
78
|
+
currency: quote.currency,
|
|
79
|
+
settlement_mode: quote.settlement.mode,
|
|
80
|
+
settlement_binding_hash: quote.settlement_binding_hash
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
if (quote.settlement && quote.settlement.mode === "bsv_teranode") {
|
|
84
|
+
payment.bsv_teranode = {
|
|
85
|
+
network: quote.settlement.hints && quote.settlement.hints.network ? quote.settlement.hints.network : null,
|
|
86
|
+
merchant_address: quote.settlement.hints && quote.settlement.hints.merchant_address ? quote.settlement.hints.merchant_address : null,
|
|
87
|
+
amount_satoshis: quote.settlement.hints && quote.settlement.hints.amount_satoshis != null ? quote.settlement.hints.amount_satoshis : null,
|
|
88
|
+
settlement_reference: quote.settlement.hints && quote.settlement.hints.settlement_reference ? quote.settlement.hints.settlement_reference : null
|
|
89
|
+
};
|
|
90
|
+
if (txid) payment.bsv_teranode.txid = txid;
|
|
91
|
+
if (rawTx) payment.bsv_teranode.raw_tx = rawTx;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
payment.issued_at_iso = new Date().toISOString();
|
|
95
|
+
payment.nonce = `xytara-cli-${Date.now()}`;
|
|
96
|
+
|
|
97
|
+
const encoded = Buffer.from(JSON.stringify(payment), "utf8").toString("base64url");
|
|
98
|
+
const signature = crypto.createHmac("sha256", walletSecret).update(encoded).digest("hex");
|
|
99
|
+
return Buffer.from(JSON.stringify({
|
|
100
|
+
scheme: "exact",
|
|
101
|
+
wallet_id: walletId,
|
|
102
|
+
payload: encoded,
|
|
103
|
+
signature
|
|
104
|
+
}), "utf8").toString("base64url");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function writeOutput(payload, pretty) {
|
|
108
|
+
process.stdout.write(JSON.stringify(payload, null, pretty ? 2 : 0));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function main() {
|
|
112
|
+
const args = parseArgs(process.argv.slice(2));
|
|
113
|
+
if (args.help) {
|
|
114
|
+
printUsage();
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const serviceUrl = String(args.url || "").replace(/\/$/, "");
|
|
119
|
+
const accountId = String(args.account || "").trim();
|
|
120
|
+
const command = String(args.command || "").trim();
|
|
121
|
+
const taskRef = String(args.task || args["task-ref"] || "").trim();
|
|
122
|
+
const body = parseJson(args["body-json"], "body_json");
|
|
123
|
+
const walletId = String(args["wallet-id"] || "").trim();
|
|
124
|
+
const walletSecret = String(args["wallet-secret"] || "").trim();
|
|
125
|
+
const txid = String(args.txid || "").trim() || null;
|
|
126
|
+
const rawTx = String(args["raw-tx"] || "").trim() || null;
|
|
127
|
+
const pretty = args.pretty === true;
|
|
128
|
+
|
|
129
|
+
if (!serviceUrl || !accountId || !command || !taskRef) {
|
|
130
|
+
printUsage();
|
|
131
|
+
process.exitCode = 1;
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const executeUrl = `${serviceUrl}/x402/commands/execute`;
|
|
136
|
+
const payload = {
|
|
137
|
+
account_id: accountId,
|
|
138
|
+
command,
|
|
139
|
+
task_ref: taskRef,
|
|
140
|
+
body
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const challengeResult = await postJson(executeUrl, payload);
|
|
144
|
+
if (challengeResult.ok) {
|
|
145
|
+
writeOutput(challengeResult.json || { ok: true }, pretty);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (challengeResult.status !== 402 || !challengeResult.json || !challengeResult.json.payment_required) {
|
|
149
|
+
writeOutput(challengeResult.json || { ok: false, status: challengeResult.status, body: challengeResult.text || null }, pretty);
|
|
150
|
+
process.exitCode = 1;
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (args["quote-only"] === true || !walletId || !walletSecret) {
|
|
155
|
+
writeOutput(challengeResult.json, pretty);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const quote = challengeResult.json.payment_required.quote;
|
|
160
|
+
const paymentSignature = buildLocalSignedPaymentSignature({
|
|
161
|
+
quote,
|
|
162
|
+
accountId,
|
|
163
|
+
walletId,
|
|
164
|
+
walletSecret,
|
|
165
|
+
txid,
|
|
166
|
+
rawTx
|
|
167
|
+
});
|
|
168
|
+
const paidPayload = {
|
|
169
|
+
...payload,
|
|
170
|
+
quote_id: quote.quote_id
|
|
171
|
+
};
|
|
172
|
+
const paidResult = await postJson(executeUrl, paidPayload, {
|
|
173
|
+
"payment-signature": paymentSignature
|
|
174
|
+
});
|
|
175
|
+
if (!paidResult.ok) {
|
|
176
|
+
writeOutput(paidResult.json || { ok: false, status: paidResult.status, body: paidResult.text || null }, pretty);
|
|
177
|
+
process.exitCode = 1;
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
writeOutput(paidResult.json || { ok: true }, pretty);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
main().catch((error) => {
|
|
184
|
+
process.stderr.write(`${error.message}\n`);
|
|
185
|
+
process.exitCode = 1;
|
|
186
|
+
});
|
package/index.js
CHANGED
|
@@ -5,6 +5,56 @@ const {
|
|
|
5
5
|
ADAPTER_INTERFACE_VERSION,
|
|
6
6
|
validateAdapterImplementation
|
|
7
7
|
} = require("./adapters/interfaces");
|
|
8
|
+
const {
|
|
9
|
+
buildReleasePack,
|
|
10
|
+
summarizeReleasePack,
|
|
11
|
+
buildComparisonPack,
|
|
12
|
+
summarizeComparisonPack,
|
|
13
|
+
buildAdoptionPack,
|
|
14
|
+
summarizeAdoptionPack,
|
|
15
|
+
buildScenarioPack,
|
|
16
|
+
summarizeScenarioPack,
|
|
17
|
+
buildLaunchPack,
|
|
18
|
+
summarizeLaunchPack
|
|
19
|
+
} = require("./lib/release_pack");
|
|
20
|
+
const {
|
|
21
|
+
buildReleaseManifest,
|
|
22
|
+
summarizeReleaseManifest,
|
|
23
|
+
buildLaunchNotes,
|
|
24
|
+
summarizeLaunchNotes
|
|
25
|
+
} = require("./lib/release_manifest");
|
|
26
|
+
const {
|
|
27
|
+
buildReleaseCenter,
|
|
28
|
+
summarizeReleaseCenter
|
|
29
|
+
} = require("./lib/release_center");
|
|
30
|
+
const {
|
|
31
|
+
buildReleaseHistory,
|
|
32
|
+
summarizeReleaseHistory
|
|
33
|
+
} = require("./lib/release_history");
|
|
34
|
+
const {
|
|
35
|
+
buildPublishPlan,
|
|
36
|
+
summarizePublishPlan
|
|
37
|
+
} = require("./lib/publish_plan");
|
|
38
|
+
const {
|
|
39
|
+
buildEcosystemEntryPack,
|
|
40
|
+
summarizeEcosystemEntryPack
|
|
41
|
+
} = require("./lib/ecosystem_entry");
|
|
42
|
+
const {
|
|
43
|
+
buildLaunchNarrativePack,
|
|
44
|
+
summarizeLaunchNarrativePack
|
|
45
|
+
} = require("./lib/launch_narrative");
|
|
46
|
+
const {
|
|
47
|
+
buildOutreachProofPack,
|
|
48
|
+
summarizeOutreachProofPack
|
|
49
|
+
} = require("./lib/outreach_proof");
|
|
50
|
+
const {
|
|
51
|
+
buildAnnouncementPack,
|
|
52
|
+
summarizeAnnouncementPack
|
|
53
|
+
} = require("./lib/announcement_pack");
|
|
54
|
+
const {
|
|
55
|
+
buildReleaseCandidatePack,
|
|
56
|
+
summarizeReleaseCandidatePack
|
|
57
|
+
} = require("./lib/release_candidate");
|
|
8
58
|
const {
|
|
9
59
|
getIntegration,
|
|
10
60
|
listIntegrations,
|
|
@@ -40,7 +90,7 @@ const {
|
|
|
40
90
|
} = require("./integrations/registry");
|
|
41
91
|
|
|
42
92
|
const COMMERCE_SDK_NAME = "xytara";
|
|
43
|
-
const COMMERCE_SDK_VERSION = "2.
|
|
93
|
+
const COMMERCE_SDK_VERSION = "2.1.0";
|
|
44
94
|
const COMMERCE_API_VERSION = "v1";
|
|
45
95
|
|
|
46
96
|
function createClient(options) {
|
|
@@ -85,5 +135,35 @@ module.exports = {
|
|
|
85
135
|
summarizeIntegrationPromotionActionPreview,
|
|
86
136
|
summarizeIntegrationPromotionActionSet,
|
|
87
137
|
summarizeIntegrationPromotionActionSetList,
|
|
138
|
+
buildReleasePack,
|
|
139
|
+
summarizeReleasePack,
|
|
140
|
+
buildComparisonPack,
|
|
141
|
+
summarizeComparisonPack,
|
|
142
|
+
buildAdoptionPack,
|
|
143
|
+
summarizeAdoptionPack,
|
|
144
|
+
buildScenarioPack,
|
|
145
|
+
summarizeScenarioPack,
|
|
146
|
+
buildLaunchPack,
|
|
147
|
+
summarizeLaunchPack,
|
|
148
|
+
buildReleaseManifest,
|
|
149
|
+
summarizeReleaseManifest,
|
|
150
|
+
buildLaunchNotes,
|
|
151
|
+
summarizeLaunchNotes,
|
|
152
|
+
buildReleaseCenter,
|
|
153
|
+
summarizeReleaseCenter,
|
|
154
|
+
buildReleaseHistory,
|
|
155
|
+
summarizeReleaseHistory,
|
|
156
|
+
buildPublishPlan,
|
|
157
|
+
summarizePublishPlan,
|
|
158
|
+
buildEcosystemEntryPack,
|
|
159
|
+
summarizeEcosystemEntryPack,
|
|
160
|
+
buildLaunchNarrativePack,
|
|
161
|
+
summarizeLaunchNarrativePack,
|
|
162
|
+
buildOutreachProofPack,
|
|
163
|
+
summarizeOutreachProofPack,
|
|
164
|
+
buildAnnouncementPack,
|
|
165
|
+
summarizeAnnouncementPack,
|
|
166
|
+
buildReleaseCandidatePack,
|
|
167
|
+
summarizeReleaseCandidatePack,
|
|
88
168
|
validateAdapterImplementation
|
|
89
169
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const packageJson = require("../package.json");
|
|
4
|
+
|
|
5
|
+
function buildAnnouncementPack() {
|
|
6
|
+
return {
|
|
7
|
+
ok: true,
|
|
8
|
+
product: packageJson.name,
|
|
9
|
+
category: "machine-commerce-announcement-pack",
|
|
10
|
+
public_quickstart: {
|
|
11
|
+
install: "npm install xytara",
|
|
12
|
+
first_cli: "xytara-run --url https://xytara.onrender.com --account acct_demo --command \"cli-run\" --task trust.verify --body-json '{\"subject_id\":\"subject-1\"}' --wallet-id merchant_wallet_main --wallet-secret YOUR_LOCAL_SIGNED_SECRET --txid YOUR_BSV_TXID",
|
|
13
|
+
first_release_view: "xytara-release --center --summary",
|
|
14
|
+
first_http: "/v1/release-center/summary"
|
|
15
|
+
},
|
|
16
|
+
release_candidate: {
|
|
17
|
+
checks: [
|
|
18
|
+
"install the package on a clean machine",
|
|
19
|
+
"run xytara-release --center --summary",
|
|
20
|
+
"run npm run verify:all",
|
|
21
|
+
"verify /v1/release-center/summary on the deployed service",
|
|
22
|
+
"verify /v1/outreach-proof/summary on the deployed service"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
publish_day: {
|
|
26
|
+
sequence: [
|
|
27
|
+
"publish the npm package",
|
|
28
|
+
"redeploy the service and docs surfaces",
|
|
29
|
+
"verify release-center, launch-narrative, and outreach-proof summaries live",
|
|
30
|
+
"run the first public proof path",
|
|
31
|
+
"share the announcement artifact with the target ecosystem audience"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
public_message: {
|
|
35
|
+
headline: "governed machine commerce with direct paid execution, reusable credits, and proof-aware followthrough",
|
|
36
|
+
who_should_try_first: [
|
|
37
|
+
"agent builders",
|
|
38
|
+
"tool and marketplace authors",
|
|
39
|
+
"repeat-use runtime operators"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function summarizeAnnouncementPack() {
|
|
46
|
+
const pack = buildAnnouncementPack();
|
|
47
|
+
return {
|
|
48
|
+
ok: true,
|
|
49
|
+
product: pack.product,
|
|
50
|
+
category: pack.category,
|
|
51
|
+
rc_check_count: pack.release_candidate.checks.length,
|
|
52
|
+
publish_step_count: pack.publish_day.sequence.length,
|
|
53
|
+
first_cli: pack.public_quickstart.first_cli,
|
|
54
|
+
audience_count: pack.public_message.who_should_try_first.length
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = {
|
|
59
|
+
buildAnnouncementPack,
|
|
60
|
+
summarizeAnnouncementPack
|
|
61
|
+
};
|
|
@@ -222,6 +222,9 @@ function createCommandArtifacts(payload, quote, options) {
|
|
|
222
222
|
network: bsvHints ? bsvHints.network : null,
|
|
223
223
|
hints: bsvHints,
|
|
224
224
|
txid: bsvPaymentReference && bsvPaymentReference.txid ? bsvPaymentReference.txid : null,
|
|
225
|
+
raw_tx: bsvPaymentReference && (bsvPaymentReference.raw_tx || bsvPaymentReference.rawTx)
|
|
226
|
+
? (bsvPaymentReference.raw_tx || bsvPaymentReference.rawTx)
|
|
227
|
+
: null,
|
|
225
228
|
status: deferredCompletion ? "pending_completion" : "recorded",
|
|
226
229
|
recorded_at_iso: deferredCompletion ? null : completedAt.toISOString()
|
|
227
230
|
};
|
|
@@ -638,6 +638,13 @@ function buildEconomicConsequenceHandoffBundle(state, body) {
|
|
|
638
638
|
};
|
|
639
639
|
}
|
|
640
640
|
const meterProfileRef = normalizeString(payload.meter_profile_ref, `meter-profile.${usageMeter.pricing_band || "utility"}.v1`);
|
|
641
|
+
const paymentRef = normalizeString(payload.payment_ref, null);
|
|
642
|
+
const settlementRef = normalizeString(payload.settlement_ref, null);
|
|
643
|
+
const settlementTxid = normalizeString(payload.settlement_txid, null);
|
|
644
|
+
const settlementStatus = normalizeString(payload.settlement_status, null);
|
|
645
|
+
const settlementFinalityStatus = normalizeString(payload.settlement_finality_status, null);
|
|
646
|
+
const treasuryReceiptRef = normalizeString(payload.treasury_receipt_ref, null);
|
|
647
|
+
const proofRef = normalizeString(payload.proof_ref, null);
|
|
641
648
|
const handoffBundle = {
|
|
642
649
|
contract_version: "naxytra-economic-consequence-handoff-v1",
|
|
643
650
|
source_system: "xytara",
|
|
@@ -647,6 +654,13 @@ function buildEconomicConsequenceHandoffBundle(state, body) {
|
|
|
647
654
|
credit_spend_ref: creditSpend.credit_spend_id,
|
|
648
655
|
usage_meter: usageMeter,
|
|
649
656
|
credit_spend: creditSpend,
|
|
657
|
+
payment_ref: paymentRef,
|
|
658
|
+
settlement_ref: settlementRef,
|
|
659
|
+
settlement_txid: settlementTxid,
|
|
660
|
+
settlement_status: settlementStatus,
|
|
661
|
+
settlement_finality_status: settlementFinalityStatus,
|
|
662
|
+
treasury_receipt_ref: treasuryReceiptRef,
|
|
663
|
+
proof_ref: proofRef,
|
|
650
664
|
handoff_surfaces: {
|
|
651
665
|
proof_bridge_surface: "/v1/proof-center/bridge/economic-handoff",
|
|
652
666
|
proof_conformance_surface: "/v1/proof-center/bridge/economic-conformance-pack"
|
package/lib/commerce_reports.js
CHANGED
|
@@ -13690,12 +13690,18 @@ function buildReconciliationReport(state, filters, listRecords) {
|
|
|
13690
13690
|
};
|
|
13691
13691
|
}
|
|
13692
13692
|
|
|
13693
|
-
function buildOperatorExportPack(state, filters, listRecords) {
|
|
13693
|
+
function buildOperatorExportPack(state, filters, listRecords, options = {}) {
|
|
13694
13694
|
const report = buildReconciliationReport(state, filters, listRecords);
|
|
13695
13695
|
const accountId = report.summary && report.summary.account_id ? report.summary.account_id : null;
|
|
13696
13696
|
const transactions = Array.from(state.transactions.values()).map((item) => item.transaction);
|
|
13697
13697
|
const receipts = Array.from(state.receipts.values()).map((item) => item.receipt);
|
|
13698
13698
|
const paymentLedger = Array.isArray(state.paymentLedger) ? state.paymentLedger.slice(0, 20) : [];
|
|
13699
|
+
const runtimeDurability = options.runtime_durability && typeof options.runtime_durability === "object"
|
|
13700
|
+
? options.runtime_durability
|
|
13701
|
+
: null;
|
|
13702
|
+
const nativeSettlementReadiness = options.native_settlement_readiness && typeof options.native_settlement_readiness === "object"
|
|
13703
|
+
? options.native_settlement_readiness
|
|
13704
|
+
: null;
|
|
13699
13705
|
return {
|
|
13700
13706
|
ok: true,
|
|
13701
13707
|
export_version: "commerce-operator-export-pack-v1",
|
|
@@ -13729,6 +13735,25 @@ function buildOperatorExportPack(state, filters, listRecords) {
|
|
|
13729
13735
|
metering_summary_ref: report.summary && report.summary.linked_surfaces ? report.summary.linked_surfaces.metering_summary : null,
|
|
13730
13736
|
usage_meters_ref: report.summary && report.summary.linked_surfaces ? report.summary.linked_surfaces.usage_meters : null
|
|
13731
13737
|
},
|
|
13738
|
+
runtime_center: {
|
|
13739
|
+
snapshot_enabled: runtimeDurability ? runtimeDurability.enabled === true : false,
|
|
13740
|
+
snapshot_exists: runtimeDurability ? runtimeDurability.snapshot_exists === true : false,
|
|
13741
|
+
snapshot_updated_at_iso: runtimeDurability ? runtimeDurability.snapshot_updated_at_iso || null : null,
|
|
13742
|
+
last_persisted_at_iso: runtimeDurability ? runtimeDurability.last_persisted_at_iso || null : null,
|
|
13743
|
+
last_flush_succeeded: runtimeDurability ? runtimeDurability.last_flush_succeeded === true : false,
|
|
13744
|
+
recovery_posture: runtimeDurability ? runtimeDurability.recovery_posture || null : null,
|
|
13745
|
+
blockers: runtimeDurability ? runtimeDurability.blockers || [] : [],
|
|
13746
|
+
inspect_ref: runtimeDurability ? runtimeDurability.inspect_ref || "/v1/runtime/durability" : "/v1/runtime/durability"
|
|
13747
|
+
},
|
|
13748
|
+
native_settlement_center: {
|
|
13749
|
+
ready: nativeSettlementReadiness ? nativeSettlementReadiness.ready === true : false,
|
|
13750
|
+
runtime_mode: nativeSettlementReadiness ? nativeSettlementReadiness.runtime_mode || null : null,
|
|
13751
|
+
receiving_identity_kind: nativeSettlementReadiness ? nativeSettlementReadiness.receiving_identity_kind || null : null,
|
|
13752
|
+
verification_mode: nativeSettlementReadiness ? nativeSettlementReadiness.payment_verification_mode || null : null,
|
|
13753
|
+
blockers: nativeSettlementReadiness ? nativeSettlementReadiness.blockers || [] : [],
|
|
13754
|
+
next_manual_inputs: nativeSettlementReadiness ? nativeSettlementReadiness.next_manual_inputs || [] : [],
|
|
13755
|
+
readiness_ref: nativeSettlementReadiness ? nativeSettlementReadiness.readiness_ref || "/v1/settlement/bsv-teranode/readiness" : "/v1/settlement/bsv-teranode/readiness"
|
|
13756
|
+
},
|
|
13732
13757
|
coordination_center: {
|
|
13733
13758
|
zone_count: report.coordination ? report.coordination.zone_count : 0,
|
|
13734
13759
|
handoff_count: report.coordination ? report.coordination.handoff_count : 0,
|
package/lib/commerce_shell.js
CHANGED
|
@@ -132,6 +132,8 @@ function buildOperatorShellSummary(input) {
|
|
|
132
132
|
const coordinationAdminView = body.coordination_admin_view || {};
|
|
133
133
|
const hostedCheckoutOperatorSummary = body.hosted_checkout_operator_summary || {};
|
|
134
134
|
const entitlementReplenishmentSummary = body.entitlement_replenishment_summary || {};
|
|
135
|
+
const runtimeDurability = body.runtime_durability || {};
|
|
136
|
+
const nativeSettlementReadiness = body.native_settlement_readiness || {};
|
|
135
137
|
|
|
136
138
|
return {
|
|
137
139
|
ok: true,
|
|
@@ -150,6 +152,8 @@ function buildOperatorShellSummary(input) {
|
|
|
150
152
|
coordination_admin_view: "/v1/coordination-center/admin-view",
|
|
151
153
|
hosted_checkout_purchase_intents: `/v1/checkout/purchase-intents?account_id=${encodeURIComponent(accountId)}`,
|
|
152
154
|
hosted_checkout_runtime_bridge_dispatches: `/v1/runtime-bridge/dispatches?account_id=${encodeURIComponent(accountId)}`,
|
|
155
|
+
runtime_durability: "/v1/runtime/durability",
|
|
156
|
+
native_settlement_readiness: "/v1/settlement/bsv-teranode/readiness",
|
|
153
157
|
proof_governance_dashboard: "/v1/proof-center/governance/dashboard",
|
|
154
158
|
proof_bridge_admin_pack: "/v1/proof-center/bridge/admin-pack"
|
|
155
159
|
},
|
|
@@ -166,7 +170,17 @@ function buildOperatorShellSummary(input) {
|
|
|
166
170
|
hosted_checkout_execution_dispatched_count: Number(hostedCheckoutOperatorSummary.execution_dispatched_count || 0)
|
|
167
171
|
,
|
|
168
172
|
low_balance_entitlement_count: Number(entitlementReplenishmentSummary.low_balance_count || 0),
|
|
169
|
-
depleted_entitlement_count: Number(entitlementReplenishmentSummary.depleted_count || 0)
|
|
173
|
+
depleted_entitlement_count: Number(entitlementReplenishmentSummary.depleted_count || 0),
|
|
174
|
+
runtime_snapshot_enabled: runtimeDurability.enabled === true,
|
|
175
|
+
runtime_snapshot_exists: runtimeDurability.snapshot_exists === true,
|
|
176
|
+
runtime_recovery_posture: runtimeDurability.recovery_posture || null,
|
|
177
|
+
native_settlement_runtime_mode: runtimeDurability.enabled === true || nativeSettlementReadiness.runtime_mode
|
|
178
|
+
? nativeSettlementReadiness.runtime_mode || null
|
|
179
|
+
: null,
|
|
180
|
+
native_settlement_ready: nativeSettlementReadiness.ready === true,
|
|
181
|
+
native_settlement_blocker_count: Array.isArray(nativeSettlementReadiness.blockers)
|
|
182
|
+
? nativeSettlementReadiness.blockers.length
|
|
183
|
+
: 0
|
|
170
184
|
},
|
|
171
185
|
linked_refs: {
|
|
172
186
|
operations_dashboard_ref: buildShellRef("operator-shell.operations-dashboard", {
|
|
@@ -182,7 +196,9 @@ function buildOperatorShellSummary(input) {
|
|
|
182
196
|
,
|
|
183
197
|
entitlement_replenishment_summary_ref: entitlementReplenishmentSummary.entitlement_count != null
|
|
184
198
|
? `/v1/economics/accounts/${encodeURIComponent(accountId)}/entitlements/replenishment-summary`
|
|
185
|
-
: null
|
|
199
|
+
: null,
|
|
200
|
+
runtime_durability_ref: runtimeDurability.inspect_ref || "/v1/runtime/durability",
|
|
201
|
+
native_settlement_readiness_ref: nativeSettlementReadiness.readiness_ref || "/v1/settlement/bsv-teranode/readiness"
|
|
186
202
|
}
|
|
187
203
|
};
|
|
188
204
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const packageJson = require("../package.json");
|
|
4
|
+
|
|
5
|
+
function buildEcosystemEntryPack() {
|
|
6
|
+
return {
|
|
7
|
+
ok: true,
|
|
8
|
+
product: packageJson.name,
|
|
9
|
+
category: "machine-commerce-ecosystem-entry",
|
|
10
|
+
audiences: [
|
|
11
|
+
{
|
|
12
|
+
audience_ref: "agent_builder",
|
|
13
|
+
why_now: "needs a first paid machine capability path with governed execution and proof-aware followthrough",
|
|
14
|
+
first_path_ref: "scenario.direct_pay.trust_verify",
|
|
15
|
+
first_http_entrypoint: "/v1/release-pack/scenarios/summary",
|
|
16
|
+
first_cli_entrypoint: "xytara-run --url https://xytara.onrender.com --account acct_demo --command \"cli-run\" --task trust.verify --body-json '{\"subject_id\":\"subject-1\"}' --wallet-id merchant_wallet_main --wallet-secret YOUR_LOCAL_SIGNED_SECRET --txid YOUR_BSV_TXID"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
audience_ref: "marketplace_or_tool_author",
|
|
20
|
+
why_now: "needs a neutral default path for quoting, payment admission, execution, and operator inspection",
|
|
21
|
+
first_path_ref: "scenario.direct_pay.trust_verify",
|
|
22
|
+
first_http_entrypoint: "/v1/release-pack/launch/summary",
|
|
23
|
+
first_cli_entrypoint: "xytara-release --launch --summary"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
audience_ref: "repeat_usage_operator",
|
|
27
|
+
why_now: "needs reusable account balance posture without redesigning the public execution surface",
|
|
28
|
+
first_path_ref: "scenario.credits_first.repeat_run",
|
|
29
|
+
first_http_entrypoint: "/v1/economics/accounts/:account_id/credit-balance",
|
|
30
|
+
first_cli_entrypoint: "xytara-release --scenarios --summary"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
audience_ref: "proof_aware_runtime_team",
|
|
34
|
+
why_now: "needs a runtime result that can continue directly into proof review instead of ending as logs",
|
|
35
|
+
first_path_ref: "scenario.runtime_to_proof.followthrough",
|
|
36
|
+
first_http_entrypoint: "/v1/transaction-center/result-packages",
|
|
37
|
+
first_cli_entrypoint: "xytara-release --center --summary"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
public_lead_sequence: [
|
|
41
|
+
"identify the audience and first success path",
|
|
42
|
+
"show the one-line cli or one-http-entrypoint path",
|
|
43
|
+
"show the matching comparison and adoption summary",
|
|
44
|
+
"show the release center when credibility and breadth need one compact artifact"
|
|
45
|
+
]
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function summarizeEcosystemEntryPack() {
|
|
50
|
+
const pack = buildEcosystemEntryPack();
|
|
51
|
+
return {
|
|
52
|
+
ok: true,
|
|
53
|
+
product: pack.product,
|
|
54
|
+
category: pack.category,
|
|
55
|
+
audience_count: pack.audiences.length,
|
|
56
|
+
first_audience: pack.audiences[0] ? pack.audiences[0].audience_ref : null,
|
|
57
|
+
lead_step_count: pack.public_lead_sequence.length
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = {
|
|
62
|
+
buildEcosystemEntryPack,
|
|
63
|
+
summarizeEcosystemEntryPack
|
|
64
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const packageJson = require("../package.json");
|
|
4
|
+
|
|
5
|
+
function buildLaunchNarrativePack() {
|
|
6
|
+
return {
|
|
7
|
+
ok: true,
|
|
8
|
+
product: packageJson.name,
|
|
9
|
+
category: "machine-commerce-launch-narrative",
|
|
10
|
+
why_now: "agents and machine systems increasingly need to cross weak-trust boundaries where payment, execution, proof, and replayability cannot stay disconnected",
|
|
11
|
+
problem_patchwork_misses: [
|
|
12
|
+
"runtime-only stacks do not carry pricing, settlement, and proof continuity together",
|
|
13
|
+
"payment-only stacks do not stay attached to real machine work and reusable spend posture",
|
|
14
|
+
"ad hoc glue leaves operators to reconstruct trust and consequence after the fact"
|
|
15
|
+
],
|
|
16
|
+
strongest_public_claim: "quote pay execute prove in one governed machine flow",
|
|
17
|
+
first_proof_to_run: {
|
|
18
|
+
path_ref: "scenario.direct_pay.trust_verify",
|
|
19
|
+
why_this_first: "smallest strong-signal run that shows paid machine execution, inspectable records, and proof-aware followthrough",
|
|
20
|
+
cli: "xytara-run --url https://xytara.onrender.com --account acct_demo --command \"cli-run\" --task trust.verify --body-json '{\"subject_id\":\"subject-1\"}' --wallet-id merchant_wallet_main --wallet-secret YOUR_LOCAL_SIGNED_SECRET --txid YOUR_BSV_TXID"
|
|
21
|
+
},
|
|
22
|
+
first_success_looks_like: [
|
|
23
|
+
"one capability is discovered and quoted",
|
|
24
|
+
"payment or credits admission succeeds",
|
|
25
|
+
"transaction, payment, and settlement records are inspectable",
|
|
26
|
+
"result output can continue into xoonya instead of ending as runtime exhaust"
|
|
27
|
+
],
|
|
28
|
+
immediate_should_care: [
|
|
29
|
+
"agent builders needing paid capability execution",
|
|
30
|
+
"tool and marketplace authors needing neutral transaction handling",
|
|
31
|
+
"operators needing credits-first repeat machine use",
|
|
32
|
+
"runtime teams needing proof-aware continuation"
|
|
33
|
+
]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function summarizeLaunchNarrativePack() {
|
|
38
|
+
const pack = buildLaunchNarrativePack();
|
|
39
|
+
return {
|
|
40
|
+
ok: true,
|
|
41
|
+
product: pack.product,
|
|
42
|
+
category: pack.category,
|
|
43
|
+
patchwork_gap_count: pack.problem_patchwork_misses.length,
|
|
44
|
+
success_signal_count: pack.first_success_looks_like.length,
|
|
45
|
+
immediate_audience_count: pack.immediate_should_care.length,
|
|
46
|
+
first_path_ref: pack.first_proof_to_run.path_ref
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = {
|
|
51
|
+
buildLaunchNarrativePack,
|
|
52
|
+
summarizeLaunchNarrativePack
|
|
53
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const packageJson = require("../package.json");
|
|
4
|
+
|
|
5
|
+
function buildOutreachProofPack() {
|
|
6
|
+
return {
|
|
7
|
+
ok: true,
|
|
8
|
+
product: packageJson.name,
|
|
9
|
+
category: "machine-commerce-outreach-proof",
|
|
10
|
+
proven_live_today: [
|
|
11
|
+
"x402 payment admission for direct machine execution",
|
|
12
|
+
"native BSV settlement observe path with finalized state",
|
|
13
|
+
"credits-first account-funded spend and deterministic usage metering",
|
|
14
|
+
"operator inspection across payment, settlement, treasury, and proof carry"
|
|
15
|
+
],
|
|
16
|
+
live_rails: [
|
|
17
|
+
{
|
|
18
|
+
rail_ref: "direct_machine_payment",
|
|
19
|
+
status: "proven_live",
|
|
20
|
+
trust_signal: "payment admitted, transaction recorded, settlement-linked execution path present"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
rail_ref: "credits_first_repeat_use",
|
|
24
|
+
status: "proven_live",
|
|
25
|
+
trust_signal: "account credits consume against real runs with deterministic usage meters"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
rail_ref: "native_bsv_settlement_observe",
|
|
29
|
+
status: "proven_live",
|
|
30
|
+
trust_signal: "observe runtime finalized against a real txid with confirmations"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
credible_public_proof_path: {
|
|
34
|
+
path_ref: "scenario.direct_pay.trust_verify",
|
|
35
|
+
why_credible: "smallest public run that already aligns with the demonstrated live payment and settlement posture",
|
|
36
|
+
cli: "xytara-run --url https://xytara.onrender.com --account acct_demo --command \"cli-run\" --task trust.verify --body-json '{\"subject_id\":\"subject-1\"}' --wallet-id merchant_wallet_main --wallet-secret YOUR_LOCAL_SIGNED_SECRET --txid YOUR_BSV_TXID"
|
|
37
|
+
},
|
|
38
|
+
trust_today_vs_later: {
|
|
39
|
+
trust_today: [
|
|
40
|
+
"direct paid machine execution",
|
|
41
|
+
"credits-first repeat usage",
|
|
42
|
+
"operator and launch surfaces",
|
|
43
|
+
"proof-aware runtime followthrough"
|
|
44
|
+
],
|
|
45
|
+
later_depth: [
|
|
46
|
+
"broader ecosystem adoption after release",
|
|
47
|
+
"deeper settlement-path breadth beyond current proven posture",
|
|
48
|
+
"continued release-line expansion after public package launch"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function summarizeOutreachProofPack() {
|
|
55
|
+
const pack = buildOutreachProofPack();
|
|
56
|
+
return {
|
|
57
|
+
ok: true,
|
|
58
|
+
product: pack.product,
|
|
59
|
+
category: pack.category,
|
|
60
|
+
proven_count: pack.proven_live_today.length,
|
|
61
|
+
live_rail_count: pack.live_rails.length,
|
|
62
|
+
trust_today_count: pack.trust_today_vs_later.trust_today.length,
|
|
63
|
+
later_depth_count: pack.trust_today_vs_later.later_depth.length,
|
|
64
|
+
first_path_ref: pack.credible_public_proof_path.path_ref
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
module.exports = {
|
|
69
|
+
buildOutreachProofPack,
|
|
70
|
+
summarizeOutreachProofPack
|
|
71
|
+
};
|