@arp-protocol/cli 0.0.0-stage → 0.0.3

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.
@@ -0,0 +1,198 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ HttpRequestError,
4
+ call,
5
+ decodeErrorResult,
6
+ getAbortError,
7
+ getUrl,
8
+ isAbortError,
9
+ isAddressEqual,
10
+ localBatchGatewayRequest,
11
+ localBatchGatewayUrl
12
+ } from "./cli-0gsbnq5w.js";
13
+ import {
14
+ BaseError,
15
+ concat,
16
+ encodeAbiParameters,
17
+ isHex,
18
+ stringify
19
+ } from "./cli-mhzh9z8k.js";
20
+ import"./cli-3kbbwfbp.js";
21
+ import"./cli-g5zvr10v.js";
22
+
23
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/errors/ccip.js
24
+ class OffchainLookupError extends BaseError {
25
+ constructor({ callbackSelector, cause, data, extraData, sender, urls }) {
26
+ super(cause.shortMessage || "An error occurred while fetching for an offchain result.", {
27
+ cause,
28
+ metaMessages: [
29
+ ...cause.metaMessages || [],
30
+ cause.metaMessages?.length ? "" : [],
31
+ "Offchain Gateway Call:",
32
+ urls && [
33
+ " Gateway URL(s):",
34
+ ...urls.map((url) => ` ${getUrl(url)}`)
35
+ ],
36
+ ` Sender: ${sender}`,
37
+ ` Data: ${data}`,
38
+ ` Callback selector: ${callbackSelector}`,
39
+ ` Extra data: ${extraData}`
40
+ ].flat(),
41
+ name: "OffchainLookupError"
42
+ });
43
+ }
44
+ }
45
+
46
+ class OffchainLookupResponseMalformedError extends BaseError {
47
+ constructor({ result, url }) {
48
+ super("Offchain gateway response is malformed. Response data must be a hex value.", {
49
+ metaMessages: [
50
+ `Gateway URL: ${getUrl(url)}`,
51
+ `Response: ${stringify(result)}`
52
+ ],
53
+ name: "OffchainLookupResponseMalformedError"
54
+ });
55
+ }
56
+ }
57
+
58
+ class OffchainLookupSenderMismatchError extends BaseError {
59
+ constructor({ sender, to }) {
60
+ super("Reverted sender address does not match target contract address (`to`).", {
61
+ metaMessages: [
62
+ `Contract address: ${to}`,
63
+ `OffchainLookup sender address: ${sender}`
64
+ ],
65
+ name: "OffchainLookupSenderMismatchError"
66
+ });
67
+ }
68
+ }
69
+
70
+ // ../../node_modules/.bun/viem@2.52.0+e016764623ac6761/node_modules/viem/_esm/utils/ccip.js
71
+ var offchainLookupSignature = "0x556f1830";
72
+ var offchainLookupAbiItem = {
73
+ name: "OffchainLookup",
74
+ type: "error",
75
+ inputs: [
76
+ {
77
+ name: "sender",
78
+ type: "address"
79
+ },
80
+ {
81
+ name: "urls",
82
+ type: "string[]"
83
+ },
84
+ {
85
+ name: "callData",
86
+ type: "bytes"
87
+ },
88
+ {
89
+ name: "callbackFunction",
90
+ type: "bytes4"
91
+ },
92
+ {
93
+ name: "extraData",
94
+ type: "bytes"
95
+ }
96
+ ]
97
+ };
98
+ async function offchainLookup(client, { blockNumber, blockTag, data, requestOptions, to }) {
99
+ const { args } = decodeErrorResult({
100
+ data,
101
+ abi: [offchainLookupAbiItem]
102
+ });
103
+ const [sender, urls, callData, callbackSelector, extraData] = args;
104
+ const { ccipRead } = client;
105
+ const ccipRequest_ = ccipRead && typeof ccipRead?.request === "function" ? ccipRead.request : ccipRequest;
106
+ try {
107
+ if (!isAddressEqual(to, sender))
108
+ throw new OffchainLookupSenderMismatchError({ sender, to });
109
+ const result = urls.includes(localBatchGatewayUrl) ? await localBatchGatewayRequest({
110
+ data: callData,
111
+ ccipRequest: (parameters) => ccipRequest_({ ...parameters, requestOptions })
112
+ }) : await ccipRequest_({ data: callData, requestOptions, sender, urls });
113
+ const { data: data_ } = await call(client, {
114
+ blockNumber,
115
+ blockTag,
116
+ data: concat([
117
+ callbackSelector,
118
+ encodeAbiParameters([{ type: "bytes" }, { type: "bytes" }], [result, extraData])
119
+ ]),
120
+ requestOptions,
121
+ to
122
+ });
123
+ return data_;
124
+ } catch (err) {
125
+ if (requestOptions?.signal?.aborted)
126
+ throw getAbortError(requestOptions.signal);
127
+ if (isAbortError(err))
128
+ throw err;
129
+ throw new OffchainLookupError({
130
+ callbackSelector,
131
+ cause: err,
132
+ data,
133
+ extraData,
134
+ sender,
135
+ urls
136
+ });
137
+ }
138
+ }
139
+ async function ccipRequest({ data, requestOptions, sender, urls }) {
140
+ let error = new Error("An unknown error occurred.");
141
+ for (let i = 0;i < urls.length; i++) {
142
+ if (requestOptions?.signal?.aborted)
143
+ throw getAbortError(requestOptions.signal);
144
+ const url = urls[i];
145
+ const method = url.includes("{data}") ? "GET" : "POST";
146
+ const body = method === "POST" ? { data, sender } : undefined;
147
+ const headers = method === "POST" ? { "Content-Type": "application/json" } : {};
148
+ try {
149
+ const response = await fetch(url.replace("{sender}", sender.toLowerCase()).replace("{data}", data), {
150
+ body: JSON.stringify(body),
151
+ headers,
152
+ method,
153
+ ...requestOptions?.signal ? { signal: requestOptions.signal } : {}
154
+ });
155
+ let result;
156
+ if (response.headers.get("Content-Type")?.startsWith("application/json")) {
157
+ result = (await response.json()).data;
158
+ } else {
159
+ result = await response.text();
160
+ }
161
+ if (!response.ok) {
162
+ error = new HttpRequestError({
163
+ body,
164
+ details: result?.error ? stringify(result.error) : response.statusText,
165
+ headers: response.headers,
166
+ status: response.status,
167
+ url
168
+ });
169
+ continue;
170
+ }
171
+ if (!isHex(result)) {
172
+ error = new OffchainLookupResponseMalformedError({
173
+ result,
174
+ url
175
+ });
176
+ continue;
177
+ }
178
+ return result;
179
+ } catch (err) {
180
+ if (requestOptions?.signal?.aborted)
181
+ throw getAbortError(requestOptions.signal);
182
+ if (isAbortError(err))
183
+ throw err;
184
+ error = new HttpRequestError({
185
+ body,
186
+ details: err.message,
187
+ url
188
+ });
189
+ }
190
+ }
191
+ throw error;
192
+ }
193
+ export {
194
+ offchainLookupSignature,
195
+ offchainLookupAbiItem,
196
+ offchainLookup,
197
+ ccipRequest
198
+ };
@@ -0,0 +1,116 @@
1
+ #!/usr/bin/env node
2
+ // ../../data/catalogue/domain-aliases.json
3
+ var domain_aliases_default = {
4
+ _note: "Words a person or an agent uses, mapped to a node of ARP's domain tree (OASF 1.1.0 names, plus ARP's own `design`), task 84. Read locally by the MCP server, the CLI and the hook: the words never leave the machine (the user, 2026-11-09), except for a caller who chooses ARP's hosted read-only endpoint, which receives its words and keeps none (ADR 0161). Every target is checked against data/catalogue/oasf-1.1.0-skills.json by packages/protocol/test/domain-words.test.ts. ARP's old category words map to the one node that held them; the split ones (method, quality) have no alias, and a refusal suggests nodes instead.",
5
+ oasfVersion: "1.1.0",
6
+ aliases: {
7
+ ads: "advertising",
8
+ advertising: "advertising",
9
+ agent: "agent application building",
10
+ agents: "agent orchestration",
11
+ android: "mobile development",
12
+ animation: "web animation",
13
+ api: "api development",
14
+ audio: "audio & speech processing",
15
+ automation: "tool use and automation",
16
+ backend: "backend development",
17
+ blockchain: "blockchain and web3",
18
+ brand: "branding",
19
+ browser: "browser automation",
20
+ captions: "video editing",
21
+ chart: "chart generation",
22
+ charts: "chart generation",
23
+ chat: "team messaging",
24
+ collaboration: "collaboration and communication",
25
+ commit: "commit authoring",
26
+ copywriting: "copywriting",
27
+ crawl: "web crawling",
28
+ cro: "conversion optimization",
29
+ dashboard: "dashboard building",
30
+ database: "databases",
31
+ debug: "code debugging",
32
+ debugging: "code debugging",
33
+ deck: "presentation authoring",
34
+ deploy: "deployment and release management",
35
+ development: "software engineering",
36
+ docker: "containerization",
37
+ docs: "technical writing",
38
+ document: "document authoring",
39
+ documentation: "project documentation",
40
+ docx: "document authoring",
41
+ editing: "video editing",
42
+ email: "email marketing",
43
+ excel: "spreadsheet authoring",
44
+ frontend: "frontend development",
45
+ git: "git workflow",
46
+ illustration: "image generation",
47
+ image: "computer vision",
48
+ infrastructure: "devops and cloud infrastructure",
49
+ ios: "mobile development",
50
+ issues: "issue tracking",
51
+ kubernetes: "container orchestration",
52
+ landing: "conversion optimization",
53
+ layout: "design",
54
+ logo: "branding",
55
+ logs: "logging and log analysis",
56
+ marketing: "content, writing and marketing",
57
+ mcp: "agent tool building",
58
+ meeting: "meeting intelligence",
59
+ meetings: "meeting intelligence",
60
+ mobile: "mobile development",
61
+ monitoring: "monitoring and alerting",
62
+ montage: "video editing",
63
+ music: "text to audio",
64
+ newsletter: "email marketing",
65
+ notes: "note-taking",
66
+ payment: "payments integration",
67
+ pdf: "pdf manipulation",
68
+ pentest: "penetration testing",
69
+ postgres: "relational database operations",
70
+ powerpoint: "presentation authoring",
71
+ pptx: "presentation authoring",
72
+ pr: "pull request management",
73
+ prd: "requirements and prd authoring",
74
+ presentation: "presentation authoring",
75
+ prompt: "prompt design",
76
+ rag: "retrieval-augmented generation",
77
+ research: "research and scholarship",
78
+ review: "code review",
79
+ scrape: "web scraping",
80
+ scraping: "web data acquisition",
81
+ search: "web search research",
82
+ security: "cybersecurity",
83
+ seo: "search engine optimization",
84
+ slide: "presentation authoring",
85
+ slides: "presentation authoring",
86
+ "smart contract": "smart contract development",
87
+ social: "social media marketing",
88
+ solidity: "smart contract development",
89
+ spec: "requirements and prd authoring",
90
+ spreadsheet: "spreadsheet authoring",
91
+ sql: "relational database operations",
92
+ subtitles: "video editing",
93
+ summarize: "text summarization",
94
+ summary: "text summarization",
95
+ tdd: "software testing",
96
+ test: "software testing",
97
+ testing: "software testing",
98
+ tests: "software testing",
99
+ thumbnail: "image generation",
100
+ tickets: "issue tracking",
101
+ trading: "defi and crypto trading",
102
+ transcription: "automatic speech recognition",
103
+ translate: "translation",
104
+ tts: "text to speech",
105
+ typography: "design",
106
+ ui: "design",
107
+ ux: "design",
108
+ voice: "text to speech",
109
+ wallet: "crypto wallet operations",
110
+ website: "web development",
111
+ writing: "content writing",
112
+ xlsx: "spreadsheet authoring"
113
+ }
114
+ };
115
+
116
+ export { domain_aliases_default };