@kingsoftcloud/ksadk-web 0.3.11 → 0.3.12
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/RELEASE_PROVENANCE.json +2 -2
- package/dist-lib/{AttachmentPreview-tjd7Ufsh.js → AttachmentPreview-HLpbjOnQ.js} +1 -1
- package/dist-lib/{ConnectedComposer-BaRxxvhk.js → ConnectedComposer-CeWPgOn2.js} +1 -1
- package/dist-lib/{ConnectedMessageList-XLBootgU.js → ConnectedMessageList-D3HWHCh2.js} +1 -1
- package/dist-lib/{InteractionSchemaForm-BNoW5wzt.js → InteractionSchemaForm-Du9NT4E8.js} +1 -1
- package/dist-lib/chat-composer.js +2 -2
- package/dist-lib/chat-timeline.js +2 -2
- package/dist-lib/cloudMaterials-BlIAT-PA.js +2491 -0
- package/dist-lib/components/teams/CloudEffectsPanel.d.ts +15 -0
- package/dist-lib/components/teams/CloudEffectsPanel.d.ts.map +1 -0
- package/dist-lib/components/teams/CloudTeamWorkspace.d.ts +38 -0
- package/dist-lib/components/teams/CloudTeamWorkspace.d.ts.map +1 -0
- package/dist-lib/components/teams/CreateGroupDialog.d.ts +3 -1
- package/dist-lib/components/teams/CreateGroupDialog.d.ts.map +1 -1
- package/dist-lib/components.js +3 -3
- package/dist-lib/core/teams/cloudCanonical.d.ts +11 -0
- package/dist-lib/core/teams/cloudCanonical.d.ts.map +1 -0
- package/dist-lib/core/teams/cloudClient.d.ts +30 -0
- package/dist-lib/core/teams/cloudClient.d.ts.map +1 -0
- package/dist-lib/core/teams/cloudContracts.d.ts +1499 -0
- package/dist-lib/core/teams/cloudContracts.d.ts.map +1 -0
- package/dist-lib/core/teams/cloudEffects.d.ts +167 -0
- package/dist-lib/core/teams/cloudEffects.d.ts.map +1 -0
- package/dist-lib/core/teams/cloudExtendedContracts.d.ts +1014 -0
- package/dist-lib/core/teams/cloudExtendedContracts.d.ts.map +1 -0
- package/dist-lib/core/teams/cloudMaterials.d.ts +83 -0
- package/dist-lib/core/teams/cloudMaterials.d.ts.map +1 -0
- package/dist-lib/core/teams/cloudOperations.d.ts +30 -0
- package/dist-lib/core/teams/cloudOperations.d.ts.map +1 -0
- package/dist-lib/core/teams/cloudProductClient.d.ts +177 -0
- package/dist-lib/core/teams/cloudProductClient.d.ts.map +1 -0
- package/dist-lib/core/teams/cloudScope.d.ts +6 -0
- package/dist-lib/core/teams/cloudScope.d.ts.map +1 -0
- package/dist-lib/core/teams/operationOutbox.d.ts +138 -0
- package/dist-lib/core/teams/operationOutbox.d.ts.map +1 -0
- package/dist-lib/core/teams/workspaceContracts.d.ts +1696 -0
- package/dist-lib/core/teams/workspaceContracts.d.ts.map +1 -0
- package/dist-lib/core/teams/workspaceObserver.d.ts +49 -0
- package/dist-lib/core/teams/workspaceObserver.d.ts.map +1 -0
- package/dist-lib/core/teams/workspaceReducer.d.ts +37 -0
- package/dist-lib/core/teams/workspaceReducer.d.ts.map +1 -0
- package/dist-lib/public/team-components.d.ts +1 -0
- package/dist-lib/public/team-components.d.ts.map +1 -1
- package/dist-lib/public/teams.d.ts +11 -0
- package/dist-lib/public/teams.d.ts.map +1 -1
- package/dist-lib/runtime.js +2 -2
- package/dist-lib/team-components.js +1875 -750
- package/dist-lib/teams.css +54 -0
- package/dist-lib/teams.js +685 -31
- package/package.json +2 -1
- package/schemas/teams-cloud/v1/binding-probe-permit.schema.json +1 -0
- package/schemas/teams-cloud/v1/build-artifact-lookup-input.schema.json +1 -0
- package/schemas/teams-cloud/v1/build-artifact-lookup-result.schema.json +1 -0
- package/schemas/teams-cloud/v1/build-artifact-receipt.schema.json +1 -0
- package/schemas/teams-cloud/v1/build-manifest.schema.json +1 -0
- package/schemas/teams-cloud/v1/callback-permit.schema.json +1 -0
- package/schemas/teams-cloud/v1/canonical-event-batch.schema.json +1 -0
- package/schemas/teams-cloud/v1/deployment-artifact-receipt.schema.json +1 -0
- package/schemas/teams-cloud/v1/effect-outcome.schema.json +1 -0
- package/schemas/teams-cloud/v1/effect-prepared-receipt.schema.json +1 -0
- package/schemas/teams-cloud/v1/effect-projection-page.schema.json +1 -0
- package/schemas/teams-cloud/v1/effect-projection.schema.json +1 -0
- package/schemas/teams-cloud/v1/effect-reconcile-input.schema.json +1 -0
- package/schemas/teams-cloud/v1/effect-record.schema.json +1 -0
- package/schemas/teams-cloud/v1/effect-report-receipt.schema.json +1 -0
- package/schemas/teams-cloud/v1/effect-request.schema.json +1 -0
- package/schemas/teams-cloud/v1/execution-effects-page.schema.json +1 -0
- package/schemas/teams-cloud/v1/execution-effects-request.schema.json +1 -0
- package/schemas/teams-cloud/v1/execution-permit.schema.json +1 -0
- package/schemas/teams-cloud/v1/execution-reference.schema.json +1 -0
- package/schemas/teams-cloud/v1/execution-result.schema.json +1 -0
- package/schemas/teams-cloud/v1/host-operation-result.schema.json +1 -0
- package/schemas/teams-cloud/v1/host-receipt.schema.json +1 -0
- package/schemas/teams-cloud/v1/loaded-build-evidence.schema.json +1 -0
- package/schemas/teams-cloud/v1/manifest.json +43 -0
- package/schemas/teams-cloud/v1/material-create.schema.json +1 -0
- package/schemas/teams-cloud/v1/material-manifest.schema.json +1 -0
- package/schemas/teams-cloud/v1/node-command.schema.json +1 -0
- package/schemas/teams-cloud/v1/node-probe-command.schema.json +1 -0
- package/schemas/teams-cloud/v1/node-probe-report.schema.json +1 -0
- package/schemas/teams-cloud/v1/node-report.schema.json +1 -0
- package/schemas/teams-cloud/v1/release-verification-receipt.schema.json +1 -0
- package/schemas/teams-cloud/v1/release-verify-input.schema.json +1 -0
- package/dist-lib/reducer-gQmR9Qb9.js +0 -424
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./MessageMarkdown-CwMTvgFj.js";
|
|
3
|
-
import {
|
|
4
|
-
import { i as
|
|
5
|
-
import { Suspense as
|
|
6
|
-
import { Fragment as
|
|
1
|
+
import { n as e, t } from "./InteractionSchemaForm-Du9NT4E8.js";
|
|
2
|
+
import { t as n } from "./MessageMarkdown-CwMTvgFj.js";
|
|
3
|
+
import { Et as r, Gt as i, S as a, i as o, o as s, s as c, t as l, v as u, wt as d } from "./cloudMaterials-BlIAT-PA.js";
|
|
4
|
+
import { i as f, n as p, o as m, r as h, s as g, t as _ } from "./presentation-yYw7xK60.js";
|
|
5
|
+
import { Suspense as v, lazy as y, useCallback as b, useEffect as x, useId as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E, useSyncExternalStore as D } from "react";
|
|
6
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/teams/InteractionMessage.tsx
|
|
8
|
-
function
|
|
8
|
+
function j({ message: e }) {
|
|
9
9
|
let t = null;
|
|
10
10
|
try {
|
|
11
11
|
let n = JSON.parse(e);
|
|
12
12
|
n && typeof n == "object" && "arguments" in n && n.arguments && typeof n.arguments == "object" && !Array.isArray(n.arguments) && (t = n);
|
|
13
13
|
} catch {}
|
|
14
|
-
if (!t) return /* @__PURE__ */
|
|
14
|
+
if (!t) return /* @__PURE__ */ k("p", { children: e });
|
|
15
15
|
let n = {
|
|
16
16
|
path: "文件位置",
|
|
17
17
|
command: "命令",
|
|
@@ -21,15 +21,15 @@ function C({ message: e }) {
|
|
|
21
21
|
medium: "中",
|
|
22
22
|
high: "高"
|
|
23
23
|
}, i = (e) => typeof e == "string" ? e : JSON.stringify(e, null, 2);
|
|
24
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ A("div", {
|
|
25
25
|
className: "team-approval-details",
|
|
26
26
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
"content" in t.arguments && /* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ k("dl", { children: Object.entries(t.arguments).filter(([e]) => e !== "content").map(([e, t]) => /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", { children: n[e] || e }), /* @__PURE__ */ k("dd", { children: /* @__PURE__ */ k("code", { children: i(t) }) })] }, e)) }),
|
|
28
|
+
"content" in t.arguments && /* @__PURE__ */ A("details", {
|
|
29
29
|
className: "team-approval-preview",
|
|
30
|
-
children: [/* @__PURE__ */
|
|
30
|
+
children: [/* @__PURE__ */ k("summary", { children: "查看待写入的文件内容" }), /* @__PURE__ */ k("pre", { children: i(t.arguments.content) })]
|
|
31
31
|
}),
|
|
32
|
-
typeof t.risk == "string" && /* @__PURE__ */
|
|
32
|
+
typeof t.risk == "string" && /* @__PURE__ */ A("p", {
|
|
33
33
|
className: "team-approval-risk",
|
|
34
34
|
children: ["风险级别:", r[t.risk] || t.risk]
|
|
35
35
|
})
|
|
@@ -38,8 +38,8 @@ function C({ message: e }) {
|
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/components/teams/TeamReconciliation.tsx
|
|
41
|
-
function
|
|
42
|
-
let [r, i] =
|
|
41
|
+
function M({ run: e, onLoadReconciliation: t, onReconcile: n }) {
|
|
42
|
+
let [r, i] = E(null), [a, o] = E({}), [s, c] = E(!1), [l, u] = E("");
|
|
43
43
|
if (!t || !n || e.leaderStandby?.reason !== "execution_uncertain_fenced") return null;
|
|
44
44
|
async function d() {
|
|
45
45
|
c(!0), u("");
|
|
@@ -64,13 +64,13 @@ function w({ run: e, onLoadReconciliation: t, onReconcile: n }) {
|
|
|
64
64
|
c(!1);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ A("section", {
|
|
68
68
|
className: "team-run-budget",
|
|
69
69
|
"aria-label": "原执行核查",
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ k("h4", { children: "旧执行结果需要核查" }),
|
|
72
|
+
/* @__PURE__ */ k("p", { children: "云端已接管,相关分支会等待原单确认。请先核对外部操作和交付物,再决定是否采用结果。" }),
|
|
73
|
+
/* @__PURE__ */ k("button", {
|
|
74
74
|
type: "button",
|
|
75
75
|
className: "team-button",
|
|
76
76
|
disabled: s,
|
|
@@ -84,23 +84,23 @@ function w({ run: e, onLoadReconciliation: t, onReconcile: n }) {
|
|
|
84
84
|
"cancelled",
|
|
85
85
|
"interrupted"
|
|
86
86
|
].includes(t?.run_status || "");
|
|
87
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ A("article", {
|
|
88
88
|
className: "team-observer-item",
|
|
89
89
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ A("p", { children: [
|
|
91
91
|
e.taskId ? "成员执行" : "原 Leader 执行",
|
|
92
92
|
" · ",
|
|
93
93
|
r ? "已返回结束回执" : "原节点尚未返回结束回执"
|
|
94
94
|
] }),
|
|
95
|
-
t?.output && /* @__PURE__ */
|
|
95
|
+
t?.output && /* @__PURE__ */ k("pre", {
|
|
96
96
|
className: "team-observer-details",
|
|
97
97
|
children: t.output.slice(0, 1e4)
|
|
98
98
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
r && /* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ A("details", { children: [/* @__PURE__ */ k("summary", { children: "执行引用" }), /* @__PURE__ */ k("code", { children: t?.run_id || e.nativeRunId || e.commandId })] }),
|
|
100
|
+
r && /* @__PURE__ */ A(O, { children: [
|
|
101
|
+
/* @__PURE__ */ A("label", {
|
|
102
102
|
className: "team-field",
|
|
103
|
-
children: ["核查说明", /* @__PURE__ */
|
|
103
|
+
children: ["核查说明", /* @__PURE__ */ k("textarea", {
|
|
104
104
|
value: n,
|
|
105
105
|
onChange: (t) => o((n) => ({
|
|
106
106
|
...n,
|
|
@@ -110,21 +110,21 @@ function w({ run: e, onLoadReconciliation: t, onReconcile: n }) {
|
|
|
110
110
|
placeholder: "说明已检查哪些原单或外部结果"
|
|
111
111
|
})]
|
|
112
112
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ k("button", {
|
|
114
114
|
type: "button",
|
|
115
115
|
className: "team-button",
|
|
116
116
|
disabled: s || !n.trim(),
|
|
117
117
|
onClick: () => void f(e, "confirm_ended"),
|
|
118
118
|
children: "确认已结束"
|
|
119
119
|
}),
|
|
120
|
-
e.taskId && t?.run_status === "succeeded" && /* @__PURE__ */
|
|
120
|
+
e.taskId && t?.run_status === "succeeded" && /* @__PURE__ */ k("button", {
|
|
121
121
|
type: "button",
|
|
122
122
|
className: "team-button",
|
|
123
123
|
disabled: s || !n.trim(),
|
|
124
124
|
onClick: () => void f(e, "use_result"),
|
|
125
125
|
children: "采用已验证成果"
|
|
126
126
|
}),
|
|
127
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ k("p", {
|
|
128
128
|
className: "team-muted",
|
|
129
129
|
children: "确认结束不会自动重新执行;必要时再对相应子任务提出重试。"
|
|
130
130
|
})
|
|
@@ -132,7 +132,7 @@ function w({ run: e, onLoadReconciliation: t, onReconcile: n }) {
|
|
|
132
132
|
]
|
|
133
133
|
}, e.commandId);
|
|
134
134
|
}),
|
|
135
|
-
l && /* @__PURE__ */
|
|
135
|
+
l && /* @__PURE__ */ k("p", {
|
|
136
136
|
role: "alert",
|
|
137
137
|
className: "team-inline-error",
|
|
138
138
|
children: l
|
|
@@ -142,56 +142,56 @@ function w({ run: e, onLoadReconciliation: t, onReconcile: n }) {
|
|
|
142
142
|
}
|
|
143
143
|
//#endregion
|
|
144
144
|
//#region src/components/teams/TeamWorkspace.tsx
|
|
145
|
-
var
|
|
145
|
+
var N = y(() => import("./ExecutionTree-v3HexvPo.js").then((e) => e.n).then((e) => ({ default: e.ExecutionTree }))), P = () => `team-${globalThis.crypto.randomUUID()}`, F = {
|
|
146
146
|
owner: "群主",
|
|
147
147
|
leader: "Leader",
|
|
148
148
|
member: "成员",
|
|
149
149
|
system: "系统"
|
|
150
|
-
},
|
|
150
|
+
}, I = {
|
|
151
151
|
idle: "空闲",
|
|
152
152
|
queued: "待执行",
|
|
153
153
|
running: "进行中",
|
|
154
154
|
waiting: "等待中",
|
|
155
155
|
needs_attention: "需要处理",
|
|
156
156
|
unavailable: "不可用"
|
|
157
|
-
},
|
|
157
|
+
}, L = {
|
|
158
158
|
connecting: "正在连接",
|
|
159
159
|
connected: "已连接",
|
|
160
160
|
reconnecting: "正在重连 · 任务继续执行",
|
|
161
161
|
offline: "连接中断 · 显示最后状态",
|
|
162
162
|
closed: "未连接"
|
|
163
163
|
};
|
|
164
|
-
function
|
|
165
|
-
return /* @__PURE__ */
|
|
164
|
+
function R({ name: e }) {
|
|
165
|
+
return /* @__PURE__ */ k("span", {
|
|
166
166
|
className: "team-avatar",
|
|
167
167
|
"aria-hidden": "true",
|
|
168
168
|
children: Array.from(e.trim())[0] || "A"
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
return /* @__PURE__ */
|
|
171
|
+
function z({ status: e }) {
|
|
172
|
+
return /* @__PURE__ */ k("span", {
|
|
173
173
|
className: "team-status",
|
|
174
174
|
"data-status": e,
|
|
175
|
-
children:
|
|
175
|
+
children: _[e] ?? e
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
return e.length <= 100 ? /* @__PURE__ */
|
|
178
|
+
function B({ goal: e }) {
|
|
179
|
+
return e.length <= 100 ? /* @__PURE__ */ k("h3", { children: e }) : /* @__PURE__ */ A("details", {
|
|
180
180
|
className: "team-run-goal",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ A("summary", { children: [/* @__PURE__ */ k("h3", { children: e }), /* @__PURE__ */ k("span", { children: "完整目标" })] }), /* @__PURE__ */ k("p", { children: e })]
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function V({ snapshot: e, connection: t, onMembers: n, onManage: r }) {
|
|
185
185
|
let i = e.members.filter((e) => e.status !== "removed");
|
|
186
|
-
return /* @__PURE__ */
|
|
186
|
+
return /* @__PURE__ */ A("header", {
|
|
187
187
|
className: "team-header",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ A("div", {
|
|
189
189
|
className: "team-header-identity",
|
|
190
|
-
children: [/* @__PURE__ */
|
|
190
|
+
children: [/* @__PURE__ */ k("div", {
|
|
191
191
|
className: "team-avatar-stack",
|
|
192
192
|
"aria-hidden": "true",
|
|
193
|
-
children: i.slice(0, 3).map((e) => /* @__PURE__ */
|
|
194
|
-
}), /* @__PURE__ */
|
|
193
|
+
children: i.slice(0, 3).map((e) => /* @__PURE__ */ k(R, { name: e.name }, e.memberId))
|
|
194
|
+
}), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h1", { children: e.group.name }), /* @__PURE__ */ A("button", {
|
|
195
195
|
type: "button",
|
|
196
196
|
className: "team-text-button team-muted",
|
|
197
197
|
onClick: n,
|
|
@@ -201,13 +201,13 @@ function M({ snapshot: e, connection: t, onMembers: n, onManage: r }) {
|
|
|
201
201
|
i.find((t) => t.memberId === e.group.leaderMemberId)?.name || "Leader"
|
|
202
202
|
]
|
|
203
203
|
})] })]
|
|
204
|
-
}), /* @__PURE__ */
|
|
204
|
+
}), /* @__PURE__ */ A("div", {
|
|
205
205
|
className: "team-header-actions",
|
|
206
|
-
children: [t !== "connected" && /* @__PURE__ */
|
|
206
|
+
children: [t !== "connected" && /* @__PURE__ */ k("span", {
|
|
207
207
|
className: "team-connection",
|
|
208
208
|
role: "status",
|
|
209
|
-
children:
|
|
210
|
-
}), r && /* @__PURE__ */
|
|
209
|
+
children: L[t]
|
|
210
|
+
}), r && /* @__PURE__ */ k("button", {
|
|
211
211
|
type: "button",
|
|
212
212
|
className: "team-button",
|
|
213
213
|
onClick: r,
|
|
@@ -216,9 +216,9 @@ function M({ snapshot: e, connection: t, onMembers: n, onManage: r }) {
|
|
|
216
216
|
})]
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
let a =
|
|
221
|
-
|
|
219
|
+
function H({ messages: e, children: t, emptyState: r, focusFinalDelivery: i }) {
|
|
220
|
+
let a = T(null), o = T(!0), [s, c] = E(100), l = e.filter((e) => e.visibility === "public");
|
|
221
|
+
C(() => {
|
|
222
222
|
let e = a.current;
|
|
223
223
|
if (!o.current || !e) return;
|
|
224
224
|
let t = i ? e.querySelector(".team-final-delivery") : null;
|
|
@@ -232,7 +232,7 @@ function N({ messages: e, children: n, emptyState: r, focusFinalDelivery: i }) {
|
|
|
232
232
|
e.scrollTop += e.scrollHeight - t;
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ k("div", {
|
|
236
236
|
className: "team-timeline",
|
|
237
237
|
ref: a,
|
|
238
238
|
onScroll: () => {
|
|
@@ -241,191 +241,191 @@ function N({ messages: e, children: n, emptyState: r, focusFinalDelivery: i }) {
|
|
|
241
241
|
},
|
|
242
242
|
"aria-label": "群聊消息",
|
|
243
243
|
tabIndex: 0,
|
|
244
|
-
children: /* @__PURE__ */
|
|
244
|
+
children: /* @__PURE__ */ A("div", {
|
|
245
245
|
className: "team-timeline-inner",
|
|
246
246
|
children: [
|
|
247
|
-
l.length > s && /* @__PURE__ */
|
|
247
|
+
l.length > s && /* @__PURE__ */ k("button", {
|
|
248
248
|
className: "team-button team-history-more",
|
|
249
249
|
type: "button",
|
|
250
250
|
onClick: u,
|
|
251
251
|
children: "查看更早的消息"
|
|
252
252
|
}),
|
|
253
|
-
!l.length && (r ?? /* @__PURE__ */
|
|
253
|
+
!l.length && (r ?? /* @__PURE__ */ A("div", {
|
|
254
254
|
className: "team-empty",
|
|
255
255
|
children: [
|
|
256
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ k("span", {
|
|
257
257
|
className: "team-eyebrow",
|
|
258
258
|
children: "一起完成一个目标"
|
|
259
259
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ k("h2", { children: "团队已就绪" }),
|
|
261
|
+
/* @__PURE__ */ A("p", { children: [
|
|
262
262
|
"描述你想得到的成果,Leader 会组织成员分工。",
|
|
263
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ k("br", {}),
|
|
264
264
|
"也可以 @成员,指定由谁参与。"
|
|
265
265
|
] })
|
|
266
266
|
]
|
|
267
267
|
})),
|
|
268
|
-
l.slice(-s).map((e) => /* @__PURE__ */
|
|
268
|
+
l.slice(-s).map((e) => /* @__PURE__ */ A("article", {
|
|
269
269
|
className: "team-message",
|
|
270
270
|
"data-role": e.groupRole,
|
|
271
271
|
"data-message-id": e.messageId,
|
|
272
|
-
children: [e.groupRole !== "owner" && /* @__PURE__ */
|
|
272
|
+
children: [e.groupRole !== "owner" && /* @__PURE__ */ k(R, { name: e.senderName }), /* @__PURE__ */ A("div", {
|
|
273
273
|
className: "team-message-main",
|
|
274
|
-
children: [/* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ A("header", { children: [
|
|
275
|
+
/* @__PURE__ */ k("strong", { children: e.senderName }),
|
|
276
|
+
/* @__PURE__ */ k("span", { children: F[e.groupRole] }),
|
|
277
|
+
/* @__PURE__ */ k("time", {
|
|
278
278
|
dateTime: e.createdAt,
|
|
279
279
|
children: new Date(e.createdAt).toLocaleTimeString([], {
|
|
280
280
|
hour: "2-digit",
|
|
281
281
|
minute: "2-digit"
|
|
282
282
|
})
|
|
283
283
|
}),
|
|
284
|
-
e.intent === "note" && /* @__PURE__ */
|
|
285
|
-
] }), /* @__PURE__ */
|
|
284
|
+
e.intent === "note" && /* @__PURE__ */ k("span", { children: "仅留言" })
|
|
285
|
+
] }), /* @__PURE__ */ k("div", {
|
|
286
286
|
className: "team-message-body",
|
|
287
|
-
children: e.parts.map((e,
|
|
287
|
+
children: e.parts.map((e, t) => e.kind === "text" ? /* @__PURE__ */ k(n, { content: e.text }, t) : /* @__PURE__ */ A("span", {
|
|
288
288
|
className: "team-attachment",
|
|
289
289
|
children: [
|
|
290
290
|
e.name || "附件",
|
|
291
291
|
" ",
|
|
292
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ k("span", { children: e.mediaType })
|
|
293
293
|
]
|
|
294
294
|
}, e.attachmentRef))
|
|
295
295
|
})]
|
|
296
296
|
})]
|
|
297
297
|
}, e.messageId)),
|
|
298
|
-
|
|
298
|
+
t
|
|
299
299
|
]
|
|
300
300
|
})
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
let a = t.filter((e) => e.status === "succeeded").length, o =
|
|
305
|
-
return /* @__PURE__ */
|
|
303
|
+
function U({ run: e, tasks: t, pendingCount: n, onOpen: r, compact: i = !1 }) {
|
|
304
|
+
let a = t.filter((e) => e.status === "succeeded").length, o = h(e.status);
|
|
305
|
+
return /* @__PURE__ */ A("button", {
|
|
306
306
|
type: "button",
|
|
307
307
|
className: "team-progress-card",
|
|
308
308
|
"data-active": o || void 0,
|
|
309
309
|
onClick: r,
|
|
310
310
|
"aria-label": `查看协作:${e.goal}`,
|
|
311
311
|
children: [
|
|
312
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ A("span", {
|
|
313
313
|
className: "team-progress-heading",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
314
|
+
children: [/* @__PURE__ */ k("span", {
|
|
315
315
|
className: "team-eyebrow",
|
|
316
316
|
children: "本轮协作"
|
|
317
|
-
}), /* @__PURE__ */
|
|
317
|
+
}), /* @__PURE__ */ A("span", {
|
|
318
318
|
className: "team-progress-status",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
319
|
+
children: [/* @__PURE__ */ k(z, { status: e.status }), o && /* @__PURE__ */ A("span", {
|
|
320
320
|
className: "team-progress-live",
|
|
321
321
|
role: "status",
|
|
322
|
-
children: ["实时处理中", /* @__PURE__ */
|
|
322
|
+
children: ["实时处理中", /* @__PURE__ */ A("span", {
|
|
323
323
|
"aria-hidden": "true",
|
|
324
324
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ k("i", {}),
|
|
326
|
+
/* @__PURE__ */ k("i", {}),
|
|
327
|
+
/* @__PURE__ */ k("i", {})
|
|
328
328
|
]
|
|
329
329
|
})]
|
|
330
330
|
})]
|
|
331
331
|
})]
|
|
332
332
|
}),
|
|
333
|
-
!i && /* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */
|
|
333
|
+
!i && /* @__PURE__ */ k("strong", { children: e.goal }),
|
|
334
|
+
/* @__PURE__ */ A("span", {
|
|
335
335
|
className: "team-progress-caption",
|
|
336
336
|
children: [
|
|
337
337
|
t.length ? `${a} / ${t.length} 项任务已验收` : "正在整理目标与分工",
|
|
338
338
|
n > 0 ? ` · ${n} 项需要处理` : "",
|
|
339
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ A("span", { children: ["查看协作 ", /* @__PURE__ */ k("span", {
|
|
340
340
|
"aria-hidden": "true",
|
|
341
341
|
children: "→"
|
|
342
342
|
})] })
|
|
343
343
|
]
|
|
344
344
|
}),
|
|
345
|
-
e.reason && /* @__PURE__ */
|
|
345
|
+
e.reason && /* @__PURE__ */ k("span", {
|
|
346
346
|
className: "team-progress-reason",
|
|
347
347
|
children: e.reason
|
|
348
348
|
})
|
|
349
349
|
]
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
let
|
|
352
|
+
function W({ members: e, activeRun: t, value: n, onChange: r, onSend: i, disabled: a = !1, recipientMemberId: o, onRecipientChange: s, focusRequest: c = 0, artifacts: l = [], referenceArtifacts: u = [], serverAuthority: d = !1 }) {
|
|
353
|
+
let f = S(), p = S(), m = S(), g = t?.teamRunId || "", _ = {
|
|
354
354
|
attachmentIds: [],
|
|
355
355
|
note: !1,
|
|
356
356
|
sourcePath: "",
|
|
357
357
|
baseRef: "",
|
|
358
358
|
inputs: "",
|
|
359
359
|
mode: "auto"
|
|
360
|
-
}, [
|
|
360
|
+
}, [v, y] = E({}), b = v[g] || _, w = (e) => y((t) => ({
|
|
361
361
|
...t,
|
|
362
|
-
[
|
|
363
|
-
...t[
|
|
362
|
+
[g]: {
|
|
363
|
+
...t[g] || _,
|
|
364
364
|
...e
|
|
365
365
|
}
|
|
366
|
-
})), { attachmentIds:
|
|
367
|
-
let n = t[
|
|
366
|
+
})), { attachmentIds: D, note: j } = b, M = (e) => y((t) => {
|
|
367
|
+
let n = t[g] || _;
|
|
368
368
|
return {
|
|
369
369
|
...t,
|
|
370
|
-
[
|
|
370
|
+
[g]: {
|
|
371
371
|
...n,
|
|
372
372
|
attachmentIds: typeof e == "function" ? e(n.attachmentIds) : e
|
|
373
373
|
}
|
|
374
374
|
};
|
|
375
|
-
}),
|
|
376
|
-
|
|
377
|
-
},
|
|
378
|
-
|
|
379
|
-
let e =
|
|
375
|
+
}), N = (e) => w({ note: e }), F = [...new Map([...l, ...u].map((e) => [e.artifactId, e])).values()], I = F.filter((e) => D.includes(e.artifactId)), [L, z] = E(""), B = o ?? L, V = (e) => {
|
|
376
|
+
z(e), s?.(e);
|
|
377
|
+
}, H = T(null);
|
|
378
|
+
C(() => {
|
|
379
|
+
let e = H.current;
|
|
380
380
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 176)}px`);
|
|
381
|
-
}, [n]),
|
|
382
|
-
|
|
383
|
-
}, [
|
|
384
|
-
let [
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}, [
|
|
388
|
-
let [
|
|
389
|
-
|
|
390
|
-
|
|
381
|
+
}, [n]), x(() => {
|
|
382
|
+
c && H.current?.focus();
|
|
383
|
+
}, [c]);
|
|
384
|
+
let [U, W] = E(0), ee = T(g);
|
|
385
|
+
ee.current = g, x(() => {
|
|
386
|
+
K("");
|
|
387
|
+
}, [g]);
|
|
388
|
+
let [G, te] = E(!1), ne = !!(t && h(t.status)), re = (!!(t && !ne) || t?.status === "cancel_requested") && !j, [ie, K] = E(""), ae = T(/* @__PURE__ */ new Map()), oe = T(!0);
|
|
389
|
+
x(() => (oe.current = !0, () => {
|
|
390
|
+
oe.current = !1;
|
|
391
391
|
}), []);
|
|
392
|
-
let
|
|
393
|
-
async function
|
|
394
|
-
if (a ||
|
|
395
|
-
if (
|
|
396
|
-
|
|
392
|
+
let se = /@([^\s@]*)$/u.exec(n)?.[1], q = se === void 0 ? [] : e.filter((e) => e.status === "active" && e.name.toLowerCase().includes(se.toLowerCase()));
|
|
393
|
+
async function J() {
|
|
394
|
+
if (a || G || !n.trim() && !I.length) return;
|
|
395
|
+
if (re) {
|
|
396
|
+
K("这个任务已结束,请新建任务继续协作。");
|
|
397
397
|
return;
|
|
398
398
|
}
|
|
399
|
-
let e = n.trim(), o =
|
|
399
|
+
let e = n.trim(), o = j ? "note" : t ? B === "" ? "followup" : "directed" : "start_goal";
|
|
400
400
|
if (o === "start_goal" && !e) {
|
|
401
|
-
|
|
401
|
+
K("请补充这轮希望团队完成的目标,或选择仅留言。");
|
|
402
402
|
return;
|
|
403
403
|
}
|
|
404
|
-
let s =
|
|
404
|
+
let s = B === "" ? [] : [B], c = [...e ? [{
|
|
405
405
|
kind: "text",
|
|
406
406
|
text: e
|
|
407
|
-
}] : [], ...
|
|
407
|
+
}] : [], ...I.map((e) => ({
|
|
408
408
|
kind: "attachment",
|
|
409
409
|
attachmentRef: e.artifactId,
|
|
410
410
|
mediaType: e.mediaType,
|
|
411
411
|
name: e.name
|
|
412
|
-
}))], l = t?.teamRunId, u =
|
|
413
|
-
if (o === "start_goal" && !
|
|
414
|
-
|
|
412
|
+
}))], l = t?.teamRunId, u = g;
|
|
413
|
+
if (o === "start_goal" && !b.sourcePath.trim() && (b.baseRef.trim() || b.inputs.trim())) {
|
|
414
|
+
K("请先填写执行节点上的工作目录。");
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
417
|
-
let
|
|
418
|
-
sourcePath:
|
|
419
|
-
mode:
|
|
420
|
-
...
|
|
421
|
-
inputs:
|
|
417
|
+
let f = o === "start_goal" && b.sourcePath.trim() ? {
|
|
418
|
+
sourcePath: b.sourcePath.trim(),
|
|
419
|
+
mode: b.mode,
|
|
420
|
+
...b.mode === "auto" && b.baseRef.trim() ? { baseRef: b.baseRef.trim() } : {},
|
|
421
|
+
inputs: b.inputs.split(/\r?\n/).map((e) => e.trim()).filter(Boolean)
|
|
422
422
|
} : void 0;
|
|
423
|
-
if (
|
|
424
|
-
|
|
423
|
+
if (f && d && f.mode === "auto" && !/^(?:[a-fA-F0-9]{40}|[a-fA-F0-9]{64})$/.test(b.baseRef.trim())) {
|
|
424
|
+
K("云端协作的 Git 基线需要完整的 40 或 64 位 commit,请在工作目录设置中填写。");
|
|
425
425
|
return;
|
|
426
426
|
}
|
|
427
|
-
if (
|
|
428
|
-
|
|
427
|
+
if (f && f.inputs.length > 32) {
|
|
428
|
+
K("每次任务最多引用 32 个输入文件。");
|
|
429
429
|
return;
|
|
430
430
|
}
|
|
431
431
|
let p = JSON.stringify([
|
|
@@ -433,250 +433,250 @@ function P({ members: e, activeRun: t, value: n, onChange: r, onSend: i, disable
|
|
|
433
433
|
o,
|
|
434
434
|
s,
|
|
435
435
|
l,
|
|
436
|
-
|
|
436
|
+
f
|
|
437
437
|
]);
|
|
438
|
-
|
|
438
|
+
ae.current.get(g)?.digest !== p && ae.current.set(g, {
|
|
439
439
|
digest: p,
|
|
440
|
-
idempotencyKey:
|
|
440
|
+
idempotencyKey: P()
|
|
441
441
|
});
|
|
442
|
-
let m =
|
|
443
|
-
|
|
442
|
+
let m = ae.current.get(g);
|
|
443
|
+
te(!0), K("");
|
|
444
444
|
try {
|
|
445
445
|
let e = await i({
|
|
446
446
|
parts: c,
|
|
447
447
|
mentions: s,
|
|
448
448
|
intent: o,
|
|
449
449
|
...l ? { teamRunId: l } : {},
|
|
450
|
-
...
|
|
450
|
+
...f ? { workspace: f } : {},
|
|
451
451
|
idempotencyKey: m.idempotencyKey
|
|
452
452
|
});
|
|
453
|
-
if (!
|
|
453
|
+
if (!oe.current) return;
|
|
454
454
|
if (e?.status === "rejected" || e?.status === "uncertain") throw Error(e.reason || (e.status === "uncertain" ? "消息接收结果尚未确认。再次提交将使用相同标识核对。" : "消息未被接收。"));
|
|
455
|
-
|
|
455
|
+
ee.current === u && (r(""), M([])), ae.current.delete(u), o === "start_goal" && y((e) => {
|
|
456
456
|
let t = { ...e };
|
|
457
457
|
return delete t[u], t;
|
|
458
458
|
});
|
|
459
459
|
} catch (e) {
|
|
460
|
-
|
|
460
|
+
K(e instanceof Error ? e.message : "消息发送失败,请重试。");
|
|
461
461
|
} finally {
|
|
462
|
-
|
|
462
|
+
te(!1);
|
|
463
463
|
}
|
|
464
464
|
}
|
|
465
|
-
function
|
|
466
|
-
|
|
465
|
+
function Y(e) {
|
|
466
|
+
V(e.memberId), r(n.replace(/@([^\s@]*)$/u, `@${e.name} `)), W(0), H.current?.focus();
|
|
467
467
|
}
|
|
468
|
-
return /* @__PURE__ */
|
|
468
|
+
return /* @__PURE__ */ A("form", {
|
|
469
469
|
className: "team-composer-wrap",
|
|
470
470
|
onSubmit: (e) => {
|
|
471
|
-
e.preventDefault(),
|
|
471
|
+
e.preventDefault(), J();
|
|
472
472
|
},
|
|
473
473
|
children: [
|
|
474
|
-
|
|
474
|
+
ie && /* @__PURE__ */ k("p", {
|
|
475
475
|
className: "team-inline-error",
|
|
476
476
|
role: "alert",
|
|
477
|
-
children:
|
|
477
|
+
children: ie
|
|
478
478
|
}),
|
|
479
|
-
!!
|
|
479
|
+
!!q.length && /* @__PURE__ */ k("div", {
|
|
480
480
|
className: "team-mention-options",
|
|
481
481
|
role: "listbox",
|
|
482
482
|
"aria-label": "选择要提及的成员",
|
|
483
|
-
children:
|
|
483
|
+
children: q.map((e, t) => /* @__PURE__ */ A("button", {
|
|
484
484
|
type: "button",
|
|
485
485
|
role: "option",
|
|
486
|
-
"aria-selected": t ===
|
|
487
|
-
onClick: () =>
|
|
486
|
+
"aria-selected": t === U,
|
|
487
|
+
onClick: () => Y(e),
|
|
488
488
|
children: [
|
|
489
|
-
/* @__PURE__ */
|
|
490
|
-
/* @__PURE__ */
|
|
491
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ k(R, { name: e.name }),
|
|
490
|
+
/* @__PURE__ */ k("span", { children: e.name }),
|
|
491
|
+
/* @__PURE__ */ k("small", { children: e.role === "leader" ? "Leader" : "成员" })
|
|
492
492
|
]
|
|
493
493
|
}, e.memberId))
|
|
494
494
|
}),
|
|
495
|
-
!!
|
|
495
|
+
!!I.length && /* @__PURE__ */ k("div", {
|
|
496
496
|
className: "team-selected-artifacts",
|
|
497
497
|
"aria-label": "已选择的交付物",
|
|
498
|
-
children:
|
|
498
|
+
children: I.map((e) => /* @__PURE__ */ A("span", {
|
|
499
499
|
className: "team-attachment",
|
|
500
|
-
children: [e.name, /* @__PURE__ */
|
|
500
|
+
children: [e.name, /* @__PURE__ */ k("button", {
|
|
501
501
|
type: "button",
|
|
502
502
|
className: "team-text-button",
|
|
503
503
|
"aria-label": `移除引用 ${e.name}`,
|
|
504
|
-
disabled:
|
|
505
|
-
onClick: () =>
|
|
504
|
+
disabled: G,
|
|
505
|
+
onClick: () => M((t) => t.filter((t) => t !== e.artifactId)),
|
|
506
506
|
children: "×"
|
|
507
507
|
})]
|
|
508
508
|
}, e.artifactId))
|
|
509
509
|
}),
|
|
510
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ A("div", {
|
|
511
511
|
className: "team-composer",
|
|
512
512
|
children: [
|
|
513
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ k("label", {
|
|
514
514
|
className: "team-sr-only",
|
|
515
|
-
htmlFor:
|
|
515
|
+
htmlFor: f,
|
|
516
516
|
children: "给团队的消息"
|
|
517
517
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
ref:
|
|
520
|
-
id:
|
|
518
|
+
/* @__PURE__ */ k("textarea", {
|
|
519
|
+
ref: H,
|
|
520
|
+
id: f,
|
|
521
521
|
value: n,
|
|
522
522
|
rows: 2,
|
|
523
523
|
onChange: (e) => {
|
|
524
|
-
r(e.target.value),
|
|
524
|
+
r(e.target.value), W(0);
|
|
525
525
|
},
|
|
526
|
-
placeholder:
|
|
527
|
-
disabled: a ||
|
|
526
|
+
placeholder: j ? "留下一条消息,不启动任务…" : B === "" ? "描述目标、交付物或需要团队解决的问题…" : "向选中的成员提问或分派工作…",
|
|
527
|
+
disabled: a || G,
|
|
528
528
|
onKeyDown: (e) => {
|
|
529
|
-
if (
|
|
529
|
+
if (q.length && !e.nativeEvent.isComposing && [
|
|
530
530
|
"ArrowDown",
|
|
531
531
|
"ArrowUp",
|
|
532
532
|
"Enter"
|
|
533
533
|
].includes(e.key)) {
|
|
534
|
-
e.preventDefault(), e.key === "Enter" ?
|
|
534
|
+
e.preventDefault(), e.key === "Enter" ? Y(q[U % q.length]) : W((t) => (t + (e.key === "ArrowDown" ? 1 : -1) + q.length) % q.length);
|
|
535
535
|
return;
|
|
536
536
|
}
|
|
537
|
-
e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(),
|
|
537
|
+
e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), J());
|
|
538
538
|
}
|
|
539
539
|
}),
|
|
540
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ A("div", {
|
|
541
541
|
className: "team-composer-toolbar",
|
|
542
|
-
children: [/* @__PURE__ */
|
|
543
|
-
/* @__PURE__ */
|
|
542
|
+
children: [/* @__PURE__ */ A("div", { children: [
|
|
543
|
+
/* @__PURE__ */ k("label", {
|
|
544
544
|
className: "team-sr-only",
|
|
545
|
-
htmlFor:
|
|
545
|
+
htmlFor: p,
|
|
546
546
|
children: "接收成员"
|
|
547
547
|
}),
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
id:
|
|
550
|
-
value:
|
|
551
|
-
onChange: (e) =>
|
|
552
|
-
disabled: a ||
|
|
553
|
-
children: [/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ A("select", {
|
|
549
|
+
id: p,
|
|
550
|
+
value: B,
|
|
551
|
+
onChange: (e) => V(e.target.value),
|
|
552
|
+
disabled: a || G,
|
|
553
|
+
children: [/* @__PURE__ */ k("option", {
|
|
554
554
|
value: "",
|
|
555
555
|
children: "发给 Leader"
|
|
556
|
-
}), e.filter((e) => e.status === "active").map((e) => /* @__PURE__ */
|
|
556
|
+
}), e.filter((e) => e.status === "active").map((e) => /* @__PURE__ */ A("option", {
|
|
557
557
|
value: e.memberId,
|
|
558
558
|
children: ["@", e.name]
|
|
559
559
|
}, e.memberId))]
|
|
560
560
|
}),
|
|
561
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ A("details", {
|
|
562
562
|
className: "team-composer-more",
|
|
563
|
-
children: [/* @__PURE__ */
|
|
563
|
+
children: [/* @__PURE__ */ k("summary", {
|
|
564
564
|
"aria-label": "更多消息选项",
|
|
565
565
|
children: "···"
|
|
566
|
-
}), /* @__PURE__ */
|
|
566
|
+
}), /* @__PURE__ */ A("div", {
|
|
567
567
|
className: "team-composer-menu",
|
|
568
|
-
children: [/* @__PURE__ */
|
|
568
|
+
children: [/* @__PURE__ */ A("label", {
|
|
569
569
|
className: "team-note-toggle",
|
|
570
|
-
children: [/* @__PURE__ */
|
|
570
|
+
children: [/* @__PURE__ */ k("input", {
|
|
571
571
|
type: "checkbox",
|
|
572
|
-
checked:
|
|
573
|
-
onChange: (e) =>
|
|
574
|
-
disabled: a ||
|
|
572
|
+
checked: j,
|
|
573
|
+
onChange: (e) => N(e.target.checked),
|
|
574
|
+
disabled: a || G
|
|
575
575
|
}), "仅留言,不启动执行"]
|
|
576
|
-
}), !t && /* @__PURE__ */
|
|
576
|
+
}), !t && /* @__PURE__ */ A("details", {
|
|
577
577
|
className: "team-workspace-options",
|
|
578
578
|
children: [
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ A("summary", { children: ["工作目录", b.sourcePath ? " · 已选择" : " · 可选"] }),
|
|
580
|
+
/* @__PURE__ */ A("label", {
|
|
581
581
|
className: "team-field",
|
|
582
|
-
children: ["工作目录", /* @__PURE__ */
|
|
583
|
-
value:
|
|
582
|
+
children: ["工作目录", /* @__PURE__ */ k("input", {
|
|
583
|
+
value: b.sourcePath,
|
|
584
584
|
maxLength: 4096,
|
|
585
|
-
onChange: (e) =>
|
|
585
|
+
onChange: (e) => w({ sourcePath: e.target.value }),
|
|
586
586
|
placeholder: "执行节点上的目录路径",
|
|
587
|
-
disabled:
|
|
587
|
+
disabled: G
|
|
588
588
|
})]
|
|
589
589
|
}),
|
|
590
|
-
/* @__PURE__ */
|
|
590
|
+
/* @__PURE__ */ A("label", {
|
|
591
591
|
className: "team-field",
|
|
592
|
-
children: ["目录类型", /* @__PURE__ */
|
|
593
|
-
value:
|
|
594
|
-
onChange: (e) =>
|
|
595
|
-
children: [/* @__PURE__ */
|
|
592
|
+
children: ["目录类型", /* @__PURE__ */ A("select", {
|
|
593
|
+
value: b.mode,
|
|
594
|
+
onChange: (e) => w({ mode: e.target.value }),
|
|
595
|
+
children: [/* @__PURE__ */ k("option", {
|
|
596
596
|
value: "auto",
|
|
597
|
-
children:
|
|
598
|
-
}), /* @__PURE__ */
|
|
597
|
+
children: d ? "Git 仓库" : "自动识别 Git"
|
|
598
|
+
}), /* @__PURE__ */ k("option", {
|
|
599
599
|
value: "directory",
|
|
600
600
|
children: "普通目录,仅复制输入文件"
|
|
601
601
|
})]
|
|
602
602
|
})]
|
|
603
603
|
}),
|
|
604
|
-
|
|
604
|
+
b.mode === "auto" && /* @__PURE__ */ A("label", {
|
|
605
605
|
className: "team-field",
|
|
606
|
-
children: ["Git 基线", /* @__PURE__ */
|
|
607
|
-
value:
|
|
606
|
+
children: ["Git 基线", /* @__PURE__ */ k("input", {
|
|
607
|
+
value: b.baseRef,
|
|
608
608
|
maxLength: 256,
|
|
609
|
-
onChange: (e) =>
|
|
610
|
-
placeholder:
|
|
611
|
-
disabled:
|
|
609
|
+
onChange: (e) => w({ baseRef: e.target.value }),
|
|
610
|
+
placeholder: d ? "完整 commit(40 或 64 位)" : "HEAD",
|
|
611
|
+
disabled: G
|
|
612
612
|
})]
|
|
613
613
|
}),
|
|
614
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ A("label", {
|
|
615
615
|
className: "team-field",
|
|
616
|
-
children: ["输入文件", /* @__PURE__ */
|
|
616
|
+
children: ["输入文件", /* @__PURE__ */ k("textarea", {
|
|
617
617
|
rows: 2,
|
|
618
|
-
value:
|
|
619
|
-
onChange: (e) =>
|
|
618
|
+
value: b.inputs,
|
|
619
|
+
onChange: (e) => w({ inputs: e.target.value }),
|
|
620
620
|
placeholder: "每行一个相对路径(非 Git 目录)",
|
|
621
|
-
disabled:
|
|
621
|
+
disabled: G
|
|
622
622
|
})]
|
|
623
623
|
}),
|
|
624
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ A("p", { children: ["路径须在执行节点可访问。Git 使用提交版本,不带入未提交修改;普通目录只复制列出的输入文件。", d && "云端协作需填写固定 commit,并确保节点可访问相同版本。"] })
|
|
625
625
|
]
|
|
626
626
|
})]
|
|
627
627
|
})]
|
|
628
628
|
}),
|
|
629
|
-
!!
|
|
629
|
+
!!F.length && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("label", {
|
|
630
630
|
className: "team-sr-only",
|
|
631
|
-
htmlFor:
|
|
631
|
+
htmlFor: m,
|
|
632
632
|
children: "引用本群交付物"
|
|
633
|
-
}), /* @__PURE__ */
|
|
634
|
-
id:
|
|
633
|
+
}), /* @__PURE__ */ A("select", {
|
|
634
|
+
id: m,
|
|
635
635
|
value: "",
|
|
636
|
-
disabled: a ||
|
|
636
|
+
disabled: a || G || I.length >= 8,
|
|
637
637
|
onChange: (e) => {
|
|
638
638
|
let t = e.target.value;
|
|
639
|
-
t &&
|
|
639
|
+
t && M((e) => e.includes(t) ? e : [...e, t]);
|
|
640
640
|
},
|
|
641
641
|
children: [
|
|
642
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ k("option", {
|
|
643
643
|
value: "",
|
|
644
644
|
children: "引用交付物"
|
|
645
645
|
}),
|
|
646
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ k("optgroup", {
|
|
647
647
|
label: "当前任务",
|
|
648
|
-
children:
|
|
648
|
+
children: l.filter((e) => !D.includes(e.artifactId)).map((e) => /* @__PURE__ */ k("option", {
|
|
649
649
|
value: e.artifactId,
|
|
650
650
|
children: e.name
|
|
651
651
|
}, e.artifactId))
|
|
652
652
|
}),
|
|
653
|
-
/* @__PURE__ */
|
|
653
|
+
/* @__PURE__ */ k("optgroup", {
|
|
654
654
|
label: "其他任务(显式引用)",
|
|
655
|
-
children:
|
|
655
|
+
children: u.filter((e) => !l.some((t) => t.artifactId === e.artifactId) && !D.includes(e.artifactId)).map((e) => /* @__PURE__ */ k("option", {
|
|
656
656
|
value: e.artifactId,
|
|
657
657
|
children: e.name
|
|
658
658
|
}, e.artifactId))
|
|
659
659
|
})
|
|
660
660
|
]
|
|
661
661
|
})] })
|
|
662
|
-
] }), /* @__PURE__ */
|
|
662
|
+
] }), /* @__PURE__ */ k("button", {
|
|
663
663
|
className: "team-button team-primary",
|
|
664
664
|
type: "submit",
|
|
665
|
-
disabled: a ||
|
|
666
|
-
children:
|
|
665
|
+
disabled: a || G || re || !n.trim() && !I.length,
|
|
666
|
+
children: G ? "正在发送" : "发送"
|
|
667
667
|
})]
|
|
668
668
|
})
|
|
669
669
|
]
|
|
670
670
|
}),
|
|
671
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ k("p", {
|
|
672
672
|
className: "team-composer-help",
|
|
673
|
-
children:
|
|
673
|
+
children: re ? t?.status === "cancel_requested" ? "正在停止任务 · 等待执行端确认" : "任务已结束 · 新建任务以继续协作" : /* @__PURE__ */ A(O, { children: ["Enter 发送 · Shift + Enter 换行", j ? " · 留言不会唤醒成员" : ""] })
|
|
674
674
|
})
|
|
675
675
|
]
|
|
676
676
|
});
|
|
677
677
|
}
|
|
678
|
-
function
|
|
679
|
-
return e.length ? /* @__PURE__ */
|
|
678
|
+
function ee({ tasks: e, members: t, selectedTaskId: n, onSelect: r }) {
|
|
679
|
+
return e.length ? /* @__PURE__ */ k("div", {
|
|
680
680
|
className: "team-task-board",
|
|
681
681
|
children: [
|
|
682
682
|
["attention", "需处理"],
|
|
@@ -684,172 +684,172 @@ function F({ tasks: e, members: t, selectedTaskId: n, onSelect: r }) {
|
|
|
684
684
|
["waiting", "等待"],
|
|
685
685
|
["done", "已完成"]
|
|
686
686
|
].map(([i, a]) => {
|
|
687
|
-
let o = e.filter((e) =>
|
|
688
|
-
return o.length ? /* @__PURE__ */
|
|
687
|
+
let o = e.filter((e) => g(e) === i);
|
|
688
|
+
return o.length ? /* @__PURE__ */ A("section", { children: [/* @__PURE__ */ A("h3", { children: [a, /* @__PURE__ */ k("span", { children: o.length })] }), o.map((e) => /* @__PURE__ */ A("button", {
|
|
689
689
|
className: "team-task-row",
|
|
690
690
|
type: "button",
|
|
691
691
|
onClick: () => r(e),
|
|
692
692
|
"aria-pressed": n === e.taskId,
|
|
693
|
-
children: [/* @__PURE__ */
|
|
693
|
+
children: [/* @__PURE__ */ A("span", {
|
|
694
694
|
className: "team-task-row-main",
|
|
695
|
-
children: [/* @__PURE__ */
|
|
696
|
-
}), /* @__PURE__ */
|
|
695
|
+
children: [/* @__PURE__ */ k("strong", { children: e.title }), /* @__PURE__ */ k(z, { status: e.status })]
|
|
696
|
+
}), /* @__PURE__ */ A("span", {
|
|
697
697
|
className: "team-muted",
|
|
698
|
-
children: [t.find((t) => t.memberId === e.ownerMemberId)?.name || "待分派",
|
|
698
|
+
children: [t.find((t) => t.memberId === e.ownerMemberId)?.name || "待分派", m(e) ? ` · ${m(e)}` : e.dependencies.length && e.status === "blocked" ? " · 等待前置任务验收" : ""]
|
|
699
699
|
})]
|
|
700
700
|
}, e.taskId))] }, i) : null;
|
|
701
701
|
})
|
|
702
|
-
}) : /* @__PURE__ */
|
|
702
|
+
}) : /* @__PURE__ */ A("div", {
|
|
703
703
|
className: "team-panel-empty",
|
|
704
|
-
children: [/* @__PURE__ */
|
|
704
|
+
children: [/* @__PURE__ */ k("h3", { children: "尚未分派任务" }), /* @__PURE__ */ k("p", { children: "Leader 建立任务后,负责人、依赖与验收进度会出现在这里。" })]
|
|
705
705
|
});
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
let n =
|
|
709
|
-
return /* @__PURE__ */
|
|
707
|
+
function G({ artifact: e, onOpen: t }) {
|
|
708
|
+
let n = f(e.uri);
|
|
709
|
+
return /* @__PURE__ */ A("div", {
|
|
710
710
|
className: "team-artifact",
|
|
711
|
-
children: [t ? /* @__PURE__ */
|
|
711
|
+
children: [t ? /* @__PURE__ */ k("button", {
|
|
712
712
|
className: "team-text-button",
|
|
713
713
|
type: "button",
|
|
714
714
|
onClick: () => t(e),
|
|
715
715
|
children: e.name
|
|
716
|
-
}) : n ? /* @__PURE__ */
|
|
716
|
+
}) : n ? /* @__PURE__ */ k("a", {
|
|
717
717
|
href: n,
|
|
718
718
|
target: "_blank",
|
|
719
719
|
rel: "noopener noreferrer",
|
|
720
720
|
children: e.name
|
|
721
|
-
}) : /* @__PURE__ */
|
|
721
|
+
}) : /* @__PURE__ */ k("span", { children: e.name }), /* @__PURE__ */ A("small", { children: [e.mediaType, e.digest ? ` · ${e.digest.slice(0, 12)}` : ""] })]
|
|
722
722
|
});
|
|
723
723
|
}
|
|
724
|
-
function
|
|
725
|
-
let [o,
|
|
726
|
-
async function
|
|
727
|
-
if (!(!r ||
|
|
728
|
-
if (t === "reject" && !
|
|
729
|
-
|
|
724
|
+
function te({ task: e, members: t, onAction: r, onOpenArtifact: i, onMemberSelect: a }) {
|
|
725
|
+
let [o, s] = E(""), [c, l] = E(!1), [u, d] = E(""), [f, p] = E(!1), [h, g] = E(""), v = e.attempts.find((e) => e.attemptId === o) ?? e.attempts.at(-1), y = t.find((t) => t.memberId === e.ownerMemberId);
|
|
726
|
+
async function b(t) {
|
|
727
|
+
if (!(!r || c)) {
|
|
728
|
+
if (t === "reject" && !h.trim()) {
|
|
729
|
+
d("请填写需要修改的内容。");
|
|
730
730
|
return;
|
|
731
731
|
}
|
|
732
|
-
|
|
732
|
+
l(!0), d("");
|
|
733
733
|
try {
|
|
734
|
-
await r(e, t, t === "reject" ?
|
|
734
|
+
await r(e, t, t === "reject" ? h.trim() : void 0), p(!1);
|
|
735
735
|
} catch (e) {
|
|
736
|
-
|
|
736
|
+
d(e instanceof Error ? e.message : "操作失败。");
|
|
737
737
|
} finally {
|
|
738
|
-
|
|
738
|
+
l(!1);
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
}
|
|
742
|
-
return /* @__PURE__ */
|
|
742
|
+
return /* @__PURE__ */ A("section", {
|
|
743
743
|
className: "team-task-detail",
|
|
744
744
|
children: [
|
|
745
|
-
/* @__PURE__ */
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
|
|
745
|
+
/* @__PURE__ */ k(z, { status: e.status }),
|
|
746
|
+
/* @__PURE__ */ k("h3", { children: e.title }),
|
|
747
|
+
y && /* @__PURE__ */ A("button", {
|
|
748
748
|
className: "team-member-link",
|
|
749
749
|
type: "button",
|
|
750
|
-
onClick: () => a?.(
|
|
750
|
+
onClick: () => a?.(y),
|
|
751
751
|
disabled: !a,
|
|
752
752
|
children: [
|
|
753
|
-
/* @__PURE__ */
|
|
754
|
-
|
|
755
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ k(R, { name: y.name }),
|
|
754
|
+
y.name,
|
|
755
|
+
/* @__PURE__ */ k("span", { children: "查看执行" })
|
|
756
756
|
]
|
|
757
757
|
}),
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
|
|
758
|
+
/* @__PURE__ */ k("p", { children: e.description }),
|
|
759
|
+
m(e) && /* @__PURE__ */ k("p", {
|
|
760
760
|
className: "team-detail-reason",
|
|
761
|
-
children:
|
|
761
|
+
children: m(e)
|
|
762
762
|
}),
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
-
/* @__PURE__ */
|
|
765
|
-
e.attempts.length > 1 && /* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ k("h4", { children: "验收要求" }),
|
|
764
|
+
/* @__PURE__ */ k("p", { children: e.acceptanceCriteria || "等待确定验收要求" }),
|
|
765
|
+
e.attempts.length > 1 && /* @__PURE__ */ A("label", {
|
|
766
766
|
className: "team-field",
|
|
767
|
-
children: ["执行记录", /* @__PURE__ */
|
|
768
|
-
value:
|
|
769
|
-
onChange: (e) =>
|
|
770
|
-
children: e.attempts.map((e) => /* @__PURE__ */
|
|
767
|
+
children: ["执行记录", /* @__PURE__ */ k("select", {
|
|
768
|
+
value: v?.attemptId,
|
|
769
|
+
onChange: (e) => s(e.target.value),
|
|
770
|
+
children: e.attempts.map((e) => /* @__PURE__ */ A("option", {
|
|
771
771
|
value: e.attemptId,
|
|
772
772
|
children: [
|
|
773
773
|
"第 ",
|
|
774
774
|
e.attemptNumber,
|
|
775
775
|
" 次执行 · ",
|
|
776
|
-
|
|
776
|
+
_[e.status]
|
|
777
777
|
]
|
|
778
778
|
}, e.attemptId))
|
|
779
779
|
})]
|
|
780
780
|
}),
|
|
781
|
-
|
|
782
|
-
|
|
781
|
+
v?.result && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("h4", { children: "交付结果" }), /* @__PURE__ */ k(n, { content: v.result })] }),
|
|
782
|
+
v?.artifacts.map((e) => /* @__PURE__ */ k(G, {
|
|
783
783
|
artifact: e,
|
|
784
784
|
onOpen: i
|
|
785
785
|
}, e.artifactId)),
|
|
786
|
-
|
|
786
|
+
f && /* @__PURE__ */ A("label", {
|
|
787
787
|
className: "team-field",
|
|
788
788
|
children: [
|
|
789
789
|
"修改意见",
|
|
790
|
-
/* @__PURE__ */
|
|
790
|
+
/* @__PURE__ */ k("textarea", {
|
|
791
791
|
rows: 3,
|
|
792
792
|
maxLength: 2e3,
|
|
793
|
-
value:
|
|
794
|
-
onChange: (e) =>
|
|
793
|
+
value: h,
|
|
794
|
+
onChange: (e) => g(e.target.value)
|
|
795
795
|
}),
|
|
796
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ k("button", {
|
|
797
797
|
className: "team-button",
|
|
798
798
|
type: "button",
|
|
799
|
-
disabled:
|
|
800
|
-
onClick: () => void
|
|
799
|
+
disabled: c || !h.trim(),
|
|
800
|
+
onClick: () => void b("reject"),
|
|
801
801
|
children: "提交修改意见"
|
|
802
802
|
})
|
|
803
803
|
]
|
|
804
804
|
}),
|
|
805
|
-
r && /* @__PURE__ */
|
|
805
|
+
r && /* @__PURE__ */ A("div", {
|
|
806
806
|
className: "team-task-actions",
|
|
807
|
-
children: [e.status === "awaiting_acceptance" && /* @__PURE__ */
|
|
807
|
+
children: [e.status === "awaiting_acceptance" && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
|
|
808
808
|
className: "team-button team-primary",
|
|
809
809
|
type: "button",
|
|
810
|
-
disabled:
|
|
811
|
-
onClick: () => void
|
|
810
|
+
disabled: c,
|
|
811
|
+
onClick: () => void b("accept"),
|
|
812
812
|
children: "验收通过"
|
|
813
|
-
}), /* @__PURE__ */
|
|
813
|
+
}), /* @__PURE__ */ k("button", {
|
|
814
814
|
className: "team-button",
|
|
815
815
|
type: "button",
|
|
816
|
-
disabled:
|
|
817
|
-
onClick: () =>
|
|
816
|
+
disabled: c,
|
|
817
|
+
onClick: () => p(!0),
|
|
818
818
|
children: "提出修改"
|
|
819
|
-
})] }), ["failed", "cancelled"].includes(e.status) && /* @__PURE__ */
|
|
819
|
+
})] }), ["failed", "cancelled"].includes(e.status) && /* @__PURE__ */ k("button", {
|
|
820
820
|
className: "team-button",
|
|
821
821
|
type: "button",
|
|
822
|
-
disabled:
|
|
823
|
-
onClick: () => void
|
|
822
|
+
disabled: c,
|
|
823
|
+
onClick: () => void b("retry"),
|
|
824
824
|
children: "重新执行"
|
|
825
825
|
})]
|
|
826
826
|
}),
|
|
827
|
-
|
|
827
|
+
u && /* @__PURE__ */ k("p", {
|
|
828
828
|
role: "alert",
|
|
829
829
|
className: "team-inline-error",
|
|
830
|
-
children:
|
|
830
|
+
children: u
|
|
831
831
|
})
|
|
832
832
|
]
|
|
833
833
|
});
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
let [i, a] =
|
|
837
|
-
async function p(
|
|
835
|
+
function ne({ interaction: e, member: n, onRespond: r }) {
|
|
836
|
+
let [i, a] = E({}), [o, s] = E(!1), [c, l] = E(!1), [u, d] = E(""), f = T(null);
|
|
837
|
+
async function p(t, n) {
|
|
838
838
|
if (o || c) return;
|
|
839
839
|
let i = JSON.stringify([
|
|
840
|
-
|
|
840
|
+
t,
|
|
841
841
|
n,
|
|
842
|
-
|
|
842
|
+
e.revision
|
|
843
843
|
]);
|
|
844
844
|
f.current?.digest !== i && (f.current = {
|
|
845
845
|
digest: i,
|
|
846
|
-
idempotencyKey:
|
|
846
|
+
idempotencyKey: P()
|
|
847
847
|
}), s(!0), d("");
|
|
848
848
|
try {
|
|
849
849
|
let i = await r({
|
|
850
|
-
ref:
|
|
851
|
-
expectedRevision:
|
|
852
|
-
action:
|
|
850
|
+
ref: e.ref,
|
|
851
|
+
expectedRevision: e.revision,
|
|
852
|
+
action: t,
|
|
853
853
|
response: n,
|
|
854
854
|
idempotencyKey: f.current.idempotencyKey
|
|
855
855
|
});
|
|
@@ -861,34 +861,34 @@ function I({ interaction: t, member: n, onRespond: r }) {
|
|
|
861
861
|
s(!1);
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
|
-
return /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ A("article", {
|
|
865
865
|
className: "team-interaction-card",
|
|
866
866
|
children: [
|
|
867
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ A("span", {
|
|
868
868
|
className: "team-eyebrow",
|
|
869
869
|
children: [n?.name || "成员", " · 需要你的确认"]
|
|
870
870
|
}),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
c ||
|
|
871
|
+
/* @__PURE__ */ k("h3", { children: e.title }),
|
|
872
|
+
/* @__PURE__ */ k(j, { message: e.message }),
|
|
873
|
+
c || e.status === "resolving" ? /* @__PURE__ */ k("p", {
|
|
874
874
|
role: "status",
|
|
875
875
|
children: "已提交,等待执行端确认"
|
|
876
|
-
}) :
|
|
877
|
-
schema:
|
|
876
|
+
}) : e.kind === "input" && e.requestSchema ? /* @__PURE__ */ k(t, {
|
|
877
|
+
schema: e.requestSchema,
|
|
878
878
|
values: i,
|
|
879
879
|
onChange: a,
|
|
880
880
|
disabled: o,
|
|
881
881
|
onSubmit: () => void p("submit", i),
|
|
882
882
|
onCancel: () => void p("cancel", {})
|
|
883
|
-
}) : /* @__PURE__ */
|
|
883
|
+
}) : /* @__PURE__ */ A("div", {
|
|
884
884
|
className: "team-task-actions",
|
|
885
|
-
children: [/* @__PURE__ */
|
|
885
|
+
children: [/* @__PURE__ */ k("button", {
|
|
886
886
|
type: "button",
|
|
887
887
|
className: "team-button",
|
|
888
888
|
disabled: o,
|
|
889
889
|
onClick: () => void p("reject", { approved: !1 }),
|
|
890
890
|
children: "拒绝"
|
|
891
|
-
}), /* @__PURE__ */
|
|
891
|
+
}), /* @__PURE__ */ k("button", {
|
|
892
892
|
type: "button",
|
|
893
893
|
className: "team-button team-primary",
|
|
894
894
|
disabled: o,
|
|
@@ -896,7 +896,7 @@ function I({ interaction: t, member: n, onRespond: r }) {
|
|
|
896
896
|
children: "同意"
|
|
897
897
|
})]
|
|
898
898
|
}),
|
|
899
|
-
u && /* @__PURE__ */
|
|
899
|
+
u && /* @__PURE__ */ k("p", {
|
|
900
900
|
role: "alert",
|
|
901
901
|
className: "team-inline-error",
|
|
902
902
|
children: u
|
|
@@ -904,29 +904,29 @@ function I({ interaction: t, member: n, onRespond: r }) {
|
|
|
904
904
|
]
|
|
905
905
|
});
|
|
906
906
|
}
|
|
907
|
-
function
|
|
908
|
-
return /* @__PURE__ */
|
|
907
|
+
function re({ interactions: e, members: t, onRespond: n }) {
|
|
908
|
+
return /* @__PURE__ */ k("section", {
|
|
909
909
|
className: "team-interactions",
|
|
910
910
|
"aria-label": "团队审批与待处理输入",
|
|
911
|
-
children: e.filter((e) => ["pending", "resolving"].includes(e.status)).map((e) => /* @__PURE__ */
|
|
911
|
+
children: e.filter((e) => ["pending", "resolving"].includes(e.status)).map((e) => /* @__PURE__ */ k(ne, {
|
|
912
912
|
interaction: e,
|
|
913
913
|
member: t.find((t) => t.memberId === e.ref.memberId),
|
|
914
914
|
onRespond: n
|
|
915
|
-
},
|
|
915
|
+
}, d(e.ref)))
|
|
916
916
|
});
|
|
917
917
|
}
|
|
918
|
-
function
|
|
919
|
-
return /* @__PURE__ */
|
|
918
|
+
function ie({ members: e, selectedMemberId: t, onSelect: n }) {
|
|
919
|
+
return /* @__PURE__ */ k("div", {
|
|
920
920
|
className: "team-member-list",
|
|
921
|
-
children: e.filter((e) => e.status !== "removed").map((e) => /* @__PURE__ */
|
|
921
|
+
children: e.filter((e) => e.status !== "removed").map((e) => /* @__PURE__ */ A("button", {
|
|
922
922
|
type: "button",
|
|
923
923
|
className: "team-member-row",
|
|
924
924
|
onClick: () => n(e),
|
|
925
925
|
"aria-pressed": t === e.memberId,
|
|
926
926
|
children: [
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
929
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ k(R, { name: e.name }),
|
|
928
|
+
/* @__PURE__ */ A("span", { children: [/* @__PURE__ */ A("strong", { children: [e.name, /* @__PURE__ */ k("small", { children: e.role === "leader" ? "Leader" : "成员" })] }), /* @__PURE__ */ A("span", { children: [I[e.executionStatus], e.binding.kind === "local_build" ? " · 本地" : " · 云端"] })] }),
|
|
929
|
+
/* @__PURE__ */ k("span", {
|
|
930
930
|
"aria-hidden": "true",
|
|
931
931
|
children: "→"
|
|
932
932
|
})
|
|
@@ -934,33 +934,33 @@ function L({ members: e, selectedMemberId: t, onSelect: n }) {
|
|
|
934
934
|
}, e.memberId))
|
|
935
935
|
});
|
|
936
936
|
}
|
|
937
|
-
function
|
|
938
|
-
return /* @__PURE__ */
|
|
937
|
+
function K({ member: e, observation: t, onDirectedMessage: r, onRetry: i, onCancel: a, cancelPending: o = !1, cancelBusy: s = !1 }) {
|
|
938
|
+
return /* @__PURE__ */ A("section", {
|
|
939
939
|
className: "team-member-inspector",
|
|
940
940
|
children: [
|
|
941
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ A("div", {
|
|
942
942
|
className: "team-member-heading",
|
|
943
|
-
children: [/* @__PURE__ */
|
|
943
|
+
children: [/* @__PURE__ */ k(R, { name: e.name }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h3", { children: e.name }), /* @__PURE__ */ A("span", {
|
|
944
944
|
className: "team-muted",
|
|
945
945
|
children: [
|
|
946
946
|
e.role === "leader" ? "Leader" : "成员",
|
|
947
947
|
" · ",
|
|
948
|
-
|
|
948
|
+
I[e.executionStatus]
|
|
949
949
|
]
|
|
950
950
|
})] })]
|
|
951
951
|
}),
|
|
952
|
-
e.responsibility && /* @__PURE__ */
|
|
952
|
+
e.responsibility && /* @__PURE__ */ k("p", {
|
|
953
953
|
className: "team-member-responsibility",
|
|
954
954
|
children: e.responsibility
|
|
955
955
|
}),
|
|
956
|
-
/* @__PURE__ */
|
|
956
|
+
/* @__PURE__ */ A("div", {
|
|
957
957
|
className: "team-member-actions",
|
|
958
|
-
children: [r && /* @__PURE__ */
|
|
958
|
+
children: [r && /* @__PURE__ */ k("button", {
|
|
959
959
|
className: "team-button",
|
|
960
960
|
type: "button",
|
|
961
961
|
onClick: r,
|
|
962
962
|
children: "在群内 @成员"
|
|
963
|
-
}), a && e.binding.capabilities.cancel && e.activeRunId && /* @__PURE__ */
|
|
963
|
+
}), a && e.binding.capabilities.cancel && e.activeRunId && /* @__PURE__ */ k("button", {
|
|
964
964
|
className: "team-button",
|
|
965
965
|
type: "button",
|
|
966
966
|
disabled: o || s,
|
|
@@ -968,75 +968,75 @@ function ae({ member: e, observation: n, onDirectedMessage: r, onRetry: i, onCan
|
|
|
968
968
|
children: s ? "正在提交…" : o ? "已请求停止" : "请求停止此执行"
|
|
969
969
|
})]
|
|
970
970
|
}),
|
|
971
|
-
/* @__PURE__ */
|
|
971
|
+
/* @__PURE__ */ k("p", {
|
|
972
972
|
className: "team-observer-note",
|
|
973
973
|
children: "执行详情只读。关闭面板不会停止成员。"
|
|
974
974
|
}),
|
|
975
|
-
|
|
976
|
-
/* @__PURE__ */
|
|
975
|
+
t ? /* @__PURE__ */ A(O, { children: [
|
|
976
|
+
/* @__PURE__ */ k("span", {
|
|
977
977
|
className: "team-connection",
|
|
978
978
|
role: "status",
|
|
979
|
-
children:
|
|
979
|
+
children: L[t.connection]
|
|
980
980
|
}),
|
|
981
|
-
|
|
981
|
+
t.error && /* @__PURE__ */ k("p", {
|
|
982
982
|
role: "alert",
|
|
983
983
|
className: "team-inline-error",
|
|
984
|
-
children:
|
|
984
|
+
children: t.error
|
|
985
985
|
}),
|
|
986
|
-
|
|
986
|
+
t.connection === "offline" && i && /* @__PURE__ */ k("button", {
|
|
987
987
|
className: "team-button",
|
|
988
988
|
type: "button",
|
|
989
989
|
onClick: i,
|
|
990
990
|
children: "重新连接"
|
|
991
991
|
}),
|
|
992
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ k("div", {
|
|
993
993
|
className: "team-member-transcript",
|
|
994
|
-
children:
|
|
994
|
+
children: t.items.filter((e) => e.visibility === "public" && !(e.kind === "progress" && Object.keys(e.payload).length === 0)).map((e) => /* @__PURE__ */ A("article", {
|
|
995
995
|
className: "team-observer-item",
|
|
996
|
-
children: [/* @__PURE__ */
|
|
996
|
+
children: [/* @__PURE__ */ k("span", {
|
|
997
997
|
className: "team-eyebrow",
|
|
998
998
|
children: e.kind === "assistant_text" ? "回复" : e.kind === "user_message" ? "输入" : e.kind === "tool_call" ? "工具调用" : e.kind === "reasoning" ? "执行思考" : e.kind
|
|
999
|
-
}), typeof e.payload.text == "string" ? /* @__PURE__ */
|
|
999
|
+
}), typeof e.payload.text == "string" ? /* @__PURE__ */ k(n, { content: e.payload.text }) : typeof e.payload.error == "string" ? /* @__PURE__ */ k("p", {
|
|
1000
1000
|
className: "team-inline-error",
|
|
1001
1001
|
children: e.payload.error
|
|
1002
|
-
}) : /* @__PURE__ */
|
|
1002
|
+
}) : /* @__PURE__ */ A("details", {
|
|
1003
1003
|
className: "team-observer-details",
|
|
1004
|
-
children: [/* @__PURE__ */
|
|
1004
|
+
children: [/* @__PURE__ */ k("summary", { children: String(e.payload.tool || e.payload.summary || e.payload.title || (e.kind === "tool_call" ? "查看工具结果" : "查看事件详情")) }), /* @__PURE__ */ k("pre", { children: JSON.stringify(e.payload, null, 2) })]
|
|
1005
1005
|
})]
|
|
1006
1006
|
}, e.itemId))
|
|
1007
1007
|
}),
|
|
1008
|
-
!
|
|
1008
|
+
!t.items.length && /* @__PURE__ */ k("p", {
|
|
1009
1009
|
className: "team-muted",
|
|
1010
1010
|
children: "尚无可展示的运行事件。"
|
|
1011
1011
|
})
|
|
1012
|
-
] }) : /* @__PURE__ */
|
|
1012
|
+
] }) : /* @__PURE__ */ k("p", {
|
|
1013
1013
|
className: "team-muted",
|
|
1014
1014
|
children: e.activeRunId ? "正在读取执行详情…" : "当前没有进行中的执行。"
|
|
1015
1015
|
})
|
|
1016
1016
|
]
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
|
-
function
|
|
1020
|
-
return e.snapshot ? /* @__PURE__ */
|
|
1019
|
+
function ae(e) {
|
|
1020
|
+
return e.snapshot ? /* @__PURE__ */ k(oe, {
|
|
1021
1021
|
...e,
|
|
1022
1022
|
snapshot: e.snapshot
|
|
1023
|
-
}, `${e.snapshot.group.authorityRef}:${e.snapshot.group.groupId}`) : /* @__PURE__ */
|
|
1023
|
+
}, `${e.snapshot.group.authorityRef}:${e.snapshot.group.groupId}`) : /* @__PURE__ */ k("section", {
|
|
1024
1024
|
className: "ksadk-teams team-workspace",
|
|
1025
|
-
children: e.loading ? /* @__PURE__ */
|
|
1025
|
+
children: e.loading ? /* @__PURE__ */ A("div", {
|
|
1026
1026
|
className: "team-loading",
|
|
1027
1027
|
role: "status",
|
|
1028
1028
|
"aria-label": "正在加载群组",
|
|
1029
1029
|
children: [
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ k("span", {}),
|
|
1031
|
+
/* @__PURE__ */ k("span", {}),
|
|
1032
|
+
/* @__PURE__ */ k("span", {})
|
|
1033
1033
|
]
|
|
1034
|
-
}) : /* @__PURE__ */
|
|
1034
|
+
}) : /* @__PURE__ */ A("div", {
|
|
1035
1035
|
className: "team-empty",
|
|
1036
1036
|
children: [
|
|
1037
|
-
/* @__PURE__ */
|
|
1038
|
-
/* @__PURE__ */
|
|
1039
|
-
e.onRetry && /* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ k("h2", { children: e.error ? "群组暂不可用" : "选择一个团队,开始协作" }),
|
|
1038
|
+
/* @__PURE__ */ k("p", { children: e.error || "创建群组并选择 Leader,让各有所长的 Agent 共同完成目标。" }),
|
|
1039
|
+
e.onRetry && /* @__PURE__ */ k("button", {
|
|
1040
1040
|
type: "button",
|
|
1041
1041
|
className: "team-button",
|
|
1042
1042
|
onClick: e.onRetry,
|
|
@@ -1046,306 +1046,306 @@ function oe(e) {
|
|
|
1046
1046
|
})
|
|
1047
1047
|
});
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1050
|
-
let [
|
|
1049
|
+
function oe({ snapshot: e, connection: t = "connected", draft: r, onDraftChange: i, initialDrafts: a, initialSelection: o, onSelectionChange: s, onSend: c, onRetry: l, error: u, onManage: d, serverAuthority: f, standbyCandidates: m, onConfigureStandby: _, onLoadReconciliation: y, onReconcile: b, onControl: S, onAcceptRun: C, onTaskAction: w, onRespondInteraction: D, onOpenArtifact: j, onMemberSelect: N, renderMember: P, onLoadExecution: F }) {
|
|
1050
|
+
let [I, L] = E(a?.[o?.teamRunId || p(e)?.teamRunId || ""] || ""), [R, ne] = E(""), [ae, oe] = E(0), [J, Y] = E(null), [ce, X] = E(!1), [le, ue] = E(o?.taskId ?? ""), [Z, de] = E(o?.teamRunId || p(e)?.teamRunId || ""), [fe, pe] = E(!1), [me, he] = E(""), [ge, _e] = E(), [Q, ve] = E(!1), [ye, be] = E(""), [xe, Se] = E(!1), [Ce, we] = E(""), Te = T(null), Ee = T(null), De = T(new Map(Object.entries(a || {}).map(([e, t]) => [e, {
|
|
1051
1051
|
text: t,
|
|
1052
1052
|
recipient: ""
|
|
1053
|
-
}]))),
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
}, [
|
|
1057
|
-
let
|
|
1058
|
-
function
|
|
1059
|
-
|
|
1053
|
+
}]))), $ = e.teamRuns.find((e) => e.teamRunId === Z) ?? null, Oe = !!(Z && !$), ke = e.tasks.filter((e) => e.teamRunId === $?.teamRunId);
|
|
1054
|
+
x(() => {
|
|
1055
|
+
$ && pe(!1);
|
|
1056
|
+
}, [$]);
|
|
1057
|
+
let Ae = $ ? e.runMembers?.filter((e) => e.teamRunId === $.teamRunId) : void 0, je = $ && e.runMembers ? Ae || [] : e.members.filter((e) => e.status !== "removed"), Me = ke.find((e) => e.taskId === le), Ne = je.find((e) => e.memberId === me), Pe = [...e.deliveries.filter((e) => e.teamRunId === $?.teamRunId).map((e) => e.runId), ...ke.flatMap((e) => e.attempts.map((e) => e.source?.runId))].filter(Boolean), Fe = !e.runMembers && e.teamRuns.length === 1, Ie = (e) => !!($ && (Pe.includes(e.runId) || Ae?.some((t) => t.sessionId === e.sessionId) || Fe && je.some((t) => t.sessionId === e.sessionId))), Le = e.interactions.filter((e) => Ie(e.ref)), Re = [...new Map([...(e.artifacts || []).filter((e) => Ie(e.source)), ...ke.flatMap((e) => e.attempts.flatMap((e) => e.artifacts))].filter((t) => t.source.groupId === e.group.groupId && t.source.authorityRef === e.group.authorityRef).map((e) => [e.artifactId, e])).values()], ze = Le.filter((e) => e.status === "pending").length + (($?.policy || e.group.policy)?.taskAcceptance === "leader" ? 0 : ke.filter((e) => g(e) === "attention").length), Be = r ?? I;
|
|
1058
|
+
function Ve(e) {
|
|
1059
|
+
L(e), i?.(e, Z), De.current.set(Z, {
|
|
1060
1060
|
text: e,
|
|
1061
|
-
recipient:
|
|
1061
|
+
recipient: R
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1065
|
-
|
|
1066
|
-
text:
|
|
1067
|
-
recipient:
|
|
1064
|
+
function He(e) {
|
|
1065
|
+
De.current.set(Z, {
|
|
1066
|
+
text: Be,
|
|
1067
|
+
recipient: R
|
|
1068
1068
|
});
|
|
1069
|
-
let t =
|
|
1070
|
-
|
|
1069
|
+
let t = De.current.get(e);
|
|
1070
|
+
de(e), pe(!1), ue(""), he(""), _e(void 0), ne(t?.recipient || ""), L(t?.text || ""), i?.(t?.text || "", e), be(""), Se(!1), we(""), X(!1), s?.({
|
|
1071
1071
|
teamRunId: e,
|
|
1072
1072
|
taskId: ""
|
|
1073
1073
|
});
|
|
1074
1074
|
}
|
|
1075
|
-
function
|
|
1076
|
-
|
|
1077
|
-
teamRunId:
|
|
1075
|
+
function Ue(e) {
|
|
1076
|
+
ue(e), s?.({
|
|
1077
|
+
teamRunId: $?.teamRunId ?? "",
|
|
1078
1078
|
taskId: e
|
|
1079
1079
|
});
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1082
|
-
|
|
1081
|
+
function We(e) {
|
|
1082
|
+
Ee.current = document.activeElement, Y(e), he("");
|
|
1083
1083
|
}
|
|
1084
1084
|
function Ge() {
|
|
1085
|
-
|
|
1085
|
+
Y(null), X(!1), Ee.current?.focus();
|
|
1086
1086
|
}
|
|
1087
1087
|
function Ke(e) {
|
|
1088
|
-
|
|
1088
|
+
ne(e.memberId), Y(null), X(!1), oe((e) => e + 1);
|
|
1089
1089
|
}
|
|
1090
1090
|
function qe(e) {
|
|
1091
|
-
|
|
1091
|
+
_e(void 0), he(e.memberId), Y("members"), N?.(e);
|
|
1092
1092
|
}
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
}, [
|
|
1093
|
+
x(() => {
|
|
1094
|
+
J && Te.current?.focus();
|
|
1095
|
+
}, [J]);
|
|
1096
1096
|
async function Je(e) {
|
|
1097
|
-
if (!(
|
|
1098
|
-
|
|
1097
|
+
if (!(!$ || !S || Q)) {
|
|
1098
|
+
ve(!0), be("");
|
|
1099
1099
|
try {
|
|
1100
|
-
await
|
|
1100
|
+
await S($, e);
|
|
1101
1101
|
} catch (e) {
|
|
1102
|
-
|
|
1102
|
+
be(e instanceof Error ? e.message : "操作失败。");
|
|
1103
1103
|
} finally {
|
|
1104
|
-
|
|
1104
|
+
ve(!1);
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
1108
|
async function Ye(e) {
|
|
1109
|
-
if (!(
|
|
1110
|
-
if (!e && !
|
|
1111
|
-
|
|
1109
|
+
if (!(!$ || !C || Q)) {
|
|
1110
|
+
if (!e && !Ce.trim()) {
|
|
1111
|
+
be("请说明需要修改的内容。");
|
|
1112
1112
|
return;
|
|
1113
1113
|
}
|
|
1114
|
-
|
|
1114
|
+
ve(!0), be("");
|
|
1115
1115
|
try {
|
|
1116
|
-
await
|
|
1116
|
+
await C($, e, e ? void 0 : Ce.trim()), Se(!1), we("");
|
|
1117
1117
|
} catch (e) {
|
|
1118
|
-
|
|
1118
|
+
be(e instanceof Error ? e.message : "验收提交失败。");
|
|
1119
1119
|
} finally {
|
|
1120
|
-
|
|
1120
|
+
ve(!1);
|
|
1121
1121
|
}
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
1124
|
async function Xe(e) {
|
|
1125
|
-
let t = await
|
|
1126
|
-
return t?.teamRunId && !e.teamRunId && ["accepted", "duplicate"].includes(t.status) && (
|
|
1125
|
+
let t = await c(e);
|
|
1126
|
+
return t?.teamRunId && !e.teamRunId && ["accepted", "duplicate"].includes(t.status) && (De.current.set("", {
|
|
1127
1127
|
text: "",
|
|
1128
1128
|
recipient: ""
|
|
1129
|
-
}),
|
|
1129
|
+
}), de(t.teamRunId), pe(!0), L(""), i?.("", ""), ne(""), s?.({
|
|
1130
1130
|
teamRunId: t.teamRunId,
|
|
1131
1131
|
taskId: ""
|
|
1132
1132
|
})), t;
|
|
1133
1133
|
}
|
|
1134
|
-
let Ze =
|
|
1134
|
+
let Ze = $?.status === "awaiting_acceptance" && C && /* @__PURE__ */ A("section", {
|
|
1135
1135
|
className: "team-final-delivery",
|
|
1136
1136
|
"aria-label": "最终验收",
|
|
1137
1137
|
children: [
|
|
1138
|
-
/* @__PURE__ */
|
|
1138
|
+
/* @__PURE__ */ k("span", {
|
|
1139
1139
|
className: "team-eyebrow",
|
|
1140
1140
|
children: "团队已提交成果"
|
|
1141
1141
|
}),
|
|
1142
|
-
/* @__PURE__ */
|
|
1143
|
-
|
|
1142
|
+
/* @__PURE__ */ k("h3", { children: "请确认这次交付" }),
|
|
1143
|
+
$.result && /* @__PURE__ */ k("div", {
|
|
1144
1144
|
className: "team-final-summary",
|
|
1145
|
-
children: /* @__PURE__ */
|
|
1145
|
+
children: /* @__PURE__ */ k(n, { content: $.result })
|
|
1146
1146
|
}),
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
|
|
1147
|
+
/* @__PURE__ */ k("p", { children: "验收通过后完成任务;提出修改会交给 Leader 继续推进。" }),
|
|
1148
|
+
xe && /* @__PURE__ */ A("label", {
|
|
1149
1149
|
className: "team-field",
|
|
1150
|
-
children: ["修改意见", /* @__PURE__ */
|
|
1151
|
-
value:
|
|
1152
|
-
onChange: (e) =>
|
|
1150
|
+
children: ["修改意见", /* @__PURE__ */ k("textarea", {
|
|
1151
|
+
value: Ce,
|
|
1152
|
+
onChange: (e) => we(e.target.value),
|
|
1153
1153
|
placeholder: "哪些内容需要调整?期望是什么?",
|
|
1154
1154
|
rows: 3,
|
|
1155
1155
|
maxLength: 2e3,
|
|
1156
|
-
disabled:
|
|
1156
|
+
disabled: Q
|
|
1157
1157
|
})]
|
|
1158
1158
|
}),
|
|
1159
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ k("div", {
|
|
1160
1160
|
className: "team-task-actions",
|
|
1161
|
-
children:
|
|
1161
|
+
children: xe ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
|
|
1162
1162
|
className: "team-button",
|
|
1163
1163
|
type: "button",
|
|
1164
|
-
disabled:
|
|
1165
|
-
onClick: () =>
|
|
1164
|
+
disabled: Q,
|
|
1165
|
+
onClick: () => Se(!1),
|
|
1166
1166
|
children: "取消修改"
|
|
1167
|
-
}), /* @__PURE__ */
|
|
1167
|
+
}), /* @__PURE__ */ k("button", {
|
|
1168
1168
|
className: "team-button team-primary",
|
|
1169
1169
|
type: "button",
|
|
1170
|
-
disabled:
|
|
1170
|
+
disabled: Q || !Ce.trim(),
|
|
1171
1171
|
onClick: () => void Ye(!1),
|
|
1172
1172
|
children: "提交修改意见"
|
|
1173
|
-
})] }) : /* @__PURE__ */
|
|
1173
|
+
})] }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
|
|
1174
1174
|
className: "team-button",
|
|
1175
1175
|
type: "button",
|
|
1176
|
-
disabled:
|
|
1177
|
-
onClick: () =>
|
|
1176
|
+
disabled: Q,
|
|
1177
|
+
onClick: () => Se(!0),
|
|
1178
1178
|
children: "提出修改"
|
|
1179
|
-
}), /* @__PURE__ */
|
|
1179
|
+
}), /* @__PURE__ */ k("button", {
|
|
1180
1180
|
className: "team-button team-primary",
|
|
1181
1181
|
type: "button",
|
|
1182
|
-
disabled:
|
|
1182
|
+
disabled: Q,
|
|
1183
1183
|
onClick: () => void Ye(!0),
|
|
1184
1184
|
children: "通过验收"
|
|
1185
1185
|
})] })
|
|
1186
1186
|
}),
|
|
1187
|
-
|
|
1187
|
+
ye && /* @__PURE__ */ k("p", {
|
|
1188
1188
|
role: "alert",
|
|
1189
1189
|
className: "team-inline-error",
|
|
1190
|
-
children:
|
|
1190
|
+
children: ye
|
|
1191
1191
|
})
|
|
1192
1192
|
]
|
|
1193
1193
|
});
|
|
1194
|
-
return /* @__PURE__ */
|
|
1194
|
+
return /* @__PURE__ */ A("section", {
|
|
1195
1195
|
className: "ksadk-teams team-workspace",
|
|
1196
|
-
"data-panel":
|
|
1197
|
-
"data-execution":
|
|
1196
|
+
"data-panel": J || "closed",
|
|
1197
|
+
"data-execution": ce ? "open" : "closed",
|
|
1198
1198
|
children: [
|
|
1199
|
-
/* @__PURE__ */
|
|
1199
|
+
/* @__PURE__ */ k(V, {
|
|
1200
1200
|
snapshot: e,
|
|
1201
|
-
connection:
|
|
1202
|
-
onProgress: () =>
|
|
1203
|
-
onMembers: () =>
|
|
1204
|
-
onManage:
|
|
1201
|
+
connection: t,
|
|
1202
|
+
onProgress: () => We("tasks"),
|
|
1203
|
+
onMembers: () => We("members"),
|
|
1204
|
+
onManage: d
|
|
1205
1205
|
}),
|
|
1206
|
-
|
|
1206
|
+
u && /* @__PURE__ */ A("div", {
|
|
1207
1207
|
className: "team-top-error",
|
|
1208
1208
|
role: "alert",
|
|
1209
|
-
children: [
|
|
1209
|
+
children: [u, l && /* @__PURE__ */ k("button", {
|
|
1210
1210
|
className: "team-text-button",
|
|
1211
1211
|
type: "button",
|
|
1212
|
-
onClick:
|
|
1212
|
+
onClick: l,
|
|
1213
1213
|
children: "重新连接"
|
|
1214
1214
|
})]
|
|
1215
1215
|
}),
|
|
1216
|
-
/* @__PURE__ */
|
|
1216
|
+
/* @__PURE__ */ A("div", {
|
|
1217
1217
|
className: "team-body",
|
|
1218
1218
|
children: [
|
|
1219
|
-
/* @__PURE__ */
|
|
1219
|
+
/* @__PURE__ */ A("nav", {
|
|
1220
1220
|
className: "team-run-directory",
|
|
1221
1221
|
"aria-label": "团队任务",
|
|
1222
|
-
children: [/* @__PURE__ */
|
|
1222
|
+
children: [/* @__PURE__ */ A("header", { children: [/* @__PURE__ */ k("h2", { children: "任务" }), /* @__PURE__ */ k("button", {
|
|
1223
1223
|
type: "button",
|
|
1224
1224
|
className: "team-text-button",
|
|
1225
1225
|
onClick: () => {
|
|
1226
|
-
|
|
1226
|
+
He(""), oe((e) => e + 1);
|
|
1227
1227
|
},
|
|
1228
1228
|
children: "+ 新任务"
|
|
1229
|
-
})] }), /* @__PURE__ */
|
|
1229
|
+
})] }), /* @__PURE__ */ A("div", {
|
|
1230
1230
|
className: "team-run-list",
|
|
1231
|
-
children: [[...e.teamRuns].reverse().map((e) => /* @__PURE__ */
|
|
1231
|
+
children: [[...e.teamRuns].reverse().map((e) => /* @__PURE__ */ A("button", {
|
|
1232
1232
|
type: "button",
|
|
1233
1233
|
className: "team-run-item",
|
|
1234
|
-
"aria-current": e.teamRunId ===
|
|
1235
|
-
onClick: () =>
|
|
1236
|
-
children: [/* @__PURE__ */
|
|
1237
|
-
}, e.teamRunId)), !e.teamRuns.length && /* @__PURE__ */
|
|
1234
|
+
"aria-current": e.teamRunId === Z ? "page" : void 0,
|
|
1235
|
+
onClick: () => He(e.teamRunId),
|
|
1236
|
+
children: [/* @__PURE__ */ k("strong", { children: e.goal }), /* @__PURE__ */ k(z, { status: e.status })]
|
|
1237
|
+
}, e.teamRunId)), !e.teamRuns.length && /* @__PURE__ */ k("p", {
|
|
1238
1238
|
className: "team-muted",
|
|
1239
1239
|
children: "每个目标是一个独立任务。"
|
|
1240
1240
|
})]
|
|
1241
1241
|
})]
|
|
1242
1242
|
}),
|
|
1243
|
-
/* @__PURE__ */
|
|
1243
|
+
/* @__PURE__ */ A("div", {
|
|
1244
1244
|
className: "team-chat-pane",
|
|
1245
|
-
"aria-hidden":
|
|
1245
|
+
"aria-hidden": ce || void 0,
|
|
1246
1246
|
children: [
|
|
1247
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ A("header", {
|
|
1248
1248
|
className: "team-task-heading",
|
|
1249
|
-
children: [/* @__PURE__ */
|
|
1249
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("span", {
|
|
1250
1250
|
className: "team-eyebrow",
|
|
1251
|
-
children:
|
|
1252
|
-
}), /* @__PURE__ */
|
|
1251
|
+
children: $ ? "当前任务" : "新的目标"
|
|
1252
|
+
}), /* @__PURE__ */ k("h2", { children: $?.goal || (Oe ? fe ? "正在同步任务…" : "未找到所选任务" : "希望团队完成什么?") })] }), /* @__PURE__ */ k("button", {
|
|
1253
1253
|
type: "button",
|
|
1254
1254
|
className: "team-button",
|
|
1255
1255
|
"aria-label": "查看任务详情",
|
|
1256
|
-
onClick: () =>
|
|
1256
|
+
onClick: () => We("tasks"),
|
|
1257
1257
|
children: "详情"
|
|
1258
1258
|
})]
|
|
1259
1259
|
}),
|
|
1260
|
-
/* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ A("label", {
|
|
1261
1261
|
className: "team-mobile-task-picker team-field",
|
|
1262
|
-
children: ["切换任务", /* @__PURE__ */
|
|
1263
|
-
value:
|
|
1264
|
-
onChange: (e) =>
|
|
1265
|
-
children: [/* @__PURE__ */
|
|
1262
|
+
children: ["切换任务", /* @__PURE__ */ A("select", {
|
|
1263
|
+
value: Z,
|
|
1264
|
+
onChange: (e) => He(e.target.value),
|
|
1265
|
+
children: [/* @__PURE__ */ k("option", {
|
|
1266
1266
|
value: "",
|
|
1267
1267
|
children: "+ 新任务"
|
|
1268
|
-
}), e.teamRuns.map((e) => /* @__PURE__ */
|
|
1268
|
+
}), e.teamRuns.map((e) => /* @__PURE__ */ k("option", {
|
|
1269
1269
|
value: e.teamRunId,
|
|
1270
1270
|
children: e.goal
|
|
1271
1271
|
}, e.teamRunId))]
|
|
1272
1272
|
})]
|
|
1273
1273
|
}),
|
|
1274
|
-
/* @__PURE__ */
|
|
1275
|
-
emptyState:
|
|
1274
|
+
/* @__PURE__ */ A(H, {
|
|
1275
|
+
emptyState: Oe ? /* @__PURE__ */ A("div", {
|
|
1276
1276
|
className: "team-empty",
|
|
1277
1277
|
role: "status",
|
|
1278
|
-
children: [/* @__PURE__ */
|
|
1278
|
+
children: [/* @__PURE__ */ k("p", { children: fe ? "正在读取刚创建的任务,消息已提交。" : "请从任务列表重新选择;当前输入不会发送到其他任务。" }), l && /* @__PURE__ */ k("button", {
|
|
1279
1279
|
className: "team-button",
|
|
1280
1280
|
type: "button",
|
|
1281
|
-
onClick:
|
|
1281
|
+
onClick: l,
|
|
1282
1282
|
children: "重新读取"
|
|
1283
1283
|
})]
|
|
1284
1284
|
}) : void 0,
|
|
1285
|
-
focusFinalDelivery: Ze ?
|
|
1286
|
-
messages: e.messages.filter((e) =>
|
|
1287
|
-
children: [
|
|
1285
|
+
focusFinalDelivery: Ze ? $?.teamRunId : void 0,
|
|
1286
|
+
messages: e.messages.filter((e) => $ ? e.teamRunId === $.teamRunId || Fe && !e.teamRunId : !1),
|
|
1287
|
+
children: [$ && /* @__PURE__ */ k(U, {
|
|
1288
1288
|
compact: !0,
|
|
1289
|
-
run:
|
|
1290
|
-
tasks:
|
|
1291
|
-
pendingCount:
|
|
1292
|
-
onOpen: () =>
|
|
1289
|
+
run: $,
|
|
1290
|
+
tasks: ke,
|
|
1291
|
+
pendingCount: ze,
|
|
1292
|
+
onOpen: () => We("tasks")
|
|
1293
1293
|
}), Ze]
|
|
1294
|
-
},
|
|
1295
|
-
|
|
1294
|
+
}, Z),
|
|
1295
|
+
ze > 0 && /* @__PURE__ */ A("button", {
|
|
1296
1296
|
type: "button",
|
|
1297
1297
|
className: "team-attention-banner",
|
|
1298
|
-
onClick: () =>
|
|
1298
|
+
onClick: () => We("tasks"),
|
|
1299
1299
|
children: [
|
|
1300
|
-
|
|
1300
|
+
ze,
|
|
1301
1301
|
" 项需要处理 ",
|
|
1302
|
-
/* @__PURE__ */
|
|
1302
|
+
/* @__PURE__ */ A("span", { children: ["查看 ", /* @__PURE__ */ k("span", {
|
|
1303
1303
|
"aria-hidden": "true",
|
|
1304
1304
|
children: "→"
|
|
1305
1305
|
})] })
|
|
1306
1306
|
]
|
|
1307
1307
|
}),
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
serverAuthority:
|
|
1308
|
+
/* @__PURE__ */ k(W, {
|
|
1309
|
+
serverAuthority: f,
|
|
1310
1310
|
referenceArtifacts: [...new Map([...e.artifacts || [], ...e.tasks.flatMap((e) => e.attempts.flatMap((e) => e.artifacts))].filter((t) => t.source.groupId === e.group.groupId && t.source.authorityRef === e.group.authorityRef).map((e) => [e.artifactId, e])).values()],
|
|
1311
|
-
artifacts:
|
|
1312
|
-
recipientMemberId:
|
|
1313
|
-
onRecipientChange:
|
|
1314
|
-
focusRequest:
|
|
1315
|
-
members:
|
|
1316
|
-
activeRun:
|
|
1317
|
-
value:
|
|
1318
|
-
onChange:
|
|
1311
|
+
artifacts: Re,
|
|
1312
|
+
recipientMemberId: R,
|
|
1313
|
+
onRecipientChange: ne,
|
|
1314
|
+
focusRequest: ae,
|
|
1315
|
+
members: je,
|
|
1316
|
+
activeRun: $,
|
|
1317
|
+
value: Be,
|
|
1318
|
+
onChange: Ve,
|
|
1319
1319
|
onSend: Xe,
|
|
1320
|
-
disabled: e.group.status !== "active" ||
|
|
1320
|
+
disabled: e.group.status !== "active" || Oe
|
|
1321
1321
|
})
|
|
1322
1322
|
]
|
|
1323
1323
|
}),
|
|
1324
|
-
|
|
1324
|
+
J && /* @__PURE__ */ A("aside", {
|
|
1325
1325
|
className: "team-sidepanel",
|
|
1326
|
-
ref:
|
|
1326
|
+
ref: Te,
|
|
1327
1327
|
tabIndex: -1,
|
|
1328
1328
|
"aria-label": "任务详情",
|
|
1329
1329
|
onKeyDown: (e) => {
|
|
1330
1330
|
e.key === "Escape" && (e.stopPropagation(), Ge());
|
|
1331
1331
|
},
|
|
1332
1332
|
children: [
|
|
1333
|
-
/* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ A("header", {
|
|
1334
1334
|
className: "team-panel-header",
|
|
1335
|
-
children: [/* @__PURE__ */
|
|
1335
|
+
children: [/* @__PURE__ */ k("nav", {
|
|
1336
1336
|
className: "team-detail-tabs",
|
|
1337
1337
|
"aria-label": "任务详情分类",
|
|
1338
1338
|
children: [
|
|
1339
1339
|
["tasks", "进度"],
|
|
1340
1340
|
["members", "成员"],
|
|
1341
1341
|
["artifacts", "交付物"]
|
|
1342
|
-
].map(([e, t]) => /* @__PURE__ */
|
|
1342
|
+
].map(([e, t]) => /* @__PURE__ */ k("button", {
|
|
1343
1343
|
type: "button",
|
|
1344
|
-
"aria-pressed":
|
|
1345
|
-
onClick: () =>
|
|
1344
|
+
"aria-pressed": J === e,
|
|
1345
|
+
onClick: () => We(e),
|
|
1346
1346
|
children: t
|
|
1347
1347
|
}, e))
|
|
1348
|
-
}), /* @__PURE__ */
|
|
1348
|
+
}), /* @__PURE__ */ k("button", {
|
|
1349
1349
|
type: "button",
|
|
1350
1350
|
className: "team-button team-icon-button",
|
|
1351
1351
|
"aria-label": "关闭详情",
|
|
@@ -1353,125 +1353,125 @@ function se({ snapshot: e, connection: n = "connected", draft: r, onDraftChange:
|
|
|
1353
1353
|
children: "×"
|
|
1354
1354
|
})]
|
|
1355
1355
|
}),
|
|
1356
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ k("div", {
|
|
1357
1357
|
className: "team-panel-scroll",
|
|
1358
|
-
children:
|
|
1359
|
-
|
|
1358
|
+
children: J === "tasks" ? /* @__PURE__ */ A(O, { children: [
|
|
1359
|
+
$ && /* @__PURE__ */ A("div", {
|
|
1360
1360
|
className: "team-run-overview",
|
|
1361
1361
|
children: [
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
|
|
1365
|
-
|
|
1362
|
+
/* @__PURE__ */ k(z, { status: $.status }),
|
|
1363
|
+
/* @__PURE__ */ k(B, { goal: $.goal }),
|
|
1364
|
+
$.reason && /* @__PURE__ */ k("p", { children: $.reason }),
|
|
1365
|
+
S && h($.status) && /* @__PURE__ */ A("div", {
|
|
1366
1366
|
className: "team-run-actions",
|
|
1367
|
-
children: [/* @__PURE__ */
|
|
1367
|
+
children: [/* @__PURE__ */ k("button", {
|
|
1368
1368
|
className: "team-text-button",
|
|
1369
1369
|
type: "button",
|
|
1370
|
-
disabled:
|
|
1371
|
-
onClick: () => void Je(
|
|
1372
|
-
children:
|
|
1373
|
-
}), /* @__PURE__ */
|
|
1370
|
+
disabled: Q || $.status === "cancel_requested",
|
|
1371
|
+
onClick: () => void Je($.dispatchSuspended ? "resume_dispatch" : "suspend_dispatch"),
|
|
1372
|
+
children: $.dispatchSuspended ? "继续协作" : "暂停派发"
|
|
1373
|
+
}), /* @__PURE__ */ k("button", {
|
|
1374
1374
|
className: "team-text-button team-danger",
|
|
1375
1375
|
type: "button",
|
|
1376
|
-
disabled:
|
|
1376
|
+
disabled: Q || $.status === "cancel_requested",
|
|
1377
1377
|
onClick: () => void Je("stop"),
|
|
1378
1378
|
children: "停止任务"
|
|
1379
1379
|
})]
|
|
1380
1380
|
}),
|
|
1381
|
-
|
|
1381
|
+
ye && !Ze && /* @__PURE__ */ k("p", {
|
|
1382
1382
|
role: "alert",
|
|
1383
1383
|
className: "team-inline-error",
|
|
1384
|
-
children:
|
|
1384
|
+
children: ye
|
|
1385
1385
|
}),
|
|
1386
|
-
/* @__PURE__ */
|
|
1387
|
-
run:
|
|
1388
|
-
enabled:
|
|
1389
|
-
candidates:
|
|
1390
|
-
configure:
|
|
1386
|
+
/* @__PURE__ */ k(se, {
|
|
1387
|
+
run: $,
|
|
1388
|
+
enabled: f,
|
|
1389
|
+
candidates: m || [],
|
|
1390
|
+
configure: _
|
|
1391
1391
|
}),
|
|
1392
|
-
/* @__PURE__ */
|
|
1393
|
-
run:
|
|
1394
|
-
onLoadReconciliation:
|
|
1395
|
-
onReconcile:
|
|
1396
|
-
},
|
|
1397
|
-
/* @__PURE__ */
|
|
1392
|
+
/* @__PURE__ */ k(M, {
|
|
1393
|
+
run: $,
|
|
1394
|
+
onLoadReconciliation: y,
|
|
1395
|
+
onReconcile: b
|
|
1396
|
+
}, $.teamRunId),
|
|
1397
|
+
/* @__PURE__ */ A("details", {
|
|
1398
1398
|
className: "team-run-budget",
|
|
1399
|
-
children: [/* @__PURE__ */
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
|
|
1399
|
+
children: [/* @__PURE__ */ k("summary", { children: "执行限额" }), /* @__PURE__ */ A("dl", { children: [
|
|
1400
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", { children: "累计启动" }), /* @__PURE__ */ A("dd", { children: [
|
|
1401
|
+
$.budget.startsUsed,
|
|
1402
1402
|
" / ",
|
|
1403
|
-
|
|
1403
|
+
$.budget.maxStarts
|
|
1404
1404
|
] })] }),
|
|
1405
|
-
/* @__PURE__ */
|
|
1405
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", { children: "同时执行" }), /* @__PURE__ */ A("dd", { children: [
|
|
1406
1406
|
"最多 ",
|
|
1407
|
-
|
|
1407
|
+
$.budget.maxConcurrent,
|
|
1408
1408
|
" 个"
|
|
1409
1409
|
] })] }),
|
|
1410
|
-
|
|
1411
|
-
|
|
1410
|
+
$.budget.maxTokens && /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", { children: "Token" }), /* @__PURE__ */ A("dd", { children: [
|
|
1411
|
+
$.budget.tokensUsed ?? 0,
|
|
1412
1412
|
" / ",
|
|
1413
|
-
|
|
1413
|
+
$.budget.maxTokens
|
|
1414
1414
|
] })] }),
|
|
1415
|
-
|
|
1415
|
+
$.budget.maxDurationSeconds && /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("dt", { children: "主动执行时限" }), /* @__PURE__ */ A("dd", { children: [Math.round($.budget.maxDurationSeconds / 60), " 分钟"] })] })
|
|
1416
1416
|
] })]
|
|
1417
1417
|
})
|
|
1418
1418
|
]
|
|
1419
1419
|
}),
|
|
1420
|
-
|
|
1421
|
-
interactions:
|
|
1422
|
-
members:
|
|
1423
|
-
onRespond:
|
|
1420
|
+
D && /* @__PURE__ */ k(re, {
|
|
1421
|
+
interactions: Le,
|
|
1422
|
+
members: je,
|
|
1423
|
+
onRespond: D
|
|
1424
1424
|
}),
|
|
1425
|
-
|
|
1425
|
+
Me ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
|
|
1426
1426
|
className: "team-text-button team-back",
|
|
1427
1427
|
type: "button",
|
|
1428
|
-
onClick: () =>
|
|
1428
|
+
onClick: () => Ue(""),
|
|
1429
1429
|
children: "← 所有分工"
|
|
1430
|
-
}), /* @__PURE__ */
|
|
1431
|
-
task:
|
|
1432
|
-
members:
|
|
1433
|
-
onAction: (
|
|
1434
|
-
onOpenArtifact:
|
|
1430
|
+
}), /* @__PURE__ */ k(te, {
|
|
1431
|
+
task: Me,
|
|
1432
|
+
members: je,
|
|
1433
|
+
onAction: ($?.policy || e.group.policy)?.taskAcceptance === "leader" ? void 0 : w,
|
|
1434
|
+
onOpenArtifact: j,
|
|
1435
1435
|
onMemberSelect: qe
|
|
1436
|
-
},
|
|
1437
|
-
tasks:
|
|
1438
|
-
members:
|
|
1439
|
-
selectedTaskId:
|
|
1440
|
-
onSelect: (e) =>
|
|
1436
|
+
}, Me.taskId)] }) : /* @__PURE__ */ k(ee, {
|
|
1437
|
+
tasks: ke,
|
|
1438
|
+
members: je,
|
|
1439
|
+
selectedTaskId: le,
|
|
1440
|
+
onSelect: (e) => Ue(e.taskId)
|
|
1441
1441
|
})
|
|
1442
|
-
] }) :
|
|
1442
|
+
] }) : J === "artifacts" ? /* @__PURE__ */ A("section", {
|
|
1443
1443
|
className: "team-artifact-list",
|
|
1444
|
-
children: [/* @__PURE__ */
|
|
1444
|
+
children: [/* @__PURE__ */ k("h3", { children: "任务交付物" }), Re.length ? Re.map((e) => /* @__PURE__ */ k(G, {
|
|
1445
1445
|
artifact: e,
|
|
1446
|
-
onOpen:
|
|
1447
|
-
}, e.artifactId)) : /* @__PURE__ */
|
|
1446
|
+
onOpen: j
|
|
1447
|
+
}, e.artifactId)) : /* @__PURE__ */ k("p", {
|
|
1448
1448
|
className: "team-muted",
|
|
1449
1449
|
children: "成员发布的成果会保存在这里。"
|
|
1450
1450
|
})]
|
|
1451
|
-
}) :
|
|
1451
|
+
}) : Ne ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
|
|
1452
1452
|
className: "team-text-button team-back",
|
|
1453
1453
|
type: "button",
|
|
1454
|
-
onClick: () =>
|
|
1454
|
+
onClick: () => he(""),
|
|
1455
1455
|
children: "← 所有成员"
|
|
1456
|
-
}),
|
|
1457
|
-
directedMessage: () => Ke(
|
|
1458
|
-
teamRunId:
|
|
1459
|
-
},
|
|
1460
|
-
member:
|
|
1461
|
-
onDirectedMessage: () => Ke(
|
|
1462
|
-
})] }) : /* @__PURE__ */
|
|
1463
|
-
members:
|
|
1464
|
-
selectedMemberId:
|
|
1456
|
+
}), P?.(Ne, {
|
|
1457
|
+
directedMessage: () => Ke(Ne),
|
|
1458
|
+
teamRunId: $?.teamRunId
|
|
1459
|
+
}, ge) ?? /* @__PURE__ */ k(K, {
|
|
1460
|
+
member: Ne,
|
|
1461
|
+
onDirectedMessage: () => Ke(Ne)
|
|
1462
|
+
})] }) : /* @__PURE__ */ k(ie, {
|
|
1463
|
+
members: je,
|
|
1464
|
+
selectedMemberId: me,
|
|
1465
1465
|
onSelect: qe
|
|
1466
1466
|
})
|
|
1467
1467
|
}),
|
|
1468
|
-
|
|
1468
|
+
J === "tasks" && (ke.length > 0 || !!(F && $)) && /* @__PURE__ */ k("footer", {
|
|
1469
1469
|
className: "team-panel-footer",
|
|
1470
|
-
children: /* @__PURE__ */
|
|
1470
|
+
children: /* @__PURE__ */ A("button", {
|
|
1471
1471
|
className: "team-button team-expand",
|
|
1472
1472
|
type: "button",
|
|
1473
|
-
onClick: () =>
|
|
1474
|
-
children: ["查看执行详情 ", /* @__PURE__ */
|
|
1473
|
+
onClick: () => X(!0),
|
|
1474
|
+
children: ["查看执行详情 ", /* @__PURE__ */ k("span", {
|
|
1475
1475
|
"aria-hidden": "true",
|
|
1476
1476
|
children: "↗"
|
|
1477
1477
|
})]
|
|
@@ -1479,43 +1479,43 @@ function se({ snapshot: e, connection: n = "connected", draft: r, onDraftChange:
|
|
|
1479
1479
|
})
|
|
1480
1480
|
]
|
|
1481
1481
|
}),
|
|
1482
|
-
|
|
1482
|
+
ce && /* @__PURE__ */ A("section", {
|
|
1483
1483
|
className: "team-execution-workspace",
|
|
1484
1484
|
"aria-label": "执行工作台",
|
|
1485
|
-
children: [/* @__PURE__ */
|
|
1485
|
+
children: [/* @__PURE__ */ A("header", {
|
|
1486
1486
|
className: "team-panel-header",
|
|
1487
|
-
children: [/* @__PURE__ */
|
|
1487
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("span", {
|
|
1488
1488
|
className: "team-eyebrow",
|
|
1489
1489
|
children: "执行详情"
|
|
1490
|
-
}), /* @__PURE__ */
|
|
1490
|
+
}), /* @__PURE__ */ k("h2", { children: $?.goal })] }), /* @__PURE__ */ k("button", {
|
|
1491
1491
|
className: "team-button",
|
|
1492
1492
|
type: "button",
|
|
1493
|
-
onClick: () =>
|
|
1493
|
+
onClick: () => X(!1),
|
|
1494
1494
|
children: "返回聊天"
|
|
1495
1495
|
})]
|
|
1496
|
-
}), /* @__PURE__ */
|
|
1497
|
-
fallback: /* @__PURE__ */
|
|
1496
|
+
}), /* @__PURE__ */ k(v, {
|
|
1497
|
+
fallback: /* @__PURE__ */ A("div", {
|
|
1498
1498
|
className: "team-loading",
|
|
1499
1499
|
role: "status",
|
|
1500
1500
|
"aria-label": "正在加载执行视图",
|
|
1501
|
-
children: [/* @__PURE__ */
|
|
1501
|
+
children: [/* @__PURE__ */ k("span", {}), /* @__PURE__ */ k("span", {})]
|
|
1502
1502
|
}),
|
|
1503
|
-
children: /* @__PURE__ */
|
|
1503
|
+
children: /* @__PURE__ */ k(q, {
|
|
1504
1504
|
authorityRef: e.group.authorityRef,
|
|
1505
1505
|
groupId: e.group.groupId,
|
|
1506
|
-
teamRunId:
|
|
1506
|
+
teamRunId: $?.teamRunId || "",
|
|
1507
1507
|
watermark: e.watermark,
|
|
1508
|
-
load:
|
|
1509
|
-
tasks:
|
|
1510
|
-
members:
|
|
1511
|
-
selectedTaskId:
|
|
1508
|
+
load: F,
|
|
1509
|
+
tasks: ke,
|
|
1510
|
+
members: je,
|
|
1511
|
+
selectedTaskId: le,
|
|
1512
1512
|
onSelect: (e) => {
|
|
1513
|
-
|
|
1513
|
+
Ue(e.taskId), X(!1), Y("tasks");
|
|
1514
1514
|
},
|
|
1515
1515
|
onSelectNode: (e) => {
|
|
1516
|
-
e.kind === "task" && e.taskId ? (
|
|
1516
|
+
e.kind === "task" && e.taskId ? (Ue(e.taskId), Y("tasks"), X(!1)) : e.source && (he(e.source.memberId), _e(e.source), Y("members"), X(!1));
|
|
1517
1517
|
}
|
|
1518
|
-
}, `${e.group.groupId}:${
|
|
1518
|
+
}, `${e.group.groupId}:${$?.teamRunId || ""}`)
|
|
1519
1519
|
})]
|
|
1520
1520
|
})
|
|
1521
1521
|
]
|
|
@@ -1523,75 +1523,75 @@ function se({ snapshot: e, connection: n = "connected", draft: r, onDraftChange:
|
|
|
1523
1523
|
]
|
|
1524
1524
|
});
|
|
1525
1525
|
}
|
|
1526
|
-
function
|
|
1527
|
-
let [i, a] =
|
|
1528
|
-
if (
|
|
1529
|
-
a(e.leaderStandby?.standbyBindingRef || ""),
|
|
1530
|
-
}, [e.teamRunId, e.leaderStandby]), !t || !r || !
|
|
1531
|
-
async function
|
|
1526
|
+
function se({ run: e, enabled: t, candidates: n, configure: r }) {
|
|
1527
|
+
let [i, a] = E(e.leaderStandby?.standbyBindingRef || ""), [o, s] = E(!1), [c, l] = E(""), [u, d] = E(e.leaderStandby), f = n.filter((e) => e.kind !== "local_build" && ["ready", "unchecked"].includes(e.availability?.state || "") && e.capabilities.leader && e.capabilities.enqueue);
|
|
1528
|
+
if (x(() => {
|
|
1529
|
+
a(e.leaderStandby?.standbyBindingRef || ""), l(""), d(e.leaderStandby);
|
|
1530
|
+
}, [e.teamRunId, e.leaderStandby]), !t || !r || !f.length && !u) return null;
|
|
1531
|
+
async function p() {
|
|
1532
1532
|
if (!(!i || o || !r)) {
|
|
1533
|
-
s(!0),
|
|
1533
|
+
s(!0), l("");
|
|
1534
1534
|
try {
|
|
1535
|
-
|
|
1535
|
+
d(await r(e, i));
|
|
1536
1536
|
} catch (e) {
|
|
1537
|
-
|
|
1537
|
+
l(e instanceof Error ? e.message : "备用配置失败。");
|
|
1538
1538
|
} finally {
|
|
1539
1539
|
s(!1);
|
|
1540
1540
|
}
|
|
1541
1541
|
}
|
|
1542
1542
|
}
|
|
1543
|
-
return /* @__PURE__ */
|
|
1543
|
+
return /* @__PURE__ */ A("details", {
|
|
1544
1544
|
className: "team-run-budget team-standby",
|
|
1545
1545
|
children: [
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
-
|
|
1546
|
+
/* @__PURE__ */ A("summary", { children: ["云端接管设置", u?.state === "active" ? " · 已接管" : u?.state === "blocked" ? " · 等待恢复" : ""] }),
|
|
1547
|
+
u && /* @__PURE__ */ k("p", {
|
|
1548
1548
|
role: "status",
|
|
1549
|
-
children:
|
|
1549
|
+
children: u.state === "active" ? "云端 Leader 已接管当前任务。" : u.state === "armed" ? "兼容的备用节点已配置;接管前会保存进度并核对原执行。" : {
|
|
1550
1550
|
standby_offline: "云端备用节点离线,正在等待恢复。",
|
|
1551
1551
|
checkpoint_required: "正在等待 Leader 保存可恢复的任务进度。",
|
|
1552
1552
|
execution_uncertain: "正在核对原执行结果,避免重复执行。"
|
|
1553
|
-
}[
|
|
1553
|
+
}[u.reason || ""] || "暂时无法接管,请检查执行状态。"
|
|
1554
1554
|
}),
|
|
1555
|
-
|
|
1556
|
-
/* @__PURE__ */
|
|
1555
|
+
h(e.status) && !!f.length && /* @__PURE__ */ A(O, { children: [
|
|
1556
|
+
/* @__PURE__ */ A("label", {
|
|
1557
1557
|
className: "team-field",
|
|
1558
|
-
children: ["Leader 备用节点", /* @__PURE__ */
|
|
1558
|
+
children: ["Leader 备用节点", /* @__PURE__ */ A("select", {
|
|
1559
1559
|
value: i,
|
|
1560
1560
|
onChange: (e) => a(e.target.value),
|
|
1561
1561
|
disabled: o,
|
|
1562
|
-
children: [/* @__PURE__ */
|
|
1562
|
+
children: [/* @__PURE__ */ k("option", {
|
|
1563
1563
|
value: "",
|
|
1564
1564
|
children: "选择云端节点,保存时检查"
|
|
1565
|
-
}),
|
|
1565
|
+
}), f.map((e) => /* @__PURE__ */ k("option", {
|
|
1566
1566
|
value: e.bindingRef,
|
|
1567
1567
|
children: e.name || e.agentId
|
|
1568
1568
|
}, e.bindingRef))]
|
|
1569
1569
|
})]
|
|
1570
1570
|
}),
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
/* @__PURE__ */
|
|
1571
|
+
/* @__PURE__ */ k("p", { children: "本地 Leader 失联后由备用节点继续。新任务沿用此配置;本地恢复时不抢回当前任务。" }),
|
|
1572
|
+
/* @__PURE__ */ k("button", {
|
|
1573
1573
|
type: "button",
|
|
1574
1574
|
className: "team-button",
|
|
1575
1575
|
disabled: o || !i,
|
|
1576
|
-
onClick: () => void
|
|
1576
|
+
onClick: () => void p(),
|
|
1577
1577
|
children: o ? "正在校验…" : "配置备用节点"
|
|
1578
1578
|
})
|
|
1579
1579
|
] }),
|
|
1580
|
-
|
|
1580
|
+
c && /* @__PURE__ */ k("p", {
|
|
1581
1581
|
role: "alert",
|
|
1582
1582
|
className: "team-inline-error",
|
|
1583
|
-
children:
|
|
1583
|
+
children: c
|
|
1584
1584
|
})
|
|
1585
1585
|
]
|
|
1586
1586
|
});
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1589
|
-
let o =
|
|
1590
|
-
|
|
1588
|
+
function q({ authorityRef: e, groupId: t, teamRunId: n, watermark: r, load: i, ...a }) {
|
|
1589
|
+
let o = T(i), s = !!i;
|
|
1590
|
+
x(() => {
|
|
1591
1591
|
o.current = i;
|
|
1592
1592
|
}, [i]);
|
|
1593
|
-
let [c, l] =
|
|
1594
|
-
return
|
|
1593
|
+
let [c, l] = E(null), [u, d] = E(""), [f, p] = E(!!i), [m, h] = E(0);
|
|
1594
|
+
return x(() => {
|
|
1595
1595
|
if (!o.current || !n) return;
|
|
1596
1596
|
let r = new AbortController();
|
|
1597
1597
|
return o.current(n, r.signal).then((i) => {
|
|
@@ -1602,227 +1602,227 @@ function ce({ authorityRef: e, groupId: t, teamRunId: n, watermark: r, load: i,
|
|
|
1602
1602
|
}).catch((e) => {
|
|
1603
1603
|
r.signal.aborted || d(e instanceof Error ? e.message : "执行视图加载失败。");
|
|
1604
1604
|
}).finally(() => {
|
|
1605
|
-
r.signal.aborted ||
|
|
1605
|
+
r.signal.aborted || p(!1);
|
|
1606
1606
|
}), () => r.abort();
|
|
1607
1607
|
}, [
|
|
1608
1608
|
e,
|
|
1609
1609
|
t,
|
|
1610
1610
|
n,
|
|
1611
1611
|
r,
|
|
1612
|
-
|
|
1612
|
+
m,
|
|
1613
1613
|
s
|
|
1614
|
-
]), /* @__PURE__ */
|
|
1614
|
+
]), /* @__PURE__ */ k(N, {
|
|
1615
1615
|
...a,
|
|
1616
1616
|
execution: c,
|
|
1617
1617
|
executionLoading: f,
|
|
1618
1618
|
executionError: u,
|
|
1619
1619
|
onRetryExecution: i ? () => {
|
|
1620
|
-
d(""),
|
|
1620
|
+
d(""), p(!0), h((e) => e + 1);
|
|
1621
1621
|
} : void 0
|
|
1622
1622
|
});
|
|
1623
1623
|
}
|
|
1624
1624
|
//#endregion
|
|
1625
1625
|
//#region src/core/teams/grouping.ts
|
|
1626
|
-
var
|
|
1627
|
-
function
|
|
1626
|
+
var J = (e) => `${e.binding.kind}:${e.binding.agentId}`, Y = (e) => e.binding.capabilities.enqueue && e.binding.availability?.state !== "unavailable";
|
|
1627
|
+
function ce(e) {
|
|
1628
1628
|
let t = /* @__PURE__ */ new Map();
|
|
1629
|
-
for (let n of e) t.set(
|
|
1630
|
-
return [...t.values()].map((e) => e.sort((e, t) => Number(
|
|
1629
|
+
for (let n of e) t.set(J(n), [...t.get(J(n)) || [], n]);
|
|
1630
|
+
return [...t.values()].map((e) => e.sort((e, t) => Number(Y(t)) - Number(Y(e)) || (t.binding.createdAt || "").localeCompare(e.binding.createdAt || "")));
|
|
1631
1631
|
}
|
|
1632
1632
|
//#endregion
|
|
1633
1633
|
//#region src/components/teams/CreateGroupDialog.tsx
|
|
1634
|
-
function
|
|
1635
|
-
let
|
|
1634
|
+
function X({ open: e, candidates: t, serverAuthority: n, loading: r, error: a, onRefresh: o, hasMore: s, onLoadMore: c, onClose: l, onCreate: u }) {
|
|
1635
|
+
let d = T(null), f = S(), [p, m] = E(""), [h, g] = E(""), [_, v] = E([]), [y, b] = E(""), [C, w] = E(""), [D, O] = E(!1), [j, M] = E(""), N = T(null), P = (e) => !!(n && e.binding.availability?.state === "unchecked"), F = (e) => Y(e) || P(e), I = (e) => F(e) && (e.binding.capabilities.leader || P(e)), L = _.map((e) => {
|
|
1636
1636
|
let n = t.find((t) => t.binding.bindingRef === e.binding.bindingRef);
|
|
1637
1637
|
return n ? {
|
|
1638
1638
|
...n,
|
|
1639
1639
|
memberId: e.memberId,
|
|
1640
1640
|
responsibility: e.responsibility
|
|
1641
1641
|
} : e;
|
|
1642
|
-
}),
|
|
1643
|
-
|
|
1644
|
-
let t =
|
|
1642
|
+
}), R = L.filter(I), z = R.some((e) => e.memberId === y) ? y : R[0]?.memberId ?? "", B = L.find((e) => e.memberId === z)?.binding.kind === "local_build", V = t.filter((e) => e.binding.kind === "cloud" && I(e)), H = V.some((e) => e.binding.bindingRef === C) ? C : "", U = ce(t).map((e) => e.sort((e, t) => Number(F(t)) - Number(F(e)))).filter((e) => e.some((e) => `${e.name} ${e.description || ""} ${e.binding.agentId}`.toLowerCase().includes(h.toLowerCase())));
|
|
1643
|
+
x(() => {
|
|
1644
|
+
let t = d.current;
|
|
1645
1645
|
if (!t) return;
|
|
1646
1646
|
let n = document.activeElement;
|
|
1647
1647
|
return e && !t.open && t.showModal(), !e && t.open && t.close(), () => {
|
|
1648
1648
|
t.open && t.close(), n?.focus();
|
|
1649
1649
|
};
|
|
1650
1650
|
}, [e]);
|
|
1651
|
-
function
|
|
1652
|
-
|
|
1651
|
+
function W(e, t) {
|
|
1652
|
+
v((n) => t ? [...n, e] : n.filter((t) => J(t) !== J(e)));
|
|
1653
1653
|
}
|
|
1654
|
-
async function
|
|
1655
|
-
if (
|
|
1656
|
-
|
|
1654
|
+
async function ee() {
|
|
1655
|
+
if (D || r) return;
|
|
1656
|
+
M("");
|
|
1657
1657
|
let e = {
|
|
1658
|
-
name:
|
|
1659
|
-
members:
|
|
1658
|
+
name: p.trim(),
|
|
1659
|
+
members: L.map((e) => ({
|
|
1660
1660
|
memberId: e.memberId,
|
|
1661
1661
|
name: e.name,
|
|
1662
1662
|
bindingRef: e.binding.bindingRef,
|
|
1663
1663
|
...e.responsibility?.trim() ? { responsibility: e.responsibility.trim() } : {}
|
|
1664
1664
|
})),
|
|
1665
|
-
leaderMemberId:
|
|
1666
|
-
...
|
|
1665
|
+
leaderMemberId: z,
|
|
1666
|
+
...n && B && H ? { leaderStandbyBindingRef: H } : {}
|
|
1667
1667
|
};
|
|
1668
1668
|
try {
|
|
1669
|
-
if (
|
|
1670
|
-
if (
|
|
1671
|
-
if (!
|
|
1669
|
+
if (i(e), L.length < 2) throw Error("请选择至少 2 位成员,一起组成团队。");
|
|
1670
|
+
if (L.some((e) => !t.some((t) => t.binding.bindingRef === e.binding.bindingRef && F(t)))) throw Error("已选成员中有 Agent 暂不可用,请更换版本或移除后重试。");
|
|
1671
|
+
if (!z) throw Error("所选成员中至少需要一位支持 Leader 的 Agent。");
|
|
1672
1672
|
} catch (e) {
|
|
1673
|
-
|
|
1673
|
+
M(e instanceof Error ? e.message : "团队配置无效。");
|
|
1674
1674
|
return;
|
|
1675
1675
|
}
|
|
1676
1676
|
let a = JSON.stringify(e);
|
|
1677
|
-
|
|
1677
|
+
N.current?.digest !== a && (N.current = {
|
|
1678
1678
|
digest: a,
|
|
1679
1679
|
idempotencyKey: `group-${globalThis.crypto.randomUUID()}`
|
|
1680
|
-
}),
|
|
1680
|
+
}), O(!0);
|
|
1681
1681
|
try {
|
|
1682
|
-
await
|
|
1682
|
+
await u({
|
|
1683
1683
|
...e,
|
|
1684
|
-
idempotencyKey:
|
|
1685
|
-
}),
|
|
1684
|
+
idempotencyKey: N.current.idempotencyKey
|
|
1685
|
+
}), m(""), g(""), v([]), b(""), w(""), N.current = null, l();
|
|
1686
1686
|
} catch (e) {
|
|
1687
|
-
|
|
1687
|
+
M(e instanceof Error ? e.message : "创建团队失败,已保留你的选择。");
|
|
1688
1688
|
} finally {
|
|
1689
|
-
|
|
1689
|
+
O(!1);
|
|
1690
1690
|
}
|
|
1691
1691
|
}
|
|
1692
|
-
return /* @__PURE__ */
|
|
1693
|
-
ref:
|
|
1692
|
+
return /* @__PURE__ */ k("dialog", {
|
|
1693
|
+
ref: d,
|
|
1694
1694
|
className: "ksadk-teams team-create-dialog",
|
|
1695
|
-
"aria-labelledby":
|
|
1695
|
+
"aria-labelledby": f,
|
|
1696
1696
|
onCancel: (e) => {
|
|
1697
|
-
e.preventDefault(),
|
|
1697
|
+
e.preventDefault(), D || l();
|
|
1698
1698
|
},
|
|
1699
|
-
children: /* @__PURE__ */
|
|
1699
|
+
children: /* @__PURE__ */ A("form", {
|
|
1700
1700
|
onSubmit: (e) => {
|
|
1701
|
-
e.preventDefault(),
|
|
1701
|
+
e.preventDefault(), ee();
|
|
1702
1702
|
},
|
|
1703
1703
|
children: [
|
|
1704
|
-
/* @__PURE__ */
|
|
1705
|
-
/* @__PURE__ */
|
|
1704
|
+
/* @__PURE__ */ A("header", { children: [/* @__PURE__ */ A("div", { children: [
|
|
1705
|
+
/* @__PURE__ */ k("span", {
|
|
1706
1706
|
className: "team-eyebrow",
|
|
1707
1707
|
children: "新的协作空间"
|
|
1708
1708
|
}),
|
|
1709
|
-
/* @__PURE__ */
|
|
1710
|
-
id:
|
|
1709
|
+
/* @__PURE__ */ k("h2", {
|
|
1710
|
+
id: f,
|
|
1711
1711
|
children: "组建团队"
|
|
1712
1712
|
}),
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
] }), /* @__PURE__ */
|
|
1713
|
+
/* @__PURE__ */ k("p", { children: "选择搭档,让 Leader 组织分工与复核。" })
|
|
1714
|
+
] }), /* @__PURE__ */ k("button", {
|
|
1715
1715
|
type: "button",
|
|
1716
1716
|
className: "team-button team-icon-button",
|
|
1717
1717
|
"aria-label": "关闭创建团队",
|
|
1718
|
-
onClick:
|
|
1719
|
-
disabled:
|
|
1718
|
+
onClick: l,
|
|
1719
|
+
disabled: D,
|
|
1720
1720
|
children: "×"
|
|
1721
1721
|
})] }),
|
|
1722
|
-
/* @__PURE__ */
|
|
1722
|
+
/* @__PURE__ */ A("div", {
|
|
1723
1723
|
className: "team-create-body",
|
|
1724
1724
|
children: [
|
|
1725
|
-
/* @__PURE__ */
|
|
1725
|
+
/* @__PURE__ */ A("label", {
|
|
1726
1726
|
className: "team-field",
|
|
1727
|
-
children: ["团队名称", /* @__PURE__ */
|
|
1728
|
-
value:
|
|
1729
|
-
onChange: (e) =>
|
|
1727
|
+
children: ["团队名称", /* @__PURE__ */ k("input", {
|
|
1728
|
+
value: p,
|
|
1729
|
+
onChange: (e) => m(e.target.value),
|
|
1730
1730
|
placeholder: "例如:产品交付团队",
|
|
1731
1731
|
maxLength: 100,
|
|
1732
|
-
disabled:
|
|
1732
|
+
disabled: D,
|
|
1733
1733
|
required: !0
|
|
1734
1734
|
})]
|
|
1735
1735
|
}),
|
|
1736
|
-
/* @__PURE__ */
|
|
1737
|
-
disabled:
|
|
1736
|
+
/* @__PURE__ */ A("fieldset", {
|
|
1737
|
+
disabled: D,
|
|
1738
1738
|
children: [
|
|
1739
|
-
/* @__PURE__ */
|
|
1740
|
-
/* @__PURE__ */
|
|
1739
|
+
/* @__PURE__ */ A("legend", { children: ["选择成员 ", /* @__PURE__ */ A("span", { children: [_.length, " / 8"] })] }),
|
|
1740
|
+
/* @__PURE__ */ A("div", {
|
|
1741
1741
|
className: "team-directory-search",
|
|
1742
|
-
children: [/* @__PURE__ */
|
|
1742
|
+
children: [/* @__PURE__ */ k("input", {
|
|
1743
1743
|
"aria-label": "搜索 Agent",
|
|
1744
1744
|
value: h,
|
|
1745
1745
|
onChange: (e) => g(e.target.value),
|
|
1746
1746
|
placeholder: "搜索名称或职责"
|
|
1747
|
-
}), o && /* @__PURE__ */
|
|
1747
|
+
}), o && /* @__PURE__ */ k("button", {
|
|
1748
1748
|
type: "button",
|
|
1749
1749
|
className: "team-text-button",
|
|
1750
|
-
disabled:
|
|
1750
|
+
disabled: r,
|
|
1751
1751
|
onClick: o,
|
|
1752
1752
|
children: "刷新"
|
|
1753
1753
|
})]
|
|
1754
1754
|
}),
|
|
1755
|
-
|
|
1755
|
+
r && /* @__PURE__ */ k("p", {
|
|
1756
1756
|
role: "status",
|
|
1757
1757
|
className: "team-muted",
|
|
1758
1758
|
children: "正在读取 Agent…"
|
|
1759
1759
|
}),
|
|
1760
|
-
a && /* @__PURE__ */
|
|
1760
|
+
a && /* @__PURE__ */ k("p", {
|
|
1761
1761
|
role: "alert",
|
|
1762
1762
|
className: "team-inline-error",
|
|
1763
1763
|
children: a
|
|
1764
1764
|
}),
|
|
1765
|
-
!
|
|
1765
|
+
!r && !t.length ? /* @__PURE__ */ k("p", {
|
|
1766
1766
|
className: "team-muted",
|
|
1767
1767
|
children: "还没有 Agent。先创建 Agent 并完成构建,再回来组队。"
|
|
1768
|
-
}) : /* @__PURE__ */
|
|
1768
|
+
}) : /* @__PURE__ */ A("div", {
|
|
1769
1769
|
className: "team-candidate-list",
|
|
1770
|
-
children: [
|
|
1771
|
-
let t =
|
|
1772
|
-
return /* @__PURE__ */
|
|
1770
|
+
children: [U.map((e) => {
|
|
1771
|
+
let t = L.find((t) => J(t) === J(e[0])), n = t || e[0], i = n.binding.kind === "local_build" ? "本地" : "云端", a = P(n) ? "创建时验证执行能力" : n.description || n.binding.description || (n.binding.capabilities.leader ? "可担任 Leader" : "任务成员");
|
|
1772
|
+
return /* @__PURE__ */ A("div", {
|
|
1773
1773
|
className: "team-candidate-group",
|
|
1774
|
-
children: [/* @__PURE__ */
|
|
1774
|
+
children: [/* @__PURE__ */ A("label", {
|
|
1775
1775
|
className: "team-candidate",
|
|
1776
1776
|
"data-selected": !!t,
|
|
1777
1777
|
children: [
|
|
1778
|
-
/* @__PURE__ */
|
|
1778
|
+
/* @__PURE__ */ k("input", {
|
|
1779
1779
|
type: "checkbox",
|
|
1780
1780
|
checked: !!t,
|
|
1781
|
-
disabled:
|
|
1782
|
-
onChange: (e) =>
|
|
1781
|
+
disabled: r || !t && (!F(n) || _.length >= 8),
|
|
1782
|
+
onChange: (e) => W(n, e.target.checked)
|
|
1783
1783
|
}),
|
|
1784
|
-
/* @__PURE__ */
|
|
1784
|
+
/* @__PURE__ */ k("span", {
|
|
1785
1785
|
className: "team-avatar",
|
|
1786
1786
|
"aria-hidden": "true",
|
|
1787
1787
|
children: Array.from(n.name)[0]
|
|
1788
1788
|
}),
|
|
1789
|
-
/* @__PURE__ */
|
|
1790
|
-
/* @__PURE__ */
|
|
1789
|
+
/* @__PURE__ */ A("span", { children: [
|
|
1790
|
+
/* @__PURE__ */ k("strong", {
|
|
1791
1791
|
title: n.name,
|
|
1792
1792
|
children: n.name
|
|
1793
1793
|
}),
|
|
1794
|
-
/* @__PURE__ */
|
|
1794
|
+
/* @__PURE__ */ k("small", {
|
|
1795
1795
|
className: "team-candidate-description",
|
|
1796
1796
|
title: a,
|
|
1797
1797
|
children: a
|
|
1798
1798
|
}),
|
|
1799
|
-
!
|
|
1799
|
+
!F(n) && /* @__PURE__ */ k("small", {
|
|
1800
1800
|
className: "team-candidate-reason",
|
|
1801
1801
|
children: n.binding.availability?.reason || "当前不支持团队执行"
|
|
1802
1802
|
})
|
|
1803
1803
|
] }),
|
|
1804
|
-
/* @__PURE__ */
|
|
1804
|
+
/* @__PURE__ */ k("span", {
|
|
1805
1805
|
className: "team-source",
|
|
1806
|
-
"data-available":
|
|
1806
|
+
"data-available": F(n),
|
|
1807
1807
|
"data-state": n.binding.availability?.state,
|
|
1808
1808
|
title: n.binding.availability?.reason || (n.binding.availability?.state === "unchecked" ? "创建时检查执行环境" : void 0),
|
|
1809
|
-
children:
|
|
1809
|
+
children: i
|
|
1810
1810
|
})
|
|
1811
1811
|
]
|
|
1812
|
-
}), t && /* @__PURE__ */
|
|
1812
|
+
}), t && /* @__PURE__ */ A("details", {
|
|
1813
1813
|
className: "team-version-choice",
|
|
1814
1814
|
children: [
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
/* @__PURE__ */
|
|
1815
|
+
/* @__PURE__ */ k("summary", { children: "职责与版本" }),
|
|
1816
|
+
/* @__PURE__ */ A("label", {
|
|
1817
1817
|
className: "team-field",
|
|
1818
|
-
children: ["工作职责", /* @__PURE__ */
|
|
1818
|
+
children: ["工作职责", /* @__PURE__ */ k("textarea", {
|
|
1819
1819
|
"aria-label": `${n.name} 的工作职责`,
|
|
1820
1820
|
rows: 2,
|
|
1821
1821
|
maxLength: 2e3,
|
|
1822
1822
|
value: n.responsibility || "",
|
|
1823
1823
|
onChange: (e) => {
|
|
1824
1824
|
let t = e.target.value;
|
|
1825
|
-
|
|
1825
|
+
v((e) => e.map((e) => J(e) === J(n) ? {
|
|
1826
1826
|
...e,
|
|
1827
1827
|
responsibility: t
|
|
1828
1828
|
} : e));
|
|
@@ -1830,125 +1830,132 @@ function V({ open: e, candidates: t, serverAuthority: r, loading: i, error: a, o
|
|
|
1830
1830
|
placeholder: "例如:核对实现边界,补充测试证据"
|
|
1831
1831
|
})]
|
|
1832
1832
|
}),
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
-
/* @__PURE__ */
|
|
1833
|
+
/* @__PURE__ */ A("p", { children: ["模型:", n.binding.modelName || "沿用固定版本配置"] }),
|
|
1834
|
+
/* @__PURE__ */ A("label", {
|
|
1835
1835
|
className: "team-field",
|
|
1836
|
-
children: ["执行版本", /* @__PURE__ */
|
|
1836
|
+
children: ["执行版本", /* @__PURE__ */ k("select", {
|
|
1837
1837
|
"aria-label": `${n.name} 的执行版本`,
|
|
1838
1838
|
value: n.binding.bindingRef,
|
|
1839
1839
|
onChange: (t) => {
|
|
1840
1840
|
let r = e.find((e) => e.binding.bindingRef === t.target.value);
|
|
1841
|
-
|
|
1841
|
+
v((e) => e.map((e) => J(e) === J(n) ? {
|
|
1842
1842
|
...r,
|
|
1843
1843
|
memberId: e.memberId,
|
|
1844
1844
|
responsibility: e.responsibility
|
|
1845
1845
|
} : e));
|
|
1846
1846
|
},
|
|
1847
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1847
|
+
children: e.map((e) => /* @__PURE__ */ A("option", {
|
|
1848
1848
|
value: e.binding.bindingRef,
|
|
1849
|
-
disabled: !
|
|
1850
|
-
children: [e.binding.version || e.binding.buildId || e.binding.bindingRef,
|
|
1849
|
+
disabled: !F(e),
|
|
1850
|
+
children: [e.binding.version || e.binding.buildId || e.binding.bindingRef, F(e) ? "" : " · 不可用"]
|
|
1851
1851
|
}, e.binding.bindingRef))
|
|
1852
1852
|
})]
|
|
1853
1853
|
})
|
|
1854
1854
|
]
|
|
1855
1855
|
})]
|
|
1856
|
-
},
|
|
1857
|
-
}), !
|
|
1856
|
+
}, J(n));
|
|
1857
|
+
}), !U.length && !!t.length && /* @__PURE__ */ k("p", {
|
|
1858
1858
|
className: "team-muted",
|
|
1859
1859
|
children: "没有匹配的 Agent。"
|
|
1860
1860
|
})]
|
|
1861
1861
|
}),
|
|
1862
|
-
|
|
1862
|
+
s && c && /* @__PURE__ */ k("button", {
|
|
1863
|
+
type: "button",
|
|
1864
|
+
className: "team-button",
|
|
1865
|
+
disabled: r || D,
|
|
1866
|
+
onClick: c,
|
|
1867
|
+
children: "加载更多成员"
|
|
1868
|
+
}),
|
|
1869
|
+
_.filter((e) => !t.some((t) => t.binding.bindingRef === e.binding.bindingRef)).map((e) => /* @__PURE__ */ A("p", {
|
|
1863
1870
|
className: "team-inline-error",
|
|
1864
1871
|
children: [
|
|
1865
1872
|
e.name,
|
|
1866
1873
|
" · 当前目录中不可用 ",
|
|
1867
|
-
/* @__PURE__ */
|
|
1874
|
+
/* @__PURE__ */ k("button", {
|
|
1868
1875
|
type: "button",
|
|
1869
1876
|
className: "team-text-button",
|
|
1870
|
-
onClick: () =>
|
|
1877
|
+
onClick: () => W(e, !1),
|
|
1871
1878
|
children: "移除"
|
|
1872
1879
|
})
|
|
1873
1880
|
]
|
|
1874
1881
|
}, e.memberId))
|
|
1875
1882
|
]
|
|
1876
1883
|
}),
|
|
1877
|
-
/* @__PURE__ */
|
|
1884
|
+
/* @__PURE__ */ A("label", {
|
|
1878
1885
|
className: "team-field",
|
|
1879
1886
|
children: [
|
|
1880
1887
|
"指定 Leader",
|
|
1881
|
-
/* @__PURE__ */
|
|
1882
|
-
value:
|
|
1883
|
-
onChange: (e) =>
|
|
1884
|
-
disabled:
|
|
1885
|
-
children: [/* @__PURE__ */
|
|
1888
|
+
/* @__PURE__ */ A("select", {
|
|
1889
|
+
value: z,
|
|
1890
|
+
onChange: (e) => b(e.target.value),
|
|
1891
|
+
disabled: D || !R.length,
|
|
1892
|
+
children: [/* @__PURE__ */ k("option", {
|
|
1886
1893
|
value: "",
|
|
1887
1894
|
disabled: !0,
|
|
1888
1895
|
children: "从已选成员中指定"
|
|
1889
|
-
}),
|
|
1896
|
+
}), R.map((e) => /* @__PURE__ */ A("option", {
|
|
1890
1897
|
value: e.memberId,
|
|
1891
|
-
children: e.name
|
|
1898
|
+
children: [e.name, P(e) ? " · 创建时验证" : ""]
|
|
1892
1899
|
}, e.memberId))]
|
|
1893
1900
|
}),
|
|
1894
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ A("small", { children: ["Leader 审核成员成果,你处理工具审批和最终验收。", R.some(P) && " 待检查候选需通过服务端能力验证后才能担任 Leader。"] })
|
|
1895
1902
|
]
|
|
1896
1903
|
}),
|
|
1897
|
-
|
|
1904
|
+
n && B && /* @__PURE__ */ A("details", {
|
|
1898
1905
|
className: "team-version-choice",
|
|
1899
1906
|
children: [
|
|
1900
|
-
/* @__PURE__ */
|
|
1901
|
-
/* @__PURE__ */
|
|
1907
|
+
/* @__PURE__ */ k("summary", { children: "本地离线时继续协作" }),
|
|
1908
|
+
/* @__PURE__ */ A("label", {
|
|
1902
1909
|
className: "team-field",
|
|
1903
|
-
children: ["Leader 云端备用", /* @__PURE__ */
|
|
1904
|
-
value:
|
|
1905
|
-
onChange: (e) =>
|
|
1906
|
-
disabled:
|
|
1907
|
-
children: [/* @__PURE__ */
|
|
1910
|
+
children: ["Leader 云端备用", /* @__PURE__ */ A("select", {
|
|
1911
|
+
value: H,
|
|
1912
|
+
onChange: (e) => w(e.target.value),
|
|
1913
|
+
disabled: D || r,
|
|
1914
|
+
children: [/* @__PURE__ */ k("option", {
|
|
1908
1915
|
value: "",
|
|
1909
1916
|
children: "暂不配置"
|
|
1910
|
-
}),
|
|
1917
|
+
}), V.map((e) => /* @__PURE__ */ A("option", {
|
|
1911
1918
|
value: e.binding.bindingRef,
|
|
1912
1919
|
children: [
|
|
1913
1920
|
e.name,
|
|
1914
1921
|
" · ",
|
|
1915
|
-
e.binding.version || e.binding.buildId || "固定版本"
|
|
1922
|
+
P(e) ? "创建时验证" : e.binding.version || e.binding.buildId || "固定版本"
|
|
1916
1923
|
]
|
|
1917
1924
|
}, e.binding.bindingRef))]
|
|
1918
1925
|
})]
|
|
1919
1926
|
}),
|
|
1920
|
-
/* @__PURE__ */
|
|
1927
|
+
/* @__PURE__ */ k("p", {
|
|
1921
1928
|
className: "team-muted",
|
|
1922
|
-
children: "
|
|
1929
|
+
children: "服务端验证同一发布及实际执行能力后,备用才可启用。云端模型、工具和任务资料需预先准备;本地凭据不会复制到云端。"
|
|
1923
1930
|
}),
|
|
1924
|
-
!
|
|
1931
|
+
!V.length && /* @__PURE__ */ k("p", {
|
|
1925
1932
|
className: "team-muted",
|
|
1926
|
-
children: "还没有可用的云端 Leader
|
|
1933
|
+
children: "还没有可用的云端 Leader 候选。可以先创建团队,接入节点后再配置。"
|
|
1927
1934
|
})
|
|
1928
1935
|
]
|
|
1929
1936
|
}),
|
|
1930
|
-
/* @__PURE__ */
|
|
1937
|
+
/* @__PURE__ */ k("p", {
|
|
1931
1938
|
className: "team-create-footnote",
|
|
1932
1939
|
children: "创建时检查选中成员的执行环境;配置失败会保留草稿。"
|
|
1933
1940
|
}),
|
|
1934
|
-
|
|
1941
|
+
j && /* @__PURE__ */ k("p", {
|
|
1935
1942
|
role: "alert",
|
|
1936
1943
|
className: "team-inline-error",
|
|
1937
|
-
children:
|
|
1944
|
+
children: j
|
|
1938
1945
|
})
|
|
1939
1946
|
]
|
|
1940
1947
|
}),
|
|
1941
|
-
/* @__PURE__ */
|
|
1948
|
+
/* @__PURE__ */ A("footer", { children: [/* @__PURE__ */ k("button", {
|
|
1942
1949
|
type: "button",
|
|
1943
1950
|
className: "team-button",
|
|
1944
|
-
onClick:
|
|
1945
|
-
disabled:
|
|
1951
|
+
onClick: l,
|
|
1952
|
+
disabled: D,
|
|
1946
1953
|
children: "稍后继续"
|
|
1947
|
-
}), /* @__PURE__ */
|
|
1954
|
+
}), /* @__PURE__ */ k("button", {
|
|
1948
1955
|
type: "submit",
|
|
1949
1956
|
className: "team-button team-primary",
|
|
1950
|
-
disabled:
|
|
1951
|
-
children:
|
|
1957
|
+
disabled: D || r || L.length < 2,
|
|
1958
|
+
children: D ? "正在检查并创建…" : "创建团队"
|
|
1952
1959
|
})] })
|
|
1953
1960
|
]
|
|
1954
1961
|
})
|
|
@@ -1956,7 +1963,7 @@ function V({ open: e, candidates: t, serverAuthority: r, loading: i, error: a, o
|
|
|
1956
1963
|
}
|
|
1957
1964
|
//#endregion
|
|
1958
1965
|
//#region src/hooks/useTeamChat.ts
|
|
1959
|
-
var
|
|
1966
|
+
var le = class {
|
|
1960
1967
|
value = {
|
|
1961
1968
|
snapshot: null,
|
|
1962
1969
|
connection: "closed",
|
|
@@ -2015,13 +2022,13 @@ var H = class {
|
|
|
2015
2022
|
};
|
|
2016
2023
|
send = (e) => this.client.send(this.groupId, e);
|
|
2017
2024
|
};
|
|
2018
|
-
function
|
|
2019
|
-
let t =
|
|
2025
|
+
function ue(e) {
|
|
2026
|
+
let t = w(() => new le(e.client, e.groupId, e.authorityRef), [
|
|
2020
2027
|
e.client,
|
|
2021
2028
|
e.groupId,
|
|
2022
2029
|
e.authorityRef
|
|
2023
|
-
]), n =
|
|
2024
|
-
return
|
|
2030
|
+
]), n = D(t.subscribe, t.getSnapshot, t.getSnapshot);
|
|
2031
|
+
return x(() => (t.start(), t.disconnect), [t]), {
|
|
2025
2032
|
...n,
|
|
2026
2033
|
loading: !n.snapshot && n.connection === "connecting",
|
|
2027
2034
|
setDraft: t.setDraft,
|
|
@@ -2030,4 +2037,1122 @@ function U(e) {
|
|
|
2030
2037
|
};
|
|
2031
2038
|
}
|
|
2032
2039
|
//#endregion
|
|
2033
|
-
|
|
2040
|
+
//#region src/components/teams/CloudEffectsPanel.tsx
|
|
2041
|
+
function Z({ scope: e, teamRunId: t, product: n, canWrite: r, refreshKey: i, pendingEffectKeys: a, command: o }) {
|
|
2042
|
+
let [s, c] = E([]), [l, d] = E(null), [f, p] = E(!1), [m, h] = E(!1), [g, _] = E(""), [v, y] = E(null), [C, w] = E(""), [D, O] = E(!1), [j, M] = E(!1), [N, P] = E(""), F = T(null), I = T(0), L = T(null), R = u(e), z = S(), B = b(async (r = 0) => {
|
|
2043
|
+
F.current?.abort();
|
|
2044
|
+
let i = new AbortController();
|
|
2045
|
+
F.current = i;
|
|
2046
|
+
let a = ++I.current;
|
|
2047
|
+
p(!0), _("");
|
|
2048
|
+
try {
|
|
2049
|
+
let o = await n.effects(e, t, i.signal, r);
|
|
2050
|
+
if (i.signal.aborted || a !== I.current) return;
|
|
2051
|
+
c((e) => r ? [...e.filter((e) => !o.items.some((t) => t.effectKey === e.effectKey)), ...o.items] : o.items), d(o.nextCursor), h(!0);
|
|
2052
|
+
} catch {
|
|
2053
|
+
!i.signal.aborted && a === I.current && _("执行记录读取失败,请重试。当前不能据此判断外部操作是否完成。");
|
|
2054
|
+
} finally {
|
|
2055
|
+
!i.signal.aborted && a === I.current && p(!1);
|
|
2056
|
+
}
|
|
2057
|
+
}, [
|
|
2058
|
+
R,
|
|
2059
|
+
t,
|
|
2060
|
+
n
|
|
2061
|
+
]);
|
|
2062
|
+
x(() => (B(), () => F.current?.abort()), [B, i]), x(() => {
|
|
2063
|
+
v && L.current?.scrollIntoView?.({ block: "nearest" });
|
|
2064
|
+
}, [v?.effect.effectKey]);
|
|
2065
|
+
let V = v ? s.find((e) => e.effectKey === v.effect.effectKey) : void 0, H = !!(v && m && (!V || V.revision !== v.effect.revision || V.evidenceDigest !== v.effect.evidenceDigest)), U = !!(v && a.includes(v.effect.effectKey));
|
|
2066
|
+
async function W() {
|
|
2067
|
+
if (!(!v || !r || g || f || j || H || U || !D || !C.trim())) {
|
|
2068
|
+
M(!0), P("");
|
|
2069
|
+
try {
|
|
2070
|
+
await o(`effects/${v.effect.effectKey}/reconcile`, {
|
|
2071
|
+
expectedRevision: v.effect.revision,
|
|
2072
|
+
expectedEvidenceDigest: v.effect.evidenceDigest,
|
|
2073
|
+
decision: "accept_risk",
|
|
2074
|
+
evidenceRef: v.evidenceRef,
|
|
2075
|
+
reason: C.trim()
|
|
2076
|
+
}), y(null), w(""), O(!1), B();
|
|
2077
|
+
} catch (e) {
|
|
2078
|
+
P(e instanceof Error ? e.message : "核查决定尚未确认,请核对原单。"), B();
|
|
2079
|
+
} finally {
|
|
2080
|
+
M(!1);
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
return /* @__PURE__ */ A("section", {
|
|
2085
|
+
className: "team-effect-review",
|
|
2086
|
+
"aria-label": "外部操作核查",
|
|
2087
|
+
children: [
|
|
2088
|
+
/* @__PURE__ */ A("header", {
|
|
2089
|
+
className: "team-effect-review-header",
|
|
2090
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h3", { children: "外部操作核查" }), /* @__PURE__ */ k("p", {
|
|
2091
|
+
className: "team-muted",
|
|
2092
|
+
children: "结果未确认的操作需要核查后再继续。核查决定会保留记录。"
|
|
2093
|
+
})] }), /* @__PURE__ */ k("button", {
|
|
2094
|
+
type: "button",
|
|
2095
|
+
className: "team-button",
|
|
2096
|
+
disabled: f,
|
|
2097
|
+
onClick: () => void B(),
|
|
2098
|
+
children: "刷新记录"
|
|
2099
|
+
})]
|
|
2100
|
+
}),
|
|
2101
|
+
g && /* @__PURE__ */ k("p", {
|
|
2102
|
+
role: "alert",
|
|
2103
|
+
className: "team-inline-error",
|
|
2104
|
+
children: g
|
|
2105
|
+
}),
|
|
2106
|
+
f && /* @__PURE__ */ k("p", {
|
|
2107
|
+
role: "status",
|
|
2108
|
+
className: "team-muted",
|
|
2109
|
+
children: "正在读取原执行记录…"
|
|
2110
|
+
}),
|
|
2111
|
+
m && !f && !g && !s.length && /* @__PURE__ */ k("p", {
|
|
2112
|
+
className: "team-muted",
|
|
2113
|
+
children: l ? "这一页没有待核查操作,请继续读取后续记录。" : "当前任务没有待核查的外部操作。"
|
|
2114
|
+
}),
|
|
2115
|
+
s.map((e) => /* @__PURE__ */ A("article", {
|
|
2116
|
+
className: "team-effect-card",
|
|
2117
|
+
children: [
|
|
2118
|
+
/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("strong", { children: e.toolName }), /* @__PURE__ */ k("span", {
|
|
2119
|
+
className: "team-effect-state",
|
|
2120
|
+
children: e.resolutionConflict ? "核查后收到不同证据" : e.phase === "prepared" ? "执行结果待核对" : "外部结果未确认"
|
|
2121
|
+
})] }),
|
|
2122
|
+
/* @__PURE__ */ k("p", {
|
|
2123
|
+
className: "team-muted",
|
|
2124
|
+
children: e.resolutionConflict ? "新证据与已有核查决定不一致,后续处理保持暂停。请重新核对原记录,并记录新的决定。" : "系统保留了原操作,不会因断线或重启自动重复发送。请先查看外部系统。"
|
|
2125
|
+
}),
|
|
2126
|
+
e.outcome?.evidence_ref && /* @__PURE__ */ A("p", {
|
|
2127
|
+
className: "team-muted",
|
|
2128
|
+
children: ["原执行证据:", e.outcome.evidence_ref]
|
|
2129
|
+
}),
|
|
2130
|
+
/* @__PURE__ */ k("button", {
|
|
2131
|
+
type: "button",
|
|
2132
|
+
className: "team-button",
|
|
2133
|
+
disabled: !r || !!g || j || a.includes(e.effectKey),
|
|
2134
|
+
onClick: () => {
|
|
2135
|
+
y({
|
|
2136
|
+
effect: e,
|
|
2137
|
+
evidenceRef: `manual-review:${crypto.randomUUID()}`
|
|
2138
|
+
}), w(""), O(!1), P("");
|
|
2139
|
+
},
|
|
2140
|
+
children: a.includes(e.effectKey) ? "等待核对原单" : "记录核查决定"
|
|
2141
|
+
})
|
|
2142
|
+
]
|
|
2143
|
+
}, e.effectKey)),
|
|
2144
|
+
l !== null && /* @__PURE__ */ k("button", {
|
|
2145
|
+
className: "team-button team-history-more",
|
|
2146
|
+
type: "button",
|
|
2147
|
+
disabled: f,
|
|
2148
|
+
onClick: () => void B(l),
|
|
2149
|
+
children: "更多执行记录"
|
|
2150
|
+
}),
|
|
2151
|
+
v && /* @__PURE__ */ A("form", {
|
|
2152
|
+
ref: L,
|
|
2153
|
+
className: "team-effect-form",
|
|
2154
|
+
onSubmit: (e) => {
|
|
2155
|
+
e.preventDefault(), W();
|
|
2156
|
+
},
|
|
2157
|
+
children: [
|
|
2158
|
+
/* @__PURE__ */ A("h3", { children: ["核查 ", v.effect.toolName] }),
|
|
2159
|
+
/* @__PURE__ */ k("p", {
|
|
2160
|
+
className: "team-muted",
|
|
2161
|
+
children: "此操作记录你接受剩余不确定性的决定,不会重新调用外部工具,也不会将原执行标记为成功。"
|
|
2162
|
+
}),
|
|
2163
|
+
/* @__PURE__ */ A("label", {
|
|
2164
|
+
className: "team-field",
|
|
2165
|
+
htmlFor: z,
|
|
2166
|
+
children: ["核查说明", /* @__PURE__ */ k("textarea", {
|
|
2167
|
+
id: z,
|
|
2168
|
+
value: C,
|
|
2169
|
+
maxLength: 1e3,
|
|
2170
|
+
rows: 3,
|
|
2171
|
+
disabled: j || U,
|
|
2172
|
+
onChange: (e) => w(e.target.value),
|
|
2173
|
+
placeholder: "说明查验了什么、得到什么结果,以及继续处理的依据。"
|
|
2174
|
+
})]
|
|
2175
|
+
}),
|
|
2176
|
+
/* @__PURE__ */ A("label", {
|
|
2177
|
+
className: "team-effect-consent",
|
|
2178
|
+
children: [/* @__PURE__ */ k("input", {
|
|
2179
|
+
type: "checkbox",
|
|
2180
|
+
checked: D,
|
|
2181
|
+
disabled: j || U,
|
|
2182
|
+
onChange: (e) => O(e.target.checked)
|
|
2183
|
+
}), /* @__PURE__ */ k("span", { children: "我已核对外部记录,接受剩余不确定性并允许后续处理。" })]
|
|
2184
|
+
}),
|
|
2185
|
+
H && /* @__PURE__ */ A("p", {
|
|
2186
|
+
role: "alert",
|
|
2187
|
+
children: ["记录已更新,核查说明已保留。", V && /* @__PURE__ */ k("button", {
|
|
2188
|
+
type: "button",
|
|
2189
|
+
className: "team-text-button",
|
|
2190
|
+
onClick: () => {
|
|
2191
|
+
y({
|
|
2192
|
+
...v,
|
|
2193
|
+
effect: V
|
|
2194
|
+
}), O(!1);
|
|
2195
|
+
},
|
|
2196
|
+
children: "读取最新证据后重新核对"
|
|
2197
|
+
})]
|
|
2198
|
+
}),
|
|
2199
|
+
U && /* @__PURE__ */ k("p", {
|
|
2200
|
+
role: "status",
|
|
2201
|
+
children: "决定已保存在本地,服务端接收结果仍待确认。请在操作记录中核对原单。"
|
|
2202
|
+
}),
|
|
2203
|
+
N && /* @__PURE__ */ k("p", {
|
|
2204
|
+
role: "alert",
|
|
2205
|
+
className: "team-inline-error",
|
|
2206
|
+
children: N
|
|
2207
|
+
}),
|
|
2208
|
+
/* @__PURE__ */ A("div", {
|
|
2209
|
+
className: "team-task-actions",
|
|
2210
|
+
children: [/* @__PURE__ */ k("button", {
|
|
2211
|
+
type: "button",
|
|
2212
|
+
className: "team-button",
|
|
2213
|
+
disabled: j,
|
|
2214
|
+
onClick: () => y(null),
|
|
2215
|
+
children: "收起"
|
|
2216
|
+
}), /* @__PURE__ */ k("button", {
|
|
2217
|
+
type: "submit",
|
|
2218
|
+
className: "team-button team-primary",
|
|
2219
|
+
disabled: !r || !!g || f || j || H || U || !D || !C.trim(),
|
|
2220
|
+
children: j ? "正在记录…" : "记录核查决定"
|
|
2221
|
+
})]
|
|
2222
|
+
})
|
|
2223
|
+
]
|
|
2224
|
+
})
|
|
2225
|
+
]
|
|
2226
|
+
});
|
|
2227
|
+
}
|
|
2228
|
+
//#endregion
|
|
2229
|
+
//#region src/components/teams/CloudTeamWorkspace.tsx
|
|
2230
|
+
var de = {
|
|
2231
|
+
operations: [],
|
|
2232
|
+
recovering: !1,
|
|
2233
|
+
errorCode: null
|
|
2234
|
+
}, fe = () => () => {}, pe = () => de, me = (e) => e.endsWith("/messages") ? "团队消息" : e.endsWith("/control") ? "任务控制" : e.endsWith("/interactions") ? "审批回复" : e.endsWith("/acceptance") ? "任务验收" : e.endsWith("/actions") ? "子任务操作" : e.endsWith("/reconcile") ? "执行核查决定" : "创建团队", he = {
|
|
2235
|
+
queued: "等待提交",
|
|
2236
|
+
sending: "正在核对原单",
|
|
2237
|
+
confirmed: "服务端已接收",
|
|
2238
|
+
rejected: "请求被拒绝",
|
|
2239
|
+
uncertain: "接收结果未确认"
|
|
2240
|
+
}, ge = {
|
|
2241
|
+
connecting: "正在读取工作区",
|
|
2242
|
+
connected: "实时连接",
|
|
2243
|
+
reconnecting: "正在恢复连接 · 执行状态待同步",
|
|
2244
|
+
offline: "连接中断 · 显示最后同步状态",
|
|
2245
|
+
closed: "尚未连接"
|
|
2246
|
+
}, _e = {
|
|
2247
|
+
idle: "空闲",
|
|
2248
|
+
queued: "排队中",
|
|
2249
|
+
running: "执行中",
|
|
2250
|
+
waiting: "等待中",
|
|
2251
|
+
needs_attention: "需要处理",
|
|
2252
|
+
unavailable: "不可用"
|
|
2253
|
+
}, Q = (e) => e === "execution_preparation_expired" ? "准备时间过长,执行授权已过期。尚未开始执行,可重新提交请求或重试任务。" : e, ve = {
|
|
2254
|
+
armed: {
|
|
2255
|
+
label: "已配置备用 Leader",
|
|
2256
|
+
description: "已配置备用执行端,当前仍由原 Leader 负责。"
|
|
2257
|
+
},
|
|
2258
|
+
fencing_old: {
|
|
2259
|
+
label: "正在停止原 Leader",
|
|
2260
|
+
description: "正在撤销原执行授权,确认后再启动备用 Leader。"
|
|
2261
|
+
},
|
|
2262
|
+
waiting_old_grant: {
|
|
2263
|
+
label: "等待原授权失效",
|
|
2264
|
+
description: "原执行授权尚未确认结束,备用 Leader 暂不执行。"
|
|
2265
|
+
},
|
|
2266
|
+
activating: {
|
|
2267
|
+
label: "正在启动备用 Leader",
|
|
2268
|
+
description: "原授权已隔离,正在恢复本轮任务上下文。"
|
|
2269
|
+
},
|
|
2270
|
+
active: {
|
|
2271
|
+
label: "备用 Leader 已接管",
|
|
2272
|
+
description: "当前由备用 Leader 继续处理本轮任务。"
|
|
2273
|
+
},
|
|
2274
|
+
blocked: {
|
|
2275
|
+
label: "Leader 接管暂时受阻",
|
|
2276
|
+
description: "接管条件尚未满足,需要先处理以下原因。"
|
|
2277
|
+
}
|
|
2278
|
+
}, ye = {
|
|
2279
|
+
effect_reconciliation_required: "存在结果未确认的外部操作,核对后才能继续接管。",
|
|
2280
|
+
release_verification_required: "尚未确认备用执行端与原 Leader 使用相同的发布内容。",
|
|
2281
|
+
standby_probe_unavailable: "暂时无法确认备用执行端的可用状态。",
|
|
2282
|
+
standby_capability_unavailable: "备用执行端暂不具备本轮任务所需的能力。",
|
|
2283
|
+
binding_revision_mismatch: "执行端配置已变化,需要重新验证。",
|
|
2284
|
+
standby_binding_mismatch: "备用执行端与本轮任务的预设配置不一致。",
|
|
2285
|
+
original_context_unavailable: "原执行上下文暂不可用。",
|
|
2286
|
+
grant_lookup_uncertain: "原执行授权的状态尚未确认。",
|
|
2287
|
+
material_not_ready: "任务材料尚未准备就绪。",
|
|
2288
|
+
leader_takeover_conflict: "本轮任务状态已变化,暂时不能接管。"
|
|
2289
|
+
};
|
|
2290
|
+
function be({ value: e }) {
|
|
2291
|
+
let t = ve[e.state];
|
|
2292
|
+
return /* @__PURE__ */ A("section", {
|
|
2293
|
+
className: "team-cloud-standby",
|
|
2294
|
+
"aria-label": "Leader 接管状态",
|
|
2295
|
+
"data-state": e.state,
|
|
2296
|
+
role: "status",
|
|
2297
|
+
children: [
|
|
2298
|
+
/* @__PURE__ */ k("strong", { children: t.label }),
|
|
2299
|
+
/* @__PURE__ */ k("p", { children: t.description }),
|
|
2300
|
+
e.reason && /* @__PURE__ */ k("p", {
|
|
2301
|
+
className: "team-cloud-standby-reason",
|
|
2302
|
+
children: ye[e.reason] || `服务端原因:${e.reason}`
|
|
2303
|
+
})
|
|
2304
|
+
]
|
|
2305
|
+
});
|
|
2306
|
+
}
|
|
2307
|
+
function xe(e) {
|
|
2308
|
+
let [t, n] = E(null), [r, i] = E(""), a = u(e.scope);
|
|
2309
|
+
return x(() => {
|
|
2310
|
+
let t, r = !0, a = new c(e.scope, e.transport);
|
|
2311
|
+
return (async () => {
|
|
2312
|
+
try {
|
|
2313
|
+
t = new s({ scope: e.scope }, e.product), t.setWritable(!1), await t.refresh(), r && (n({
|
|
2314
|
+
observer: a,
|
|
2315
|
+
operations: t
|
|
2316
|
+
}), i(""));
|
|
2317
|
+
} catch {
|
|
2318
|
+
t?.dispose(), r && (i("当前浏览器无法打开持久操作存储,工作区仅供查看。"), n({
|
|
2319
|
+
observer: a,
|
|
2320
|
+
operations: null
|
|
2321
|
+
}));
|
|
2322
|
+
}
|
|
2323
|
+
})(), a.observe(e.initialRunId), () => {
|
|
2324
|
+
r = !1, a.dispose(), t?.dispose();
|
|
2325
|
+
};
|
|
2326
|
+
}, [
|
|
2327
|
+
a,
|
|
2328
|
+
e.transport,
|
|
2329
|
+
e.product
|
|
2330
|
+
]), !t || u(t.observer.scope) !== a ? /* @__PURE__ */ k("section", {
|
|
2331
|
+
className: "ksadk-teams team-workspace",
|
|
2332
|
+
children: /* @__PURE__ */ k("p", {
|
|
2333
|
+
role: r ? "alert" : "status",
|
|
2334
|
+
className: "team-cloud-notice",
|
|
2335
|
+
children: r || "正在准备团队工作区…"
|
|
2336
|
+
})
|
|
2337
|
+
}) : /* @__PURE__ */ k(Se, {
|
|
2338
|
+
...e,
|
|
2339
|
+
readOnlyReason: r || e.readOnlyReason,
|
|
2340
|
+
resources: t
|
|
2341
|
+
});
|
|
2342
|
+
}
|
|
2343
|
+
function Se({ resources: e, ...t }) {
|
|
2344
|
+
let { observer: n, operations: r } = e, { onSelectionChange: i, onChanged: o } = t, s = D(n.subscribe, n.getSnapshot, n.getSnapshot), c = D(r?.subscribe ?? fe, r?.getSnapshot ?? pe, r?.getSnapshot ?? pe), [l, d] = E(""), [f, p] = E(!1), [m, h] = E(""), [g, _] = E(null), v = T(0), [y, b] = E(() => typeof navigator > "u" || navigator.onLine);
|
|
2345
|
+
x(() => {
|
|
2346
|
+
let e = () => b(navigator.onLine);
|
|
2347
|
+
return window.addEventListener("online", e), window.addEventListener("offline", e), () => {
|
|
2348
|
+
window.removeEventListener("online", e), window.removeEventListener("offline", e);
|
|
2349
|
+
};
|
|
2350
|
+
}, []);
|
|
2351
|
+
let S = s.projection?.snapshot.group.status === "archived", C = !!r && y && !S && t.canWrite && s.connection === "connected";
|
|
2352
|
+
x(() => {
|
|
2353
|
+
r && (r.setWritable(C), C ? r.recover() : r.refresh());
|
|
2354
|
+
}, [r, C]), x(() => {
|
|
2355
|
+
if (!r) return;
|
|
2356
|
+
let e = () => {
|
|
2357
|
+
r.refresh(), document.visibilityState === "visible" && navigator.onLine && C && r.recover();
|
|
2358
|
+
};
|
|
2359
|
+
window.addEventListener("online", e), window.addEventListener("focus", e);
|
|
2360
|
+
let t = window.setInterval(e, 15e3);
|
|
2361
|
+
return () => {
|
|
2362
|
+
window.removeEventListener("online", e), window.removeEventListener("focus", e), clearInterval(t);
|
|
2363
|
+
};
|
|
2364
|
+
}, [r, C]);
|
|
2365
|
+
async function w(e, i) {
|
|
2366
|
+
if (!C || !r) throw Error("当前为只读状态,请恢复连接后重试。");
|
|
2367
|
+
d("");
|
|
2368
|
+
let a = await r.submit({
|
|
2369
|
+
operation: `groups/${t.scope.groupId}/${e}`,
|
|
2370
|
+
payload: i
|
|
2371
|
+
});
|
|
2372
|
+
if (e === "messages" && !["confirmed", "rejected"].includes(a.status) && _(a.operationId), a.status !== "confirmed") throw Error(a.status === "rejected" ? `请求未被接受(${a.errorCode || "operation_rejected"})。` : "已保存操作,接收结果尚未确认。请在操作记录中核对原单,不要重复创建目标。");
|
|
2373
|
+
return t.onChanged?.(), n.refresh(), a;
|
|
2374
|
+
}
|
|
2375
|
+
x(() => {
|
|
2376
|
+
if (!(!r || !g)) return r.subscribe(() => {
|
|
2377
|
+
let e = r.getSnapshot().operations.find((e) => e.operationId === g);
|
|
2378
|
+
if (!e || !["confirmed", "rejected"].includes(e.status) || (_(null), e.status === "rejected")) return;
|
|
2379
|
+
d("");
|
|
2380
|
+
let t = n.getSnapshot(), a = e.payload.parts, s = Array.isArray(a) ? a.filter((e) => e && typeof e == "object" && !Array.isArray(e) && e.kind === "text").map((e) => e.text).join("") : "", c = e.payload.intent === "start_goal", l = c ? m.trim() === s : t.selectedRunId === e.payload.teamRunId && t.draft.trim() === s;
|
|
2381
|
+
c && l && (h(""), p(!1)), !c && typeof e.payload.teamRunId == "string" && n.acknowledgeDraft(e.payload.teamRunId, s);
|
|
2382
|
+
let u = e.receipt?.teamRunId;
|
|
2383
|
+
typeof u == "string" && l && (!c || f) ? (n.observe(u), i?.(u)) : n.refresh(), o?.();
|
|
2384
|
+
});
|
|
2385
|
+
}, [
|
|
2386
|
+
r,
|
|
2387
|
+
n,
|
|
2388
|
+
g,
|
|
2389
|
+
m,
|
|
2390
|
+
f,
|
|
2391
|
+
i,
|
|
2392
|
+
o
|
|
2393
|
+
]);
|
|
2394
|
+
let O = c.operations.some((e) => e.operation.endsWith("/messages") && !["confirmed", "rejected"].includes(e.status) && (f ? e.payload.intent === "start_goal" : e.payload.teamRunId === s.selectedRunId || !s.selectedRunId && e.payload.intent === "start_goal")), j = (e) => {
|
|
2395
|
+
v.current++, p(!1), d(""), n.observe(e), t.onSelectionChange?.(e);
|
|
2396
|
+
};
|
|
2397
|
+
return /* @__PURE__ */ k(Ce, {
|
|
2398
|
+
observation: s,
|
|
2399
|
+
canWrite: C,
|
|
2400
|
+
readOnlyReason: y ? S ? "团队已归档,历史记录仍可查看。" : t.readOnlyReason : "浏览器已离线,草稿与待确认操作会保留。",
|
|
2401
|
+
onRetry: () => n.refresh(),
|
|
2402
|
+
onLoadMore: (e) => {
|
|
2403
|
+
n.loadMore(e).catch(() => d("分页读取失败。可重试;快照过期时会自动重新同步。"));
|
|
2404
|
+
},
|
|
2405
|
+
onChooseRun: j,
|
|
2406
|
+
onNewGoal: () => {
|
|
2407
|
+
v.current++, p(!0);
|
|
2408
|
+
},
|
|
2409
|
+
newGoal: f,
|
|
2410
|
+
composer: /* @__PURE__ */ k(we, {
|
|
2411
|
+
scope: t.scope,
|
|
2412
|
+
product: t.product,
|
|
2413
|
+
observation: s,
|
|
2414
|
+
newGoal: f,
|
|
2415
|
+
pendingMessage: O,
|
|
2416
|
+
canWrite: C,
|
|
2417
|
+
value: f ? m : s.draft,
|
|
2418
|
+
onChange: (e) => f ? h(e) : n.setDraft(e),
|
|
2419
|
+
onCancelNew: () => {
|
|
2420
|
+
v.current++, p(!1);
|
|
2421
|
+
},
|
|
2422
|
+
onSubmit: async (e) => {
|
|
2423
|
+
let t = v.current, r = Array.isArray(e.parts) ? e.parts.map((e) => e && typeof e == "object" && !Array.isArray(e) && e.kind === "text" ? e.text : "").join("") : "", i = await w("messages", e);
|
|
2424
|
+
if (typeof e.teamRunId == "string" && n.acknowledgeDraft(e.teamRunId, r), v.current !== t) return;
|
|
2425
|
+
f && h((e) => e.trim() === r ? "" : e);
|
|
2426
|
+
let a = i.receipt?.teamRunId;
|
|
2427
|
+
typeof a == "string" && j(a);
|
|
2428
|
+
}
|
|
2429
|
+
}, f ? "new" : s.selectedRunId ?? "empty"),
|
|
2430
|
+
operations: /* @__PURE__ */ A("section", {
|
|
2431
|
+
className: "team-cloud-operations",
|
|
2432
|
+
"aria-label": "操作记录",
|
|
2433
|
+
children: [
|
|
2434
|
+
/* @__PURE__ */ A("header", { children: [/* @__PURE__ */ k("strong", { children: "操作记录" }), /* @__PURE__ */ k("button", {
|
|
2435
|
+
className: "team-text-button",
|
|
2436
|
+
type: "button",
|
|
2437
|
+
disabled: !C || c.recovering,
|
|
2438
|
+
onClick: () => void r?.recover(),
|
|
2439
|
+
children: c.recovering ? "正在核对…" : "核对待确认操作"
|
|
2440
|
+
})] }),
|
|
2441
|
+
c.errorCode && /* @__PURE__ */ A("p", {
|
|
2442
|
+
role: "alert",
|
|
2443
|
+
children: [
|
|
2444
|
+
"持久操作存储暂不可用(",
|
|
2445
|
+
c.errorCode,
|
|
2446
|
+
")。"
|
|
2447
|
+
]
|
|
2448
|
+
}),
|
|
2449
|
+
c.operations.slice(-8).reverse().map((e) => /* @__PURE__ */ A("p", {
|
|
2450
|
+
"data-status": e.status,
|
|
2451
|
+
children: [/* @__PURE__ */ k("span", { children: me(e.operation) }), /* @__PURE__ */ k("span", { children: he[e.status] })]
|
|
2452
|
+
}, e.operationId)),
|
|
2453
|
+
!c.operations.length && /* @__PURE__ */ k("p", {
|
|
2454
|
+
className: "team-muted",
|
|
2455
|
+
children: "操作在发送前保存;刷新后继续核对。"
|
|
2456
|
+
})
|
|
2457
|
+
]
|
|
2458
|
+
}),
|
|
2459
|
+
error: l,
|
|
2460
|
+
renderTasks: (e) => /* @__PURE__ */ k(Te, {
|
|
2461
|
+
task: e,
|
|
2462
|
+
scope: t.scope,
|
|
2463
|
+
product: t.product,
|
|
2464
|
+
canWrite: C,
|
|
2465
|
+
command: w
|
|
2466
|
+
}, `${e.taskId}:${e.revision}`),
|
|
2467
|
+
effects: t.effectsEnabled && s.selectedRunId ? /* @__PURE__ */ k(Z, {
|
|
2468
|
+
scope: t.scope,
|
|
2469
|
+
teamRunId: s.selectedRunId,
|
|
2470
|
+
product: t.product,
|
|
2471
|
+
canWrite: C,
|
|
2472
|
+
command: w,
|
|
2473
|
+
refreshKey: `${s.projection?.snapshot.watermark ?? 0}:${c.operations.map((e) => `${e.operationId}:${e.status}`).join("|")}`,
|
|
2474
|
+
pendingEffectKeys: c.operations.filter((e) => !["confirmed", "rejected"].includes(e.status)).map((e) => /^groups\/[^/]+\/effects\/([^/]+)\/reconcile$/.exec(e.operation)?.[1]).filter((e) => !!e)
|
|
2475
|
+
}, `${u(t.scope)}:${s.selectedRunId}`) : void 0,
|
|
2476
|
+
renderInteraction: (e) => /* @__PURE__ */ k(De, {
|
|
2477
|
+
summary: e,
|
|
2478
|
+
scope: t.scope,
|
|
2479
|
+
product: t.product,
|
|
2480
|
+
canWrite: C,
|
|
2481
|
+
command: w
|
|
2482
|
+
}, `${a(e)}:${e.revision}`),
|
|
2483
|
+
artifactUrl: (e, n) => t.product.artifactUrl(t.scope, e, n),
|
|
2484
|
+
onControl: (e) => {
|
|
2485
|
+
let t = s.projection?.snapshot.selectedRun;
|
|
2486
|
+
t && w(`team-runs/${t.teamRunId}/control`, {
|
|
2487
|
+
action: e,
|
|
2488
|
+
expectedRevision: t.revision
|
|
2489
|
+
}).catch((e) => d(e instanceof Error ? e.message : "操作失败。"));
|
|
2490
|
+
},
|
|
2491
|
+
onAcceptance: (e, t) => {
|
|
2492
|
+
let n = s.projection?.snapshot.selectedRun;
|
|
2493
|
+
n && w(`team-runs/${n.teamRunId}/acceptance`, {
|
|
2494
|
+
action: e,
|
|
2495
|
+
expectedRevision: n.revision,
|
|
2496
|
+
...t ? { reason: t } : {}
|
|
2497
|
+
}).catch((e) => d(e instanceof Error ? e.message : "操作失败。"));
|
|
2498
|
+
}
|
|
2499
|
+
});
|
|
2500
|
+
}
|
|
2501
|
+
function Ce(e) {
|
|
2502
|
+
let { observation: t, canWrite: r, onLoadMore: i } = e, o = t.projection?.snapshot, [s, c] = E("messages"), [l, u] = E(""), d = S(), f = T(null), p = T(null), m = `${o?.selectedRun?.teamRunId ?? ""}:${s}:${!!e.newGoal}`, g = () => {
|
|
2503
|
+
let e = f.current;
|
|
2504
|
+
if (!e || s !== "messages") return;
|
|
2505
|
+
let t = e.getBoundingClientRect().top, n = Array.from(e.querySelectorAll("[data-message-id]")).find((e) => e.getBoundingClientRect().bottom > t);
|
|
2506
|
+
p.current = {
|
|
2507
|
+
context: m,
|
|
2508
|
+
bottom: e.scrollHeight - e.clientHeight - e.scrollTop < 48,
|
|
2509
|
+
anchorId: n?.dataset.messageId,
|
|
2510
|
+
anchorOffset: n ? n.getBoundingClientRect().top - t : void 0
|
|
2511
|
+
};
|
|
2512
|
+
};
|
|
2513
|
+
C(() => {
|
|
2514
|
+
let e = f.current;
|
|
2515
|
+
if (!e || s !== "messages") {
|
|
2516
|
+
p.current = null;
|
|
2517
|
+
return;
|
|
2518
|
+
}
|
|
2519
|
+
let t = p.current;
|
|
2520
|
+
if (!t || t.context !== m || t.bottom) e.scrollTop = e.scrollHeight;
|
|
2521
|
+
else if (t.anchorId && t.anchorOffset !== void 0) {
|
|
2522
|
+
let n = Array.from(e.querySelectorAll("[data-message-id]")).find((e) => e.dataset.messageId === t.anchorId);
|
|
2523
|
+
n && (e.scrollTop += n.getBoundingClientRect().top - e.getBoundingClientRect().top - t.anchorOffset);
|
|
2524
|
+
}
|
|
2525
|
+
g();
|
|
2526
|
+
}, [m, o?.recentMessages]);
|
|
2527
|
+
let _ = (e, n = "加载更多") => o?.cursors[e] && /* @__PURE__ */ k("button", {
|
|
2528
|
+
className: "team-button team-history-more",
|
|
2529
|
+
type: "button",
|
|
2530
|
+
disabled: t.loadingPages.includes(e) || t.connection !== "connected",
|
|
2531
|
+
onClick: () => i(e),
|
|
2532
|
+
children: t.loadingPages.includes(e) ? "正在读取…" : n
|
|
2533
|
+
});
|
|
2534
|
+
if (!o) return /* @__PURE__ */ k("section", {
|
|
2535
|
+
className: "ksadk-teams team-workspace",
|
|
2536
|
+
children: /* @__PURE__ */ A("div", {
|
|
2537
|
+
className: "team-empty",
|
|
2538
|
+
children: [
|
|
2539
|
+
/* @__PURE__ */ k("h2", { children: t.connection === "offline" ? "暂时无法读取团队" : "正在打开工作区" }),
|
|
2540
|
+
/* @__PURE__ */ k("p", {
|
|
2541
|
+
role: "status",
|
|
2542
|
+
children: ge[t.connection]
|
|
2543
|
+
}),
|
|
2544
|
+
t.errorCode && /* @__PURE__ */ k("p", {
|
|
2545
|
+
role: "alert",
|
|
2546
|
+
children: t.errorCode
|
|
2547
|
+
}),
|
|
2548
|
+
/* @__PURE__ */ k("button", {
|
|
2549
|
+
type: "button",
|
|
2550
|
+
className: "team-button",
|
|
2551
|
+
onClick: e.onRetry,
|
|
2552
|
+
children: "重新连接"
|
|
2553
|
+
})
|
|
2554
|
+
]
|
|
2555
|
+
})
|
|
2556
|
+
});
|
|
2557
|
+
let v = o.selectedRun, y = v ? o.selectedRunMembers : o.members;
|
|
2558
|
+
return /* @__PURE__ */ A("section", {
|
|
2559
|
+
className: "ksadk-teams team-workspace team-cloud-workspace",
|
|
2560
|
+
"aria-label": "云端团队工作区",
|
|
2561
|
+
children: [
|
|
2562
|
+
/* @__PURE__ */ A("header", {
|
|
2563
|
+
className: "team-header",
|
|
2564
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("span", {
|
|
2565
|
+
className: "team-eyebrow",
|
|
2566
|
+
children: "云端协作空间"
|
|
2567
|
+
}), /* @__PURE__ */ k("h1", { children: o.group.name })] }), /* @__PURE__ */ A("div", {
|
|
2568
|
+
className: "team-header-actions",
|
|
2569
|
+
children: [/* @__PURE__ */ k("span", {
|
|
2570
|
+
className: "team-connection",
|
|
2571
|
+
role: "status",
|
|
2572
|
+
children: ge[t.connection]
|
|
2573
|
+
}), /* @__PURE__ */ k("button", {
|
|
2574
|
+
type: "button",
|
|
2575
|
+
className: "team-button",
|
|
2576
|
+
onClick: e.onRetry,
|
|
2577
|
+
children: "刷新"
|
|
2578
|
+
})]
|
|
2579
|
+
})]
|
|
2580
|
+
}),
|
|
2581
|
+
!r && /* @__PURE__ */ A("p", {
|
|
2582
|
+
className: "team-cloud-notice",
|
|
2583
|
+
role: "status",
|
|
2584
|
+
children: ["只读 · ", e.readOnlyReason || (t.connection === "connected" ? "服务暂未开放写入,已有历史仍可查看。" : "等待连接恢复后再提交操作。")]
|
|
2585
|
+
}),
|
|
2586
|
+
e.error && /* @__PURE__ */ k("p", {
|
|
2587
|
+
role: "alert",
|
|
2588
|
+
className: "team-inline-error team-cloud-notice",
|
|
2589
|
+
children: e.error
|
|
2590
|
+
}),
|
|
2591
|
+
/* @__PURE__ */ A("div", {
|
|
2592
|
+
className: "team-cloud-layout",
|
|
2593
|
+
children: [/* @__PURE__ */ A("aside", {
|
|
2594
|
+
className: "team-cloud-runs",
|
|
2595
|
+
"aria-label": "团队任务",
|
|
2596
|
+
children: [
|
|
2597
|
+
/* @__PURE__ */ A("header", { children: [/* @__PURE__ */ k("h2", { children: "团队任务" }), /* @__PURE__ */ k("button", {
|
|
2598
|
+
className: "team-text-button",
|
|
2599
|
+
type: "button",
|
|
2600
|
+
disabled: !r,
|
|
2601
|
+
onClick: e.onNewGoal,
|
|
2602
|
+
children: "新任务"
|
|
2603
|
+
})] }),
|
|
2604
|
+
o.runSummaries.map((t) => /* @__PURE__ */ A("button", {
|
|
2605
|
+
type: "button",
|
|
2606
|
+
className: "team-cloud-run",
|
|
2607
|
+
"aria-current": !e.newGoal && v?.teamRunId === t.teamRunId ? "page" : void 0,
|
|
2608
|
+
onClick: () => e.onChooseRun(t.teamRunId),
|
|
2609
|
+
children: [
|
|
2610
|
+
/* @__PURE__ */ k("strong", { children: t.goal }),
|
|
2611
|
+
/* @__PURE__ */ A("span", { children: [
|
|
2612
|
+
/* @__PURE__ */ k(z, { status: t.status }),
|
|
2613
|
+
" · ",
|
|
2614
|
+
t.taskCount,
|
|
2615
|
+
" 项任务"
|
|
2616
|
+
] }),
|
|
2617
|
+
t.pendingCount > 0 && /* @__PURE__ */ A("small", { children: [t.pendingCount, " 项待处理"] })
|
|
2618
|
+
]
|
|
2619
|
+
}, t.teamRunId)),
|
|
2620
|
+
!o.runSummaries.length && /* @__PURE__ */ k("p", {
|
|
2621
|
+
className: "team-muted",
|
|
2622
|
+
children: "还没有协作任务。从一个目标开始。"
|
|
2623
|
+
}),
|
|
2624
|
+
_("runSummaries", "更多团队任务"),
|
|
2625
|
+
e.operations
|
|
2626
|
+
]
|
|
2627
|
+
}), /* @__PURE__ */ A("div", {
|
|
2628
|
+
className: "team-cloud-main",
|
|
2629
|
+
children: [e.newGoal ? /* @__PURE__ */ A("div", {
|
|
2630
|
+
className: "team-cloud-goal",
|
|
2631
|
+
children: [
|
|
2632
|
+
/* @__PURE__ */ k("span", {
|
|
2633
|
+
className: "team-eyebrow",
|
|
2634
|
+
children: "新的协作任务"
|
|
2635
|
+
}),
|
|
2636
|
+
/* @__PURE__ */ k("h2", { children: "这次需要团队完成什么?" }),
|
|
2637
|
+
/* @__PURE__ */ k("p", { children: "描述目标和交付要求。任务记录与其他协作独立保存。" })
|
|
2638
|
+
]
|
|
2639
|
+
}) : /* @__PURE__ */ A(O, { children: [
|
|
2640
|
+
v && /* @__PURE__ */ A("header", {
|
|
2641
|
+
className: "team-cloud-run-header",
|
|
2642
|
+
children: [
|
|
2643
|
+
/* @__PURE__ */ k("h2", { children: v.goal }),
|
|
2644
|
+
/* @__PURE__ */ A("div", {
|
|
2645
|
+
className: "team-task-actions",
|
|
2646
|
+
children: [
|
|
2647
|
+
/* @__PURE__ */ k(z, { status: v.status }),
|
|
2648
|
+
v.dispatchSuspended && /* @__PURE__ */ k("span", { children: "已暂停派发" }),
|
|
2649
|
+
h(v.status) && v.status !== "cancel_requested" && e.onControl && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("button", {
|
|
2650
|
+
className: "team-button",
|
|
2651
|
+
type: "button",
|
|
2652
|
+
disabled: !r,
|
|
2653
|
+
onClick: () => e.onControl?.(v.dispatchSuspended ? "resume_dispatch" : "suspend_dispatch"),
|
|
2654
|
+
children: v.dispatchSuspended ? "恢复派发" : "暂停派发"
|
|
2655
|
+
}), /* @__PURE__ */ k("button", {
|
|
2656
|
+
className: "team-button team-danger",
|
|
2657
|
+
type: "button",
|
|
2658
|
+
disabled: !r,
|
|
2659
|
+
onClick: () => e.onControl?.("stop"),
|
|
2660
|
+
children: "停止任务"
|
|
2661
|
+
})] })
|
|
2662
|
+
]
|
|
2663
|
+
}),
|
|
2664
|
+
v.reason && /* @__PURE__ */ k("p", {
|
|
2665
|
+
className: "team-muted",
|
|
2666
|
+
children: Q(v.reason)
|
|
2667
|
+
}),
|
|
2668
|
+
v.status === "awaiting_acceptance" && e.onAcceptance && /* @__PURE__ */ A("div", {
|
|
2669
|
+
className: "team-cloud-acceptance",
|
|
2670
|
+
children: [
|
|
2671
|
+
/* @__PURE__ */ k("p", { children: "请查看成果后验收。" }),
|
|
2672
|
+
/* @__PURE__ */ A("label", {
|
|
2673
|
+
className: "team-field",
|
|
2674
|
+
children: ["修改意见", /* @__PURE__ */ k("textarea", {
|
|
2675
|
+
rows: 2,
|
|
2676
|
+
value: l,
|
|
2677
|
+
maxLength: 2e3,
|
|
2678
|
+
onChange: (e) => u(e.target.value),
|
|
2679
|
+
disabled: !r
|
|
2680
|
+
})]
|
|
2681
|
+
}),
|
|
2682
|
+
/* @__PURE__ */ k("button", {
|
|
2683
|
+
className: "team-button",
|
|
2684
|
+
disabled: !r || !l.trim(),
|
|
2685
|
+
onClick: () => e.onAcceptance?.("request_changes", l.trim()),
|
|
2686
|
+
children: "提出修改"
|
|
2687
|
+
}),
|
|
2688
|
+
/* @__PURE__ */ k("button", {
|
|
2689
|
+
className: "team-button team-primary",
|
|
2690
|
+
disabled: !r,
|
|
2691
|
+
onClick: () => e.onAcceptance?.("accept"),
|
|
2692
|
+
children: "验收通过"
|
|
2693
|
+
})
|
|
2694
|
+
]
|
|
2695
|
+
}),
|
|
2696
|
+
v.leaderStandby && /* @__PURE__ */ k(be, { value: v.leaderStandby })
|
|
2697
|
+
]
|
|
2698
|
+
}),
|
|
2699
|
+
/* @__PURE__ */ k("div", {
|
|
2700
|
+
className: "team-cloud-tabs",
|
|
2701
|
+
role: "tablist",
|
|
2702
|
+
"aria-label": "任务工作区",
|
|
2703
|
+
children: [
|
|
2704
|
+
"messages",
|
|
2705
|
+
"tasks",
|
|
2706
|
+
"artifacts",
|
|
2707
|
+
"approvals",
|
|
2708
|
+
"members",
|
|
2709
|
+
"effects"
|
|
2710
|
+
].filter((t) => t !== "effects" || e.effects).map((e) => /* @__PURE__ */ A("button", {
|
|
2711
|
+
type: "button",
|
|
2712
|
+
role: "tab",
|
|
2713
|
+
id: `${d}-${e}`,
|
|
2714
|
+
"aria-controls": `${d}-panel`,
|
|
2715
|
+
"aria-selected": s === e,
|
|
2716
|
+
onClick: () => c(e),
|
|
2717
|
+
children: [{
|
|
2718
|
+
messages: "消息",
|
|
2719
|
+
tasks: "任务",
|
|
2720
|
+
artifacts: "交付物",
|
|
2721
|
+
approvals: "待处理",
|
|
2722
|
+
members: "成员",
|
|
2723
|
+
effects: "执行核查"
|
|
2724
|
+
}[e], e === "approvals" && v?.pendingCount ? ` (${v.pendingCount})` : ""]
|
|
2725
|
+
}, e))
|
|
2726
|
+
}),
|
|
2727
|
+
/* @__PURE__ */ A("div", {
|
|
2728
|
+
ref: f,
|
|
2729
|
+
onScroll: g,
|
|
2730
|
+
className: "team-cloud-panel",
|
|
2731
|
+
role: "tabpanel",
|
|
2732
|
+
id: `${d}-panel`,
|
|
2733
|
+
"aria-labelledby": `${d}-${s}`,
|
|
2734
|
+
tabIndex: 0,
|
|
2735
|
+
children: [
|
|
2736
|
+
s === "effects" && e.effects,
|
|
2737
|
+
s === "messages" && /* @__PURE__ */ A(O, { children: [
|
|
2738
|
+
_("recentMessages", "查看更早的消息"),
|
|
2739
|
+
o.recentMessages.filter((e) => e.visibility === "public").map((e) => /* @__PURE__ */ k("article", {
|
|
2740
|
+
className: "team-message",
|
|
2741
|
+
"data-message-id": e.messageId,
|
|
2742
|
+
"data-role": e.groupRole,
|
|
2743
|
+
children: /* @__PURE__ */ A("div", {
|
|
2744
|
+
className: "team-message-main",
|
|
2745
|
+
children: [/* @__PURE__ */ A("header", { children: [/* @__PURE__ */ k("strong", { children: e.senderName }), /* @__PURE__ */ k("time", {
|
|
2746
|
+
dateTime: e.createdAt,
|
|
2747
|
+
children: new Date(e.createdAt).toLocaleTimeString([], {
|
|
2748
|
+
hour: "2-digit",
|
|
2749
|
+
minute: "2-digit"
|
|
2750
|
+
})
|
|
2751
|
+
})] }), /* @__PURE__ */ k("div", {
|
|
2752
|
+
className: "team-message-body",
|
|
2753
|
+
children: e.parts.map((e, t) => e.kind === "text" ? /* @__PURE__ */ k(n, { content: e.text }, t) : /* @__PURE__ */ k("span", {
|
|
2754
|
+
className: "team-attachment",
|
|
2755
|
+
children: e.name || "附件"
|
|
2756
|
+
}, t))
|
|
2757
|
+
})]
|
|
2758
|
+
})
|
|
2759
|
+
}, e.messageId)),
|
|
2760
|
+
!o.recentMessages.length && /* @__PURE__ */ k("p", {
|
|
2761
|
+
className: "team-muted",
|
|
2762
|
+
children: v ? "这项协作还没有公开消息。" : "选择任务查看消息,或新建协作目标。"
|
|
2763
|
+
})
|
|
2764
|
+
] }),
|
|
2765
|
+
s === "tasks" && /* @__PURE__ */ A(O, { children: [
|
|
2766
|
+
o.taskSummaries.map((t) => e.renderTasks?.(t) ?? /* @__PURE__ */ A("article", { children: [/* @__PURE__ */ k("h3", { children: t.title }), /* @__PURE__ */ k(z, { status: t.status })] }, t.taskId)),
|
|
2767
|
+
!o.taskSummaries.length && /* @__PURE__ */ k("p", {
|
|
2768
|
+
className: "team-muted",
|
|
2769
|
+
children: "尚无分工任务。"
|
|
2770
|
+
}),
|
|
2771
|
+
_("taskSummaries")
|
|
2772
|
+
] }),
|
|
2773
|
+
s === "approvals" && /* @__PURE__ */ A(O, { children: [
|
|
2774
|
+
o.pendingInteractions.map((t) => e.renderInteraction?.(t) ?? /* @__PURE__ */ k("p", { children: t.title }, a(t))),
|
|
2775
|
+
!o.pendingInteractions.length && /* @__PURE__ */ k("p", {
|
|
2776
|
+
className: "team-muted",
|
|
2777
|
+
children: "当前任务没有待处理事项。"
|
|
2778
|
+
}),
|
|
2779
|
+
_("pendingInteractions")
|
|
2780
|
+
] }),
|
|
2781
|
+
s === "artifacts" && /* @__PURE__ */ A(O, { children: [
|
|
2782
|
+
o.artifactSummaries.map((t) => /* @__PURE__ */ A("article", {
|
|
2783
|
+
className: "team-cloud-artifact",
|
|
2784
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("strong", { children: t.name }), /* @__PURE__ */ A("p", {
|
|
2785
|
+
className: "team-muted",
|
|
2786
|
+
children: [
|
|
2787
|
+
t.mediaType,
|
|
2788
|
+
" · ",
|
|
2789
|
+
t.sizeBytes.toLocaleString(),
|
|
2790
|
+
" 字节 · ",
|
|
2791
|
+
t.state === "ready" ? "已就绪" : t.state === "failed" ? "准备失败" : "准备中"
|
|
2792
|
+
]
|
|
2793
|
+
})] }), t.state === "ready" && e.artifactUrl && /* @__PURE__ */ k("a", {
|
|
2794
|
+
href: e.artifactUrl(t.artifactId, t.teamRunId),
|
|
2795
|
+
download: t.name,
|
|
2796
|
+
children: "下载"
|
|
2797
|
+
})]
|
|
2798
|
+
}, t.artifactId)),
|
|
2799
|
+
!o.artifactSummaries.length && /* @__PURE__ */ k("p", {
|
|
2800
|
+
className: "team-muted",
|
|
2801
|
+
children: "交付物准备好后会显示在这里。"
|
|
2802
|
+
}),
|
|
2803
|
+
_("artifactSummaries")
|
|
2804
|
+
] }),
|
|
2805
|
+
s === "members" && /* @__PURE__ */ A(O, { children: [y.map((e) => /* @__PURE__ */ k("article", {
|
|
2806
|
+
className: "team-cloud-member",
|
|
2807
|
+
children: /* @__PURE__ */ A("div", { children: [
|
|
2808
|
+
/* @__PURE__ */ k("strong", { children: e.name }),
|
|
2809
|
+
/* @__PURE__ */ A("span", {
|
|
2810
|
+
className: "team-muted",
|
|
2811
|
+
children: [
|
|
2812
|
+
" ",
|
|
2813
|
+
e.role === "leader" ? "Leader" : "成员",
|
|
2814
|
+
" · ",
|
|
2815
|
+
e.binding.kind === "local_build" ? "本地节点" : "云端节点"
|
|
2816
|
+
]
|
|
2817
|
+
}),
|
|
2818
|
+
/* @__PURE__ */ k("p", { children: e.responsibility }),
|
|
2819
|
+
/* @__PURE__ */ A("p", {
|
|
2820
|
+
className: "team-muted",
|
|
2821
|
+
children: [
|
|
2822
|
+
e.binding.availability.state === "ready" ? "执行环境就绪" : e.binding.availability.state === "unchecked" ? "执行环境待检查" : "执行环境不可用",
|
|
2823
|
+
" · ",
|
|
2824
|
+
_e[e.executionStatus]
|
|
2825
|
+
]
|
|
2826
|
+
}),
|
|
2827
|
+
(e.reason || e.binding.availability.reason) && /* @__PURE__ */ k("p", {
|
|
2828
|
+
role: "status",
|
|
2829
|
+
children: e.reason || e.binding.availability.reason
|
|
2830
|
+
})
|
|
2831
|
+
] })
|
|
2832
|
+
}, e.memberId)), /* @__PURE__ */ k("p", {
|
|
2833
|
+
className: "team-muted",
|
|
2834
|
+
children: "节点环境与执行状态来自最近同步;离开页面只停止观察。"
|
|
2835
|
+
})] })
|
|
2836
|
+
]
|
|
2837
|
+
})
|
|
2838
|
+
] }), e.composer]
|
|
2839
|
+
})]
|
|
2840
|
+
})
|
|
2841
|
+
]
|
|
2842
|
+
});
|
|
2843
|
+
}
|
|
2844
|
+
function we({ scope: e, product: t, observation: n, newGoal: r, pendingMessage: i, value: a, onChange: s, canWrite: c, onSubmit: u, onCancelNew: d }) {
|
|
2845
|
+
let f = S(), p = T(null), [m] = E(() => new l(t, e)), g = D(m.subscribe, m.getSnapshot, m.getSnapshot);
|
|
2846
|
+
x(() => () => m.dispose(), [m]), x(() => {
|
|
2847
|
+
c || m.cancel();
|
|
2848
|
+
}, [c, m]);
|
|
2849
|
+
let [_, v] = E(""), [y, b] = E(!1), [C, w] = E(""), j = n.projection?.snapshot, M = r ? null : j?.selectedRun, N = r || !M, P = c && !i && (N || h(M.status) && M.status !== "cancel_requested"), F = !N || g.files.length === 0 || g.state === "ready", I = o(g.state);
|
|
2850
|
+
async function L() {
|
|
2851
|
+
if (!(!P || y || !a.trim() || !F)) {
|
|
2852
|
+
b(!0), w("");
|
|
2853
|
+
try {
|
|
2854
|
+
await u({
|
|
2855
|
+
parts: [{
|
|
2856
|
+
kind: "text",
|
|
2857
|
+
text: a.trim()
|
|
2858
|
+
}],
|
|
2859
|
+
mentions: N || !_ ? [] : [_],
|
|
2860
|
+
intent: N ? "start_goal" : _ ? "directed" : "followup",
|
|
2861
|
+
...N ? {} : { teamRunId: M.teamRunId },
|
|
2862
|
+
...N && g.material?.state === "ready" ? { materialManifestRef: g.material.materialId } : {}
|
|
2863
|
+
});
|
|
2864
|
+
} catch (e) {
|
|
2865
|
+
w(e instanceof Error ? e.message : "提交未完成,草稿已保留。");
|
|
2866
|
+
} finally {
|
|
2867
|
+
b(!1);
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
}
|
|
2871
|
+
return /* @__PURE__ */ A("form", {
|
|
2872
|
+
className: "team-composer-wrap",
|
|
2873
|
+
onSubmit: (e) => {
|
|
2874
|
+
e.preventDefault(), L();
|
|
2875
|
+
},
|
|
2876
|
+
children: [
|
|
2877
|
+
i && /* @__PURE__ */ k("p", {
|
|
2878
|
+
className: "team-cloud-notice",
|
|
2879
|
+
role: "status",
|
|
2880
|
+
children: "上一条消息的接收结果未确认,请先在操作记录中核对原单。"
|
|
2881
|
+
}),
|
|
2882
|
+
C && /* @__PURE__ */ k("p", {
|
|
2883
|
+
className: "team-inline-error",
|
|
2884
|
+
role: "alert",
|
|
2885
|
+
children: C
|
|
2886
|
+
}),
|
|
2887
|
+
/* @__PURE__ */ A("div", {
|
|
2888
|
+
className: "team-composer",
|
|
2889
|
+
children: [
|
|
2890
|
+
/* @__PURE__ */ k("label", {
|
|
2891
|
+
className: "team-sr-only",
|
|
2892
|
+
htmlFor: f,
|
|
2893
|
+
children: N ? "团队协作目标" : "给团队的消息"
|
|
2894
|
+
}),
|
|
2895
|
+
/* @__PURE__ */ k("textarea", {
|
|
2896
|
+
id: f,
|
|
2897
|
+
rows: 3,
|
|
2898
|
+
value: a,
|
|
2899
|
+
onChange: (e) => s(e.target.value),
|
|
2900
|
+
disabled: y,
|
|
2901
|
+
placeholder: N ? "描述目标、预期成果和约束…" : M && !h(M.status) ? "此任务已结束,可新建任务继续协作" : c ? "补充要求,或向成员提问…" : "可先整理草稿,恢复连接后再发送…",
|
|
2902
|
+
onKeyDown: (e) => {
|
|
2903
|
+
e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && (e.preventDefault(), L());
|
|
2904
|
+
}
|
|
2905
|
+
}),
|
|
2906
|
+
N && g.files.length > 0 && /* @__PURE__ */ A("section", {
|
|
2907
|
+
className: "team-cloud-materials",
|
|
2908
|
+
"aria-label": "任务材料",
|
|
2909
|
+
children: [
|
|
2910
|
+
/* @__PURE__ */ A("div", {
|
|
2911
|
+
className: "team-cloud-material-status",
|
|
2912
|
+
children: [/* @__PURE__ */ A("span", {
|
|
2913
|
+
role: "status",
|
|
2914
|
+
children: [{
|
|
2915
|
+
idle: "",
|
|
2916
|
+
hashing: "正在校验文件",
|
|
2917
|
+
creating: "正在准备上传",
|
|
2918
|
+
uploading: "正在上传",
|
|
2919
|
+
verifying: "服务端正在校验",
|
|
2920
|
+
ready: "材料已就绪",
|
|
2921
|
+
failed: "上传未完成",
|
|
2922
|
+
cancelled: "上传已取消"
|
|
2923
|
+
}[g.state], I ? ` · ${g.completed}/${g.files.length}` : ""]
|
|
2924
|
+
}), /* @__PURE__ */ A("span", { children: [g.files.length, " 个文件"] })]
|
|
2925
|
+
}),
|
|
2926
|
+
/* @__PURE__ */ k("ul", { children: g.files.map((e, t) => /* @__PURE__ */ A("li", { children: [/* @__PURE__ */ k("span", { children: e.name }), /* @__PURE__ */ A("span", { children: [e.size.toLocaleString(), " 字节"] })] }, `${t}:${e.name}`)) }),
|
|
2927
|
+
g.error && /* @__PURE__ */ k("p", {
|
|
2928
|
+
className: "team-inline-error",
|
|
2929
|
+
role: "alert",
|
|
2930
|
+
children: g.error
|
|
2931
|
+
}),
|
|
2932
|
+
/* @__PURE__ */ A("div", {
|
|
2933
|
+
className: "team-task-actions",
|
|
2934
|
+
children: [
|
|
2935
|
+
I && /* @__PURE__ */ k("button", {
|
|
2936
|
+
type: "button",
|
|
2937
|
+
className: "team-text-button",
|
|
2938
|
+
onClick: () => m.cancel(),
|
|
2939
|
+
children: "取消上传"
|
|
2940
|
+
}),
|
|
2941
|
+
["failed", "cancelled"].includes(g.state) && /* @__PURE__ */ k("button", {
|
|
2942
|
+
type: "button",
|
|
2943
|
+
className: "team-text-button",
|
|
2944
|
+
disabled: !P || y,
|
|
2945
|
+
onClick: () => void m.retry(),
|
|
2946
|
+
children: "重试上传"
|
|
2947
|
+
}),
|
|
2948
|
+
/* @__PURE__ */ k("button", {
|
|
2949
|
+
type: "button",
|
|
2950
|
+
className: "team-text-button",
|
|
2951
|
+
disabled: y || i,
|
|
2952
|
+
onClick: () => m.clear(),
|
|
2953
|
+
children: "移除材料"
|
|
2954
|
+
})
|
|
2955
|
+
]
|
|
2956
|
+
})
|
|
2957
|
+
]
|
|
2958
|
+
}),
|
|
2959
|
+
/* @__PURE__ */ A("div", {
|
|
2960
|
+
className: "team-composer-toolbar",
|
|
2961
|
+
children: [/* @__PURE__ */ A("div", { children: [
|
|
2962
|
+
!N && /* @__PURE__ */ A("select", {
|
|
2963
|
+
"aria-label": "接收成员",
|
|
2964
|
+
value: _,
|
|
2965
|
+
onChange: (e) => v(e.target.value),
|
|
2966
|
+
disabled: y || !P,
|
|
2967
|
+
children: [/* @__PURE__ */ k("option", {
|
|
2968
|
+
value: "",
|
|
2969
|
+
children: "发给 Leader"
|
|
2970
|
+
}), j?.selectedRunMembers.filter((e) => e.status === "active").map((e) => /* @__PURE__ */ A("option", {
|
|
2971
|
+
value: e.memberId,
|
|
2972
|
+
children: ["@", e.name]
|
|
2973
|
+
}, e.memberId))]
|
|
2974
|
+
}),
|
|
2975
|
+
N && /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k("input", {
|
|
2976
|
+
ref: p,
|
|
2977
|
+
type: "file",
|
|
2978
|
+
multiple: !0,
|
|
2979
|
+
hidden: !0,
|
|
2980
|
+
"aria-label": "选择任务材料",
|
|
2981
|
+
onChange: (e) => {
|
|
2982
|
+
let t = Array.from(e.target.files ?? []);
|
|
2983
|
+
e.target.value = "", P && !y && t.length && m.select(t);
|
|
2984
|
+
}
|
|
2985
|
+
}), /* @__PURE__ */ k("button", {
|
|
2986
|
+
className: "team-text-button",
|
|
2987
|
+
type: "button",
|
|
2988
|
+
disabled: !P || y || I,
|
|
2989
|
+
onClick: () => p.current?.click(),
|
|
2990
|
+
children: g.files.length ? "重新选择材料" : "添加材料"
|
|
2991
|
+
})] }),
|
|
2992
|
+
r && /* @__PURE__ */ k("button", {
|
|
2993
|
+
className: "team-text-button",
|
|
2994
|
+
type: "button",
|
|
2995
|
+
disabled: y || i,
|
|
2996
|
+
onClick: d,
|
|
2997
|
+
children: "返回任务"
|
|
2998
|
+
})
|
|
2999
|
+
] }), /* @__PURE__ */ k("button", {
|
|
3000
|
+
className: "team-button team-primary",
|
|
3001
|
+
type: "submit",
|
|
3002
|
+
disabled: !P || y || !a.trim() || !F,
|
|
3003
|
+
children: y ? "正在核对" : N ? "开始协作" : "发送"
|
|
3004
|
+
})]
|
|
3005
|
+
})
|
|
3006
|
+
]
|
|
3007
|
+
}),
|
|
3008
|
+
/* @__PURE__ */ A("p", {
|
|
3009
|
+
className: "team-composer-help",
|
|
3010
|
+
children: ["Enter 发送 · Shift + Enter 换行", N ? " · 单个材料 ≤20 MiB,总计 ≤64 MiB" : " · 接收回执不代表执行完成"]
|
|
3011
|
+
})
|
|
3012
|
+
]
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
3015
|
+
function Te({ task: e, scope: t, product: n, canWrite: r, command: i }) {
|
|
3016
|
+
let [a, o] = E(!1), [s, c] = E(null), [l, u] = E("");
|
|
3017
|
+
return x(() => {
|
|
3018
|
+
if (!a) return;
|
|
3019
|
+
let r = new AbortController();
|
|
3020
|
+
return n.task(t, e.taskId, e.teamRunId, r.signal).then((t) => {
|
|
3021
|
+
if (!r.signal.aborted) {
|
|
3022
|
+
if (t.taskId !== e.taskId || t.revision !== e.revision) throw Error("任务已更新,请刷新后重试。");
|
|
3023
|
+
c(t);
|
|
3024
|
+
}
|
|
3025
|
+
}).catch(() => {
|
|
3026
|
+
r.signal.aborted || u("任务详情读取失败,请关闭后重新打开。");
|
|
3027
|
+
}), () => r.abort();
|
|
3028
|
+
}, [
|
|
3029
|
+
a,
|
|
3030
|
+
n,
|
|
3031
|
+
t,
|
|
3032
|
+
e
|
|
3033
|
+
]), /* @__PURE__ */ A("article", {
|
|
3034
|
+
className: "team-cloud-task",
|
|
3035
|
+
children: [
|
|
3036
|
+
/* @__PURE__ */ A("button", {
|
|
3037
|
+
className: "team-cloud-task-title",
|
|
3038
|
+
type: "button",
|
|
3039
|
+
"aria-expanded": a,
|
|
3040
|
+
onClick: () => {
|
|
3041
|
+
o(!a), u("");
|
|
3042
|
+
},
|
|
3043
|
+
children: [/* @__PURE__ */ k("strong", { children: e.title }), /* @__PURE__ */ k(z, { status: e.status })]
|
|
3044
|
+
}),
|
|
3045
|
+
e.reason && /* @__PURE__ */ k("p", {
|
|
3046
|
+
className: "team-muted",
|
|
3047
|
+
children: Q(e.reason)
|
|
3048
|
+
}),
|
|
3049
|
+
a && (s ? /* @__PURE__ */ k(te, {
|
|
3050
|
+
task: s,
|
|
3051
|
+
members: [],
|
|
3052
|
+
onAction: r ? (t, n, r) => i(`tasks/${e.taskId}/actions`, {
|
|
3053
|
+
action: n,
|
|
3054
|
+
expectedRevision: e.revision,
|
|
3055
|
+
...r ? { reason: r } : {}
|
|
3056
|
+
}) : void 0
|
|
3057
|
+
}) : /* @__PURE__ */ k("p", {
|
|
3058
|
+
role: l ? "alert" : "status",
|
|
3059
|
+
children: l || "正在读取任务详情…"
|
|
3060
|
+
}))
|
|
3061
|
+
]
|
|
3062
|
+
});
|
|
3063
|
+
}
|
|
3064
|
+
function Ee(e) {
|
|
3065
|
+
if (!e || typeof e != "object") return !1;
|
|
3066
|
+
if (Array.isArray(e)) return e.some(Ee);
|
|
3067
|
+
let t = e;
|
|
3068
|
+
return t.secret === !0 || t.writeOnly === !0 || t.format === "password" || Object.values(t).some(Ee);
|
|
3069
|
+
}
|
|
3070
|
+
function De({ summary: n, scope: r, product: i, canWrite: a, command: o }) {
|
|
3071
|
+
let [s, c] = E(null), [l, u] = E(!1), [d, f] = E({}), [p, m] = E(""), [h, g] = E(!1), [_, v] = E(!1);
|
|
3072
|
+
x(() => {
|
|
3073
|
+
if (!l) return;
|
|
3074
|
+
let e = new AbortController();
|
|
3075
|
+
return i.interaction(r, n, e.signal).then((t) => {
|
|
3076
|
+
e.signal.aborted || c(t);
|
|
3077
|
+
}).catch(() => {
|
|
3078
|
+
e.signal.aborted || m("审批详情读取失败,请关闭后重试或刷新。");
|
|
3079
|
+
}), () => e.abort();
|
|
3080
|
+
}, [
|
|
3081
|
+
l,
|
|
3082
|
+
r,
|
|
3083
|
+
i,
|
|
3084
|
+
n
|
|
3085
|
+
]);
|
|
3086
|
+
async function y(e, t) {
|
|
3087
|
+
if (!(!a || !s || s.status !== "pending" || h || _ || Ee(s.requestSchema))) {
|
|
3088
|
+
g(!0), m("");
|
|
3089
|
+
try {
|
|
3090
|
+
await o("interactions", {
|
|
3091
|
+
ref: s.ref,
|
|
3092
|
+
expectedRevision: s.revision,
|
|
3093
|
+
action: e,
|
|
3094
|
+
response: t
|
|
3095
|
+
}), v(!0);
|
|
3096
|
+
} catch (e) {
|
|
3097
|
+
m(e instanceof Error ? e.message : "审批提交失败。");
|
|
3098
|
+
} finally {
|
|
3099
|
+
g(!1);
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
}
|
|
3103
|
+
return /* @__PURE__ */ A("article", {
|
|
3104
|
+
className: "team-interaction-card",
|
|
3105
|
+
children: [
|
|
3106
|
+
/* @__PURE__ */ k("h3", { children: n.title }),
|
|
3107
|
+
/* @__PURE__ */ k("button", {
|
|
3108
|
+
className: "team-text-button",
|
|
3109
|
+
type: "button",
|
|
3110
|
+
"aria-expanded": l,
|
|
3111
|
+
onClick: () => {
|
|
3112
|
+
u(!l), m("");
|
|
3113
|
+
},
|
|
3114
|
+
children: l ? "收起详情" : "查看并处理"
|
|
3115
|
+
}),
|
|
3116
|
+
l && (s ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(j, { message: s.message }), _ || s.status !== "pending" ? /* @__PURE__ */ k("p", {
|
|
3117
|
+
role: "status",
|
|
3118
|
+
children: _ || s.status === "resolving" ? "服务端已接收,等待执行端确认。" : s.status === "expired" ? "该事项已过期。" : s.status === "cancelled" ? "该事项已取消。" : "该事项已处理。"
|
|
3119
|
+
}) : Ee(s.requestSchema) ? /* @__PURE__ */ k("p", {
|
|
3120
|
+
role: "status",
|
|
3121
|
+
children: "此表单包含敏感字段,无法通过浏览器持久队列提交,请使用安全凭据配置入口。"
|
|
3122
|
+
}) : s.kind === "input" ? s.requestSchema && e(s.requestSchema).length > 0 ? /* @__PURE__ */ k(t, {
|
|
3123
|
+
schema: s.requestSchema,
|
|
3124
|
+
values: d,
|
|
3125
|
+
onChange: f,
|
|
3126
|
+
disabled: !a || h,
|
|
3127
|
+
onSubmit: () => void y("submit", d),
|
|
3128
|
+
onCancel: () => void y("cancel", {})
|
|
3129
|
+
}) : /* @__PURE__ */ k("p", {
|
|
3130
|
+
role: "status",
|
|
3131
|
+
children: "缺少输入表单,暂不能提交。"
|
|
3132
|
+
}) : /* @__PURE__ */ A("div", {
|
|
3133
|
+
className: "team-task-actions",
|
|
3134
|
+
children: [/* @__PURE__ */ k("button", {
|
|
3135
|
+
className: "team-button",
|
|
3136
|
+
disabled: !a || h,
|
|
3137
|
+
onClick: () => void y("reject", { approved: !1 }),
|
|
3138
|
+
children: "拒绝"
|
|
3139
|
+
}), /* @__PURE__ */ k("button", {
|
|
3140
|
+
className: "team-button team-primary",
|
|
3141
|
+
disabled: !a || h,
|
|
3142
|
+
onClick: () => void y("approve", { approved: !0 }),
|
|
3143
|
+
children: "同意"
|
|
3144
|
+
})]
|
|
3145
|
+
})] }) : /* @__PURE__ */ k("p", {
|
|
3146
|
+
role: "status",
|
|
3147
|
+
children: p || "正在读取审批详情…"
|
|
3148
|
+
})),
|
|
3149
|
+
p && s && /* @__PURE__ */ k("p", {
|
|
3150
|
+
role: "alert",
|
|
3151
|
+
className: "team-inline-error",
|
|
3152
|
+
children: p
|
|
3153
|
+
})
|
|
3154
|
+
]
|
|
3155
|
+
});
|
|
3156
|
+
}
|
|
3157
|
+
//#endregion
|
|
3158
|
+
export { xe as CloudTeamWorkspace, Ce as CloudTeamWorkspaceView, X as CreateGroupDialog, W as GroupComposer, V as GroupHeader, H as GroupTimeline, K as MemberInspector, ie as MemberRail, ee as TaskBoard, te as TaskDetail, re as TeamInteractionTray, U as TeamProgressCard, z as TeamStatusLabel, ae as TeamWorkspace, ue as useTeamChat };
|