@nanodoc/nanodoc-dsh-plugin 0.0.0-stage → 0.1.0-beta.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 CHANGED
@@ -1,3 +1,11 @@
1
- # Temporary Holding Version
1
+ # NanoDoc
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ NanoDoc bundles three capabilities: PDF conversion and translation (PDFlux), financial statement extraction (Mesh), and document comparison (Calliper). Once you enter the shared NanoDoc API key, you can enable or disable each component independently.
4
+
5
+ Upload PDFs in the chat to convert or translate them, extract financial statements, or compare documents. Preview results in the right-hand pane and download them locally.
6
+
7
+ ![Examples of PDF translation, financial statement extraction, and document comparison](https://cdn.jsdelivr.net/npm/@nanodoc/nanodoc-dsh-plugin@latest/docs/preview-all.en.png)
8
+
9
+ Save your shared NanoDoc API key for the international environment in the plugin settings. Upload a PDF in the chat and ask NanoDoc to convert it, translate it, or extract its financial statements. Upload two PDFs to compare them.
10
+
11
+ If both editions are installed, enable the edition you want to use in the current Harness profile.
@@ -0,0 +1,7 @@
1
+ Upload PDFs in the chat to convert or translate them, extract financial statements, or compare documents. Preview results in the right-hand pane and download them locally.
2
+
3
+ ![Examples of PDF translation, financial statement extraction, and document comparison](preview-all.en.png)
4
+
5
+ Save your shared NanoDoc API key for the international environment in the plugin settings. Upload a PDF in the chat and ask NanoDoc to convert it, translate it, or extract its financial statements. Upload two PDFs to compare them.
6
+
7
+ If both editions are installed, enable the edition you want to use in the current Harness profile.
Binary file
package/icon.svg ADDED
@@ -0,0 +1,11 @@
1
+ <svg width="58" height="58" viewBox="0 0 58 58" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M32.5568 5.32203C34.0944 4.43444 35.8587 4.72545 37.047 5.73121L45.3234 10.657C46.7314 11.1927 47.8126 12.5349 47.8127 14.2537V37.6072C47.8126 38.981 47.0795 40.2503 45.8898 40.9373L25.5011 52.7087C22.9374 54.1887 19.7327 52.3389 19.7326 49.3787V26.0252C19.7326 24.6513 20.4657 23.3811 21.6554 22.6941L33.7287 15.7234V10.0046L16.8957 19.7234C15.7257 20.3992 15.005 21.6486 15.005 22.9998V46.3533C15.0051 46.7687 15.0694 47.1618 15.1867 47.5261L15.2072 47.5886L15.1437 47.6062C12.755 48.2641 10.2137 46.4893 10.213 43.8318V20.4783C10.213 19.0819 10.9588 17.7908 12.1681 17.0925L32.5568 5.32203Z" fill="url(#paint0_linear_1_225)"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M30.7336 38.6406C30.0338 38.2104 29.1178 38.4291 28.6875 39.1288C28.2573 39.8287 28.4759 40.7447 29.1757 41.1749L30.1264 41.7593C30.8262 42.1893 31.7423 41.9709 32.1725 41.2711C32.6025 40.5713 32.3839 39.6553 31.6843 39.225L30.7336 38.6406ZM30.7285 27.2879C30.0287 26.8577 29.1127 27.0763 28.6824 27.7761C28.2522 28.4759 28.4708 29.3919 29.1706 29.8221L40.2584 36.638C40.9583 37.0683 41.8743 36.8497 42.3045 36.1498C42.7346 35.45 42.5161 34.534 41.8163 34.1038L30.7285 27.2879ZM30.7305 32.9639C30.0307 32.5341 29.1146 32.7525 28.6844 33.4521C28.2542 34.152 28.473 35.0689 29.1728 35.4991L32.341 37.4459C33.0409 37.8761 33.9569 37.6575 34.3871 36.9577C34.8172 36.2578 34.5987 35.3418 33.8989 34.9116L30.7305 32.9639ZM38.6459 26.48C37.946 26.0498 37.03 26.2684 36.5998 26.9682C36.1696 27.6681 36.3881 28.5841 37.088 29.0143L40.2555 30.9623C40.9554 31.3925 41.8723 31.1737 42.3025 30.4738C42.7327 29.774 42.514 28.857 41.8141 28.4268L38.6459 26.48ZM40.8605 22.1666C40.1607 21.7364 39.2447 21.9551 38.8145 22.6548C38.3842 23.3547 38.6028 24.2707 39.3027 24.7009L40.2533 25.2853C40.9532 25.7154 41.8692 25.4969 42.2994 24.7971C42.7295 24.0973 42.5109 23.1813 41.8112 22.751L40.8605 22.1666Z" fill="white"/>
4
+ <defs>
5
+ <linearGradient id="paint0_linear_1_225" x1="10.213" y1="16.014" x2="47.7863" y2="39.5297" gradientUnits="userSpaceOnUse">
6
+ <stop stop-color="#8B9FF8"/>
7
+ <stop offset="0.475962" stop-color="#6763F6"/>
8
+ <stop offset="1" stop-color="#3326C4"/>
9
+ </linearGradient>
10
+ </defs>
11
+ </svg>
package/lib/client.js ADDED
@@ -0,0 +1,391 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "@nanodoc/nanodoc-dsh-plugin",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ "use strict";
7
+ var __create = Object.create;
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ var __getProtoOf = Object.getPrototypeOf;
12
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
13
+ var __export = (target, all) => {
14
+ for (var name in all)
15
+ __defProp(target, name, { get: all[name], enumerable: true });
16
+ };
17
+ var __copyProps = (to, from, except, desc) => {
18
+ if (from && typeof from === "object" || typeof from === "function") {
19
+ for (let key of __getOwnPropNames(from))
20
+ if (!__hasOwnProp.call(to, key) && key !== except)
21
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22
+ }
23
+ return to;
24
+ };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26
+ // If the importer is in node compatibility mode or this is not an ESM
27
+ // file that has been converted to a CommonJS file using a Babel-
28
+ // compatible transform (i.e. "__esModule" has not been set), then set
29
+ // "default" to the CommonJS "module.exports" for node compatibility.
30
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31
+ mod
32
+ ));
33
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
+
35
+ // src/client/index.tsx
36
+ var index_exports = {};
37
+ __export(index_exports, {
38
+ apply: () => apply,
39
+ inject: () => inject
40
+ });
41
+ module.exports = __toCommonJS(index_exports);
42
+
43
+ // src/client/error-page.ts
44
+ var React = __toESM(require("react"), 1);
45
+ function ErrorPage({ message }) {
46
+ return React.createElement("div", {
47
+ role: "alert",
48
+ style: {
49
+ flex: "1 0 100%",
50
+ minHeight: 96,
51
+ display: "grid",
52
+ placeContent: "center",
53
+ textAlign: "center",
54
+ padding: 16,
55
+ boxSizing: "border-box"
56
+ }
57
+ }, message);
58
+ }
59
+
60
+ // src/client/settings.tsx
61
+ var React2 = __toESM(require("react"), 1);
62
+
63
+ // package.json
64
+ var package_default = {
65
+ name: "@nanodoc/nanodoc-dsh-plugin",
66
+ version: "0.1.0-beta.2",
67
+ description: "NanoDoc bundle: convert and translate PDFs, extract financial statements, and compare documents. Each component can be enabled or disabled independently.",
68
+ type: "module",
69
+ main: "lib/index.js",
70
+ types: "lib/types/index.d.ts",
71
+ exports: {
72
+ ".": {
73
+ types: "./lib/types/index.d.ts",
74
+ default: "./lib/index.js"
75
+ },
76
+ "./client": {
77
+ types: "./lib/types/client/index.d.ts",
78
+ default: "./lib/client.js"
79
+ },
80
+ "./package.json": "./package.json",
81
+ "./locale/*.json": "./locale/*.json"
82
+ },
83
+ files: [
84
+ "docs/DETAIL.en.md",
85
+ "docs/preview-all.en.png",
86
+ "locale",
87
+ "icon.svg",
88
+ "lib",
89
+ "README.md"
90
+ ],
91
+ dsh: {
92
+ bundle: {
93
+ patch: "./lib/cordis.patch.yml"
94
+ },
95
+ client: {
96
+ platform: "web",
97
+ inject: [
98
+ "@deepseek-ai/dsh-client-locale",
99
+ "@deepseek-ai/dsh-api-remotes",
100
+ "@deepseek-ai/dsh-client-ui-plugin-manager"
101
+ ]
102
+ }
103
+ },
104
+ engines: {
105
+ dsh: ">=0.2.2-rc.1 <0.3.0"
106
+ },
107
+ peerDependencies: {
108
+ "@deepseek-ai/cordis": "~4.1.0"
109
+ },
110
+ devDependencies: {
111
+ "@deepseek-ai/cordis": "4.1.0",
112
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
113
+ "@types/node": "^22.20.5",
114
+ esbuild: "^0.25.0",
115
+ react: "^18.2.0",
116
+ typescript: "^5.6.0",
117
+ vitest: "^2.1.0"
118
+ },
119
+ scripts: {
120
+ build: "node build/build.mjs",
121
+ "build:test": "node build/build.mjs",
122
+ "build:release": "node build/build.mjs release",
123
+ typecheck: "tsc -p tsconfig.json --noEmit",
124
+ test: "vitest run",
125
+ smoke: "node scripts/smoke.mjs"
126
+ },
127
+ dependencies: {
128
+ "@nanodoc/pdflux-dsh-plugin": "0.1.0-beta.2",
129
+ "@nanodoc/mesh-dsh-plugin": "0.1.0-beta.2",
130
+ "@nanodoc/calliper-dsh-plugin": "0.1.0-beta.2"
131
+ },
132
+ icon: "./icon.svg",
133
+ publishConfig: {
134
+ access: "public",
135
+ registry: "http://100.64.0.1:4873/",
136
+ tag: "rc"
137
+ }
138
+ };
139
+
140
+ // src/region.ts
141
+ var PLUGIN_LANGUAGE = "en";
142
+ var API_KEY_REF = "NANODOC_API_KEY_EN";
143
+
144
+ // src/client/settings-keys.ts
145
+ var SETTINGS_BUNDLE_KEY = package_default.name;
146
+ var rowId = PLUGIN_LANGUAGE === "en" ? "nanodoc-en" : "nanodoc";
147
+ var SETTINGS_ROW_KEYS = [`${SETTINGS_BUNDLE_KEY}#${rowId}`];
148
+
149
+ // src/client/locale/zh.json
150
+ var zh_default = {
151
+ settingsLanguage: "\u8BED\u8A00",
152
+ settingsLanguageZh: "\u4E2D\u6587",
153
+ settingsLanguageEn: "English",
154
+ settingsWebsite: "\u5B98\u7F51",
155
+ settingsWebsiteHint: "\u8BF7\u901A\u8FC7\u4E0A\u65B9\u5B98\u7F51\u94FE\u63A5\u6CE8\u518C\u8D26\u53F7\u5E76\u83B7\u53D6 API Key\u3002",
156
+ settingsApiKey: "NanoDoc API \u5BC6\u94A5",
157
+ settingsSaveKey: "\u4FDD\u5B58\u5BC6\u94A5",
158
+ settingsClearKey: "\u6E05\u9664\u5BC6\u94A5",
159
+ settingsRetry: "\u91CD\u8BD5",
160
+ settingsBusy: "\u5904\u7406\u4E2D\u2026",
161
+ settingsReading: "\u6B63\u5728\u8BFB\u53D6\u2026",
162
+ settingsConfigured: "\u5DF2\u914D\u7F6E",
163
+ settingsUnconfigured: "\u672A\u914D\u7F6E",
164
+ settingsReadFailed: "\u8BFB\u53D6\u5931\u8D25",
165
+ settingsCredFailed: "\u8BFB\u53D6\u51ED\u636E\u72B6\u6001\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8FDE\u63A5\u540E\u91CD\u8BD5",
166
+ settingsKeySaved: "\u5DF2\u4FDD\u5B58",
167
+ settingsKeySaveFailed: "\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",
168
+ settingsKeySaveFailedRetry: "\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8FDE\u63A5\u540E\u91CD\u8BD5",
169
+ settingsKeyCleared: "\u5DF2\u6E05\u9664\u5BC6\u94A5",
170
+ settingsClearFailed: "\u6E05\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",
171
+ settingsClearFailedRetry: "\u6E05\u9664\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8FDE\u63A5\u540E\u91CD\u8BD5",
172
+ settingsLanguageSaved: "\u5DF2\u4FDD\u5B58\u8BED\u8A00",
173
+ settingsLanguageSaveFailed: "\u4FDD\u5B58\u8BED\u8A00\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",
174
+ settingsKeyPlaceholder: "\u8BF7\u8F93\u5165 API \u5BC6\u94A5",
175
+ settingsKeyReplacePlaceholder: "\u8F93\u5165\u65B0\u5BC6\u94A5\u4EE5\u66FF\u6362",
176
+ settingsHint: "\u5F53\u524D\u8BED\u8A00\u5BF9\u5E94\u73AF\u5883\u7684\u5BC6\u94A5\u4FDD\u5B58\u5728\u672C\u673A\uFF1B\u7559\u7A7A\u4FDD\u7559\u73B0\u6709\u5BC6\u94A5\u3002",
177
+ settingsSummary: "\u586B\u5199\u5171\u7528\u7684 NanoDoc API \u5BC6\u94A5",
178
+ settingsApiKeyZh: "\u56FD\u5185 NanoDoc API \u5BC6\u94A5",
179
+ settingsApiKeyEn: "\u56FD\u9645 NanoDoc API \u5BC6\u94A5",
180
+ settingsLanguageKeyHint: "\u5148\u9009\u62E9\u8BED\u8A00\uFF0C\u518D\u586B\u5199\u8BE5\u73AF\u5883\u7684 API Key\uFF1B\u56FD\u5185\u4E0E\u56FD\u9645\u5BC6\u94A5\u5206\u5F00\u5B58\u50A8\uFF0C\u4E09\u9879\u80FD\u529B\u5171\u7528\u5BF9\u5E94\u73AF\u5883\u7684\u5BC6\u94A5\uFF0C\u5931\u6548\u65F6\u4E0D\u4F1A\u81EA\u52A8\u6539\u7528\u53E6\u4E00\u628A\u3002"
181
+ };
182
+
183
+ // src/client/locale/en.json
184
+ var en_default = {
185
+ settingsLanguage: "Language",
186
+ settingsLanguageZh: "\u4E2D\u6587",
187
+ settingsLanguageEn: "English",
188
+ settingsWebsite: "Official site",
189
+ settingsWebsiteHint: "Register on the official site above to obtain an API key.",
190
+ settingsApiKey: "NanoDoc API key",
191
+ settingsSaveKey: "Save key",
192
+ settingsClearKey: "Clear key",
193
+ settingsRetry: "Retry",
194
+ settingsBusy: "Working\u2026",
195
+ settingsReading: "Loading\u2026",
196
+ settingsConfigured: "Configured",
197
+ settingsUnconfigured: "Not configured",
198
+ settingsReadFailed: "Load failed",
199
+ settingsCredFailed: "Failed to read credential status. Check the connection and retry.",
200
+ settingsKeySaved: "Saved",
201
+ settingsKeySaveFailed: "Save failed; retry",
202
+ settingsKeySaveFailedRetry: "Save failed; check the connection and retry",
203
+ settingsKeyCleared: "API key cleared",
204
+ settingsClearFailed: "Failed to clear; retry",
205
+ settingsClearFailedRetry: "Failed to clear; check the connection and retry",
206
+ settingsLanguageSaved: "Language saved",
207
+ settingsLanguageSaveFailed: "Failed to save language; retry",
208
+ settingsKeyPlaceholder: "Enter API key",
209
+ settingsKeyReplacePlaceholder: "Enter a new key to replace",
210
+ settingsHint: "The key for the current language environment is stored on this machine; leave blank to keep the existing key.",
211
+ settingsSummary: "Enter the shared NanoDoc API key",
212
+ settingsApiKeyZh: "CN NanoDoc API key",
213
+ settingsApiKeyEn: "Intl NanoDoc API key",
214
+ settingsLanguageKeyHint: "Select a language first, then enter that environment\u2019s API key. CN and Intl keys are stored separately and shared by all three capabilities; requests never fall back to the other key."
215
+ };
216
+
217
+ // src/client/locale.ts
218
+ var DICTS = { zh: zh_default, en: en_default };
219
+ function t(key, fallback) {
220
+ const dict = DICTS[PLUGIN_LANGUAGE] ?? DICTS.zh;
221
+ return dict[key] ?? DICTS.zh[key] ?? DICTS.en[key] ?? fallback;
222
+ }
223
+
224
+ // src/client/settings.tsx
225
+ function registerSettings(ctx) {
226
+ const Card = (props) => {
227
+ const [configured, setConfigured] = React2.useState(void 0);
228
+ const [value, setValue] = React2.useState("");
229
+ const [message, setMessage] = React2.useState(void 0);
230
+ const [actionError, setActionError] = React2.useState(void 0);
231
+ const [loadError, setLoadError] = React2.useState(void 0);
232
+ const [busy, setBusy] = React2.useState(false);
233
+ const refresh = React2.useCallback(async () => {
234
+ setLoadError(void 0);
235
+ try {
236
+ const res = await ctx.remote?.credentials?.describe?.([API_KEY_REF]);
237
+ if (res?.ok) {
238
+ const info = res.value?.[API_KEY_REF];
239
+ setConfigured(!!info?.configured);
240
+ } else {
241
+ setLoadError(t("settingsCredFailed", "\u8BFB\u53D6\u51ED\u636E\u72B6\u6001\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8FDE\u63A5\u540E\u91CD\u8BD5"));
242
+ setConfigured(void 0);
243
+ }
244
+ } catch {
245
+ setLoadError(t("settingsCredFailed", "\u8BFB\u53D6\u51ED\u636E\u72B6\u6001\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8FDE\u63A5\u540E\u91CD\u8BD5"));
246
+ setConfigured(void 0);
247
+ }
248
+ }, []);
249
+ React2.useEffect(() => {
250
+ if (props.view !== "summary") void refresh();
251
+ }, [refresh, props.view]);
252
+ if (props.view === "summary") {
253
+ return React2.createElement("div", null, t("settingsSummary", "\u586B\u5199 NanoDoc API \u5BC6\u94A5"));
254
+ }
255
+ const saveKey = async () => {
256
+ const next = value.trim();
257
+ if (!next) return;
258
+ setBusy(true);
259
+ setMessage(void 0);
260
+ setActionError(void 0);
261
+ try {
262
+ const res = await ctx.remote?.credentials?.set?.(API_KEY_REF, next);
263
+ if (res?.ok) {
264
+ setValue("");
265
+ setMessage(t("settingsKeySaved", "\u5DF2\u4FDD\u5B58"));
266
+ await refresh();
267
+ } else {
268
+ setActionError(t("settingsKeySaveFailed", "\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"));
269
+ }
270
+ } catch {
271
+ setActionError(t("settingsKeySaveFailedRetry", "\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8FDE\u63A5\u540E\u91CD\u8BD5"));
272
+ } finally {
273
+ setBusy(false);
274
+ }
275
+ };
276
+ const clearKey = async () => {
277
+ setBusy(true);
278
+ setMessage(void 0);
279
+ setActionError(void 0);
280
+ try {
281
+ const res = await ctx.remote?.credentials?.unset?.(API_KEY_REF);
282
+ if (!res?.ok) {
283
+ setActionError(t("settingsClearFailed", "\u6E05\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"));
284
+ return;
285
+ }
286
+ setMessage(t("settingsKeyCleared", "\u5DF2\u6E05\u9664\u5BC6\u94A5"));
287
+ await refresh();
288
+ } catch {
289
+ setActionError(t("settingsClearFailedRetry", "\u6E05\u9664\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8FDE\u63A5\u540E\u91CD\u8BD5"));
290
+ } finally {
291
+ setBusy(false);
292
+ }
293
+ };
294
+ const buttonStyle = {
295
+ height: 34,
296
+ boxSizing: "border-box",
297
+ border: "1px solid rgba(128,128,128,.25)",
298
+ borderRadius: 6,
299
+ padding: "0 12px",
300
+ font: "inherit",
301
+ whiteSpace: "nowrap",
302
+ cursor: busy ? "wait" : "pointer",
303
+ color: "inherit",
304
+ background: "transparent"
305
+ };
306
+ const inputStyle = {
307
+ width: "100%",
308
+ height: 34,
309
+ minWidth: 0,
310
+ boxSizing: "border-box",
311
+ padding: "0 10px",
312
+ borderRadius: 6,
313
+ border: "1px solid rgba(128,128,128,.35)",
314
+ background: "transparent",
315
+ color: "inherit",
316
+ font: "inherit"
317
+ };
318
+ const label = PLUGIN_LANGUAGE === "zh" ? t("settingsApiKeyZh", "\u56FD\u5185 NanoDoc API \u5BC6\u94A5") : t("settingsApiKeyEn", "\u56FD\u9645 NanoDoc API \u5BC6\u94A5");
319
+ const ready = configured;
320
+ const canSave = !busy && value.trim().length > 0;
321
+ return React2.createElement(
322
+ "section",
323
+ {
324
+ style: { width: "100%", maxWidth: 480, boxSizing: "border-box", padding: "8px 0", font: '13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif' }
325
+ },
326
+ React2.createElement(
327
+ "div",
328
+ { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 8 } },
329
+ React2.createElement("span", { style: { fontWeight: 600 } }, label),
330
+ React2.createElement(
331
+ "span",
332
+ { style: { padding: "2px 6px", borderRadius: 4, fontSize: 12, background: ready ? "rgba(34,160,107,.12)" : "rgba(128,128,128,.1)", color: ready ? "#25855e" : "inherit" } },
333
+ loadError ? t("settingsReadFailed", "\u8BFB\u53D6\u5931\u8D25") : ready === void 0 ? t("settingsReading", "\u6B63\u5728\u8BFB\u53D6\u2026") : ready ? t("settingsConfigured", "\u5DF2\u914D\u7F6E") : t("settingsUnconfigured", "\u672A\u914D\u7F6E")
334
+ )
335
+ ),
336
+ loadError ? React2.createElement(ErrorPage, { message: loadError }) : null,
337
+ React2.createElement("input", {
338
+ type: "password",
339
+ "aria-label": label,
340
+ style: inputStyle,
341
+ placeholder: ready ? t("settingsKeyReplacePlaceholder", "\u8F93\u5165\u65B0\u5BC6\u94A5\u4EE5\u66FF\u6362") : t("settingsKeyPlaceholder", "\u8BF7\u8F93\u5165 API \u5BC6\u94A5"),
342
+ autoComplete: "off",
343
+ value,
344
+ disabled: busy,
345
+ onChange: (e) => setValue(e.target.value),
346
+ onKeyDown: (e) => {
347
+ if (e.key === "Enter" && canSave) void saveKey();
348
+ }
349
+ }),
350
+ React2.createElement(
351
+ "div",
352
+ { style: { display: "flex", alignItems: "center", gap: 8, marginTop: 8 } },
353
+ React2.createElement("button", {
354
+ type: "button",
355
+ disabled: !canSave,
356
+ onClick: () => void saveKey(),
357
+ style: { ...buttonStyle, background: canSave ? "#4d6bfe" : "rgba(128,128,128,.1)", color: canSave ? "#fff" : "inherit", opacity: canSave ? 1 : 0.45, borderColor: "transparent" }
358
+ }, busy ? t("settingsBusy", "\u5904\u7406\u4E2D\u2026") : t("settingsSaveKey", "\u4FDD\u5B58\u5BC6\u94A5")),
359
+ ready ? React2.createElement("button", { type: "button", disabled: busy, onClick: () => void clearKey(), style: buttonStyle }, t("settingsClearKey", "\u6E05\u9664\u5BC6\u94A5")) : null,
360
+ loadError ? React2.createElement("button", { type: "button", disabled: busy, onClick: () => void refresh(), style: buttonStyle }, t("settingsRetry", "\u91CD\u8BD5")) : null
361
+ ),
362
+ React2.createElement("div", { style: { marginTop: 8, opacity: 0.6, fontSize: 12 } }, t("settingsHint", "\u5BC6\u94A5\u4FDD\u5B58\u5728\u672C\u673A\uFF1B\u7559\u7A7A\u4FDD\u7559\u73B0\u6709\u5BC6\u94A5\u3002")),
363
+ actionError ? React2.createElement(ErrorPage, { message: actionError }) : null,
364
+ message ? React2.createElement("div", { role: "status", style: { marginTop: 6, fontSize: 12 } }, message) : null
365
+ );
366
+ };
367
+ ctx.slots.inject(
368
+ "plugins.bundle.config",
369
+ () => ctx.slots.register({ name: "plugins.bundle.config", key: SETTINGS_BUNDLE_KEY }, Card)
370
+ );
371
+ for (const key of SETTINGS_ROW_KEYS) {
372
+ ctx.slots.inject(
373
+ "plugins.row.config",
374
+ () => ctx.slots.register({ name: "plugins.row.config", key }, Card)
375
+ );
376
+ }
377
+ }
378
+
379
+ // src/client/index.tsx
380
+ var inject = [
381
+ "slots",
382
+ "remote",
383
+ "remote.credentials"
384
+ ];
385
+ function apply(ctx) {
386
+ registerSettings(ctx);
387
+ }
388
+
389
+ return module.exports;
390
+ }
391
+ });
@@ -0,0 +1,33 @@
1
+ # Bundle patch for @nanodoc/nanodoc-dsh-plugin.
2
+ # Install with: dsh plugin --profile <name> add @nanodoc/nanodoc-dsh-plugin
3
+ # Four rows: thin UI (nanodoc) + three capability packages (row ids must stay pdflux/mesh/calliper).
4
+ - insert:
5
+ - id: nanodoc-en
6
+ name: '@nanodoc/nanodoc-dsh-plugin'
7
+ - id: pdflux
8
+ name: '@nanodoc/pdflux-dsh-plugin'
9
+ config:
10
+ baseUrl: https://nanodoc.ai/nanodoc/
11
+ nanodocApiKeyRef: NANODOC_API_KEY_EN
12
+ pollIntervalMs: 2000
13
+ maxWaitSeconds: 60
14
+ maxFileMB: 200
15
+ requireUploadApproval: false
16
+ - id: mesh
17
+ name: '@nanodoc/mesh-dsh-plugin'
18
+ config:
19
+ baseUrl: https://nanodoc.ai/nanodoc/
20
+ nanodocApiKeyRef: NANODOC_API_KEY_EN
21
+ pollIntervalMs: 2000
22
+ maxWaitSeconds: 60
23
+ maxFileMB: 200
24
+ requireUploadApproval: false
25
+ - id: calliper
26
+ name: '@nanodoc/calliper-dsh-plugin'
27
+ config:
28
+ baseUrl: https://nanodoc.ai/nanodoc/
29
+ nanodocApiKeyRef: NANODOC_API_KEY_EN
30
+ pollIntervalMs: 2000
31
+ maxWaitSeconds: 60
32
+ maxFileMB: 200
33
+ requireUploadApproval: false
package/lib/index.js ADDED
@@ -0,0 +1,10 @@
1
+ // src/index.ts
2
+ var name = "nanodoc";
3
+ var inject = [];
4
+ async function apply(_ctx) {
5
+ }
6
+ export {
7
+ apply,
8
+ inject,
9
+ name
10
+ };
@@ -0,0 +1,3 @@
1
+ import type { Context } from '@deepseek-ai/cordis'
2
+ export declare const inject: readonly string[]
3
+ export declare function apply(ctx: Context): void
@@ -0,0 +1,4 @@
1
+ import type { Context } from '@deepseek-ai/cordis'
2
+ export declare const name: 'nanodoc'
3
+ export declare const inject: readonly string[]
4
+ export declare function apply(ctx: Context): Promise<void>
package/locale/en.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "NanoDoc",
4
+ "description": "NanoDoc bundles three capabilities: PDF conversion and translation (PDFlux), financial statement extraction (Mesh), and document comparison (Calliper). Once you enter the shared NanoDoc API key, you can enable or disable each component independently.",
5
+ "detail": "docs/DETAIL.en.md"
6
+ }
7
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "NanoDoc",
4
+ "description": "NanoDoc bundles three capabilities: PDF conversion and translation (PDFlux), financial statement extraction (Mesh), and document comparison (Calliper). Once you enter the shared NanoDoc API key, you can enable or disable each component independently.",
5
+ "detail": "docs/DETAIL.en.md"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,75 @@
1
1
  {
2
2
  "name": "@nanodoc/nanodoc-dsh-plugin",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0-beta.2",
4
+ "description": "NanoDoc bundle: convert and translate PDFs, extract financial statements, and compare documents. Each component can be enabled or disabled independently.",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "types": "lib/types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/types/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./client": {
14
+ "types": "./lib/types/client/index.d.ts",
15
+ "default": "./lib/client.js"
16
+ },
17
+ "./package.json": "./package.json",
18
+ "./locale/*.json": "./locale/*.json"
19
+ },
20
+ "files": [
21
+ "docs/DETAIL.en.md",
22
+ "docs/preview-all.en.png",
23
+ "locale",
24
+ "icon.svg",
25
+ "lib",
26
+ "README.md"
27
+ ],
28
+ "dsh": {
29
+ "bundle": {
30
+ "patch": "./lib/cordis.patch.yml"
31
+ },
32
+ "client": {
33
+ "platform": "web",
34
+ "inject": [
35
+ "@deepseek-ai/dsh-client-locale",
36
+ "@deepseek-ai/dsh-api-remotes",
37
+ "@deepseek-ai/dsh-client-ui-plugin-manager"
38
+ ]
39
+ }
40
+ },
41
+ "engines": {
42
+ "dsh": ">=0.2.2-rc.1 <0.3.0"
43
+ },
44
+ "peerDependencies": {
45
+ "@deepseek-ai/cordis": "~4.1.0"
46
+ },
47
+ "devDependencies": {
48
+ "@deepseek-ai/cordis": "4.1.0",
49
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.1",
50
+ "@types/node": "^22.20.5",
51
+ "esbuild": "^0.25.0",
52
+ "react": "^18.2.0",
53
+ "typescript": "^5.6.0",
54
+ "vitest": "^2.1.0"
55
+ },
56
+ "scripts": {
57
+ "build": "node build/build.mjs",
58
+ "build:test": "node build/build.mjs",
59
+ "build:release": "node build/build.mjs release",
60
+ "typecheck": "tsc -p tsconfig.json --noEmit",
61
+ "test": "vitest run",
62
+ "smoke": "node scripts/smoke.mjs"
63
+ },
64
+ "dependencies": {
65
+ "@nanodoc/pdflux-dsh-plugin": "0.1.0-beta.2",
66
+ "@nanodoc/mesh-dsh-plugin": "0.1.0-beta.2",
67
+ "@nanodoc/calliper-dsh-plugin": "0.1.0-beta.2"
68
+ },
69
+ "icon": "./icon.svg",
70
+ "publishConfig": {
71
+ "access": "public",
72
+ "registry": "http://100.64.0.1:4873/",
73
+ "tag": "rc"
74
+ }
75
+ }