@hongmaple0820/dsh-scale 0.1.0 → 0.1.2
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 +1 -1
- package/lib/client.js +177 -9
- package/lib/commandsBridge.js +4 -0
- package/lib/commandsBridge.js.map +1 -1
- package/package.json +2 -2
- package/lib/client.js.map +0 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ SCALE Engine 治理插件 for DeepSeek Harness(DSH)。一个 `apply()` 挂
|
|
|
10
10
|
| Commands(T2) | `ctx.commands.register` | 6 个治理斜杠命令:`/scale-preflight`、`/scale-gate-quality`、`/scale-verify`、`/scale-shield-status`、`/scale-cortex-metrics`、`/scale-doctor-env`——真实拉起 `scale` CLI(allowlist 固定参数、120–300s 超时、输出截断) |
|
|
11
11
|
| Skills(T2) | `ctx.skills.registerProvider` | `.scale/skills/<PHASE>/<name>.md` 阶段工作流技能进 DSH 注册表(名字 kebab-case、正文 get() 懒加载;`skills.json` 的域路由元数据不注册——那些指向全局根的外部技能,DSH 自己的文件发现负责) |
|
|
12
12
|
|
|
13
|
-
客户端半(T3):`exports["./client"]`(`dsh.client.platform: "web"`)为
|
|
13
|
+
客户端半(T3):`exports["./client"]`(`dsh.client.platform: "web"`)为 40 个 `mcp__scale__*` 工具(25 个核心 + 15 个媒体)注册 `tool.call.toolview` 卡片——纯展示(会话内参数 + 结果),轻量 React(`React.createElement` 全局 + `styles.insert`,无 JSX、无 Vue 混挂——计划 R6 允许的回退路线,U4 就此关闭),不触文件系统。
|
|
14
14
|
|
|
15
15
|
工具名映射(DSH → SCALE Shield):`pwsh→Bash`、`write→Write`、`edit→Edit`、`read→Read`;`mcp__scale__*` 前缀自动解包(`shell_run` 按 Bash 语义判定)。
|
|
16
16
|
|
package/lib/client.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
// dsh-scale client half — wrapped for the DeepSeek Harness web plugin loader.
|
|
2
|
+
// Generated by scripts/build-client.mjs from the tsc output; do not edit.
|
|
3
|
+
window.__ModuleLoader__.load({
|
|
4
|
+
id: "@hongmaple0820/dsh-scale",
|
|
5
|
+
factory: (require) => {
|
|
6
|
+
var module = { exports: {} };
|
|
7
|
+
var exports = module.exports;
|
|
8
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
9
|
// dsh-scale client half (T3) — Web (React) client plugin.
|
|
2
10
|
//
|
|
3
11
|
// Route decision (plan R6/U4, resolved): lightweight React components via the
|
|
@@ -7,7 +15,11 @@
|
|
|
7
15
|
// never touches the filesystem (plan §6 T3 acceptance).
|
|
8
16
|
//
|
|
9
17
|
// This module must stay free of node-only imports: it loads in the browser.
|
|
10
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* The 40 MCP tools dsh-scale exposes under mcp__scale__: 25 core tools
|
|
20
|
+
* (27 minus the narrowed shell pair) plus all 15 media tools. Keep this list
|
|
21
|
+
* aligned with src/media/mcpTools.ts — the media count is asserted in tests.
|
|
22
|
+
*/
|
|
11
23
|
const SCALE_MCP_TOOLS = [
|
|
12
24
|
'scale_create', 'scale_transition', 'scale_list', 'scale_show', 'scale_available_actions',
|
|
13
25
|
'scale_context', 'scale_stats', 'scale_detect_changes', 'scale_review_context',
|
|
@@ -15,14 +27,28 @@ const SCALE_MCP_TOOLS = [
|
|
|
15
27
|
'task_checkpoint', 'task_resume', 'complete_task', 'capability_list', 'capability_map',
|
|
16
28
|
'bridge_register', 'bridge_heartbeat', 'delegation_delegate', 'delegation_review',
|
|
17
29
|
'cortex_promotion_propose', 'cortex_promotion_hit', 'cortex_promotion_approve',
|
|
30
|
+
'media_list_providers', 'media_validate_storyboard', 'media_create_task',
|
|
31
|
+
'media_run_task', 'media_wait_task', 'media_estimate_cost',
|
|
32
|
+
'media_render_storyboard', 'media_generate_image', 'media_get_task',
|
|
33
|
+
'media_list_tasks', 'media_cancel_task', 'media_retry_task',
|
|
34
|
+
'media_recover_tasks', 'media_get_evidence', 'media_list_approvals',
|
|
18
35
|
];
|
|
19
36
|
const CSS = `
|
|
20
37
|
.dsh-scale-card{border:1px solid var(--dsh-border,#e2e2e2);border-radius:8px;padding:8px 10px;margin:4px 0;font-size:12px;font-family:var(--dsh-mono,ui-monospace,monospace)}
|
|
21
38
|
.dsh-scale-card-head{display:flex;gap:6px;align-items:baseline;margin-bottom:4px}
|
|
22
39
|
.dsh-scale-card-badge{background:#1f6feb;color:#fff;border-radius:4px;padding:1px 5px;font-size:10px;font-weight:600;letter-spacing:.03em}
|
|
40
|
+
.dsh-scale-card-badge-media{background:#8250df}
|
|
23
41
|
.dsh-scale-card-name{font-weight:600}
|
|
42
|
+
.dsh-scale-card-status{border-radius:4px;padding:1px 5px;font-size:10px;font-weight:600}
|
|
43
|
+
.dsh-scale-card-status-running{background:#fff8c5;color:#5b4b00}
|
|
44
|
+
.dsh-scale-card-status-succeeded{background:#dafbe1;color:#116329}
|
|
45
|
+
.dsh-scale-card-status-failed{background:#ffebe9;color:#82071e}
|
|
46
|
+
.dsh-scale-card-status-cancelled{background:#eff1f3;color:#57606a}
|
|
24
47
|
.dsh-scale-card-args{color:var(--dsh-muted,#666);white-space:pre-wrap;word-break:break-all;max-height:6.5em;overflow:hidden}
|
|
25
48
|
.dsh-scale-card-result{margin-top:4px;color:var(--dsh-text,#222);white-space:pre-wrap;word-break:break-all;max-height:10em;overflow:hidden;border-top:1px dashed var(--dsh-border,#ddd);padding-top:4px}
|
|
49
|
+
.dsh-scale-card-media{margin-top:4px;border-top:1px dashed var(--dsh-border,#ddd);padding-top:4px}
|
|
50
|
+
.dsh-scale-card-media-row{display:flex;gap:6px;align-items:baseline}
|
|
51
|
+
.dsh-scale-card-media-path{color:var(--dsh-text,#222);word-break:break-all}
|
|
26
52
|
`;
|
|
27
53
|
/** Defensive React access — the client exposes React (createElement) as a global (plan §2.8). */
|
|
28
54
|
function react() {
|
|
@@ -44,10 +70,115 @@ function preview(value, cap = 600) {
|
|
|
44
70
|
function shortName(wireName) {
|
|
45
71
|
return wireName.startsWith('mcp__scale__') ? wireName.slice('mcp__scale__'.length) : wireName;
|
|
46
72
|
}
|
|
73
|
+
/** Media tool names whose cards get the structured status/output view (plan M5). */
|
|
74
|
+
const MEDIA_TOOLS = new Set([
|
|
75
|
+
'media_create_task', 'media_run_task', 'media_wait_task', 'media_get_task',
|
|
76
|
+
'media_list_tasks', 'media_cancel_task', 'media_retry_task', 'media_recover_tasks',
|
|
77
|
+
'media_estimate_cost', 'media_generate_image', 'media_render_storyboard',
|
|
78
|
+
'media_list_providers', 'media_list_approvals',
|
|
79
|
+
]);
|
|
80
|
+
/** Media job statuses → CSS modifier (anything else renders without a chip). */
|
|
81
|
+
const STATUS_CLASS = {
|
|
82
|
+
running: 'dsh-scale-card-status-running',
|
|
83
|
+
packaging: 'dsh-scale-card-status-running',
|
|
84
|
+
created: 'dsh-scale-card-status-running',
|
|
85
|
+
validated: 'dsh-scale-card-status-running',
|
|
86
|
+
succeeded: 'dsh-scale-card-status-succeeded',
|
|
87
|
+
failed: 'dsh-scale-card-status-failed',
|
|
88
|
+
failed_validation: 'dsh-scale-card-status-failed',
|
|
89
|
+
interrupted: 'dsh-scale-card-status-failed',
|
|
90
|
+
cancelled: 'dsh-scale-card-status-cancelled',
|
|
91
|
+
awaiting_approval: 'dsh-scale-card-status-cancelled',
|
|
92
|
+
};
|
|
93
|
+
const MEDIA_STATUS_LABEL = {
|
|
94
|
+
created: 'created',
|
|
95
|
+
validated: 'validated',
|
|
96
|
+
awaiting_approval: 'awaiting approval',
|
|
97
|
+
running: 'running…',
|
|
98
|
+
packaging: 'packaging…',
|
|
99
|
+
succeeded: 'done',
|
|
100
|
+
failed: 'failed',
|
|
101
|
+
failed_validation: 'invalid input',
|
|
102
|
+
interrupted: 'interrupted',
|
|
103
|
+
cancelled: 'cancelled',
|
|
104
|
+
};
|
|
105
|
+
function asRecord(value) {
|
|
106
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
107
|
+
return undefined;
|
|
108
|
+
return value;
|
|
109
|
+
}
|
|
110
|
+
/** Tool results arrive as JSON strings — parse defensively, keep raw on failure. */
|
|
111
|
+
function parseResult(value) {
|
|
112
|
+
const direct = asRecord(value);
|
|
113
|
+
if (direct)
|
|
114
|
+
return direct;
|
|
115
|
+
if (typeof value !== 'string')
|
|
116
|
+
return undefined;
|
|
117
|
+
try {
|
|
118
|
+
return asRecord(JSON.parse(value));
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function asString(value) {
|
|
125
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Pull taskId/status/outputs out of a media tool's args + result. Accepted
|
|
129
|
+
* shapes (all real handleMediaToolCall payloads, plus the raw snapshot):
|
|
130
|
+
* flat summary — {taskId,type,status,outputs[]} (create/get/cancel/retry/run)
|
|
131
|
+
* wait envelope — {done, job:{...}} (wait_task)
|
|
132
|
+
* list envelope — {tasks:[...]} (list_tasks: latest wins)
|
|
133
|
+
* raw snapshot — {id,type,status,...}
|
|
134
|
+
*/
|
|
135
|
+
function mediaInfo(tool, props) {
|
|
136
|
+
const args = asRecord(props.arguments ?? props.args ?? props.input);
|
|
137
|
+
const result = parseResult(props.result ?? props.content ?? props.output);
|
|
138
|
+
const candidates = [
|
|
139
|
+
asRecord(result?.task),
|
|
140
|
+
asRecord(result?.job),
|
|
141
|
+
...collectTasks(result),
|
|
142
|
+
result,
|
|
143
|
+
];
|
|
144
|
+
const payload = candidates.find(entry => entry && (entry.taskId || entry.id || entry.status));
|
|
145
|
+
const info = { outputs: [] };
|
|
146
|
+
info.taskId = asString(payload?.taskId) ?? asString(payload?.id) ?? asString(args?.taskId);
|
|
147
|
+
info.status = asString(payload?.status);
|
|
148
|
+
info.jobType = asString(payload?.type);
|
|
149
|
+
if (payload?.error && typeof payload.error === 'object' && !Array.isArray(payload.error)) {
|
|
150
|
+
const err = payload.error;
|
|
151
|
+
info.error = asString(err.code) ?? asString(err.message);
|
|
152
|
+
}
|
|
153
|
+
const outputs = payload?.outputs;
|
|
154
|
+
if (Array.isArray(outputs)) {
|
|
155
|
+
for (const output of outputs) {
|
|
156
|
+
const record = asRecord(output);
|
|
157
|
+
const path = asString(record?.path);
|
|
158
|
+
if (path)
|
|
159
|
+
info.outputs.push(path);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if (!info.taskId && !info.status && info.outputs.length === 0)
|
|
163
|
+
return info;
|
|
164
|
+
return info;
|
|
165
|
+
}
|
|
166
|
+
function collectTasks(result) {
|
|
167
|
+
const tasks = result?.tasks;
|
|
168
|
+
if (!Array.isArray(tasks) || tasks.length === 0)
|
|
169
|
+
return [];
|
|
170
|
+
const records = tasks.filter((entry) => Boolean(asRecord(entry)));
|
|
171
|
+
// A list payload shows the LATEST task: `media_list_tasks` returns newest
|
|
172
|
+
// first, so the first record wins. Reordering here keeps mediaInfo's
|
|
173
|
+
// first-match `find` semantics.
|
|
174
|
+
return [records[0]];
|
|
175
|
+
}
|
|
47
176
|
/**
|
|
48
177
|
* Toolview card for mcp__scale__* calls. Props are consumed defensively:
|
|
49
178
|
* the exact third-party card payload shape is not part of a stable public
|
|
50
179
|
* contract, so every field is optional and rendering degrades to the name.
|
|
180
|
+
* Media tools additionally get a structured strip: taskId + status + output
|
|
181
|
+
* paths (plan M5: 卡片显示 taskId + 状态 + 产物路径;不阻塞对话).
|
|
51
182
|
*/
|
|
52
183
|
function ScaleToolCard(props) {
|
|
53
184
|
const R = react();
|
|
@@ -56,11 +187,13 @@ function ScaleToolCard(props) {
|
|
|
56
187
|
const wireName = typeof props.tool === 'string' ? props.tool
|
|
57
188
|
: typeof props.name === 'string' ? props.name
|
|
58
189
|
: 'mcp__scale__?';
|
|
190
|
+
const tool = shortName(wireName);
|
|
191
|
+
const isMedia = MEDIA_TOOLS.has(tool);
|
|
59
192
|
const argsText = preview(props.arguments ?? props.args ?? props.input);
|
|
60
|
-
const resultText = preview(props.result ?? props.content ?? props.output);
|
|
193
|
+
const resultText = isMedia ? '' : preview(props.result ?? props.content ?? props.output);
|
|
61
194
|
const children = [
|
|
62
|
-
R.createElement('span', { className: 'dsh-scale-card-badge' }, 'SCALE'),
|
|
63
|
-
R.createElement('span', { className: 'dsh-scale-card-name' },
|
|
195
|
+
R.createElement('span', { className: isMedia ? 'dsh-scale-card-badge dsh-scale-card-badge-media' : 'dsh-scale-card-badge' }, 'SCALE'),
|
|
196
|
+
R.createElement('span', { className: 'dsh-scale-card-name' }, tool),
|
|
64
197
|
];
|
|
65
198
|
if (props.phase === 'preparing' || props.isRunning === true) {
|
|
66
199
|
children.push(R.createElement('span', { className: 'dsh-scale-card-name' }, '· running'));
|
|
@@ -68,12 +201,43 @@ function ScaleToolCard(props) {
|
|
|
68
201
|
const body = [R.createElement('div', { className: 'dsh-scale-card-head' }, ...children)];
|
|
69
202
|
if (argsText)
|
|
70
203
|
body.push(R.createElement('div', { className: 'dsh-scale-card-args' }, argsText));
|
|
71
|
-
if (
|
|
72
|
-
|
|
204
|
+
if (isMedia) {
|
|
205
|
+
const info = mediaInfo(tool, props);
|
|
206
|
+
const mediaRows = [];
|
|
207
|
+
if (info.taskId) {
|
|
208
|
+
mediaRows.push(R.createElement('div', { className: 'dsh-scale-card-media-row' }, R.createElement('span', { className: 'dsh-scale-card-name' }, info.taskId)));
|
|
209
|
+
}
|
|
210
|
+
if (info.status) {
|
|
211
|
+
const statusClass = STATUS_CLASS[info.status] ?? 'dsh-scale-card-status';
|
|
212
|
+
const label = MEDIA_STATUS_LABEL[info.status] ?? info.status;
|
|
213
|
+
mediaRows.push(R.createElement('span', { className: `dsh-scale-card-status ${statusClass}` }, label));
|
|
214
|
+
}
|
|
215
|
+
if (info.jobType)
|
|
216
|
+
mediaRows.push(R.createElement('span', { className: 'dsh-scale-card-args' }, info.jobType));
|
|
217
|
+
if (mediaRows.length > 0) {
|
|
218
|
+
body.push(R.createElement('div', { className: 'dsh-scale-card-media' }, ...mediaRows));
|
|
219
|
+
}
|
|
220
|
+
if (info.outputs.length > 0) {
|
|
221
|
+
body.push(R.createElement('div', { className: 'dsh-scale-card-media' }, ...info.outputs.map(path => R.createElement('div', { className: 'dsh-scale-card-media-row' }, R.createElement('span', { className: 'dsh-scale-card-media-path' }, path)))));
|
|
222
|
+
}
|
|
223
|
+
if (info.error) {
|
|
224
|
+
body.push(R.createElement('div', { className: 'dsh-scale-card-result' }, info.error));
|
|
225
|
+
}
|
|
226
|
+
// Unparseable result (error text, unexpected shape) — surface it raw so a
|
|
227
|
+
// failure is never swallowed by the structured strip.
|
|
228
|
+
const rawResult = preview(props.result ?? props.content ?? props.output);
|
|
229
|
+
if (!parseResult(props.result ?? props.content ?? props.output) && rawResult) {
|
|
230
|
+
body.push(R.createElement('div', { className: 'dsh-scale-card-result' }, rawResult));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
if (resultText)
|
|
235
|
+
body.push(R.createElement('div', { className: 'dsh-scale-card-result' }, resultText));
|
|
236
|
+
}
|
|
73
237
|
return R.createElement('div', { className: 'dsh-scale-card', 'data-tool': wireName }, ...body);
|
|
74
238
|
}
|
|
75
|
-
|
|
76
|
-
|
|
239
|
+
const inject = ['slots'];
|
|
240
|
+
function apply(ctx) {
|
|
77
241
|
// Client-scoped CSS, inserted once (styles.insert is a client global).
|
|
78
242
|
const styles = globalThis.styles;
|
|
79
243
|
try {
|
|
@@ -111,4 +275,8 @@ export function apply(ctx) {
|
|
|
111
275
|
}
|
|
112
276
|
});
|
|
113
277
|
}
|
|
114
|
-
|
|
278
|
+
exports.inject = inject;
|
|
279
|
+
exports.apply = apply;
|
|
280
|
+
return module.exports;
|
|
281
|
+
}
|
|
282
|
+
});
|
package/lib/commandsBridge.js
CHANGED
|
@@ -16,6 +16,10 @@ export const SCALE_COMMANDS = [
|
|
|
16
16
|
{ name: 'scale-shield-status', description: 'Show Scale Shield hook registration and .scale integrity', args: ['shield', 'status'] },
|
|
17
17
|
{ name: 'scale-cortex-metrics', description: 'Show SCALE Cortex governance ROI metrics (30 days)', args: ['cortex', 'metrics', '--days', '30'] },
|
|
18
18
|
{ name: 'scale-doctor-env', description: 'Diagnose the SCALE environment', args: ['doctor', 'env'] },
|
|
19
|
+
{ name: 'scale-media-doctor', description: 'Check media pipeline prerequisites (ffmpeg/ffprobe/playwright)', args: ['media', 'doctor'] },
|
|
20
|
+
{ name: 'scale-media-tasks', description: 'List media workflow tasks in this project', args: ['media', 'task', 'list'] },
|
|
21
|
+
{ name: 'scale-media-providers', description: 'List media providers with config status (no secrets)', args: ['media', 'providers', 'list'] },
|
|
22
|
+
{ name: 'scale-media-approvals', description: 'List pending media approval requests (decisions happen on the dashboard or CLI)', args: ['media', 'approvals', 'list'] },
|
|
19
23
|
];
|
|
20
24
|
/**
|
|
21
25
|
* Register the allowlisted SCALE commands. The handler stays inside the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandsBridge.js","sourceRoot":"","sources":["../src/commandsBridge.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,wEAAwE;AACxE,6BAA6B;AAG7B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAY9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAuB;IAChD,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,6CAA6C,EAAE,IAAI,EAAE,CAAC,WAAW,CAAC,EAAE;IAC5G,EAAE,IAAI,EAAE,oBAAoB,EAAE,WAAW,EAAE,kCAAkC,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE;IAC9H,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,2CAA2C,EAAE,IAAI,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,SAAS,EA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C,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;oBACvE,MAAM,IAAI,GAAG,WAAW,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;oBAC7E,OAAO,MAAM,CAAC,EAAE;wBACd,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;wBAC3B,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,WAAW,MAAM,CAAC,QAAQ,IAAI,QAAQ,GAAG,EAAE,CAAA;gBAC/E,CAAC;aACF,CAAC,CAAA;YACF,UAAU,IAAI,CAAC,CAAA;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,gFAAgF;QAClF,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hongmaple0820/dsh-scale",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "SCALE Engine governance plugin for DeepSeek Harness — Shield (tool interception), Cortex (instinct injection), Evidence (runtime trail)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"README.md"
|
|
22
22
|
],
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "tsc -p tsconfig.json",
|
|
24
|
+
"build": "tsc -p tsconfig.json && node scripts/build-client.mjs",
|
|
25
25
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
26
26
|
},
|
|
27
27
|
"dsh": {
|
package/lib/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings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