@moonbeam-foundation/sdk 0.12.0 → 0.13.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/README.md +79 -18
- package/bin/moonbeam.mjs +4 -1
- package/dist/actors/track-record.d.ts +1 -1
- package/dist/actors/track-record.js +1 -1
- package/dist/arbitration/index.d.ts +10 -4
- package/dist/arbitration/index.d.ts.map +1 -1
- package/dist/arbitration/index.js +14 -2
- package/dist/arbitration/index.js.map +1 -1
- package/dist/assurance/assurance-shared.d.ts +85 -132
- package/dist/assurance/assurance-shared.js +46 -90
- package/dist/core/keyed.d.ts +17 -0
- package/dist/core/keyed.d.ts.map +1 -0
- package/dist/core/keyed.js +36 -0
- package/dist/core/keyed.js.map +1 -0
- package/dist/cover/index.d.ts +3 -3
- package/dist/cover/index.d.ts.map +1 -1
- package/dist/cover/index.js +2 -1
- package/dist/cover/index.js.map +1 -1
- package/dist/devnet/index.d.ts +3 -3
- package/dist/devnet/index.d.ts.map +1 -1
- package/dist/devnet/index.js +7 -6
- package/dist/devnet/index.js.map +1 -1
- package/dist/devnet/profile.d.ts +1 -1
- package/dist/devnet/profile.d.ts.map +1 -1
- package/dist/devnet/profile.js +3 -2
- package/dist/devnet/profile.js.map +1 -1
- package/dist/economy/index.d.ts +264 -0
- package/dist/economy/index.d.ts.map +1 -0
- package/dist/economy/index.js +376 -0
- package/dist/economy/index.js.map +1 -0
- package/dist/erc8183/index.d.ts +1 -1
- package/dist/errors/index.d.ts +5 -5
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +3 -3
- package/dist/jobs/index.d.ts +4 -4
- package/dist/jobs/index.d.ts.map +1 -1
- package/dist/jobs/index.js +3 -2
- package/dist/jobs/index.js.map +1 -1
- package/dist/market/cohorts.d.ts +112 -0
- package/dist/market/cohorts.d.ts.map +1 -0
- package/dist/market/cohorts.js +72 -0
- package/dist/market/cohorts.js.map +1 -0
- package/dist/market/http.d.ts.map +1 -1
- package/dist/market/http.js +2 -1
- package/dist/market/http.js.map +1 -1
- package/dist/market/index.d.ts +27 -17
- package/dist/market/index.d.ts.map +1 -1
- package/dist/market/index.js +16 -9
- package/dist/market/index.js.map +1 -1
- package/dist/market/journey.d.ts +7 -7
- package/dist/market/journey.d.ts.map +1 -1
- package/dist/market/journey.js +10 -9
- package/dist/market/journey.js.map +1 -1
- package/dist/market/listed.d.ts +228 -0
- package/dist/market/listed.d.ts.map +1 -0
- package/dist/market/listed.js +169 -0
- package/dist/market/listed.js.map +1 -0
- package/dist/market/reads.d.ts +124 -0
- package/dist/market/reads.d.ts.map +1 -0
- package/dist/market/reads.js +99 -0
- package/dist/market/reads.js.map +1 -0
- package/dist/market/sale-stops.d.ts +2 -2
- package/dist/market/sale-stops.d.ts.map +1 -1
- package/dist/market/states-data.d.ts +491 -0
- package/dist/market/states-data.d.ts.map +1 -0
- package/dist/market/states-data.js +4 -0
- package/dist/market/states-data.js.map +1 -0
- package/dist/market/states.d.ts +40 -0
- package/dist/market/states.d.ts.map +1 -0
- package/dist/market/states.js +36 -0
- package/dist/market/states.js.map +1 -0
- package/dist/market/venues-data.d.ts.map +1 -1
- package/dist/market/venues-data.js +808 -40
- package/dist/market/venues-data.js.map +1 -1
- package/dist/market/venues.d.ts +50 -5
- package/dist/market/venues.d.ts.map +1 -1
- package/dist/market/venues.js +23 -7
- package/dist/market/venues.js.map +1 -1
- package/dist/onboard/index.d.ts +215 -33
- package/dist/onboard/index.d.ts.map +1 -1
- package/dist/onboard/index.js +344 -34
- package/dist/onboard/index.js.map +1 -1
- package/dist/onboard/send.d.ts +43 -0
- package/dist/onboard/send.d.ts.map +1 -0
- package/dist/onboard/send.js +65 -0
- package/dist/onboard/send.js.map +1 -0
- package/dist/playground/cases.d.ts +72 -0
- package/dist/playground/cases.d.ts.map +1 -0
- package/dist/playground/cases.js +115 -0
- package/dist/playground/cases.js.map +1 -0
- package/dist/playground/doc.d.ts +2 -0
- package/dist/playground/doc.d.ts.map +1 -0
- package/dist/playground/doc.js +52 -0
- package/dist/playground/doc.js.map +1 -0
- package/dist/playground/index.d.ts +172 -0
- package/dist/playground/index.d.ts.map +1 -0
- package/dist/playground/index.js +246 -0
- package/dist/playground/index.js.map +1 -0
- package/dist/playground/nets.d.ts +79 -0
- package/dist/playground/nets.d.ts.map +1 -0
- package/dist/playground/nets.js +147 -0
- package/dist/playground/nets.js.map +1 -0
- package/dist/playground/ports.d.ts +93 -0
- package/dist/playground/ports.d.ts.map +1 -0
- package/dist/playground/ports.js +72 -0
- package/dist/playground/ports.js.map +1 -0
- package/dist/playground/stream.d.ts +106 -0
- package/dist/playground/stream.d.ts.map +1 -0
- package/dist/playground/stream.js +269 -0
- package/dist/playground/stream.js.map +1 -0
- package/dist/pools/index.d.ts +18 -7
- package/dist/pools/index.d.ts.map +1 -1
- package/dist/pools/index.js +31 -9
- package/dist/pools/index.js.map +1 -1
- package/dist/proof/index.d.ts +5 -5
- package/dist/proof/index.d.ts.map +1 -1
- package/dist/proof/index.js +3 -2
- package/dist/proof/index.js.map +1 -1
- package/dist/resale/index.d.ts +13 -13
- package/dist/resale/index.d.ts.map +1 -1
- package/dist/resale/index.js +20 -19
- package/dist/resale/index.js.map +1 -1
- package/dist/resale/payment-scheme.d.mts +2 -5
- package/dist/resale/payment-scheme.mjs +16 -116
- package/dist/resale/payment-scheme.pin.json +1 -2
- package/dist/resale/settle-rule.d.ts +3 -3
- package/dist/resale/settle-rule.d.ts.map +1 -1
- package/dist/resale/settle-rule.js +3 -3
- package/dist/resale/settle-rule.js.map +1 -1
- package/dist/rpc/index.js +1 -1
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/steps.d.ts +4 -4
- package/dist/workflows/steps.d.ts.map +1 -1
- package/dist/workflows/steps.js +4 -4
- package/dist/workflows/steps.js.map +1 -1
- package/dist/workflows/types.d.ts +1 -1
- package/dist/x402/index.d.ts +2 -2
- package/dist/x402/index.d.ts.map +1 -1
- package/dist/x402/index.js +5 -4
- package/dist/x402/index.js.map +1 -1
- package/docs/PATHS.md +96 -0
- package/docs/REFERENCE.md +52 -19
- package/docs/VENUES.md +85 -36
- package/docs/WORKFLOWS.md +3 -3
- package/docs/io-coverage.md +206 -0
- package/docs/playground.md +220 -0
- package/examples/24-resell-on-base.mjs +1 -1
- package/examples/50-x402-pay-a-wall.mjs +1 -1
- package/examples/51-read-a-proof.mjs +2 -2
- package/examples/README.md +1 -1
- package/examples/data/cross-list.recorded.json +1 -1
- package/examples/data/x402-wall-402.json +6 -6
- package/package.json +28 -4
- package/dist/assurance/assurance-shared.d.ts.map +0 -1
- package/dist/assurance/assurance-shared.js.map +0 -1
package/dist/market/journey.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type ListRow = {
|
|
|
12
12
|
at?: string;
|
|
13
13
|
read_at?: string;
|
|
14
14
|
};
|
|
15
|
-
/** A list step as
|
|
15
|
+
/** A list step as Moonbeam keeps it. Moonbeam's own fields ride along. */
|
|
16
16
|
export type ListView = {
|
|
17
17
|
[k: string]: unknown;
|
|
18
18
|
id: string;
|
|
@@ -27,11 +27,11 @@ export type ListView = {
|
|
|
27
27
|
usdc: string;
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
/** The list step's id of an agent, derived the way
|
|
30
|
+
/** The list step's id of an agent, derived the way Moonbeam derives it: `lst_` + the first 16 hex of sha256("list:<ref>"). */
|
|
31
31
|
export declare function listIdOf(ref: string): Promise<string>;
|
|
32
32
|
/**
|
|
33
33
|
* List an agent on the markets where agents are found (`POST /list`): its ERC-8004 record on Base, the MCP Registry and the
|
|
34
|
-
* A2A Registry, all three unless named. Runs on a plan key and is part of the plan (no per-listing price is set).
|
|
34
|
+
* A2A Registry, all three unless named. Runs on a plan key and is part of the plan (no per-listing price is set). Moonbeam serves the agent's MCP door and A2A
|
|
35
35
|
* card and publishes each market; asking again returns the same record, read anew. `ref` is the agent's ERC-8004 id on Base,
|
|
36
36
|
* whose card names the class it sells.
|
|
37
37
|
*/
|
|
@@ -54,7 +54,7 @@ export declare function delistListing(t: OnboardTransport, id: string, o: {
|
|
|
54
54
|
listing: Listing;
|
|
55
55
|
body: Record<string, unknown>;
|
|
56
56
|
}>;
|
|
57
|
-
/**
|
|
57
|
+
/** Moonbeam's register-8004 builder takes an agentURI of at most this many characters. */
|
|
58
58
|
export declare const MAX_INLINE_URI = 2048;
|
|
59
59
|
/** A listing's registration file as an inline `data:` URI (nothing is hosted), or why it cannot be. Pure. */
|
|
60
60
|
export declare function inlineRegistration(x: {
|
|
@@ -71,7 +71,7 @@ export declare function inlineRegistration(x: {
|
|
|
71
71
|
};
|
|
72
72
|
/**
|
|
73
73
|
* Your agent's own ERC-8004 id on Base, as unsigned calls: the listing's registration file (`export.erc8004` of
|
|
74
|
-
* `GET /agent-listings/:id`) inlined as a data: URI, and `register(agentURI)` built by
|
|
74
|
+
* `GET /agent-listings/:id`) inlined as a data: URI, and `register(agentURI)` built by Moonbeam (`POST /assurance/call`).
|
|
75
75
|
* Your wallet signs and owns the id; the receipt's `Registered` event names it. Nothing is signed or sent here.
|
|
76
76
|
*/
|
|
77
77
|
export declare function register8004Calls(t: OnboardTransport, listingId: string): Promise<{
|
|
@@ -108,7 +108,7 @@ export type PlanOffer = {
|
|
|
108
108
|
days: number;
|
|
109
109
|
};
|
|
110
110
|
/**
|
|
111
|
-
* The plans and the top-up, as
|
|
111
|
+
* The plans and the top-up, as Moonbeam's own 402 answer names them (`POST /access/subscribe` with no key and no payment):
|
|
112
112
|
* nothing is minted and nothing is paid. Buying one is the same POST with a payment, from your wallet.
|
|
113
113
|
*/
|
|
114
114
|
export declare function planOffers(t: OnboardTransport): Promise<{
|
|
@@ -158,7 +158,7 @@ export type SaleSlice = {
|
|
|
158
158
|
/**
|
|
159
159
|
* What an agent sold, as the sale run counts it: the slice of its class wall or of its seller host, every sale by day and buying
|
|
160
160
|
* market, and where each seller share stands (paid, kept, held, owed, refunded). The sale run is a published file: pass its URL
|
|
161
|
-
* as `salesUrl` or set MOONBEAM_SALES_URL (it comes with your key). The
|
|
161
|
+
* as `salesUrl` or set MOONBEAM_SALES_URL (it comes with your key). The operator's own seller hosts are said as `ours`.
|
|
162
162
|
* null when the agent has no sale.
|
|
163
163
|
*/
|
|
164
164
|
export declare function agentSales(t: OnboardTransport, ref: string, o?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey.d.ts","sourceRoot":"","sources":["../../src/market/journey.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAyC,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"journey.d.ts","sourceRoot":"","sources":["../../src/market/journey.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAyC,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAKrH,+HAA+H;AAC/H,eAAO,MAAM,YAAY,sDAAsE,CAAC;AAChG,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AACvD,+IAA+I;AAC/I,MAAM,MAAM,OAAO,GAAG;IAAE,KAAK,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACnK,0EAA0E;AAC1E,MAAM,MAAM,QAAQ,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAAC,EAAE,EAAE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,CAAC,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAYtK;AAID;2HAC2H;AAC3H,wBAAsB,WAAW,CAAC,CAAC,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAI1G"}
|
package/dist/market/journey.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsonOf } from '../errors/index.js';
|
|
2
2
|
import { MarketError, call, needKey, query, seg } from './http.js';
|
|
3
3
|
import { jobCalls, publishListing, readListing } from './index.js';
|
|
4
|
+
import { keyedFetch } from '../core/keyed.js';
|
|
4
5
|
// ── list ──────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
5
6
|
/** The markets the list step lists on: the agent's ERC-8004 record on Base, the official MCP Registry and the A2A Registry. */
|
|
6
7
|
export const LIST_MARKETS = Object.freeze(['erc8004', 'mcp_registry', 'a2a_registry']);
|
|
@@ -12,14 +13,14 @@ const listOf = (j, what) => {
|
|
|
12
13
|
throw new MarketError(502, what, j);
|
|
13
14
|
return j.list;
|
|
14
15
|
};
|
|
15
|
-
/** The list step's id of an agent, derived the way
|
|
16
|
+
/** The list step's id of an agent, derived the way Moonbeam derives it: `lst_` + the first 16 hex of sha256("list:<ref>"). */
|
|
16
17
|
export async function listIdOf(ref) {
|
|
17
18
|
const d = await globalThis.crypto.subtle.digest('SHA-256', new TextEncoder().encode(`list:${agentRef(ref)}`));
|
|
18
19
|
return `lst_${[...new Uint8Array(d)].map((b) => b.toString(16).padStart(2, '0')).join('').slice(0, 16)}`;
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* List an agent on the markets where agents are found (`POST /list`): its ERC-8004 record on Base, the MCP Registry and the
|
|
22
|
-
* A2A Registry, all three unless named. Runs on a plan key and is part of the plan (no per-listing price is set).
|
|
23
|
+
* A2A Registry, all three unless named. Runs on a plan key and is part of the plan (no per-listing price is set). Moonbeam serves the agent's MCP door and A2A
|
|
23
24
|
* card and publishes each market; asking again returns the same record, read anew. `ref` is the agent's ERC-8004 id on Base,
|
|
24
25
|
* whose card names the class it sells.
|
|
25
26
|
*/
|
|
@@ -65,7 +66,7 @@ export async function delistListing(t, id, o) {
|
|
|
65
66
|
return statusTo(t, id, 'archived');
|
|
66
67
|
}
|
|
67
68
|
// ── register on ERC-8004 ──────────────────────────────────────────────────────────────────────────────────────────────
|
|
68
|
-
/**
|
|
69
|
+
/** Moonbeam's register-8004 builder takes an agentURI of at most this many characters. */
|
|
69
70
|
export const MAX_INLINE_URI = 2048;
|
|
70
71
|
const base64 = (s) => { let b = ''; for (const c of new TextEncoder().encode(s))
|
|
71
72
|
b += String.fromCharCode(c); return btoa(b); };
|
|
@@ -82,7 +83,7 @@ export function inlineRegistration(x) {
|
|
|
82
83
|
}
|
|
83
84
|
/**
|
|
84
85
|
* Your agent's own ERC-8004 id on Base, as unsigned calls: the listing's registration file (`export.erc8004` of
|
|
85
|
-
* `GET /agent-listings/:id`) inlined as a data: URI, and `register(agentURI)` built by
|
|
86
|
+
* `GET /agent-listings/:id`) inlined as a data: URI, and `register(agentURI)` built by Moonbeam (`POST /assurance/call`).
|
|
86
87
|
* Your wallet signs and owns the id; the receipt's `Registered` event names it. Nothing is signed or sent here.
|
|
87
88
|
*/
|
|
88
89
|
export async function register8004Calls(t, listingId) {
|
|
@@ -113,13 +114,13 @@ export async function tenantKeys(t) {
|
|
|
113
114
|
return { keys: j.keys ?? [], recentChanges: j.recent_changes ?? [], body: j };
|
|
114
115
|
}
|
|
115
116
|
/**
|
|
116
|
-
* The plans and the top-up, as
|
|
117
|
+
* The plans and the top-up, as Moonbeam's own 402 answer names them (`POST /access/subscribe` with no key and no payment):
|
|
117
118
|
* nothing is minted and nothing is paid. Buying one is the same POST with a payment, from your wallet.
|
|
118
119
|
*/
|
|
119
120
|
export async function planOffers(t) {
|
|
120
121
|
const what = 'POST /access/subscribe';
|
|
121
|
-
// no key and no create_key:
|
|
122
|
-
const r = await t
|
|
122
|
+
// no key and no create_key: Moonbeam answers its terms with 402 and mints nothing
|
|
123
|
+
const r = await keyedFetch(t, `${t.base}/access/subscribe`, { method: 'POST', headers: { accept: 'application/json', 'content-type': 'application/json' }, body: '{}' });
|
|
123
124
|
const j = (await jsonOf(r));
|
|
124
125
|
if (r.status !== 402 || !j || j.code !== 'payment_required')
|
|
125
126
|
throw new MarketError(r.status === 402 ? 502 : r.status, what, j);
|
|
@@ -148,7 +149,7 @@ const keyOfRef = (ref) => {
|
|
|
148
149
|
/**
|
|
149
150
|
* What an agent sold, as the sale run counts it: the slice of its class wall or of its seller host, every sale by day and buying
|
|
150
151
|
* market, and where each seller share stands (paid, kept, held, owed, refunded). The sale run is a published file: pass its URL
|
|
151
|
-
* as `salesUrl` or set MOONBEAM_SALES_URL (it comes with your key). The
|
|
152
|
+
* as `salesUrl` or set MOONBEAM_SALES_URL (it comes with your key). The operator's own seller hosts are said as `ours`.
|
|
152
153
|
* null when the agent has no sale.
|
|
153
154
|
*/
|
|
154
155
|
export async function agentSales(t, ref, o = {}) {
|
|
@@ -156,7 +157,7 @@ export async function agentSales(t, ref, o = {}) {
|
|
|
156
157
|
const url = (o.salesUrl ?? (typeof process !== 'undefined' ? process.env?.['MOONBEAM_SALES_URL'] : undefined) ?? '').trim();
|
|
157
158
|
if (!/^https:\/\//.test(url))
|
|
158
159
|
throw new RangeError('agentSales reads the sale run: pass { salesUrl } or set MOONBEAM_SALES_URL (https)');
|
|
159
|
-
const r = await t
|
|
160
|
+
const r = await keyedFetch(t, url, { method: 'GET', headers: { accept: 'application/json' } });
|
|
160
161
|
const j = (await jsonOf(r));
|
|
161
162
|
const b = j?.by_agent;
|
|
162
163
|
if (!r.ok || !b || b.rule !== 'SALE_SLICES_v1' || !Array.isArray(b.slices))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey.js","sourceRoot":"","sources":["../../src/market/journey.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAoD,MAAM,YAAY,CAAC;AAErH,yHAAyH;AAEzH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,cAAc,CAAU,CAAC,CAAC;AAMhG,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAE,EAAE,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAAE,MAAM,IAAI,UAAU,CAAC,uCAAuC,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAChL,MAAM,MAAM,GAAG,CAAC,CAAsB,EAAE,IAAY,EAAY,EAAE;IAChE,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACrG,OAAO,CAAC,CAAC,IAAI,CAAC;AAChB,CAAC,CAAC;AAEF,+HAA+H;AAC/H,MAAM,CAA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AC,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1C,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,wCAAwC,SAAS,EAAE,CAAC,CAAC;IAC/G,OAAO,IAAI,CAA0B,CAAC,EAAE,KAAK,EAAE,wBAAwB,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import type { OnboardTransport } from '../onboard/index.js';
|
|
2
|
+
import { type VenueId } from './venues.js';
|
|
3
|
+
export declare const JOURNEY_SCHEMA = "listed.journey.v1";
|
|
4
|
+
/** The five LEDs of an agent on a venue: its offer is up, a buyer can hire it, it is listed, the listing reads back, it was paid. */
|
|
5
|
+
export declare const JOURNEY_LEDS: readonly ["offer", "hire", "list", "read_back", "paid"];
|
|
6
|
+
export type JourneyLed = (typeof JOURNEY_LEDS)[number];
|
|
7
|
+
/** An LED's state. `unread`: the read behind it did not answer, so it is neither on nor off. */
|
|
8
|
+
export type LedState = 'on' | 'partial' | 'off' | 'unread';
|
|
9
|
+
/** Where the agent stands on a venue. */
|
|
10
|
+
export type JourneyStanding = 'listed_by_owner' | 'listed_by_moonbeam' | 'listable' | 'not_yet' | 'closed' | 'unread';
|
|
11
|
+
/** The next step's kind. */
|
|
12
|
+
export type JourneyAct = 'list' | 'probe' | 'hire' | 'paid' | 'improve' | 'reread' | 'identity' | 'none';
|
|
13
|
+
/** One read behind an LED: its kind, what it read, and when. */
|
|
14
|
+
export type JourneyEvidence = {
|
|
15
|
+
kind: string;
|
|
16
|
+
ref: string;
|
|
17
|
+
read_at: string | null;
|
|
18
|
+
};
|
|
19
|
+
/** One LED: its state, one plain line on why, the reads that lit it (an LED is on only with one), and what would move it. */
|
|
20
|
+
export type JourneyLight = {
|
|
21
|
+
state: LedState;
|
|
22
|
+
why: string;
|
|
23
|
+
evidence: JourneyEvidence[];
|
|
24
|
+
moves_when: string;
|
|
25
|
+
};
|
|
26
|
+
/** The numbered steps a person takes on a venue, only where no machine path exists; the last step is the venue's own URL. */
|
|
27
|
+
export type JourneyHuman = {
|
|
28
|
+
where: string;
|
|
29
|
+
steps: string[];
|
|
30
|
+
url: string;
|
|
31
|
+
why: string;
|
|
32
|
+
};
|
|
33
|
+
export type JourneyPrefill = {
|
|
34
|
+
ref: string;
|
|
35
|
+
class: string | null;
|
|
36
|
+
resource: string | null;
|
|
37
|
+
venue: string;
|
|
38
|
+
step: string;
|
|
39
|
+
};
|
|
40
|
+
/** The one next step: in the Studio, by the machine, by a person (with numbered steps), or none. */
|
|
41
|
+
export type JourneyNext = {
|
|
42
|
+
by: 'studio' | 'genie' | 'human' | 'none';
|
|
43
|
+
act: JourneyAct;
|
|
44
|
+
studio?: {
|
|
45
|
+
step: string;
|
|
46
|
+
chat?: string;
|
|
47
|
+
label: string;
|
|
48
|
+
prefill: JourneyPrefill;
|
|
49
|
+
};
|
|
50
|
+
genie?: {
|
|
51
|
+
op: string;
|
|
52
|
+
prefill: JourneyPrefill;
|
|
53
|
+
};
|
|
54
|
+
human?: JourneyHuman;
|
|
55
|
+
why: string;
|
|
56
|
+
};
|
|
57
|
+
/** The agent on one venue. `agent_paid_7d` is the agent's own money there; `market` is everyone's money on that venue. */
|
|
58
|
+
export type JourneyVenue = {
|
|
59
|
+
[k: string]: unknown;
|
|
60
|
+
venue_id: VenueId;
|
|
61
|
+
venue: string;
|
|
62
|
+
mark: string;
|
|
63
|
+
leds: Record<JourneyLed, JourneyLight>;
|
|
64
|
+
standing: JourneyStanding;
|
|
65
|
+
proof?: {
|
|
66
|
+
kind: string;
|
|
67
|
+
url: string | null;
|
|
68
|
+
ref?: string;
|
|
69
|
+
read_at: string | null;
|
|
70
|
+
};
|
|
71
|
+
agent_paid_7d?: {
|
|
72
|
+
usd: number | null;
|
|
73
|
+
buyers: number | null;
|
|
74
|
+
jobs?: number | null;
|
|
75
|
+
window: '7d';
|
|
76
|
+
from: 'board_row' | 'seller_profile';
|
|
77
|
+
read_at: string | null;
|
|
78
|
+
};
|
|
79
|
+
market?: {
|
|
80
|
+
usd_7d: number | null;
|
|
81
|
+
payments_7d: number | null;
|
|
82
|
+
buyers_7d: number | null;
|
|
83
|
+
sellers: number | null;
|
|
84
|
+
class_usd_7d?: number;
|
|
85
|
+
from: 'venue_sides';
|
|
86
|
+
read_at: string | null;
|
|
87
|
+
};
|
|
88
|
+
next: JourneyNext;
|
|
89
|
+
why: string;
|
|
90
|
+
flags?: string[];
|
|
91
|
+
};
|
|
92
|
+
/** listed.journey.v1, with the venues keyed by id: every venue of `VENUE_IDS` is there, or the read is refused. */
|
|
93
|
+
export type Journey = {
|
|
94
|
+
schema: typeof JOURNEY_SCHEMA;
|
|
95
|
+
agent: {
|
|
96
|
+
ref: string;
|
|
97
|
+
name: string;
|
|
98
|
+
kind: 'outside' | 'house';
|
|
99
|
+
class: string | null;
|
|
100
|
+
host?: string;
|
|
101
|
+
page?: {
|
|
102
|
+
state: string;
|
|
103
|
+
read_at: string | null;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
read_at: string;
|
|
107
|
+
headline: {
|
|
108
|
+
text: string | null;
|
|
109
|
+
from: '402' | 'class' | 'unread';
|
|
110
|
+
resource: string | null;
|
|
111
|
+
class: string | null;
|
|
112
|
+
class_mismatch: string[] | 'unread';
|
|
113
|
+
};
|
|
114
|
+
/** the class probe and the grade after it; no grade is on before the probe */
|
|
115
|
+
checks: Record<'probe' | 'grade', JourneyLight>;
|
|
116
|
+
venues: Record<VenueId, JourneyVenue>;
|
|
117
|
+
/** the reads the answer was made from, each ok, unread or kept (the last good read stands) */
|
|
118
|
+
reads: {
|
|
119
|
+
kind: string;
|
|
120
|
+
state: 'ok' | 'unread' | 'kept';
|
|
121
|
+
read_at: string | null;
|
|
122
|
+
why?: string;
|
|
123
|
+
}[];
|
|
124
|
+
/** what could not be read, in words */
|
|
125
|
+
unread: string[];
|
|
126
|
+
/** venue ids the answer holds that this SDK does not know yet (their rows stay in `body`) */
|
|
127
|
+
extra: string[];
|
|
128
|
+
body: Record<string, unknown>;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* One agent on every venue (`GET /listed?agent=<ref>&view=journey`): where it stands, its five LEDs with why, evidence and
|
|
132
|
+
* what would move each, and the one next step (a Studio step, a machine step, or a person's numbered steps where no machine
|
|
133
|
+
* path exists). Public. A ref is `8453:<ERC-8004 id>`, `erc8004:<chain>:<id>`, or a board row (`x402:<12 hex>`, `x402:host:<host>`,
|
|
134
|
+
* `virtuals:`, `bitagent:`, `near:`, `olas:` + 12 hex).
|
|
135
|
+
*/
|
|
136
|
+
export declare function journey(t: OnboardTransport, ref: string): Promise<Journey>;
|
|
137
|
+
/** A listed.journey.v1 body as the typed answer, its venues keyed by id. Pure; throws a MarketError when the body breaks the schema. */
|
|
138
|
+
export declare function journeyOf(j: Record<string, unknown>, what?: string): Journey;
|
|
139
|
+
export declare const LIST_SCHEMA = "genie.list.virtuals.v1";
|
|
140
|
+
/** The venues `list` plans a listing on: Virtuals ACP. Every other venue's next step is in `journey(t, ref).venues[id].next`. */
|
|
141
|
+
export declare const LIST_VENUES: readonly ["erc8183-base"];
|
|
142
|
+
export type ListVenue = (typeof LIST_VENUES)[number];
|
|
143
|
+
/** The steps of a Virtuals ACP listing, in the order the Studio's list step runs them. */
|
|
144
|
+
export declare const LIST_STEPS: readonly ["agent", "signer", "register", "seller", "offerings", "readback"];
|
|
145
|
+
export type ListStepId = (typeof LIST_STEPS)[number];
|
|
146
|
+
/** A step's state. `waiting_approval` appears only in the Studio's run, with the approval's link. */
|
|
147
|
+
export type ListStepState = 'done' | 'running' | 'waiting' | 'waiting_approval' | 'refused' | 'skipped';
|
|
148
|
+
/** Whose move a step is. */
|
|
149
|
+
export type ListWho = 'machine' | 'owner' | 'builder';
|
|
150
|
+
export type ListStep = {
|
|
151
|
+
step: ListStepId;
|
|
152
|
+
state: ListStepState;
|
|
153
|
+
who: ListWho;
|
|
154
|
+
read_at: string;
|
|
155
|
+
evidence: {
|
|
156
|
+
kind: string;
|
|
157
|
+
ref?: string;
|
|
158
|
+
url?: string;
|
|
159
|
+
why?: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
export type ListOffering = {
|
|
163
|
+
name: string;
|
|
164
|
+
priceUsdc: number | null;
|
|
165
|
+
shown: boolean;
|
|
166
|
+
held?: string;
|
|
167
|
+
};
|
|
168
|
+
/** The one thing a person does, for whoever holds the venue account. `url` is null until the Studio's run asks the venue for the link. */
|
|
169
|
+
export type ListHuman = {
|
|
170
|
+
kind: 'approval';
|
|
171
|
+
for: 'owner' | 'builder';
|
|
172
|
+
url: string | null;
|
|
173
|
+
page: string;
|
|
174
|
+
expires_at: string | null;
|
|
175
|
+
chat: string;
|
|
176
|
+
};
|
|
177
|
+
/** genie.list.virtuals.v1: the listing as it stands, step by step. */
|
|
178
|
+
export type ListPlan = {
|
|
179
|
+
schema: typeof LIST_SCHEMA;
|
|
180
|
+
ref: string;
|
|
181
|
+
venue: ListVenue;
|
|
182
|
+
/** whose Virtuals account the agent is in: Moonbeam's own, or a builder's */
|
|
183
|
+
account: 'house:moonbeam' | 'builder';
|
|
184
|
+
agent: {
|
|
185
|
+
id: string;
|
|
186
|
+
name: string | null;
|
|
187
|
+
page: string;
|
|
188
|
+
chains: {
|
|
189
|
+
chainId: number;
|
|
190
|
+
erc8004AgentId: number | null;
|
|
191
|
+
}[];
|
|
192
|
+
};
|
|
193
|
+
erc8004AgentId: number | null;
|
|
194
|
+
steps: ListStep[];
|
|
195
|
+
offerings: ListOffering[];
|
|
196
|
+
human: ListHuman | null;
|
|
197
|
+
done: boolean;
|
|
198
|
+
};
|
|
199
|
+
/** What a run would set: the agent's name and description, and per offering (by name) its description and price. */
|
|
200
|
+
export type ListCustom = {
|
|
201
|
+
name?: string;
|
|
202
|
+
description?: string;
|
|
203
|
+
offerings?: {
|
|
204
|
+
name: string;
|
|
205
|
+
description?: string;
|
|
206
|
+
priceUsdc?: number;
|
|
207
|
+
}[];
|
|
208
|
+
};
|
|
209
|
+
/** Moonbeam's own agent on Virtuals ACP. Any other agent id is read as a builder's, in its own account. */
|
|
210
|
+
export declare const HOUSE_AGENTS: Readonly<Record<'moonbeam', string>>;
|
|
211
|
+
/**
|
|
212
|
+
* The listing of an agent on a venue, step by step as it stands now (genie.list.virtuals.v1). Read and plan only: the SDK never
|
|
213
|
+
* asks for a signer, registers, shows an offering or approves anything, and never moves money. The Moonbeam Studio's list step
|
|
214
|
+
* runs the steps; `human` names the one approval a person gives there (the venue account's holder: the owner for Moonbeam's own
|
|
215
|
+
* agent, the builder for theirs), and is returned, never acted on.
|
|
216
|
+
*
|
|
217
|
+
* `agent` is `moonbeam` (Moonbeam's own Virtuals agent) or a Virtuals agent id. `custom` is what the run would set: the agent's
|
|
218
|
+
* name and description, and per offering its description and price; the plan shows those offerings and says what would change.
|
|
219
|
+
* The venue's own public record is read through the transport's fetch (`o.api`, default https://api.acp.virtuals.io).
|
|
220
|
+
*/
|
|
221
|
+
export declare function list(t: OnboardTransport, o: {
|
|
222
|
+
venue: ListVenue;
|
|
223
|
+
agent: string;
|
|
224
|
+
custom?: ListCustom;
|
|
225
|
+
now?: () => string;
|
|
226
|
+
api?: string;
|
|
227
|
+
}): Promise<ListPlan>;
|
|
228
|
+
//# sourceMappingURL=listed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listed.d.ts","sourceRoot":"","sources":["../../src/market/listed.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAKtD,eAAO,MAAM,cAAc,sBAAsB,CAAC;AAClD,qIAAqI;AACrI,eAAO,MAAM,YAAY,yDAAyE,CAAC;AACnG,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,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I,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AACF,oHAAoH;AACpH,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC;AAE3I,2GAA2G;AAC3G,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAuE,CAAC;AAmFtI;;;;;;;;;GASG;AACH,wBAAsB,IAAI,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAUhK"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { jsonOf } from '../errors/index.js';
|
|
2
|
+
import { MarketError, call, query } from './http.js';
|
|
3
|
+
import { VENUE_IDS } from './venues.js';
|
|
4
|
+
import { keyedFetch } from '../core/keyed.js';
|
|
5
|
+
// ── journey ───────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
6
|
+
export const JOURNEY_SCHEMA = 'listed.journey.v1';
|
|
7
|
+
/** The five LEDs of an agent on a venue: its offer is up, a buyer can hire it, it is listed, the listing reads back, it was paid. */
|
|
8
|
+
export const JOURNEY_LEDS = Object.freeze(['offer', 'hire', 'list', 'read_back', 'paid']);
|
|
9
|
+
/** The refs a journey takes: an agent's ERC-8004 id (`8453:<id>` or `erc8004:<chain>:<id>`), or its row on a market's board. */
|
|
10
|
+
const JOURNEY_REF = /^(?:(?:x402|virtuals|bitagent|near|olas):[0-9a-f]{12}|x402:host:[a-z0-9.-]{3,253}|(?:erc8004:)?\d{1,10}:\d{1,12})$/;
|
|
11
|
+
/**
|
|
12
|
+
* One agent on every venue (`GET /listed?agent=<ref>&view=journey`): where it stands, its five LEDs with why, evidence and
|
|
13
|
+
* what would move each, and the one next step (a Studio step, a machine step, or a person's numbered steps where no machine
|
|
14
|
+
* path exists). Public. A ref is `8453:<ERC-8004 id>`, `erc8004:<chain>:<id>`, or a board row (`x402:<12 hex>`, `x402:host:<host>`,
|
|
15
|
+
* `virtuals:`, `bitagent:`, `near:`, `olas:` + 12 hex).
|
|
16
|
+
*/
|
|
17
|
+
export async function journey(t, ref) {
|
|
18
|
+
const r = String(ref ?? '').trim();
|
|
19
|
+
if (!JOURNEY_REF.test(r))
|
|
20
|
+
throw new RangeError(`not an agent ref: ${ref} (8453:<id>, erc8004:<chain>:<id>, x402:<12 hex>, x402:host:<host>, or virtuals: / bitagent: / near: / olas: + 12 hex)`);
|
|
21
|
+
const what = 'GET /listed?view=journey';
|
|
22
|
+
const j = await call(t, 'GET', `/listed${query({ agent: r, view: 'journey' })}`);
|
|
23
|
+
return journeyOf(j, what);
|
|
24
|
+
}
|
|
25
|
+
/** A listed.journey.v1 body as the typed answer, its venues keyed by id. Pure; throws a MarketError when the body breaks the schema. */
|
|
26
|
+
export function journeyOf(j, what = 'listed.journey.v1') {
|
|
27
|
+
const rows = j['venues'];
|
|
28
|
+
if (j['schema'] !== JOURNEY_SCHEMA || !Array.isArray(rows) || !j['agent'] || !j['checks'])
|
|
29
|
+
throw new MarketError(502, what, { ok: false, code: 'bad_answer', error: `${what} did not answer ${JOURNEY_SCHEMA}` });
|
|
30
|
+
const by = new Map(rows.map((v) => [v.venue_id, v]));
|
|
31
|
+
const missing = VENUE_IDS.filter((id) => !by.has(id) || !by.get(id)?.leds);
|
|
32
|
+
if (missing.length)
|
|
33
|
+
throw new MarketError(502, what, { ok: false, code: 'bad_answer', error: `${what} has no row for ${missing.join(', ')}` });
|
|
34
|
+
const venues = Object.fromEntries(VENUE_IDS.map((id) => [id, by.get(id)]));
|
|
35
|
+
return {
|
|
36
|
+
schema: JOURNEY_SCHEMA,
|
|
37
|
+
agent: j['agent'],
|
|
38
|
+
read_at: String(j['read_at'] ?? ''),
|
|
39
|
+
headline: j['headline'],
|
|
40
|
+
checks: j['checks'],
|
|
41
|
+
venues,
|
|
42
|
+
reads: Array.isArray(j['reads']) ? j['reads'] : [],
|
|
43
|
+
unread: Array.isArray(j['unread']) ? j['unread'] : [],
|
|
44
|
+
extra: [...by.keys()].filter((id) => !VENUE_IDS.includes(id)),
|
|
45
|
+
body: j,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// ── list ──────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
49
|
+
export const LIST_SCHEMA = 'genie.list.virtuals.v1';
|
|
50
|
+
/** The venues `list` plans a listing on: Virtuals ACP. Every other venue's next step is in `journey(t, ref).venues[id].next`. */
|
|
51
|
+
export const LIST_VENUES = Object.freeze(['erc8183-base']);
|
|
52
|
+
/** The steps of a Virtuals ACP listing, in the order the Studio's list step runs them. */
|
|
53
|
+
export const LIST_STEPS = Object.freeze(['agent', 'signer', 'register', 'seller', 'offerings', 'readback']);
|
|
54
|
+
/** Moonbeam's own agent on Virtuals ACP. Any other agent id is read as a builder's, in its own account. */
|
|
55
|
+
export const HOUSE_AGENTS = Object.freeze({ moonbeam: '01a1cc7f-97ae-74da-8f87-b25514174a22' });
|
|
56
|
+
const AGENT_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
57
|
+
const BASE = 8453;
|
|
58
|
+
const VIRTUALS_API = 'https://api.acp.virtuals.io';
|
|
59
|
+
const VIRTUALS_APP = 'https://app.virtuals.io/acp/agents';
|
|
60
|
+
const checkCustom = (c) => {
|
|
61
|
+
if (!c)
|
|
62
|
+
return null;
|
|
63
|
+
const line = (s, max, what) => { if (s !== undefined && (typeof s !== 'string' || !s.trim() || s.length > max))
|
|
64
|
+
throw new RangeError(`${what} is 1 to ${max} characters`); };
|
|
65
|
+
line(c.name, 80, 'custom.name');
|
|
66
|
+
line(c.description, 1000, 'custom.description');
|
|
67
|
+
for (const o of c.offerings ?? []) {
|
|
68
|
+
line(o.name, 80, 'an offering name');
|
|
69
|
+
line(o.description, 1000, `${o.name}: its description`);
|
|
70
|
+
if (o.priceUsdc !== undefined && !(Number.isFinite(o.priceUsdc) && o.priceUsdc > 0))
|
|
71
|
+
throw new RangeError(`${o.name}: priceUsdc is a positive number of USDC`);
|
|
72
|
+
}
|
|
73
|
+
return c;
|
|
74
|
+
};
|
|
75
|
+
/** Virtuals ACP: the plan from the agent's own public record (its chains, its ERC-8004 id, its offerings shown or hidden). */
|
|
76
|
+
const planVirtuals = async (t, { agent, account, custom, now, api }) => {
|
|
77
|
+
const page = `${VIRTUALS_APP}/${agent}`;
|
|
78
|
+
const url = `${api}/agents/${agent}`;
|
|
79
|
+
const r = await keyedFetch(t, url, { method: 'GET', headers: { accept: 'application/json' } });
|
|
80
|
+
const body = await jsonOf(r);
|
|
81
|
+
if (!r.ok && r.status !== 404)
|
|
82
|
+
throw new MarketError(r.status, 'GET virtuals /agents/:id', body);
|
|
83
|
+
const rec = r.ok && body && typeof body === 'object' ? (body.data ?? body) : null;
|
|
84
|
+
const at = now();
|
|
85
|
+
const steps = [];
|
|
86
|
+
const step = (s, state, who, evidence) => steps.push({ step: s, state, who, read_at: at, evidence });
|
|
87
|
+
const person = account === 'house:moonbeam' ? 'owner' : 'builder';
|
|
88
|
+
const chains = (rec?.chains ?? []).map((c) => ({ chainId: Number(c.chainId), erc8004AgentId: c.erc8004AgentId ?? null }));
|
|
89
|
+
const erc8004AgentId = chains.find((c) => c.chainId === BASE)?.erc8004AgentId ?? null;
|
|
90
|
+
const record = (rec?.offerings ?? []).filter((o) => typeof o.name === 'string');
|
|
91
|
+
const shownNames = new Set(record.filter((o) => !o.isHidden).map((o) => o.name));
|
|
92
|
+
// the offerings a run would show: the custom ones by name where given, else the record's own
|
|
93
|
+
const want = custom?.offerings?.length ? custom.offerings.map((o) => o.name) : record.map((o) => o.name);
|
|
94
|
+
const priceOf = (name) => custom?.offerings?.find((o) => o.name === name)?.priceUsdc ?? record.find((o) => o.name === name)?.priceValue ?? null;
|
|
95
|
+
const offerings = want.map((name) => ({ name, priceUsdc: priceOf(name), shown: shownNames.has(name) }));
|
|
96
|
+
const plan = (human) => ({
|
|
97
|
+
schema: LIST_SCHEMA, ref: agent, venue: 'erc8183-base', account,
|
|
98
|
+
agent: { id: agent, name: rec?.name ?? null, page, chains }, erc8004AgentId, steps, offerings, human,
|
|
99
|
+
done: steps.length > 0 && steps.every((s) => s.state === 'done' || s.state === 'skipped'),
|
|
100
|
+
});
|
|
101
|
+
// 1. the agent
|
|
102
|
+
if (!rec || (!rec.id && !rec.name)) {
|
|
103
|
+
step('agent', 'refused', 'machine', { kind: 'virtuals.agent', ref: agent, url, why: 'no such agent on Virtuals' });
|
|
104
|
+
return plan(null);
|
|
105
|
+
}
|
|
106
|
+
step('agent', 'done', 'machine', { kind: 'virtuals.agent', ref: agent, url });
|
|
107
|
+
// 2. the signer, and 3. the ERC-8004 identity on Base: the register call runs through the agent's signer
|
|
108
|
+
let human = null;
|
|
109
|
+
if (erc8004AgentId) {
|
|
110
|
+
step('signer', 'done', 'machine', { kind: 'virtuals.chains', ref: `${BASE}`, why: 'registered on Base, which runs through the agent\'s signer' });
|
|
111
|
+
step('register', 'done', 'machine', { kind: 'erc8004.identity', ref: String(erc8004AgentId) });
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
step('signer', 'waiting', person, { kind: 'virtuals.signer', why: 'the agent has no identity on Base yet: the list step first asks for Moonbeam\'s signer, and its holder approves it once' });
|
|
115
|
+
step('register', 'waiting', 'machine', { kind: 'erc8004.register_call', why: 'registered on Base once the signer is approved (one transaction, no value)' });
|
|
116
|
+
human = { kind: 'approval', for: person, url: null, page, expires_at: null,
|
|
117
|
+
chat: `Approve Moonbeam's signer for this agent. Run the list step in the Moonbeam Studio: it shows the approval link, which lasts five minutes. The agent: ${page}` };
|
|
118
|
+
}
|
|
119
|
+
// 4. the seller: an offering is shown only once the agent's seller answers
|
|
120
|
+
if (shownNames.size)
|
|
121
|
+
step('seller', 'done', 'machine', { kind: 'virtuals.offerings', ref: `${shownNames.size} shown`, why: 'an offering is shown only once the agent\'s seller answers' });
|
|
122
|
+
else
|
|
123
|
+
step('seller', 'waiting', 'machine', { kind: 'seller.unit', why: 'no offering is shown, so the agent\'s seller is not shown to answer yet' });
|
|
124
|
+
// 5. the offerings a run would show, with the custom words and prices
|
|
125
|
+
const changes = custom ? [
|
|
126
|
+
...(custom.name && custom.name !== rec.name ? ['the name'] : []),
|
|
127
|
+
...(custom.description && custom.description !== rec.description ? ['the description'] : []),
|
|
128
|
+
...(custom.offerings ?? []).filter((o) => {
|
|
129
|
+
const x = record.find((y) => y.name === o.name);
|
|
130
|
+
return !x || (o.description !== undefined && o.description !== x.description) || (o.priceUsdc !== undefined && o.priceUsdc !== x.priceValue);
|
|
131
|
+
}).map((o) => o.name),
|
|
132
|
+
] : [];
|
|
133
|
+
const hidden = offerings.filter((o) => !o.shown).map((o) => o.name);
|
|
134
|
+
if (!want.length)
|
|
135
|
+
step('offerings', 'waiting', 'machine', { kind: 'virtuals.offerings', why: 'the agent has no offering yet' });
|
|
136
|
+
else if (changes.length || hidden.length)
|
|
137
|
+
step('offerings', 'waiting', 'machine', { kind: 'virtuals.offerings', ref: `${want.length - hidden.length} of ${want.length} shown`, why: [...(changes.length ? [`the run sets ${changes.join(', ')}`] : []), ...(hidden.length ? [`not shown yet: ${hidden.join(', ')}`] : [])].join('; ') });
|
|
138
|
+
else
|
|
139
|
+
step('offerings', 'done', 'machine', { kind: 'virtuals.offerings', ref: `${want.length} shown` });
|
|
140
|
+
// 6. the read back: this plan is itself a read of the agent's record
|
|
141
|
+
step('readback', hidden.length || !want.length ? 'running' : 'done', 'machine', { kind: 'virtuals.agent', ref: `${shownNames.size} shown`, url, ...(hidden.length ? { why: `not shown yet: ${hidden.join(', ')}` } : {}) });
|
|
142
|
+
return plan(human);
|
|
143
|
+
};
|
|
144
|
+
const PLANNERS = { 'erc8183-base': planVirtuals };
|
|
145
|
+
/**
|
|
146
|
+
* The listing of an agent on a venue, step by step as it stands now (genie.list.virtuals.v1). Read and plan only: the SDK never
|
|
147
|
+
* asks for a signer, registers, shows an offering or approves anything, and never moves money. The Moonbeam Studio's list step
|
|
148
|
+
* runs the steps; `human` names the one approval a person gives there (the venue account's holder: the owner for Moonbeam's own
|
|
149
|
+
* agent, the builder for theirs), and is returned, never acted on.
|
|
150
|
+
*
|
|
151
|
+
* `agent` is `moonbeam` (Moonbeam's own Virtuals agent) or a Virtuals agent id. `custom` is what the run would set: the agent's
|
|
152
|
+
* name and description, and per offering its description and price; the plan shows those offerings and says what would change.
|
|
153
|
+
* The venue's own public record is read through the transport's fetch (`o.api`, default https://api.acp.virtuals.io).
|
|
154
|
+
*/
|
|
155
|
+
export async function list(t, o) {
|
|
156
|
+
const planner = PLANNERS[o?.venue];
|
|
157
|
+
if (!planner)
|
|
158
|
+
throw new RangeError(`list plans a listing on ${LIST_VENUES.join(', ')}; the next step on ${o?.venue} is in journey(t, ref).venues['${o?.venue}'].next`);
|
|
159
|
+
const a = String(o.agent ?? '').trim();
|
|
160
|
+
const house = Object.keys(HOUSE_AGENTS).find((k) => k === a || HOUSE_AGENTS[k] === a);
|
|
161
|
+
const agent = house ? HOUSE_AGENTS[house] : a;
|
|
162
|
+
if (!AGENT_ID.test(agent))
|
|
163
|
+
throw new RangeError(`an agent on Virtuals ACP is 'moonbeam' or its agent id (a UUID): ${o.agent}`);
|
|
164
|
+
const api = (o.api ?? VIRTUALS_API).replace(/\/+$/, '');
|
|
165
|
+
if (!/^https:\/\//.test(api))
|
|
166
|
+
throw new RangeError('the venue API is https');
|
|
167
|
+
return planner(t, { agent, account: house ? 'house:moonbeam' : 'builder', custom: checkCustom(o.custom), now: o.now ?? (() => new Date().toISOString()), api });
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=listed.js.map
|