@vymalo/opencode-devtools 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog.d.ts +7 -7
- package/dist/catalog.js +27 -26
- package/dist/catalog.js.map +1 -1
- package/dist/groups/codec.js +162 -135
- package/dist/groups/codec.js.map +1 -1
- package/dist/groups/convert.js +116 -89
- package/dist/groups/convert.js.map +1 -1
- package/dist/groups/crypto.js +247 -186
- package/dist/groups/crypto.js.map +1 -1
- package/dist/groups/datetime.js +265 -215
- package/dist/groups/datetime.js.map +1 -1
- package/dist/groups/http.d.ts +6 -6
- package/dist/groups/http.js +272 -248
- package/dist/groups/http.js.map +1 -1
- package/dist/groups/math.js +157 -127
- package/dist/groups/math.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib.js +1 -0
- package/dist/lib.js.map +1 -1
- package/dist/logging.d.ts +6 -6
- package/dist/logging.js +59 -62
- package/dist/logging.js.map +1 -1
- package/dist/opencode.d.ts +4 -4
- package/dist/opencode.js +71 -75
- package/dist/opencode.js.map +1 -1
- package/dist/schema.d.ts +41 -41
- package/dist/schema.js +43 -48
- package/dist/schema.js.map +1 -1
- package/dist/tool-spec.d.ts +27 -27
- package/dist/tool-spec.js +24 -16
- package/dist/tool-spec.js.map +1 -1
- package/dist/tools.d.ts +8 -8
- package/dist/tools.js +80 -73
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +27 -27
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/package.json +3 -3
package/dist/groups/http.js
CHANGED
|
@@ -1,269 +1,293 @@
|
|
|
1
1
|
import { json, reqString } from "../tool-spec.js";
|
|
2
|
-
const METHODS = [
|
|
2
|
+
const METHODS = [
|
|
3
|
+
"GET",
|
|
4
|
+
"POST",
|
|
5
|
+
"PUT",
|
|
6
|
+
"PATCH",
|
|
7
|
+
"DELETE",
|
|
8
|
+
"HEAD",
|
|
9
|
+
"OPTIONS"
|
|
10
|
+
];
|
|
3
11
|
const MAX_REDIRECTS = 5;
|
|
4
|
-
const MAX_RESPONSE_BYTES =
|
|
12
|
+
const MAX_RESPONSE_BYTES = 1e7;
|
|
5
13
|
function isPrivateIpv4(host) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
const m = host.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
|
|
15
|
+
if (!m) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
const a = Number(m[1]);
|
|
19
|
+
const b = Number(m[2]);
|
|
20
|
+
if (a === 10 || a === 127 || a === 0) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
if (a === 169 && b === 254) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
if (a === 172 && b >= 16 && b <= 31) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (a === 192 && b === 168) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
if (a === 100 && b >= 64 && b <= 127) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
28
36
|
}
|
|
29
37
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
* Extract a dotted IPv4 from an IPv4-mapped IPv6 literal — both the dotted
|
|
39
|
+
* (`::ffff:127.0.0.1`) and the hex (`::ffff:7f00:1`, what `new URL()` normalizes
|
|
40
|
+
* to) forms. Returns null if not a mapped address.
|
|
41
|
+
*/
|
|
34
42
|
function mappedIpv4(h) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
const dotted = h.match(/^::ffff:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/);
|
|
44
|
+
if (dotted) {
|
|
45
|
+
return dotted[1];
|
|
46
|
+
}
|
|
47
|
+
const hex = h.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/);
|
|
48
|
+
if (hex) {
|
|
49
|
+
const hi = Number.parseInt(hex[1], 16);
|
|
50
|
+
const lo = Number.parseInt(hex[2], 16);
|
|
51
|
+
return `${hi >> 8 & 255}.${hi & 255}.${lo >> 8 & 255}.${lo & 255}`;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
46
54
|
}
|
|
47
55
|
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
* Reject loopback / private / link-local destinations. IPv6-prefix and IPv4
|
|
57
|
+
* range checks only run on actual IP *literals* — a DNS name like `fdroid.org`
|
|
58
|
+
* (which starts with `fd`) is NOT an IPv6 ULA and must not be blocked. This is
|
|
59
|
+
* still a literal-host guard: it does not resolve DNS, so a public name that
|
|
60
|
+
* resolves to a private IP (DNS rebinding) is not caught — see docs/devtools.md.
|
|
61
|
+
*/
|
|
54
62
|
export function isBlockedHost(hostname) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
63
|
+
const h = hostname.toLowerCase().replace(/^\[|\]$/g, "");
|
|
64
|
+
const isIpv6 = h.includes(":");
|
|
65
|
+
const isIpv4 = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(h);
|
|
66
|
+
if (!isIpv6 && !isIpv4) {
|
|
67
|
+
// Plain DNS name — only the localhost family is private.
|
|
68
|
+
return h === "localhost" || h.endsWith(".localhost");
|
|
69
|
+
}
|
|
70
|
+
if (isIpv4) {
|
|
71
|
+
return isPrivateIpv4(h);
|
|
72
|
+
}
|
|
73
|
+
// IPv6 literal.
|
|
74
|
+
if (h === "::1" || h === "::") {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
const mapped = mappedIpv4(h);
|
|
78
|
+
if (mapped) {
|
|
79
|
+
return isPrivateIpv4(mapped);
|
|
80
|
+
}
|
|
81
|
+
if (h.startsWith("fc") || h.startsWith("fd")) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
if (/^fe[89ab]/.test(h)) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
return h.startsWith("ff");
|
|
80
88
|
}
|
|
81
89
|
function assertAllowed(rawUrl, ctx) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return url;
|
|
90
|
+
let url;
|
|
91
|
+
try {
|
|
92
|
+
url = new URL(rawUrl);
|
|
93
|
+
} catch {
|
|
94
|
+
throw new Error(`invalid URL: ${rawUrl}`);
|
|
95
|
+
}
|
|
96
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
97
|
+
throw new Error(`unsupported protocol "${url.protocol}" (only http/https)`);
|
|
98
|
+
}
|
|
99
|
+
if (!ctx.options.http.allowPrivateNetwork && isBlockedHost(url.hostname)) {
|
|
100
|
+
throw new Error(`refusing to reach private/loopback host "${url.hostname}" (set http.allowPrivateNetwork to allow)`);
|
|
101
|
+
}
|
|
102
|
+
return url;
|
|
96
103
|
}
|
|
97
104
|
function asHeaders(value) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
if (value === undefined || value === null) {
|
|
106
|
+
return {};
|
|
107
|
+
}
|
|
108
|
+
if (typeof value !== "object") {
|
|
109
|
+
throw new Error("\"headers\" must be an object of string values");
|
|
110
|
+
}
|
|
111
|
+
const out = {};
|
|
112
|
+
for (const [k, v] of Object.entries(value)) {
|
|
113
|
+
out[k] = typeof v === "string" ? v : String(v);
|
|
114
|
+
}
|
|
115
|
+
return out;
|
|
109
116
|
}
|
|
110
117
|
/**
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
* Fetch with **manual** redirect handling so every hop is re-validated by the
|
|
119
|
+
* SSRF guard — the default follow-redirects behaviour would let a public URL
|
|
120
|
+
* 30x to `http://127.0.0.1/…` and bypass `allowPrivateNetwork: false`.
|
|
121
|
+
*/
|
|
115
122
|
async function fetchGuarded(start, init, ctx) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
123
|
+
let url = start;
|
|
124
|
+
let method = init.method;
|
|
125
|
+
let body = init.body;
|
|
126
|
+
for (let hop = 0;; hop++) {
|
|
127
|
+
const res = await ctx.fetchImpl(url, {
|
|
128
|
+
method,
|
|
129
|
+
headers: init.headers,
|
|
130
|
+
body,
|
|
131
|
+
redirect: "manual",
|
|
132
|
+
signal: AbortSignal.timeout(ctx.options.http.timeoutMs)
|
|
133
|
+
});
|
|
134
|
+
const location = res.status >= 300 && res.status < 400 ? res.headers.get("location") : null;
|
|
135
|
+
if (!location) {
|
|
136
|
+
return res;
|
|
137
|
+
}
|
|
138
|
+
if (hop >= MAX_REDIRECTS) {
|
|
139
|
+
throw new Error(`too many redirects (> ${MAX_REDIRECTS})`);
|
|
140
|
+
}
|
|
141
|
+
const next = new URL(location, url);
|
|
142
|
+
assertAllowed(next.href, ctx);
|
|
143
|
+
// 303 (and 301/302 from a non-idempotent method) → GET with no body.
|
|
144
|
+
if (res.status === 303 || (res.status === 301 || res.status === 302) && method !== "GET" && method !== "HEAD") {
|
|
145
|
+
method = "GET";
|
|
146
|
+
body = undefined;
|
|
147
|
+
}
|
|
148
|
+
url = next;
|
|
149
|
+
await res.body?.cancel().catch(() => {});
|
|
150
|
+
}
|
|
145
151
|
}
|
|
146
152
|
/** Read a response body, capped at MAX_RESPONSE_BYTES, parsing JSON when applicable. */
|
|
147
153
|
async function readBody(res) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
154
|
+
let text = "";
|
|
155
|
+
let truncated = false;
|
|
156
|
+
const reader = res.body?.getReader();
|
|
157
|
+
if (reader) {
|
|
158
|
+
const chunks = [];
|
|
159
|
+
let received = 0;
|
|
160
|
+
while (true) {
|
|
161
|
+
const { done, value } = await reader.read();
|
|
162
|
+
if (done) {
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
received += value.byteLength;
|
|
166
|
+
if (received > MAX_RESPONSE_BYTES) {
|
|
167
|
+
const keep = value.byteLength - (received - MAX_RESPONSE_BYTES);
|
|
168
|
+
chunks.push(value.subarray(0, Math.max(0, keep)));
|
|
169
|
+
truncated = true;
|
|
170
|
+
await reader.cancel();
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
chunks.push(value);
|
|
174
|
+
}
|
|
175
|
+
text = Buffer.concat(chunks.map((c) => Buffer.from(c))).toString("utf8");
|
|
176
|
+
} else {
|
|
177
|
+
text = await res.text();
|
|
178
|
+
}
|
|
179
|
+
const contentType = res.headers.get("content-type") ?? "";
|
|
180
|
+
let body = text;
|
|
181
|
+
if (contentType.includes("application/json") && text.length > 0 && !truncated) {
|
|
182
|
+
try {
|
|
183
|
+
body = JSON.parse(text);
|
|
184
|
+
} catch {}
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
body,
|
|
188
|
+
bodyText: text,
|
|
189
|
+
truncated
|
|
190
|
+
};
|
|
185
191
|
}
|
|
186
|
-
export const HTTP_TOOLS = [
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
192
|
+
export const HTTP_TOOLS = [{
|
|
193
|
+
name: "http_request",
|
|
194
|
+
group: "http",
|
|
195
|
+
description: "Make an HTTP request (GET/POST/PUT/PATCH/DELETE/…) and return the status, response headers, and parsed body. JSON responses are parsed automatically. Redirects are followed but re-checked against the SSRF guard; response bodies are capped at 10 MB.",
|
|
196
|
+
input: {
|
|
197
|
+
url: {
|
|
198
|
+
type: "string",
|
|
199
|
+
description: "Absolute http(s) URL."
|
|
200
|
+
},
|
|
201
|
+
method: {
|
|
202
|
+
type: "string",
|
|
203
|
+
optional: true,
|
|
204
|
+
enum: METHODS,
|
|
205
|
+
description: "HTTP method (default GET)."
|
|
206
|
+
},
|
|
207
|
+
headers: {
|
|
208
|
+
type: "record",
|
|
209
|
+
optional: true,
|
|
210
|
+
valueType: "string",
|
|
211
|
+
description: "Request headers (e.g. Authorization, Content-Type)."
|
|
212
|
+
},
|
|
213
|
+
body: {
|
|
214
|
+
type: "string",
|
|
215
|
+
optional: true,
|
|
216
|
+
description: "Request body (string; set Content-Type yourself)."
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
handler: async (args, ctx) => {
|
|
220
|
+
const url = assertAllowed(reqString(args, "url"), ctx);
|
|
221
|
+
const method = typeof args.method === "string" ? args.method.toUpperCase() : "GET";
|
|
222
|
+
const headers = asHeaders(args.headers);
|
|
223
|
+
const rawBody = typeof args.body === "string" ? args.body : undefined;
|
|
224
|
+
const body = method === "GET" || method === "HEAD" ? undefined : rawBody;
|
|
225
|
+
const res = await fetchGuarded(url, {
|
|
226
|
+
method,
|
|
227
|
+
headers,
|
|
228
|
+
body
|
|
229
|
+
}, ctx);
|
|
230
|
+
const responseHeaders = Object.fromEntries(res.headers.entries());
|
|
231
|
+
const { body: parsed, bodyText, truncated } = await readBody(res);
|
|
232
|
+
return json({
|
|
233
|
+
status: res.status,
|
|
234
|
+
statusText: res.statusText,
|
|
235
|
+
ok: res.ok,
|
|
236
|
+
headers: responseHeaders,
|
|
237
|
+
body: parsed,
|
|
238
|
+
truncated
|
|
239
|
+
}, `${method} ${url.href} → ${res.status} ${res.statusText}${truncated ? " (body truncated at 10 MB)" : ""}\n\n${bodyText.slice(0, 4e3)}`);
|
|
240
|
+
}
|
|
241
|
+
}, {
|
|
242
|
+
name: "http_graphql",
|
|
243
|
+
group: "http",
|
|
244
|
+
description: "Execute a GraphQL query or mutation against an endpoint and return the structured data and errors.",
|
|
245
|
+
input: {
|
|
246
|
+
url: {
|
|
247
|
+
type: "string",
|
|
248
|
+
description: "GraphQL endpoint URL."
|
|
249
|
+
},
|
|
250
|
+
query: {
|
|
251
|
+
type: "string",
|
|
252
|
+
description: "The GraphQL query or mutation document."
|
|
253
|
+
},
|
|
254
|
+
variables: {
|
|
255
|
+
type: "record",
|
|
256
|
+
optional: true,
|
|
257
|
+
valueType: "any",
|
|
258
|
+
description: "Query variables."
|
|
259
|
+
},
|
|
260
|
+
headers: {
|
|
261
|
+
type: "record",
|
|
262
|
+
optional: true,
|
|
263
|
+
valueType: "string",
|
|
264
|
+
description: "Extra request headers (e.g. Authorization)."
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
handler: async (args, ctx) => {
|
|
268
|
+
const url = assertAllowed(reqString(args, "url"), ctx);
|
|
269
|
+
const query = reqString(args, "query");
|
|
270
|
+
const variables = typeof args.variables === "object" && args.variables !== null ? args.variables : {};
|
|
271
|
+
const res = await fetchGuarded(url, {
|
|
272
|
+
method: "POST",
|
|
273
|
+
headers: {
|
|
274
|
+
"content-type": "application/json",
|
|
275
|
+
accept: "application/json",
|
|
276
|
+
...asHeaders(args.headers)
|
|
277
|
+
},
|
|
278
|
+
body: JSON.stringify({
|
|
279
|
+
query,
|
|
280
|
+
variables
|
|
281
|
+
})
|
|
282
|
+
}, ctx);
|
|
283
|
+
const { body, bodyText } = await readBody(res);
|
|
284
|
+
const payload = typeof body === "object" && body !== null ? body : {};
|
|
285
|
+
return json({
|
|
286
|
+
status: res.status,
|
|
287
|
+
data: payload.data,
|
|
288
|
+
errors: payload.errors
|
|
289
|
+
}, `${url.href} → ${res.status}\n\n${bodyText.slice(0, 4e3)}`);
|
|
290
|
+
}
|
|
291
|
+
}];
|
|
292
|
+
|
|
269
293
|
//# sourceMappingURL=http.js.map
|
package/dist/groups/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"
|
|
1
|
+
{"mappings":"AAAA,SAAS,MAAM,iBAAkD;AAEjE,MAAM,UAAU;CAAC;CAAO;CAAQ;CAAO;CAAS;CAAU;CAAQ;AAAS;AAC3E,MAAM,gBAAgB;AACtB,MAAM,qBAAqB;AAE3B,SAAS,cAAc,MAAuB;CAC5C,MAAM,IAAI,KAAK,MAAM,8CAA8C;CACnE,IAAI,CAAC,GAAG;EACN,OAAO;CACT;CACA,MAAM,IAAI,OAAO,EAAE,EAAE;CACrB,MAAM,IAAI,OAAO,EAAE,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