@co0ontty/wand 4.104.2-beta.376.1.gc08b7b3 → 4.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +4 -4
- package/dist/provider-catalog.d.ts +2 -7
- package/dist/provider-catalog.js +13 -7
- package/dist/server-workspace-routes.js +12 -27
- package/dist/structured-provider-common.d.ts +1 -1
- package/dist/structured-provider-common.js +4 -27
- package/dist/task-comment-dispatch.js +0 -3
- package/dist/web-ui/content/login.js +4 -4
- package/dist/web-ui/content/module-manifest.json +1 -1
- package/dist/web-ui/content/modules/{58866143a3365521 → 0341f0d00f88a16f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{91ee32135a3582b0 → 0567e161e2cca41e}/chunk.js +1 -1
- package/dist/web-ui/content/modules/069f5a4267b0a9e3/runtime.js +279 -0
- package/dist/web-ui/content/modules/{2afbc201474adacc → 084dca1ea52bf38e}/login-visual.js +1 -1
- package/dist/web-ui/content/modules/0d62c22b7aed5f1f/host-bridge.js +1 -0
- package/dist/web-ui/content/modules/{30169d15cea782f0 → 0d7f7d954382dc42}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3d10e3f6f6f92b55 → 0da28408ec089cf7}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{57d68f0a47e8fd7c → 130e8905cc7f639c}/toast-region.js +1 -1
- package/dist/web-ui/content/modules/{79b0c18f2bf35740 → 186d6e3b44a3c539}/host.js +1 -1
- package/dist/web-ui/content/modules/{d7b540917fb90755 → 1870280f0e783c62}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3bd3c84c4257ba0d → 1a0b5db535599f72}/chunk.js +1 -1
- package/dist/web-ui/content/modules/1cf252d2f64a6279/chunk.js +7 -0
- package/dist/web-ui/content/modules/1d1dc0fd8a0210aa/composer-surface-adapter.js +1 -0
- package/dist/web-ui/content/modules/{907dcf0ea5b5f23f → 2061d4a88875b9f9}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{2a47853ca7752c1f → 22497085d7cdd83b}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{12e91deb96ace24d → 23f15023aa2279a3}/shell-file-panel-drawer.js +1 -1
- package/dist/web-ui/content/modules/{15279373f0e1461f → 2cab58e5d148844c}/host.js +1 -1
- package/dist/web-ui/content/modules/{6b0bafa239dfe4e2 → 32edeb64dbf339f6}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{e01769df89873feb → 33daaeb4bf68c7ba}/chunk.js +1 -1
- package/dist/web-ui/content/modules/37da177222b6308d/workspaces-panel.js +4 -0
- package/dist/web-ui/content/modules/3af7facf8a7588c7/chunk.js +1 -0
- package/dist/web-ui/content/modules/3b95dc1376e932ea/host.js +1 -0
- package/dist/web-ui/content/modules/{a685793c5d9b90d1 → 3cbbad48df7998f8}/chunk.js +1 -1
- package/dist/web-ui/content/modules/41cf79c899bc83c8/host.js +1 -0
- package/dist/web-ui/content/modules/{bb59e8cb4323bf06 → 444af9de1698eea0}/host.js +1 -1
- package/dist/web-ui/content/modules/452327275cc5d8f8/host.js +1 -0
- package/dist/web-ui/content/modules/{9661b076f08e64b4 → 466310a17dac465f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{b358eaf2e45849a6 → 46f1b6c3274d399b}/host.js +1 -1
- package/dist/web-ui/content/modules/47998d82dc65bfeb/sidebar-peek.js +1 -0
- package/dist/web-ui/content/modules/{47af6b35e1d01ea7 → 486a828390c5d44d}/host.js +1 -1
- package/dist/web-ui/content/modules/{7f32261c1627c3cd → 4cc15b385bc6cc32}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{f36b4d3d44491852 → 4d5ab67f6c0ce19f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a41351130003e6bb → 54aaf60ac85dcb2b}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{0c04f94bbfd39a2f → 54c22eddaf009d00}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{e43af4aa407885fd → 55b931232c672f4f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{ee893f06cdb2b4f7 → 583049de28ef2b02}/panel.js +1 -1
- package/dist/web-ui/content/modules/{da1aa5fa0186fea7 → 5a2a58334d63e127}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{39faef0cffbad28e → 5ba0668f5a22133b}/home.js +2 -2
- package/dist/web-ui/content/modules/{37abb74d1a0a0791 → 6b41e59ab342482f}/notice-view.js +1 -1
- package/dist/web-ui/content/modules/{805b859b1b76ce4d → 6b5445f41bef0a66}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{5e7104e569359449 → 6e8395f61c89b5aa}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{bfe51130a84795fb → 6f74cede70164e19}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{c03e0f84f798d33a → 704690f5d6ab9157}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{38bb024e09cb5d5d → 70715360138f4d99}/host.js +2 -2
- package/dist/web-ui/content/modules/{5de35db482fb1a42 → 78d06dfdc4b13d78}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{033e0a741edd2ba1 → 7994dec16e8b1039}/page.js +3 -3
- package/dist/web-ui/content/modules/{be497f1d39753979 → 7dce56c1987e8d43}/chunk.js +1 -1
- package/dist/web-ui/content/modules/7edec8f23f8e0834/chunk.js +1 -0
- package/dist/web-ui/content/modules/80e92c14a6789896/progress.js +1 -0
- package/dist/web-ui/content/modules/{c3e0de0a61f0db34 → 8a828b4d087667dd}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{8f0d4e22c18a58b0 → 8b2f9a027ae1d7eb}/chunk.js +1 -1
- package/dist/web-ui/content/modules/8d6f223764846e18/brand-identity.js +1 -0
- package/dist/web-ui/content/modules/{d3cc94cf4a47a12a → 9136bae16758fd4c}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a1715be0f97c2479 → 93fa5c35e4bcab96}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{55a47b6e2c2016f2 → 96fe39f39930d9e4}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{5c9e8245d4a8a312 → 99e5cdf0c3bd0e3d}/sha256.js +1 -1
- package/dist/web-ui/content/modules/{5bb5db89a343817f → 9db41ad5ac96ffa2}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{b7aeeb22bf604ec7 → 9f4e26a1c1867d65}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{02fad74223254019 → a073cb6d182ccd32}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3a72b79418f0f80a → a8cba9f1d6b49ef1}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{8ea498cf092dba30 → a97b3b9b68f9ca38}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{601a2767ae24d1cb → aa7d409d04bbd736}/chunk.js +1 -1
- package/dist/web-ui/content/modules/ac34ed6692b43ede/dropdown-surface.js +1 -0
- package/dist/web-ui/content/modules/{ce90d0b55bbe6430 → aff19b31898aa157}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3a2fa12c8b537964 → b2f6e088e6e45878}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{5743d8116d15696b → b4446bf92e182bfb}/employee-card.js +1 -1
- package/dist/web-ui/content/modules/{d9019922118b2c37 → b79c15aace456028}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{d4b07cef43d36e79 → b8c18baf7cfb61b1}/chat-render.js +1 -1
- package/dist/web-ui/content/modules/{5472191457a926d3 → b8c447171e3d60a0}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a63f0b3d73d97e0b → b945370f1fa784f9}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{684db83476dcba20 → ba5fa76884e1f806}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a59c83b5b5b85da2 → bb1bb9460cc10fbe}/host.js +1 -1
- package/dist/web-ui/content/modules/{217595f72a1c3fc5 → bc28252270bcc51a}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{fa79ed5d045c24dd → be7f1f9183a1247f}/chunk.js +1 -1
- package/dist/web-ui/content/modules/bf0b693a654e2655/host.js +75 -0
- package/dist/web-ui/content/modules/{d856bfc56bea5f20 → bf7449bcf95e1454}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{af6ff78aeb782cf2 → c0384ffb4ef740a0}/host.js +1 -1
- package/dist/web-ui/content/modules/{d274491ffc8ee646 → c091efd46e221c29}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{3d5c498522b48225 → c1ec2ebce8ea5dd8}/dialog-modal.js +1 -1
- package/dist/web-ui/content/modules/{2460e872ab3a1f37 → c2f7bb50118f1603}/chunk.js +1 -1
- package/dist/web-ui/content/modules/c369ce4eb71277e6/host.js +1 -0
- package/dist/web-ui/content/modules/{84358b5b729cbe48 → c46b3501573953e9}/chunk.js +1 -1
- package/dist/web-ui/content/modules/c577ad641502d509/panel-host.js +1 -0
- package/dist/web-ui/content/modules/c75976857c18f251/host.js +1 -0
- package/dist/web-ui/content/modules/{4841e45cb7c5cc67 → c8eaffbedda0d3d0}/queue-view-adapter.js +1 -1
- package/dist/web-ui/content/modules/{20483d6e57cfe9d7 → cadd26ae50359434}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{7ae83a3f06f2daa3 → d37ff6684c9aeeec}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{a33666b143331cd6 → d48c1f89342bc4bc}/workspace-window.js +1 -1
- package/dist/web-ui/content/modules/{6bd6ee3c9f05e2f5 → d569c96d4acfdec3}/chunk.js +1 -1
- package/dist/web-ui/content/modules/d7cdd7dca9a0c9f8/chunk.js +1 -0
- package/dist/web-ui/content/modules/{578703196f82222d → d859a83f486aab23}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{acda148b7423bdab → d8b258a6455d77da}/host.js +1 -1
- package/dist/web-ui/content/modules/d937e939122180b9/host.js +1 -0
- package/dist/web-ui/content/modules/{c3e1f083e07d6840 → df5d48b4ff04b443}/library-bridge.js +1 -1
- package/dist/web-ui/content/modules/e020beea3e7da7db/chunk.js +1 -0
- package/dist/web-ui/content/modules/{e0ab9fa5a8882433 → e0a1ae9163e77556}/host.js +1 -1
- package/dist/web-ui/content/modules/e2feda63a603c64e/group-editor.js +1 -0
- package/dist/web-ui/content/modules/{a2be1fd01cf06837 → e4503f8e6379ccdc}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{d857ea8244b1026e → e70296674a841d60}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{17603a34d545c784 → ec2f6b23d12d3a15}/chunk.js +1 -1
- package/dist/web-ui/content/modules/{85181d84d5ce62b3 → ede751e1f2500d03}/employee-profile.js +1 -1
- package/dist/web-ui/content/modules/{97ef63ff1f0784d9 → ee4301b734e2fd43}/chunk.js +1 -1
- package/dist/web-ui/content/modules/f4e6095edc32562c/markdown.js +1 -0
- package/dist/web-ui/content/modules/{9eb83751622e2b97 → f7f0710962cab0e0}/chunk.js +1 -1
- package/dist/web-ui/content/modules/fe30627fc1e59d4f/chunk.js +1 -0
- package/dist/web-ui/content/modules/ffbd3bcaecd8e814/task-board-host.js +10 -0
- package/dist/web-ui/embedded-assets.d.ts +413 -413
- package/dist/web-ui/embedded-assets.js +4 -4
- package/dist/web-ui/group-chat-visibility.d.ts +8 -0
- package/dist/web-ui/group-chat-visibility.js +8 -0
- package/dist/web-ui/provider-identity.d.ts +3 -4
- package/dist/web-ui/provider-identity.js +3 -7
- package/package.json +1 -1
- package/dist/web-ui/content/modules/1f041aa8d3673d93/chunk.js +0 -1
- package/dist/web-ui/content/modules/2230c51655163cf3/runtime.js +0 -279
- package/dist/web-ui/content/modules/3d4451bc069c1498/chunk.js +0 -1
- package/dist/web-ui/content/modules/426b8133daebff78/host.js +0 -1
- package/dist/web-ui/content/modules/455436229dc57d7f/sidebar-peek.js +0 -1
- package/dist/web-ui/content/modules/46de3c2e2ca680c1/host.js +0 -1
- package/dist/web-ui/content/modules/497789a07177ed7b/chunk.js +0 -1
- package/dist/web-ui/content/modules/6687ad7aa57f443b/task-board-host.js +0 -22
- package/dist/web-ui/content/modules/87edd7cc79811bb8/composer-surface-adapter.js +0 -1
- package/dist/web-ui/content/modules/916021ce252882ca/chunk.js +0 -1
- package/dist/web-ui/content/modules/92df279c40bc4218/host.js +0 -1
- package/dist/web-ui/content/modules/99e48e07517d3f83/dropdown-surface.js +0 -1
- package/dist/web-ui/content/modules/a750f4868304b089/host.js +0 -1
- package/dist/web-ui/content/modules/abfe4b88dcd89d88/host.js +0 -1
- package/dist/web-ui/content/modules/b32c9addcd31f54b/panel-host.js +0 -1
- package/dist/web-ui/content/modules/bad2c42c7ddeab94/host.js +0 -1
- package/dist/web-ui/content/modules/bfa8e2c827201374/chunk.js +0 -1
- package/dist/web-ui/content/modules/c118e0c96bc023ee/host-bridge.js +0 -1
- package/dist/web-ui/content/modules/c3512b18c4c0e4ac/brand-identity.js +0 -1
- package/dist/web-ui/content/modules/cd5e90a37ccdf2dc/group-editor.js +0 -1
- package/dist/web-ui/content/modules/cdb8281bb89da303/chunk.js +0 -1
- package/dist/web-ui/content/modules/d90e77f9f8d4f1ec/workspaces-panel.js +0 -4
- package/dist/web-ui/content/modules/de977ff0b3ad3882/progress.js +0 -1
- package/dist/web-ui/content/modules/e25dea52e13504b6/markdown.js +0 -1
- package/dist/web-ui/content/modules/f2bdbdc4a1141826/host.js +0 -69
package/dist/build-info.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"commit": "
|
|
3
|
-
"builtAt": "2026-10-
|
|
4
|
-
"version": "4.
|
|
5
|
-
"channel": "
|
|
2
|
+
"commit": "42b6740fc59b0c3a539407c6459f8679d0c38378",
|
|
3
|
+
"builtAt": "2026-10-26T01:00:44.487Z",
|
|
4
|
+
"version": "4.105.0",
|
|
5
|
+
"channel": "stable"
|
|
6
6
|
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provider 的唯一真源:受支持的 CLI 列表、展示名、别名表与推断规则。
|
|
3
|
-
*
|
|
4
|
-
* 这个模块必须保持"纯数据 + 纯函数",不能 import 任何 `node:*`:
|
|
5
|
-
* 服务端(`src/session-provider.ts`)与浏览器 bundle(`src/web-ui/provider-identity.ts`)
|
|
6
|
-
* 都直接复用它,避免同一个 provider 概念散落在两处各写一份。
|
|
7
|
-
*/
|
|
8
1
|
/** 全部受支持的会话 provider;顺序即 UI / 派发选择器里的展示顺序。 */
|
|
9
2
|
export declare const SESSION_PROVIDERS: readonly ["claude", "codex", "opencode", "grok", "qoder", "pi"];
|
|
10
3
|
export type SessionProvider = (typeof SESSION_PROVIDERS)[number];
|
|
@@ -20,6 +13,8 @@ export declare function isNativeThinkingEffort(value: unknown): boolean;
|
|
|
20
13
|
export declare function isSessionProvider(value: unknown): value is SessionProvider;
|
|
21
14
|
/** provider 对应的 CLI 可执行文件名(Qoder 的 CLI 叫 qodercli)。 */
|
|
22
15
|
export declare function providerCliCommand(provider: SessionProvider): string;
|
|
16
|
+
/** CLI 结构化执行的默认 runner;服务端与 Web 创建入口共用。 */
|
|
17
|
+
export declare function defaultStructuredRunner(provider: SessionProvider): "claude-cli-print" | "codex-cli-exec" | "opencode-cli-run" | "grok-cli-headless" | "qoder-cli-print" | "pi-cli-json";
|
|
23
18
|
/**
|
|
24
19
|
* provider 的展示名。缺省不认识的字符串一律回落到 "AI"。
|
|
25
20
|
*
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provider 的唯一真源:受支持的 CLI 列表、展示名、别名表与推断规则。
|
|
3
|
-
*
|
|
4
|
-
* 这个模块必须保持"纯数据 + 纯函数",不能 import 任何 `node:*`:
|
|
5
|
-
* 服务端(`src/session-provider.ts`)与浏览器 bundle(`src/web-ui/provider-identity.ts`)
|
|
6
|
-
* 都直接复用它,避免同一个 provider 概念散落在两处各写一份。
|
|
7
|
-
*/
|
|
8
1
|
/** 全部受支持的会话 provider;顺序即 UI / 派发选择器里的展示顺序。 */
|
|
9
2
|
export const SESSION_PROVIDERS = ["claude", "codex", "opencode", "grok", "qoder", "pi"];
|
|
10
3
|
/**
|
|
@@ -27,6 +20,19 @@ export function isSessionProvider(value) {
|
|
|
27
20
|
export function providerCliCommand(provider) {
|
|
28
21
|
return provider === "qoder" ? "qodercli" : provider;
|
|
29
22
|
}
|
|
23
|
+
// 新 provider 必须明确配置 runner;不能静默落到 Claude。
|
|
24
|
+
const DEFAULT_STRUCTURED_RUNNERS = {
|
|
25
|
+
claude: "claude-cli-print",
|
|
26
|
+
codex: "codex-cli-exec",
|
|
27
|
+
opencode: "opencode-cli-run",
|
|
28
|
+
grok: "grok-cli-headless",
|
|
29
|
+
qoder: "qoder-cli-print",
|
|
30
|
+
pi: "pi-cli-json",
|
|
31
|
+
};
|
|
32
|
+
/** CLI 结构化执行的默认 runner;服务端与 Web 创建入口共用。 */
|
|
33
|
+
export function defaultStructuredRunner(provider) {
|
|
34
|
+
return DEFAULT_STRUCTURED_RUNNERS[provider];
|
|
35
|
+
}
|
|
30
36
|
/**
|
|
31
37
|
* provider 的展示名。缺省不认识的字符串一律回落到 "AI"。
|
|
32
38
|
*
|
|
@@ -558,9 +558,16 @@ export function registerWorkspaceRoutes(app, storage, sessions, titleOptions = {
|
|
|
558
558
|
}
|
|
559
559
|
res.json(result);
|
|
560
560
|
}));
|
|
561
|
-
//
|
|
562
|
-
|
|
563
|
-
|
|
561
|
+
// 两个创建入口只在项目来源上不同;独立任务挂到隐藏全局空间。
|
|
562
|
+
// 默认只创建逻辑分组,仅显式 worktree:true 才创建隔离目录。
|
|
563
|
+
app.post(["/api/tasks", "/api/workspaces/:id/tasks"], asyncRoute(async (req, res) => {
|
|
564
|
+
const workspace = req.params.id === undefined
|
|
565
|
+
? storage.ensureGlobalWorkspace()
|
|
566
|
+
: storage.getWorkspace(req.params.id);
|
|
567
|
+
if (!workspace) {
|
|
568
|
+
res.status(404).json({ error: "未找到该项目。" });
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
564
571
|
try {
|
|
565
572
|
const created = createTaskForWorkspace(storage, workspace, req.body);
|
|
566
573
|
// 带提示词建的任务立刻排上模型总结(响应里已经是提示词临时标题)。
|
|
@@ -908,28 +915,6 @@ export function registerWorkspaceRoutes(app, storage, sessions, titleOptions = {
|
|
|
908
915
|
worktrees,
|
|
909
916
|
});
|
|
910
917
|
}));
|
|
911
|
-
// 默认只创建逻辑分组;仅显式 worktree:true 才创建隔离目录。
|
|
912
|
-
app.post("/api/workspaces/:id/tasks", asyncRoute(async (req, res) => {
|
|
913
|
-
const workspace = storage.getWorkspace(req.params.id);
|
|
914
|
-
if (!workspace) {
|
|
915
|
-
res.status(404).json({ error: "未找到该项目。" });
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
try {
|
|
919
|
-
const created = createTaskForWorkspace(storage, workspace, req.body);
|
|
920
|
-
refreshAutoBoardTaskTitles(storage, titleOptions);
|
|
921
|
-
res.status(201).json({
|
|
922
|
-
...created.task,
|
|
923
|
-
...resolvedMilestoneFields(storage, created.task.milestoneId),
|
|
924
|
-
cwd: created.cwd,
|
|
925
|
-
isolated: created.isolated,
|
|
926
|
-
worktreeError: created.worktreeError,
|
|
927
|
-
});
|
|
928
|
-
}
|
|
929
|
-
catch (error) {
|
|
930
|
-
sendRouteError(res, surfaceDomainError(error, /Git 仓库/) ?? error, "创建任务失败。");
|
|
931
|
-
}
|
|
932
|
-
}));
|
|
933
918
|
// 任务详情:meta + 该任务下的会话;后台预取/轮询不改活动时间。
|
|
934
919
|
app.get("/api/workspace-tasks/:taskId", (req, res) => {
|
|
935
920
|
const task = storage.getWorkspaceTask(req.params.taskId);
|
|
@@ -947,11 +932,11 @@ export function registerWorkspaceRoutes(app, storage, sessions, titleOptions = {
|
|
|
947
932
|
...taskExecutionProjection(taskSessions, card ? storage.countQueuedTaskCommentDispatchesForTask(card.id) : 0),
|
|
948
933
|
...resolvedMilestoneFields(storage, task.milestoneId),
|
|
949
934
|
cwd: taskRuntimeCwd(task, workspace),
|
|
950
|
-
sessions:
|
|
935
|
+
sessions: taskSessions.map((session) => ({
|
|
951
936
|
...workspaceSessionSummary(session, {
|
|
952
937
|
taskName: task.name,
|
|
953
938
|
workspaceName: workspace?.name,
|
|
954
|
-
},
|
|
939
|
+
}, undefined, teamMarkersFor(teamMarkers, session.id)),
|
|
955
940
|
workspaceTaskId: task.id,
|
|
956
941
|
})),
|
|
957
942
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SessionProvider, SessionRunner, SessionSnapshot, StructuredSessionState } from "./types.js";
|
|
2
|
+
export { defaultStructuredRunner } from "./provider-catalog.js";
|
|
2
3
|
/**
|
|
3
4
|
* 把会话级系统提示交给 CLI 的开关。Claude / Qoder / Pi 用 `--append-system-prompt`,
|
|
4
5
|
* Grok 用 `--rules`;Codex / OpenCode 没有这个入口,只能退回并入本轮消息。
|
|
@@ -21,7 +22,6 @@ export declare function isThinkingEffort(value: unknown): value is NonNullable<S
|
|
|
21
22
|
/** 只取本 provider 的原生档位。别的 CLI 的前缀不能串过去。 */
|
|
22
23
|
export declare function prefixedThinkingEffort(provider: SessionProvider, effort: SessionSnapshot["thinkingEffort"]): string | null;
|
|
23
24
|
export declare function isStructuredRunnerForProvider(provider: SessionProvider, runner: unknown): runner is SessionRunner;
|
|
24
|
-
export declare function defaultStructuredRunner(provider: SessionProvider): SessionRunner;
|
|
25
25
|
/**
|
|
26
26
|
* 历史值归一:`claude-sdk` 是 SDK 执行路径的遗留会话值(含旧客户端仍会提交的值)。
|
|
27
27
|
* SDK 已移除,读路径把它映射成同一套 `claude -p` 执行,不报错、不丢会话。
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { isNativeThinkingEffort } from "./provider-catalog.js";
|
|
1
|
+
import { defaultStructuredRunner, isNativeThinkingEffort, isSessionProvider } from "./provider-catalog.js";
|
|
2
2
|
import { shellQuote } from "./shell-quote.js";
|
|
3
|
+
export { defaultStructuredRunner } from "./provider-catalog.js";
|
|
3
4
|
/**
|
|
4
5
|
* 把会话级系统提示交给 CLI 的开关。Claude / Qoder / Pi 用 `--append-system-prompt`,
|
|
5
6
|
* Grok 用 `--rules`;Codex / OpenCode 没有这个入口,只能退回并入本轮消息。
|
|
@@ -73,32 +74,8 @@ export function prefixedThinkingEffort(provider, effort) {
|
|
|
73
74
|
}
|
|
74
75
|
export function isStructuredRunnerForProvider(provider, runner) {
|
|
75
76
|
// "claude-sdk" 是历史值:SDK 执行路径已移除,只在读旧会话时用来识别(见 normalizeStructuredRunner)。
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if (provider === "codex")
|
|
79
|
-
return runner === "codex-cli-exec";
|
|
80
|
-
if (provider === "opencode")
|
|
81
|
-
return runner === "opencode-cli-run";
|
|
82
|
-
if (provider === "grok")
|
|
83
|
-
return runner === "grok-cli-headless";
|
|
84
|
-
if (provider === "qoder")
|
|
85
|
-
return runner === "qoder-cli-print";
|
|
86
|
-
if (provider === "pi")
|
|
87
|
-
return runner === "pi-cli-json";
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
export function defaultStructuredRunner(provider) {
|
|
91
|
-
if (provider === "codex")
|
|
92
|
-
return "codex-cli-exec";
|
|
93
|
-
if (provider === "opencode")
|
|
94
|
-
return "opencode-cli-run";
|
|
95
|
-
if (provider === "grok")
|
|
96
|
-
return "grok-cli-headless";
|
|
97
|
-
if (provider === "qoder")
|
|
98
|
-
return "qoder-cli-print";
|
|
99
|
-
if (provider === "pi")
|
|
100
|
-
return "pi-cli-json";
|
|
101
|
-
return "claude-cli-print";
|
|
77
|
+
return isSessionProvider(provider)
|
|
78
|
+
&& (runner === defaultStructuredRunner(provider) || provider === "claude" && runner === "claude-sdk");
|
|
102
79
|
}
|
|
103
80
|
/**
|
|
104
81
|
* 历史值归一:`claude-sdk` 是 SDK 执行路径的遗留会话值(含旧客户端仍会提交的值)。
|
|
@@ -162,9 +162,6 @@ function commentBlockNeedsRestore(block) {
|
|
|
162
162
|
return block.type === "tool_use" || Buffer.byteLength(JSON.stringify(block), "utf8") > 7 * 1024
|
|
163
163
|
|| block.type === "tool_result" && block._truncated === true;
|
|
164
164
|
}
|
|
165
|
-
function commentBlockHandles(messages, turnOffset) {
|
|
166
|
-
return messages.flatMap((turn, index) => turn.content.flatMap((block, blockIndex) => commentBlockNeedsRestore(block) ? [{ turnOffset: turnOffset + index, blockIndex }] : []));
|
|
167
|
-
}
|
|
168
165
|
function boundedCommentResultMessages(messages, turnOffset) {
|
|
169
166
|
let includedBlocks = 0;
|
|
170
167
|
const truncatedBlocks = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var h=["claude","codex","opencode","grok","qoder","pi"],O=["claude","codex","opencode","grok","qoder","pi"],w=`^(?:${O.join("|")}):[a-z0-9][a-z0-9_-]{0,31}$`;var U=new RegExp(w),K=new Set(h);var s={claude:"Claude",codex:"Codex",opencode:"OpenCode",grok:"Grok",qoder:"Qoder",pi:"Pi"},y="Wand Agent",z={anthropic:"claude",claude:"claude","claude-cli":"claude","claude-cli-print":"claude","claude-sdk":"claude",codex:"codex","codex-cli":"codex","codex-cli-exec":"codex",grok:"grok","grok-cli":"grok","grok-cli-headless":"grok","open-code":"opencode",open_code:"opencode",opencode:"opencode","opencode-cli-run":"opencode",qoder:"qoder","qoder-cli":"qoder","qoder-cli-print":"qoder",qodercli:"qoder",pi:"pi","pi-cli":"pi","pi-cli-json":"pi"};function L(e){if(typeof e!="string")return null;let n=e.trim().toLowerCase();return n?z[n]??null:null}var D="wand-agent",ie=[{id:"claude",provider:"claude",label:s.claude,description:"Claude Code"},{id:"codex",provider:"codex",label:s.codex,description:"OpenAI Codex CLI"},{id:"opencode",provider:"opencode",label:s.opencode,description:"OpenCode CLI"},{id:"grok",provider:"grok",label:s.grok,description:"Grok Build CLI"},{id:"qoder",provider:"qoder",label:s.qoder,description:"Qoder CLI"},{id:"pi",provider:"pi",engine:"cli",label:s.pi,description:"Pi CLI\uFF1A\u7ED3\u6784\u5316 JSON \u6216 PTY \u7EC8\u7AEF"},{id:D,provider:"pi",engine:"sdk",label:y,description:"Wand \u81EA\u5E26 Agent\uFF1A\u8FDB\u7A0B\u5185 SDK \u6267\u884C\uFF0C\u53EA\u652F\u6301\u7ED3\u6784\u5316\u4F1A\u8BDD"}];var H="#D97757",N="m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",$="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z";var V="M517.36 400H634.72V634.72H517.36Z",B=[{fill:"#F09082",d:"M165.29 165.29H517.36V400H400V282.65H165.29Z"},{fill:"#4D9ABF",d:"M165.29 282.65H282.65V400H400V517.36H282.65V634.72H165.29Z"},{fill:"#F1BE58",d:V}],F=["M13.2371 21.0407L24.3186 12.8506C24.8619 12.4491 25.6384 12.6057 25.8973 13.2294C27.2597 16.5185 26.651 20.4712 23.9403 23.1851C21.2297 25.8989 17.4581 26.4941 14.0108 25.1386L10.2449 26.8843C15.6463 30.5806 22.2053 29.6665 26.304 25.5601C29.5551 22.3051 30.562 17.8683 29.6205 13.8673L29.629 13.8758C28.2637 7.99809 29.9647 5.64871 33.449.844576C33.5314.730667 33.6139.616757 33.6964.5L29.1113 5.09055V5.07631L13.2343 21.0436Z","M10.9503 23.0313C7.07343 19.3235 7.74185 13.5853 11.0498 10.2763C13.4959 7.82722 17.5036 6.82767 21.0021 8.2971L24.7595 6.55998C24.0826 6.07017 23.215 5.54334 22.2195 5.17313C17.7198 3.31926 12.3326 4.24192 8.67479 7.90126C5.15635 11.4239 4.0499 16.8403 5.94992 21.4622C7.36924 24.9165 5.04257 27.3598 2.69884 29.826C1.86829 30.7002 1.0349 31.5745.36364 32.5L10.9474 23.0341Z"];function E(e){let n=L(e),t=`class="${`wand-provider-logo wand-provider-logo-${n??"generic"}`}" aria-hidden="true" focusable="false" data-provider-logo="${n??"generic"}"`;return n==="opencode"?`<svg ${t} viewBox="0 0 512 512"><path d="M0 0H512V512H0Z" fill="#131010"/><path d="M320 224V352H192V224H320Z" fill="#5A5858"/><path d="M384 416H128V96H384V416ZM320 160H192V352H320V160Z" fill="#fff" fill-rule="evenodd"/></svg>`:n==="qoder"?`<svg ${t} viewBox="0 0 180 180"><rect width="180" height="180" rx="40" fill="#111113"/><path d="M78 31c18 0 35 6 49 18l8 7c-5-2-10-3-15-3-10 0-19 3-26 9-11 10-17 24-17 40v18c0 12 5 21 13 28l-45-24c-8-4-13-12-13-21V80c0-27 20-49 46-49Z" fill="#fff"/><path d="M126 53c13 4 22 15 22 29v54c0 8-8 13-15 9l-10-5c-6 5-14 8-23 8-14 0-26-7-34-17l-6-9c15-7 26-19 33-33 4-9 6-18 6-28v-8c8-3 18-3 27 0Z" fill="#2ADB5C"/></svg>`:n==="grok"?`<svg ${t} viewBox="0 0 34 33" fill="currentColor">${F.map(i=>`<path d="${i}"/>`).join("")}</svg>`:n==="pi"?`<svg ${t} viewBox="0 0 800 800">${B.map(({d:i,fill:a})=>`<path d="${i}" fill="${a}"/>`).join("")}</svg>`:n==="claude"?`<svg ${t} viewBox="0 0 24 24" fill="${H}"><path d="${N}"/></svg>`:n==="codex"?`<svg ${t} viewBox="0 0 24 24" fill="currentColor"><path d="${$}"/></svg>`:`<svg ${t} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1"/><circle cx="12" cy="12" r="3"/></svg>`}var q={claude:[67,148],codex:[124,92],opencode:[201,56],grok:[290,43],qoder:[379,56],pi:[456,92]};function j(){return h.map((e,n)=>{let[o,t]=q[e],i=`M${o} ${t+25} C${o} ${t+82} 290 118 290 192`,a=E(e).replace("<svg ",'<svg width="26" height="26" ');return`<g style="--lv-delay: ${-n*1.25}s">
|
|
2
2
|
<path class="login-visual-wire" d="${i}"/>
|
|
3
3
|
<path class="login-visual-signal" d="${i}" pathLength="1"/>
|
|
4
|
-
<g transform="translate(${
|
|
4
|
+
<g transform="translate(${o-25} ${t-25})">
|
|
5
5
|
<rect class="login-visual-node" width="50" height="50" rx="15"/>
|
|
6
6
|
<g transform="translate(12 12)">${a}</g>
|
|
7
7
|
</g>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<ellipse class="login-visual-orbit" cx="290" cy="246" rx="255" ry="203"/>
|
|
25
25
|
<ellipse class="login-visual-orbit" cx="290" cy="246" rx="225" ry="176"/>
|
|
26
26
|
<path class="login-visual-registration" d="M21 218h10m-5-5v10M551 218h10m-5-5v10M285 455h10m-5-5v10"/>
|
|
27
|
-
${
|
|
27
|
+
${j()}
|
|
28
28
|
|
|
29
29
|
<rect class="login-visual-backplate" x="100" y="206" width="376" height="214" rx="14"/>
|
|
30
30
|
<rect class="login-visual-backplate" x="92" y="198" width="376" height="214" rx="14"/>
|
|
@@ -128,4 +128,4 @@
|
|
|
128
128
|
</form>
|
|
129
129
|
</section>
|
|
130
130
|
</div>
|
|
131
|
-
</main>`}var
|
|
131
|
+
</main>`}var A={viewport:108,inset:24,background:"#E3E8EE",paths:[{fill:"#6B7B8D",d:"M6,0h6v6h-6z M48,0h6v6h-6z M0,6h6v6h-6z M12,6h6v6h-6z M42,6h6v6h-6z M54,6h6v6h-6z M0,12h6v6h-6z M54,12h6v6h-6z M6,36h6v6h-6z M48,36h6v6h-6z M18,48h6v6h-6z M36,48h6v6h-6z"},{fill:"#9EAAB8",d:"M6,6h6v6h-6z M48,6h6v6h-6z M6,12h48v6h-48z M0,18h12v6h-12z M24,18h12v6h-12z M48,18h12v6h-12z M0,24h12v6h-12z M24,24h12v6h-12z M48,24h12v6h-12z M0,30h24v6h-24z M36,30h24v6h-24z M0,36h6v6h-6z M12,36h6v6h-6z M24,36h12v6h-12z M42,36h6v6h-6z M54,36h6v6h-6z M6,42h48v6h-48z M12,48h6v6h-6z M24,48h12v6h-12z M42,48h6v6h-6z M18,54h6v6h-6z M36,54h6v6h-6z"},{fill:"#FFFFFF",d:"M12,18h6v6h-6z M36,18h6v6h-6z M12,24h12v6h-12z M36,24h12v6h-12z"},{fill:"#7EC88B",d:"M18,18h6v6h-6z M42,18h6v6h-6z"},{fill:"#F28B9A",d:"M24,30h12v6h-12z"},{fill:"#C5CED8",d:"M18,36h6v6h-6z M36,36h6v6h-6z"}]};function v(e="wand-brand-mark"){let n=e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"),{viewport:o,inset:t,background:i,paths:a}=A;return`<svg class="${n}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${o} ${o}" aria-hidden="true" focusable="false" data-wand-brand="pixel-cat"><rect width="${o}" height="${o}" rx="24" fill="${i}"/><g transform="translate(${t} ${t})">`+a.map(({fill:r,d})=>`<path fill="${r}" d="${d}"/>`).join("")+"</g></svg>"}var ue="data:image/svg+xml,"+encodeURIComponent(v());function f(e){return/^wlt_[a-zA-Z0-9_-]{43}$/.test(e)}function I(e){let n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set;n?n.call(e,""):e.value="",e.dispatchEvent(new Event("input",{bubbles:!0}))}async function C(e,n={}){let o=f(e),t;try{t=await fetch(o?"/api/login/ticket":"/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o?{ticket:e}:{password:e}),credentials:"same-origin"})}catch{return{ok:!1,kind:o?"unknown":"offline",message:o?"\u7968\u636E\u767B\u5F55\u7ED3\u679C\u672A\u77E5\uFF1B\u8BF7\u5148\u5237\u65B0\u6838\u5BF9\u767B\u5F55\u72B6\u6001\uFF0C\u4E0D\u8981\u91CD\u590D\u63D0\u4EA4\u3002":n.networkMessage??"\u767B\u5F55\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5\u3002"}}if(t.status===429){let r=await t.json().catch(()=>null),d=r&&typeof r.retryAfter=="number"?Math.max(1,Math.ceil(r.retryAfter)):0;return{ok:!1,kind:"rejected",message:r&&typeof r.error=="string"?r.error:"\u767B\u5F55\u5C1D\u8BD5\u6B21\u6570\u8FC7\u591A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5\u3002",retryAfterMs:d?d*1e3:void 0}}if(!t.ok){if(o){let r=await t.json().catch(()=>null);return{ok:!1,kind:"rejected",message:r&&typeof r.error=="string"?r.error:"\u7968\u636E\u767B\u5F55\u672A\u786E\u8BA4\uFF1B\u8BF7\u5148\u5237\u65B0\u6838\u5BF9\u767B\u5F55\u72B6\u6001\uFF0C\u4E0D\u8981\u81EA\u52A8\u91CD\u8BD5\u3002"}}return{ok:!1,kind:"rejected",message:"\u5BC6\u7801\u9519\u8BEF\uFF0C\u8BF7\u91CD\u8BD5\u3002",credentialInvalid:!0}}let i;try{i=await fetch("/api/config",{credentials:"same-origin"})}catch{return{ok:!1,kind:"unknown",message:o?"\u7968\u636E\u767B\u5F55\u7ED3\u679C\u672A\u77E5\uFF1B\u8BF7\u5148\u5237\u65B0\u6838\u5BF9\u767B\u5F55\u72B6\u6001\uFF0C\u4E0D\u8981\u91CD\u590D\u63D0\u4EA4\u3002":"\u767B\u5F55\u7ED3\u679C\u672A\u786E\u8BA4\uFF1B\u8BF7\u5148\u5237\u65B0\u6838\u5BF9\u767B\u5F55\u72B6\u6001\uFF0C\u4E0D\u8981\u91CD\u590D\u63D0\u4EA4\u3002"}}return i.ok?{ok:!0,config:await i.json().catch(()=>null)}:{ok:!1,kind:"cookie-not-stored",message:n.cookieMessage??"\u767B\u5F55\u72B6\u6001\u672A\u80FD\u4FDD\u5B58\uFF0C\u8BF7\u91CD\u8BD5\u3002"}}function R(e,n){e&&f(n)&&I(e)}var S="password",k="login-button",P="login-error",u=!1,c=0,m=0;function l(e){return document.getElementById(e)}function g(e){let n=l(P);n&&(n.textContent=e,n.classList.remove("hidden"))}function _(){let e=l(P);e&&(e.textContent="",e.classList.add("hidden"))}function G(){l("login-cert-hint")?.classList.remove("hidden");let e=l("login-cert-http-link");e&&(e.href="http://"+location.host+location.pathname,e.style.display=location.protocol==="https:"?"":"none")}function p(e,n){let o=l(k);o&&(o.textContent=e,o.disabled=n)}function M(){m||(m=window.setTimeout(function(){m=0;let n=Math.ceil((c-Date.now())/1e3);if(n>0){if(M(),u)return;p("\u8BF7\u7B49\u5F85 "+n+"s",!0),g("\u767B\u5F55\u5C1D\u8BD5\u6B21\u6570\u8FC7\u591A\uFF0C\u8BF7\u7B49\u5F85 "+n+" \u79D2\u3002");return}c=0,p("\u8FDB\u5165\u63A7\u5236\u53F0",!1),g("\u73B0\u5728\u53EF\u4EE5\u518D\u8BD5\u4E00\u6B21\u4E86\u3002")},1e3))}function Z(){location.replace(location.pathname+location.search)}async function x(){let e=l(S),n=l(k);if(!e||!n)return;let o=Math.ceil((c-Date.now())/1e3);if(o>0){g("\u767B\u5F55\u5C1D\u8BD5\u6B21\u6570\u8FC7\u591A\uFF0C\u8BF7\u7B49\u5F85 "+o+" \u79D2\u3002"),M();return}if(u)return;_(),l("login-cert-hint")?.classList.add("hidden"),e.dataset.error="false",e.setAttribute("aria-invalid","false"),u=!0,p("\u767B\u5F55\u4E2D...",!0);let t=e.value;R(e,t);let i=await C(t);if(u=!1,i.ok){Z();return}i.retryAfterMs&&(c=Date.now()+i.retryAfterMs,M()),i.kind==="cookie-not-stored"&&location.protocol==="https:"&&G(),i.credentialInvalid&&(e.dataset.error="true",e.setAttribute("aria-invalid","true")),g(i.message),p("\u8FDB\u5165\u63A7\u5236\u53F0",c>Date.now())}function W(){let e=document.querySelector("[data-login-controls]");if(!e)return;let n=v("brand-logo");e.innerHTML=T(n,b(n));let o=l(S);l(k)?.addEventListener("click",()=>{x()}),l("login-form")?.addEventListener("submit",t=>{t.preventDefault(),x()}),o?.addEventListener("input",()=>{o.dataset.error="false",o.setAttribute("aria-invalid","false"),_()}),o?.addEventListener("keydown",t=>{t.key==="Enter"&&(t.preventDefault(),x())}),o?.focus()}W();})();
|