dsh-run2skill 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +5 -5
- package/README.md +5 -5
- package/lib/client.js +307 -84
- package/lib/index.d.ts +64 -3
- package/lib/index.js +8916 -7293
- package/package.json +18 -5
package/lib/client.js
CHANGED
|
@@ -4219,41 +4219,48 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4219
4219
|
}
|
|
4220
4220
|
//#endregion
|
|
4221
4221
|
//#region \0run2skill-css:run2skill-settings-page.module.css.mjs
|
|
4222
|
-
const css = ".
|
|
4222
|
+
const css = ".run2skill_page_R4wX7a{width:min(100%,1040px);color:var(--dsw-alias-label-primary);gap:24px;padding:16px 0 48px;display:grid}.run2skill_intro_R4wX7a,.run2skill_muted_R4wX7a{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:1.5}.run2skill_section_R4wX7a{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);box-shadow:0 1px 2px var(--dsw-alias-border-l1);border-radius:16px;overflow:hidden}.run2skill_sectionHeader_R4wX7a{box-sizing:border-box;height:auto;min-height:56px;padding:14px 20px}.run2skill_sectionTitle_R4wX7a{font-size:15px}.run2skill_sectionBody_R4wX7a{gap:18px;padding:12px 24px 24px 56px;display:grid;container-type:inline-size}.run2skill_attentionGroup_R4wX7a{gap:16px;min-width:0;display:grid}.run2skill_empty_R4wX7a{min-height:56px;color:var(--dsw-alias-label-secondary);place-items:center;margin:0;font-size:13px;display:grid}.run2skill_toolbar_R4wX7a,.run2skill_actions_R4wX7a,.run2skill_modeGroup_R4wX7a{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_attentionList_R4wX7a,.run2skill_proposalList_R4wX7a,.run2skill_activityList_R4wX7a{gap:8px;margin:0;padding:0;list-style:none;display:grid}.run2skill_activityItem_R4wX7a{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.run2skill_activitySummary_R4wX7a{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_proposalToolbar_R4wX7a{grid-template-columns:minmax(12rem,1fr) auto;align-items:center;gap:8px;display:grid}.run2skill_proposalToolbar_R4wX7a>:first-child{width:100%}.run2skill_proposalToolbarCompact_R4wX7a{justify-content:flex-end;display:flex}.run2skill_proposalToolbarCompact_R4wX7a>:first-child{width:auto}.run2skill_proposalLayout_R4wX7a{grid-template-columns:1fr;gap:12px;display:grid}.run2skill_proposalListButton_R4wX7a{text-align:start;white-space:normal;overflow-wrap:anywhere;border-radius:10px;flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:2px;width:100%;height:auto;min-height:48px;padding:8px 12px}.run2skill_proposalListButton_R4wX7a[aria-current=true]{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary);box-shadow:inset 3px 0 var(--dsw-alias-brand-primary)}.run2skill_proposalName_R4wX7a{max-width:100%;font-size:14px;font-weight:600;line-height:20px}.run2skill_proposalMeta_R4wX7a{max-width:100%;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.run2skill_detail_R4wX7a{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;min-width:0;max-height:640px;padding:18px;overflow:auto}.run2skill_detail_R4wX7a>:first-child{margin-top:0}.run2skill_detailFacts_R4wX7a{grid-template-columns:minmax(6rem,max-content) minmax(0,1fr);gap:8px 16px;margin:0 0 20px;display:grid}.run2skill_detailFacts_R4wX7a dt{color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_detailFacts_R4wX7a dd{overflow-wrap:anywhere;min-width:0;margin:0}.run2skill_detail_R4wX7a pre{white-space:pre-wrap;unicode-bidi:isolate;overflow:auto}.run2skill_technicalDetails_R4wX7a{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;margin:16px 0;padding:10px 12px}.run2skill_technicalDetails_R4wX7a summary{cursor:pointer;color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_technicalDetails_R4wX7a[open] summary{margin-bottom:12px}.run2skill_status_R4wX7a{min-height:20px;margin:0;font-size:13px}.run2skill_danger_R4wX7a{color:var(--dsw-alias-state-error-primary)}.run2skill_backdrop_R4wX7a,.run2skill_rejectOverlay_R4wX7a{background:var(--dsw-alias-bg-mask-1);position:fixed;inset:0}.run2skill_backdrop_R4wX7a{z-index:999}.run2skill_rejectOverlay_R4wX7a{z-index:1001;place-items:center;padding:16px;display:grid}.run2skill_legacyDialog_R4wX7a{z-index:1000;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-shadow:0 16px 48px var(--dsw-alias-bg-mask-1);border-radius:16px;grid-template-columns:minmax(16rem,24rem) minmax(0,1fr);gap:16px;padding:16px;display:grid;position:fixed;inset:5vh 5vw;overflow:hidden}.run2skill_blocked_R4wX7a{pointer-events:none;display:contents}.run2skill_queue_R4wX7a,.run2skill_legacyDetail_R4wX7a{min-width:0;overflow:auto}.run2skill_legacyHeader_R4wX7a{justify-content:space-between;align-items:center;gap:8px;display:flex}.run2skill_legacyList_R4wX7a{margin:0;padding:0;list-style:none}.run2skill_rejectCard_R4wX7a{background:var(--dsw-alias-bg-layer-1);border-radius:16px;max-width:32rem;padding:16px}.run2skill_textBlock_R4wX7a{white-space:pre-wrap;overflow-wrap:anywhere;unicode-bidi:isolate;overflow:auto}.run2skill_previewFacts_R4wX7a{grid-template-columns:max-content 1fr;gap:6px 12px;display:grid}.run2skill_previewFacts_R4wX7a dt,.run2skill_previewFacts_R4wX7a dd{margin:0}@container (width>=760px){.run2skill_proposalLayout_R4wX7a{grid-template-columns:minmax(240px,.8fr) minmax(0,1.6fr);gap:20px}}@container (width<=420px){.run2skill_proposalToolbar_R4wX7a,.run2skill_detailFacts_R4wX7a{grid-template-columns:1fr}.run2skill_proposalToolbar_R4wX7a>:last-child{justify-self:start}.run2skill_detailFacts_R4wX7a dt:not(:first-child){margin-top:8px}}@media (width<=720px){.run2skill_sectionBody_R4wX7a{padding:8px 18px 20px}.run2skill_activityItem_R4wX7a{flex-direction:column;align-items:flex-start}}";
|
|
4223
4223
|
if (typeof document !== "undefined") upsertRun2skillStyle(css);
|
|
4224
4224
|
var _run2skill_css_run2skill_settings_page_module_css_default = {
|
|
4225
|
-
"
|
|
4226
|
-
"
|
|
4227
|
-
"
|
|
4228
|
-
"
|
|
4229
|
-
"
|
|
4230
|
-
"
|
|
4231
|
-
"
|
|
4232
|
-
"
|
|
4233
|
-
"
|
|
4234
|
-
"
|
|
4235
|
-
"
|
|
4236
|
-
"
|
|
4237
|
-
"
|
|
4238
|
-
"
|
|
4239
|
-
"
|
|
4240
|
-
"
|
|
4241
|
-
"
|
|
4242
|
-
"
|
|
4243
|
-
"
|
|
4244
|
-
"
|
|
4245
|
-
"
|
|
4246
|
-
"
|
|
4247
|
-
"
|
|
4248
|
-
"
|
|
4249
|
-
"
|
|
4250
|
-
"
|
|
4251
|
-
"
|
|
4252
|
-
"
|
|
4253
|
-
"
|
|
4254
|
-
"
|
|
4255
|
-
"
|
|
4256
|
-
"
|
|
4225
|
+
"textBlock": "run2skill_textBlock_R4wX7a",
|
|
4226
|
+
"previewFacts": "run2skill_previewFacts_R4wX7a",
|
|
4227
|
+
"attentionList": "run2skill_attentionList_R4wX7a",
|
|
4228
|
+
"rejectCard": "run2skill_rejectCard_R4wX7a",
|
|
4229
|
+
"status": "run2skill_status_R4wX7a",
|
|
4230
|
+
"empty": "run2skill_empty_R4wX7a",
|
|
4231
|
+
"proposalListButton": "run2skill_proposalListButton_R4wX7a",
|
|
4232
|
+
"danger": "run2skill_danger_R4wX7a",
|
|
4233
|
+
"page": "run2skill_page_R4wX7a",
|
|
4234
|
+
"attentionGroup": "run2skill_attentionGroup_R4wX7a",
|
|
4235
|
+
"sectionTitle": "run2skill_sectionTitle_R4wX7a",
|
|
4236
|
+
"backdrop": "run2skill_backdrop_R4wX7a",
|
|
4237
|
+
"blocked": "run2skill_blocked_R4wX7a",
|
|
4238
|
+
"actions": "run2skill_actions_R4wX7a",
|
|
4239
|
+
"legacyDialog": "run2skill_legacyDialog_R4wX7a",
|
|
4240
|
+
"modeGroup": "run2skill_modeGroup_R4wX7a",
|
|
4241
|
+
"activityItem": "run2skill_activityItem_R4wX7a",
|
|
4242
|
+
"proposalToolbarCompact": "run2skill_proposalToolbarCompact_R4wX7a",
|
|
4243
|
+
"detail": "run2skill_detail_R4wX7a",
|
|
4244
|
+
"intro": "run2skill_intro_R4wX7a",
|
|
4245
|
+
"technicalDetails": "run2skill_technicalDetails_R4wX7a",
|
|
4246
|
+
"muted": "run2skill_muted_R4wX7a",
|
|
4247
|
+
"activitySummary": "run2skill_activitySummary_R4wX7a",
|
|
4248
|
+
"proposalList": "run2skill_proposalList_R4wX7a",
|
|
4249
|
+
"detailFacts": "run2skill_detailFacts_R4wX7a",
|
|
4250
|
+
"legacyHeader": "run2skill_legacyHeader_R4wX7a",
|
|
4251
|
+
"sectionBody": "run2skill_sectionBody_R4wX7a",
|
|
4252
|
+
"sectionHeader": "run2skill_sectionHeader_R4wX7a",
|
|
4253
|
+
"proposalLayout": "run2skill_proposalLayout_R4wX7a",
|
|
4254
|
+
"activityList": "run2skill_activityList_R4wX7a",
|
|
4255
|
+
"rejectOverlay": "run2skill_rejectOverlay_R4wX7a",
|
|
4256
|
+
"toolbar": "run2skill_toolbar_R4wX7a",
|
|
4257
|
+
"section": "run2skill_section_R4wX7a",
|
|
4258
|
+
"proposalToolbar": "run2skill_proposalToolbar_R4wX7a",
|
|
4259
|
+
"queue": "run2skill_queue_R4wX7a",
|
|
4260
|
+
"legacyDetail": "run2skill_legacyDetail_R4wX7a",
|
|
4261
|
+
"proposalName": "run2skill_proposalName_R4wX7a",
|
|
4262
|
+
"proposalMeta": "run2skill_proposalMeta_R4wX7a",
|
|
4263
|
+
"legacyList": "run2skill_legacyList_R4wX7a"
|
|
4257
4264
|
};
|
|
4258
4265
|
//#endregion
|
|
4259
4266
|
//#region src/client/purge-settings.ts
|
|
@@ -4970,6 +4977,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4970
4977
|
"PUBLISHED",
|
|
4971
4978
|
"PUBLISH_FAILED"
|
|
4972
4979
|
]);
|
|
4980
|
+
const attentionAction = object({
|
|
4981
|
+
actionKey: string().regex(/^act_[a-f0-9]{64}$/),
|
|
4982
|
+
subjectId: workItemId,
|
|
4983
|
+
kind: _enum([
|
|
4984
|
+
"REVIEW_PROPOSAL",
|
|
4985
|
+
"REFRESH_PROPOSAL",
|
|
4986
|
+
"RETRY_PUBLICATION"
|
|
4987
|
+
]),
|
|
4988
|
+
proposalRef
|
|
4989
|
+
}).strict();
|
|
4973
4990
|
const rootDisplay = object({
|
|
4974
4991
|
state: _enum(["EXISTING", "ABSENT"]),
|
|
4975
4992
|
scope: _enum(["PROJECT", "USER"]),
|
|
@@ -5043,12 +5060,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5043
5060
|
supportingExperienceIds: array(string().regex(/^exp_[a-f0-9]{64}$/)).min(1).max(3),
|
|
5044
5061
|
catalogObservationDigest: sha256,
|
|
5045
5062
|
curationRationale: string().min(1).max(4096),
|
|
5046
|
-
actionBinding,
|
|
5063
|
+
actionBinding: actionBinding.optional(),
|
|
5047
5064
|
proposalId,
|
|
5048
5065
|
digest: sha256
|
|
5049
|
-
}).strict().
|
|
5050
|
-
|
|
5051
|
-
|
|
5066
|
+
}).strict().superRefine((value, context) => {
|
|
5067
|
+
if (value.actionBinding !== void 0 && value.kind !== value.actionBinding.kind) context.addIssue({
|
|
5068
|
+
code: "custom",
|
|
5069
|
+
path: ["actionBinding"],
|
|
5070
|
+
message: "action binding kind must match proposal kind"
|
|
5071
|
+
});
|
|
5052
5072
|
});
|
|
5053
5073
|
const evidence = object({
|
|
5054
5074
|
source: literal("USER_DIRECT"),
|
|
@@ -5140,8 +5160,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5140
5160
|
turnEndSeq: nonNegativeInteger
|
|
5141
5161
|
}).strict(),
|
|
5142
5162
|
evidenceRefs: array(evidence).max(16),
|
|
5143
|
-
experiences: array(experience).max(3)
|
|
5144
|
-
|
|
5163
|
+
experiences: array(experience).max(3),
|
|
5164
|
+
action: attentionAction.optional()
|
|
5165
|
+
}).strict().superRefine((value, context) => {
|
|
5166
|
+
if (value.processingState === "READY_FOR_REVIEW" && value.publicationOutcome === "PENDING_REVIEW" && value.proposal.actionBinding === void 0) context.addIssue({
|
|
5167
|
+
code: "custom",
|
|
5168
|
+
path: ["proposal", "actionBinding"],
|
|
5169
|
+
message: "approvable Proposal requires a safe action binding"
|
|
5170
|
+
});
|
|
5171
|
+
});
|
|
5145
5172
|
const receipt = object({
|
|
5146
5173
|
apiVersion: literal(1),
|
|
5147
5174
|
workItemId,
|
|
@@ -5186,8 +5213,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5186
5213
|
approve: "proposals/approve",
|
|
5187
5214
|
reject: "proposals/reject",
|
|
5188
5215
|
retry: "proposals/retry",
|
|
5216
|
+
refresh: "proposals/refresh",
|
|
5189
5217
|
confirmDiscard: "coverage/confirm-discard"
|
|
5190
5218
|
};
|
|
5219
|
+
function describeProposalKind(kind) {
|
|
5220
|
+
if (kind === "CREATE") return "新建技能";
|
|
5221
|
+
if (kind === "MERGE") return "更新已有技能";
|
|
5222
|
+
return "无需新建技能";
|
|
5223
|
+
}
|
|
5224
|
+
function describePersistenceScope(scope) {
|
|
5225
|
+
return scope === "PROJECT" ? "仅当前项目可用" : "所有项目可用";
|
|
5226
|
+
}
|
|
5227
|
+
function describeProposalScope(kind, scope) {
|
|
5228
|
+
if (kind !== "DISCARD") return describePersistenceScope(scope);
|
|
5229
|
+
return scope === "PROJECT" ? "本次经验来自当前项目" : "本次经验适用于所有项目";
|
|
5230
|
+
}
|
|
5191
5231
|
function describeProposalOutcome(detail) {
|
|
5192
5232
|
if (detail.publicationOutcome === "PUBLISHED") return "Skill 已保存,DSH 已确认可以使用";
|
|
5193
5233
|
if (detail.publicationOutcome === "DISCARDED") return "技能草稿已放弃,Skill 未更改";
|
|
@@ -5393,19 +5433,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5393
5433
|
await this.whenIdle();
|
|
5394
5434
|
const detail = this.#state.detail;
|
|
5395
5435
|
if (this.#disposed || detail === void 0 || this.#state.mutationPending) return;
|
|
5396
|
-
const proposalRef = {
|
|
5436
|
+
const proposalRef = detail.action?.proposalRef ?? {
|
|
5397
5437
|
proposalId: detail.proposal.proposalId,
|
|
5398
5438
|
revision: detail.proposal.revision,
|
|
5399
5439
|
digest: detail.proposal.digest
|
|
5400
5440
|
};
|
|
5401
|
-
const targetEndpoint = action === "APPROVE" ? endpoint.approve : action === "REJECT" ? endpoint.reject : action === "RETRY" ? endpoint.retry : endpoint.confirmDiscard;
|
|
5441
|
+
const targetEndpoint = action === "APPROVE" ? endpoint.approve : action === "REJECT" ? endpoint.reject : action === "REFRESH" ? endpoint.refresh : action === "RETRY" ? endpoint.retry : endpoint.confirmDiscard;
|
|
5402
5442
|
const request = {
|
|
5403
5443
|
apiVersion: 1,
|
|
5404
5444
|
workItemId: detail.workItemId,
|
|
5405
5445
|
workItemRevision: detail.workItemRevision,
|
|
5406
5446
|
proposalRef,
|
|
5407
5447
|
currentScope: this.#scopeAccess().currentScope,
|
|
5408
|
-
action: this.#scopeAccess().actions.find((candidate) => candidate.proposalRef.proposalId === proposalRef.proposalId),
|
|
5448
|
+
action: detail.action ?? this.#scopeAccess().actions.find((candidate) => candidate.proposalRef.proposalId === proposalRef.proposalId),
|
|
5409
5449
|
...action === "REJECT" ? { confirm: true } : {}
|
|
5410
5450
|
};
|
|
5411
5451
|
await this.#execute(async (signal) => {
|
|
@@ -5834,7 +5874,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5834
5874
|
controller.select(item.proposalRef.proposalId);
|
|
5835
5875
|
},
|
|
5836
5876
|
className: _run2skill_css_run2skill_settings_page_module_css_default.proposalListButton
|
|
5837
|
-
}, `${item.kind} · ${makeSafeText(item.name)} · ${item.persistenceScope} · ${describeProposalListItem(item)}`))))), (0, react.createElement)("section", {
|
|
5877
|
+
}, `${describeProposalKind(item.kind)} · ${makeSafeText(item.name)} · ${describeProposalScope(item.kind, item.persistenceScope)} · ${describeProposalListItem(item)}`))))), (0, react.createElement)("section", {
|
|
5838
5878
|
"aria-label": "技能草稿详情",
|
|
5839
5879
|
className: _run2skill_css_run2skill_settings_page_module_css_default.legacyDetail
|
|
5840
5880
|
}, state.detailPhase === "IDLE" ? (0, react.createElement)("p", null, "选择一份技能草稿查看完整内容") : null, state.detailPhase === "LOADING" ? (0, react.createElement)("p", null, "正在加载技能草稿详情…") : null, state.detailPhase === "ERROR" ? (0, react.createElement)("p", { role: "alert" }, "技能草稿详情暂不可用") : null, state.detail === void 0 ? null : (0, react.createElement)(ProposalDetailView, {
|
|
@@ -5851,6 +5891,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5851
5891
|
onRetry: () => {
|
|
5852
5892
|
controller.mutate("RETRY");
|
|
5853
5893
|
},
|
|
5894
|
+
onRefresh: () => {
|
|
5895
|
+
controller.mutate("REFRESH");
|
|
5896
|
+
},
|
|
5854
5897
|
onConfirmDiscard: () => {
|
|
5855
5898
|
controller.mutate("CONFIRM_DISCARD");
|
|
5856
5899
|
}
|
|
@@ -5870,12 +5913,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5870
5913
|
}
|
|
5871
5914
|
function factsFromAction(detail) {
|
|
5872
5915
|
const action = detail.proposal.actionBinding;
|
|
5916
|
+
if (action === void 0) {
|
|
5917
|
+
if (detail.publicationOutcome === "NEEDS_REFRESH") return "这份草稿的保存目标已失效;请生成新草稿后重新审核。";
|
|
5918
|
+
if (detail.publicationOutcome === "PUBLISH_FAILED") return "这份草稿的保存目标暂时不可确认;请等待目录恢复后重试保存。";
|
|
5919
|
+
return "这份草稿的保存目标暂时不可确认;请等待目录恢复后重新打开详情。";
|
|
5920
|
+
}
|
|
5873
5921
|
if (action.kind === "CREATE") return [
|
|
5874
5922
|
`Skill 存储规则版本:${action.rootBinding.rootContractVersion}`,
|
|
5875
5923
|
`Skill 存储定位器版本:${action.rootBinding.resolverVersion}`,
|
|
5876
|
-
|
|
5924
|
+
`保存位置:${describeRootSource(action.rootBinding.expectedSource)}`,
|
|
5877
5925
|
`存储定位规则校验值:${action.rootBinding.resolutionContractDigest}`,
|
|
5878
|
-
|
|
5926
|
+
`保存目录:${describeRootState(action.rootBinding.state)}`,
|
|
5879
5927
|
`Skill 名称:${action.targetBinding.skillName}`,
|
|
5880
5928
|
`Skill 内容校验值:${detail.proposal.skillBytesDigest}`,
|
|
5881
5929
|
`确认目标不存在的时间:${action.expectedAbsence.observedAt}`,
|
|
@@ -5886,9 +5934,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5886
5934
|
if (action.kind === "MERGE") return [
|
|
5887
5935
|
`Skill 存储规则版本:${action.rootBinding.rootContractVersion}`,
|
|
5888
5936
|
`Skill 存储定位器版本:${action.rootBinding.resolverVersion}`,
|
|
5889
|
-
|
|
5937
|
+
`保存位置:${describeRootSource(action.rootBinding.expectedSource)}`,
|
|
5890
5938
|
`存储定位规则校验值:${action.rootBinding.resolutionContractDigest}`,
|
|
5891
|
-
|
|
5939
|
+
`保存目录:${describeRootState(action.rootBinding.state)}`,
|
|
5892
5940
|
`现有 Skill 标识:${action.baseBinding.candidateKey}`,
|
|
5893
5941
|
`Skill 名称:${action.targetBinding.skillName}`,
|
|
5894
5942
|
`原内容校验值:${action.baseBinding.bytesDigest}`,
|
|
@@ -5897,13 +5945,48 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5897
5945
|
return [
|
|
5898
5946
|
`匹配到的现有 Skill 标识:${action.coveringCandidateBinding.candidateKey}`,
|
|
5899
5947
|
`名称:${action.coveringCandidateBinding.name}`,
|
|
5900
|
-
|
|
5948
|
+
`已有技能来源:${describeCandidateSource(action.coveringCandidateBinding.source)}`,
|
|
5901
5949
|
`内容校验值:${action.coveringCandidateBinding.contentDigest}`,
|
|
5902
5950
|
`确认时间:${action.coveringCandidateBinding.observedAt}`
|
|
5903
5951
|
].join("\n");
|
|
5904
5952
|
}
|
|
5953
|
+
function describeRootSource(source) {
|
|
5954
|
+
return source === "project-dsh" ? "当前项目的 DSH 技能目录" : "个人 DSH 技能目录(所有项目可用)";
|
|
5955
|
+
}
|
|
5956
|
+
function describeRootState(state) {
|
|
5957
|
+
return state === "EXISTING" ? "已存在" : "尚未建立,保存时会自动创建";
|
|
5958
|
+
}
|
|
5959
|
+
function describeCandidateSource(source) {
|
|
5960
|
+
if (source === "project-dsh") return "当前项目的 DSH 技能";
|
|
5961
|
+
if (source === "project-agents") return "当前项目的 Agent 技能";
|
|
5962
|
+
if (source === "user-dsh") return "个人 DSH 技能(所有项目可用)";
|
|
5963
|
+
if (source === "user-agents") return "个人 Agent 技能(所有项目可用)";
|
|
5964
|
+
if (source === "bundled") return "DSH 内置技能";
|
|
5965
|
+
if (source === "runtime") return "当前会话加载的技能";
|
|
5966
|
+
if (source === "custom") return "自定义技能目录";
|
|
5967
|
+
return "其他已加载位置";
|
|
5968
|
+
}
|
|
5969
|
+
function describeProposalAction(detail) {
|
|
5970
|
+
const proposal = detail.proposal;
|
|
5971
|
+
if (proposal.actionBinding === void 0) return factsFromAction(detail);
|
|
5972
|
+
if (proposal.actionBinding.kind === "CREATE") return `确认后会新建技能“${makeSafeText(proposal.name)}”。`;
|
|
5973
|
+
if (proposal.actionBinding.kind === "MERGE") return `确认后会把这次经验补充到已有技能“${makeSafeText(proposal.name)}”中。`;
|
|
5974
|
+
const existingName = proposal.actionBinding.coveringCandidateBinding.name;
|
|
5975
|
+
return `已有技能“${makeSafeText(existingName)}”已包含这次经验。这份草稿不会保存,确认后将继续使用该已有技能。`;
|
|
5976
|
+
}
|
|
5977
|
+
function describeExperienceType(type) {
|
|
5978
|
+
if (type === "CORRECTION") return "纠错经验";
|
|
5979
|
+
if (type === "CONSTRAINT") return "使用约束";
|
|
5980
|
+
return "操作流程";
|
|
5981
|
+
}
|
|
5982
|
+
function describeResolutionKind(kind) {
|
|
5983
|
+
if (kind === "CONFIGURATION") return "由 DSH 配置指定";
|
|
5984
|
+
if (kind === "ENVIRONMENT") return "由运行环境指定";
|
|
5985
|
+
return "使用 DSH 默认位置";
|
|
5986
|
+
}
|
|
5905
5987
|
function proposalDetailAction(detail, mutationPending) {
|
|
5906
5988
|
if (mutationPending) return "NONE";
|
|
5989
|
+
if (detail.processingState === "NEEDS_ATTENTION" && detail.publicationOutcome === "NEEDS_REFRESH") return "REFRESH";
|
|
5907
5990
|
if (detail.reviewDecision === "PENDING" && detail.processingState === "READY_FOR_REVIEW" && detail.publicationOutcome === "PENDING_REVIEW") return "REVIEW";
|
|
5908
5991
|
if (detail.reviewDecision === "APPROVED" && detail.processingState === "NEEDS_ATTENTION" && detail.publicationOutcome === "PUBLISH_FAILED") return "RETRY_PUBLICATION";
|
|
5909
5992
|
return "NONE";
|
|
@@ -5914,18 +5997,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5914
5997
|
const action = proposalDetailAction(detail, mutationPending);
|
|
5915
5998
|
const actionable = action === "REVIEW";
|
|
5916
5999
|
const coordinate = detail.sessionCoordinate;
|
|
5917
|
-
const baseBytes = proposal.actionBinding
|
|
5918
|
-
const coveringBytes = proposal.actionBinding
|
|
6000
|
+
const baseBytes = proposal.actionBinding?.kind === "MERGE" ? proposal.actionBinding.baseBinding.exactBytes : void 0;
|
|
6001
|
+
const coveringBytes = proposal.actionBinding?.kind === "DISCARD" ? proposal.actionBinding.coveringCandidateBinding.content : void 0;
|
|
6002
|
+
const coveringCandidate = proposal.actionBinding?.kind === "DISCARD" ? proposal.actionBinding.coveringCandidateBinding : void 0;
|
|
5919
6003
|
const diff = baseBytes === void 0 ? [] : makeExactLineDiff(baseBytes, proposal.exactSkillBytes);
|
|
5920
|
-
return (0, react.createElement)(react.Fragment, null, (0, react.createElement)("h3", null, `${proposal.kind}
|
|
6004
|
+
return (0, react.createElement)(react.Fragment, null, (0, react.createElement)("h3", null, coveringCandidate === void 0 ? `${describeProposalKind(proposal.kind)}:${makeSafeText(proposal.name)}` : `无需新建技能:继续使用 ${makeSafeText(coveringCandidate.name)}`), (0, react.createElement)("dl", { className: _run2skill_css_run2skill_settings_page_module_css_default.detailFacts }, coveringCandidate === void 0 ? (0, react.createElement)(react.Fragment, null, (0, react.createElement)("dt", null, "这个技能有什么用"), (0, react.createElement)("dd", null, makeSafeText(proposal.description)), (0, react.createElement)("dt", null, "什么时候会用到"), (0, react.createElement)("dd", null, makeSafeText(proposal.whenToUse)), (0, react.createElement)("dt", null, "保存后在哪里可用"), (0, react.createElement)("dd", null, describePersistenceScope(proposal.persistenceScope))) : (0, react.createElement)(react.Fragment, null, (0, react.createElement)("dt", null, "原本想保存的经验"), (0, react.createElement)("dd", null, makeSafeText(proposal.description)), (0, react.createElement)("dt", null, "适用场景"), (0, react.createElement)("dd", null, makeSafeText(proposal.whenToUse)), (0, react.createElement)("dt", null, "这次经验的范围"), (0, react.createElement)("dd", null, describeProposalScope(proposal.kind, proposal.persistenceScope))), (0, react.createElement)("dt", null, "当前进度"), (0, react.createElement)("dd", null, describeProposalOutcome(detail))), (0, react.createElement)("h4", null, coveringCandidate === void 0 ? "为什么建议保存" : "为什么无需新建"), (0, react.createElement)("p", null, makeSafeText(proposal.curationRationale)), ...detail.experiences.map((experience) => (0, react.createElement)("article", { key: experience.experienceId }, (0, react.createElement)("strong", null, `${describeExperienceType(experience.type)} · 来自明确表达`), (0, react.createElement)("p", null, makeSafeText(experience.lesson)))), (0, react.createElement)("h4", null, "参考的对话内容"), (0, react.createElement)("p", { className: _run2skill_css_run2skill_settings_page_module_css_default.muted }, "以下片段来自本次对话,并已过滤不可安全展示的内容。"), ...detail.evidenceRefs.map((evidence, index) => (0, react.createElement)("article", { key: `${String(evidence.messageSeq)}:${evidence.excerptDigest}` }, (0, react.createElement)("strong", null, `对话片段 ${String(index + 1)}${evidence.truncated ? "(内容较长,已节选)" : ""}`), (0, react.createElement)(ProposalTextView, {
|
|
5921
6005
|
value: evidence.excerpt,
|
|
5922
6006
|
mode: "SAFE",
|
|
5923
|
-
label:
|
|
5924
|
-
}))), (0, react.createElement)("h4", null, "
|
|
6007
|
+
label: `参考的对话内容 ${String(index + 1)}`
|
|
6008
|
+
}))), (0, react.createElement)("h4", null, "这次会怎么处理"), (0, react.createElement)("p", null, describeProposalAction(detail)), (0, react.createElement)("details", { className: _run2skill_css_run2skill_settings_page_module_css_default.technicalDetails }, (0, react.createElement)("summary", null, "技术信息(排查问题时使用)"), (0, react.createElement)("dl", { className: _run2skill_css_run2skill_settings_page_module_css_default.detailFacts }, (0, react.createElement)("dt", null, "草稿版本"), (0, react.createElement)("dd", null, String(proposal.revision)), (0, react.createElement)("dt", null, "草稿内容指纹"), (0, react.createElement)("dd", null, proposal.digest), (0, react.createElement)("dt", null, "来源会话"), (0, react.createElement)("dd", null, `${coordinate.rootSessionId} / 第 ${String(coordinate.turn)} 回合 / 记录 ${String(coordinate.turnEndSeq)}`), proposal.workspaceBinding === void 0 ? null : (0, react.createElement)(react.Fragment, null, (0, react.createElement)("dt", null, "项目标识"), (0, react.createElement)("dd", null, proposal.workspaceBinding.workspaceId)), proposal.dshHomeBinding === void 0 ? null : (0, react.createElement)(react.Fragment, null, (0, react.createElement)("dt", null, "保存位置识别方式"), (0, react.createElement)("dd", null, describeResolutionKind(proposal.dshHomeBinding.resolutionKind)), (0, react.createElement)("dt", null, "用户技能目录指纹"), (0, react.createElement)("dd", null, proposal.dshHomeBinding.identityDigest)), (0, react.createElement)("dt", null, "用户决定"), (0, react.createElement)("dd", null, describeReviewDecision(detail.reviewDecision)), (0, react.createElement)("dt", null, "处理进度"), (0, react.createElement)("dd", null, describeProcessingState(detail.processingState)), (0, react.createElement)("dt", null, coveringCandidate === void 0 ? "保存结果" : "处理结果"), (0, react.createElement)("dd", null, coveringCandidate === void 0 ? describePublicationOutcome(detail.publicationOutcome) : describeProposalOutcome(detail))), (0, react.createElement)("h4", null, "对话证据定位信息"), (0, react.createElement)("ul", null, ...detail.evidenceRefs.map((evidence) => (0, react.createElement)("li", { key: `${String(evidence.messageSeq)}:${evidence.excerptDigest}` }, `记录 ${String(evidence.messageSeq)} · 内容指纹 ${evidence.excerptDigest}`))), (0, react.createElement)(ProposalTextView, {
|
|
5925
6009
|
value: factsFromAction(detail),
|
|
5926
6010
|
mode: "SAFE",
|
|
5927
|
-
label: "
|
|
5928
|
-
}), (0, react.createElement)("div", {
|
|
6011
|
+
label: coveringCandidate === void 0 ? "保存目标技术信息" : "已有技能匹配技术信息"
|
|
6012
|
+
})), (0, react.createElement)("div", {
|
|
5929
6013
|
role: "group",
|
|
5930
6014
|
"aria-label": "内容显示方式",
|
|
5931
6015
|
className: _run2skill_css_run2skill_settings_page_module_css_default.modeGroup
|
|
@@ -5935,24 +6019,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5935
6019
|
onClick: () => {
|
|
5936
6020
|
props.setTextMode("SAFE");
|
|
5937
6021
|
}
|
|
5938
|
-
}, "
|
|
6022
|
+
}, "标出隐藏字符"), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, {
|
|
5939
6023
|
"aria-pressed": props.textMode === "RAW",
|
|
5940
6024
|
active: props.textMode === "RAW",
|
|
5941
6025
|
onClick: () => {
|
|
5942
6026
|
props.setTextMode("RAW");
|
|
5943
6027
|
}
|
|
5944
|
-
}, "
|
|
6028
|
+
}, "按原文显示")), (0, react.createElement)("h4", null, coveringCandidate === void 0 ? "确认要保存的技能说明" : "用于判断的草稿内容"), (0, react.createElement)("p", { className: _run2skill_css_run2skill_settings_page_module_css_default.muted }, coveringCandidate === void 0 ? "这是 Agent 以后会遵循的完整说明。开头是技能名称和设置,标题下方是具体规则。" : "这份草稿不会保存,仅用于核对已有技能是否已经包含相同经验。"), (0, react.createElement)(ProposalTextView, {
|
|
5945
6029
|
value: proposal.exactSkillBytes,
|
|
5946
6030
|
mode: props.textMode,
|
|
5947
|
-
label: "
|
|
5948
|
-
}), baseBytes === void 0 ? null : (0, react.createElement)(react.Fragment, null, (0, react.createElement)("h4", null, "
|
|
6031
|
+
label: coveringCandidate === void 0 ? "确认要保存的技能说明" : "用于判断的草稿内容"
|
|
6032
|
+
}), baseBytes === void 0 ? null : (0, react.createElement)(react.Fragment, null, (0, react.createElement)("h4", null, "现有技能内容"), (0, react.createElement)(ProposalTextView, {
|
|
5949
6033
|
value: baseBytes,
|
|
5950
6034
|
mode: props.textMode,
|
|
5951
|
-
label: "
|
|
5952
|
-
}), (0, react.createElement)("h4", null, "
|
|
6035
|
+
label: "现有技能内容"
|
|
6036
|
+
}), (0, react.createElement)("h4", null, "将发生的内容变化"), (0, react.createElement)("p", { className: _run2skill_css_run2skill_settings_page_module_css_default.muted }, "“+”表示新增内容,“-”表示将被替换的内容。"), (0, react.createElement)("pre", { "aria-label": "将发生的内容变化" }, diff.map((line) => `${line.kind === "ADD" ? "+" : line.kind === "REMOVE" ? "-" : " "} ${makeSafeText(line.text)}`).join("\n"))), coveringBytes === void 0 ? null : (0, react.createElement)(react.Fragment, null, (0, react.createElement)("h4", null, "将继续使用的已有技能内容"), (0, react.createElement)(ProposalTextView, {
|
|
5953
6037
|
value: coveringBytes,
|
|
5954
6038
|
mode: props.textMode,
|
|
5955
|
-
label: "
|
|
6039
|
+
label: "将继续使用的已有技能内容"
|
|
5956
6040
|
})), (0, react.createElement)("div", {
|
|
5957
6041
|
role: "group",
|
|
5958
6042
|
"aria-label": "技能草稿操作",
|
|
@@ -5961,7 +6045,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5961
6045
|
variant: "primary",
|
|
5962
6046
|
disabled: mutationPending,
|
|
5963
6047
|
onClick: props.onRetry
|
|
5964
|
-
}, "重试保存") :
|
|
6048
|
+
}, "重试保存") : action === "REFRESH" ? (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6049
|
+
variant: "primary",
|
|
6050
|
+
disabled: mutationPending,
|
|
6051
|
+
onClick: props.onRefresh
|
|
6052
|
+
}, "生成新草稿") : proposal.kind === "DISCARD" ? (0, react.createElement)(react.Fragment, null, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5965
6053
|
variant: "primary",
|
|
5966
6054
|
disabled: !actionable,
|
|
5967
6055
|
onClick: props.onConfirmDiscard
|
|
@@ -6174,7 +6262,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6174
6262
|
return (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.sectionBody }, (0, react.createElement)("p", { className: _run2skill_css_run2skill_settings_page_module_css_default.muted }, "展示最近沉淀的 Skill"), visibleState.phase === "LOADING" ? (0, react.createElement)("p", { role: "status" }, "正在读取最近活动…") : null, visibleState.phase === "ERROR" ? (0, react.createElement)("p", { role: "alert" }, "最近活动暂不可用。") : null, visibleState.phase === "READY" && visibleState.items.length === 0 ? (0, react.createElement)("p", null, "最近 7 天没有成功沉淀的 Skill。") : null, visibleState.items.length === 0 ? null : (0, react.createElement)("ul", { className: _run2skill_css_run2skill_settings_page_module_css_default.activityList }, ...visibleState.items.map((item) => (0, react.createElement)("li", {
|
|
6175
6263
|
className: _run2skill_css_run2skill_settings_page_module_css_default.activityItem,
|
|
6176
6264
|
key: item.activityId
|
|
6177
|
-
}, (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.activitySummary }, (0, react.createElement)("strong", null, item.skillName), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, item.operation === "CREATED" ? "
|
|
6265
|
+
}, (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.activitySummary }, (0, react.createElement)("strong", null, item.skillName), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, item.operation === "CREATED" ? "新建技能" : "更新技能"), usefulActivityScope(visibleState.items, item) ? (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, describePersistenceScope(item.scope)) : null), (0, react.createElement)("time", {
|
|
6178
6266
|
dateTime: item.occurredAt,
|
|
6179
6267
|
className: _run2skill_css_run2skill_settings_page_module_css_default.muted
|
|
6180
6268
|
}, formatActivityTime(item.occurredAt))))));
|
|
@@ -6199,7 +6287,43 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6199
6287
|
inputTokens: number().int().nonnegative().optional(),
|
|
6200
6288
|
outputTokens: number().int().nonnegative().optional(),
|
|
6201
6289
|
outcome: string().min(1).max(256)
|
|
6202
|
-
}).strict()).max(2)
|
|
6290
|
+
}).strict()).max(2),
|
|
6291
|
+
attentionKind: _enum([
|
|
6292
|
+
"SAFETY_STOP",
|
|
6293
|
+
"PROCESSING_FAILURE",
|
|
6294
|
+
"STALE_RESULT",
|
|
6295
|
+
"NEEDS_DECISION"
|
|
6296
|
+
]).optional(),
|
|
6297
|
+
currentStage: _enum([
|
|
6298
|
+
"DETECTION",
|
|
6299
|
+
"OWNERSHIP",
|
|
6300
|
+
"RECALL",
|
|
6301
|
+
"COVERAGE",
|
|
6302
|
+
"GENERATION"
|
|
6303
|
+
]).optional(),
|
|
6304
|
+
stages: array(object({
|
|
6305
|
+
stage: _enum([
|
|
6306
|
+
"DETECTION",
|
|
6307
|
+
"OWNERSHIP",
|
|
6308
|
+
"RECALL",
|
|
6309
|
+
"COVERAGE",
|
|
6310
|
+
"GENERATION"
|
|
6311
|
+
]),
|
|
6312
|
+
state: _enum([
|
|
6313
|
+
"NOT_STARTED",
|
|
6314
|
+
"COMPLETED",
|
|
6315
|
+
"STOPPED"
|
|
6316
|
+
]),
|
|
6317
|
+
modelCalls: object({
|
|
6318
|
+
total: number().int().nonnegative(),
|
|
6319
|
+
reserved: number().int().nonnegative(),
|
|
6320
|
+
succeeded: number().int().nonnegative(),
|
|
6321
|
+
failed: number().int().nonnegative(),
|
|
6322
|
+
aborted: number().int().nonnegative(),
|
|
6323
|
+
timedOut: number().int().nonnegative(),
|
|
6324
|
+
outcomeUnknown: number().int().nonnegative()
|
|
6325
|
+
}).strict()
|
|
6326
|
+
}).strict()).max(5).optional()
|
|
6203
6327
|
}).strict();
|
|
6204
6328
|
const learningIssuePageSchema = object({
|
|
6205
6329
|
ok: literal(true),
|
|
@@ -6209,6 +6333,75 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6209
6333
|
nextCursor: string().regex(/^c_[1-9][0-9]*_[1-9][0-9]*_[a-f0-9]{64}$/).optional()
|
|
6210
6334
|
}).strict()
|
|
6211
6335
|
}).strict();
|
|
6336
|
+
const learningStageLabels = {
|
|
6337
|
+
DETECTION: "语义检测",
|
|
6338
|
+
OWNERSHIP: "重复保存检查",
|
|
6339
|
+
RECALL: "已有 Skill 检索",
|
|
6340
|
+
COVERAGE: "重复与合并判断",
|
|
6341
|
+
GENERATION: "Skill 草稿生成"
|
|
6342
|
+
};
|
|
6343
|
+
function learningIssueDescription(item) {
|
|
6344
|
+
if (item.failureCode === "BASELINE_INCOMPLETE") return {
|
|
6345
|
+
title: "自动沉淀已停止",
|
|
6346
|
+
detail: "缺少任务开始前的 Skill 状态记录,无法确认 Agent 是否已经保存过同类 Skill。为避免重复生成,本次已停止。已有 Skill 和原始会话记录不受影响。"
|
|
6347
|
+
};
|
|
6348
|
+
if (item.failureCode === "MODEL_TERMINAL_FAILURE") return {
|
|
6349
|
+
title: "自动沉淀未完成",
|
|
6350
|
+
detail: "模型没有返回可用的结果,本次自动沉淀未完成。已有 Skill 和原始会话记录不受影响。"
|
|
6351
|
+
};
|
|
6352
|
+
if (item.failureCode === "MODEL_OUTPUT_TRUNCATED") return {
|
|
6353
|
+
title: "语义判断没有完成",
|
|
6354
|
+
detail: "模型在返回简短判断前用完了本次输出额度,因此没有继续生成 Skill 草稿。已有 Skill 和原始会话记录不受影响。"
|
|
6355
|
+
};
|
|
6356
|
+
if (item.failureCode === "SESSION_CONTEXT_UNAVAILABLE") return {
|
|
6357
|
+
title: "自动沉淀已停止",
|
|
6358
|
+
detail: "任务结束后没能恢复当时的会话信息,无法确认 Agent 是否已经保存过同类 Skill。为避免重复生成,本次已停止。已有 Skill 和原始会话记录不受影响。"
|
|
6359
|
+
};
|
|
6360
|
+
if (item.failureCode === "SESSION_SNAPSHOT_UNAVAILABLE") return {
|
|
6361
|
+
title: "自动沉淀已停止",
|
|
6362
|
+
detail: "没能读取任务结束时的会话快照,无法确认 Skill 状态是否稳定。为避免重复生成,本次已停止。已有 Skill 和原始会话记录不受影响。"
|
|
6363
|
+
};
|
|
6364
|
+
if (item.failureCode === "SESSION_LOG_UNAVAILABLE") return {
|
|
6365
|
+
title: "自动沉淀已停止",
|
|
6366
|
+
detail: "没能完整读取本次任务的会话记录,无法确认 Agent 是否已经保存过同类 Skill。为避免重复生成,本次已停止。已有 Skill 和原始会话记录不受影响。"
|
|
6367
|
+
};
|
|
6368
|
+
if (item.failureCode === "SESSION_WINDOW_INCOMPLETE") return {
|
|
6369
|
+
title: "自动沉淀已停止",
|
|
6370
|
+
detail: "本次任务的会话记录不完整或超出安全检查范围,无法可靠判断是否已经生成过 Skill。为避免重复生成,本次已停止。"
|
|
6371
|
+
};
|
|
6372
|
+
if (item.failureCode === "SESSION_CHANGED_DURING_CHECK") return {
|
|
6373
|
+
title: "自动沉淀已停止",
|
|
6374
|
+
detail: "核对期间会话又发生了变化,当前结果已经失效。为避免使用过期记录或重复生成,本次已停止。"
|
|
6375
|
+
};
|
|
6376
|
+
if (item.failureCode === "OWNERSHIP_ANALYSIS_UNAVAILABLE" || item.failureCode === "OBSERVATION_FAILED") return {
|
|
6377
|
+
title: "自动沉淀已停止",
|
|
6378
|
+
detail: "系统没能完整核对本次任务结束时的 Skill 状态和 Agent 操作记录,因此无法确认是否已经保存过同类 Skill。为避免重复生成,本次已停止。已有 Skill 和原始会话记录不受影响。"
|
|
6379
|
+
};
|
|
6380
|
+
if (item.attentionKind === "STALE_RESULT") return {
|
|
6381
|
+
title: "自动沉淀结果已过期",
|
|
6382
|
+
detail: "生成依据已经发生变化,本次结果已停止使用,以免覆盖新的 Skill 状态。"
|
|
6383
|
+
};
|
|
6384
|
+
if (item.attentionKind === "NEEDS_DECISION") return {
|
|
6385
|
+
title: "自动沉淀需要确认",
|
|
6386
|
+
detail: "系统无法明确判断是否还需要生成 Skill,因此没有自动继续。"
|
|
6387
|
+
};
|
|
6388
|
+
if (item.attentionKind === "SAFETY_STOP") return {
|
|
6389
|
+
title: "自动沉淀已停止",
|
|
6390
|
+
detail: "系统无法确认继续处理是否安全,因此本次自动沉淀已停止。已有 Skill 和原始会话记录不受影响。"
|
|
6391
|
+
};
|
|
6392
|
+
return {
|
|
6393
|
+
title: "自动沉淀未完成",
|
|
6394
|
+
detail: "处理过程中出现问题,本次自动沉淀未能继续。已有 Skill 和原始会话记录不受影响。"
|
|
6395
|
+
};
|
|
6396
|
+
}
|
|
6397
|
+
function stageDescription(stage) {
|
|
6398
|
+
const label = learningStageLabels[stage.stage];
|
|
6399
|
+
if (stage.state === "NOT_STARTED") return `${label}:未开始`;
|
|
6400
|
+
if (stage.state === "STOPPED") return `${label}:未完成`;
|
|
6401
|
+
if (stage.modelCalls.total === 0) return `${label}:已完成`;
|
|
6402
|
+
const succeeded = stage.modelCalls.succeeded === 0 ? "" : `,成功 ${String(stage.modelCalls.succeeded)} 次`;
|
|
6403
|
+
return `${label}:已完成(模型调用 ${String(stage.modelCalls.total)} 次${succeeded})`;
|
|
6404
|
+
}
|
|
6212
6405
|
function attentionValue(value) {
|
|
6213
6406
|
if (value === null || typeof value !== "object" || !("ok" in value) || value.ok !== true || !("value" in value)) return;
|
|
6214
6407
|
const projection = value.value;
|
|
@@ -6300,7 +6493,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6300
6493
|
});
|
|
6301
6494
|
scopeAccessRef.current = {
|
|
6302
6495
|
currentScope: currentScope(props.workspaceId, props.scopeGeneration),
|
|
6303
|
-
actions: props.actions.flatMap((action) => action.subjectId === void 0 || action.proposalRef === void 0 || ![
|
|
6496
|
+
actions: props.actions.flatMap((action) => action.subjectId === void 0 || action.proposalRef === void 0 || ![
|
|
6497
|
+
"REVIEW_PROPOSAL",
|
|
6498
|
+
"REFRESH_PROPOSAL",
|
|
6499
|
+
"RETRY_PUBLICATION"
|
|
6500
|
+
].includes(action.kind ?? "") ? [] : [{
|
|
6304
6501
|
actionKey: action.actionKey,
|
|
6305
6502
|
subjectId: action.subjectId,
|
|
6306
6503
|
kind: action.kind,
|
|
@@ -6336,17 +6533,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6336
6533
|
const [textMode, setTextMode] = (0, react.useState)("SAFE");
|
|
6337
6534
|
const [rejectConfirm, setRejectConfirm] = (0, react.useState)(false);
|
|
6338
6535
|
const rejectTriggerRef = (0, react.useRef)(null);
|
|
6339
|
-
const
|
|
6536
|
+
const actionableItems = actionableProposalItems(props.actions, state.items);
|
|
6537
|
+
const showFilter = actionableItems.length > 1;
|
|
6538
|
+
const items = showFilter ? actionableItems.filter((item) => `${item.name} ${item.description} ${item.kind}`.toLocaleLowerCase().includes(filter.trim().toLocaleLowerCase())) : actionableItems;
|
|
6340
6539
|
const selectedActionable = items.some((item) => item.proposalRef.proposalId === state.selectedProposalId);
|
|
6341
6540
|
if (props.actions.length === 0) return (0, react.createElement)(react.Fragment);
|
|
6342
|
-
return (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.
|
|
6541
|
+
return (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.attentionGroup }, (0, react.createElement)("div", { className: showFilter ? _run2skill_css_run2skill_settings_page_module_css_default.proposalToolbar : `${_run2skill_css_run2skill_settings_page_module_css_default.proposalToolbar} ${_run2skill_css_run2skill_settings_page_module_css_default.proposalToolbarCompact}` }, showFilter ? (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
6343
6542
|
value: filter,
|
|
6344
6543
|
placeholder: "筛选技能草稿",
|
|
6345
6544
|
"aria-label": "筛选技能草稿",
|
|
6346
6545
|
onChange: (event) => {
|
|
6347
6546
|
setFilter(event.currentTarget.value);
|
|
6348
6547
|
}
|
|
6349
|
-
}), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6548
|
+
}) : null, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6350
6549
|
variant: "outline",
|
|
6351
6550
|
size: "sm",
|
|
6352
6551
|
icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline16),
|
|
@@ -6354,13 +6553,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6354
6553
|
controller.open();
|
|
6355
6554
|
}
|
|
6356
6555
|
}, "刷新")), state.listPhase === "LOADING" ? (0, react.createElement)("p", { role: "status" }, "正在加载待处理事项…") : null, state.listPhase === "ERROR" ? (0, react.createElement)("p", { role: "alert" }, "待处理事项暂不可用。") : null, (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.proposalLayout }, (0, react.createElement)("ul", { className: _run2skill_css_run2skill_settings_page_module_css_default.proposalList }, ...items.map((item) => (0, react.createElement)("li", { key: item.proposalRef.proposalId }, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6357
|
-
variant:
|
|
6556
|
+
variant: "outline",
|
|
6358
6557
|
className: _run2skill_css_run2skill_settings_page_module_css_default.proposalListButton,
|
|
6558
|
+
"aria-current": state.selectedProposalId === item.proposalRef.proposalId ? "true" : void 0,
|
|
6559
|
+
"aria-label": `${item.name},${describeProposalKind(item.kind)},${describeProposalScope(item.kind, item.persistenceScope)},${describeProposalListItem(item)}`,
|
|
6359
6560
|
disabled: state.mutationPending || state.detailPhase === "LOADING",
|
|
6360
6561
|
onClick: () => {
|
|
6361
6562
|
controller.select(item.proposalRef.proposalId);
|
|
6362
6563
|
}
|
|
6363
|
-
},
|
|
6564
|
+
}, (0, react.createElement)("span", { className: _run2skill_css_run2skill_settings_page_module_css_default.proposalName }, item.name), (0, react.createElement)("span", { className: _run2skill_css_run2skill_settings_page_module_css_default.proposalMeta }, `${describeProposalKind(item.kind)} · ${describeProposalScope(item.kind, item.persistenceScope)} · ${describeProposalListItem(item)}`))))), (0, react.createElement)("section", {
|
|
6565
|
+
className: _run2skill_css_run2skill_settings_page_module_css_default.detail,
|
|
6566
|
+
"aria-label": "技能草稿详情"
|
|
6567
|
+
}, !selectedActionable || state.detailPhase === "IDLE" ? (0, react.createElement)("p", null, "选择一项查看审核事实。") : null, selectedActionable && state.detailPhase === "LOADING" ? (0, react.createElement)("p", { role: "status" }, "正在加载详情…") : null, selectedActionable && state.detailPhase === "ERROR" ? (0, react.createElement)("p", { role: "alert" }, "详情暂不可用。") : null, !selectedActionable || state.detail === void 0 ? null : (0, react.createElement)(ProposalDetailView, {
|
|
6364
6568
|
detail: state.detail,
|
|
6365
6569
|
textMode,
|
|
6366
6570
|
setTextMode,
|
|
@@ -6375,6 +6579,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6375
6579
|
onRetry: () => {
|
|
6376
6580
|
controller.mutate("RETRY").finally(props.onMutationSettled);
|
|
6377
6581
|
},
|
|
6582
|
+
onRefresh: () => {
|
|
6583
|
+
controller.mutate("REFRESH").finally(props.onMutationSettled);
|
|
6584
|
+
},
|
|
6378
6585
|
onConfirmDiscard: () => {
|
|
6379
6586
|
controller.mutate("CONFIRM_DISCARD").finally(props.onMutationSettled);
|
|
6380
6587
|
}
|
|
@@ -6480,9 +6687,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6480
6687
|
};
|
|
6481
6688
|
if (learningActions.size === 0) return (0, react.createElement)(react.Fragment);
|
|
6482
6689
|
return (0, react.createElement)("section", {
|
|
6483
|
-
className: _run2skill_css_run2skill_settings_page_module_css_default.
|
|
6484
|
-
"aria-label": "
|
|
6485
|
-
}, (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.toolbar }, (0, react.createElement)("strong", null,
|
|
6690
|
+
className: _run2skill_css_run2skill_settings_page_module_css_default.attentionGroup,
|
|
6691
|
+
"aria-label": "自动沉淀未继续"
|
|
6692
|
+
}, (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.toolbar }, (0, react.createElement)("strong", null, `自动沉淀未继续 · ${String(learningActions.size)} 项`), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6486
6693
|
variant: "outline",
|
|
6487
6694
|
size: "sm",
|
|
6488
6695
|
icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline16),
|
|
@@ -6490,36 +6697,41 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6490
6697
|
onClick: () => {
|
|
6491
6698
|
setRefreshGeneration((value) => value + 1);
|
|
6492
6699
|
}
|
|
6493
|
-
}, "
|
|
6700
|
+
}, "刷新详情")), phase === "LOADING" ? (0, react.createElement)("p", { role: "status" }, "正在加载自动沉淀详情…") : null, phase === "ERROR" ? (0, react.createElement)("p", { role: "alert" }, "自动沉淀详情暂不可用,请保持 DSH 运行并稍后重试。") : null, ...items.map((item) => {
|
|
6494
6701
|
const action = learningActions.get(item.workItemId);
|
|
6495
6702
|
const busy = pending === item.workItemId;
|
|
6703
|
+
const isCoverageConfirmation = item.failureCode === "COVERED_NEEDS_CONFIRMATION";
|
|
6704
|
+
const description = isCoverageConfirmation ? {
|
|
6705
|
+
title: "发现可能重复的 Skill",
|
|
6706
|
+
detail: "Run2Skill 发现已有 Skill 可能已经包含这次经验,因此暂停生成新草稿。请选择下一步。"
|
|
6707
|
+
} : learningIssueDescription(item);
|
|
6496
6708
|
return (0, react.createElement)("article", {
|
|
6497
6709
|
className: _run2skill_css_run2skill_settings_page_module_css_default.detail,
|
|
6498
6710
|
key: item.workItemId
|
|
6499
|
-
}, (0, react.createElement)("
|
|
6711
|
+
}, (0, react.createElement)("strong", null, description.title), (0, react.createElement)("p", null, description.detail), item.stages === void 0 ? item.calls.length === 0 ? null : (0, react.createElement)("p", null, `已记录模型调用 ${String(item.calls.length)} 次`) : (0, react.createElement)("div", null, ...item.stages.map((stage) => (0, react.createElement)("p", { key: stage.stage }, stageDescription(stage)))), item.modelRoute === void 0 ? null : (0, react.createElement)("details", { className: _run2skill_css_run2skill_settings_page_module_css_default.technicalDetails }, (0, react.createElement)("summary", null, "本次处理的技术信息"), (0, react.createElement)("p", null, `使用的模型:${item.modelRoute.model}(${item.modelRoute.provider})`)), (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.actions }, action?.availableActions?.includes("RETRY") === true ? (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6500
6712
|
variant: "primary",
|
|
6501
6713
|
disabled: busy || pending !== void 0,
|
|
6502
6714
|
onClick: () => {
|
|
6503
6715
|
mutate("learning/issues/retry", item);
|
|
6504
6716
|
}
|
|
6505
|
-
}, busy ? "
|
|
6717
|
+
}, busy ? "正在处理…" : isCoverageConfirmation ? "继续生成新 Skill 草稿" : "重试学习") : null, action?.availableActions?.includes("DISMISS") === true ? (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6506
6718
|
variant: "outline",
|
|
6507
6719
|
disabled: busy || pending !== void 0,
|
|
6508
6720
|
onClick: (event) => {
|
|
6509
6721
|
dismissTriggerRef.current = event.currentTarget;
|
|
6510
6722
|
setDismiss(item);
|
|
6511
6723
|
}
|
|
6512
|
-
}, "
|
|
6724
|
+
}, isCoverageConfirmation ? "使用已有 Skill,不生成草稿" : "关闭此事项") : null));
|
|
6513
6725
|
}), (0, react.createElement)(ManagedConfirmationModal, {
|
|
6514
6726
|
open: dismiss !== void 0,
|
|
6515
|
-
title: "
|
|
6516
|
-
description: "
|
|
6727
|
+
title: dismiss?.failureCode === "COVERED_NEEDS_CONFIRMATION" ? "使用已有 Skill,不生成新草稿?" : "确认关闭此待处理事项?",
|
|
6728
|
+
description: dismiss?.failureCode === "COVERED_NEEDS_CONFIRMATION" ? "确认后,此项将从待处理列表移除,Run2Skill 不会为这次经验生成新草稿;已有 Skill 和 DSH 原始会话记录不会改变。" : "关闭后,本次自动沉淀不会继续,也不会生成草稿;已有 Skill 和 DSH 的原始会话记录不会改变。",
|
|
6517
6729
|
disabled: pending !== void 0,
|
|
6518
6730
|
triggerRef: dismissTriggerRef,
|
|
6519
6731
|
onClose: () => {
|
|
6520
6732
|
setDismiss(void 0);
|
|
6521
6733
|
},
|
|
6522
|
-
confirmLabel: "确认关闭",
|
|
6734
|
+
confirmLabel: dismiss?.failureCode === "COVERED_NEEDS_CONFIRMATION" ? "使用已有 Skill" : "确认关闭",
|
|
6523
6735
|
onConfirm: () => {
|
|
6524
6736
|
const selected = dismiss;
|
|
6525
6737
|
setDismiss(void 0);
|
|
@@ -6584,7 +6796,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6584
6796
|
}, (0, react.createElement)("div", { ref: contentRef }));
|
|
6585
6797
|
}
|
|
6586
6798
|
function actionableProposalItems(actions, items) {
|
|
6587
|
-
const identities = new Set(actions.flatMap((action) => action.subjectId === void 0 || action.proposalRef === void 0 || ![
|
|
6799
|
+
const identities = new Set(actions.flatMap((action) => action.subjectId === void 0 || action.proposalRef === void 0 || ![
|
|
6800
|
+
"REVIEW_PROPOSAL",
|
|
6801
|
+
"REFRESH_PROPOSAL",
|
|
6802
|
+
"RETRY_PUBLICATION"
|
|
6803
|
+
].includes(action.kind ?? "") ? [] : [`${action.subjectId}\u0000${action.proposalRef.proposalId}\u0000${String(action.proposalRef.revision)}\u0000${action.proposalRef.digest}`]));
|
|
6588
6804
|
return items.filter((item) => identities.has(`${item.workItemId}\u0000${item.proposalRef.proposalId}\u0000${String(item.proposalRef.revision)}\u0000${item.proposalRef.digest}`));
|
|
6589
6805
|
}
|
|
6590
6806
|
function hostTabVisible(element) {
|
|
@@ -6693,7 +6909,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6693
6909
|
}, [props.active, refresh]);
|
|
6694
6910
|
const value = state.value;
|
|
6695
6911
|
if (value === void 0 || value.actions.length === 0 && value.runtimeWarnings.length === 0 && value.projectCompleteness !== "UNKNOWN" && value.runtimeCompleteness !== "UNKNOWN") return (0, react.createElement)(react.Fragment);
|
|
6696
|
-
return (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.toolbar }, (0, react.createElement)(react.Fragment, null, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, `${String(value.actions.length)} 项可操作事项`), value.projectCompleteness === "UNAVAILABLE" ? (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, "未选择当前项目") : value.projectCompleteness === "UNKNOWN" ? (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, "
|
|
6912
|
+
return (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.toolbar }, (0, react.createElement)(react.Fragment, null, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, `${String(value.actions.length)} 项可操作事项`), value.projectCompleteness === "UNAVAILABLE" ? (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, "未选择当前项目") : value.projectCompleteness === "UNKNOWN" ? (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, "当前项目的待处理状态暂时无法确认") : null, value.runtimeCompleteness === "UNKNOWN" ? (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, "未保存数量未知") : null, ...value.runtimeWarnings.map((warning) => (0, react.createElement)("span", {
|
|
6697
6913
|
key: warning.noticeKey,
|
|
6698
6914
|
role: "alert"
|
|
6699
6915
|
}, warning.message ?? "存在尚未持久化的学习信号。"))));
|
|
@@ -6747,7 +6963,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6747
6963
|
callAttention: props.callAttention,
|
|
6748
6964
|
refreshGeneration: attentionRefresh,
|
|
6749
6965
|
onProjection: setAttention
|
|
6750
|
-
}), attention?.actions.some((action) => [
|
|
6966
|
+
}), attention?.actions.some((action) => [
|
|
6967
|
+
"REVIEW_PROPOSAL",
|
|
6968
|
+
"REFRESH_PROPOSAL",
|
|
6969
|
+
"RETRY_PUBLICATION"
|
|
6970
|
+
].includes(action.kind ?? "")) === true ? (0, react.createElement)(ProposalSettingsSection, {
|
|
6751
6971
|
...workspaceId === void 0 ? {} : { workspaceId },
|
|
6752
6972
|
callReview: props.callReview,
|
|
6753
6973
|
active: hostTab.visible && open.has("attention"),
|
|
@@ -7008,9 +7228,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7008
7228
|
exports.apply = apply;
|
|
7009
7229
|
exports.applyAutomaticLearningSettingsClient = applyAutomaticLearningSettingsClient;
|
|
7010
7230
|
exports.applyRun2skillClient = applyRun2skillClient;
|
|
7231
|
+
exports.describePersistenceScope = describePersistenceScope;
|
|
7011
7232
|
exports.describeProcessingState = describeProcessingState;
|
|
7233
|
+
exports.describeProposalKind = describeProposalKind;
|
|
7012
7234
|
exports.describeProposalListItem = describeProposalListItem;
|
|
7013
7235
|
exports.describeProposalOutcome = describeProposalOutcome;
|
|
7236
|
+
exports.describeProposalScope = describeProposalScope;
|
|
7014
7237
|
exports.describeProposalSummaryState = describeProposalSummaryState;
|
|
7015
7238
|
exports.describePublicationOutcome = describePublicationOutcome;
|
|
7016
7239
|
exports.describeReviewDecision = describeReviewDecision;
|