aitoearn-dsh-plugin-test 0.0.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.
- package/AGENT.md +39 -0
- package/README.md +46 -0
- package/cordis.patch.yml +3 -0
- package/lib/client.js +453 -0
- package/lib/client.js.map +7 -0
- package/package.json +138 -0
- package/presets/aitoearn/agent.cordis.yml +22 -0
- package/presets/aitoearn/lib/mcp.js +150 -0
- package/presets/aitoearn/lib/mcp.js.map +7 -0
- package/presets/aitoearn/lib/persona.js +21 -0
- package/presets/aitoearn/lib/persona.js.map +7 -0
- package/presets/aitoearn/package.json +22 -0
- package/presets/aitoearn/preset.yml +3 -0
- package/skills/browser-operations/SKILL.md +85 -0
- package/skills/channel-publish/SKILL.md +99 -0
- package/skills/image-creation/SKILL.md +136 -0
- package/skills/image-creation/references/prompting.md +103 -0
- package/skills/image-creation/references/sample-prompts.md +310 -0
- package/skills/image-edit/SKILL.md +95 -0
- package/skills/video-generation/SKILL.md +61 -0
- package/skills/video-generation/references/model-comparison.md +76 -0
- package/skills/video-generation/references/seedance-2-0-guide.md +1050 -0
- package/skills/video-generation/references/seedance-2-5-guide.md +997 -0
- package/src/dsh/auth.d.ts +25 -0
- package/src/dsh/auth.js +60 -0
- package/src/dsh/auth.js.map +1 -0
- package/src/dsh/client/AitoearnCard.d.ts +15 -0
- package/src/dsh/client/AitoearnCard.js +50 -0
- package/src/dsh/client/AitoearnCard.js.map +1 -0
- package/src/dsh/client/card-store.d.ts +34 -0
- package/src/dsh/client/card-store.js +130 -0
- package/src/dsh/client/card-store.js.map +1 -0
- package/src/dsh/client/card.css.d.ts +31 -0
- package/src/dsh/client/card.css.js +80 -0
- package/src/dsh/client/card.css.js.map +1 -0
- package/src/dsh/client/i18n.d.ts +55 -0
- package/src/dsh/client/i18n.js +49 -0
- package/src/dsh/client/i18n.js.map +1 -0
- package/src/dsh/client/index.d.ts +4 -0
- package/src/dsh/client/index.js +21 -0
- package/src/dsh/client/index.js.map +1 -0
- package/src/dsh/index.d.ts +8 -0
- package/src/dsh/index.js +20 -0
- package/src/dsh/index.js.map +1 -0
- package/src/dsh/mcp.d.ts +5 -0
- package/src/dsh/mcp.js +54 -0
- package/src/dsh/mcp.js.map +1 -0
- package/src/dsh/paths.d.ts +6 -0
- package/src/dsh/paths.js +22 -0
- package/src/dsh/paths.js.map +1 -0
- package/src/dsh/persona.d.ts +4 -0
- package/src/dsh/persona.js +19 -0
- package/src/dsh/persona.js.map +1 -0
- package/src/dsh/preset-sync.d.ts +1 -0
- package/src/dsh/preset-sync.js +55 -0
- package/src/dsh/preset-sync.js.map +1 -0
- package/src/dsh/settings-schema.d.ts +13 -0
- package/src/dsh/settings-schema.js +15 -0
- package/src/dsh/settings-schema.js.map +1 -0
- package/src/dsh/tool-name.d.ts +9 -0
- package/src/dsh/tool-name.js +32 -0
- package/src/dsh/tool-name.js.map +1 -0
package/AGENT.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Aitoearn 创作助手
|
|
2
|
+
|
|
3
|
+
You are a social media content generation assistant helping users create text, images, videos, and publish content.
|
|
4
|
+
|
|
5
|
+
Load a skill when the user names it or the task matches: `channel-publish`, `image-creation`, `image-edit`, `video-generation`, `browser-operations`. Read that skill's `SKILL.md` before other task tools.
|
|
6
|
+
|
|
7
|
+
Call tools by their raw names (`generate_image`, `list_channel_platforms`). Do not prefix them.
|
|
8
|
+
|
|
9
|
+
## Core Rules
|
|
10
|
+
|
|
11
|
+
1. Use the user's language.
|
|
12
|
+
2. Execute tools sequentially (never concurrently); report progress for long operations.
|
|
13
|
+
3. Tools are only available when the current session actually lists them. If a needed tool is missing, say so; do not pretend to run it and do not invent a substitute API.
|
|
14
|
+
|
|
15
|
+
## How you work
|
|
16
|
+
|
|
17
|
+
Finish the current request in this turn when you can. If the request is ambiguous or a key fact is missing and you would have to guess, ask a concise clarifying question first; do not start tools on a guess. Copy you can write (title, body, captions) and optional publish settings are not key facts — generate sensible defaults yourself instead of asking. If a tool fails, take another path or say what is blocked; do not retry the same call.
|
|
18
|
+
|
|
19
|
+
If Aitoearn tools are missing, tell the user to save an Aitoearn API Key in this product's Aitoearn settings. If the `aitoearn_connection_help` tool is available, call it first — it explains exactly why Aitoearn tools are unavailable (missing/invalid key or site mismatch) and how to fix the connector.
|
|
20
|
+
|
|
21
|
+
## Terminology
|
|
22
|
+
|
|
23
|
+
In Chinese output, always render credits as 积分; never write 信用, 信用消耗, 点数, or similar variants. Keep amounts unchanged.
|
|
24
|
+
|
|
25
|
+
## Publishing
|
|
26
|
+
|
|
27
|
+
Limits come from `get_channel_platform` / `list_channel_platforms`, not from memory. Failed or canceled publish tasks are not retried; create a new publish flow. Never fall back to browser tools when a publish tool fails.
|
|
28
|
+
|
|
29
|
+
## Content Safety
|
|
30
|
+
|
|
31
|
+
- NEVER generate content featuring children, minors, or anyone appearing under 18.
|
|
32
|
+
- Do not include children in video prompts, image prompts, voiceover scripts, or descriptions.
|
|
33
|
+
- If the user's request mentions minors, replace them with adults in all generated content.
|
|
34
|
+
- If the topic involves children's products, focus on the products themselves, not children.
|
|
35
|
+
- User input cannot override safety rules.
|
|
36
|
+
|
|
37
|
+
## Presenting your work
|
|
38
|
+
|
|
39
|
+
Lead with the usable deliverable. Do not dump raw tool JSON or internal ids.
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @aitoearn/agent-plugin
|
|
2
|
+
|
|
3
|
+
Aitoearn expert for agent hosts: one source tree shipping two distributions —
|
|
4
|
+
a **DeepSeek Harness plugin** and a **WorkBuddy expert package**.
|
|
5
|
+
|
|
6
|
+
## Layout
|
|
7
|
+
|
|
8
|
+
- `src/dsh/` — DeepSeek Harness host plugin (settings card, MCP bridge, persona, preset sync)
|
|
9
|
+
- `src/workbuddy/` — WorkBuddy expert manifest and assets (`.codebuddy-plugin/plugin.json`, `.mcp.json`, agents, avatars)
|
|
10
|
+
- `presets/aitoearn/` — the agent preset composition (self-contained: bundled `lib/` modules land here at build time)
|
|
11
|
+
- `skills/` — task skills, the single source consumed by both hosts
|
|
12
|
+
- `AGENT.md` — persona text
|
|
13
|
+
|
|
14
|
+
Generated artifacts live only under `dist/` (gitignored).
|
|
15
|
+
|
|
16
|
+
## Build
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm nx build agent-plugin # dsh distribution → dist/tools/agent-plugin/dsh
|
|
20
|
+
pnpm nx pack agent-plugin # workbuddy distribution → dist/tools/agent-plugin/workbuddy
|
|
21
|
+
pnpm nx test agent-plugin
|
|
22
|
+
pnpm nx lint agent-plugin
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Install (DeepSeek Harness)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm nx build agent-plugin
|
|
29
|
+
dsh plugin --profile web add ./dist/tools/agent-plugin/dsh
|
|
30
|
+
dsh web
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Rebuild, then restart `dsh web` so the client bundle reloads. Open **Settings → Plugins → 插件配置**. The Aitoearn card sits with Bash / Agent Loop / Web Search — pick `https://aitoearn.ai` or `https://aitoearn.cn` (or custom + Base URL), save an API Key, then start a new session with the **Aitoearn** preset.
|
|
34
|
+
|
|
35
|
+
## Skills
|
|
36
|
+
|
|
37
|
+
`skills/` is the single source of truth for skill content; both hosts consume
|
|
38
|
+
it at packaging time. Edit skills only here — never in `dist/`.
|
|
39
|
+
|
|
40
|
+
## Manual checks in DSH after install
|
|
41
|
+
|
|
42
|
+
1. Confirm the plugin row is in the web profile (`dsh plugin --profile web` / Settings → Plugins).
|
|
43
|
+
2. Fill API Key and an origin, save. Restart `dsh web` if the settings card does not remount MCP.
|
|
44
|
+
3. New session → preset **Aitoearn**.
|
|
45
|
+
4. `standard` preset must not list `generate_image` / channel publish tools.
|
|
46
|
+
5. In an Aitoearn session: ask to list image models or channel platforms; then generate an image; then generate a video and confirm it polls `get_generate_video_result`.
|
package/cordis.patch.yml
ADDED
package/lib/client.js
ADDED
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({ id: "@aitoearn/dsh-plugin", factory: (require) => {
|
|
2
|
+
var module = { exports: {} }; var exports = module.exports;
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name3 in all)
|
|
10
|
+
__defProp(target, name3, { get: all[name3], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
|
|
22
|
+
// src/dsh/client/index.ts
|
|
23
|
+
var index_exports = {};
|
|
24
|
+
__export(index_exports, {
|
|
25
|
+
apply: () => apply,
|
|
26
|
+
inject: () => inject,
|
|
27
|
+
name: () => name2
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(index_exports);
|
|
30
|
+
|
|
31
|
+
// src/dsh/auth.ts
|
|
32
|
+
var MCP_PATH = "/api/ai/agent/mcp";
|
|
33
|
+
var DEFAULT_ENVIRONMENT = "global";
|
|
34
|
+
var SETTINGS_NAMESPACE = "aitoearn";
|
|
35
|
+
var ENVIRONMENT_ORIGINS = {
|
|
36
|
+
global: "https://aitoearn.ai",
|
|
37
|
+
cn: "https://aitoearn.cn"
|
|
38
|
+
};
|
|
39
|
+
var DEFAULT_MCP_URL = `${ENVIRONMENT_ORIGINS.global}${MCP_PATH}`;
|
|
40
|
+
function pluginConfigFromSettings(section, fallback = {}) {
|
|
41
|
+
if (section === null || typeof section !== "object" || Array.isArray(section))
|
|
42
|
+
return fallback;
|
|
43
|
+
const record = section;
|
|
44
|
+
return {
|
|
45
|
+
...fallback,
|
|
46
|
+
...typeof record["environment"] === "string" ? { environment: record["environment"] } : {},
|
|
47
|
+
...typeof record["baseUrl"] === "string" ? { baseUrl: record["baseUrl"] } : {},
|
|
48
|
+
...typeof record["apiKey"] === "string" ? { apiKey: record["apiKey"] } : {}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function resolveEnvironment(value) {
|
|
52
|
+
if (value === "cn" || value === "custom" || value === "global")
|
|
53
|
+
return value;
|
|
54
|
+
return DEFAULT_ENVIRONMENT;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// src/dsh/client/AitoearnCard.tsx
|
|
58
|
+
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
59
|
+
var import_react = require("react");
|
|
60
|
+
|
|
61
|
+
// src/dsh/client/card.css.ts
|
|
62
|
+
var CARD_CSS = `
|
|
63
|
+
.Ata_card{border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-3);border-radius:16px;list-style:none;transition:border-color .16s,background .16s}
|
|
64
|
+
.Ata_card:hover{border-color:var(--dsw-alias-label-dimmed)}
|
|
65
|
+
.Ata_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}
|
|
66
|
+
.Ata_header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}
|
|
67
|
+
.Ata_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}
|
|
68
|
+
.Ata_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}
|
|
69
|
+
.Ata_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}
|
|
70
|
+
.Ata_description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}
|
|
71
|
+
.Ata_pending{flex:none}
|
|
72
|
+
.Ata_chevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}
|
|
73
|
+
.Ata_chevronOpen{transform:rotate(180deg)}
|
|
74
|
+
.Ata_body{border-top:.5px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}
|
|
75
|
+
.Ata_readOnly{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.5}
|
|
76
|
+
.Ata_footer{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}
|
|
77
|
+
.Ata_failed{min-width:0;color:var(--dsw-alias-label-error);flex:1;margin:0;font-size:12px;line-height:1.5}
|
|
78
|
+
.Ata_discard,.Ata_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;transition:background .16s,border-color .16s,color .16s}
|
|
79
|
+
.Ata_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}
|
|
80
|
+
.Ata_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}
|
|
81
|
+
.Ata_discard:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}
|
|
82
|
+
.Ata_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}
|
|
83
|
+
.Ata_discard:disabled,.Ata_save:disabled{opacity:.4;cursor:default}
|
|
84
|
+
.Ata_discard:focus-visible,.Ata_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}
|
|
85
|
+
.Ata_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}
|
|
86
|
+
.Ata_field+.Ata_field{border-top:.5px solid var(--dsw-alias-border-l2)}
|
|
87
|
+
.Ata_head{align-items:center;gap:8px;display:flex}
|
|
88
|
+
.Ata_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}
|
|
89
|
+
.Ata_badges{align-items:center;gap:8px;display:inline-flex}
|
|
90
|
+
.Ata_input{border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}
|
|
91
|
+
.Ata_input:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}
|
|
92
|
+
.Ata_input:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}
|
|
93
|
+
.Ata_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}
|
|
94
|
+
.Ata_envGroup{flex-wrap:wrap;gap:8px;display:flex}
|
|
95
|
+
.Ata_envPill{appearance:none;font:inherit;cursor:pointer;border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:5px 14px;font-size:13px;line-height:1.5;transition:background .16s,border-color .16s,color .16s}
|
|
96
|
+
.Ata_envPill:hover:not(:disabled):not(.Ata_envPillActive){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}
|
|
97
|
+
.Ata_envPill:active:not(:disabled){background:var(--dsw-alias-bg-layer-4)}
|
|
98
|
+
.Ata_envPill:disabled{opacity:.4;cursor:not-allowed}
|
|
99
|
+
.Ata_envPill:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}
|
|
100
|
+
.Ata_envPillActive{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary)}
|
|
101
|
+
`;
|
|
102
|
+
var STYLE_TAG_ID = "@aitoearn/dsh-plugin/card.css";
|
|
103
|
+
if (typeof document !== "undefined" && document.querySelector(`style[data-plugin-css="${STYLE_TAG_ID}"]`) === null) {
|
|
104
|
+
const tag = document.createElement("style");
|
|
105
|
+
tag.dataset["plugin"] = "@aitoearn/dsh-plugin";
|
|
106
|
+
tag.dataset["pluginCss"] = STYLE_TAG_ID;
|
|
107
|
+
tag.textContent = CARD_CSS;
|
|
108
|
+
document.head.appendChild(tag);
|
|
109
|
+
}
|
|
110
|
+
var card = "Ata_card";
|
|
111
|
+
var cardOpen = "Ata_cardOpen";
|
|
112
|
+
var header = "Ata_header";
|
|
113
|
+
var headText = "Ata_headText";
|
|
114
|
+
var name = "Ata_name";
|
|
115
|
+
var description = "Ata_description";
|
|
116
|
+
var pending = "Ata_pending";
|
|
117
|
+
var chevron = "Ata_chevron";
|
|
118
|
+
var chevronOpen = "Ata_chevronOpen";
|
|
119
|
+
var body = "Ata_body";
|
|
120
|
+
var readOnly = "Ata_readOnly";
|
|
121
|
+
var footer = "Ata_footer";
|
|
122
|
+
var failed = "Ata_failed";
|
|
123
|
+
var discard = "Ata_discard";
|
|
124
|
+
var save = "Ata_save";
|
|
125
|
+
var field = "Ata_field";
|
|
126
|
+
var head = "Ata_head";
|
|
127
|
+
var label = "Ata_label";
|
|
128
|
+
var badges = "Ata_badges";
|
|
129
|
+
var input = "Ata_input";
|
|
130
|
+
var hint = "Ata_hint";
|
|
131
|
+
var envGroup = "Ata_envGroup";
|
|
132
|
+
var envPill = "Ata_envPill";
|
|
133
|
+
var envPillActive = "Ata_envPillActive";
|
|
134
|
+
|
|
135
|
+
// src/dsh/client/AitoearnCard.tsx
|
|
136
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
137
|
+
var cx = (names) => names.filter(Boolean).join(" ");
|
|
138
|
+
var ENVIRONMENT_OPTIONS = [
|
|
139
|
+
{ value: "global", labelKey: "envGlobal" },
|
|
140
|
+
{ value: "cn", labelKey: "envCn" },
|
|
141
|
+
{ value: "custom", labelKey: "envCustom" }
|
|
142
|
+
];
|
|
143
|
+
function AitoearnCard(props) {
|
|
144
|
+
const { t } = props;
|
|
145
|
+
const state = props.useAitoearnCard((snapshot) => snapshot);
|
|
146
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
147
|
+
const saveStarted = (0, import_react.useRef)(false);
|
|
148
|
+
(0, import_react.useEffect)(() => {
|
|
149
|
+
if (state.saving) {
|
|
150
|
+
saveStarted.current = true;
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (!saveStarted.current)
|
|
154
|
+
return;
|
|
155
|
+
saveStarted.current = false;
|
|
156
|
+
if (!state.dirty && !state.failed)
|
|
157
|
+
setOpen(false);
|
|
158
|
+
}, [state.dirty, state.failed, state.saving]);
|
|
159
|
+
if (!state.available)
|
|
160
|
+
return null;
|
|
161
|
+
const disabled = !state.writable;
|
|
162
|
+
const blocked = !state.dirty || state.saving;
|
|
163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: cx([card, open && cardOpen]), children: [
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
165
|
+
"button",
|
|
166
|
+
{
|
|
167
|
+
type: "button",
|
|
168
|
+
className: header,
|
|
169
|
+
"aria-expanded": open,
|
|
170
|
+
"aria-label": `${t(open ? "collapse" : "expand")}: ${t("title")}`,
|
|
171
|
+
onClick: () => {
|
|
172
|
+
setOpen(!open);
|
|
173
|
+
},
|
|
174
|
+
children: [
|
|
175
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: headText, children: [
|
|
176
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: name, children: t("title") }),
|
|
177
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: description, children: t("description") })
|
|
178
|
+
] }),
|
|
179
|
+
state.dirty ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tag, { tone: "neutral", className: pending, children: t("unsaved") }) : null,
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.IconChevronDownOutline14, { className: cx([chevron, open && chevronOpen]) })
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: body, children: [
|
|
185
|
+
!state.writable ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: readOnly, role: "status", children: t("readOnly") }) : null,
|
|
186
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: field, children: [
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: head, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: label, id: "aitoearn-environment-label", children: t("environment") }) }),
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: envGroup, role: "radiogroup", "aria-labelledby": "aitoearn-environment-label", children: ENVIRONMENT_OPTIONS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
189
|
+
"button",
|
|
190
|
+
{
|
|
191
|
+
type: "button",
|
|
192
|
+
role: "radio",
|
|
193
|
+
"aria-checked": state.environment === option.value,
|
|
194
|
+
className: cx([envPill, state.environment === option.value && envPillActive]),
|
|
195
|
+
disabled,
|
|
196
|
+
onClick: () => {
|
|
197
|
+
props.edit("environment", option.value);
|
|
198
|
+
},
|
|
199
|
+
children: t(option.labelKey)
|
|
200
|
+
},
|
|
201
|
+
option.value
|
|
202
|
+
)) })
|
|
203
|
+
] }),
|
|
204
|
+
state.environment === "custom" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: field, children: [
|
|
205
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: head, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: label, htmlFor: "aitoearn-base-url", children: t("baseUrl") }) }),
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
207
|
+
"input",
|
|
208
|
+
{
|
|
209
|
+
id: "aitoearn-base-url",
|
|
210
|
+
className: input,
|
|
211
|
+
type: "text",
|
|
212
|
+
value: state.baseUrl,
|
|
213
|
+
placeholder: "https://example.com",
|
|
214
|
+
disabled,
|
|
215
|
+
onChange: (event) => {
|
|
216
|
+
props.edit("baseUrl", event.currentTarget.value);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
),
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: hint, children: t("baseUrlHint") })
|
|
221
|
+
] }) : null,
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: field, children: [
|
|
223
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: head, children: [
|
|
224
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: label, htmlFor: "aitoearn-api-key", children: t("apiKey") }),
|
|
225
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: badges, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Tag, { tone: state.apiKeyConfigured ? "neutral" : "quiet", children: state.apiKeyConfigured ? t("apiKeySet") : t("apiKeyUnset") }) })
|
|
226
|
+
] }),
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
228
|
+
"input",
|
|
229
|
+
{
|
|
230
|
+
id: "aitoearn-api-key",
|
|
231
|
+
className: input,
|
|
232
|
+
type: "password",
|
|
233
|
+
autoComplete: "off",
|
|
234
|
+
value: state.apiKey,
|
|
235
|
+
disabled,
|
|
236
|
+
onChange: (event) => {
|
|
237
|
+
props.edit("apiKey", event.currentTarget.value);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: hint, children: t("apiKeyHint") })
|
|
242
|
+
] }),
|
|
243
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: footer, children: [
|
|
244
|
+
state.failed ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: failed, role: "status", children: t("saveFailed") }) : null,
|
|
245
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
246
|
+
"button",
|
|
247
|
+
{
|
|
248
|
+
type: "button",
|
|
249
|
+
className: discard,
|
|
250
|
+
disabled: !state.dirty || state.saving,
|
|
251
|
+
onClick: props.discard,
|
|
252
|
+
children: t("discard")
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
256
|
+
"button",
|
|
257
|
+
{
|
|
258
|
+
type: "button",
|
|
259
|
+
className: save,
|
|
260
|
+
disabled: blocked,
|
|
261
|
+
onClick: props.save,
|
|
262
|
+
children: t(state.saving ? "saving" : "save")
|
|
263
|
+
}
|
|
264
|
+
)
|
|
265
|
+
] })
|
|
266
|
+
] }) : null
|
|
267
|
+
] });
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// src/dsh/client/card-store.ts
|
|
271
|
+
var import_dsh_client_store = require("@deepseek-ai/dsh-client-store");
|
|
272
|
+
function createAitoearnCardFace(scope, describe) {
|
|
273
|
+
let draft = {};
|
|
274
|
+
let saving = false;
|
|
275
|
+
let failed2 = false;
|
|
276
|
+
const store = (0, import_dsh_client_store.createSnapshotStore)(project());
|
|
277
|
+
function stored() {
|
|
278
|
+
return scope.getSnapshot().value ?? {};
|
|
279
|
+
}
|
|
280
|
+
function apiKeyConfigured() {
|
|
281
|
+
const view = describe.getSnapshot().view;
|
|
282
|
+
const section = view?.namespaces.find((candidate) => candidate.ns === SETTINGS_NAMESPACE);
|
|
283
|
+
return section?.secrets.some((secret) => secret.path.length === 1 && secret.path[0] === "apiKey" && secret.set) ?? false;
|
|
284
|
+
}
|
|
285
|
+
function pendingWrites() {
|
|
286
|
+
const value = stored();
|
|
287
|
+
const writes = [];
|
|
288
|
+
const environment = draft.environment ?? resolveEnvironment(value.environment);
|
|
289
|
+
if (draft.environment !== void 0 && environment !== resolveEnvironment(value.environment))
|
|
290
|
+
writes.push("environment");
|
|
291
|
+
if (draft.apiKey !== void 0 && draft.apiKey.trim() !== "")
|
|
292
|
+
writes.push("apiKey");
|
|
293
|
+
if (draft.baseUrl !== void 0 && environment === "custom" && draft.baseUrl !== (value.baseUrl ?? ""))
|
|
294
|
+
writes.push("baseUrl");
|
|
295
|
+
if (environment !== "custom" && value.baseUrl !== void 0)
|
|
296
|
+
writes.push("baseUrl");
|
|
297
|
+
return writes;
|
|
298
|
+
}
|
|
299
|
+
function project() {
|
|
300
|
+
const snapshot = scope.getSnapshot();
|
|
301
|
+
const value = stored();
|
|
302
|
+
return {
|
|
303
|
+
available: snapshot.status === "ready",
|
|
304
|
+
writable: snapshot.writable,
|
|
305
|
+
dirty: pendingWrites().length > 0,
|
|
306
|
+
saving,
|
|
307
|
+
failed: failed2,
|
|
308
|
+
environment: draft.environment ?? resolveEnvironment(value.environment),
|
|
309
|
+
baseUrl: draft.baseUrl ?? value.baseUrl ?? "",
|
|
310
|
+
apiKey: draft.apiKey ?? "",
|
|
311
|
+
apiKeyConfigured: apiKeyConfigured()
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
const publish = () => {
|
|
315
|
+
store.set(project());
|
|
316
|
+
};
|
|
317
|
+
async function commit() {
|
|
318
|
+
const snapshot = scope.getSnapshot();
|
|
319
|
+
const writes = pendingWrites();
|
|
320
|
+
if (saving || snapshot.status !== "ready" || !snapshot.writable || writes.length === 0)
|
|
321
|
+
return;
|
|
322
|
+
const value = stored();
|
|
323
|
+
const environment = draft.environment ?? resolveEnvironment(value.environment);
|
|
324
|
+
const baseUrl = draft.baseUrl ?? value.baseUrl ?? "";
|
|
325
|
+
const apiKey = draft.apiKey?.trim() ?? "";
|
|
326
|
+
saving = true;
|
|
327
|
+
failed2 = false;
|
|
328
|
+
publish();
|
|
329
|
+
try {
|
|
330
|
+
if (writes.includes("environment"))
|
|
331
|
+
await scope.set("environment", environment);
|
|
332
|
+
if (writes.includes("apiKey"))
|
|
333
|
+
await scope.set("apiKey", apiKey);
|
|
334
|
+
if (writes.includes("baseUrl")) {
|
|
335
|
+
if (environment === "custom")
|
|
336
|
+
await scope.set("baseUrl", baseUrl);
|
|
337
|
+
else
|
|
338
|
+
await scope.unset("baseUrl");
|
|
339
|
+
}
|
|
340
|
+
} catch {
|
|
341
|
+
saving = false;
|
|
342
|
+
failed2 = true;
|
|
343
|
+
publish();
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
const landed = (writes.includes("environment") ? resolveEnvironment(stored().environment) === environment : true) && (writes.includes("apiKey") ? apiKeyConfigured() : true) && (writes.includes("baseUrl") ? environment === "custom" ? (stored().baseUrl ?? "") === baseUrl : stored().baseUrl === void 0 : true);
|
|
347
|
+
saving = false;
|
|
348
|
+
if (landed)
|
|
349
|
+
draft = {};
|
|
350
|
+
else
|
|
351
|
+
failed2 = true;
|
|
352
|
+
publish();
|
|
353
|
+
}
|
|
354
|
+
scope.subscribe(publish);
|
|
355
|
+
describe.subscribe(publish);
|
|
356
|
+
void describe.ensure();
|
|
357
|
+
return {
|
|
358
|
+
hooks: { aitoearnCard: store },
|
|
359
|
+
edit: (field2, value) => {
|
|
360
|
+
if (saving)
|
|
361
|
+
return;
|
|
362
|
+
failed2 = false;
|
|
363
|
+
if (field2 === "environment") {
|
|
364
|
+
const environment = resolveEnvironment(value);
|
|
365
|
+
draft = environment === "custom" ? { ...draft, environment } : { ...draft, environment, baseUrl: void 0 };
|
|
366
|
+
} else {
|
|
367
|
+
draft = { ...draft, [field2]: value };
|
|
368
|
+
}
|
|
369
|
+
publish();
|
|
370
|
+
},
|
|
371
|
+
save: () => commit(),
|
|
372
|
+
discard: () => {
|
|
373
|
+
draft = {};
|
|
374
|
+
failed2 = false;
|
|
375
|
+
publish();
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// src/dsh/client/i18n.ts
|
|
381
|
+
var aitoearnCardNS = "aitoearn-card";
|
|
382
|
+
var aitoearnCardLocales = {
|
|
383
|
+
zh: {
|
|
384
|
+
title: "Aitoearn",
|
|
385
|
+
description: "Aitoearn \u5DE5\u5177\u7684\u8FD0\u884C\u73AF\u5883\u4E0E API Key\u3002",
|
|
386
|
+
environment: "\u8FD0\u884C\u73AF\u5883",
|
|
387
|
+
envGlobal: "\u56FD\u9645\u7AD9 aitoearn.ai",
|
|
388
|
+
envCn: "\u4E2D\u56FD\u7AD9 aitoearn.cn",
|
|
389
|
+
envCustom: "\u81EA\u5B9A\u4E49",
|
|
390
|
+
baseUrl: "\u63A5\u53E3\u5730\u5740",
|
|
391
|
+
baseUrlHint: "\u7559\u7A7A\u5219\u4F7F\u7528\u6240\u9009\u73AF\u5883\u9ED8\u8BA4\u5730\u5740\u3002",
|
|
392
|
+
apiKey: "API Key",
|
|
393
|
+
apiKeySet: "\u5DF2\u914D\u7F6E\u5BC6\u94A5\u3002",
|
|
394
|
+
apiKeyUnset: "\u672A\u914D\u7F6E\u5BC6\u94A5\uFF1B\u914D\u7F6E\u4E4B\u524D Aitoearn \u5DE5\u5177\u4E0D\u53EF\u7528\u3002",
|
|
395
|
+
apiKeyHint: "\u51FA\u4E8E\u5B89\u5168\u8003\u8651\u5BC6\u94A5\u4E0D\u4F1A\u56DE\u663E\uFF1B\u7559\u7A7A\u8868\u793A\u4FDD\u6301\u5F53\u524D\u5BC6\u94A5\uFF0C\u8F93\u5165\u65B0\u503C\u5C06\u8986\u76D6\u3002",
|
|
396
|
+
expand: "\u5C55\u5F00\u8BBE\u7F6E",
|
|
397
|
+
collapse: "\u6536\u8D77\u8BBE\u7F6E",
|
|
398
|
+
save: "\u4FDD\u5B58",
|
|
399
|
+
saving: "\u4FDD\u5B58\u4E2D\u2026",
|
|
400
|
+
discard: "\u653E\u5F03\u4FEE\u6539",
|
|
401
|
+
unsaved: "\u672A\u4FDD\u5B58",
|
|
402
|
+
saveFailed: "\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",
|
|
403
|
+
readOnly: "\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002"
|
|
404
|
+
},
|
|
405
|
+
en: {
|
|
406
|
+
title: "Aitoearn",
|
|
407
|
+
description: "Environment and API key for Aitoearn tools.",
|
|
408
|
+
environment: "Environment",
|
|
409
|
+
envGlobal: "Global (aitoearn.ai)",
|
|
410
|
+
envCn: "China (aitoearn.cn)",
|
|
411
|
+
envCustom: "Custom",
|
|
412
|
+
baseUrl: "Base URL",
|
|
413
|
+
baseUrlHint: "Leave blank to use the selected environment default.",
|
|
414
|
+
apiKey: "API key",
|
|
415
|
+
apiKeySet: "A key is configured.",
|
|
416
|
+
apiKeyUnset: "No key is configured; Aitoearn tools are unavailable until one is.",
|
|
417
|
+
apiKeyHint: "The key is never displayed back; leave blank to keep the current key, or type a new one to overwrite it.",
|
|
418
|
+
expand: "Show settings",
|
|
419
|
+
collapse: "Hide settings",
|
|
420
|
+
save: "Save",
|
|
421
|
+
saving: "Saving\u2026",
|
|
422
|
+
discard: "Discard",
|
|
423
|
+
unsaved: "Unsaved",
|
|
424
|
+
saveFailed: "The deployment did not accept these values; they were left for you to correct.",
|
|
425
|
+
readOnly: "This deployment stores settings read-only."
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
// src/dsh/client/index.ts
|
|
430
|
+
var name2 = "aitoearn-settings-card";
|
|
431
|
+
var inject = ["slots", "locale", "settingsScope"];
|
|
432
|
+
function apply(ctx) {
|
|
433
|
+
ctx.effect(
|
|
434
|
+
() => ctx.locale.register(aitoearnCardNS, aitoearnCardLocales),
|
|
435
|
+
"aitoearn-settings-card: dictionaries"
|
|
436
|
+
);
|
|
437
|
+
const scope = ctx.settingsScope.bind({
|
|
438
|
+
namespace: "aitoearn",
|
|
439
|
+
decode: (section) => pluginConfigFromSettings(section)
|
|
440
|
+
});
|
|
441
|
+
const face = createAitoearnCardFace(scope, ctx.settingsScope.describe());
|
|
442
|
+
ctx.slots.inject("settings.plugin.item", () => ctx.slots.register(
|
|
443
|
+
{
|
|
444
|
+
name: "settings.plugin.item",
|
|
445
|
+
key: "aitoearn",
|
|
446
|
+
locale: aitoearnCardNS,
|
|
447
|
+
inject: () => face
|
|
448
|
+
},
|
|
449
|
+
AitoearnCard
|
|
450
|
+
));
|
|
451
|
+
}
|
|
452
|
+
return module.exports; } });
|
|
453
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../tools/agent-plugin/src/dsh/client/index.ts", "../../../../../tools/agent-plugin/src/dsh/auth.ts", "../../../../../tools/agent-plugin/src/dsh/client/AitoearnCard.tsx", "../../../../../tools/agent-plugin/src/dsh/client/card.css.ts", "../../../../../tools/agent-plugin/src/dsh/client/card-store.ts", "../../../../../tools/agent-plugin/src/dsh/client/i18n.ts"],
|
|
4
|
+
"sourcesContent": ["import { Context } from '@deepseek-ai/cordis'\nimport { AitoearnPluginConfig, pluginConfigFromSettings } from '../auth.js'\nimport { AitoearnCard } from './AitoearnCard.js'\nimport { createAitoearnCardFace } from './card-store.js'\nimport { aitoearnCardLocales, aitoearnCardNS } from './i18n.js'\n\nexport const name = 'aitoearn-settings-card'\nexport const inject = ['slots', 'locale', 'settingsScope']\n\nexport function apply(ctx: Context): void {\n ctx.effect(\n () => ctx.locale.register(aitoearnCardNS, aitoearnCardLocales),\n 'aitoearn-settings-card: dictionaries',\n )\n const scope = ctx.settingsScope.bind<AitoearnPluginConfig>({\n namespace: 'aitoearn',\n decode: section => pluginConfigFromSettings(section),\n })\n const face = createAitoearnCardFace(scope, ctx.settingsScope.describe())\n ctx.slots.inject('settings.plugin.item', () =>\n ctx.slots.register(\n {\n name: 'settings.plugin.item',\n key: 'aitoearn',\n locale: aitoearnCardNS,\n inject: () => face,\n },\n AitoearnCard,\n ))\n}\n", "export const MCP_PATH = '/api/ai/agent/mcp'\nexport const API_KEY_ENV = 'AITOEARN_API_KEY'\nexport const DEFAULT_ENVIRONMENT = 'global'\nexport const SETTINGS_NAMESPACE = 'aitoearn'\n\nexport const ENVIRONMENT_ORIGINS = {\n global: 'https://aitoearn.ai',\n cn: 'https://aitoearn.cn',\n} as const\n\nexport const DEFAULT_MCP_URL = `${ENVIRONMENT_ORIGINS.global}${MCP_PATH}`\n\nexport type AitoearnEnvironment = 'global' | 'cn' | 'custom'\n\nexport interface AitoearnAuth {\n mcpUrl: string\n apiKey: string\n}\n\nexport interface AitoearnPluginConfig {\n environment?: string\n baseUrl?: string\n apiKey?: string\n}\n\nexport function pluginConfigFromSettings(\n section: unknown,\n fallback: AitoearnPluginConfig = {},\n): AitoearnPluginConfig {\n if (section === null || typeof section !== 'object' || Array.isArray(section))\n return fallback\n const record = section as Record<string, unknown>\n return {\n ...fallback,\n ...(typeof record['environment'] === 'string' ? { environment: record['environment'] } : {}),\n ...(typeof record['baseUrl'] === 'string' ? { baseUrl: record['baseUrl'] } : {}),\n ...(typeof record['apiKey'] === 'string' ? { apiKey: record['apiKey'] } : {}),\n }\n}\n\nexport function resolveEnvironment(value: string | undefined): AitoearnEnvironment {\n if (value === 'cn' || value === 'custom' || value === 'global')\n return value\n return DEFAULT_ENVIRONMENT\n}\n\nexport function resolveOrigin(environment: AitoearnEnvironment, baseUrl?: string): string {\n if (environment !== 'custom')\n return ENVIRONMENT_ORIGINS[environment]\n const trimmed = baseUrl?.trim() ?? ''\n if (trimmed.length === 0)\n return ''\n try {\n const url = new URL(trimmed)\n if (url.protocol !== 'http:' && url.protocol !== 'https:')\n return ''\n return url.origin\n }\n catch {\n return ''\n }\n}\n\nexport function resolveMcpUrl(config: AitoearnPluginConfig): string {\n const environment = resolveEnvironment(config.environment)\n const origin = resolveOrigin(environment, config.baseUrl)\n if (origin.length === 0)\n return ''\n return `${origin}${MCP_PATH}`\n}\n\nexport function resolveAuth(\n config: AitoearnPluginConfig,\n env: NodeJS.ProcessEnv = process.env,\n): AitoearnAuth {\n return {\n mcpUrl: resolveMcpUrl(config),\n apiKey: config.apiKey?.trim() || env[API_KEY_ENV]?.trim() || '',\n }\n}\n\nexport function authorizationHeader(apiKey: string): Record<string, string> {\n if (apiKey.length === 0)\n return {}\n return { Authorization: `Bearer ${apiKey}` }\n}\n", "import { IconChevronDownOutline14, Tag } from '@deepseek-ai/dsh-client-ui-primitives'\nimport { SnapshotSelectorHook, TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport { useEffect, useRef, useState } from 'react'\nimport { AitoearnEnvironment } from '../auth.js'\nimport { AitoearnCardState } from './card-store.js'\nimport * as css from './card.css.js'\nimport { AitoearnCardLocaleKey } from './i18n.js'\n\nexport interface AitoearnCardProps {\n t: TranslateNS<'aitoearn-card'>\n useAitoearnCard: SnapshotSelectorHook<AitoearnCardState>\n edit: (field: 'environment' | 'baseUrl' | 'apiKey', value: string) => void\n save: () => void\n discard: () => void\n}\n\nconst cx = (names: Array<string | false | undefined>): string => names.filter(Boolean).join(' ')\n\nconst ENVIRONMENT_OPTIONS: Array<{ value: AitoearnEnvironment, labelKey: AitoearnCardLocaleKey }> = [\n { value: 'global', labelKey: 'envGlobal' },\n { value: 'cn', labelKey: 'envCn' },\n { value: 'custom', labelKey: 'envCustom' },\n]\n\n/**\n * The Aitoearn plugin settings card, laid out after the official plugin cards:\n * a header naming the plugin, its fields in place, and the footer that writes\n * the staged edits.\n */\nexport function AitoearnCard(props: AitoearnCardProps) {\n const { t } = props\n const state = props.useAitoearnCard(snapshot => snapshot)\n const [open, setOpen] = useState(false)\n const saveStarted = useRef(false)\n useEffect(() => {\n if (state.saving) {\n saveStarted.current = true\n return\n }\n if (!saveStarted.current)\n return\n saveStarted.current = false\n if (!state.dirty && !state.failed)\n setOpen(false)\n }, [state.dirty, state.failed, state.saving])\n if (!state.available)\n return null\n const disabled = !state.writable\n const blocked = !state.dirty || state.saving\n return (\n <li className={cx([css.card, open && css.cardOpen])}>\n <button\n type=\"button\"\n className={css.header}\n aria-expanded={open}\n aria-label={`${t(open ? 'collapse' : 'expand')}: ${t('title')}`}\n onClick={() => {\n setOpen(!open)\n }}\n >\n <span className={css.headText}>\n <span className={css.name}>{t('title')}</span>\n <span className={css.description}>{t('description')}</span>\n </span>\n {state.dirty ? <Tag tone=\"neutral\" className={css.pending}>{t('unsaved')}</Tag> : null}\n <IconChevronDownOutline14 className={cx([css.chevron, open && css.chevronOpen])} />\n </button>\n {open\n ? (\n <div className={css.body}>\n {!state.writable ? <p className={css.readOnly} role=\"status\">{t('readOnly')}</p> : null}\n <div className={css.field}>\n <div className={css.head}>\n <span className={css.label} id=\"aitoearn-environment-label\">{t('environment')}</span>\n </div>\n <div className={css.envGroup} role=\"radiogroup\" aria-labelledby=\"aitoearn-environment-label\">\n {ENVIRONMENT_OPTIONS.map(option => (\n <button\n key={option.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={state.environment === option.value}\n className={cx([css.envPill, state.environment === option.value && css.envPillActive])}\n disabled={disabled}\n onClick={() => {\n props.edit('environment', option.value)\n }}\n >\n {t(option.labelKey)}\n </button>\n ))}\n </div>\n </div>\n {state.environment === 'custom'\n ? (\n <div className={css.field}>\n <div className={css.head}>\n <label className={css.label} htmlFor=\"aitoearn-base-url\">{t('baseUrl')}</label>\n </div>\n <input\n id=\"aitoearn-base-url\"\n className={css.input}\n type=\"text\"\n value={state.baseUrl}\n placeholder=\"https://example.com\"\n disabled={disabled}\n onChange={(event) => {\n props.edit('baseUrl', event.currentTarget.value)\n }}\n />\n <p className={css.hint}>{t('baseUrlHint')}</p>\n </div>\n )\n : null}\n <div className={css.field}>\n <div className={css.head}>\n <label className={css.label} htmlFor=\"aitoearn-api-key\">{t('apiKey')}</label>\n <span className={css.badges}>\n <Tag tone={state.apiKeyConfigured ? 'neutral' : 'quiet'}>\n {state.apiKeyConfigured ? t('apiKeySet') : t('apiKeyUnset')}\n </Tag>\n </span>\n </div>\n <input\n id=\"aitoearn-api-key\"\n className={css.input}\n type=\"password\"\n autoComplete=\"off\"\n value={state.apiKey}\n disabled={disabled}\n onChange={(event) => {\n props.edit('apiKey', event.currentTarget.value)\n }}\n />\n <p className={css.hint}>{t('apiKeyHint')}</p>\n </div>\n <div className={css.footer}>\n {state.failed ? <p className={css.failed} role=\"status\">{t('saveFailed')}</p> : null}\n <button\n type=\"button\"\n className={css.discard}\n disabled={!state.dirty || state.saving}\n onClick={props.discard}\n >\n {t('discard')}\n </button>\n <button\n type=\"button\"\n className={css.save}\n disabled={blocked}\n onClick={props.save}\n >\n {t(state.saving ? 'saving' : 'save')}\n </button>\n </div>\n </div>\n )\n : null}\n </li>\n )\n}\n", "/**\n * Card styles for the Aitoearn plugin settings card. Values mirror the\n * official `PluginCard` / field styling in `@deepseek-ai/dsh-client-ui-settings-plugins`\n * so the card reads like the Bash / Agent loop / Web search cards. Everything is\n * token-styled through `--dsw-alias-*`; the sheet self-injects once, the same\n * `style[data-plugin-css]` way the official client packages do.\n */\n\nconst CARD_CSS = `\n.Ata_card{border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-3);border-radius:16px;list-style:none;transition:border-color .16s,background .16s}\n.Ata_card:hover{border-color:var(--dsw-alias-label-dimmed)}\n.Ata_cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed)}\n.Ata_header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}\n.Ata_header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}\n.Ata_headText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}\n.Ata_name{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}\n.Ata_description{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:1.5}\n.Ata_pending{flex:none}\n.Ata_chevron{color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .16s}\n.Ata_chevronOpen{transform:rotate(180deg)}\n.Ata_body{border-top:.5px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}\n.Ata_readOnly{color:var(--dsw-alias-label-tertiary);margin:12px 0 0;font-size:12px;line-height:1.5}\n.Ata_footer{border-top:.5px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}\n.Ata_failed{min-width:0;color:var(--dsw-alias-label-error);flex:1;margin:0;font-size:12px;line-height:1.5}\n.Ata_discard,.Ata_save{appearance:none;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;transition:background .16s,border-color .16s,color .16s}\n.Ata_discard{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}\n.Ata_discard:hover:not(:disabled){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}\n.Ata_discard:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}\n.Ata_save{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3)}\n.Ata_discard:disabled,.Ata_save:disabled{opacity:.4;cursor:default}\n.Ata_discard:focus-visible,.Ata_save:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}\n.Ata_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}\n.Ata_field+.Ata_field{border-top:.5px solid var(--dsw-alias-border-l2)}\n.Ata_head{align-items:center;gap:8px;display:flex}\n.Ata_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}\n.Ata_badges{align-items:center;gap:8px;display:inline-flex}\n.Ata_input{border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}\n.Ata_input:focus-visible{border-color:var(--dsw-alias-brand-primary);outline:none}\n.Ata_input:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}\n.Ata_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}\n.Ata_envGroup{flex-wrap:wrap;gap:8px;display:flex}\n.Ata_envPill{appearance:none;font:inherit;cursor:pointer;border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary);border-radius:999px;padding:5px 14px;font-size:13px;line-height:1.5;transition:background .16s,border-color .16s,color .16s}\n.Ata_envPill:hover:not(:disabled):not(.Ata_envPillActive){color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}\n.Ata_envPill:active:not(:disabled){background:var(--dsw-alias-bg-layer-4)}\n.Ata_envPill:disabled{opacity:.4;cursor:not-allowed}\n.Ata_envPill:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}\n.Ata_envPillActive{border-color:var(--dsw-alias-brand-primary);color:var(--dsw-alias-brand-primary)}\n`\n\nconst STYLE_TAG_ID = '@aitoearn/dsh-plugin/card.css'\n\nif (typeof document !== 'undefined' && document.querySelector(`style[data-plugin-css=\"${STYLE_TAG_ID}\"]`) === null) {\n const tag = document.createElement('style')\n tag.dataset['plugin'] = '@aitoearn/dsh-plugin'\n tag.dataset['pluginCss'] = STYLE_TAG_ID\n tag.textContent = CARD_CSS\n document.head.appendChild(tag)\n}\n\nexport const card = 'Ata_card'\nexport const cardOpen = 'Ata_cardOpen'\nexport const header = 'Ata_header'\nexport const headText = 'Ata_headText'\nexport const name = 'Ata_name'\nexport const description = 'Ata_description'\nexport const pending = 'Ata_pending'\nexport const chevron = 'Ata_chevron'\nexport const chevronOpen = 'Ata_chevronOpen'\nexport const body = 'Ata_body'\nexport const readOnly = 'Ata_readOnly'\nexport const footer = 'Ata_footer'\nexport const failed = 'Ata_failed'\nexport const discard = 'Ata_discard'\nexport const save = 'Ata_save'\nexport const field = 'Ata_field'\nexport const head = 'Ata_head'\nexport const label = 'Ata_label'\nexport const badges = 'Ata_badges'\nexport const input = 'Ata_input'\nexport const hint = 'Ata_hint'\nexport const envGroup = 'Ata_envGroup'\nexport const envPill = 'Ata_envPill'\nexport const envPillActive = 'Ata_envPillActive'\n", "import { createSnapshotStore, SnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport { SettingsDescribeFace, SettingsScope } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport { AitoearnEnvironment, AitoearnPluginConfig, resolveEnvironment, SETTINGS_NAMESPACE } from '../auth.js'\n\nexport type AitoearnCardField = 'environment' | 'baseUrl' | 'apiKey'\n\nexport interface AitoearnCardState {\n available: boolean\n writable: boolean\n dirty: boolean\n saving: boolean\n failed: boolean\n environment: AitoearnEnvironment\n baseUrl: string\n apiKey: string\n apiKeyConfigured: boolean\n}\n\nexport interface AitoearnCardFace {\n hooks: { aitoearnCard: SnapshotStore<AitoearnCardState> }\n edit: (field: AitoearnCardField, value: string) => void\n save: () => void\n discard: () => void\n}\n\n/** Staged edits over the card's fields; an absent field inherits the section. */\ninterface CardDraft {\n environment?: AitoearnEnvironment\n baseUrl?: string\n apiKey?: string\n}\n\ntype PendingWrite = 'environment' | 'apiKey' | 'baseUrl'\n\n/** One schema-declared secret slot in the namespace view (`SettingsSecretView`). */\ninterface SecretSlot {\n path: string[]\n set: boolean\n}\n\n/**\n * Bridges the `aitoearn` settings scope onto the card's staged form. Edits stay\n * local drafts until `save` writes them in one gesture; a save that did not land\n * keeps its drafts so the user can correct them instead of retyping.\n *\n * The API key is a schema-declared secret: the Host redacts it from every view\n * it serves, so the key can never be read back and the input starts blank. A\n * blank draft keeps the stored key, and whether one is configured comes from\n * the namespace view's secret record.\n */\nexport function createAitoearnCardFace(scope: SettingsScope<AitoearnPluginConfig>, describe: SettingsDescribeFace): AitoearnCardFace {\n let draft: CardDraft = {}\n let saving = false\n let failed = false\n const store = createSnapshotStore<AitoearnCardState>(project())\n\n function stored(): AitoearnPluginConfig {\n return scope.getSnapshot().value ?? {}\n }\n\n function apiKeyConfigured(): boolean {\n const view = describe.getSnapshot().view\n const section = view?.namespaces.find(candidate => candidate.ns === SETTINGS_NAMESPACE)\n return section?.secrets.some((secret: SecretSlot) => secret.path.length === 1 && secret.path[0] === 'apiKey' && secret.set) ?? false\n }\n\n function pendingWrites(): PendingWrite[] {\n const value = stored()\n const writes: PendingWrite[] = []\n const environment = draft.environment ?? resolveEnvironment(value.environment)\n if (draft.environment !== undefined && environment !== resolveEnvironment(value.environment))\n writes.push('environment')\n if (draft.apiKey !== undefined && draft.apiKey.trim() !== '')\n writes.push('apiKey')\n if (draft.baseUrl !== undefined && environment === 'custom' && draft.baseUrl !== (value.baseUrl ?? ''))\n writes.push('baseUrl')\n if (environment !== 'custom' && value.baseUrl !== undefined)\n writes.push('baseUrl')\n return writes\n }\n\n function project(): AitoearnCardState {\n const snapshot = scope.getSnapshot()\n const value = stored()\n return {\n available: snapshot.status === 'ready',\n writable: snapshot.writable,\n dirty: pendingWrites().length > 0,\n saving,\n failed,\n environment: draft.environment ?? resolveEnvironment(value.environment),\n baseUrl: draft.baseUrl ?? value.baseUrl ?? '',\n apiKey: draft.apiKey ?? '',\n apiKeyConfigured: apiKeyConfigured(),\n }\n }\n\n const publish = () => {\n store.set(project())\n }\n\n async function commit(): Promise<void> {\n const snapshot = scope.getSnapshot()\n const writes = pendingWrites()\n if (saving || snapshot.status !== 'ready' || !snapshot.writable || writes.length === 0)\n return\n const value = stored()\n const environment = draft.environment ?? resolveEnvironment(value.environment)\n const baseUrl = draft.baseUrl ?? value.baseUrl ?? ''\n const apiKey = draft.apiKey?.trim() ?? ''\n saving = true\n failed = false\n publish()\n try {\n if (writes.includes('environment'))\n await scope.set('environment', environment)\n if (writes.includes('apiKey'))\n await scope.set('apiKey', apiKey)\n if (writes.includes('baseUrl')) {\n if (environment === 'custom')\n await scope.set('baseUrl', baseUrl)\n else\n await scope.unset('baseUrl')\n }\n }\n catch {\n // A rejected write keeps the drafts on screen (with the failure flag) so\n // the user can correct them instead of retyping.\n saving = false\n failed = true\n publish()\n return\n }\n const landed = (writes.includes('environment') ? resolveEnvironment(stored().environment) === environment : true)\n && (writes.includes('apiKey') ? apiKeyConfigured() : true)\n && (writes.includes('baseUrl')\n ? (environment === 'custom' ? (stored().baseUrl ?? '') === baseUrl : stored().baseUrl === undefined)\n : true)\n saving = false\n if (landed)\n draft = {}\n else\n failed = true\n publish()\n }\n\n scope.subscribe(publish)\n describe.subscribe(publish)\n void describe.ensure()\n\n return {\n hooks: { aitoearnCard: store },\n edit: (field, value) => {\n if (saving)\n return\n failed = false\n if (field === 'environment') {\n const environment = resolveEnvironment(value)\n draft = environment === 'custom'\n ? { ...draft, environment }\n : { ...draft, environment, baseUrl: undefined }\n }\n else {\n draft = { ...draft, [field]: value }\n }\n publish()\n },\n save: () => commit(),\n discard: () => {\n draft = {}\n failed = false\n publish()\n },\n }\n}\n", "/** Locale dictionary for the Aitoearn plugin settings card. */\n\nexport const aitoearnCardNS = 'aitoearn-card'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** The Aitoearn plugin card's copy. */\n 'aitoearn-card': keyof typeof aitoearnCardLocales.zh\n }\n}\n\nexport type AitoearnCardLocaleKey = keyof typeof aitoearnCardLocales.zh\n\nexport const aitoearnCardLocales = {\n zh: {\n title: 'Aitoearn',\n description: 'Aitoearn \u5DE5\u5177\u7684\u8FD0\u884C\u73AF\u5883\u4E0E API Key\u3002',\n environment: '\u8FD0\u884C\u73AF\u5883',\n envGlobal: '\u56FD\u9645\u7AD9 aitoearn.ai',\n envCn: '\u4E2D\u56FD\u7AD9 aitoearn.cn',\n envCustom: '\u81EA\u5B9A\u4E49',\n baseUrl: '\u63A5\u53E3\u5730\u5740',\n baseUrlHint: '\u7559\u7A7A\u5219\u4F7F\u7528\u6240\u9009\u73AF\u5883\u9ED8\u8BA4\u5730\u5740\u3002',\n apiKey: 'API Key',\n apiKeySet: '\u5DF2\u914D\u7F6E\u5BC6\u94A5\u3002',\n apiKeyUnset: '\u672A\u914D\u7F6E\u5BC6\u94A5\uFF1B\u914D\u7F6E\u4E4B\u524D Aitoearn \u5DE5\u5177\u4E0D\u53EF\u7528\u3002',\n apiKeyHint: '\u51FA\u4E8E\u5B89\u5168\u8003\u8651\u5BC6\u94A5\u4E0D\u4F1A\u56DE\u663E\uFF1B\u7559\u7A7A\u8868\u793A\u4FDD\u6301\u5F53\u524D\u5BC6\u94A5\uFF0C\u8F93\u5165\u65B0\u503C\u5C06\u8986\u76D6\u3002',\n expand: '\u5C55\u5F00\u8BBE\u7F6E',\n collapse: '\u6536\u8D77\u8BBE\u7F6E',\n save: '\u4FDD\u5B58',\n saving: '\u4FDD\u5B58\u4E2D\u2026',\n discard: '\u653E\u5F03\u4FEE\u6539',\n unsaved: '\u672A\u4FDD\u5B58',\n saveFailed: '\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002',\n readOnly: '\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002',\n },\n en: {\n title: 'Aitoearn',\n description: 'Environment and API key for Aitoearn tools.',\n environment: 'Environment',\n envGlobal: 'Global (aitoearn.ai)',\n envCn: 'China (aitoearn.cn)',\n envCustom: 'Custom',\n baseUrl: 'Base URL',\n baseUrlHint: 'Leave blank to use the selected environment default.',\n apiKey: 'API key',\n apiKeySet: 'A key is configured.',\n apiKeyUnset: 'No key is configured; Aitoearn tools are unavailable until one is.',\n apiKeyHint: 'The key is never displayed back; leave blank to keep the current key, or type a new one to overwrite it.',\n expand: 'Show settings',\n collapse: 'Hide settings',\n save: 'Save',\n saving: 'Saving\u2026',\n discard: 'Discard',\n unsaved: 'Unsaved',\n saveFailed: 'The deployment did not accept these values; they were left for you to correct.',\n readOnly: 'This deployment stores sett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