transproof-dsh-plugin 0.0.0-stage → 0.1.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.
@@ -0,0 +1,115 @@
1
+ /* ═══════════ T-031 专名百科自动查证(v4.41.0)═══════════
2
+ 专名核验面板每行「🔎 查维基」→ 中英维基百科 action API(origin=*,纯前端直连)。
3
+ 带回:维基条目名(通行译名建议)+ 一段简介 + 真 URL;人工确认后才入词库。
4
+ 查不到 / 网络被拦:友好提示开代理或换渠道。不执行任何第三方脚本。 */
5
+ const WIKI_API_ZH = 'https://zh.wikipedia.org/w/api.php?origin=*&format=json&formatversion=2';
6
+ const WIKI_API_EN = 'https://en.wikipedia.org/w/api.php?origin=*&format=json&formatversion=2';
7
+
8
+ function wikiJson(url, ms){
9
+ return new Promise((res, rej) => {
10
+ const ctrl = new AbortController();
11
+ const to = setTimeout(() => { ctrl.abort(); rej(new Error('timeout')); }, ms || 15000);
12
+ fetch(url, { signal: ctrl.signal }).then(r => {
13
+ if(!r.ok) throw new Error('http ' + r.status);
14
+ return r.json();
15
+ }).then(j => { clearTimeout(to); res(j); }, e => { clearTimeout(to); rej(e); });
16
+ });
17
+ }
18
+
19
+ function wikiCleanTitle(title){
20
+ const t = String(title || '');
21
+ let cut = t.length;
22
+ const a = t.indexOf('(');
23
+ const b = t.indexOf('(');
24
+ if(a >= 0 && a < cut) cut = a;
25
+ if(b >= 0 && b < cut) cut = b;
26
+ return (cut > 0 ? t.slice(0, cut) : t).trim() || t;
27
+ }
28
+
29
+ async function wikiSearchTitle(api, q){
30
+ const url = api + '&action=query&list=search&srlimit=3&srsearch=' + encodeURIComponent(q);
31
+ const j = await wikiJson(url);
32
+ return ((j.query && j.query.search) || []).map(h => h.title).filter(Boolean);
33
+ }
34
+
35
+ async function wikiExtract(api, title){
36
+ const url = api + '&action=query&prop=extracts&exintro=1&explaintext=1&titles=' + encodeURIComponent(title);
37
+ const j = await wikiJson(url);
38
+ const pages = (j.query && j.query.pages) || [];
39
+ return pages.length ? (pages[0].extract || '') : '';
40
+ }
41
+
42
+ async function gvWikiLookup(t){
43
+ if(!t || !t.foreign){ toast('这条没有外文名,查不了维基', 'w'); return; }
44
+ modal('🔎 维基查证 · ' + esc(t.foreign), '<div class="alert i" id="gv-wiki-msg"><span class="spin"></span> 正在查中英维基百科,最多 30 秒…</div>');
45
+ try{
46
+ let title = ''; let api = WIKI_API_ZH; let lang = 'zh';
47
+ const zhHits = await wikiSearchTitle(WIKI_API_ZH, t.foreign);
48
+ if(zhHits.length){ title = zhHits[0]; }
49
+ else{
50
+ const enHits = await wikiSearchTitle(WIKI_API_EN, t.foreign);
51
+ if(enHits.length){ title = enHits[0]; api = WIKI_API_EN; lang = 'en'; }
52
+ }
53
+ if(!title){
54
+ $('#gv-wiki-msg').innerHTML = '维基百科没找到「' + esc(t.foreign) + '」相关条目。' +
55
+ '<br><br>可能原因:拼写不同 / 该专名在维基没有独立词条 / 网络被拦。' +
56
+ '<br><br>💡 建议:<br>· 检查外文名拼写后重试;<br>· 点词条行「🔗 回填依据」手填真 URL;<br>· 网络问题请开代理或换渠道(Google Scholar / 百度学术 / CNKI)。';
57
+ return;
58
+ }
59
+ let extract = '';
60
+ try{ extract = await wikiExtract(api, title); }
61
+ catch(e){ extract = ''; }
62
+ const zhSuggest = (lang === 'zh') ? wikiCleanTitle(title) : title;
63
+ const brief = extract ? extract.slice(0, 300) : '';
64
+ const pageUrl = (lang === 'zh' ? 'https://zh.wikipedia.org/wiki/' : 'https://en.wikipedia.org/wiki/') + encodeURIComponent(title);
65
+ const msg = $('#gv-wiki-msg');
66
+ msg.className = 'alert i';
67
+ msg.innerHTML =
68
+ '<div style="font-size:14px;font-weight:600">' + esc(title) + ' <a href="' + esc(pageUrl) + '" target="_blank" rel="noopener" style="font-size:12px">打开真 URL ↗</a></div>' +
69
+ '<div style="font-size:12.5px;margin-top:4px;color:var(--tx2)">建议译名:<b>' + esc(zhSuggest) + '</b>' + (lang === 'en' ? '(英文维基条目,请人工译成中文)' : '') + '</div>' +
70
+ (brief ? '<div style="font-size:12px;margin-top:8px;color:var(--tx2);max-height:180px;overflow:auto">' + esc(brief) + '</div>' : '<div style="font-size:12px;margin-top:8px;color:var(--tx3)">(维基没有简介摘要)</div>') +
71
+ '<div style="margin-top:12px;display:flex;gap:8px;flex-wrap:wrap">' +
72
+ '<button class="btn pri sm" id="gv-wiki-adopt">✓ 采用这个译名 + 存依据</button>' +
73
+ '<button class="btn gray sm" id="gv-wiki-urlonly">🔗 只存真 URL</button>' +
74
+ '<button class="btn gray sm" id="gv-wiki-cancel">关闭</button>' +
75
+ '</div>';
76
+ const adopt = $('#gv-wiki-adopt');
77
+ if(adopt) adopt.onclick = () => {
78
+ t.zh = zhSuggest;
79
+ t.url = pageUrl;
80
+ t.brief = brief;
81
+ if(!t.tags) t.tags = [];
82
+ if(t.tags.indexOf('维基查证') < 0) t.tags.push('维基查证');
83
+ saveGloss();
84
+ glossLog('url', 'term:' + t.id, 'wiki', pageUrl);
85
+ if(typeof renderGlossTable === 'function') renderGlossTable();
86
+ if(typeof renderGvPanel === 'function') renderGvPanel();
87
+ closeModal();
88
+ toast('已写入译名与依据,批准后生效');
89
+ };
90
+ const urlOnly = $('#gv-wiki-urlonly');
91
+ if(urlOnly) urlOnly.onclick = () => {
92
+ t.url = pageUrl;
93
+ saveGloss();
94
+ glossLog('url', 'term:' + t.id, 'wiki-url', pageUrl);
95
+ if(typeof renderGlossTable === 'function') renderGlossTable();
96
+ if(typeof renderGvPanel === 'function') renderGvPanel();
97
+ closeModal();
98
+ toast('已回填真 URL');
99
+ };
100
+ const cancel = $('#gv-wiki-cancel');
101
+ if(cancel) cancel.onclick = () => closeModal();
102
+ }catch(e){
103
+ const msg = $('#gv-wiki-msg');
104
+ msg.innerHTML = '❌ 维基百科直连失败(' + esc(errMsg(e)) + ')。' +
105
+ '<br><br>维基百科被网络或浏览器拦了。💡 建议:<br>· 打开代理(或换网络)后点「重试」;<br>· 或点词条行「🔗 回填依据」手填 URL;<br>· 或换渠道:Google Scholar / 百度学术 / CNKI(词库行 🔎 联网查证)。' +
106
+ '<div style="margin-top:12px"><button class="btn sm" id="gv-wiki-retry">↻ 重试</button> <button class="btn gray sm" id="gv-wiki-cancel2">关闭</button></div>';
107
+ const retry = $('#gv-wiki-retry');
108
+ if(retry) retry.onclick = () => gvWikiLookup(t);
109
+ const cancel2 = $('#gv-wiki-cancel2');
110
+ if(cancel2) cancel2.onclick = () => closeModal();
111
+ }
112
+ }
113
+
114
+ window.gvWikiLookup = gvWikiLookup;
115
+ window.wikiCleanTitle = wikiCleanTitle;
package/client.js ADDED
@@ -0,0 +1,69 @@
1
+ /**
2
+ * 译校助手 TransProof —— DSH 插件薄壳客户端(原型)。
3
+ *
4
+ * 关键结论(本原型要证明的事):
5
+ * DSH 插件的「页面入口」是一个 React 组件,经 window.__ModuleLoader__.load()
6
+ * 的 factory(require) 注入 require('react'),再用 ctx.slots 注册到 main 槽。
7
+ * —— 所以纯 HTML/JS 不能「裸」当入口,但套一层薄壳(这里用 <iframe> 承载
8
+ * 现有 TransProof 网页)就能进,核心 13 个 js 一行不改。
9
+ *
10
+ * 契约来自 coldgust/dsh-translation-assistant 的真实 client.js(非编造):
11
+ * window.__ModuleLoader__.load({ id, factory(require){ const React = require('react'); ... } })
12
+ * factory 返回 { inject: ['slots','locale'], apply(ctx){ ctx.slots.inject('main', ...) } }
13
+ */
14
+
15
+ window.__ModuleLoader__.load({
16
+ id: 'transproof-dsh-plugin',
17
+ factory(require) {
18
+ const React = require('react');
19
+ const h = React.createElement;
20
+
21
+ const NS = 'transproof';
22
+ const PANEL_ID = 'transproof';
23
+ // Host 侧静态服务提供的 TransProof 页面(host/index.js 用 webServer.register 提供)。
24
+ // 现有 TransProof 的相对路径 js/xx.js 因此能正常加载,本地体检在 iframe 里照常跑、不联网。
25
+ const APP_URL = '/dsh-transproof/app/index.html';
26
+
27
+ /** 页面:一个 iframe 承载纯前端 TransProof —— 这就是「薄壳」。 */
28
+ function TransProofPage() {
29
+ return h('div', { style: { width: '100%', height: '100%', display: 'flex' } },
30
+ h('iframe', {
31
+ title: '译校助手 TransProof',
32
+ src: APP_URL,
33
+ style: { width: '100%', height: '100%', border: '0', background: '#fff' },
34
+ }),
35
+ );
36
+ }
37
+
38
+ /** 侧栏面板图标(点击进入主页面)。 */
39
+ function TransProofPanelIcon() {
40
+ return h('div', { style: { fontSize: '18px', lineHeight: 1 } }, '🈴');
41
+ }
42
+
43
+ // 极简字典(TA 用 locale.register(NS, {zh,en});这里给最小可用集)。
44
+ const zh = { panel: '译校助手', title: '译校助手 TransProof' };
45
+ const en = { panel: 'TransProof', title: 'TransProof' };
46
+
47
+ return {
48
+ inject: ['slots', 'locale'],
49
+ apply(ctx) {
50
+ ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'transproof-dsh-plugin: dictionaries');
51
+ const t = ctx.locale.bind(NS);
52
+ // 主槽页面
53
+ ctx.slots.inject('main', () => ctx.slots.register({
54
+ name: 'main',
55
+ key: PANEL_ID,
56
+ locale: NS,
57
+ }, TransProofPage));
58
+ // 侧栏面板入口
59
+ ctx.slots.inject('sidebar.panellist', () => ctx.slots.register({
60
+ name: 'sidebar.panellist',
61
+ id: PANEL_ID,
62
+ order: 21,
63
+ locale: NS,
64
+ label: () => t('panel'),
65
+ }, TransProofPanelIcon));
66
+ },
67
+ };
68
+ },
69
+ });
@@ -0,0 +1,9 @@
1
+ # 译校助手 TransProof 薄壳插件:一条 Host 行。
2
+ # 契约照 coldgust/dsh-translation-assistant 的 cordis.patch.yml(非编造)。
3
+ - insert:
4
+ - id: transproof-dsh-plugin
5
+ name: 'transproof-dsh-plugin'
6
+ config:
7
+ # TransProof 静态文件根(index.html + js/)。本地体检纯 JS 不联网,不配模型。
8
+ # 指向插件内置的 app/ 打包目录(../app 相对 host/ 解析);resolveAppRoot 仍有兜底,改错也能自愈。
9
+ appRoot: '../app'
package/host/index.js ADDED
@@ -0,0 +1,189 @@
1
+ /**
2
+ * 译校助手 TransProof —— DSH 插件薄壳 Host 半边。
3
+ *
4
+ * 契约来自 coldgust/dsh-translation-assistant 的真实 host/index.js:
5
+ * export const inject = ['webServer'];
6
+ * export function apply(ctx, config) { ... }
7
+ * ctx.webServer.register({ kind:'prefix', path, handler }) // 挂同源静态路由
8
+ * ctx.get('tools').register(toolDef) // 挂 Agent 工具
9
+ *
10
+ * 本插件挂两样:
11
+ * 1. Agent 工具 transproof_audit —— 「跑本地体检」。**复用网页版同一套体检**(见 loadAuditApi):
12
+ * 直接读网页版 transproof/js/08-render-audit.js,抽出 paraAudit/numAudit/punctAudit/styleAudit
13
+ * 四个纯函数来跑——与网页版同一份代码,永不漂移、自动跟着网页版更新(每次调用读最新)。
14
+ * 纯机械比对、不联网、不调模型、不花 token。
15
+ * 2. 同源静态路由 /dsh-transproof/app —— 给 client.js 的 <iframe> 端出真正的 TransProof 网页。
16
+ */
17
+
18
+ import fs from 'node:fs';
19
+ import path from 'node:path';
20
+ import { fileURLToPath } from 'node:url';
21
+
22
+ export const inject = ['webServer'];
23
+
24
+ const APP_PREFIX = '/dsh-transproof/app';
25
+ const HERE = path.dirname(fileURLToPath(import.meta.url));
26
+
27
+ // ---------- 静态文件根定位 ----------
28
+ function resolveAppRoot(cfgRoot) {
29
+ const candidates = [];
30
+ if (cfgRoot) {
31
+ if (path.isAbsolute(cfgRoot)) candidates.push(cfgRoot);
32
+ candidates.push(path.resolve(cfgRoot));
33
+ candidates.push(path.resolve(HERE, cfgRoot));
34
+ }
35
+ candidates.push('C:/Users/Andrew/.dsh/dsh_orb/transproof');
36
+ candidates.push(path.resolve(HERE, '../../transproof'));
37
+ candidates.push(path.resolve(HERE, '../app'));
38
+ for (const c of candidates) {
39
+ try {
40
+ if (c && fs.existsSync(path.join(c, 'index.html'))) return path.resolve(c);
41
+ } catch (e) {}
42
+ }
43
+ return null;
44
+ }
45
+
46
+ // ---------- 复用网页版体检:从 08-render-audit.js 抽出 4 个纯函数 ----------
47
+ let AUDIT_CACHE = null;
48
+
49
+ function sliceFn(text, startMarker, endMarker) {
50
+ const a = text.indexOf(startMarker);
51
+ if (a < 0) throw new Error('体检函数没找到:' + startMarker);
52
+ const b = text.indexOf(endMarker, a);
53
+ if (b < 0) throw new Error('体检函数结尾没找到:' + endMarker);
54
+ return text.slice(a, b);
55
+ }
56
+
57
+ function loadAuditApi(root) {
58
+ const file = path.join(root, 'js', '08-render-audit.js');
59
+ const st = fs.statSync(file);
60
+ if (AUDIT_CACHE && AUDIT_CACHE.file === file && AUDIT_CACHE.mtime === st.mtimeMs) return AUDIT_CACHE.api;
61
+ const text = fs.readFileSync(file, 'utf8');
62
+ const NL = String.fromCharCode(10);
63
+ const body = [
64
+ sliceFn(text, 'function paraAudit(', 'function showParaAudit('),
65
+ sliceFn(text, 'function numAudit(', 'function showNumAudit('),
66
+ sliceFn(text, 'function punctAudit(', 'function showPunctAudit('),
67
+ sliceFn(text, 'function styleAudit(', 'function showStyleAudit('),
68
+ 'return { paraAudit: paraAudit, numAudit: numAudit, punctAudit: punctAudit, styleAudit: styleAudit };'
69
+ ].join(NL);
70
+ const api = new Function(body)();
71
+ AUDIT_CACHE = { file, mtime: st.mtimeMs, api };
72
+ return api;
73
+ }
74
+
75
+ // ---------- 静态服务 ----------
76
+ const MIME = {
77
+ html: 'text/html; charset=utf-8',
78
+ js: 'text/javascript; charset=utf-8',
79
+ mjs: 'text/javascript; charset=utf-8',
80
+ css: 'text/css; charset=utf-8',
81
+ json: 'application/json; charset=utf-8',
82
+ svg: 'image/svg+xml',
83
+ png: 'image/png',
84
+ jpg: 'image/jpeg',
85
+ jpeg: 'image/jpeg',
86
+ gif: 'image/gif',
87
+ ico: 'image/x-icon',
88
+ gz: 'application/gzip',
89
+ wasm: 'application/wasm',
90
+ txt: 'text/plain; charset=utf-8',
91
+ };
92
+
93
+ function esc(s) {
94
+ return String(s).split('&').join('&amp;').split('<').join('&lt;').split('>').join('&gt;');
95
+ }
96
+
97
+ function send(res, code, type, body) {
98
+ try { if (res && typeof res.statusCode === 'number') res.statusCode = code; } catch (e) {}
99
+ try { if (res && typeof res.setHeader === 'function') { res.setHeader('content-type', type); res.setHeader('cache-control', 'no-cache, must-revalidate'); } } catch (e) {}
100
+ if (res && typeof res.end === 'function') { res.end(body); return undefined; }
101
+ if (res && typeof res.send === 'function') {
102
+ try { if (typeof res.status === 'function') res.status(code); } catch (e) {}
103
+ res.send(body); return undefined;
104
+ }
105
+ return { statusCode: code, headers: { 'content-type': type }, body };
106
+ }
107
+
108
+ function makeAppHandler(root) {
109
+ return async function serve(req, res) {
110
+ if (!root) {
111
+ return send(res, 500, 'text/html; charset=utf-8',
112
+ '<!doctype html><meta charset="utf-8"><p>TransProof 静态根(appRoot)没找到。</p>');
113
+ }
114
+ let urlPath = String((req && (req.url || req.path)) || '/').split('?')[0];
115
+ if (urlPath.indexOf(APP_PREFIX) === 0) urlPath = urlPath.slice(APP_PREFIX.length);
116
+ if (urlPath === '' || urlPath === '/') urlPath = '/index.html';
117
+ if (urlPath.indexOf('..') >= 0) return send(res, 400, 'text/plain; charset=utf-8', 'bad path');
118
+ const rel = urlPath.split('/').filter(Boolean).join('/');
119
+ const file = path.resolve(root, rel);
120
+ if (file !== root && file.indexOf(root + path.sep) !== 0) {
121
+ return send(res, 400, 'text/plain; charset=utf-8', 'bad path');
122
+ }
123
+ let st = null;
124
+ try { st = fs.statSync(file); } catch (e) {}
125
+ if (!st || !st.isFile()) {
126
+ return send(res, 404, 'text/html; charset=utf-8',
127
+ '<!doctype html><meta charset="utf-8"><p>404 ' + esc(rel) + '</p>');
128
+ }
129
+ const ext = (file.split('.').pop() || '').toLowerCase();
130
+ const body = fs.readFileSync(file);
131
+ return send(res, 200, MIME[ext] || 'application/octet-stream', body);
132
+ };
133
+ }
134
+
135
+ // ---------- Agent 工具:跑网页版同一套体检 ----------
136
+ function createTool(root) {
137
+ return {
138
+ name: 'transproof_audit',
139
+ description: [
140
+ '译校助手「跑本地体检」:复用网页版同一套体检——段落对齐、数字与格式、标点·书名号、翻译腔,',
141
+ '四项一起跑。纯机械比对、不联网、不调模型、不花 token。用于快速发现漏段、括号没闭合、',
142
+ '数字对不上、翻译腔等硬伤。',
143
+ ].join(''),
144
+ parameters: {
145
+ type: 'object',
146
+ additionalProperties: false,
147
+ properties: {
148
+ source: { type: 'string', description: '原文。' },
149
+ translation: { type: 'string', description: '译文。' },
150
+ },
151
+ required: ['source', 'translation'],
152
+ },
153
+ output: {
154
+ schema: { type: 'object', properties: {} },
155
+ render: (_args, value) => [{ type: 'text', text: JSON.stringify(value, null, 2) }],
156
+ },
157
+ isConcurrencySafe: () => true,
158
+ timeoutMs: 30000,
159
+ async execute(args) {
160
+ const input = args && typeof args === 'object' ? args : {};
161
+ const source = typeof input.source === 'string' ? input.source : '';
162
+ const translation = typeof input.translation === 'string' ? input.translation : '';
163
+ const A = loadAuditApi(root);
164
+ const para = A.paraAudit(source, translation);
165
+ const num = A.numAudit(source, translation);
166
+ const punct = A.punctAudit(source, translation);
167
+ const style = A.styleAudit(translation);
168
+ return {
169
+ ok: true,
170
+ note: '网页版同一套体检(transproof/js/08-render-audit.js),不联网、不花 token',
171
+ audit: { para, num, punct, style },
172
+ };
173
+ },
174
+ };
175
+ }
176
+
177
+ // ---------- Host 入口 ----------
178
+ export function apply(ctx, config) {
179
+ const root = resolveAppRoot(config && config.appRoot);
180
+ try {
181
+ ctx.webServer.register({ kind: 'prefix', path: APP_PREFIX, handler: makeAppHandler(root) });
182
+ } catch (e) {
183
+ console.error('[transproof-dsh-plugin] register app route failed:', e && e.message);
184
+ }
185
+ const tools = ctx.get('tools');
186
+ if (tools) {
187
+ ctx.effect(() => tools.register(createTool(root)), 'transproof-dsh-plugin: agent tool');
188
+ }
189
+ }
package/icon.svg ADDED
@@ -0,0 +1,32 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48" role="img" aria-label="TransProof 莫比乌斯锁链">
2
+ <defs>
3
+ <linearGradient id="tpChain" x1="0" y1="0" x2="1" y2="1">
4
+ <stop offset="0" stop-color="#7dd3fc"/>
5
+ <stop offset="0.45" stop-color="#3b82f6"/>
6
+ <stop offset="1" stop-color="#1e2f6b"/>
7
+ </linearGradient>
8
+ <linearGradient id="tpChainHi" x1="0" y1="0" x2="1" y2="1">
9
+ <stop offset="0" stop-color="#e0f2fe"/>
10
+ <stop offset="1" stop-color="#38bdf8"/>
11
+ </linearGradient>
12
+ </defs>
13
+
14
+ <!-- 莫比乌斯锁链环:一圈互相套接的链节环绕四周,带子在顶部扭转一次(单面) -->
15
+ <!-- 套接的链节:隔一个加粗/减细、前后面交叠,营造「锁链」立体互扣 -->
16
+ <g fill="none" stroke="url(#tpChain)" stroke-width="3.2" stroke-linecap="round">
17
+ <ellipse rx="5.8" ry="2.9" transform="translate(38 24) rotate(90)"/>
18
+ <ellipse rx="2.9" ry="5.8" transform="translate(34.6 15.4) rotate(45)" stroke="url(#tpChainHi)"/>
19
+ <ellipse rx="5.8" ry="2.9" transform="translate(26 11) rotate(15)"/>
20
+ <ellipse rx="2.9" ry="5.8" transform="translate(17 12.6) rotate(-30)" stroke="url(#tpChainHi)"/>
21
+ <ellipse rx="5.8" ry="2.9" transform="translate(10 21) rotate(75)"/>
22
+ <ellipse rx="2.9" ry="5.8" transform="translate(10.4 31) rotate(115)" stroke="url(#tpChainHi)"/>
23
+ <ellipse rx="5.8" ry="2.9" transform="translate(18 38.5) rotate(160)"/>
24
+ <ellipse rx="2.9" ry="5.8" transform="translate(28 38) rotate(205)" stroke="url(#tpChainHi)"/>
25
+ <ellipse rx="5.8" ry="2.9" transform="translate(36 32) rotate(250)"/>
26
+ <ellipse rx="2.9" ry="5.8" transform="translate(38.5 27) rotate(285)" stroke="url(#tpChainHi)"/>
27
+ </g>
28
+
29
+ <!-- 顶部扭转处:一个「翻面」的链节,标示莫比乌斯单面(正反连续) -->
30
+ <path d="M22 8.5 C26 6.5 31 7 34 10"
31
+ fill="none" stroke="url(#tpChainHi)" stroke-width="3.4" stroke-linecap="round"/>
32
+ </svg>
package/locale/en.json ADDED
@@ -0,0 +1 @@
1
+ {"panel":"TransProof","title":"TransProof"}
package/locale/zh.json ADDED
@@ -0,0 +1 @@
1
+ {"panel":"译校助手","title":"译校助手 TransProof"}
package/package.json CHANGED
@@ -1,6 +1,34 @@
1
1
  {
2
2
  "name": "transproof-dsh-plugin",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "译校助手 TransProof 的 DeepSeek Harness 插件薄壳原型:把纯前端网页包进 DSH 页面入口 + 暴露「跑本地体检」Agent 工具。本地体检保持纯 JS 不联网。",
5
+ "license": "Apache-2.0",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": "./host/index.js",
9
+ "./client": "./client.js",
10
+ "./locale/*.json": "./locale/*.json",
11
+ "./icon": "./icon.svg"
12
+ },
13
+ "files": [
14
+ "app/**",
15
+ "host/*.js",
16
+ "client.js",
17
+ "cordis.patch.yml",
18
+ "locale/*.json",
19
+ "icon.svg",
20
+ "README.md"
21
+ ],
22
+ "dsh": {
23
+ "bundle": {
24
+ "patch": "./cordis.patch.yml"
25
+ },
26
+ "client": {
27
+ "platform": "web",
28
+ "immediately": true,
29
+ "inject": [
30
+ "@deepseek-ai/dsh-client-ui-sidebar"
31
+ ]
32
+ }
33
+ }
34
+ }