@tangle-network/agent-app 0.47.4 → 0.47.6
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/app-auth/index.js +2 -2
- package/dist/assistant/index.js +7 -7
- package/dist/chat-react/index.js +1 -1
- package/dist/chat-routes/index.d.ts +1 -0
- package/dist/chat-routes/index.js +218 -1050
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-routes/protected-runtime-producer.d.ts +22 -0
- package/dist/{chunk-NOME5ZPG.js → chunk-IR5OBDO2.js} +4 -4
- package/dist/chunk-KHRIPDW5.js +135 -0
- package/dist/chunk-KHRIPDW5.js.map +1 -0
- package/dist/chunk-LYAYNWDS.js +1049 -0
- package/dist/chunk-LYAYNWDS.js.map +1 -0
- package/dist/{chunk-YABHE2QY.js → chunk-UB4LENR5.js} +4 -4
- package/dist/design-canvas/index.js +1 -1
- package/dist/platform/index.js +2 -2
- package/dist/public-consultation/index.d.ts +139 -0
- package/dist/public-consultation/index.js +230 -0
- package/dist/public-consultation/index.js.map +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +6 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/protected-model.d.ts +29 -0
- package/dist/sequences/index.js +3 -3
- package/dist/teams-react/index.js +3 -3
- package/dist/web-react/index.js +5 -5
- package/dist/work-product/index.js +5 -5
- package/package.json +6 -1
- /package/dist/{chunk-NOME5ZPG.js.map → chunk-IR5OBDO2.js.map} +0 -0
- /package/dist/{chunk-YABHE2QY.js.map → chunk-UB4LENR5.js.map} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AgentProfile } from '@tangle-network/agent-interface';
|
|
2
|
+
import { type RunProtectedAgentCandidateModelGrantOptions } from '@tangle-network/agent-runtime/candidate-execution';
|
|
3
|
+
import type { McpToolDefinition } from '../tools/mcp-rpc';
|
|
4
|
+
import type { ChatTurnRouteProducer } from './turn-routes';
|
|
5
|
+
export interface ProtectedRuntimeChatOptions {
|
|
6
|
+
profile: AgentProfile;
|
|
7
|
+
prompt: string;
|
|
8
|
+
priorMessages?: ReadonlyArray<{
|
|
9
|
+
role: string;
|
|
10
|
+
content: string;
|
|
11
|
+
}>;
|
|
12
|
+
/** Runtime owns reservation, activation, revocation and authoritative settlement. */
|
|
13
|
+
grant: Omit<RunProtectedAgentCandidateModelGrantOptions<void>, 'execute'>;
|
|
14
|
+
/** Only tools authorized for this execution. Each tool validates its arguments and effects. */
|
|
15
|
+
tools: readonly McpToolDefinition<{
|
|
16
|
+
signal: AbortSignal;
|
|
17
|
+
}>[];
|
|
18
|
+
maxToolCalls: number;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
}
|
|
21
|
+
/** Run a profile through the protected Router tool executor and the shared chat projection. */
|
|
22
|
+
export declare function createProtectedRuntimeChatProducer(options: ProtectedRuntimeChatOptions): ChatTurnRouteProducer;
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
charAt,
|
|
5
5
|
charBefore
|
|
6
6
|
} from "./chunk-3HUFJ5LO.js";
|
|
7
|
+
import {
|
|
8
|
+
AsyncView
|
|
9
|
+
} from "./chunk-3UBAO3N5.js";
|
|
7
10
|
import {
|
|
8
11
|
stepActivityFlowTrace
|
|
9
12
|
} from "./chunk-FBVLEGEG.js";
|
|
@@ -24,9 +27,6 @@ import {
|
|
|
24
27
|
usePending,
|
|
25
28
|
usePopover
|
|
26
29
|
} from "./chunk-E5HZ4JPA.js";
|
|
27
|
-
import {
|
|
28
|
-
AsyncView
|
|
29
|
-
} from "./chunk-3UBAO3N5.js";
|
|
30
30
|
import {
|
|
31
31
|
filterCommandPaletteItems,
|
|
32
32
|
groupCommandPaletteItems
|
|
@@ -5959,4 +5959,4 @@ export {
|
|
|
5959
5959
|
useThinkingSeconds,
|
|
5960
5960
|
ChatMessages
|
|
5961
5961
|
};
|
|
5962
|
-
//# sourceMappingURL=chunk-
|
|
5962
|
+
//# sourceMappingURL=chunk-IR5OBDO2.js.map
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// src/runtime/protected-model.ts
|
|
2
|
+
import {
|
|
3
|
+
createProtectedAgentCandidateModelPort
|
|
4
|
+
} from "@tangle-network/agent-runtime/candidate-execution";
|
|
5
|
+
var GATEWAY_ORIGIN = "https://candidate-router.tangle.tools";
|
|
6
|
+
var CONTROL_ORIGIN = "https://router.tangle.tools/v1/candidate-model-grants";
|
|
7
|
+
var ACTIVATION_NAMES = [
|
|
8
|
+
"MODEL_GATEWAY_TOKEN",
|
|
9
|
+
"MODEL_GATEWAY_BASE_URL",
|
|
10
|
+
"OPENAI_API_KEY",
|
|
11
|
+
"OPENAI_BASE_URL",
|
|
12
|
+
"ANTHROPIC_API_KEY",
|
|
13
|
+
"ANTHROPIC_AUTH_TOKEN",
|
|
14
|
+
"ANTHROPIC_BASE_URL"
|
|
15
|
+
];
|
|
16
|
+
var ProtectedModelSettlementError = class extends Error {
|
|
17
|
+
constructor(settlement, cause) {
|
|
18
|
+
super("Protected model settled, but its audit record could not be saved", { cause });
|
|
19
|
+
this.settlement = settlement;
|
|
20
|
+
this.name = "ProtectedModelSettlementError";
|
|
21
|
+
}
|
|
22
|
+
settlement;
|
|
23
|
+
};
|
|
24
|
+
function createRouterProtectedModelPort(options) {
|
|
25
|
+
if (!options.apiKey || !Number.isFinite(options.maxCostUsd) || options.maxCostUsd <= 0 || !Number.isSafeInteger(Math.round(options.maxCostUsd * 1e9))) {
|
|
26
|
+
throw new Error("Protected Router transport requires a parent key and finite positive cap");
|
|
27
|
+
}
|
|
28
|
+
const receipts = /* @__PURE__ */ new Map();
|
|
29
|
+
async function request(operation, body, settling = false) {
|
|
30
|
+
const timeout = AbortSignal.timeout(settling ? 3e4 : 15e3);
|
|
31
|
+
const signal = !settling && options.signal ? AbortSignal.any([timeout, options.signal]) : timeout;
|
|
32
|
+
let response;
|
|
33
|
+
try {
|
|
34
|
+
response = await fetch(`${CONTROL_ORIGIN}/${operation}`, {
|
|
35
|
+
method: "POST",
|
|
36
|
+
redirect: "error",
|
|
37
|
+
signal,
|
|
38
|
+
headers: {
|
|
39
|
+
Authorization: `Bearer ${options.apiKey}`,
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
"X-Tangle-Client": options.clientName ?? "agent-app"
|
|
42
|
+
},
|
|
43
|
+
body: JSON.stringify(body)
|
|
44
|
+
});
|
|
45
|
+
} catch {
|
|
46
|
+
if (!settling && options.signal?.aborted) throw options.signal.reason;
|
|
47
|
+
throw new Error(`Protected model ${operation} transport failed`);
|
|
48
|
+
}
|
|
49
|
+
if (!response.ok) {
|
|
50
|
+
const body2 = await response.json().catch(() => null);
|
|
51
|
+
const code = body2?.error?.code;
|
|
52
|
+
const safeCode = typeof code === "string" && /^candidate_[a-z_]{1,80}$/.test(code) ? code : "request_failed";
|
|
53
|
+
throw new Error(`Protected model ${operation}: ${safeCode} (HTTP ${response.status})`);
|
|
54
|
+
}
|
|
55
|
+
return await response.json();
|
|
56
|
+
}
|
|
57
|
+
const client = {
|
|
58
|
+
reserve: (value) => request("reserve", value),
|
|
59
|
+
activate: async (value) => {
|
|
60
|
+
const activation = await request("activate", value);
|
|
61
|
+
const env = activation?.env;
|
|
62
|
+
const token = env?.MODEL_GATEWAY_TOKEN;
|
|
63
|
+
if (typeof token !== "string" || !/^sk-tgr-[A-Za-z0-9_-]{32,}$/.test(token) || env.MODEL_GATEWAY_BASE_URL !== `${GATEWAY_ORIGIN}/v1` || env.OPENAI_BASE_URL !== `${GATEWAY_ORIGIN}/v1` || env.ANTHROPIC_BASE_URL !== GATEWAY_ORIGIN || [env.OPENAI_API_KEY, env.ANTHROPIC_API_KEY, env.ANTHROPIC_AUTH_TOKEN].some((value2) => value2 !== token)) {
|
|
64
|
+
throw new Error("Protected model activation changed the gateway or credential binding");
|
|
65
|
+
}
|
|
66
|
+
return activation;
|
|
67
|
+
},
|
|
68
|
+
settle: async (value) => {
|
|
69
|
+
const wire = await request("settle", value, true);
|
|
70
|
+
const projected = runtimeSettlement(wire, options.maxCostUsd);
|
|
71
|
+
receipts.set(value.preparationId, wire);
|
|
72
|
+
return projected;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const port = createProtectedAgentCandidateModelPort({
|
|
76
|
+
client,
|
|
77
|
+
resolveModel: (value) => request("resolve", value),
|
|
78
|
+
gatewayDomain: "candidate-router.tangle.tools",
|
|
79
|
+
activationEnvNames: ACTIVATION_NAMES
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
...port,
|
|
83
|
+
settleGrant: async (value) => {
|
|
84
|
+
const settlement = await port.settleGrant(value);
|
|
85
|
+
const receipt = receipts.get(value.preparationId);
|
|
86
|
+
if (receipt) {
|
|
87
|
+
try {
|
|
88
|
+
await options.onSettlement?.(structuredClone(receipt));
|
|
89
|
+
} catch (error) {
|
|
90
|
+
throw new ProtectedModelSettlementError(settlement, error);
|
|
91
|
+
} finally {
|
|
92
|
+
receipts.delete(value.preparationId);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return settlement;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function runtimeSettlement(wire, capUsd) {
|
|
100
|
+
const billing = wire?.billing;
|
|
101
|
+
if (!Array.isArray(wire?.calls) || !billing || billing.status !== "settled" || typeof billing.authorizationId !== "string" || billing.authorizationId.length === 0 || billing.reservedCostUsdNanos !== Math.round(capUsd * 1e9) || !Number.isSafeInteger(billing.settledCostUsdNanos) || billing.settledCostUsdNanos < 0 || billing.settledCostUsdNanos > billing.reservedCostUsdNanos || billing.settledCostUsdNanos > 0 && (typeof billing.transactionId !== "string" || billing.transactionId.length === 0)) {
|
|
102
|
+
throw new Error("Protected model billing receipt is incomplete or exceeds its reservation");
|
|
103
|
+
}
|
|
104
|
+
const billingFields = /* @__PURE__ */ new Set(["status", "authorizationId", "transactionId", "reservedCostUsdNanos", "settledCostUsdNanos"]);
|
|
105
|
+
if (Object.keys(billing).some((key) => !billingFields.has(key))) {
|
|
106
|
+
throw new Error("Protected model billing receipt contains an unknown field");
|
|
107
|
+
}
|
|
108
|
+
let cost = 0;
|
|
109
|
+
const calls = wire.calls.map(({ cacheWriteTokens, cacheWrite5mTokens, cacheWrite1hTokens, ...call }) => {
|
|
110
|
+
for (const count of [cacheWriteTokens, cacheWrite5mTokens, cacheWrite1hTokens]) {
|
|
111
|
+
if (!Number.isSafeInteger(count) || count < 0 || count > call.accountedInputTokens) {
|
|
112
|
+
throw new Error("Protected model cache-write receipt is invalid");
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (cacheWrite5mTokens + cacheWrite1hTokens > cacheWriteTokens) {
|
|
116
|
+
throw new Error("Protected model cache-write receipt does not reconcile");
|
|
117
|
+
}
|
|
118
|
+
if (!Number.isSafeInteger(call.costUsdNanos) || call.costUsdNanos < 0) {
|
|
119
|
+
throw new Error("Protected model call cost is invalid");
|
|
120
|
+
}
|
|
121
|
+
cost += call.costUsdNanos;
|
|
122
|
+
if (!Number.isSafeInteger(cost)) throw new Error("Protected model cumulative cost is invalid");
|
|
123
|
+
if ("costProvenance" in call) throw new Error("Router call receipt contains an unknown field");
|
|
124
|
+
return { ...call, costProvenance: "observed" };
|
|
125
|
+
});
|
|
126
|
+
if (cost !== billing.settledCostUsdNanos) throw new Error("Protected model billing does not match its call ledger");
|
|
127
|
+
const { billing: _billing, ...settlement } = wire;
|
|
128
|
+
return { ...settlement, calls };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export {
|
|
132
|
+
ProtectedModelSettlementError,
|
|
133
|
+
createRouterProtectedModelPort
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=chunk-KHRIPDW5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/runtime/protected-model.ts"],"sourcesContent":["import {\n createProtectedAgentCandidateModelPort,\n type AgentCandidateModelGrantClient,\n type AgentCandidateModelPort,\n} from '@tangle-network/agent-runtime/candidate-execution'\n\nconst GATEWAY_ORIGIN = 'https://candidate-router.tangle.tools'\nconst CONTROL_ORIGIN = 'https://router.tangle.tools/v1/candidate-model-grants'\nconst ACTIVATION_NAMES = [\n 'MODEL_GATEWAY_TOKEN', 'MODEL_GATEWAY_BASE_URL', 'OPENAI_API_KEY', 'OPENAI_BASE_URL',\n 'ANTHROPIC_API_KEY', 'ANTHROPIC_AUTH_TOKEN', 'ANTHROPIC_BASE_URL',\n] as const\n\nexport interface RouterProtectedModelPortOptions {\n apiKey: string\n maxCostUsd: number\n clientName?: string\n signal?: AbortSignal\n onSettlement?(receipt: RouterProtectedModelSettlement): Promise<void> | void\n}\n\n/** A validated charge remains authoritative when the product cannot save its audit record. */\nexport class ProtectedModelSettlementError extends Error {\n constructor(readonly settlement: Awaited<ReturnType<AgentCandidateModelPort['settleGrant']>>, cause: unknown) {\n super('Protected model settled, but its audit record could not be saved', { cause })\n this.name = 'ProtectedModelSettlementError'\n }\n}\n\n/** Bind one turn to Router's atomic grant ledger without exposing its parent key. */\nexport function createRouterProtectedModelPort(options: RouterProtectedModelPortOptions): AgentCandidateModelPort {\n if (!options.apiKey || !Number.isFinite(options.maxCostUsd) || options.maxCostUsd <= 0\n || !Number.isSafeInteger(Math.round(options.maxCostUsd * 1_000_000_000))) {\n throw new Error('Protected Router transport requires a parent key and finite positive cap')\n }\n const receipts = new Map<string, RouterProtectedModelSettlement>()\n async function request<T>(operation: string, body: unknown, settling = false): Promise<T> {\n const timeout = AbortSignal.timeout(settling ? 30_000 : 15_000)\n const signal = !settling && options.signal ? AbortSignal.any([timeout, options.signal]) : timeout\n let response: Response\n try {\n response = await fetch(`${CONTROL_ORIGIN}/${operation}`, {\n method: 'POST', redirect: 'error', signal,\n headers: {\n Authorization: `Bearer ${options.apiKey}`,\n 'Content-Type': 'application/json', 'X-Tangle-Client': options.clientName ?? 'agent-app',\n },\n body: JSON.stringify(body),\n })\n } catch {\n if (!settling && options.signal?.aborted) throw options.signal.reason\n throw new Error(`Protected model ${operation} transport failed`)\n }\n if (!response.ok) {\n const body = await response.json().catch(() => null) as { error?: { code?: unknown } } | null\n const code = body?.error?.code\n // Preserve Runtime's draining retry contract without echoing server text or credentials.\n const safeCode = typeof code === 'string' && /^candidate_[a-z_]{1,80}$/.test(code) ? code : 'request_failed'\n throw new Error(`Protected model ${operation}: ${safeCode} (HTTP ${response.status})`)\n }\n return await response.json() as T\n }\n\n const client: AgentCandidateModelGrantClient = {\n reserve: (value) => request('reserve', value),\n activate: async (value) => {\n const activation = await request<Awaited<ReturnType<AgentCandidateModelGrantClient['activate']>>>('activate', value)\n const env = activation?.env\n const token = env?.MODEL_GATEWAY_TOKEN\n if (typeof token !== 'string' || !/^sk-tgr-[A-Za-z0-9_-]{32,}$/.test(token)\n || env.MODEL_GATEWAY_BASE_URL !== `${GATEWAY_ORIGIN}/v1`\n || env.OPENAI_BASE_URL !== `${GATEWAY_ORIGIN}/v1`\n || env.ANTHROPIC_BASE_URL !== GATEWAY_ORIGIN\n || [env.OPENAI_API_KEY, env.ANTHROPIC_API_KEY, env.ANTHROPIC_AUTH_TOKEN].some((value) => value !== token)) {\n throw new Error('Protected model activation changed the gateway or credential binding')\n }\n return activation\n },\n settle: async (value) => {\n const wire = await request<RouterProtectedModelSettlement>('settle', value, true)\n const projected = runtimeSettlement(wire, options.maxCostUsd)\n receipts.set(value.preparationId, wire)\n return projected\n },\n }\n const port = createProtectedAgentCandidateModelPort({\n client, resolveModel: (value) => request('resolve', value),\n gatewayDomain: 'candidate-router.tangle.tools', activationEnvNames: ACTIVATION_NAMES,\n })\n return {\n ...port,\n settleGrant: async (value) => {\n const settlement = await port.settleGrant(value)\n const receipt = receipts.get(value.preparationId)\n if (receipt) {\n try {\n await options.onSettlement?.(structuredClone(receipt))\n } catch (error) {\n throw new ProtectedModelSettlementError(settlement, error)\n } finally {\n receipts.delete(value.preparationId)\n }\n }\n return settlement\n },\n }\n}\n\nexport interface RouterProtectedModelSettlement extends Omit<Awaited<ReturnType<AgentCandidateModelGrantClient['settle']>>, 'calls'> {\n billing: {\n status: string\n authorizationId?: string\n transactionId?: string\n reservedCostUsdNanos: number\n settledCostUsdNanos: number\n }\n calls: Array<Omit<Awaited<ReturnType<AgentCandidateModelGrantClient['settle']>>['calls'][number], 'costProvenance'> & {\n cacheWriteTokens: number\n cacheWrite5mTokens: number\n cacheWrite1hTokens: number\n }>\n}\n\n/** Check Router's billing extension before projecting its portable Runtime ledger. */\nfunction runtimeSettlement(wire: RouterProtectedModelSettlement, capUsd: number): Awaited<ReturnType<AgentCandidateModelGrantClient['settle']>> {\n const billing = wire?.billing\n if (!Array.isArray(wire?.calls) || !billing || billing.status !== 'settled'\n || typeof billing.authorizationId !== 'string' || billing.authorizationId.length === 0\n || billing.reservedCostUsdNanos !== Math.round(capUsd * 1_000_000_000)\n || !Number.isSafeInteger(billing.settledCostUsdNanos) || billing.settledCostUsdNanos < 0\n || billing.settledCostUsdNanos > billing.reservedCostUsdNanos\n || (billing.settledCostUsdNanos > 0 && (typeof billing.transactionId !== 'string' || billing.transactionId.length === 0))) {\n throw new Error('Protected model billing receipt is incomplete or exceeds its reservation')\n }\n const billingFields = new Set(['status', 'authorizationId', 'transactionId', 'reservedCostUsdNanos', 'settledCostUsdNanos'])\n if (Object.keys(billing).some((key) => !billingFields.has(key))) {\n throw new Error('Protected model billing receipt contains an unknown field')\n }\n let cost = 0\n const calls = wire.calls.map(({ cacheWriteTokens, cacheWrite5mTokens, cacheWrite1hTokens, ...call }) => {\n for (const count of [cacheWriteTokens, cacheWrite5mTokens, cacheWrite1hTokens]) {\n if (!Number.isSafeInteger(count) || count < 0 || count > call.accountedInputTokens) {\n throw new Error('Protected model cache-write receipt is invalid')\n }\n }\n if (cacheWrite5mTokens + cacheWrite1hTokens > cacheWriteTokens) {\n throw new Error('Protected model cache-write receipt does not reconcile')\n }\n if (!Number.isSafeInteger(call.costUsdNanos) || call.costUsdNanos < 0) {\n throw new Error('Protected model call cost is invalid')\n }\n cost += call.costUsdNanos\n if (!Number.isSafeInteger(cost)) throw new Error('Protected model cumulative cost is invalid')\n if ('costProvenance' in call) throw new Error('Router call receipt contains an unknown field')\n return { ...call, costProvenance: 'observed' as const }\n })\n if (cost !== billing.settledCostUsdNanos) throw new Error('Protected model billing does not match its call ledger')\n const { billing: _billing, ...settlement } = wire\n return { ...settlement, calls }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAGK;AAEP,IAAM,iBAAiB;AACvB,IAAM,iBAAiB;AACvB,IAAM,mBAAmB;AAAA,EACvB;AAAA,EAAuB;AAAA,EAA0B;AAAA,EAAkB;AAAA,EACnE;AAAA,EAAqB;AAAA,EAAwB;AAC/C;AAWO,IAAM,gCAAN,cAA4C,MAAM;AAAA,EACvD,YAAqB,YAAyE,OAAgB;AAC5G,UAAM,oEAAoE,EAAE,MAAM,CAAC;AADhE;AAEnB,SAAK,OAAO;AAAA,EACd;AAAA,EAHqB;AAIvB;AAGO,SAAS,+BAA+B,SAAmE;AAChH,MAAI,CAAC,QAAQ,UAAU,CAAC,OAAO,SAAS,QAAQ,UAAU,KAAK,QAAQ,cAAc,KAChF,CAAC,OAAO,cAAc,KAAK,MAAM,QAAQ,aAAa,GAAa,CAAC,GAAG;AAC1E,UAAM,IAAI,MAAM,0EAA0E;AAAA,EAC5F;AACA,QAAM,WAAW,oBAAI,IAA4C;AACjE,iBAAe,QAAW,WAAmB,MAAe,WAAW,OAAmB;AACxF,UAAM,UAAU,YAAY,QAAQ,WAAW,MAAS,IAAM;AAC9D,UAAM,SAAS,CAAC,YAAY,QAAQ,SAAS,YAAY,IAAI,CAAC,SAAS,QAAQ,MAAM,CAAC,IAAI;AAC1F,QAAI;AACJ,QAAI;AACF,iBAAW,MAAM,MAAM,GAAG,cAAc,IAAI,SAAS,IAAI;AAAA,QACvD,QAAQ;AAAA,QAAQ,UAAU;AAAA,QAAS;AAAA,QACnC,SAAS;AAAA,UACP,eAAe,UAAU,QAAQ,MAAM;AAAA,UACvC,gBAAgB;AAAA,UAAoB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