@godv61/dsh-task-engine 0.30.1 → 0.30.3
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/.adaptive-test.mjs +92 -83
- package/.evidence-test.mjs +16 -16
- package/.resource-test.mjs +19 -19
- package/.roundtrip-test.mjs +5 -5
- package/.sonar-credential-test.mjs +38 -38
- package/.sonar-rule-catalog-test.mjs +42 -0
- package/.sonarlint-local-test.mjs +26 -10
- package/.workflow-test.mjs +37 -37
- package/README.md +221 -216
- package/docs/development.md +45 -45
- package/docs/manual.html +177 -178
- package/lib/client.js +925 -433
- package/lib/client.js.map +3 -3
- package/lib/controller.d.ts +38 -0
- package/lib/controller.js +66 -1
- package/lib/controller.js.map +1 -1
- package/lib/dev-task.js +5 -4
- package/lib/dev-task.js.map +1 -1
- package/lib/sonar-report.js +11 -1
- package/lib/sonar-report.js.map +1 -1
- package/lib/sonar-rule-catalog.d.ts +28 -0
- package/lib/sonar-rule-catalog.js +82 -0
- package/lib/sonar-rule-catalog.js.map +1 -0
- package/lib/sonar.d.ts +6 -0
- package/lib/sonar.js.map +1 -1
- package/lib/sonarlint-install.d.ts +7 -0
- package/lib/sonarlint-install.js +150 -0
- package/lib/sonarlint-install.js.map +1 -0
- package/lib/sonarlint-local.d.ts +13 -1
- package/lib/sonarlint-local.js +113 -23
- package/lib/sonarlint-local.js.map +1 -1
- package/package.json +4 -3
- package/scripts/verify-package.mjs +3 -3
- package/skills/code-review/SKILL.md +4 -4
- package/skills/eng-delivery/SKILL.md +2 -2
- package/skills/task-orchestration/SKILL.md +1 -1
- package/skills/test-validation/SKILL.md +3 -3
package/lib/client.js
CHANGED
|
@@ -38,7 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(index_exports);
|
|
40
40
|
|
|
41
|
-
//
|
|
41
|
+
// node_modules/zod/v3/external.js
|
|
42
42
|
var external_exports = {};
|
|
43
43
|
__export(external_exports, {
|
|
44
44
|
BRAND: () => BRAND,
|
|
@@ -150,7 +150,7 @@ __export(external_exports, {
|
|
|
150
150
|
void: () => voidType
|
|
151
151
|
});
|
|
152
152
|
|
|
153
|
-
//
|
|
153
|
+
// node_modules/zod/v3/helpers/util.js
|
|
154
154
|
var util;
|
|
155
155
|
(function(util2) {
|
|
156
156
|
util2.assertEqual = (_) => {
|
|
@@ -284,7 +284,7 @@ var getParsedType = (data) => {
|
|
|
284
284
|
}
|
|
285
285
|
};
|
|
286
286
|
|
|
287
|
-
//
|
|
287
|
+
// node_modules/zod/v3/ZodError.js
|
|
288
288
|
var ZodIssueCode = util.arrayToEnum([
|
|
289
289
|
"invalid_type",
|
|
290
290
|
"invalid_literal",
|
|
@@ -402,7 +402,7 @@ ZodError.create = (issues) => {
|
|
|
402
402
|
return error;
|
|
403
403
|
};
|
|
404
404
|
|
|
405
|
-
//
|
|
405
|
+
// node_modules/zod/v3/locales/en.js
|
|
406
406
|
var errorMap = (issue, _ctx) => {
|
|
407
407
|
let message;
|
|
408
408
|
switch (issue.code) {
|
|
@@ -505,7 +505,7 @@ var errorMap = (issue, _ctx) => {
|
|
|
505
505
|
};
|
|
506
506
|
var en_default = errorMap;
|
|
507
507
|
|
|
508
|
-
//
|
|
508
|
+
// node_modules/zod/v3/errors.js
|
|
509
509
|
var overrideErrorMap = en_default;
|
|
510
510
|
function setErrorMap(map) {
|
|
511
511
|
overrideErrorMap = map;
|
|
@@ -514,7 +514,7 @@ function getErrorMap() {
|
|
|
514
514
|
return overrideErrorMap;
|
|
515
515
|
}
|
|
516
516
|
|
|
517
|
-
//
|
|
517
|
+
// node_modules/zod/v3/helpers/parseUtil.js
|
|
518
518
|
var makeIssue = (params) => {
|
|
519
519
|
const { data, path, errorMaps, issueData } = params;
|
|
520
520
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -624,14 +624,14 @@ var isDirty = (x) => x.status === "dirty";
|
|
|
624
624
|
var isValid = (x) => x.status === "valid";
|
|
625
625
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
626
626
|
|
|
627
|
-
//
|
|
627
|
+
// node_modules/zod/v3/helpers/errorUtil.js
|
|
628
628
|
var errorUtil;
|
|
629
629
|
(function(errorUtil2) {
|
|
630
630
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
631
631
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
632
632
|
})(errorUtil || (errorUtil = {}));
|
|
633
633
|
|
|
634
|
-
//
|
|
634
|
+
// node_modules/zod/v3/types.js
|
|
635
635
|
var ParseInputLazyPath = class {
|
|
636
636
|
constructor(parent, value, path, key) {
|
|
637
637
|
this._cachedPath = [];
|
|
@@ -4267,6 +4267,7 @@ var taskLedgerViewSchema = external_exports.object({
|
|
|
4267
4267
|
})).optional(),
|
|
4268
4268
|
report_path: external_exports.string().optional(),
|
|
4269
4269
|
scanned_files: external_exports.array(external_exports.string()).optional(),
|
|
4270
|
+
profile_coverage: external_exports.array(external_exports.object({ language: external_exports.string(), active_rules: external_exports.number(), analyzer: external_exports.string() })).optional(),
|
|
4270
4271
|
findings: external_exports.array(external_exports.object({
|
|
4271
4272
|
key: external_exports.string(),
|
|
4272
4273
|
rule: external_exports.string(),
|
|
@@ -4374,6 +4375,26 @@ var adaptiveViewSchema = external_exports.object({
|
|
|
4374
4375
|
var adaptiveWriteRequestSchema = external_exports.object({ path: external_exports.string(), config: adaptiveConfigSchema, expected_hash: external_exports.string() });
|
|
4375
4376
|
var sonarTokenInfoSchema = external_exports.object({ configured: external_exports.boolean(), source: external_exports.string().optional(), writable: external_exports.boolean() });
|
|
4376
4377
|
var sonarTokenWriteSchema = external_exports.object({ path: external_exports.string(), token: external_exports.string().min(1) });
|
|
4378
|
+
var sonarAnalyzerStatusSchema = external_exports.object({ profiles: external_exports.array(external_exports.object({
|
|
4379
|
+
language: external_exports.string(),
|
|
4380
|
+
active_rules: external_exports.number(),
|
|
4381
|
+
analyzer: external_exports.string()
|
|
4382
|
+
})), analyzed_languages: external_exports.array(external_exports.string()), other_profile_count: external_exports.number(), updated_at: external_exports.string().optional() });
|
|
4383
|
+
var sonarRuleUpdateInfoSchema = external_exports.object({ updated_at: external_exports.string().optional() });
|
|
4384
|
+
var sonarRuleRequestSchema = external_exports.object({ path: external_exports.string(), language: external_exports.string().optional() });
|
|
4385
|
+
var sonarRuleViewSchema = external_exports.object({
|
|
4386
|
+
profiles: external_exports.array(external_exports.object({
|
|
4387
|
+
key: external_exports.string(),
|
|
4388
|
+
name: external_exports.string(),
|
|
4389
|
+
language: external_exports.string(),
|
|
4390
|
+
active_rules: external_exports.number(),
|
|
4391
|
+
analyzed: external_exports.boolean()
|
|
4392
|
+
})),
|
|
4393
|
+
analyzed_languages: external_exports.array(external_exports.string()),
|
|
4394
|
+
selected_language: external_exports.string(),
|
|
4395
|
+
rule_total: external_exports.number(),
|
|
4396
|
+
rules: external_exports.array(external_exports.object({ key: external_exports.string(), name: external_exports.string(), language: external_exports.string(), severity: external_exports.string() }))
|
|
4397
|
+
});
|
|
4377
4398
|
var projectSkillProfileRequestSchema = external_exports.object({ path: external_exports.string(), name: external_exports.string() });
|
|
4378
4399
|
var projectSkillProfileWriteRequestSchema = projectSkillProfileRequestSchema.extend({
|
|
4379
4400
|
profile: skillProfileSchema,
|
|
@@ -4454,6 +4475,82 @@ var TYPERT_REMOTE = {
|
|
|
4454
4475
|
}],
|
|
4455
4476
|
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#SonarTokenInfo`, create: () => sonarTokenInfoSchema, schema: sonarTokenInfoSchema }
|
|
4456
4477
|
},
|
|
4478
|
+
{
|
|
4479
|
+
id: `${PACKAGE}#task-engine/describeSonarRuleUpdate`,
|
|
4480
|
+
service: "taskEngineController",
|
|
4481
|
+
namespace: "task-engine",
|
|
4482
|
+
method: "describeSonarRuleUpdate",
|
|
4483
|
+
invocation: { kind: "direct" },
|
|
4484
|
+
parameters: [{
|
|
4485
|
+
name: "path",
|
|
4486
|
+
wire: "path",
|
|
4487
|
+
source: "json",
|
|
4488
|
+
codec: { mode: "strict", typeSymbol: "string", create: () => external_exports.string(), schema: external_exports.string() }
|
|
4489
|
+
}],
|
|
4490
|
+
result: {
|
|
4491
|
+
mode: "strict",
|
|
4492
|
+
typeSymbol: `${PACKAGE}/types#SonarRuleUpdateInfo`,
|
|
4493
|
+
create: () => sonarRuleUpdateInfoSchema,
|
|
4494
|
+
schema: sonarRuleUpdateInfoSchema
|
|
4495
|
+
}
|
|
4496
|
+
},
|
|
4497
|
+
{
|
|
4498
|
+
id: `${PACKAGE}#task-engine/prepareSonarAnalyzer`,
|
|
4499
|
+
service: "taskEngineController",
|
|
4500
|
+
namespace: "task-engine",
|
|
4501
|
+
method: "prepareSonarAnalyzer",
|
|
4502
|
+
invocation: { kind: "direct" },
|
|
4503
|
+
parameters: [{
|
|
4504
|
+
name: "path",
|
|
4505
|
+
wire: "path",
|
|
4506
|
+
source: "json",
|
|
4507
|
+
codec: { mode: "strict", typeSymbol: "string", create: () => external_exports.string(), schema: external_exports.string() }
|
|
4508
|
+
}],
|
|
4509
|
+
result: {
|
|
4510
|
+
mode: "strict",
|
|
4511
|
+
typeSymbol: `${PACKAGE}/types#SonarAnalyzerStatus`,
|
|
4512
|
+
create: () => sonarAnalyzerStatusSchema,
|
|
4513
|
+
schema: sonarAnalyzerStatusSchema
|
|
4514
|
+
}
|
|
4515
|
+
},
|
|
4516
|
+
{
|
|
4517
|
+
id: `${PACKAGE}#task-engine/updateSonarRules`,
|
|
4518
|
+
service: "taskEngineController",
|
|
4519
|
+
namespace: "task-engine",
|
|
4520
|
+
method: "updateSonarRules",
|
|
4521
|
+
invocation: { kind: "direct" },
|
|
4522
|
+
parameters: [{
|
|
4523
|
+
name: "path",
|
|
4524
|
+
wire: "path",
|
|
4525
|
+
source: "json",
|
|
4526
|
+
codec: { mode: "strict", typeSymbol: "string", create: () => external_exports.string(), schema: external_exports.string() }
|
|
4527
|
+
}],
|
|
4528
|
+
result: {
|
|
4529
|
+
mode: "strict",
|
|
4530
|
+
typeSymbol: `${PACKAGE}/types#SonarAnalyzerStatus`,
|
|
4531
|
+
create: () => sonarAnalyzerStatusSchema,
|
|
4532
|
+
schema: sonarAnalyzerStatusSchema
|
|
4533
|
+
}
|
|
4534
|
+
},
|
|
4535
|
+
{
|
|
4536
|
+
id: `${PACKAGE}#task-engine/readSonarProjectRules`,
|
|
4537
|
+
service: "taskEngineController",
|
|
4538
|
+
namespace: "task-engine",
|
|
4539
|
+
method: "readSonarProjectRules",
|
|
4540
|
+
invocation: { kind: "direct" },
|
|
4541
|
+
parameters: [{
|
|
4542
|
+
name: "request",
|
|
4543
|
+
wire: "request",
|
|
4544
|
+
source: "json",
|
|
4545
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#SonarRuleRequest`, create: () => sonarRuleRequestSchema, schema: sonarRuleRequestSchema }
|
|
4546
|
+
}],
|
|
4547
|
+
result: {
|
|
4548
|
+
mode: "strict",
|
|
4549
|
+
typeSymbol: `${PACKAGE}/types#SonarRuleView`,
|
|
4550
|
+
create: () => sonarRuleViewSchema,
|
|
4551
|
+
schema: sonarRuleViewSchema
|
|
4552
|
+
}
|
|
4553
|
+
},
|
|
4457
4554
|
{
|
|
4458
4555
|
id: `${PACKAGE}#task-engine/readProjectSkillProfile`,
|
|
4459
4556
|
service: "taskEngineController",
|
|
@@ -4817,8 +4914,8 @@ var TYPERT_REMOTE = {
|
|
|
4817
4914
|
var remote_default = TYPERT_REMOTE;
|
|
4818
4915
|
|
|
4819
4916
|
// src/client/Workbench.tsx
|
|
4820
|
-
var
|
|
4821
|
-
var
|
|
4917
|
+
var import_react10 = require("react");
|
|
4918
|
+
var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4822
4919
|
|
|
4823
4920
|
// src/client/icons.ts
|
|
4824
4921
|
var primitives = __toESM(require("@deepseek-ai/dsh-client-ui-primitives"), 1);
|
|
@@ -4834,7 +4931,6 @@ var workbenchTheme = `
|
|
|
4834
4931
|
.te-workbench h2 { margin:0 0 6px; font-size:24px; letter-spacing:-.5px; }
|
|
4835
4932
|
.te-workbench h3,.te-modal h3 { margin:0; font-size:16px; overflow-wrap:anywhere; }
|
|
4836
4933
|
.te-config-layout { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; align-items:start; width:100%; }
|
|
4837
|
-
.te-config-layout.is-open { grid-template-columns:minmax(0,1fr) minmax(320px,420px); }
|
|
4838
4934
|
.te-config-main { min-width:0; }
|
|
4839
4935
|
.te-inline-panel { position:sticky !important; top:12px; min-width:0; }
|
|
4840
4936
|
.te-flow-notice { margin:0; padding:10px 12px; border:1px solid var(--dsw-alias-state-warn-primary); border-radius:8px; font-size:13px; }
|
|
@@ -4890,10 +4986,28 @@ var workbenchTheme = `
|
|
|
4890
4986
|
.te-skill-evidence { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:13px; font-weight:600; }
|
|
4891
4987
|
.te-skill-evidence .te-input { min-width:210px; }
|
|
4892
4988
|
.te-skill-rule-list { display:flex; flex:1; flex-direction:column; gap:4px; min-height:0; overflow:auto; padding:4px; }
|
|
4989
|
+
.te-rule-filters { display:flex; gap:6px; flex-wrap:wrap; }
|
|
4990
|
+
.te-rule-filter { border:1px solid var(--dsw-alias-border-l2); border-radius:999px; padding:5px 10px; background:var(--dsw-alias-bg-layer-1); color:var(--dsw-alias-label-secondary); cursor:pointer; font-size:12px; }
|
|
4991
|
+
.te-rule-filter[aria-pressed="true"] { border-color:var(--dsw-alias-state-business-primary); color:var(--dsw-alias-state-business-primary); }
|
|
4893
4992
|
.te-skill-rule-row { display:flex; align-items:center; gap:10px; padding:9px 10px; border:1px solid var(--dsw-alias-border-l2); border-radius:8px; cursor:pointer; }
|
|
4993
|
+
.te-skill-rule-row:has(input:checked) { border-color:var(--dsw-alias-state-business-primary); background:var(--dsw-alias-bg-layer-1); }
|
|
4894
4994
|
.te-skill-rule-row:hover { background:var(--dsw-alias-bg-layer-1); }
|
|
4895
4995
|
.te-skill-rule-row span { flex:1; min-width:0; overflow-wrap:anywhere; }
|
|
4896
4996
|
.te-skill-rule-row small { color:var(--dsw-alias-label-secondary); }
|
|
4997
|
+
.te-meta-layout { display:grid; grid-template-columns:minmax(170px,220px) minmax(0,1fr); gap:14px; align-items:start; }
|
|
4998
|
+
.te-meta-nav { display:flex; flex-direction:column; gap:6px; min-width:0; }
|
|
4999
|
+
.te-meta-nav button { width:100%; border:1px solid var(--dsw-alias-border-l2); border-radius:9px; background:var(--dsw-alias-bg-layer-1); color:var(--dsw-alias-label-primary); text-align:left; padding:10px 12px; cursor:pointer; }
|
|
5000
|
+
.te-meta-nav button[aria-current="true"] { border-color:var(--dsw-alias-state-business-primary); color:var(--dsw-alias-state-business-primary); }
|
|
5001
|
+
.te-meta-nav small { display:block; color:var(--dsw-alias-label-secondary); margin-top:3px; }
|
|
5002
|
+
.te-meta-detail { min-width:0; border:1px solid var(--dsw-alias-border-l2); border-radius:12px; padding:16px; display:flex; flex-direction:column; gap:14px; }
|
|
5003
|
+
.te-meta-skill-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid var(--dsw-alias-border-l2); border-radius:9px; }
|
|
5004
|
+
.te-meta-skill-row>span { min-width:0; overflow-wrap:anywhere; }
|
|
5005
|
+
.te-meta-skill-actions { display:flex; align-items:center; gap:6px; flex:none; }
|
|
5006
|
+
.te-meta-candidates { display:flex; flex-direction:column; gap:4px; max-height:230px; overflow:auto; }
|
|
5007
|
+
.te-meta-candidate { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px; border:1px solid var(--dsw-alias-border-l2); border-radius:8px; }
|
|
5008
|
+
.te-meta-candidate span { min-width:0; overflow-wrap:anywhere; }
|
|
5009
|
+
.te-meta-candidate small { display:block; color:var(--dsw-alias-label-secondary); font-size:11px; }
|
|
5010
|
+
.te-adaptive-savebar { position:sticky; bottom:0; z-index:3; display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:12px 16px; border:1px solid var(--dsw-alias-border-l2); border-radius:10px; background:var(--dsw-alias-bg-layer-2); box-shadow:var(--dsw-elevation-prominent); }
|
|
4897
5011
|
.te-workbench p,.te-modal p { color:var(--dsw-alias-label-secondary); line-height:1.65; }
|
|
4898
5012
|
.te-content { max-width:1600px; margin:auto; width:100%; }
|
|
4899
5013
|
.te-resource { display:flex; flex-direction:column; gap:20px; }
|
|
@@ -4934,8 +5048,8 @@ var workbenchTheme = `
|
|
|
4934
5048
|
.te-form { display:flex; flex-direction:column; gap:16px; }
|
|
4935
5049
|
.te-form label { display:flex; flex-direction:column; gap:8px; font-size:13px; }
|
|
4936
5050
|
.te-editor { min-height:260px; resize:vertical; line-height:1.6; font-family:monospace; }
|
|
4937
|
-
@media(max-width:760px) { .te-transfer {grid-template-columns:1fr;} .te-transfer-arrow {transform:rotate(90deg); height:20px;} .te-transfer-list {max-height:210px;} }
|
|
4938
|
-
@media(max-width:1000px) { .te-
|
|
5051
|
+
@media(max-width:760px) { .te-transfer {grid-template-columns:1fr;} .te-transfer-arrow {transform:rotate(90deg); height:20px;} .te-transfer-list {max-height:210px;} .te-meta-layout {grid-template-columns:1fr;} .te-meta-nav {display:grid; grid-template-columns:repeat(2,minmax(0,1fr));} }
|
|
5052
|
+
@media(max-width:1000px) { .te-inline-panel { position:static !important; height:min(600px,calc(100vh - 32px)) !important; } }
|
|
4939
5053
|
@media(max-width:640px) { .te-targets {grid-template-columns:1fr;} .te-resource {gap:14px;} .te-section-heading h2 {font-size:21px;} .te-modal:not(.te-drawer) {padding:10px !important;} .te-drawer [role=dialog] {border-radius:0 !important;} .te-skill-evidence {align-items:stretch; flex-direction:column;} .te-skill-evidence .te-input {min-width:0;} }
|
|
4940
5054
|
`;
|
|
4941
5055
|
|
|
@@ -5068,8 +5182,8 @@ var styles = {
|
|
|
5068
5182
|
};
|
|
5069
5183
|
|
|
5070
5184
|
// src/client/AdaptivePanel.tsx
|
|
5071
|
-
var
|
|
5072
|
-
var
|
|
5185
|
+
var import_react4 = require("react");
|
|
5186
|
+
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5073
5187
|
|
|
5074
5188
|
// src/adaptive.ts
|
|
5075
5189
|
var META_STAGES = {
|
|
@@ -5276,6 +5390,7 @@ function SkillRuleDialog({ skill, profile, rules, description, saveLabel, onSave
|
|
|
5276
5390
|
const [draftRules, setDraftRules] = (0, import_react2.useState)(profile?.rules ?? []);
|
|
5277
5391
|
const [evidence, setEvidence] = (0, import_react2.useState)(profile?.evidence ?? "");
|
|
5278
5392
|
const [query, setQuery] = (0, import_react2.useState)("");
|
|
5393
|
+
const [filter, setFilter] = (0, import_react2.useState)("all");
|
|
5279
5394
|
const [dirty, setDirty] = (0, import_react2.useState)(false);
|
|
5280
5395
|
const [busy, setBusy] = (0, import_react2.useState)(false);
|
|
5281
5396
|
const [error, setError] = (0, import_react2.useState)("");
|
|
@@ -5302,17 +5417,20 @@ function SkillRuleDialog({ skill, profile, rules, description, saveLabel, onSave
|
|
|
5302
5417
|
setBusy(false);
|
|
5303
5418
|
}
|
|
5304
5419
|
};
|
|
5420
|
+
const selectedKeys = new Set(draftRules.map(formatResourceRef));
|
|
5305
5421
|
const filtered = rules.filter((rule) => {
|
|
5306
5422
|
const key = formatResourceRef(rule.ref);
|
|
5307
|
-
const chosen =
|
|
5308
|
-
|
|
5309
|
-
|
|
5423
|
+
const chosen = selectedKeys.has(key);
|
|
5424
|
+
const matches = `${rule.name} ${rule.sourceLabel} ${rule.source}`.toLowerCase().includes(query.trim().toLowerCase());
|
|
5425
|
+
return matches && (filter === "all" || filter === "selected" && chosen || filter === "project" && (rule.ref.source === "project" || rule.ref.source === "codex-project") || filter === "user" && rule.ref.source === "user" || filter === "bundled" && rule.ref.source === "bundled");
|
|
5426
|
+
}).sort((a, b) => Number(selectedKeys.has(formatResourceRef(b.ref))) - Number(selectedKeys.has(formatResourceRef(a.ref))) || a.name.localeCompare(b.name));
|
|
5310
5427
|
const catalogKeys = new Set(rules.map((rule) => formatResourceRef(rule.ref)));
|
|
5311
5428
|
const missingRules = draftRules.filter((rule) => !catalogKeys.has(formatResourceRef(rule)));
|
|
5429
|
+
const visibleMissing = missingRules.filter((rule) => (filter === "all" || filter === "selected") && rule.name.toLowerCase().includes(query.trim().toLowerCase()));
|
|
5312
5430
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
5313
5431
|
ResourceModal,
|
|
5314
5432
|
{
|
|
5315
|
-
placement: "
|
|
5433
|
+
placement: "right",
|
|
5316
5434
|
title: `\u914D\u7F6E\u89C4\u5219 \xB7 ${skill.name}`,
|
|
5317
5435
|
description: description ?? "\u89C4\u5219\u5C5E\u4E8E\u6280\u80FD\uFF1B\u6B64\u5904\u7684\u914D\u7F6E\u4F1A\u7528\u4E8E\u6240\u6709\u7ED1\u5B9A\u8BE5\u6280\u80FD\u7684\u8282\u70B9\u3002",
|
|
5318
5436
|
onClose: close,
|
|
@@ -5346,10 +5464,21 @@ function SkillRuleDialog({ skill, profile, rules, description, saveLabel, onSave
|
|
|
5346
5464
|
] })
|
|
5347
5465
|
] }),
|
|
5348
5466
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { className: "te-input", type: "search", "aria-label": "\u641C\u7D22\u89C4\u5219", placeholder: "\u641C\u7D22\u89C4\u5219\u540D\u79F0\u6216\u6765\u6E90", value: query, onChange: (event) => setQuery(event.target.value) }),
|
|
5467
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "te-rule-filters", role: "group", "aria-label": "\u7B5B\u9009\u89C4\u5219", children: [["all", "\u5168\u90E8"], ["selected", `\u5DF2\u9009 ${draftRules.length}`], ["project", "\u9879\u76EE"], ["user", "\u7528\u6237"], ["bundled", "\u5185\u7F6E"]].map(([value, label3]) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
5468
|
+
"button",
|
|
5469
|
+
{
|
|
5470
|
+
type: "button",
|
|
5471
|
+
"aria-pressed": filter === value,
|
|
5472
|
+
className: "te-rule-filter",
|
|
5473
|
+
onClick: () => setFilter(value),
|
|
5474
|
+
children: label3
|
|
5475
|
+
},
|
|
5476
|
+
value
|
|
5477
|
+
)) }),
|
|
5349
5478
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "te-skill-rule-list", role: "group", "aria-label": "\u89C4\u5219\u5217\u8868", children: [
|
|
5350
5479
|
rules.length === 0 && missingRules.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "te-binding-empty", children: "\u89C4\u5219\u5E93\u4E3A\u7A7A\uFF0C\u8BF7\u5148\u5230\u201C\u89C4\u5219\u201D\u9875\u521B\u5EFA\u6216\u5B89\u88C5\u3002" }) : null,
|
|
5351
|
-
rules.length > 0 && filtered.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "te-binding-empty", children: "\u6CA1\u6709\u5339\u914D\u7684\u89C4\u5219\u3002" }) : null,
|
|
5352
|
-
|
|
5480
|
+
rules.length > 0 && filtered.length === 0 && visibleMissing.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "te-binding-empty", children: "\u6CA1\u6709\u5339\u914D\u7684\u89C4\u5219\u3002" }) : null,
|
|
5481
|
+
visibleMissing.map((rule) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "te-skill-rule-row", children: [
|
|
5353
5482
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "checkbox", checked: true, onChange: () => toggle(rule) }),
|
|
5354
5483
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: rule.name }),
|
|
5355
5484
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("small", { children: [
|
|
@@ -5359,7 +5488,7 @@ function SkillRuleDialog({ skill, profile, rules, description, saveLabel, onSave
|
|
|
5359
5488
|
] }, formatResourceRef(rule))),
|
|
5360
5489
|
filtered.map((rule) => {
|
|
5361
5490
|
const key = formatResourceRef(rule.ref);
|
|
5362
|
-
const checked =
|
|
5491
|
+
const checked = selectedKeys.has(key);
|
|
5363
5492
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "te-skill-rule-row", children: [
|
|
5364
5493
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "checkbox", checked, onChange: () => toggle(rule.ref) }),
|
|
5365
5494
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: rule.name }),
|
|
@@ -5372,6 +5501,210 @@ function SkillRuleDialog({ skill, profile, rules, description, saveLabel, onSave
|
|
|
5372
5501
|
);
|
|
5373
5502
|
}
|
|
5374
5503
|
|
|
5504
|
+
// src/client/SonarRuleViewer.tsx
|
|
5505
|
+
var import_react3 = require("react");
|
|
5506
|
+
var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5507
|
+
var muted = { fontSize: 12, color: "var(--dsw-alias-label-secondary)" };
|
|
5508
|
+
var outline = {
|
|
5509
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
5510
|
+
borderRadius: 7,
|
|
5511
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
5512
|
+
color: "var(--dsw-alias-label-primary)"
|
|
5513
|
+
};
|
|
5514
|
+
function SonarRuleViewer({ workspace, host, remote, onClose }) {
|
|
5515
|
+
const [view, setView] = (0, import_react3.useState)(null);
|
|
5516
|
+
const [busy, setBusy] = (0, import_react3.useState)(true);
|
|
5517
|
+
const [error, setError] = (0, import_react3.useState)("");
|
|
5518
|
+
const [search, setSearch] = (0, import_react3.useState)("");
|
|
5519
|
+
const [showOther, setShowOther] = (0, import_react3.useState)(false);
|
|
5520
|
+
(0, import_react3.useEffect)(() => {
|
|
5521
|
+
let active = true;
|
|
5522
|
+
void remote.readSonarProjectRules({ path: workspace }).then((result) => {
|
|
5523
|
+
if (!active) return;
|
|
5524
|
+
setBusy(false);
|
|
5525
|
+
if (result.ok) setView(result.value);
|
|
5526
|
+
else setError(describeError(result.error));
|
|
5527
|
+
}, (failure) => {
|
|
5528
|
+
if (active) {
|
|
5529
|
+
setBusy(false);
|
|
5530
|
+
setError(describeError(failure));
|
|
5531
|
+
}
|
|
5532
|
+
});
|
|
5533
|
+
return () => {
|
|
5534
|
+
active = false;
|
|
5535
|
+
};
|
|
5536
|
+
}, [remote, workspace]);
|
|
5537
|
+
const selectLanguage = (language) => {
|
|
5538
|
+
if (busy || language === view?.selected_language) return;
|
|
5539
|
+
setBusy(true);
|
|
5540
|
+
setError("");
|
|
5541
|
+
setSearch("");
|
|
5542
|
+
void remote.readSonarProjectRules({ path: workspace, language }).then((result) => {
|
|
5543
|
+
setBusy(false);
|
|
5544
|
+
if (result.ok) setView(result.value);
|
|
5545
|
+
else setError(describeError(result.error));
|
|
5546
|
+
}, (failure) => {
|
|
5547
|
+
setBusy(false);
|
|
5548
|
+
setError(describeError(failure));
|
|
5549
|
+
});
|
|
5550
|
+
};
|
|
5551
|
+
const refreshRules = () => {
|
|
5552
|
+
if (busy) return;
|
|
5553
|
+
setBusy(true);
|
|
5554
|
+
setError("");
|
|
5555
|
+
void remote.readSonarProjectRules({ path: workspace, language: view?.selected_language || void 0 }).then((result) => {
|
|
5556
|
+
setBusy(false);
|
|
5557
|
+
if (result.ok) setView(result.value);
|
|
5558
|
+
else setError(describeError(result.error));
|
|
5559
|
+
}, (failure) => {
|
|
5560
|
+
setBusy(false);
|
|
5561
|
+
setError(describeError(failure));
|
|
5562
|
+
});
|
|
5563
|
+
};
|
|
5564
|
+
const hasAnalyzedProfiles = view?.profiles.some((profile2) => profile2.analyzed) ?? false;
|
|
5565
|
+
const profiles = view?.profiles.filter((profile2) => showOther || !hasAnalyzedProfiles || profile2.analyzed) ?? [];
|
|
5566
|
+
const query = search.trim().toLowerCase();
|
|
5567
|
+
const rules = view?.rules.filter((rule) => !query || `${rule.key} ${rule.name} ${rule.severity}`.toLowerCase().includes(query)) ?? [];
|
|
5568
|
+
const profile = view?.profiles.find((item) => item.language === view.selected_language);
|
|
5569
|
+
const profileUrl = profile ? `${host.replace(/\/$/u, "")}/profiles/show?name=${encodeURIComponent(profile.name)}&language=${encodeURIComponent(profile.language.toLowerCase())}` : "";
|
|
5570
|
+
return (0, import_react3.createElement)(
|
|
5571
|
+
"div",
|
|
5572
|
+
{ role: "presentation", style: {
|
|
5573
|
+
position: "fixed",
|
|
5574
|
+
inset: 0,
|
|
5575
|
+
zIndex: 1e3,
|
|
5576
|
+
background: "rgba(0,0,0,.35)"
|
|
5577
|
+
}, onClick: onClose },
|
|
5578
|
+
(0, import_react3.createElement)(
|
|
5579
|
+
"section",
|
|
5580
|
+
{
|
|
5581
|
+
role: "dialog",
|
|
5582
|
+
"aria-modal": true,
|
|
5583
|
+
"aria-label": "\u67E5\u770B\u5F53\u524D\u9879\u76EE SonarQube \u89C4\u5219",
|
|
5584
|
+
onClick: (event) => event.stopPropagation(),
|
|
5585
|
+
style: {
|
|
5586
|
+
position: "absolute",
|
|
5587
|
+
right: 0,
|
|
5588
|
+
top: 0,
|
|
5589
|
+
bottom: 0,
|
|
5590
|
+
width: "min(760px, 96vw)",
|
|
5591
|
+
padding: 20,
|
|
5592
|
+
boxSizing: "border-box",
|
|
5593
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
5594
|
+
color: "var(--dsw-alias-label-primary)",
|
|
5595
|
+
display: "flex",
|
|
5596
|
+
flexDirection: "column",
|
|
5597
|
+
gap: 12,
|
|
5598
|
+
boxShadow: "-8px 0 30px rgba(0,0,0,.14)"
|
|
5599
|
+
}
|
|
5600
|
+
},
|
|
5601
|
+
(0, import_react3.createElement)(
|
|
5602
|
+
"div",
|
|
5603
|
+
{ style: { display: "flex", justifyContent: "space-between", alignItems: "center" } },
|
|
5604
|
+
(0, import_react3.createElement)("strong", null, "\u5F53\u524D\u9879\u76EE\u7684 SonarQube \u89C4\u5219"),
|
|
5605
|
+
(0, import_react3.createElement)(
|
|
5606
|
+
"div",
|
|
5607
|
+
{ style: { display: "flex", gap: 8 } },
|
|
5608
|
+
(0, import_react3.createElement)(
|
|
5609
|
+
import_dsh_client_ui_primitives2.Button,
|
|
5610
|
+
{ variant: "outline", size: "sm", disabled: busy, onClick: refreshRules },
|
|
5611
|
+
busy ? "\u8BFB\u53D6\u4E2D\u2026" : "\u5237\u65B0\u670D\u52A1\u5668\u6E05\u5355"
|
|
5612
|
+
),
|
|
5613
|
+
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: onClose }, "\u5173\u95ED")
|
|
5614
|
+
)
|
|
5615
|
+
),
|
|
5616
|
+
(0, import_react3.createElement)(
|
|
5617
|
+
"p",
|
|
5618
|
+
{ style: { ...muted, margin: 0 } },
|
|
5619
|
+
"\u8FD9\u91CC\u5B9E\u65F6\u8BFB\u53D6\u5F53\u524D\u9879\u76EE Quality Profile \u4E2D\u542F\u7528\u7684\u89C4\u5219\uFF1B\u5237\u65B0\u6E05\u5355\u53EA\u66F4\u65B0\u9875\u9762\u663E\u793A\u3002\u672C\u5730\u5206\u6790\u5668\u4F7F\u7528\u65B0\u89C4\u5219\u8BF7\u8FD4\u56DE\u914D\u7F6E\u9875\u70B9\u51FB\u201C\u66F4\u65B0\u5F53\u524D\u9879\u76EE\u89C4\u5219\u201D\u3002Quality Gate \u662F\u626B\u63CF\u7ED3\u679C\u7684\u901A\u8FC7\u6761\u4EF6\u3002"
|
|
5620
|
+
),
|
|
5621
|
+
error ? (0, import_react3.createElement)("div", { role: "alert", style: { color: "var(--dsw-alias-danger, #b42318)" } }, error) : null,
|
|
5622
|
+
busy && !view ? (0, import_react3.createElement)("div", { style: muted }, "\u6B63\u5728\u8BFB\u53D6\u5F53\u524D\u9879\u76EE\u7684\u8D28\u91CF\u914D\u7F6E\u548C\u89C4\u5219\u2026") : null,
|
|
5623
|
+
view ? (0, import_react3.createElement)(
|
|
5624
|
+
"div",
|
|
5625
|
+
{ style: { display: "flex", flexDirection: "column", gap: 12, minHeight: 0, flex: 1 } },
|
|
5626
|
+
(0, import_react3.createElement)("div", { style: muted }, hasAnalyzedProfiles ? `\u6700\u8FD1\u4E00\u6B21\u670D\u52A1\u7AEF\u5206\u6790\u6D89\u53CA\uFF1A${view.analyzed_languages.join("\u3001")}\u3002\u9ED8\u8BA4\u53EA\u663E\u793A\u8FD9\u4E9B\u8BED\u8A00\u3002` : "\u670D\u52A1\u5668\u5C1A\u672A\u8FD4\u56DE\u53EF\u5339\u914D\u7684\u5DF2\u5206\u6790\u8BED\u8A00\uFF0C\u663E\u793A\u6240\u6709\u751F\u6548\u7684\u8BED\u8A00\u914D\u7F6E\u3002"),
|
|
5627
|
+
hasAnalyzedProfiles && view.profiles.some((item) => !item.analyzed) ? (0, import_react3.createElement)(
|
|
5628
|
+
"label",
|
|
5629
|
+
{ style: muted },
|
|
5630
|
+
(0, import_react3.createElement)("input", {
|
|
5631
|
+
type: "checkbox",
|
|
5632
|
+
checked: showOther,
|
|
5633
|
+
onChange: (event) => setShowOther(event.target.checked)
|
|
5634
|
+
}),
|
|
5635
|
+
` \u663E\u793A\u5176\u5B83\u8BED\u8A00\u914D\u7F6E\uFF08${view.profiles.filter((item) => !item.analyzed).length}\uFF09`
|
|
5636
|
+
) : null,
|
|
5637
|
+
(0, import_react3.createElement)(
|
|
5638
|
+
"div",
|
|
5639
|
+
{ style: { display: "flex", flexWrap: "wrap", gap: 6, maxHeight: 110, overflowY: "auto" } },
|
|
5640
|
+
...profiles.map((item) => (0, import_react3.createElement)(
|
|
5641
|
+
"button",
|
|
5642
|
+
{
|
|
5643
|
+
key: item.key,
|
|
5644
|
+
type: "button",
|
|
5645
|
+
disabled: busy,
|
|
5646
|
+
onClick: () => selectLanguage(item.language),
|
|
5647
|
+
style: {
|
|
5648
|
+
...outline,
|
|
5649
|
+
cursor: "pointer",
|
|
5650
|
+
padding: "5px 9px",
|
|
5651
|
+
fontWeight: item.language === view.selected_language ? 700 : 400,
|
|
5652
|
+
borderColor: item.language === view.selected_language ? "var(--dsw-alias-label-primary)" : void 0
|
|
5653
|
+
}
|
|
5654
|
+
},
|
|
5655
|
+
`${item.language} \xB7 ${item.active_rules}`
|
|
5656
|
+
))
|
|
5657
|
+
),
|
|
5658
|
+
profile ? (0, import_react3.createElement)(
|
|
5659
|
+
"div",
|
|
5660
|
+
{ style: {
|
|
5661
|
+
...outline,
|
|
5662
|
+
padding: 10,
|
|
5663
|
+
display: "flex",
|
|
5664
|
+
flexWrap: "wrap",
|
|
5665
|
+
gap: 8,
|
|
5666
|
+
justifyContent: "space-between",
|
|
5667
|
+
alignItems: "center"
|
|
5668
|
+
} },
|
|
5669
|
+
(0, import_react3.createElement)("span", null, `${profile.language} / ${profile.name}\uFF1A\u670D\u52A1\u5668\u542F\u7528 ${profile.active_rules} \u6761\uFF0C\u5DF2\u8BFB\u53D6 ${view.rule_total} \u6761`),
|
|
5670
|
+
(0, import_react3.createElement)("a", { href: profileUrl, target: "_blank", rel: "noopener noreferrer" }, "\u5728 SonarQube \u67E5\u770B\u914D\u7F6E")
|
|
5671
|
+
) : null,
|
|
5672
|
+
profile && view.rule_total !== profile.active_rules ? (0, import_react3.createElement)("div", { role: "alert" }, "\u670D\u52A1\u7AEF\u914D\u7F6E\u7EDF\u8BA1\u4E0E\u89C4\u5219\u5217\u8868\u6570\u91CF\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u5237\u65B0\u540E\u6838\u5BF9\u3002") : null,
|
|
5673
|
+
(0, import_react3.createElement)("input", {
|
|
5674
|
+
type: "search",
|
|
5675
|
+
"aria-label": "\u641C\u7D22 SonarQube \u89C4\u5219\u7F16\u53F7\u6216\u540D\u79F0",
|
|
5676
|
+
placeholder: "\u641C\u7D22\u89C4\u5219\u7F16\u53F7\u3001\u540D\u79F0\u6216\u4E25\u91CD\u6027",
|
|
5677
|
+
value: search,
|
|
5678
|
+
onChange: (event) => setSearch(event.target.value),
|
|
5679
|
+
style: { ...outline, padding: "8px 10px", width: "100%", boxSizing: "border-box" }
|
|
5680
|
+
}),
|
|
5681
|
+
(0, import_react3.createElement)("div", { style: muted }, busy ? "\u6B63\u5728\u5207\u6362\u8BED\u8A00\u2026" : `\u663E\u793A ${rules.length} / ${view.rule_total} \u6761\u89C4\u5219`),
|
|
5682
|
+
(0, import_react3.createElement)(
|
|
5683
|
+
"div",
|
|
5684
|
+
{ style: { flex: 1, minHeight: 0, overflowY: "auto", display: "flex", flexDirection: "column", gap: 6 } },
|
|
5685
|
+
...rules.map((rule) => (0, import_react3.createElement)(
|
|
5686
|
+
"a",
|
|
5687
|
+
{
|
|
5688
|
+
key: rule.key,
|
|
5689
|
+
href: `${host.replace(/\/$/u, "")}/coding_rules?selected=${encodeURIComponent(rule.key)}`,
|
|
5690
|
+
target: "_blank",
|
|
5691
|
+
rel: "noopener noreferrer",
|
|
5692
|
+
style: { ...outline, padding: "9px 11px", textDecoration: "none" }
|
|
5693
|
+
},
|
|
5694
|
+
(0, import_react3.createElement)("strong", null, rule.name),
|
|
5695
|
+
(0, import_react3.createElement)("div", { style: muted }, `${rule.key} \xB7 ${rule.severity}`)
|
|
5696
|
+
))
|
|
5697
|
+
),
|
|
5698
|
+
(0, import_react3.createElement)(
|
|
5699
|
+
"p",
|
|
5700
|
+
{ style: { ...muted, margin: 0 } },
|
|
5701
|
+
"\u672C\u5730\u5206\u6790\u5668\u72B6\u6001\u6309\u8BED\u8A00\u5224\u65AD\uFF1B\u5373\u4F7F\u663E\u793A SYNCED\uFF0C\u4E5F\u4E0D\u4FDD\u8BC1\u8FD9\u91CC\u6BCF\u6761\u670D\u52A1\u7AEF\u89C4\u5219\u90FD\u80FD\u5728\u63D0\u4EA4\u524D\u672C\u5730\u6267\u884C\u3002"
|
|
5702
|
+
)
|
|
5703
|
+
) : null
|
|
5704
|
+
)
|
|
5705
|
+
);
|
|
5706
|
+
}
|
|
5707
|
+
|
|
5375
5708
|
// src/client/AdaptivePanel.tsx
|
|
5376
5709
|
var card = {
|
|
5377
5710
|
border: "1px solid var(--dsw-alias-border-l2)",
|
|
@@ -5394,30 +5727,45 @@ var input = {
|
|
|
5394
5727
|
};
|
|
5395
5728
|
var SOURCE_ORDER = ["project", "codex-project", "user", "bundled"];
|
|
5396
5729
|
function effectiveSource(entries, name) {
|
|
5397
|
-
return entries.filter((entry) => entry.name === name).sort((a, b) => SOURCE_ORDER.indexOf(a.source) - SOURCE_ORDER.indexOf(b.source))[0]?.
|
|
5730
|
+
return entries.filter((entry) => entry.name === name).sort((a, b) => SOURCE_ORDER.indexOf(a.source) - SOURCE_ORDER.indexOf(b.source))[0]?.sourceLabel ?? "\u7F3A\u5931";
|
|
5398
5731
|
}
|
|
5399
5732
|
function AdaptivePanel({ workspace, remote, onOpenInit }) {
|
|
5400
|
-
const [view, setView] = (0,
|
|
5401
|
-
const [draft, setDraft] = (0,
|
|
5402
|
-
const [skills, setSkills] = (0,
|
|
5403
|
-
const [rules, setRules] = (0,
|
|
5404
|
-
const [selected, setSelected] = (0,
|
|
5405
|
-
const [
|
|
5406
|
-
const [
|
|
5407
|
-
const [
|
|
5408
|
-
const [
|
|
5409
|
-
const [
|
|
5410
|
-
const [
|
|
5411
|
-
const [
|
|
5412
|
-
const
|
|
5733
|
+
const [view, setView] = (0, import_react4.useState)(null);
|
|
5734
|
+
const [draft, setDraft] = (0, import_react4.useState)({});
|
|
5735
|
+
const [skills, setSkills] = (0, import_react4.useState)([]);
|
|
5736
|
+
const [rules, setRules] = (0, import_react4.useState)([]);
|
|
5737
|
+
const [selected, setSelected] = (0, import_react4.useState)(null);
|
|
5738
|
+
const [activeMeta, setActiveMeta] = (0, import_react4.useState)("requirements-analysis");
|
|
5739
|
+
const [metaQuery, setMetaQuery] = (0, import_react4.useState)("");
|
|
5740
|
+
const [skillQuery, setSkillQuery] = (0, import_react4.useState)("");
|
|
5741
|
+
const [loading, setLoading] = (0, import_react4.useState)(true);
|
|
5742
|
+
const [saving, setSaving] = (0, import_react4.useState)(false);
|
|
5743
|
+
const [dirty, setDirty] = (0, import_react4.useState)(false);
|
|
5744
|
+
const [message, setMessage] = (0, import_react4.useState)("");
|
|
5745
|
+
const [sonarToken, setSonarToken] = (0, import_react4.useState)("");
|
|
5746
|
+
const [tokenInfo, setTokenInfo] = (0, import_react4.useState)(null);
|
|
5747
|
+
const [tokenBusy, setTokenBusy] = (0, import_react4.useState)(false);
|
|
5748
|
+
const [analyzerOperation, setAnalyzerOperation] = (0, import_react4.useState)("");
|
|
5749
|
+
const [analyzerProfiles, setAnalyzerProfiles] = (0, import_react4.useState)(null);
|
|
5750
|
+
const [analyzerOtherCount, setAnalyzerOtherCount] = (0, import_react4.useState)(0);
|
|
5751
|
+
const [analyzerUpdatedAt, setAnalyzerUpdatedAt] = (0, import_react4.useState)("");
|
|
5752
|
+
const [ruleViewerOpen, setRuleViewerOpen] = (0, import_react4.useState)(false);
|
|
5753
|
+
const refresh = (0, import_react4.useCallback)(() => {
|
|
5413
5754
|
setLoading(true);
|
|
5414
5755
|
setMessage("");
|
|
5415
5756
|
setSonarToken("");
|
|
5416
5757
|
setTokenInfo(null);
|
|
5758
|
+
setAnalyzerProfiles(null);
|
|
5759
|
+
setAnalyzerOtherCount(0);
|
|
5760
|
+
setAnalyzerUpdatedAt("");
|
|
5417
5761
|
void remote.describeSonarToken(workspace).then((result) => {
|
|
5418
5762
|
if (result.ok) setTokenInfo(result.value);
|
|
5419
5763
|
}, () => {
|
|
5420
5764
|
});
|
|
5765
|
+
void remote.describeSonarRuleUpdate(workspace).then((result) => {
|
|
5766
|
+
if (result.ok) setAnalyzerUpdatedAt(result.value.updated_at ?? "");
|
|
5767
|
+
}, () => {
|
|
5768
|
+
});
|
|
5421
5769
|
void Promise.all([remote.readAdaptive(workspace), remote.listSkills(workspace), remote.listRules(workspace)]).then(([config, catalog, ruleCatalog]) => {
|
|
5422
5770
|
setLoading(false);
|
|
5423
5771
|
if (!config.ok) {
|
|
@@ -5442,7 +5790,7 @@ function AdaptivePanel({ workspace, remote, onOpenInit }) {
|
|
|
5442
5790
|
setMessage("\u8BFB\u53D6\u5931\u8D25\uFF1A" + describeError(error));
|
|
5443
5791
|
});
|
|
5444
5792
|
}, [remote, workspace]);
|
|
5445
|
-
(0,
|
|
5793
|
+
(0, import_react4.useEffect)(() => {
|
|
5446
5794
|
refresh();
|
|
5447
5795
|
}, [refresh]);
|
|
5448
5796
|
const update = (config) => {
|
|
@@ -5460,7 +5808,15 @@ function AdaptivePanel({ workspace, remote, onOpenInit }) {
|
|
|
5460
5808
|
update({ ...draft, meta_bindings });
|
|
5461
5809
|
};
|
|
5462
5810
|
const updateSonar = (patch) => {
|
|
5463
|
-
update({ ...draft, sonar: {
|
|
5811
|
+
update({ ...draft, sonar: {
|
|
5812
|
+
...draft.sonar,
|
|
5813
|
+
...patch,
|
|
5814
|
+
source: "ide-local",
|
|
5815
|
+
mode: "branch",
|
|
5816
|
+
token_env: draft.sonar?.token_env ?? "SONAR_TOKEN",
|
|
5817
|
+
reference_branch: patch.reference_branch ?? draft.sonar?.reference_branch ?? "HEAD",
|
|
5818
|
+
scan_command: void 0
|
|
5819
|
+
} });
|
|
5464
5820
|
};
|
|
5465
5821
|
const openRules = (name) => {
|
|
5466
5822
|
setMessage("");
|
|
@@ -5535,7 +5891,14 @@ function AdaptivePanel({ workspace, remote, onOpenInit }) {
|
|
|
5535
5891
|
const save = () => {
|
|
5536
5892
|
if (!view) return;
|
|
5537
5893
|
setSaving(true);
|
|
5538
|
-
|
|
5894
|
+
const config = { ...draft, ...draft.sonar?.enabled ? { sonar: {
|
|
5895
|
+
...draft.sonar,
|
|
5896
|
+
source: "ide-local",
|
|
5897
|
+
mode: "branch",
|
|
5898
|
+
reference_branch: draft.sonar.reference_branch?.trim() || "HEAD",
|
|
5899
|
+
scan_command: void 0
|
|
5900
|
+
} } : {} };
|
|
5901
|
+
void remote.writeAdaptive({ path: workspace, config, expected_hash: view.hash }).then((result) => {
|
|
5539
5902
|
setSaving(false);
|
|
5540
5903
|
if (!result.ok) {
|
|
5541
5904
|
setMessage("\u4FDD\u5B58\u5931\u8D25\uFF1A" + describeError(result.error));
|
|
@@ -5587,86 +5950,203 @@ function AdaptivePanel({ workspace, remote, onOpenInit }) {
|
|
|
5587
5950
|
setMessage("\u79FB\u9664 SonarQube Token \u5931\u8D25\uFF1A" + describeError(error));
|
|
5588
5951
|
});
|
|
5589
5952
|
};
|
|
5953
|
+
const prepareAnalyzer = () => {
|
|
5954
|
+
if (dirty) {
|
|
5955
|
+
setMessage("\u8BF7\u5148\u4FDD\u5B58 SonarQube \u5BA1\u6838\u914D\u7F6E\uFF0C\u518D\u68C0\u67E5\u672C\u5730\u5206\u6790\u5668\u3002");
|
|
5956
|
+
return;
|
|
5957
|
+
}
|
|
5958
|
+
setAnalyzerOperation("prepare");
|
|
5959
|
+
setAnalyzerProfiles(null);
|
|
5960
|
+
setMessage("\u6B63\u5728\u5B89\u88C5\u6216\u68C0\u67E5\u672C\u5730\u5206\u6790\u5668\uFF0C\u5E76\u8FDE\u63A5\u5F53\u524D\u9879\u76EE\u7684 SonarQube\uFF1B\u9996\u6B21\u4E0B\u8F7D\u53EF\u80FD\u9700\u8981\u8F83\u957F\u65F6\u95F4\u3002");
|
|
5961
|
+
void remote.prepareSonarAnalyzer(workspace).then((result) => {
|
|
5962
|
+
setAnalyzerOperation("");
|
|
5963
|
+
if (!result.ok) {
|
|
5964
|
+
setMessage("\u672C\u5730\u5206\u6790\u5668\u68C0\u67E5\u5931\u8D25\uFF1A" + describeError(result.error));
|
|
5965
|
+
return;
|
|
5966
|
+
}
|
|
5967
|
+
setAnalyzerProfiles(result.value.profiles);
|
|
5968
|
+
setAnalyzerOtherCount(result.value.other_profile_count);
|
|
5969
|
+
setAnalyzerUpdatedAt(result.value.updated_at ?? "");
|
|
5970
|
+
setMessage("\u5DF2\u8FDE\u63A5 SonarQube\uFF1B\u4E0B\u65B9\u4F18\u5148\u663E\u793A\u672C\u9879\u76EE\u6700\u8FD1\u4E00\u6B21\u5206\u6790\u6D89\u53CA\u7684\u8BED\u8A00\u3002");
|
|
5971
|
+
}, (error) => {
|
|
5972
|
+
setAnalyzerOperation("");
|
|
5973
|
+
setMessage("\u672C\u5730\u5206\u6790\u5668\u68C0\u67E5\u5931\u8D25\uFF1A" + describeError(error));
|
|
5974
|
+
});
|
|
5975
|
+
};
|
|
5976
|
+
const updateRules = () => {
|
|
5977
|
+
if (dirty) {
|
|
5978
|
+
setMessage("\u8BF7\u5148\u4FDD\u5B58 SonarQube \u5BA1\u6838\u914D\u7F6E\uFF0C\u518D\u66F4\u65B0\u89C4\u5219\u3002");
|
|
5979
|
+
return;
|
|
5980
|
+
}
|
|
5981
|
+
setAnalyzerOperation("update");
|
|
5982
|
+
setMessage("\u6B63\u5728\u4ECE\u5F53\u524D SonarQube \u9879\u76EE\u91CD\u65B0\u540C\u6B65\u89C4\u5219\uFF1B\u5B8C\u6210\u540E\u540E\u7EED\u5BA1\u6838\u4F1A\u4F7F\u7528\u65B0\u914D\u7F6E\u3002");
|
|
5983
|
+
void remote.updateSonarRules(workspace).then((result) => {
|
|
5984
|
+
setAnalyzerOperation("");
|
|
5985
|
+
if (!result.ok) {
|
|
5986
|
+
setMessage("\u66F4\u65B0\u89C4\u5219\u5931\u8D25\uFF1A" + describeError(result.error));
|
|
5987
|
+
return;
|
|
5988
|
+
}
|
|
5989
|
+
setAnalyzerProfiles(result.value.profiles);
|
|
5990
|
+
setAnalyzerOtherCount(result.value.other_profile_count);
|
|
5991
|
+
setAnalyzerUpdatedAt(result.value.updated_at ?? "");
|
|
5992
|
+
setMessage("\u5F53\u524D\u9879\u76EE\u7684\u672C\u5730\u89C4\u5219\u5DF2\u66F4\u65B0\uFF1B\u540E\u7EED\u4EE3\u7801\u5BA1\u6838\u5C06\u4F7F\u7528\u8FD9\u6B21\u540C\u6B65\u7684\u914D\u7F6E\u3002");
|
|
5993
|
+
}, (error) => {
|
|
5994
|
+
setAnalyzerOperation("");
|
|
5995
|
+
setMessage("\u66F4\u65B0\u89C4\u5219\u5931\u8D25\uFF1A" + describeError(error));
|
|
5996
|
+
});
|
|
5997
|
+
};
|
|
5590
5998
|
const candidates = [...new Set(skills.map((skill) => skill.name))].filter((name) => name !== "eng-delivery" && !(name in META_STAGES)).sort();
|
|
5999
|
+
const stageQuery = metaQuery.trim().toLowerCase();
|
|
6000
|
+
const visibleStages = Object.entries(META_STAGES).filter(([id, stage]) => !stageQuery || `${id} ${stage} ${(draft.meta_bindings?.[id] ?? []).join(" ")}`.toLowerCase().includes(stageQuery));
|
|
6001
|
+
const visibleMeta = visibleStages.find(([id]) => id === activeMeta)?.[0] ?? visibleStages[0]?.[0];
|
|
6002
|
+
const mounted = visibleMeta ? draft.meta_bindings?.[visibleMeta] ?? [] : [];
|
|
6003
|
+
const candidateQuery = skillQuery.trim().toLowerCase();
|
|
6004
|
+
const matchingCandidates = candidates.filter((name) => !mounted.includes(name) && (!candidateQuery || name.toLowerCase().includes(candidateQuery) || skills.some((skill) => skill.name === name && `${skill.description} ${skill.sourceLabel}`.toLowerCase().includes(candidateQuery))));
|
|
5591
6005
|
const sonar = draft.sonar ?? {};
|
|
5592
|
-
return (0,
|
|
6006
|
+
return (0, import_react4.createElement)(
|
|
5593
6007
|
"div",
|
|
5594
6008
|
{ style: { ...styles.section, display: "flex", flexDirection: "column", gap: 16 } },
|
|
5595
|
-
(0,
|
|
6009
|
+
(0, import_react4.createElement)(
|
|
5596
6010
|
"div",
|
|
5597
6011
|
{ style: row },
|
|
5598
|
-
(0,
|
|
5599
|
-
(0,
|
|
6012
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", onClick: onOpenInit }, "\u521D\u59CB\u5316\u9879\u76EE Skill / Rule"),
|
|
6013
|
+
(0, import_react4.createElement)("span", { style: label }, "\u626B\u63CF\u9879\u76EE\u540E\u5148\u9884\u89C8\uFF0C\u786E\u8BA4\u540E\u5199\u5165\u3002")
|
|
5600
6014
|
),
|
|
5601
|
-
(0,
|
|
5602
|
-
"
|
|
6015
|
+
(0, import_react4.createElement)(
|
|
6016
|
+
"details",
|
|
5603
6017
|
{ style: card },
|
|
5604
|
-
(0,
|
|
5605
|
-
(0,
|
|
5606
|
-
(0,
|
|
6018
|
+
(0, import_react4.createElement)("summary", { style: { cursor: "pointer", fontWeight: 600 } }, "\u6309\u9700\u6C42\u9009\u62E9\u6D41\u7A0B \xB7 \u67E5\u770B\u56DB\u6863\u9636\u6BB5"),
|
|
6019
|
+
(0, import_react4.createElement)("span", { style: label }, "\u6BCF\u4E2A\u4EFB\u52A1\u5355\u72EC\u9009\u62E9\u590D\u6742\u5EA6\u5E76\u51BB\u7ED3\u9636\u6BB5\u548C\u6280\u80FD\uFF1B\u4E0D\u540C\u4F1A\u8BDD\u53EF\u8D70\u4E0D\u540C\u6D41\u7A0B\u3002"),
|
|
6020
|
+
(0, import_react4.createElement)("div", { style: grid }, ...(view?.grades ?? []).map((grade) => (0, import_react4.createElement)(
|
|
5607
6021
|
"div",
|
|
5608
6022
|
{ key: grade.id, style: { ...card, gap: 5 } },
|
|
5609
|
-
(0,
|
|
5610
|
-
(0,
|
|
5611
|
-
(0,
|
|
6023
|
+
(0, import_react4.createElement)("strong", null, `${grade.label} \xB7 ${grade.id}`),
|
|
6024
|
+
(0, import_react4.createElement)("span", { style: label }, grade.guidance),
|
|
6025
|
+
(0, import_react4.createElement)("span", { style: { fontSize: 12 } }, grade.stages.join(" \u2192 "))
|
|
5612
6026
|
)))
|
|
5613
6027
|
),
|
|
5614
|
-
(0,
|
|
6028
|
+
(0, import_react4.createElement)(
|
|
5615
6029
|
"div",
|
|
5616
6030
|
{ style: card },
|
|
5617
|
-
(0,
|
|
5618
|
-
(0,
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
6031
|
+
(0, import_react4.createElement)("strong", null, "\u5143\u6280\u80FD\u4E0E\u9879\u76EE\u6280\u80FD"),
|
|
6032
|
+
(0, import_react4.createElement)("span", { style: label }, "\u6BCF\u4E2A\u5143\u6280\u80FD\u59CB\u7EC8\u52A0\u8F7D\u540C\u540D\u6838\u5FC3 Skill\uFF1B\u540C\u540D\u9879\u76EE Skill \u8986\u76D6\u7528\u6237\u4E0E\u5185\u7F6E\u7248\u672C\u3002\u9644\u52A0\u6280\u80FD\u6309\u540D\u79F0\u6302\u8F7D\uFF0C\u5B9E\u9645\u6765\u6E90\u5728\u4EFB\u52A1\u521B\u5EFA\u65F6\u89E3\u6790\u3002Rule \u4FDD\u5B58\u5728\u5BF9\u5E94 Skill \u7684 profile.json\u3002"),
|
|
6033
|
+
(0, import_react4.createElement)("input", {
|
|
6034
|
+
className: "te-input",
|
|
6035
|
+
type: "search",
|
|
6036
|
+
"aria-label": "\u641C\u7D22\u5143\u6280\u80FD\u6216\u5DF2\u6302\u8F7D\u6280\u80FD",
|
|
6037
|
+
placeholder: "\u641C\u7D22\u9636\u6BB5\u6216\u5DF2\u6302\u8F7D\u7684 Skill",
|
|
6038
|
+
value: metaQuery,
|
|
6039
|
+
onChange: (event) => setMetaQuery(event.target.value)
|
|
6040
|
+
}),
|
|
6041
|
+
(0, import_react4.createElement)(
|
|
6042
|
+
"div",
|
|
6043
|
+
{ className: "te-meta-layout" },
|
|
6044
|
+
(0, import_react4.createElement)(
|
|
6045
|
+
"nav",
|
|
6046
|
+
{ className: "te-meta-nav", "aria-label": "\u5143\u6280\u80FD\u9636\u6BB5" },
|
|
6047
|
+
...visibleStages.map(([id, stage]) => (0, import_react4.createElement)(
|
|
6048
|
+
"button",
|
|
6049
|
+
{
|
|
6050
|
+
key: id,
|
|
6051
|
+
type: "button",
|
|
6052
|
+
"aria-current": visibleMeta === id ? "true" : void 0,
|
|
6053
|
+
onClick: () => {
|
|
6054
|
+
setActiveMeta(id);
|
|
6055
|
+
setSkillQuery("");
|
|
6056
|
+
}
|
|
6057
|
+
},
|
|
6058
|
+
stage,
|
|
6059
|
+
(0, import_react4.createElement)("small", null, `\u5DF2\u6302\u8F7D ${(draft.meta_bindings?.[id] ?? []).length} \u4E2A Skill`)
|
|
6060
|
+
)),
|
|
6061
|
+
visibleStages.length === 0 ? (0, import_react4.createElement)("span", { style: label }, "\u6CA1\u6709\u5339\u914D\u7684\u9636\u6BB5\u3002") : null
|
|
6062
|
+
),
|
|
6063
|
+
visibleMeta ? (0, import_react4.createElement)(
|
|
5623
6064
|
"div",
|
|
5624
|
-
{
|
|
5625
|
-
(0,
|
|
5626
|
-
(0, import_react3.createElement)("span", { style: label }, `\u6838\u5FC3\uFF1A${id} \xB7 \u751F\u6548\u6765\u6E90\uFF1A${effectiveSource(skills, id)}`),
|
|
5627
|
-
(0, import_react3.createElement)(import_dsh_client_ui_primitives2.Button, { variant: "outline", size: "sm", onClick: () => openRules(id) }, "\u914D\u7F6E\u6838\u5FC3 Skill \u7684 Rule"),
|
|
5628
|
-
(0, import_react3.createElement)(
|
|
6065
|
+
{ className: "te-meta-detail" },
|
|
6066
|
+
(0, import_react4.createElement)(
|
|
5629
6067
|
"div",
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
type: "button",
|
|
5634
|
-
title: "\u79FB\u9664\u6302\u8F7D",
|
|
5635
|
-
style: { ...input, minWidth: 0, cursor: "pointer" },
|
|
5636
|
-
onClick: () => removeSkill(meta, name)
|
|
5637
|
-
}, `${name} \xB7 ${effectiveSource(skills, name)} \xD7`)),
|
|
5638
|
-
...selected2.map((name) => (0, import_react3.createElement)(import_dsh_client_ui_primitives2.Button, {
|
|
5639
|
-
key: `rules-${name}`,
|
|
5640
|
-
variant: "outline",
|
|
5641
|
-
size: "sm",
|
|
5642
|
-
onClick: () => openRules(name)
|
|
5643
|
-
}, `\u914D\u7F6E ${name} \u7684 Rule`))
|
|
6068
|
+
null,
|
|
6069
|
+
(0, import_react4.createElement)("strong", null, META_STAGES[visibleMeta]),
|
|
6070
|
+
(0, import_react4.createElement)("div", { style: label }, "\u6838\u5FC3 Skill \u4E0E\u9644\u52A0 Skill \u7684 Rule \u5206\u522B\u4FDD\u5B58\u5728\u5404\u81EA\u7684\u914D\u7F6E\u4E2D\u3002")
|
|
5644
6071
|
),
|
|
5645
|
-
(0,
|
|
5646
|
-
"
|
|
5647
|
-
{
|
|
5648
|
-
|
|
5649
|
-
"
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
6072
|
+
(0, import_react4.createElement)(
|
|
6073
|
+
"div",
|
|
6074
|
+
{ className: "te-meta-skill-row" },
|
|
6075
|
+
(0, import_react4.createElement)(
|
|
6076
|
+
"span",
|
|
6077
|
+
null,
|
|
6078
|
+
(0, import_react4.createElement)("strong", null, visibleMeta),
|
|
6079
|
+
(0, import_react4.createElement)("small", { style: { ...label, display: "block" } }, `\u6838\u5FC3 \xB7 ${effectiveSource(skills, visibleMeta)}`)
|
|
6080
|
+
),
|
|
6081
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", onClick: () => openRules(visibleMeta) }, "\u914D\u7F6E Rule")
|
|
6082
|
+
),
|
|
6083
|
+
(0, import_react4.createElement)("strong", { style: { fontSize: 13 } }, `\u9644\u52A0 Skill \xB7 ${mounted.length}`),
|
|
6084
|
+
...mounted.map((name) => (0, import_react4.createElement)(
|
|
6085
|
+
"div",
|
|
6086
|
+
{ key: name, className: "te-meta-skill-row" },
|
|
6087
|
+
(0, import_react4.createElement)(
|
|
6088
|
+
"span",
|
|
6089
|
+
null,
|
|
6090
|
+
(0, import_react4.createElement)("strong", null, name),
|
|
6091
|
+
(0, import_react4.createElement)("small", { style: { ...label, display: "block" } }, effectiveSource(skills, name))
|
|
6092
|
+
),
|
|
6093
|
+
(0, import_react4.createElement)(
|
|
6094
|
+
"div",
|
|
6095
|
+
{ className: "te-meta-skill-actions" },
|
|
6096
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", onClick: () => openRules(name) }, "\u914D\u7F6E Rule"),
|
|
6097
|
+
(0, import_react4.createElement)("button", {
|
|
6098
|
+
type: "button",
|
|
6099
|
+
className: "te-transfer-remove",
|
|
6100
|
+
"aria-label": `\u4ECE${META_STAGES[visibleMeta]}\u79FB\u9664 ${name}`,
|
|
6101
|
+
onClick: () => removeSkill(visibleMeta, name)
|
|
6102
|
+
}, "\xD7")
|
|
6103
|
+
)
|
|
6104
|
+
)),
|
|
6105
|
+
mounted.length === 0 ? (0, import_react4.createElement)("span", { style: label }, "\u5C1A\u672A\u6302\u8F7D\u9644\u52A0 Skill\u3002") : null,
|
|
6106
|
+
(0, import_react4.createElement)(
|
|
6107
|
+
"div",
|
|
6108
|
+
{ style: { display: "flex", flexDirection: "column", gap: 7 } },
|
|
6109
|
+
(0, import_react4.createElement)("strong", { style: { fontSize: 13 } }, "\u6302\u8F7D\u9644\u52A0 Skill"),
|
|
6110
|
+
(0, import_react4.createElement)("input", {
|
|
6111
|
+
className: "te-input",
|
|
6112
|
+
type: "search",
|
|
6113
|
+
"aria-label": "\u641C\u7D22\u53EF\u6302\u8F7D\u6280\u80FD",
|
|
6114
|
+
placeholder: "\u641C\u7D22 Skill \u540D\u79F0\u3001\u8BF4\u660E\u6216\u6765\u6E90",
|
|
6115
|
+
value: skillQuery,
|
|
6116
|
+
onChange: (event) => setSkillQuery(event.target.value)
|
|
6117
|
+
}),
|
|
6118
|
+
(0, import_react4.createElement)("span", { style: label }, `\u53EF\u9009 ${matchingCandidates.length} \u4E2A${matchingCandidates.length > 12 ? "\uFF0C\u5148\u663E\u793A\u524D 12 \u4E2A\uFF1B\u53EF\u7EE7\u7EED\u8F93\u5165\u7F29\u5C0F\u8303\u56F4" : ""}`),
|
|
6119
|
+
(0, import_react4.createElement)(
|
|
6120
|
+
"div",
|
|
6121
|
+
{ className: "te-meta-candidates" },
|
|
6122
|
+
...matchingCandidates.slice(0, 12).map((name) => (0, import_react4.createElement)(
|
|
6123
|
+
"div",
|
|
6124
|
+
{ key: name, className: "te-meta-candidate" },
|
|
6125
|
+
(0, import_react4.createElement)(
|
|
6126
|
+
"span",
|
|
6127
|
+
null,
|
|
6128
|
+
(0, import_react4.createElement)("strong", null, name),
|
|
6129
|
+
(0, import_react4.createElement)("small", null, effectiveSource(skills, name))
|
|
6130
|
+
),
|
|
6131
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", onClick: () => addSkill(visibleMeta, name) }, "\u6302\u8F7D")
|
|
6132
|
+
)),
|
|
6133
|
+
matchingCandidates.length === 0 ? (0, import_react4.createElement)("span", { style: label }, "\u6CA1\u6709\u5339\u914D\u7684 Skill\u3002") : null
|
|
6134
|
+
)
|
|
5655
6135
|
)
|
|
5656
|
-
)
|
|
5657
|
-
|
|
6136
|
+
) : null
|
|
6137
|
+
)
|
|
5658
6138
|
),
|
|
5659
|
-
(0,
|
|
6139
|
+
(0, import_react4.createElement)(
|
|
5660
6140
|
"div",
|
|
5661
6141
|
{ style: card },
|
|
5662
|
-
(0,
|
|
6142
|
+
(0, import_react4.createElement)(
|
|
5663
6143
|
"div",
|
|
5664
6144
|
{ style: row },
|
|
5665
|
-
(0,
|
|
5666
|
-
(0,
|
|
6145
|
+
(0, import_react4.createElement)("strong", null, "SonarQube \u5BA1\u6838"),
|
|
6146
|
+
(0, import_react4.createElement)(
|
|
5667
6147
|
"label",
|
|
5668
6148
|
{ style: row },
|
|
5669
|
-
(0,
|
|
6149
|
+
(0, import_react4.createElement)("input", {
|
|
5670
6150
|
type: "checkbox",
|
|
5671
6151
|
checked: sonar.enabled === true,
|
|
5672
6152
|
onChange: (event) => updateSonar({ enabled: event.target.checked })
|
|
@@ -5674,111 +6154,111 @@ function AdaptivePanel({ workspace, remote, onOpenInit }) {
|
|
|
5674
6154
|
"\u542F\u7528\uFF08\u4EC5\u4EE3\u7801\u5BA1\u6838\u9636\u6BB5\uFF09"
|
|
5675
6155
|
)
|
|
5676
6156
|
),
|
|
5677
|
-
(0,
|
|
5678
|
-
sonar.enabled === true ? (0,
|
|
6157
|
+
(0, import_react4.createElement)("span", { style: label }, "\u6D4B\u8BD5\u901A\u8FC7\u540E\uFF0C\u4EE3\u7801\u5BA1\u6838\u5143\u6280\u80FD\u4F1A\u68C0\u67E5\u63D0\u4EA4\u524D\u7684\u65B0\u589E\u4EE3\u7801\u3002\u9996\u6B21\u5BA1\u6838\u81EA\u52A8\u51C6\u5907\u672C\u5730\u5206\u6790\u7EC4\u4EF6\uFF0C\u5E76\u4ECE SonarQube \u540C\u6B65\u5F53\u524D\u9879\u76EE\u7684\u89C4\u5219\u3002Token \u6309\u9879\u76EE\u4FDD\u5B58\u5728\u672C\u673A DSH \u51ED\u636E\u5B58\u50A8\u3002"),
|
|
6158
|
+
sonar.enabled === true && sonar.source && sonar.source !== "ide-local" ? (0, import_react4.createElement)(
|
|
6159
|
+
"span",
|
|
6160
|
+
{ style: label },
|
|
6161
|
+
"\u6B64\u9879\u76EE\u4ECD\u662F\u65E7\u5BA1\u6838\u6A21\u5F0F\uFF1B\u4FDD\u5B58\u914D\u7F6E\u540E\uFF0C\u65B0\u4EFB\u52A1\u5C06\u4F7F\u7528\u63D0\u4EA4\u524D\u672C\u5730\u5BA1\u6838\u3002\u5DF2\u6709\u4EFB\u52A1\u6309\u521B\u5EFA\u65F6\u7684\u914D\u7F6E\u7EE7\u7EED\u3002"
|
|
6162
|
+
) : null,
|
|
6163
|
+
sonar.enabled === true ? (0, import_react4.createElement)(
|
|
5679
6164
|
"div",
|
|
5680
6165
|
{ style: grid },
|
|
5681
|
-
(0,
|
|
5682
|
-
"label",
|
|
5683
|
-
{ style: { display: "flex", flexDirection: "column", gap: 4 } },
|
|
5684
|
-
(0, import_react3.createElement)("span", { style: label }, "\u626B\u63CF\u6765\u6E90"),
|
|
5685
|
-
(0, import_react3.createElement)(
|
|
5686
|
-
"select",
|
|
5687
|
-
{
|
|
5688
|
-
style: input,
|
|
5689
|
-
value: sonar.source ?? "ci",
|
|
5690
|
-
onChange: (event) => updateSonar({
|
|
5691
|
-
source: event.target.value,
|
|
5692
|
-
...event.target.value !== "ci" ? { mode: "branch" } : {},
|
|
5693
|
-
...event.target.value !== "ide-local" ? { include_paths: [] } : {}
|
|
5694
|
-
})
|
|
5695
|
-
},
|
|
5696
|
-
(0, import_react3.createElement)("option", { value: "ci" }, "CI \u5DF2\u6709\u7ED3\u679C"),
|
|
5697
|
-
(0, import_react3.createElement)("option", { value: "ide-local" }, "\u672C\u5730\u89C4\u5219\u5BA1\u6838\uFF08\u65E0\u9700\u63D0\u4EA4\u6216\u63A8\u9001\uFF09"),
|
|
5698
|
-
(0, import_react3.createElement)("option", { value: "local" }, "\u672C\u673A\u626B\u63CF\u5E76\u4E0A\u4F20\uFF08\u9700 Developer Edition\uFF09")
|
|
5699
|
-
)
|
|
5700
|
-
),
|
|
5701
|
-
...[
|
|
5702
|
-
["host_url", "\u670D\u52A1\u5730\u5740", "https://sonar.example"],
|
|
5703
|
-
["project_key", "\u9879\u76EE Key", "my-project"],
|
|
5704
|
-
["token_env", "Token \u73AF\u5883\u53D8\u91CF\u540D\uFF08\u53EF\u9009\u540E\u5907\uFF09", "SONAR_TOKEN"]
|
|
5705
|
-
].map(([key, title, placeholder]) => (0, import_react3.createElement)(
|
|
6166
|
+
...[["host_url", "\u670D\u52A1\u5730\u5740", "https://sonar.example"], ["project_key", "\u9879\u76EE Key", "my-project"]].map(([key, title, placeholder]) => (0, import_react4.createElement)(
|
|
5706
6167
|
"label",
|
|
5707
6168
|
{ key, style: { display: "flex", flexDirection: "column", gap: 4 } },
|
|
5708
|
-
(0,
|
|
5709
|
-
(0,
|
|
6169
|
+
(0, import_react4.createElement)("span", { style: label }, title),
|
|
6170
|
+
(0, import_react4.createElement)("input", {
|
|
5710
6171
|
style: input,
|
|
5711
6172
|
value: sonar[key] ?? "",
|
|
5712
6173
|
placeholder,
|
|
5713
6174
|
onChange: (event) => updateSonar({ [key]: event.target.value })
|
|
5714
6175
|
})
|
|
5715
6176
|
)),
|
|
5716
|
-
(0,
|
|
5717
|
-
"
|
|
5718
|
-
{ style: {
|
|
5719
|
-
(0,
|
|
5720
|
-
(0,
|
|
5721
|
-
"
|
|
5722
|
-
{
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
6177
|
+
(0, import_react4.createElement)(
|
|
6178
|
+
"details",
|
|
6179
|
+
{ style: { gridColumn: "1 / -1" } },
|
|
6180
|
+
(0, import_react4.createElement)("summary", null, "\u9AD8\u7EA7\u8BBE\u7F6E\uFF1A\u65B0\u589E\u4EE3\u7801\u53C2\u8003\u7248\u672C\u4E0E\u5BA1\u6838\u8303\u56F4"),
|
|
6181
|
+
(0, import_react4.createElement)(
|
|
6182
|
+
"div",
|
|
6183
|
+
{ style: { ...grid, marginTop: 8 } },
|
|
6184
|
+
(0, import_react4.createElement)(
|
|
6185
|
+
"label",
|
|
6186
|
+
{ style: { display: "flex", flexDirection: "column", gap: 4 } },
|
|
6187
|
+
(0, import_react4.createElement)("span", { style: label }, "Git \u53C2\u8003\u7248\u672C\uFF08\u9ED8\u8BA4 HEAD\uFF0C\u5373\u672A\u63D0\u4EA4\u53D8\u66F4\uFF09"),
|
|
6188
|
+
(0, import_react4.createElement)("input", {
|
|
6189
|
+
style: input,
|
|
6190
|
+
value: sonar.reference_branch ?? "HEAD",
|
|
6191
|
+
placeholder: "HEAD",
|
|
6192
|
+
onChange: (event) => updateSonar({ reference_branch: event.target.value })
|
|
6193
|
+
})
|
|
6194
|
+
),
|
|
6195
|
+
(0, import_react4.createElement)(
|
|
6196
|
+
"label",
|
|
6197
|
+
{ style: { display: "flex", flexDirection: "column", gap: 4 } },
|
|
6198
|
+
(0, import_react4.createElement)("span", { style: label }, "\u5BA1\u6838\u8DEF\u5F84\uFF08\u6BCF\u884C\u4E00\u4E2A\uFF1B\u7559\u7A7A\u4E3A\u672C\u6B21\u4EFB\u52A1\u7684\u5168\u90E8\u4EE3\u7801\uFF09"),
|
|
6199
|
+
(0, import_react4.createElement)("textarea", {
|
|
6200
|
+
style: { ...input, minHeight: 76 },
|
|
6201
|
+
value: (sonar.include_paths ?? []).join("\n"),
|
|
6202
|
+
onChange: (event) => updateSonar({
|
|
6203
|
+
include_paths: event.target.value.split(/\r?\n|,/u).map((path) => path.trim()).filter(Boolean)
|
|
6204
|
+
})
|
|
6205
|
+
})
|
|
6206
|
+
)
|
|
5730
6207
|
)
|
|
5731
6208
|
),
|
|
5732
|
-
|
|
5733
|
-
"label",
|
|
5734
|
-
{ style: { display: "flex", flexDirection: "column", gap: 4 } },
|
|
5735
|
-
(0, import_react3.createElement)("span", { style: label }, sonar.source === "local" ? "\u65B0\u4EE3\u7801\u53C2\u8003\u5206\u652F\uFF08\u987B\u5DF2\u6709 Sonar \u5206\u6790\uFF09" : "\u65B0\u4EE3\u7801\u53C2\u8003\u5206\u652F\uFF08\u672C\u673A Git \u5206\u652F\uFF09"),
|
|
5736
|
-
(0, import_react3.createElement)("input", {
|
|
5737
|
-
style: input,
|
|
5738
|
-
value: sonar.reference_branch ?? "",
|
|
5739
|
-
placeholder: "\u4F8B\u5982 qdm_sit",
|
|
5740
|
-
onChange: (event) => updateSonar({ reference_branch: event.target.value })
|
|
5741
|
-
})
|
|
5742
|
-
) : null,
|
|
5743
|
-
sonar.source === "local" ? (0, import_react3.createElement)(
|
|
5744
|
-
"label",
|
|
5745
|
-
{ style: { display: "flex", flexDirection: "column", gap: 4 } },
|
|
5746
|
-
(0, import_react3.createElement)("span", { style: label }, "\u672C\u673A\u626B\u63CF\u547D\u4EE4\uFF08\u53EF\u9009\uFF1B\u4E0D\u586B\u5219\u81EA\u52A8\u9009\u62E9 Maven / sonar-scanner\uFF09"),
|
|
5747
|
-
(0, import_react3.createElement)("input", {
|
|
5748
|
-
style: input,
|
|
5749
|
-
value: sonar.scan_command ?? "",
|
|
5750
|
-
placeholder: "mvn org.sonarsource.scanner.maven:sonar-maven-plugin:5.5.0.6356:sonar",
|
|
5751
|
-
onChange: (event) => updateSonar({ scan_command: event.target.value })
|
|
5752
|
-
})
|
|
5753
|
-
) : null,
|
|
5754
|
-
sonar.source === "local" ? (0, import_react3.createElement)(
|
|
6209
|
+
(0, import_react4.createElement)(
|
|
5755
6210
|
"span",
|
|
5756
|
-
{ style: label },
|
|
5757
|
-
"\u672C\
|
|
5758
|
-
)
|
|
5759
|
-
|
|
5760
|
-
"
|
|
5761
|
-
{ style: {
|
|
5762
|
-
(0,
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
6211
|
+
{ style: { ...label, gridColumn: "1 / -1" } },
|
|
6212
|
+
"\u65E0\u9700\u5B89\u88C5 IDEA\u3001Maven \u6216 SonarScanner\u3002\u9996\u6B21\u5BA1\u6838\u4F1A\u4E0B\u8F7D\u5B98\u65B9\u672C\u5730\u5206\u6790\u540E\u53F0\uFF1B\u8BED\u8A00\u5206\u6790\u5668\u7531\u540E\u53F0\u4ECE SonarQube \u540C\u6B65\u3002\u90E8\u5206\u670D\u52A1\u7AEF\u89C4\u5219\u65E0\u6CD5\u5728\u672C\u5730\u6267\u884C\uFF0C\u672C\u5730\u901A\u8FC7\u4E0D\u7B49\u4E8E\u670D\u52A1\u7AEF\u8D28\u91CF\u95E8\u7981\u901A\u8FC7\u3002"
|
|
6213
|
+
),
|
|
6214
|
+
(0, import_react4.createElement)(
|
|
6215
|
+
"div",
|
|
6216
|
+
{ style: { ...row, gridColumn: "1 / -1" } },
|
|
6217
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, {
|
|
6218
|
+
variant: "outline",
|
|
6219
|
+
size: "sm",
|
|
6220
|
+
disabled: !!analyzerOperation || saving || dirty,
|
|
6221
|
+
onClick: prepareAnalyzer
|
|
6222
|
+
}, analyzerOperation === "prepare" ? "\u5B89\u88C5\u4E0E\u68C0\u67E5\u4E2D\u2026" : "\u5B89\u88C5\u6216\u68C0\u67E5\u672C\u5730\u5206\u6790\u5668"),
|
|
6223
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, {
|
|
6224
|
+
variant: "outline",
|
|
6225
|
+
size: "sm",
|
|
6226
|
+
disabled: !!analyzerOperation || saving || dirty,
|
|
6227
|
+
onClick: updateRules
|
|
6228
|
+
}, analyzerOperation === "update" ? "\u89C4\u5219\u66F4\u65B0\u4E2D\u2026" : "\u66F4\u65B0\u5F53\u524D\u9879\u76EE\u89C4\u5219"),
|
|
6229
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, {
|
|
6230
|
+
variant: "outline",
|
|
6231
|
+
size: "sm",
|
|
6232
|
+
disabled: saving || dirty,
|
|
6233
|
+
onClick: () => setRuleViewerOpen(true)
|
|
6234
|
+
}, "\u67E5\u770B\u5F53\u524D\u9879\u76EE\u89C4\u5219"),
|
|
6235
|
+
(0, import_react4.createElement)("span", { style: label }, "\u5148\u4FDD\u5B58\u670D\u52A1\u5730\u5740\u3001\u9879\u76EE Key \u548C Token\uFF1B\u68C0\u67E5\u4E0D\u4F1A\u5BA1\u6838\u6216\u4E0A\u4F20\u9879\u76EE\u4EE3\u7801\u3002")
|
|
6236
|
+
),
|
|
6237
|
+
analyzerUpdatedAt && !dirty ? (0, import_react4.createElement)(
|
|
5773
6238
|
"span",
|
|
5774
|
-
{ style: label },
|
|
5775
|
-
|
|
6239
|
+
{ style: { ...label, gridColumn: "1 / -1" } },
|
|
6240
|
+
`\u4E0A\u6B21\u624B\u52A8\u66F4\u65B0\uFF1A${new Date(analyzerUpdatedAt).toLocaleString()}`
|
|
5776
6241
|
) : null,
|
|
5777
|
-
(0,
|
|
6242
|
+
analyzerProfiles ? (0, import_react4.createElement)(
|
|
6243
|
+
"div",
|
|
6244
|
+
{ style: { ...label, gridColumn: "1 / -1" } },
|
|
6245
|
+
analyzerProfiles.length ? analyzerProfiles.map((profile) => (0, import_react4.createElement)(
|
|
6246
|
+
"div",
|
|
6247
|
+
{ key: profile.language },
|
|
6248
|
+
`${profile.language}\uFF1A\u670D\u52A1\u7AEF ${profile.active_rules} \u6761\u89C4\u5219\uFF1B\u672C\u5730\u5206\u6790\u5668 ${profile.analyzer}`
|
|
6249
|
+
)) : "\u9879\u76EE\u6CA1\u6709\u8FD4\u56DE\u5DF2\u542F\u7528\u89C4\u5219\u7684\u8BED\u8A00\u3002",
|
|
6250
|
+
analyzerOtherCount ? (0, import_react4.createElement)(
|
|
6251
|
+
"div",
|
|
6252
|
+
null,
|
|
6253
|
+
`\u5176\u5B83 ${analyzerOtherCount} \u4E2A\u8BED\u8A00\u914D\u7F6E\u5DF2\u6536\u8D77\uFF1B\u53EF\u5728\u201C\u67E5\u770B\u5F53\u524D\u9879\u76EE\u89C4\u5219\u201D\u4E2D\u663E\u793A\u3002`
|
|
6254
|
+
) : null,
|
|
6255
|
+
(0, import_react4.createElement)("div", null, "\u5DF2\u540C\u6B65\u8868\u793A\u8BE5\u8BED\u8A00\u5206\u6790\u5668\u53EF\u7528\uFF0C\u4E0D\u4EE3\u8868\u670D\u52A1\u7AEF\u5168\u90E8\u89C4\u5219\u90FD\u80FD\u5728\u672C\u5730\u6267\u884C\u3002")
|
|
6256
|
+
) : null,
|
|
6257
|
+
(0, import_react4.createElement)(
|
|
5778
6258
|
"div",
|
|
5779
6259
|
{ style: { display: "flex", flexDirection: "column", gap: 5 } },
|
|
5780
|
-
(0,
|
|
5781
|
-
(0,
|
|
6260
|
+
(0, import_react4.createElement)("span", { style: label }, `\u5F53\u524D\u9879\u76EE Token\uFF1A${tokenInfo === null ? "\u72B6\u6001\u4E0D\u53EF\u7528" : tokenInfo.configured ? "\u5DF2\u914D\u7F6E" : "\u672A\u914D\u7F6E"}`),
|
|
6261
|
+
(0, import_react4.createElement)("input", {
|
|
5782
6262
|
type: "password",
|
|
5783
6263
|
autoComplete: "new-password",
|
|
5784
6264
|
style: input,
|
|
@@ -5786,16 +6266,16 @@ function AdaptivePanel({ workspace, remote, onOpenInit }) {
|
|
|
5786
6266
|
placeholder: "\u8F93\u5165\u7528\u6237\u4EE4\u724C\uFF08\u4FDD\u5B58\u540E\u4E0D\u56DE\u663E\uFF09",
|
|
5787
6267
|
onChange: (event) => setSonarToken(event.target.value)
|
|
5788
6268
|
}),
|
|
5789
|
-
(0,
|
|
6269
|
+
(0, import_react4.createElement)(
|
|
5790
6270
|
"div",
|
|
5791
6271
|
{ style: row },
|
|
5792
|
-
(0,
|
|
6272
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, {
|
|
5793
6273
|
variant: "outline",
|
|
5794
6274
|
size: "sm",
|
|
5795
6275
|
disabled: tokenBusy || !sonarToken.trim() || tokenInfo?.writable === false,
|
|
5796
6276
|
onClick: saveToken
|
|
5797
6277
|
}, tokenBusy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58 Token"),
|
|
5798
|
-
tokenInfo?.configured ? (0,
|
|
6278
|
+
tokenInfo?.configured ? (0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, {
|
|
5799
6279
|
variant: "outline",
|
|
5800
6280
|
size: "sm",
|
|
5801
6281
|
disabled: tokenBusy || tokenInfo.writable === false,
|
|
@@ -5805,20 +6285,21 @@ function AdaptivePanel({ workspace, remote, onOpenInit }) {
|
|
|
5805
6285
|
)
|
|
5806
6286
|
) : null
|
|
5807
6287
|
),
|
|
5808
|
-
(0,
|
|
6288
|
+
(0, import_react4.createElement)(
|
|
5809
6289
|
"div",
|
|
5810
|
-
{
|
|
5811
|
-
(0,
|
|
5812
|
-
(0,
|
|
5813
|
-
|
|
6290
|
+
{ className: "te-adaptive-savebar" },
|
|
6291
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", disabled: loading || saving, onClick: refresh }, "\u5237\u65B0"),
|
|
6292
|
+
(0, import_react4.createElement)(
|
|
6293
|
+
import_dsh_client_ui_primitives3.Button,
|
|
5814
6294
|
{ variant: "primary", size: "sm", disabled: loading || saving || !dirty, onClick: save },
|
|
5815
6295
|
saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u81EA\u9002\u5E94\u914D\u7F6E"
|
|
5816
6296
|
),
|
|
5817
|
-
(0,
|
|
6297
|
+
(0, import_react4.createElement)("span", { style: label }, dirty ? "\u6709\u672A\u4FDD\u5B58\u7684\u9879\u76EE\u914D\u7F6E" : "\u9879\u76EE\u914D\u7F6E\u5DF2\u4FDD\u5B58"),
|
|
6298
|
+
message ? (0, import_react4.createElement)("span", { role: "status", style: { ...label, flexBasis: "100%" } }, message) : null
|
|
5818
6299
|
),
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
selected ? (0,
|
|
6300
|
+
view?.problems.length ? (0, import_react4.createElement)("p", { role: "alert", style: styles.status }, view.problems.join("\uFF1B")) : null,
|
|
6301
|
+
ruleViewerOpen && sonar.enabled === true && sonar.host_url ? (0, import_react4.createElement)(SonarRuleViewer, { workspace, host: sonar.host_url, remote, onClose: () => setRuleViewerOpen(false) }) : null,
|
|
6302
|
+
selected ? (0, import_react4.createElement)(SkillRuleDialog, {
|
|
5822
6303
|
key: `${selected.skill.source}:${selected.skill.name}`,
|
|
5823
6304
|
skill: selected.skill,
|
|
5824
6305
|
profile: selected.profile,
|
|
@@ -5832,8 +6313,8 @@ function AdaptivePanel({ workspace, remote, onOpenInit }) {
|
|
|
5832
6313
|
}
|
|
5833
6314
|
|
|
5834
6315
|
// src/client/InitPanel.tsx
|
|
5835
|
-
var
|
|
5836
|
-
var
|
|
6316
|
+
var import_react5 = require("react");
|
|
6317
|
+
var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5837
6318
|
var MD_LABELS = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
5838
6319
|
var INIT_TIMEOUT_S = 150;
|
|
5839
6320
|
var card2 = {
|
|
@@ -5845,18 +6326,18 @@ var card2 = {
|
|
|
5845
6326
|
padding: "12px 14px"
|
|
5846
6327
|
};
|
|
5847
6328
|
function InitPanel({ workspace, remote }) {
|
|
5848
|
-
const [view, setView] = (0,
|
|
5849
|
-
const [generating, setGenerating] = (0,
|
|
5850
|
-
const [elapsed, setElapsed] = (0,
|
|
5851
|
-
const [draft, setDraft] = (0,
|
|
5852
|
-
const [editing, setEditing] = (0,
|
|
5853
|
-
const [body2, setBody] = (0,
|
|
5854
|
-
const [msg, setMsg] = (0,
|
|
5855
|
-
const [projectInitMsg, setProjectInitMsg] = (0,
|
|
5856
|
-
const [projectBusy, setProjectBusy] = (0,
|
|
5857
|
-
const [projectDraft, setProjectDraft] = (0,
|
|
5858
|
-
const [projectResources, setProjectResources] = (0,
|
|
5859
|
-
(0,
|
|
6329
|
+
const [view, setView] = (0, import_react5.useState)(null);
|
|
6330
|
+
const [generating, setGenerating] = (0, import_react5.useState)(false);
|
|
6331
|
+
const [elapsed, setElapsed] = (0, import_react5.useState)(0);
|
|
6332
|
+
const [draft, setDraft] = (0, import_react5.useState)(null);
|
|
6333
|
+
const [editing, setEditing] = (0, import_react5.useState)(false);
|
|
6334
|
+
const [body2, setBody] = (0, import_react5.useState)("");
|
|
6335
|
+
const [msg, setMsg] = (0, import_react5.useState)("");
|
|
6336
|
+
const [projectInitMsg, setProjectInitMsg] = (0, import_react5.useState)("");
|
|
6337
|
+
const [projectBusy, setProjectBusy] = (0, import_react5.useState)(false);
|
|
6338
|
+
const [projectDraft, setProjectDraft] = (0, import_react5.useState)(null);
|
|
6339
|
+
const [projectResources, setProjectResources] = (0, import_react5.useState)([]);
|
|
6340
|
+
(0, import_react5.useEffect)(() => {
|
|
5860
6341
|
if (!generating && !projectBusy) {
|
|
5861
6342
|
setElapsed(0);
|
|
5862
6343
|
return;
|
|
@@ -5870,7 +6351,7 @@ function InitPanel({ workspace, remote }) {
|
|
|
5870
6351
|
clearInterval(timer);
|
|
5871
6352
|
};
|
|
5872
6353
|
}, [generating, projectBusy]);
|
|
5873
|
-
(0,
|
|
6354
|
+
(0, import_react5.useEffect)(() => {
|
|
5874
6355
|
setProjectDraft(null);
|
|
5875
6356
|
setProjectResources([]);
|
|
5876
6357
|
setProjectInitMsg("");
|
|
@@ -5936,13 +6417,13 @@ function InitPanel({ workspace, remote }) {
|
|
|
5936
6417
|
setProjectBusy(false);
|
|
5937
6418
|
}
|
|
5938
6419
|
};
|
|
5939
|
-
const refresh = (0,
|
|
6420
|
+
const refresh = (0, import_react5.useCallback)(() => {
|
|
5940
6421
|
void remote.readInit(workspace).then((r) => {
|
|
5941
6422
|
if (r.ok) setView(r.value);
|
|
5942
6423
|
}, () => {
|
|
5943
6424
|
});
|
|
5944
6425
|
}, [remote, workspace]);
|
|
5945
|
-
(0,
|
|
6426
|
+
(0, import_react5.useEffect)(() => {
|
|
5946
6427
|
refresh();
|
|
5947
6428
|
}, [refresh]);
|
|
5948
6429
|
const generate = async () => {
|
|
@@ -5985,27 +6466,27 @@ function InitPanel({ workspace, remote }) {
|
|
|
5985
6466
|
setMsg("");
|
|
5986
6467
|
};
|
|
5987
6468
|
const exists = view?.exists === true;
|
|
5988
|
-
return (0,
|
|
6469
|
+
return (0, import_react5.createElement)(
|
|
5989
6470
|
"div",
|
|
5990
6471
|
{ style: styles.section },
|
|
5991
|
-
(0,
|
|
6472
|
+
(0, import_react5.createElement)(
|
|
5992
6473
|
"div",
|
|
5993
6474
|
{ style: card2 },
|
|
5994
|
-
(0,
|
|
5995
|
-
(0,
|
|
6475
|
+
(0, import_react5.createElement)("h2", { style: { margin: 0, fontSize: 17 } }, "\u9879\u76EE Skill / Rule \u521D\u59CB\u5316"),
|
|
6476
|
+
(0, import_react5.createElement)(
|
|
5996
6477
|
"p",
|
|
5997
6478
|
{ style: styles.muted },
|
|
5998
6479
|
"\u5728\u6B64\u626B\u63CF\u4ED3\u5E93\u5E76\u751F\u6210\u9879\u76EE Skill / Rule \u63D0\u6848\u3002\u9879\u76EE\u5730\u56FE\u8986\u76D6\u6574\u4E2A\u4ED3\u5E93\uFF0C\u5F53\u524D\u9700\u6C42\u7684\u4E13\u5C5E\u4FE1\u606F\u5E94\u5199\u5165\u4EFB\u52A1\u4EA7\u7269\u3002\u9010\u9879\u5BA1\u9605\u540E\u786E\u8BA4\u5199\u5165\uFF1B\u5DF2\u6709\u540C\u540D\u8D44\u6E90\u4E0D\u4F1A\u88AB\u8986\u76D6\u3002"
|
|
5999
6480
|
),
|
|
6000
|
-
(0,
|
|
6481
|
+
(0, import_react5.createElement)(
|
|
6001
6482
|
"p",
|
|
6002
6483
|
{ style: styles.muted },
|
|
6003
6484
|
"\u56E2\u961F\u5171\u4EAB\u65F6\uFF0C\u8BF7\u5C06\u751F\u6210\u7684 .dsh/skills\u3001.dsh/rules \u548C .dsh/meta.json \u7EB3\u5165 Git\uFF1B\u5BA1\u6838\u62A5\u544A\u53EF\u4FDD\u7559\u5728\u672C\u5730\u3002"
|
|
6004
6485
|
),
|
|
6005
|
-
(0,
|
|
6486
|
+
(0, import_react5.createElement)(
|
|
6006
6487
|
"div",
|
|
6007
6488
|
{ style: styles.row },
|
|
6008
|
-
(0,
|
|
6489
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6009
6490
|
variant: "primary",
|
|
6010
6491
|
size: "md",
|
|
6011
6492
|
disabled: projectBusy,
|
|
@@ -6013,24 +6494,24 @@ function InitPanel({ workspace, remote }) {
|
|
|
6013
6494
|
void generateProject();
|
|
6014
6495
|
}
|
|
6015
6496
|
}, projectBusy ? "\u626B\u63CF\u4E0E\u751F\u6210\u4E2D\u2026" : "\u626B\u63CF\u5E76\u751F\u6210\u63D0\u6848"),
|
|
6016
|
-
projectBusy ? (0,
|
|
6497
|
+
projectBusy ? (0, import_react5.createElement)("span", { style: styles.status }, `\u5DF2\u8017\u65F6 ${elapsed} \u79D2`) : null
|
|
6017
6498
|
),
|
|
6018
|
-
projectResources.length > 0 ? (0,
|
|
6499
|
+
projectResources.length > 0 ? (0, import_react5.createElement)(
|
|
6019
6500
|
"div",
|
|
6020
6501
|
{ style: styles.section },
|
|
6021
|
-
(0,
|
|
6502
|
+
(0, import_react5.createElement)(
|
|
6022
6503
|
"p",
|
|
6023
6504
|
{ style: styles.muted },
|
|
6024
6505
|
`\u9879\u76EE\uFF1A${workspace}\u3002\u63D0\u6848\u5305\u542B ${projectResources.length} \u4E2A Skill / Rule\uFF1B\u9879\u76EE\u5730\u56FE\u9700\u8986\u76D6\uFF1A${projectDraft?.project_map_coverage.join("\u3001") ?? "\u68C0\u67E5\u4FEE\u6539\u540E\u663E\u793A"}\u3002`
|
|
6025
6506
|
),
|
|
6026
|
-
...projectResources.map((resource, index) => (0,
|
|
6507
|
+
...projectResources.map((resource, index) => (0, import_react5.createElement)(
|
|
6027
6508
|
"div",
|
|
6028
6509
|
{ key: `${resource.kind}-${resource.name}`, style: card2 },
|
|
6029
|
-
(0,
|
|
6510
|
+
(0, import_react5.createElement)(
|
|
6030
6511
|
"div",
|
|
6031
6512
|
{ style: styles.row },
|
|
6032
|
-
(0,
|
|
6033
|
-
(0,
|
|
6513
|
+
(0, import_react5.createElement)("strong", null, `${resource.kind === "skill" ? "Skill" : "Rule"} \xB7 ${resource.name}`),
|
|
6514
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6034
6515
|
variant: "ghost",
|
|
6035
6516
|
size: "sm",
|
|
6036
6517
|
disabled: projectBusy,
|
|
@@ -6041,24 +6522,24 @@ function InitPanel({ workspace, remote }) {
|
|
|
6041
6522
|
}
|
|
6042
6523
|
}, "\u79FB\u9664\u5EFA\u8BAE")
|
|
6043
6524
|
),
|
|
6044
|
-
resource.kind === "skill" ? (0,
|
|
6525
|
+
resource.kind === "skill" ? (0, import_react5.createElement)(
|
|
6045
6526
|
"div",
|
|
6046
6527
|
{ style: styles.section },
|
|
6047
|
-
(0,
|
|
6528
|
+
(0, import_react5.createElement)("label", null, "\u7B80\u4ECB", (0, import_react5.createElement)("input", {
|
|
6048
6529
|
style: styles.input,
|
|
6049
6530
|
value: resource.description ?? "",
|
|
6050
6531
|
onChange: (event) => {
|
|
6051
6532
|
updateProjectResource(index, { description: event.target.value });
|
|
6052
6533
|
}
|
|
6053
6534
|
})),
|
|
6054
|
-
(0,
|
|
6535
|
+
(0, import_react5.createElement)("label", null, "\u6302\u8F7D\u5143\u6280\u80FD\uFF08\u9017\u53F7\u5206\u9694\uFF09", (0, import_react5.createElement)("input", {
|
|
6055
6536
|
style: styles.input,
|
|
6056
6537
|
value: (resource.meta_skills ?? []).join(", "),
|
|
6057
6538
|
onChange: (event) => {
|
|
6058
6539
|
updateProjectResource(index, { meta_skills: event.target.value.split(",").map((item) => item.trim()).filter(Boolean) });
|
|
6059
6540
|
}
|
|
6060
6541
|
})),
|
|
6061
|
-
(0,
|
|
6542
|
+
(0, import_react5.createElement)("label", null, "\u5173\u8054 Rule\uFF08\u9017\u53F7\u5206\u9694\uFF09", (0, import_react5.createElement)("input", {
|
|
6062
6543
|
style: styles.input,
|
|
6063
6544
|
value: (resource.rules ?? []).join(", "),
|
|
6064
6545
|
onChange: (event) => {
|
|
@@ -6066,7 +6547,7 @@ function InitPanel({ workspace, remote }) {
|
|
|
6066
6547
|
}
|
|
6067
6548
|
}))
|
|
6068
6549
|
) : null,
|
|
6069
|
-
(0,
|
|
6550
|
+
(0, import_react5.createElement)("label", null, "\u5185\u5BB9", (0, import_react5.createElement)("textarea", {
|
|
6070
6551
|
style: { ...styles.textarea, minHeight: 180 },
|
|
6071
6552
|
value: resource.content,
|
|
6072
6553
|
onChange: (event) => {
|
|
@@ -6074,10 +6555,10 @@ function InitPanel({ workspace, remote }) {
|
|
|
6074
6555
|
}
|
|
6075
6556
|
}))
|
|
6076
6557
|
)),
|
|
6077
|
-
(0,
|
|
6558
|
+
(0, import_react5.createElement)(
|
|
6078
6559
|
"div",
|
|
6079
6560
|
{ style: styles.row },
|
|
6080
|
-
(0,
|
|
6561
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6081
6562
|
variant: "outline",
|
|
6082
6563
|
size: "md",
|
|
6083
6564
|
disabled: projectBusy,
|
|
@@ -6085,7 +6566,7 @@ function InitPanel({ workspace, remote }) {
|
|
|
6085
6566
|
void checkProject();
|
|
6086
6567
|
}
|
|
6087
6568
|
}, "\u68C0\u67E5\u4FEE\u6539"),
|
|
6088
|
-
(0,
|
|
6569
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6089
6570
|
variant: "primary",
|
|
6090
6571
|
size: "md",
|
|
6091
6572
|
disabled: projectBusy || projectDraft === null,
|
|
@@ -6094,47 +6575,47 @@ function InitPanel({ workspace, remote }) {
|
|
|
6094
6575
|
}
|
|
6095
6576
|
}, "\u786E\u8BA4\u5199\u5165\u9879\u76EE")
|
|
6096
6577
|
),
|
|
6097
|
-
projectDraft !== null ? (0,
|
|
6578
|
+
projectDraft !== null ? (0, import_react5.createElement)("p", { style: styles.muted }, `\u5C06\u521B\u5EFA\uFF1A${projectDraft.files_to_create.join("\u3001")}\uFF0C\u5E76\u66F4\u65B0 .dsh/meta.json`) : null
|
|
6098
6579
|
) : null,
|
|
6099
|
-
projectInitMsg ? (0,
|
|
6580
|
+
projectInitMsg ? (0, import_react5.createElement)("p", { role: "status", style: styles.status }, projectInitMsg) : null
|
|
6100
6581
|
),
|
|
6101
|
-
(0,
|
|
6582
|
+
(0, import_react5.createElement)(
|
|
6102
6583
|
"div",
|
|
6103
6584
|
{ style: card2 },
|
|
6104
|
-
(0,
|
|
6105
|
-
(0,
|
|
6585
|
+
(0, import_react5.createElement)("h2", { style: { margin: 0, fontSize: 17 } }, "AGENTS.md \u521D\u59CB\u5316"),
|
|
6586
|
+
(0, import_react5.createElement)(
|
|
6106
6587
|
"div",
|
|
6107
6588
|
{ style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" } },
|
|
6108
|
-
(0,
|
|
6109
|
-
(0,
|
|
6110
|
-
view?.path !== void 0 ? (0,
|
|
6589
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.StateDot, { state: exists ? "done" : "ongoing" }),
|
|
6590
|
+
(0, import_react5.createElement)("span", { style: styles.bindingLabel }, exists ? `AGENTS.md \u5DF2\u5B58\u5728 \xB7 ${view.lines} \u884C\uFF08\u4E0A\u9650 200\uFF09` : "AGENTS.md \u672A\u521B\u5EFA"),
|
|
6591
|
+
view?.path !== void 0 ? (0, import_react5.createElement)("span", { style: styles.sourceBadge }, `\u5DF2\u5B9A\u4F4D\u5230 ${view.path}`) : null
|
|
6111
6592
|
),
|
|
6112
|
-
(0,
|
|
6593
|
+
(0, import_react5.createElement)(
|
|
6113
6594
|
"p",
|
|
6114
6595
|
{ style: styles.muted },
|
|
6115
6596
|
"\u9879\u76EE\u6839 AGENTS.md \u4F1A\u88AB DSH \u81EA\u52A8\u6CE8\u5165\u5230\u6BCF\u4E2A\u4F1A\u8BDD\u3002\u521D\u59CB\u5316\u4E00\u6B21\uFF0C\u4E4B\u540E\u6BCF\u6B21\u4EFB\u52A1\u5F00\u5DE5 AI \u90FD\u81EA\u5E26\u8FD9\u4EFD\u9879\u76EE\u8BA4\u77E5\uFF08\u9879\u76EE\u662F\u4EC0\u4E48 \u2192 \u600E\u4E48\u8DD1 \u2192 \u7ED3\u6784 \u2192 \u7EA6\u5B9A \u2192 \u5751\uFF09\u3002"
|
|
6116
6597
|
),
|
|
6117
|
-
exists && !editing && draft === null ? (0,
|
|
6598
|
+
exists && !editing && draft === null ? (0, import_react5.createElement)(
|
|
6118
6599
|
"div",
|
|
6119
6600
|
{ style: styles.mdPreview },
|
|
6120
|
-
(0,
|
|
6601
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.MarkdownText, { text: view.content, labels: MD_LABELS })
|
|
6121
6602
|
) : null,
|
|
6122
|
-
draft !== null ? (0,
|
|
6603
|
+
draft !== null ? (0, import_react5.createElement)(
|
|
6123
6604
|
"div",
|
|
6124
6605
|
{ style: styles.section },
|
|
6125
|
-
(0,
|
|
6606
|
+
(0, import_react5.createElement)(
|
|
6126
6607
|
"div",
|
|
6127
6608
|
{ style: styles.sourceRow },
|
|
6128
|
-
(0,
|
|
6129
|
-
(0,
|
|
6609
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.StateDot, { state: "ongoing", size: 8 }),
|
|
6610
|
+
(0, import_react5.createElement)("span", { style: styles.sourceBadge }, `AI \u8349\u7A3F \xB7 ${draft.lines} \u884C \xB7 \u5C1A\u672A\u5199\u5165`)
|
|
6130
6611
|
),
|
|
6131
|
-
(0,
|
|
6612
|
+
(0, import_react5.createElement)(
|
|
6132
6613
|
"div",
|
|
6133
6614
|
{ style: styles.mdPreview },
|
|
6134
|
-
(0,
|
|
6615
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.MarkdownText, { text: draft.content, labels: MD_LABELS })
|
|
6135
6616
|
)
|
|
6136
6617
|
) : null,
|
|
6137
|
-
editing ? (0,
|
|
6618
|
+
editing ? (0, import_react5.createElement)("textarea", {
|
|
6138
6619
|
style: { ...styles.textarea, minHeight: 300 },
|
|
6139
6620
|
placeholder: "AGENTS.md \u6B63\u6587\uFF08Markdown\uFF0C\u2264200 \u884C\uFF09",
|
|
6140
6621
|
value: body2,
|
|
@@ -6142,16 +6623,16 @@ function InitPanel({ workspace, remote }) {
|
|
|
6142
6623
|
setBody(ev.target.value);
|
|
6143
6624
|
}
|
|
6144
6625
|
}) : null,
|
|
6145
|
-
generating ? (0,
|
|
6626
|
+
generating ? (0, import_react5.createElement)(
|
|
6146
6627
|
"p",
|
|
6147
6628
|
{ style: styles.status },
|
|
6148
6629
|
`AI \u6B63\u5728\u626B\u63CF\u9879\u76EE\u5E76\u751F\u6210\u8349\u7A3F\u2026 \u5DF2\u8017\u65F6 ${elapsed} \u79D2\uFF08\u6700\u957F ${INIT_TIMEOUT_S} \u79D2\uFF09\uFF0C\u8BF7\u7A0D\u5019`
|
|
6149
6630
|
) : null,
|
|
6150
|
-
msg !== "" ? (0,
|
|
6151
|
-
draft !== null ? (0,
|
|
6631
|
+
msg !== "" ? (0, import_react5.createElement)("p", { style: styles.status }, msg) : null,
|
|
6632
|
+
draft !== null ? (0, import_react5.createElement)(
|
|
6152
6633
|
"div",
|
|
6153
6634
|
{ style: styles.row },
|
|
6154
|
-
(0,
|
|
6635
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6155
6636
|
variant: "primary",
|
|
6156
6637
|
size: "md",
|
|
6157
6638
|
disabled: draft.lines > 200,
|
|
@@ -6160,14 +6641,14 @@ function InitPanel({ workspace, remote }) {
|
|
|
6160
6641
|
void write(draft.content, exists);
|
|
6161
6642
|
}
|
|
6162
6643
|
}, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
|
|
6163
|
-
draft.lines > 200 ? (0,
|
|
6164
|
-
(0,
|
|
6644
|
+
draft.lines > 200 ? (0, import_react5.createElement)("span", { style: styles.sourceBadge }, `\u8349\u7A3F ${draft.lines} \u884C\u8D85\u9650\uFF0C\u8BF7\u70B9\u300C\u653E\u5F03\u300D\u540E\u91CD\u8BD5`) : null,
|
|
6645
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "md", onClick: () => {
|
|
6165
6646
|
setDraft(null);
|
|
6166
6647
|
} }, "\u653E\u5F03")
|
|
6167
|
-
) : editing ? (0,
|
|
6648
|
+
) : editing ? (0, import_react5.createElement)(
|
|
6168
6649
|
"div",
|
|
6169
6650
|
{ style: styles.row },
|
|
6170
|
-
(0,
|
|
6651
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6171
6652
|
variant: "primary",
|
|
6172
6653
|
size: "md",
|
|
6173
6654
|
disabled: body2.trim() === "",
|
|
@@ -6176,13 +6657,13 @@ function InitPanel({ workspace, remote }) {
|
|
|
6176
6657
|
void write(body2, exists);
|
|
6177
6658
|
}
|
|
6178
6659
|
}, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
|
|
6179
|
-
(0,
|
|
6660
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "md", onClick: () => {
|
|
6180
6661
|
setEditing(false);
|
|
6181
6662
|
} }, "\u53D6\u6D88")
|
|
6182
|
-
) : (0,
|
|
6663
|
+
) : (0, import_react5.createElement)(
|
|
6183
6664
|
"div",
|
|
6184
6665
|
{ style: styles.row },
|
|
6185
|
-
(0,
|
|
6666
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6186
6667
|
variant: "primary",
|
|
6187
6668
|
size: "md",
|
|
6188
6669
|
disabled: generating,
|
|
@@ -6191,18 +6672,18 @@ function InitPanel({ workspace, remote }) {
|
|
|
6191
6672
|
void generate();
|
|
6192
6673
|
}
|
|
6193
6674
|
}, exists ? "\u91CD\u65B0\u751F\u6210 AGENTS.md" : "\u751F\u6210 AGENTS.md"),
|
|
6194
|
-
exists ? (0,
|
|
6675
|
+
exists ? (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", size: "md", onClick: startEdit }, "\u624B\u52A8\u7F16\u8F91") : null
|
|
6195
6676
|
)
|
|
6196
6677
|
)
|
|
6197
6678
|
);
|
|
6198
6679
|
}
|
|
6199
6680
|
|
|
6200
6681
|
// src/client/SkillManager.tsx
|
|
6201
|
-
var
|
|
6682
|
+
var import_react7 = require("react");
|
|
6202
6683
|
|
|
6203
6684
|
// src/client/ResourceManager.tsx
|
|
6204
|
-
var
|
|
6205
|
-
var
|
|
6685
|
+
var import_react6 = require("react");
|
|
6686
|
+
var import_dsh_client_ui_primitives5 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6206
6687
|
var labels = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
6207
6688
|
var levelOf = (row2) => row2.source === "bundled" ? "bundled" : row2.source.startsWith("user") ? "user" : "project";
|
|
6208
6689
|
var sourceText = (source) => source === "bundled" ? "\u5185\u7F6E" : source === "codex-project" ? "\u9879\u76EE \xB7 Codex" : source.startsWith("user") ? "\u4E2A\u4EBA" : "\u9879\u76EE";
|
|
@@ -6210,36 +6691,36 @@ var sizeText = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1024 * 1024 ? `$
|
|
|
6210
6691
|
var fail = (r) => describeError(r.error ?? "\u64CD\u4F5C\u5931\u8D25");
|
|
6211
6692
|
function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
6212
6693
|
const noun = kind === "skill" ? "\u6280\u80FD" : "\u89C4\u5219";
|
|
6213
|
-
const [rows, setRows] = (0,
|
|
6214
|
-
const [query, setQuery] = (0,
|
|
6215
|
-
const [filter, setFilter] = (0,
|
|
6216
|
-
const [notice, setNotice] = (0,
|
|
6217
|
-
const [error, setError] = (0,
|
|
6218
|
-
const [loading, setLoading] = (0,
|
|
6219
|
-
const [revision, refresh] = (0,
|
|
6220
|
-
const [busy, setBusy] = (0,
|
|
6221
|
-
const [roots, setRoots] = (0,
|
|
6222
|
-
const [importing, setImporting] = (0,
|
|
6223
|
-
const [request, setRequest] = (0,
|
|
6224
|
-
const [preview, setPreview] = (0,
|
|
6225
|
-
const [level, setLevel] = (0,
|
|
6226
|
-
const [manual, setManual] = (0,
|
|
6227
|
-
const [sourceDir, setSourceDir] = (0,
|
|
6228
|
-
const [dirs, setDirs] = (0,
|
|
6229
|
-
const [browsePath, setBrowsePath] = (0,
|
|
6230
|
-
const [editing, setEditing] = (0,
|
|
6231
|
-
const [viewing, setViewing] = (0,
|
|
6232
|
-
const [name, setName] = (0,
|
|
6233
|
-
const [description, setDescription] = (0,
|
|
6234
|
-
const [whenToUse, setWhenToUse] = (0,
|
|
6235
|
-
const [body2, setBody] = (0,
|
|
6236
|
-
const [templateSource, setTemplateSource] = (0,
|
|
6237
|
-
const [deleting, setDeleting] = (0,
|
|
6238
|
-
const input2 = (0,
|
|
6239
|
-
const fileEpoch = (0,
|
|
6240
|
-
const browseEpoch = (0,
|
|
6694
|
+
const [rows, setRows] = (0, import_react6.useState)([]);
|
|
6695
|
+
const [query, setQuery] = (0, import_react6.useState)("");
|
|
6696
|
+
const [filter, setFilter] = (0, import_react6.useState)("all");
|
|
6697
|
+
const [notice, setNotice] = (0, import_react6.useState)("");
|
|
6698
|
+
const [error, setError] = (0, import_react6.useState)("");
|
|
6699
|
+
const [loading, setLoading] = (0, import_react6.useState)(true);
|
|
6700
|
+
const [revision, refresh] = (0, import_react6.useState)(0);
|
|
6701
|
+
const [busy, setBusy] = (0, import_react6.useState)(false);
|
|
6702
|
+
const [roots, setRoots] = (0, import_react6.useState)(null);
|
|
6703
|
+
const [importing, setImporting] = (0, import_react6.useState)(false);
|
|
6704
|
+
const [request, setRequest] = (0, import_react6.useState)(null);
|
|
6705
|
+
const [preview, setPreview] = (0, import_react6.useState)(null);
|
|
6706
|
+
const [level, setLevel] = (0, import_react6.useState)("project");
|
|
6707
|
+
const [manual, setManual] = (0, import_react6.useState)(false);
|
|
6708
|
+
const [sourceDir, setSourceDir] = (0, import_react6.useState)("");
|
|
6709
|
+
const [dirs, setDirs] = (0, import_react6.useState)([]);
|
|
6710
|
+
const [browsePath, setBrowsePath] = (0, import_react6.useState)("");
|
|
6711
|
+
const [editing, setEditing] = (0, import_react6.useState)(null);
|
|
6712
|
+
const [viewing, setViewing] = (0, import_react6.useState)(false);
|
|
6713
|
+
const [name, setName] = (0, import_react6.useState)("");
|
|
6714
|
+
const [description, setDescription] = (0, import_react6.useState)("");
|
|
6715
|
+
const [whenToUse, setWhenToUse] = (0, import_react6.useState)("");
|
|
6716
|
+
const [body2, setBody] = (0, import_react6.useState)("");
|
|
6717
|
+
const [templateSource, setTemplateSource] = (0, import_react6.useState)(null);
|
|
6718
|
+
const [deleting, setDeleting] = (0, import_react6.useState)(null);
|
|
6719
|
+
const input2 = (0, import_react6.useRef)(null);
|
|
6720
|
+
const fileEpoch = (0, import_react6.useRef)(0);
|
|
6721
|
+
const browseEpoch = (0, import_react6.useRef)(0);
|
|
6241
6722
|
const readonly = editing !== null && editing !== "new" && (levelOf(editing) === "bundled" || editing.source === "codex-project");
|
|
6242
|
-
(0,
|
|
6723
|
+
(0, import_react6.useEffect)(() => {
|
|
6243
6724
|
let active = true;
|
|
6244
6725
|
setLoading(true);
|
|
6245
6726
|
setRows([]);
|
|
@@ -6266,7 +6747,7 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6266
6747
|
fileEpoch.current++;
|
|
6267
6748
|
};
|
|
6268
6749
|
}, [workspace, remote, kind, revision]);
|
|
6269
|
-
(0,
|
|
6750
|
+
(0, import_react6.useEffect)(() => {
|
|
6270
6751
|
let active = true;
|
|
6271
6752
|
setPreview(null);
|
|
6272
6753
|
if (!request) return;
|
|
@@ -6470,93 +6951,93 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6470
6951
|
setBusy(false);
|
|
6471
6952
|
}
|
|
6472
6953
|
};
|
|
6473
|
-
const status = () => error ? (0,
|
|
6474
|
-
const targets = () => (0,
|
|
6954
|
+
const status = () => error ? (0, import_react6.createElement)("div", { className: "te-alert", role: "alert" }, error) : null;
|
|
6955
|
+
const targets = () => (0, import_react6.createElement)(
|
|
6475
6956
|
"div",
|
|
6476
6957
|
{ className: "te-targets" },
|
|
6477
|
-
...["project", "user"].map((lvl) => (0,
|
|
6958
|
+
...["project", "user"].map((lvl) => (0, import_react6.createElement)(
|
|
6478
6959
|
"button",
|
|
6479
6960
|
{ type: "button", key: lvl, className: `te-target ${level === lvl ? "selected" : ""}`, "aria-pressed": level === lvl, disabled: busy || editing !== null && editing !== "new", onClick: () => {
|
|
6480
6961
|
setPreview(null);
|
|
6481
6962
|
setLevel(lvl);
|
|
6482
6963
|
} },
|
|
6483
|
-
(0,
|
|
6484
|
-
(0,
|
|
6964
|
+
(0, import_react6.createElement)("strong", null, lvl === "project" ? "\u9879\u76EE\u5171\u4EAB" : "\u4E2A\u4EBA\u5168\u5C40"),
|
|
6965
|
+
(0, import_react6.createElement)("small", null, lvl === "project" ? "\u4EC5\u5F53\u524D\u5DE5\u4F5C\u533A\u4F7F\u7528" : "\u6B64\u4E3B\u673A\u4E0A\u7684\u6240\u6709\u9879\u76EE\u53EF\u7528")
|
|
6485
6966
|
)),
|
|
6486
|
-
(0,
|
|
6967
|
+
(0, import_react6.createElement)("code", { className: "te-path" }, roots?.[level] ?? (level === "project" ? `${workspace}/.dsh/${kind}s` : `DSH_HOME/${kind}s`))
|
|
6487
6968
|
);
|
|
6488
6969
|
const visible = rows.filter((r) => `${r.name} ${r.description ?? ""}`.toLowerCase().includes(query.toLowerCase()) && (filter === "all" || levelOf(r) === filter));
|
|
6489
|
-
return (0,
|
|
6970
|
+
return (0, import_react6.createElement)(
|
|
6490
6971
|
"section",
|
|
6491
6972
|
{ className: "te-resource" },
|
|
6492
|
-
(0,
|
|
6973
|
+
(0, import_react6.createElement)("input", { type: "file", ref: input2, hidden: true, "aria-label": kind === "skill" ? "\u9009\u62E9\u6280\u80FD\u6587\u4EF6\u5939" : "\u9009\u62E9\u89C4\u5219\u6587\u4EF6", ...kind === "skill" ? { webkitdirectory: "", multiple: true } : { accept: ".md,text/markdown" }, onChange: (e) => {
|
|
6493
6974
|
void selected(Array.from(e.target.files ?? []));
|
|
6494
6975
|
} }),
|
|
6495
|
-
(0,
|
|
6976
|
+
(0, import_react6.createElement)("div", { className: "te-section-heading" }, (0, import_react6.createElement)("div", null, (0, import_react6.createElement)("h2", null, `${noun}\u5E93`), (0, import_react6.createElement)("p", null, kind === "skill" ? "\u628A\u53EF\u590D\u7528\u7684\u5DE5\u4F5C\u65B9\u6CD5\u5E26\u5165\u9879\u76EE\u3002" : "\u4E3A\u9879\u76EE\u660E\u786E\u7EA6\u5B9A\uFF0C\u8BA9\u6BCF\u6B21\u4EA4\u4ED8\u4FDD\u6301\u4E00\u81F4\u3002")), (0, import_react6.createElement)("div", { className: "te-actions" }, (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", onClick: () => {
|
|
6496
6977
|
void edit("new");
|
|
6497
|
-
} }, `\u65B0\u5EFA${noun}`), (0,
|
|
6498
|
-
(0,
|
|
6499
|
-
notice ? (0,
|
|
6978
|
+
} }, `\u65B0\u5EFA${noun}`), (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "primary", onClick: choose }, `\u5B89\u88C5${noun}`))),
|
|
6979
|
+
(0, import_react6.createElement)("div", { className: "te-toolbar" }, (0, import_react6.createElement)("input", { className: "te-input", placeholder: `\u641C\u7D22${noun}\u540D\u79F0${kind === "skill" ? "\u6216\u63CF\u8FF0" : ""}`, value: query, onChange: (e) => setQuery(e.target.value) }), (0, import_react6.createElement)("select", { className: "te-input", "aria-label": "\u7B5B\u9009\u6765\u6E90", value: filter, onChange: (e) => setFilter(e.target.value) }, (0, import_react6.createElement)("option", { value: "all" }, `\u5168\u90E8\u6765\u6E90 \xB7 ${rows.length}`), (0, import_react6.createElement)("option", { value: "project" }, "\u9879\u76EE"), (0, import_react6.createElement)("option", { value: "user" }, "\u4E2A\u4EBA")), (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", onClick: () => refresh((n) => n + 1), disabled: loading }, "\u5237\u65B0")),
|
|
6980
|
+
notice ? (0, import_react6.createElement)("div", { className: "te-success", role: "status" }, notice) : null,
|
|
6500
6981
|
!importing && !editing && !deleting ? status() : null,
|
|
6501
|
-
loading ? (0,
|
|
6982
|
+
loading ? (0, import_react6.createElement)("div", { className: "te-empty", role: "status" }, "\u6B63\u5728\u52A0\u8F7D\u2026") : visible.length === 0 ? (0, import_react6.createElement)("div", { className: "te-empty" }, (0, import_react6.createElement)("h3", null, query || filter !== "all" ? "\u6CA1\u6709\u5339\u914D\u7684\u7ED3\u679C" : `\u8FD8\u6CA1\u6709${noun}`), (0, import_react6.createElement)("p", null, "\u8C03\u6574\u7B5B\u9009\uFF0C\u6216\u4F7F\u7528\u53F3\u4E0A\u89D2\u6309\u94AE\u6DFB\u52A0\u3002")) : (0, import_react6.createElement)("div", { className: "te-resource-grid" }, ...visible.map((row2) => (0, import_react6.createElement)(
|
|
6502
6983
|
"article",
|
|
6503
6984
|
{ className: "te-resource-card", key: row2.source + "/" + row2.name },
|
|
6504
|
-
(0,
|
|
6505
|
-
(0,
|
|
6506
|
-
(0,
|
|
6507
|
-
(0,
|
|
6985
|
+
(0, import_react6.createElement)("div", { className: "te-card-top" }, (0, import_react6.createElement)("span", { className: "te-resource-icon", "aria-hidden": true }, kind === "skill" ? "\u25C7" : "\u2261"), (0, import_react6.createElement)("span", { className: "te-badge" }, sourceText(row2.source))),
|
|
6986
|
+
(0, import_react6.createElement)("h3", null, row2.name),
|
|
6987
|
+
(0, import_react6.createElement)("p", null, row2.description || "\u9879\u76EE\u7EA6\u5B9A\u4E0E\u6267\u884C\u89C4\u5219"),
|
|
6988
|
+
(0, import_react6.createElement)("div", { className: "te-actions" }, kind === "skill" && onConfigureSkill ? (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "primary", size: "sm", onClick: () => onConfigureSkill({ source: row2.source === "codex-project" ? "codex-project" : levelOf(row2), name: row2.name }) }, "\u914D\u7F6E\u89C4\u5219") : null, (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", size: "sm", onClick: () => {
|
|
6508
6989
|
void edit(row2, true);
|
|
6509
|
-
} }, "\u67E5\u770B"), levelOf(row2) === "bundled" ? (0,
|
|
6990
|
+
} }, "\u67E5\u770B"), levelOf(row2) === "bundled" ? (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", size: "sm", disabled: busy, onClick: () => {
|
|
6510
6991
|
void copyTemplate(row2);
|
|
6511
|
-
} }, "\u4EE5\u6B64\u4E3A\u6A21\u677F\u65B0\u5EFA") : row2.source !== "codex-project" ? (0,
|
|
6992
|
+
} }, "\u4EE5\u6B64\u4E3A\u6A21\u677F\u65B0\u5EFA") : row2.source !== "codex-project" ? (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", size: "sm", onClick: () => {
|
|
6512
6993
|
void edit(row2);
|
|
6513
|
-
} }, "\u7F16\u8F91") : null, levelOf(row2) !== "bundled" && row2.source !== "codex-project" ? (0,
|
|
6994
|
+
} }, "\u7F16\u8F91") : null, levelOf(row2) !== "bundled" && row2.source !== "codex-project" ? (0, import_react6.createElement)("button", { className: "te-delete", onClick: () => {
|
|
6514
6995
|
setDeleting(row2);
|
|
6515
6996
|
setError("");
|
|
6516
6997
|
} }, "\u5220\u9664") : null)
|
|
6517
6998
|
))),
|
|
6518
|
-
kind === "skill" ? (0,
|
|
6999
|
+
kind === "skill" ? (0, import_react6.createElement)("button", { className: "te-link", onClick: () => {
|
|
6519
7000
|
setImporting(true);
|
|
6520
7001
|
setManual(true);
|
|
6521
7002
|
setError("");
|
|
6522
7003
|
} }, "\u9AD8\u7EA7\uFF1A\u4ECE Harness \u4E3B\u673A\u8DEF\u5F84\u5B89\u88C5") : null,
|
|
6523
|
-
importing ? (0,
|
|
7004
|
+
importing ? (0, import_react6.createElement)(
|
|
6524
7005
|
ResourceModal,
|
|
6525
|
-
{ title: `\u5B89\u88C5${noun}`, description: "\u5148\u68C0\u67E5\u5185\u5BB9\u548C\u5B89\u88C5\u4F4D\u7F6E\uFF0C\u786E\u8BA4\u540E\u624D\u4F1A\u5199\u5165\u3002", onClose: close, footer: (0,
|
|
7006
|
+
{ title: `\u5B89\u88C5${noun}`, description: "\u5148\u68C0\u67E5\u5185\u5BB9\u548C\u5B89\u88C5\u4F4D\u7F6E\uFF0C\u786E\u8BA4\u540E\u624D\u4F1A\u5199\u5165\u3002", onClose: close, footer: (0, import_react6.createElement)("div", { className: "te-actions" }, (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", disabled: busy, onClick: close }, "\u53D6\u6D88"), (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "primary", disabled: busy || !preview || preview.conflict, onClick: () => {
|
|
6526
7007
|
void install();
|
|
6527
7008
|
} }, busy ? "\u5904\u7406\u4E2D\u2026" : "\u786E\u8BA4\u5B89\u88C5")) },
|
|
6528
7009
|
targets(),
|
|
6529
|
-
(0,
|
|
6530
|
-
manual ? (0,
|
|
7010
|
+
(0, import_react6.createElement)("div", { className: "te-actions" }, (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", disabled: busy, onClick: choose }, "\u91CD\u65B0\u9009\u62E9"), kind === "skill" ? (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", disabled: busy, onClick: () => setManual(!manual) }, manual ? "\u6536\u8D77\u9AD8\u7EA7\u65B9\u5F0F" : "\u4E3B\u673A\u8DEF\u5F84") : null),
|
|
7011
|
+
manual ? (0, import_react6.createElement)("div", { className: "te-advanced" }, (0, import_react6.createElement)("p", null, "\u6B64\u8DEF\u5F84\u4F4D\u4E8E Harness \u4E3B\u673A\uFF1B\u6D4F\u89C8\u5668\u9009\u62E9\u5668\u8BFB\u53D6\u7684\u662F\u4F60\u5F53\u524D\u7535\u8111\u3002"), (0, import_react6.createElement)("div", { className: "te-toolbar" }, (0, import_react6.createElement)("input", { className: "te-input", "aria-label": "\u4E3B\u673A\u6280\u80FD\u76EE\u5F55", value: sourceDir, onChange: (e) => {
|
|
6531
7012
|
setSourceDir(e.target.value);
|
|
6532
7013
|
setRequest(null);
|
|
6533
|
-
} }), (0,
|
|
7014
|
+
} }), (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", onClick: () => {
|
|
6534
7015
|
void browse(sourceDir);
|
|
6535
|
-
} }, "\u6D4F\u89C8"), (0,
|
|
7016
|
+
} }, "\u6D4F\u89C8"), (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", disabled: busy || !sourceDir.trim(), onClick: () => setRequest({ kind, level, path: workspace, files: [], sourceDir }) }, "\u9884\u89C8\u76EE\u5F55")), (0, import_react6.createElement)("div", { className: "te-dir-list" }, browsePath ? (0, import_react6.createElement)("button", { onClick: () => {
|
|
6536
7017
|
void browse(browsePath.replace(/[\\/][^\\/]+[\\/]?$/u, "") || "/");
|
|
6537
|
-
} }, "\u2191 \u4E0A\u7EA7\u76EE\u5F55") : null, ...dirs.map((d) => (0,
|
|
7018
|
+
} }, "\u2191 \u4E0A\u7EA7\u76EE\u5F55") : null, ...dirs.map((d) => (0, import_react6.createElement)("button", { key: d.name, onClick: () => {
|
|
6538
7019
|
setRequest(null);
|
|
6539
7020
|
void browse(browsePath.replace(/[\\/]+$/u, "") + "/" + d.name);
|
|
6540
7021
|
} }, d.name + (d.hasSkill ? " \xB7 SKILL.md" : ""))))) : null,
|
|
6541
|
-
busy ? (0,
|
|
7022
|
+
busy ? (0, import_react6.createElement)("p", { role: "status" }, "\u6B63\u5728\u6821\u9A8C\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u5019\u2026") : null,
|
|
6542
7023
|
status(),
|
|
6543
|
-
preview ? (0,
|
|
7024
|
+
preview ? (0, import_react6.createElement)("div", { className: "te-preview" }, (0, import_react6.createElement)("h3", null, preview.name), (0, import_react6.createElement)("p", null, preview.description), (0, import_react6.createElement)("div", { className: "te-actions" }, (0, import_react6.createElement)("span", { className: "te-badge" }, `${preview.files} \u4E2A\u6587\u4EF6`), (0, import_react6.createElement)("span", { className: "te-badge" }, sizeText(preview.bytes))), (0, import_react6.createElement)("code", { className: "te-path" }, preview.target), preview.conflict ? (0, import_react6.createElement)("div", { className: "te-alert", role: "alert" }, "\u5DF2\u6709\u540C\u540D\u8D44\u6E90\u3002\u8BF7\u53D6\u6D88\u5E76\u68C0\u67E5\u73B0\u6709\u5185\u5BB9\uFF0C\u5B89\u88C5\u4E0D\u4F1A\u8986\u76D6\u5B83\u3002") : null, (0, import_react6.createElement)("div", { className: "te-markdown" }, (0, import_react6.createElement)(import_dsh_client_ui_primitives5.MarkdownText, { text: preview.content, labels }))) : null
|
|
6544
7025
|
) : null,
|
|
6545
|
-
editing ? (0,
|
|
7026
|
+
editing ? (0, import_react6.createElement)(
|
|
6546
7027
|
ResourceModal,
|
|
6547
|
-
{ title: editing === "new" ? `\u65B0\u5EFA${noun}` : `${viewing ? "\u67E5\u770B" : "\u7F16\u8F91"}${noun} \xB7 ${name}`, onClose: close, footer: (0,
|
|
7028
|
+
{ title: editing === "new" ? `\u65B0\u5EFA${noun}` : `${viewing ? "\u67E5\u770B" : "\u7F16\u8F91"}${noun} \xB7 ${name}`, onClose: close, footer: (0, import_react6.createElement)("div", { className: "te-actions" }, (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", disabled: busy, onClick: close }, "\u5173\u95ED"), editing !== "new" && levelOf(editing) === "bundled" ? (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", disabled: busy, onClick: () => {
|
|
6548
7029
|
void copyTemplate(editing);
|
|
6549
|
-
} }, "\u4EE5\u6B64\u4E3A\u6A21\u677F\u65B0\u5EFA") : null, !readonly ? (0,
|
|
7030
|
+
} }, "\u4EE5\u6B64\u4E3A\u6A21\u677F\u65B0\u5EFA") : null, !readonly ? (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", disabled: busy, onClick: () => setViewing(!viewing) }, viewing ? "\u7F16\u8F91\u5185\u5BB9" : "\u9884\u89C8") : null, !readonly ? (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "primary", disabled: busy || !name.trim() || !body2.trim() || kind === "skill" && !description.trim(), onClick: () => {
|
|
6550
7031
|
void save();
|
|
6551
7032
|
} }, busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58") : null) },
|
|
6552
|
-
!readonly ? targets() : (0,
|
|
6553
|
-
templateSource ? (0,
|
|
7033
|
+
!readonly ? targets() : (0, import_react6.createElement)("p", { className: "te-badge" }, editing.source === "codex-project" ? "Codex \u9879\u76EE\u6280\u80FD \xB7 \u6B63\u6587\u8BF7\u5728\u539F\u76EE\u5F55\u7F16\u8F91" : "\u5185\u7F6E\u6837\u672C \xB7 \u53EA\u8BFB"),
|
|
7034
|
+
templateSource ? (0, import_react6.createElement)("p", null, `\u4EE5\u300C${templateSource.name}\u300D\u4E3A\u6A21\u677F\u590D\u5236\u6B63\u6587\u3002\u65B0\u8D44\u6E90\u7684\u5B8C\u6210\u51ED\u8BC1\u3001\u89C4\u5219\u548C\u9636\u6BB5\u7ED1\u5B9A\u9700\u5355\u72EC\u914D\u7F6E\uFF0C\u4FDD\u5B58\u672C\u8EAB\u4E0D\u4F1A\u542F\u7528\u5B83\u3002`) : null,
|
|
6554
7035
|
status(),
|
|
6555
|
-
viewing ? (0,
|
|
7036
|
+
viewing ? (0, import_react6.createElement)("div", { className: "te-markdown" }, (0, import_react6.createElement)(import_dsh_client_ui_primitives5.MarkdownText, { text: body2, labels })) : (0, import_react6.createElement)("div", { className: "te-form" }, (0, import_react6.createElement)("label", null, "\u540D\u79F0", (0, import_react6.createElement)("input", { className: "te-input", value: name, disabled: editing !== "new" || busy, onChange: (e) => setName(e.target.value), placeholder: "\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u8FDE\u5B57\u7B26" })), kind === "skill" ? (0, import_react6.createElement)("label", null, "\u63CF\u8FF0", (0, import_react6.createElement)("input", { className: "te-input", value: description, disabled: busy, onChange: (e) => setDescription(e.target.value) })) : null, kind === "skill" ? (0, import_react6.createElement)("label", null, "\u4F7F\u7528\u65F6\u673A\uFF08\u53EF\u9009\uFF09", (0, import_react6.createElement)("input", { className: "te-input", value: whenToUse, disabled: busy, onChange: (e) => setWhenToUse(e.target.value) })) : null, (0, import_react6.createElement)("label", null, "Markdown \u6B63\u6587", (0, import_react6.createElement)("textarea", { className: "te-input te-editor", value: body2, disabled: busy, onChange: (e) => setBody(e.target.value) })))
|
|
6556
7037
|
) : null,
|
|
6557
|
-
deleting ? (0,
|
|
7038
|
+
deleting ? (0, import_react6.createElement)(ResourceModal, { title: `\u5220\u9664${noun}\u300C${deleting.name}\u300D\uFF1F`, description: levelOf(deleting) === "user" ? "\u8FD9\u662F\u4E2A\u4EBA\u5168\u5C40\u8D44\u6E90\uFF0C\u5220\u9664\u4F1A\u5F71\u54CD\u6B64\u4E3B\u673A\u4E0A\u7684\u6240\u6709\u9879\u76EE\u3002" : "\u5220\u9664\u5C06\u5F71\u54CD\u5F53\u524D\u9879\u76EE\u3002", onClose: close, footer: (0, import_react6.createElement)("div", { className: "te-actions" }, (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", disabled: busy, onClick: close }, "\u4FDD\u7559"), (0, import_react6.createElement)("button", { className: "te-danger-button", disabled: busy, onClick: () => {
|
|
6558
7039
|
void remove();
|
|
6559
|
-
} }, busy ? "\u5220\u9664\u4E2D\u2026" : "\u786E\u8BA4\u6C38\u4E45\u5220\u9664")) }, (0,
|
|
7040
|
+
} }, busy ? "\u5220\u9664\u4E2D\u2026" : "\u786E\u8BA4\u6C38\u4E45\u5220\u9664")) }, (0, import_react6.createElement)("code", { className: "te-path" }, `${roots?.[levelOf(deleting) === "user" ? "user" : "project"] ?? "\u8D44\u6E90\u76EE\u5F55"}/${deleting.name}${kind === "rule" ? ".md" : ""}`), (0, import_react6.createElement)("p", null, "\u6B64\u64CD\u4F5C\u4E0D\u4F1A\u8FDB\u5165\u56DE\u6536\u7AD9\uFF0C\u8BF7\u786E\u8BA4\u5DF2\u6709\u5907\u4EFD\u3002"), status()) : null
|
|
6560
7041
|
);
|
|
6561
7042
|
}
|
|
6562
7043
|
|
|
@@ -6788,11 +7269,11 @@ function resolveFlow(flow, project) {
|
|
|
6788
7269
|
// src/client/SkillManager.tsx
|
|
6789
7270
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
6790
7271
|
function SkillManager({ workspace, remote }) {
|
|
6791
|
-
const [config, setConfig] = (0,
|
|
6792
|
-
const [rules, setRules] = (0,
|
|
6793
|
-
const [selected, setSelected] = (0,
|
|
6794
|
-
const [message, setMessage] = (0,
|
|
6795
|
-
(0,
|
|
7272
|
+
const [config, setConfig] = (0, import_react7.useState)(null);
|
|
7273
|
+
const [rules, setRules] = (0, import_react7.useState)([]);
|
|
7274
|
+
const [selected, setSelected] = (0, import_react7.useState)(null);
|
|
7275
|
+
const [message, setMessage] = (0, import_react7.useState)("");
|
|
7276
|
+
(0, import_react7.useEffect)(() => {
|
|
6796
7277
|
let active = true;
|
|
6797
7278
|
void Promise.all([remote.read(workspace), remote.listRules(workspace)]).then(([saved, availableRules]) => {
|
|
6798
7279
|
if (!active) return;
|
|
@@ -6833,7 +7314,7 @@ function SkillManager({ workspace, remote }) {
|
|
|
6833
7314
|
setMessage(`\u5DF2\u4FDD\u5B58 ${selected.name} \u7684\u89C4\u5219\u914D\u7F6E\u3002`);
|
|
6834
7315
|
setSelected(null);
|
|
6835
7316
|
};
|
|
6836
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className:
|
|
7317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "te-config-layout", children: [
|
|
6837
7318
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "te-config-main", children: [
|
|
6838
7319
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ResourceManager, { workspace, remote, kind: "skill", onConfigureSkill: config ? (ref) => {
|
|
6839
7320
|
setMessage("");
|
|
@@ -6857,14 +7338,14 @@ function SkillManager({ workspace, remote }) {
|
|
|
6857
7338
|
}
|
|
6858
7339
|
|
|
6859
7340
|
// src/client/RuleManager.tsx
|
|
6860
|
-
var
|
|
7341
|
+
var import_react8 = require("react");
|
|
6861
7342
|
function RuleManager(props) {
|
|
6862
|
-
return (0,
|
|
7343
|
+
return (0, import_react8.createElement)(ResourceManager, { ...props, key: props.workspace, kind: "rule" });
|
|
6863
7344
|
}
|
|
6864
7345
|
|
|
6865
7346
|
// src/client/TaskLedger.tsx
|
|
6866
|
-
var
|
|
6867
|
-
var
|
|
7347
|
+
var import_react9 = require("react");
|
|
7348
|
+
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6868
7349
|
var card3 = {
|
|
6869
7350
|
display: "flex",
|
|
6870
7351
|
flexDirection: "column",
|
|
@@ -6902,10 +7383,10 @@ var badge = {
|
|
|
6902
7383
|
color: "var(--dsw-alias-label-secondary)"
|
|
6903
7384
|
};
|
|
6904
7385
|
function verdictDot(outcome) {
|
|
6905
|
-
return (0,
|
|
7386
|
+
return (0, import_react9.createElement)(import_dsh_client_ui_primitives6.StateDot, { state: outcome === "pass" ? "done" : "error" });
|
|
6906
7387
|
}
|
|
6907
7388
|
function itemStatusDot(status) {
|
|
6908
|
-
return (0,
|
|
7389
|
+
return (0, import_react9.createElement)(import_dsh_client_ui_primitives6.StateDot, { state: status === "done" ? "done" : "ongoing" });
|
|
6909
7390
|
}
|
|
6910
7391
|
function timeText(at) {
|
|
6911
7392
|
return at.slice(0, 19).replace("T", " ");
|
|
@@ -6913,83 +7394,94 @@ function timeText(at) {
|
|
|
6913
7394
|
function itemAudit(item) {
|
|
6914
7395
|
const lines = [];
|
|
6915
7396
|
if (item.dispatch !== void 0) {
|
|
6916
|
-
lines.push((0,
|
|
7397
|
+
lines.push((0, import_react9.createElement)(
|
|
6917
7398
|
"div",
|
|
6918
7399
|
{ key: "dispatch", style: metaLine },
|
|
6919
|
-
(0,
|
|
6920
|
-
(0,
|
|
6921
|
-
(0,
|
|
7400
|
+
(0, import_react9.createElement)("span", { style: badge }, "\u5DF2\u5F00\u59CB"),
|
|
7401
|
+
(0, import_react9.createElement)("span", null, item.dispatch.description === "" ? "\uFF08\u65E0\u63CF\u8FF0\uFF09" : item.dispatch.description),
|
|
7402
|
+
(0, import_react9.createElement)("span", { style: badge }, timeText(item.dispatch.at))
|
|
6922
7403
|
));
|
|
6923
7404
|
}
|
|
6924
7405
|
if (item.review !== void 0) {
|
|
6925
7406
|
const spec = item.review.spec;
|
|
6926
7407
|
const quality = item.review.quality;
|
|
6927
|
-
lines.push((0,
|
|
7408
|
+
lines.push((0, import_react9.createElement)(
|
|
6928
7409
|
"div",
|
|
6929
7410
|
{ key: "review", style: metaLine },
|
|
6930
7411
|
verdictDot(spec.outcome),
|
|
6931
|
-
(0,
|
|
6932
|
-
(0,
|
|
7412
|
+
(0, import_react9.createElement)("span", null, `\u89C4\u683C\u7B26\u5408 ${spec.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`),
|
|
7413
|
+
(0, import_react9.createElement)("span", null, "\xB7"),
|
|
6933
7414
|
verdictDot(quality.outcome),
|
|
6934
|
-
(0,
|
|
7415
|
+
(0, import_react9.createElement)("span", null, `\u4EE3\u7801\u8D28\u91CF ${quality.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`)
|
|
6935
7416
|
));
|
|
6936
7417
|
const failNotes = [spec, quality].flatMap((stage) => stage.outcome === "fail" ? stage.notes ?? [] : []);
|
|
6937
7418
|
if (failNotes.length > 0) {
|
|
6938
|
-
lines.push((0,
|
|
7419
|
+
lines.push((0, import_react9.createElement)(
|
|
6939
7420
|
"div",
|
|
6940
7421
|
{ key: "notes", style: metaLine },
|
|
6941
|
-
...failNotes.map((note) => (0,
|
|
7422
|
+
...failNotes.map((note) => (0, import_react9.createElement)("span", { key: note, style: badge }, note))
|
|
6942
7423
|
));
|
|
6943
7424
|
}
|
|
6944
7425
|
}
|
|
6945
7426
|
if (lines.length === 0) {
|
|
6946
7427
|
const status = item.status === "done" ? "\u5DF2\u6807\u8BB0\u5B8C\u6210\uFF0C\u7F3A\u5C11\u5B9E\u65BD\u9879\u5BA1\u67E5\u8BB0\u5F55" : item.status === "doing" ? "\u5B9E\u65BD\u4E2D\uFF0C\u5F85\u5BA1\u67E5" : "\u5F85\u5F00\u59CB";
|
|
6947
|
-
lines.push((0,
|
|
7428
|
+
lines.push((0, import_react9.createElement)("div", { key: "none", style: metaLine }, (0, import_react9.createElement)("span", { style: badge }, status)));
|
|
6948
7429
|
}
|
|
6949
|
-
return (0,
|
|
7430
|
+
return (0, import_react9.createElement)("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, ...lines);
|
|
6950
7431
|
}
|
|
6951
7432
|
function sonarAudit(task) {
|
|
6952
7433
|
if (!task.sonar) return null;
|
|
6953
7434
|
const audit = task.sonar.audit;
|
|
6954
|
-
if (!audit) return (0,
|
|
7435
|
+
if (!audit) return (0, import_react9.createElement)("div", { style: metaLine }, "SonarQube \u5DF2\u542F\u7528\uFF0C\u5C1A\u672A\u8FD0\u884C\u4EE3\u7801\u5BA1\u6838\u3002");
|
|
6955
7436
|
const source = { "ide-local": "\u672C\u5730\u89C4\u5219\u5BA1\u6838", local: "\u672C\u673A\u4E0A\u4F20\u626B\u63CF", ci: "CI \u626B\u63CF" }[task.sonar.source] ?? task.sonar.source;
|
|
6956
7437
|
const reviewGate = audit.review_gate ?? audit.gate;
|
|
6957
7438
|
const outcome = reviewGate === "OK" ? "\u901A\u8FC7" : "\u672A\u901A\u8FC7";
|
|
6958
7439
|
const unresolved = audit.unresolved_count ?? audit.blocking_count;
|
|
6959
|
-
return (0,
|
|
7440
|
+
return (0, import_react9.createElement)(
|
|
6960
7441
|
"details",
|
|
6961
7442
|
{ style: { borderTop: "1px solid var(--dsw-alias-border-l2)", paddingTop: 8 } },
|
|
6962
|
-
(0,
|
|
7443
|
+
(0, import_react9.createElement)(
|
|
6963
7444
|
"summary",
|
|
6964
7445
|
{ style: { cursor: "pointer", fontSize: 13 } },
|
|
6965
7446
|
`\u6700\u8FD1\u4E00\u6B21 SonarQube \u5BA1\u6838\uFF1A${outcome} \xB7 \u672A\u89E3\u51B3 ${unresolved} \u6761 \xB7 \u539F\u59CB\u547D\u4E2D ${audit.blocking_count} \u6761 \xB7 ${timeText(audit.checked_at)}`
|
|
6966
7447
|
),
|
|
6967
|
-
(0,
|
|
7448
|
+
(0, import_react9.createElement)(
|
|
6968
7449
|
"p",
|
|
6969
7450
|
{ style: metaLine },
|
|
6970
7451
|
`\u6765\u6E90\uFF1A${source}\uFF1B\u5206\u6790\u76EE\u6807\uFF1A${audit.target}\uFF1B\u539F\u59CB\u7ED3\u679C\uFF1A${audit.gate}\u3002\u8FD9\u662F\u8BE5\u6B21\u5BA1\u6838\u8BB0\u5F55\uFF1B\u4EE3\u7801\u6216\u89C4\u5219\u53D8\u66F4\u540E\u9700\u91CD\u65B0\u6D4B\u8BD5\u5E76\u5BA1\u6838\u3002`
|
|
6971
7452
|
),
|
|
6972
|
-
audit.report_path ? (0,
|
|
6973
|
-
audit.scanned_files?.length ? (0,
|
|
7453
|
+
audit.report_path ? (0, import_react9.createElement)("p", { style: metaLine }, `\u5BA1\u6838\u6587\u4EF6\uFF1A${audit.report_path}`) : null,
|
|
7454
|
+
audit.scanned_files?.length ? (0, import_react9.createElement)(
|
|
6974
7455
|
"details",
|
|
6975
7456
|
null,
|
|
6976
|
-
(0,
|
|
6977
|
-
...audit.scanned_files.map((file) => (0,
|
|
7457
|
+
(0, import_react9.createElement)("summary", { style: { cursor: "pointer", fontSize: 12 } }, `\u672C\u6B21\u5206\u6790\u6587\u4EF6\uFF08${audit.scanned_files.length}\uFF09`),
|
|
7458
|
+
...audit.scanned_files.map((file) => (0, import_react9.createElement)("div", { key: file, style: metaLine }, file))
|
|
6978
7459
|
) : null,
|
|
6979
|
-
|
|
7460
|
+
audit.profile_coverage?.length ? (0, import_react9.createElement)(
|
|
7461
|
+
"details",
|
|
7462
|
+
null,
|
|
7463
|
+
(0, import_react9.createElement)("summary", { style: { cursor: "pointer", fontSize: 12 } }, "\u9879\u76EE\u89C4\u5219\u4E0E\u672C\u5730\u5206\u6790\u5668"),
|
|
7464
|
+
...audit.profile_coverage.map((profile) => (0, import_react9.createElement)(
|
|
7465
|
+
"div",
|
|
7466
|
+
{ key: profile.language, style: metaLine },
|
|
7467
|
+
`${profile.language}\uFF1A\u670D\u52A1\u7AEF\u542F\u7528 ${profile.active_rules} \u6761\u89C4\u5219\uFF1B\u672C\u5730\u5206\u6790\u5668 ${profile.analyzer}`
|
|
7468
|
+
)),
|
|
7469
|
+
(0, import_react9.createElement)("div", { style: metaLine }, "\u6B64\u5904\u663E\u793A\u8BED\u8A00\u5206\u6790\u5668\u72B6\u6001\uFF0C\u4E0D\u80FD\u8BC1\u660E\u6BCF\u6761\u670D\u52A1\u7AEF\u89C4\u5219\u90FD\u53EF\u5728\u672C\u5730\u6267\u884C\u3002")
|
|
7470
|
+
) : null,
|
|
7471
|
+
...audit.uncovered_files.map((file) => (0, import_react9.createElement)(
|
|
6980
7472
|
"div",
|
|
6981
7473
|
{ key: `uncovered-${file}`, style: metaLine },
|
|
6982
7474
|
`\u672A\u8986\u76D6\uFF1A${file}`
|
|
6983
7475
|
)),
|
|
6984
|
-
...(audit.dispositions ?? []).map((entry) => (0,
|
|
7476
|
+
...(audit.dispositions ?? []).map((entry) => (0, import_react9.createElement)(
|
|
6985
7477
|
"div",
|
|
6986
7478
|
{ key: `disposition-${entry.issue_key}`, style: metaLine },
|
|
6987
7479
|
`\u4EBA\u5DE5\u786E\u8BA4\u8BEF\u62A5\uFF1A${entry.issue_key} \xB7 ${entry.reason} \xB7 ${entry.approved_at}`
|
|
6988
7480
|
)),
|
|
6989
|
-
audit.findings.length === 0 ? (0,
|
|
7481
|
+
audit.findings.length === 0 ? (0, import_react9.createElement)("p", { style: metaLine }, "\u6CA1\u6709\u65B0\u589E\u4EE3\u7801\u95EE\u9898\u3002") : (0, import_react9.createElement)(
|
|
6990
7482
|
"div",
|
|
6991
7483
|
{ style: { display: "flex", flexDirection: "column", gap: 6 } },
|
|
6992
|
-
...audit.findings.map((finding) => (0,
|
|
7484
|
+
...audit.findings.map((finding) => (0, import_react9.createElement)(
|
|
6993
7485
|
"div",
|
|
6994
7486
|
{ key: finding.key, style: {
|
|
6995
7487
|
...itemRow,
|
|
@@ -6997,26 +7489,26 @@ function sonarAudit(task) {
|
|
|
6997
7489
|
fontSize: 12,
|
|
6998
7490
|
overflowWrap: "anywhere"
|
|
6999
7491
|
} },
|
|
7000
|
-
(0,
|
|
7492
|
+
(0, import_react9.createElement)(
|
|
7001
7493
|
"div",
|
|
7002
7494
|
{ style: headerRow },
|
|
7003
|
-
(0,
|
|
7004
|
-
(0,
|
|
7005
|
-
(0,
|
|
7495
|
+
(0, import_react9.createElement)("strong", null, finding.severity),
|
|
7496
|
+
(0, import_react9.createElement)("code", null, finding.rule),
|
|
7497
|
+
(0, import_react9.createElement)("span", null, `${finding.file}${finding.line === void 0 ? "" : `:${finding.line}`}`)
|
|
7006
7498
|
),
|
|
7007
|
-
(0,
|
|
7499
|
+
(0, import_react9.createElement)("span", null, finding.message)
|
|
7008
7500
|
))
|
|
7009
7501
|
)
|
|
7010
7502
|
);
|
|
7011
7503
|
}
|
|
7012
7504
|
function TaskLedger({ workspace, remote }) {
|
|
7013
|
-
const [tasks, setTasks] = (0,
|
|
7014
|
-
const [error, setError] = (0,
|
|
7015
|
-
const [loading, setLoading] = (0,
|
|
7016
|
-
const [query, setQuery] = (0,
|
|
7017
|
-
const [risk, setRisk] = (0,
|
|
7018
|
-
const [stage, setStage] = (0,
|
|
7019
|
-
const refresh = (0,
|
|
7505
|
+
const [tasks, setTasks] = (0, import_react9.useState)([]);
|
|
7506
|
+
const [error, setError] = (0, import_react9.useState)("");
|
|
7507
|
+
const [loading, setLoading] = (0, import_react9.useState)(true);
|
|
7508
|
+
const [query, setQuery] = (0, import_react9.useState)("");
|
|
7509
|
+
const [risk, setRisk] = (0, import_react9.useState)("all");
|
|
7510
|
+
const [stage, setStage] = (0, import_react9.useState)("all");
|
|
7511
|
+
const refresh = (0, import_react9.useCallback)(() => {
|
|
7020
7512
|
if (workspace === "") return;
|
|
7021
7513
|
setError("");
|
|
7022
7514
|
setLoading(true);
|
|
@@ -7035,59 +7527,59 @@ function TaskLedger({ workspace, remote }) {
|
|
|
7035
7527
|
if (timer !== void 0) clearTimeout(timer);
|
|
7036
7528
|
});
|
|
7037
7529
|
}, [remote, workspace]);
|
|
7038
|
-
(0,
|
|
7530
|
+
(0, import_react9.useEffect)(() => {
|
|
7039
7531
|
refresh();
|
|
7040
7532
|
}, [refresh]);
|
|
7041
7533
|
const visible = tasks.filter((task) => `${task.task_id} ${task.title} ${task.branch}`.toLowerCase().includes(query.toLowerCase()) && (risk === "all" || task.risk_level === risk) && (stage === "all" || task.stage === stage));
|
|
7042
|
-
return (0,
|
|
7534
|
+
return (0, import_react9.createElement)(
|
|
7043
7535
|
"div",
|
|
7044
7536
|
{ style: styles.section },
|
|
7045
|
-
(0,
|
|
7537
|
+
(0, import_react9.createElement)(
|
|
7046
7538
|
"div",
|
|
7047
7539
|
{ className: "te-toolbar" },
|
|
7048
|
-
(0,
|
|
7049
|
-
(0,
|
|
7050
|
-
(0,
|
|
7540
|
+
(0, import_react9.createElement)("input", { className: "te-input", placeholder: "\u641C\u7D22\u4EFB\u52A1\u3001\u6807\u9898\u6216\u5206\u652F", value: query, onChange: (e) => setQuery(e.target.value) }),
|
|
7541
|
+
(0, import_react9.createElement)("select", { className: "te-input", "aria-label": "\u98CE\u9669\u7B5B\u9009", value: risk, onChange: (e) => setRisk(e.target.value) }, (0, import_react9.createElement)("option", { value: "all" }, "\u5168\u90E8\u98CE\u9669"), (0, import_react9.createElement)("option", { value: "standard" }, "\u6807\u51C6"), (0, import_react9.createElement)("option", { value: "high_risk" }, "\u9AD8\u98CE\u9669")),
|
|
7542
|
+
(0, import_react9.createElement)("select", { className: "te-input", "aria-label": "\u9636\u6BB5\u7B5B\u9009", value: stage, onChange: (e) => setStage(e.target.value) }, (0, import_react9.createElement)("option", { value: "all" }, "\u5168\u90E8\u9636\u6BB5"), ...Array.from(new Set(tasks.map((t) => t.stage))).map((value) => (0, import_react9.createElement)("option", { key: value, value }, value)))
|
|
7051
7543
|
),
|
|
7052
|
-
(0,
|
|
7544
|
+
(0, import_react9.createElement)(
|
|
7053
7545
|
"div",
|
|
7054
7546
|
{ style: headerRow },
|
|
7055
|
-
(0,
|
|
7056
|
-
(0,
|
|
7057
|
-
(0,
|
|
7547
|
+
(0, import_react9.createElement)("span", { style: styles.bindingLabel }, "\u4EFB\u52A1\u53F0\u8D26"),
|
|
7548
|
+
(0, import_react9.createElement)("span", { style: styles.sourceBadge }, "\u53EA\u8BFB \xB7 \u6765\u81EA .dsh/task-*.json"),
|
|
7549
|
+
(0, import_react9.createElement)(import_dsh_client_ui_primitives6.Button, { variant: "outline", size: "sm", disabled: loading, onClick: refresh }, loading ? "\u8BFB\u53D6\u4E2D\u2026" : "\u5237\u65B0")
|
|
7058
7550
|
),
|
|
7059
|
-
loading ? (0,
|
|
7551
|
+
loading ? (0, import_react9.createElement)("p", { role: "status" }, "\u6B63\u5728\u8BFB\u53D6\u4EFB\u52A1\u2026") : error !== "" ? (0, import_react9.createElement)("p", { style: styles.status }, error) : tasks.length === 0 ? (0, import_react9.createElement)("p", { style: styles.muted }, "\u5F53\u524D\u5DE5\u4F5C\u533A\u8FD8\u6CA1\u6709\u4EFB\u52A1\uFF1A\u5F00\u5DE5\u540E\uFF08dev_task create\uFF09\u4F1A\u5728\u8FD9\u91CC\u5217\u51FA\u5B9E\u65BD\u4E0E\u5BA1\u67E5\u8BB0\u5F55\u3002") : visible.length === 0 ? (0, import_react9.createElement)("div", { className: "te-empty" }, "\u6CA1\u6709\u5339\u914D\u7684\u4EFB\u52A1\uFF0C\u8BF7\u8C03\u6574\u7B5B\u9009\u3002") : (0, import_react9.createElement)(
|
|
7060
7552
|
"div",
|
|
7061
7553
|
{ style: { display: "flex", flexDirection: "column", gap: 12 } },
|
|
7062
|
-
...visible.map((task) => (0,
|
|
7554
|
+
...visible.map((task) => (0, import_react9.createElement)(
|
|
7063
7555
|
"div",
|
|
7064
7556
|
{ key: task.task_id, style: card3 },
|
|
7065
|
-
(0,
|
|
7557
|
+
(0, import_react9.createElement)(
|
|
7066
7558
|
"div",
|
|
7067
7559
|
{ style: headerRow },
|
|
7068
|
-
(0,
|
|
7069
|
-
(0,
|
|
7070
|
-
(0,
|
|
7071
|
-
task.complexity ? (0,
|
|
7072
|
-
(0,
|
|
7073
|
-
(0,
|
|
7074
|
-
(0,
|
|
7075
|
-
(0,
|
|
7076
|
-
task.updated_at ? (0,
|
|
7560
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 14, fontWeight: 600, color: "var(--dsw-alias-label-primary)" } }, task.task_id),
|
|
7561
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } }, task.title),
|
|
7562
|
+
(0, import_react9.createElement)("span", { style: badge }, task.stage),
|
|
7563
|
+
task.complexity ? (0, import_react9.createElement)("span", { style: badge }, `\u590D\u6742\u5EA6\uFF1A${{ low: "\u4F4E", medium: "\u4E2D", high: "\u9AD8", ultra: "\u8D85\u9AD8" }[task.complexity] ?? task.complexity}`) : null,
|
|
7564
|
+
(0, import_react9.createElement)("span", { style: badge }, task.branch),
|
|
7565
|
+
(0, import_react9.createElement)("span", { className: "te-badge", style: task.risk_level === "high_risk" ? { color: "var(--dsw-alias-state-error-primary)" } : {} }, task.risk_level === "high_risk" ? "\u9AD8\u98CE\u9669" : "\u6807\u51C6"),
|
|
7566
|
+
(0, import_react9.createElement)("span", { className: "te-badge" }, task.verification_passed ? "\u9A8C\u8BC1\u901A\u8FC7" : "\u5F85\u9A8C\u8BC1"),
|
|
7567
|
+
(0, import_react9.createElement)("span", { className: "te-badge" }, `\u5BA1\u6838\uFF1A${task.review_outcome ?? "pending"}`),
|
|
7568
|
+
task.updated_at ? (0, import_react9.createElement)("span", { style: metaLine }, "\u66F4\u65B0\u4E8E " + timeText(task.updated_at)) : null
|
|
7077
7569
|
),
|
|
7078
7570
|
sonarAudit(task),
|
|
7079
|
-
(0,
|
|
7571
|
+
(0, import_react9.createElement)(
|
|
7080
7572
|
"div",
|
|
7081
7573
|
{ style: { display: "flex", flexDirection: "column" } },
|
|
7082
|
-
...task.items.map((item) => (0,
|
|
7574
|
+
...task.items.map((item) => (0, import_react9.createElement)(
|
|
7083
7575
|
"div",
|
|
7084
7576
|
{ key: item.id, style: itemRow },
|
|
7085
|
-
(0,
|
|
7577
|
+
(0, import_react9.createElement)(
|
|
7086
7578
|
"div",
|
|
7087
7579
|
{ style: headerRow },
|
|
7088
7580
|
itemStatusDot(item.status),
|
|
7089
|
-
(0,
|
|
7090
|
-
(0,
|
|
7581
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } }, item.id),
|
|
7582
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 12, color: "var(--dsw-alias-label-secondary)" } }, item.title)
|
|
7091
7583
|
),
|
|
7092
7584
|
itemAudit(item)
|
|
7093
7585
|
))
|
|
@@ -7161,29 +7653,29 @@ var TABS = [
|
|
|
7161
7653
|
function Workbench({ useStore, actions, useWorkspaces, remote }) {
|
|
7162
7654
|
const open = useStore((s) => s.open);
|
|
7163
7655
|
const workspaces = useWorkspaces((s) => s.items);
|
|
7164
|
-
const [tab, setTab] = (0,
|
|
7165
|
-
const [workspace, setWorkspace] = (0,
|
|
7656
|
+
const [tab, setTab] = (0, import_react10.useState)("adaptive");
|
|
7657
|
+
const [workspace, setWorkspace] = (0, import_react10.useState)("");
|
|
7166
7658
|
if (!open) return null;
|
|
7167
7659
|
const current = workspaces.some((w) => w.path === workspace) ? workspace : workspaces[0]?.path ?? "";
|
|
7168
|
-
return (0,
|
|
7660
|
+
return (0, import_react10.createElement)(
|
|
7169
7661
|
"div",
|
|
7170
7662
|
{ style: overlay, className: "te-workbench" },
|
|
7171
|
-
(0,
|
|
7172
|
-
(0,
|
|
7663
|
+
(0, import_react10.createElement)("style", null, workbenchTheme),
|
|
7664
|
+
(0, import_react10.createElement)(
|
|
7173
7665
|
"div",
|
|
7174
7666
|
{ style: header },
|
|
7175
|
-
(0,
|
|
7667
|
+
(0, import_react10.createElement)(
|
|
7176
7668
|
"div",
|
|
7177
7669
|
{ style: headerBrand },
|
|
7178
|
-
(0,
|
|
7179
|
-
(0,
|
|
7670
|
+
(0, import_react10.createElement)(IconSettings, { size: 18 }),
|
|
7671
|
+
(0, import_react10.createElement)(
|
|
7180
7672
|
"div",
|
|
7181
7673
|
{ style: headerText },
|
|
7182
|
-
(0,
|
|
7183
|
-
(0,
|
|
7674
|
+
(0, import_react10.createElement)("span", { style: headerTitle }, "\u5DE5\u7A0B\u4EFB\u52A1"),
|
|
7675
|
+
(0, import_react10.createElement)("p", { style: headerSub }, "\u6309\u9700\u6C42\u590D\u6742\u5EA6\u9009\u62E9\u4EFB\u52A1\u6D41\u7A0B \xB7 \u5143\u6280\u80FD\u6302\u8F7D\u9879\u76EE Skill \u4E0E Rule")
|
|
7184
7676
|
)
|
|
7185
7677
|
),
|
|
7186
|
-
(0,
|
|
7678
|
+
(0, import_react10.createElement)(
|
|
7187
7679
|
"button",
|
|
7188
7680
|
{
|
|
7189
7681
|
type: "button",
|
|
@@ -7199,43 +7691,43 @@ function Workbench({ useStore, actions, useWorkspaces, remote }) {
|
|
|
7199
7691
|
event.currentTarget.style.background = "transparent";
|
|
7200
7692
|
}
|
|
7201
7693
|
},
|
|
7202
|
-
(0,
|
|
7694
|
+
(0, import_react10.createElement)(IconClose, { size: 16 })
|
|
7203
7695
|
)
|
|
7204
7696
|
),
|
|
7205
|
-
(0,
|
|
7697
|
+
(0, import_react10.createElement)(
|
|
7206
7698
|
"div",
|
|
7207
7699
|
{ style: tabbar },
|
|
7208
|
-
...TABS.map((t) => (0,
|
|
7700
|
+
...TABS.map((t) => (0, import_react10.createElement)(import_dsh_client_ui_primitives7.Pill, { key: t.id, active: tab === t.id, onClick: () => {
|
|
7209
7701
|
setTab(t.id);
|
|
7210
7702
|
} }, t.label)),
|
|
7211
|
-
workspaces.length > 0 ? (0,
|
|
7703
|
+
workspaces.length > 0 ? (0, import_react10.createElement)("select", {
|
|
7212
7704
|
style: selectStyle,
|
|
7213
7705
|
"aria-label": "\u5F53\u524D\u5DE5\u4F5C\u533A",
|
|
7214
7706
|
value: current,
|
|
7215
7707
|
onChange: (ev) => {
|
|
7216
7708
|
setWorkspace(ev.target.value);
|
|
7217
7709
|
}
|
|
7218
|
-
}, ...workspaces.map((w) => (0,
|
|
7710
|
+
}, ...workspaces.map((w) => (0, import_react10.createElement)("option", { key: w.path, value: w.path }, w.title || w.path))) : null
|
|
7219
7711
|
),
|
|
7220
|
-
(0,
|
|
7712
|
+
(0, import_react10.createElement)(
|
|
7221
7713
|
"div",
|
|
7222
7714
|
{ style: body },
|
|
7223
|
-
(0,
|
|
7715
|
+
(0, import_react10.createElement)(
|
|
7224
7716
|
"div",
|
|
7225
7717
|
{ className: "te-content", key: current },
|
|
7226
|
-
(0,
|
|
7227
|
-
current === "" ? (0,
|
|
7718
|
+
(0, import_react10.createElement)("p", { style: { ...styles.hint, marginBottom: 10 }, title: current }, "\u5DE5\u4F5C\u533A \xB7 " + current),
|
|
7719
|
+
current === "" ? (0, import_react10.createElement)("p", { style: styles.muted }, "\u5F53\u524D\u6CA1\u6709\u5DE5\u4F5C\u533A\uFF1A\u8BF7\u5148\u5728\u4FA7\u680F\u521B\u5EFA\u4E00\u4E2A\u5DE5\u4F5C\u533A\u3002") : tab === "init" ? (0, import_react10.createElement)(InitPanel, { workspace: current, remote }) : tab === "adaptive" ? (0, import_react10.createElement)(AdaptivePanel, { workspace: current, remote, onOpenInit: () => setTab("init") }) : tab === "tasks" ? (0, import_react10.createElement)(TaskLedger, { workspace: current, remote }) : tab === "skills" ? (0, import_react10.createElement)(SkillManager, { workspace: current, remote }) : (0, import_react10.createElement)(RuleManager, { workspace: current, remote })
|
|
7228
7720
|
)
|
|
7229
7721
|
)
|
|
7230
7722
|
);
|
|
7231
7723
|
}
|
|
7232
7724
|
|
|
7233
7725
|
// src/client/TriggerButton.tsx
|
|
7234
|
-
var
|
|
7726
|
+
var import_react11 = require("react");
|
|
7235
7727
|
var hover = "var(--dsw-alias-bg-layer-2)";
|
|
7236
7728
|
var label2 = "var(--dsw-alias-label-primary)";
|
|
7237
7729
|
function TriggerButton({ wide, actions }) {
|
|
7238
|
-
return (0,
|
|
7730
|
+
return (0, import_react11.createElement)(
|
|
7239
7731
|
"button",
|
|
7240
7732
|
{
|
|
7241
7733
|
type: "button",
|
|
@@ -7275,8 +7767,8 @@ function TriggerButton({ wide, actions }) {
|
|
|
7275
7767
|
transition: "background 120ms ease"
|
|
7276
7768
|
}
|
|
7277
7769
|
},
|
|
7278
|
-
(0,
|
|
7279
|
-
wide ? (0,
|
|
7770
|
+
(0, import_react11.createElement)(IconSettings, { size: wide ? 16 : 18 }),
|
|
7771
|
+
wide ? (0, import_react11.createElement)("span", { style: { fontSize: 14, lineHeight: "22px" } }, "\u5DE5\u7A0B\u6D41\u7A0B") : null
|
|
7280
7772
|
);
|
|
7281
7773
|
}
|
|
7282
7774
|
|