@godv61/dsh-task-engine 0.27.1 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.acceptance.mjs +11 -11
- package/.adaptive-test.mjs +189 -0
- package/.assessment-batch1.mjs +14 -14
- package/.codex-project-test.mjs +80 -80
- package/.enforce-test.mjs +12 -12
- package/.evidence-test.mjs +8 -8
- package/.filter-test.mjs +6 -6
- package/.freeze-test.mjs +44 -44
- package/.hook-test.mjs +19 -2
- package/.p0-test.mjs +21 -21
- package/.preset-test.mjs +11 -1
- package/.revision-test.mjs +16 -16
- package/.roundtrip-test.mjs +247 -247
- package/.workflow-test.mjs +122 -120
- package/README.md +33 -27
- package/cordis.patch.yml +158 -9
- package/docs/CHANGELOG.md +44 -30
- package/docs/README.md +6 -5
- package/docs/adaptive-workflows.md +72 -0
- package/docs/configuration.md +25 -25
- package/docs/development.md +1 -1
- package/docs/faq.md +14 -6
- package/docs/getting-started.md +8 -5
- package/docs/manual-legacy.html +380 -0
- package/docs/manual.html +124 -378
- package/docs/resource-install.md +5 -5
- package/docs/roadmap.md +8 -9
- package/hooks/commit-msg +39 -22
- package/lib/adaptive.d.ts +15 -0
- package/lib/adaptive.js +54 -0
- package/lib/adaptive.js.map +1 -0
- package/lib/client.js +719 -433
- package/lib/client.js.map +3 -3
- package/lib/controller.d.ts +50 -0
- package/lib/controller.js +132 -0
- package/lib/controller.js.map +1 -1
- package/lib/dev-task.js +413 -18
- package/lib/dev-task.js.map +1 -1
- package/lib/engine.d.ts +20 -0
- package/lib/engine.js +4 -1
- package/lib/engine.js.map +1 -1
- package/lib/hook.js +50 -29
- package/lib/hook.js.map +1 -1
- package/lib/project-init.d.ts +23 -0
- package/lib/project-init.js +94 -0
- package/lib/project-init.js.map +1 -0
- package/lib/skill-audit.js +8 -7
- package/lib/skill-audit.js.map +1 -1
- package/lib/sonar.d.ts +33 -0
- package/lib/sonar.js +80 -0
- package/lib/sonar.js.map +1 -0
- package/package.json +15 -16
- package/preset/agent.cordis.yml +3 -3
- package/preset/enable.mjs +2 -2
- package/preset/persona.md +4 -2
- package/scripts/verify-package.mjs +9 -5
- package/skills/architecture-design/SKILL.md +11 -0
- package/skills/code-development/SKILL.md +11 -0
- package/skills/code-review/SKILL.md +11 -0
- package/skills/eng-delivery/SKILL.md +19 -15
- package/skills/requirements-analysis/SKILL.md +11 -0
- package/skills/task-orchestration/SKILL.md +11 -0
- package/skills/test-validation/SKILL.md +11 -0
package/lib/client.js
CHANGED
|
@@ -38,7 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(index_exports);
|
|
40
40
|
|
|
41
|
-
// node_modules/zod/v3/external.js
|
|
41
|
+
// ../../dsharness/task-en/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
|
-
// node_modules/zod/v3/helpers/util.js
|
|
153
|
+
// ../../dsharness/task-en/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
|
-
// node_modules/zod/v3/ZodError.js
|
|
287
|
+
// ../../dsharness/task-en/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
|
-
// node_modules/zod/v3/locales/en.js
|
|
405
|
+
// ../../dsharness/task-en/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
|
-
// node_modules/zod/v3/errors.js
|
|
508
|
+
// ../../dsharness/task-en/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
|
-
// node_modules/zod/v3/helpers/parseUtil.js
|
|
517
|
+
// ../../dsharness/task-en/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
|
-
// node_modules/zod/v3/helpers/errorUtil.js
|
|
627
|
+
// ../../dsharness/task-en/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
|
-
// node_modules/zod/v3/types.js
|
|
634
|
+
// ../../dsharness/task-en/node_modules/zod/v3/types.js
|
|
635
635
|
var ParseInputLazyPath = class {
|
|
636
636
|
constructor(parent, value, path, key) {
|
|
637
637
|
this._cachedPath = [];
|
|
@@ -697,41 +697,41 @@ var ZodType = class {
|
|
|
697
697
|
get description() {
|
|
698
698
|
return this._def.description;
|
|
699
699
|
}
|
|
700
|
-
_getType(
|
|
701
|
-
return getParsedType(
|
|
700
|
+
_getType(input2) {
|
|
701
|
+
return getParsedType(input2.data);
|
|
702
702
|
}
|
|
703
|
-
_getOrReturnCtx(
|
|
703
|
+
_getOrReturnCtx(input2, ctx) {
|
|
704
704
|
return ctx || {
|
|
705
|
-
common:
|
|
706
|
-
data:
|
|
707
|
-
parsedType: getParsedType(
|
|
705
|
+
common: input2.parent.common,
|
|
706
|
+
data: input2.data,
|
|
707
|
+
parsedType: getParsedType(input2.data),
|
|
708
708
|
schemaErrorMap: this._def.errorMap,
|
|
709
|
-
path:
|
|
710
|
-
parent:
|
|
709
|
+
path: input2.path,
|
|
710
|
+
parent: input2.parent
|
|
711
711
|
};
|
|
712
712
|
}
|
|
713
|
-
_processInputParams(
|
|
713
|
+
_processInputParams(input2) {
|
|
714
714
|
return {
|
|
715
715
|
status: new ParseStatus(),
|
|
716
716
|
ctx: {
|
|
717
|
-
common:
|
|
718
|
-
data:
|
|
719
|
-
parsedType: getParsedType(
|
|
717
|
+
common: input2.parent.common,
|
|
718
|
+
data: input2.data,
|
|
719
|
+
parsedType: getParsedType(input2.data),
|
|
720
720
|
schemaErrorMap: this._def.errorMap,
|
|
721
|
-
path:
|
|
722
|
-
parent:
|
|
721
|
+
path: input2.path,
|
|
722
|
+
parent: input2.parent
|
|
723
723
|
}
|
|
724
724
|
};
|
|
725
725
|
}
|
|
726
|
-
_parseSync(
|
|
727
|
-
const result = this._parse(
|
|
726
|
+
_parseSync(input2) {
|
|
727
|
+
const result = this._parse(input2);
|
|
728
728
|
if (isAsync(result)) {
|
|
729
729
|
throw new Error("Synchronous parse encountered promise.");
|
|
730
730
|
}
|
|
731
731
|
return result;
|
|
732
732
|
}
|
|
733
|
-
_parseAsync(
|
|
734
|
-
const result = this._parse(
|
|
733
|
+
_parseAsync(input2) {
|
|
734
|
+
const result = this._parse(input2);
|
|
735
735
|
return Promise.resolve(result);
|
|
736
736
|
}
|
|
737
737
|
parse(data, params) {
|
|
@@ -1057,13 +1057,13 @@ function isValidCidr(ip, version) {
|
|
|
1057
1057
|
return false;
|
|
1058
1058
|
}
|
|
1059
1059
|
var ZodString = class _ZodString extends ZodType {
|
|
1060
|
-
_parse(
|
|
1060
|
+
_parse(input2) {
|
|
1061
1061
|
if (this._def.coerce) {
|
|
1062
|
-
|
|
1062
|
+
input2.data = String(input2.data);
|
|
1063
1063
|
}
|
|
1064
|
-
const parsedType = this._getType(
|
|
1064
|
+
const parsedType = this._getType(input2);
|
|
1065
1065
|
if (parsedType !== ZodParsedType.string) {
|
|
1066
|
-
const ctx2 = this._getOrReturnCtx(
|
|
1066
|
+
const ctx2 = this._getOrReturnCtx(input2);
|
|
1067
1067
|
addIssueToContext(ctx2, {
|
|
1068
1068
|
code: ZodIssueCode.invalid_type,
|
|
1069
1069
|
expected: ZodParsedType.string,
|
|
@@ -1075,8 +1075,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1075
1075
|
let ctx = void 0;
|
|
1076
1076
|
for (const check of this._def.checks) {
|
|
1077
1077
|
if (check.kind === "min") {
|
|
1078
|
-
if (
|
|
1079
|
-
ctx = this._getOrReturnCtx(
|
|
1078
|
+
if (input2.data.length < check.value) {
|
|
1079
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1080
1080
|
addIssueToContext(ctx, {
|
|
1081
1081
|
code: ZodIssueCode.too_small,
|
|
1082
1082
|
minimum: check.value,
|
|
@@ -1088,8 +1088,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1088
1088
|
status.dirty();
|
|
1089
1089
|
}
|
|
1090
1090
|
} else if (check.kind === "max") {
|
|
1091
|
-
if (
|
|
1092
|
-
ctx = this._getOrReturnCtx(
|
|
1091
|
+
if (input2.data.length > check.value) {
|
|
1092
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1093
1093
|
addIssueToContext(ctx, {
|
|
1094
1094
|
code: ZodIssueCode.too_big,
|
|
1095
1095
|
maximum: check.value,
|
|
@@ -1101,10 +1101,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1101
1101
|
status.dirty();
|
|
1102
1102
|
}
|
|
1103
1103
|
} else if (check.kind === "length") {
|
|
1104
|
-
const tooBig =
|
|
1105
|
-
const tooSmall =
|
|
1104
|
+
const tooBig = input2.data.length > check.value;
|
|
1105
|
+
const tooSmall = input2.data.length < check.value;
|
|
1106
1106
|
if (tooBig || tooSmall) {
|
|
1107
|
-
ctx = this._getOrReturnCtx(
|
|
1107
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1108
1108
|
if (tooBig) {
|
|
1109
1109
|
addIssueToContext(ctx, {
|
|
1110
1110
|
code: ZodIssueCode.too_big,
|
|
@@ -1127,8 +1127,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1127
1127
|
status.dirty();
|
|
1128
1128
|
}
|
|
1129
1129
|
} else if (check.kind === "email") {
|
|
1130
|
-
if (!emailRegex.test(
|
|
1131
|
-
ctx = this._getOrReturnCtx(
|
|
1130
|
+
if (!emailRegex.test(input2.data)) {
|
|
1131
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1132
1132
|
addIssueToContext(ctx, {
|
|
1133
1133
|
validation: "email",
|
|
1134
1134
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1140,8 +1140,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1140
1140
|
if (!emojiRegex) {
|
|
1141
1141
|
emojiRegex = new RegExp(_emojiRegex, "u");
|
|
1142
1142
|
}
|
|
1143
|
-
if (!emojiRegex.test(
|
|
1144
|
-
ctx = this._getOrReturnCtx(
|
|
1143
|
+
if (!emojiRegex.test(input2.data)) {
|
|
1144
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1145
1145
|
addIssueToContext(ctx, {
|
|
1146
1146
|
validation: "emoji",
|
|
1147
1147
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1150,8 +1150,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1150
1150
|
status.dirty();
|
|
1151
1151
|
}
|
|
1152
1152
|
} else if (check.kind === "uuid") {
|
|
1153
|
-
if (!uuidRegex.test(
|
|
1154
|
-
ctx = this._getOrReturnCtx(
|
|
1153
|
+
if (!uuidRegex.test(input2.data)) {
|
|
1154
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1155
1155
|
addIssueToContext(ctx, {
|
|
1156
1156
|
validation: "uuid",
|
|
1157
1157
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1160,8 +1160,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1160
1160
|
status.dirty();
|
|
1161
1161
|
}
|
|
1162
1162
|
} else if (check.kind === "nanoid") {
|
|
1163
|
-
if (!nanoidRegex.test(
|
|
1164
|
-
ctx = this._getOrReturnCtx(
|
|
1163
|
+
if (!nanoidRegex.test(input2.data)) {
|
|
1164
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1165
1165
|
addIssueToContext(ctx, {
|
|
1166
1166
|
validation: "nanoid",
|
|
1167
1167
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1170,8 +1170,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1170
1170
|
status.dirty();
|
|
1171
1171
|
}
|
|
1172
1172
|
} else if (check.kind === "cuid") {
|
|
1173
|
-
if (!cuidRegex.test(
|
|
1174
|
-
ctx = this._getOrReturnCtx(
|
|
1173
|
+
if (!cuidRegex.test(input2.data)) {
|
|
1174
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1175
1175
|
addIssueToContext(ctx, {
|
|
1176
1176
|
validation: "cuid",
|
|
1177
1177
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1180,8 +1180,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1180
1180
|
status.dirty();
|
|
1181
1181
|
}
|
|
1182
1182
|
} else if (check.kind === "cuid2") {
|
|
1183
|
-
if (!cuid2Regex.test(
|
|
1184
|
-
ctx = this._getOrReturnCtx(
|
|
1183
|
+
if (!cuid2Regex.test(input2.data)) {
|
|
1184
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1185
1185
|
addIssueToContext(ctx, {
|
|
1186
1186
|
validation: "cuid2",
|
|
1187
1187
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1190,8 +1190,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1190
1190
|
status.dirty();
|
|
1191
1191
|
}
|
|
1192
1192
|
} else if (check.kind === "ulid") {
|
|
1193
|
-
if (!ulidRegex.test(
|
|
1194
|
-
ctx = this._getOrReturnCtx(
|
|
1193
|
+
if (!ulidRegex.test(input2.data)) {
|
|
1194
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1195
1195
|
addIssueToContext(ctx, {
|
|
1196
1196
|
validation: "ulid",
|
|
1197
1197
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1201,9 +1201,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
} else if (check.kind === "url") {
|
|
1203
1203
|
try {
|
|
1204
|
-
new URL(
|
|
1204
|
+
new URL(input2.data);
|
|
1205
1205
|
} catch {
|
|
1206
|
-
ctx = this._getOrReturnCtx(
|
|
1206
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1207
1207
|
addIssueToContext(ctx, {
|
|
1208
1208
|
validation: "url",
|
|
1209
1209
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1213,9 +1213,9 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1213
1213
|
}
|
|
1214
1214
|
} else if (check.kind === "regex") {
|
|
1215
1215
|
check.regex.lastIndex = 0;
|
|
1216
|
-
const testResult = check.regex.test(
|
|
1216
|
+
const testResult = check.regex.test(input2.data);
|
|
1217
1217
|
if (!testResult) {
|
|
1218
|
-
ctx = this._getOrReturnCtx(
|
|
1218
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1219
1219
|
addIssueToContext(ctx, {
|
|
1220
1220
|
validation: "regex",
|
|
1221
1221
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1224,10 +1224,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1224
1224
|
status.dirty();
|
|
1225
1225
|
}
|
|
1226
1226
|
} else if (check.kind === "trim") {
|
|
1227
|
-
|
|
1227
|
+
input2.data = input2.data.trim();
|
|
1228
1228
|
} else if (check.kind === "includes") {
|
|
1229
|
-
if (!
|
|
1230
|
-
ctx = this._getOrReturnCtx(
|
|
1229
|
+
if (!input2.data.includes(check.value, check.position)) {
|
|
1230
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1231
1231
|
addIssueToContext(ctx, {
|
|
1232
1232
|
code: ZodIssueCode.invalid_string,
|
|
1233
1233
|
validation: { includes: check.value, position: check.position },
|
|
@@ -1236,12 +1236,12 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1236
1236
|
status.dirty();
|
|
1237
1237
|
}
|
|
1238
1238
|
} else if (check.kind === "toLowerCase") {
|
|
1239
|
-
|
|
1239
|
+
input2.data = input2.data.toLowerCase();
|
|
1240
1240
|
} else if (check.kind === "toUpperCase") {
|
|
1241
|
-
|
|
1241
|
+
input2.data = input2.data.toUpperCase();
|
|
1242
1242
|
} else if (check.kind === "startsWith") {
|
|
1243
|
-
if (!
|
|
1244
|
-
ctx = this._getOrReturnCtx(
|
|
1243
|
+
if (!input2.data.startsWith(check.value)) {
|
|
1244
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1245
1245
|
addIssueToContext(ctx, {
|
|
1246
1246
|
code: ZodIssueCode.invalid_string,
|
|
1247
1247
|
validation: { startsWith: check.value },
|
|
@@ -1250,8 +1250,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1250
1250
|
status.dirty();
|
|
1251
1251
|
}
|
|
1252
1252
|
} else if (check.kind === "endsWith") {
|
|
1253
|
-
if (!
|
|
1254
|
-
ctx = this._getOrReturnCtx(
|
|
1253
|
+
if (!input2.data.endsWith(check.value)) {
|
|
1254
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1255
1255
|
addIssueToContext(ctx, {
|
|
1256
1256
|
code: ZodIssueCode.invalid_string,
|
|
1257
1257
|
validation: { endsWith: check.value },
|
|
@@ -1261,8 +1261,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1261
1261
|
}
|
|
1262
1262
|
} else if (check.kind === "datetime") {
|
|
1263
1263
|
const regex = datetimeRegex(check);
|
|
1264
|
-
if (!regex.test(
|
|
1265
|
-
ctx = this._getOrReturnCtx(
|
|
1264
|
+
if (!regex.test(input2.data)) {
|
|
1265
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1266
1266
|
addIssueToContext(ctx, {
|
|
1267
1267
|
code: ZodIssueCode.invalid_string,
|
|
1268
1268
|
validation: "datetime",
|
|
@@ -1272,8 +1272,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
} else if (check.kind === "date") {
|
|
1274
1274
|
const regex = dateRegex;
|
|
1275
|
-
if (!regex.test(
|
|
1276
|
-
ctx = this._getOrReturnCtx(
|
|
1275
|
+
if (!regex.test(input2.data)) {
|
|
1276
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1277
1277
|
addIssueToContext(ctx, {
|
|
1278
1278
|
code: ZodIssueCode.invalid_string,
|
|
1279
1279
|
validation: "date",
|
|
@@ -1283,8 +1283,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
} else if (check.kind === "time") {
|
|
1285
1285
|
const regex = timeRegex(check);
|
|
1286
|
-
if (!regex.test(
|
|
1287
|
-
ctx = this._getOrReturnCtx(
|
|
1286
|
+
if (!regex.test(input2.data)) {
|
|
1287
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1288
1288
|
addIssueToContext(ctx, {
|
|
1289
1289
|
code: ZodIssueCode.invalid_string,
|
|
1290
1290
|
validation: "time",
|
|
@@ -1293,8 +1293,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1293
1293
|
status.dirty();
|
|
1294
1294
|
}
|
|
1295
1295
|
} else if (check.kind === "duration") {
|
|
1296
|
-
if (!durationRegex.test(
|
|
1297
|
-
ctx = this._getOrReturnCtx(
|
|
1296
|
+
if (!durationRegex.test(input2.data)) {
|
|
1297
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1298
1298
|
addIssueToContext(ctx, {
|
|
1299
1299
|
validation: "duration",
|
|
1300
1300
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1303,8 +1303,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1303
1303
|
status.dirty();
|
|
1304
1304
|
}
|
|
1305
1305
|
} else if (check.kind === "ip") {
|
|
1306
|
-
if (!isValidIP(
|
|
1307
|
-
ctx = this._getOrReturnCtx(
|
|
1306
|
+
if (!isValidIP(input2.data, check.version)) {
|
|
1307
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1308
1308
|
addIssueToContext(ctx, {
|
|
1309
1309
|
validation: "ip",
|
|
1310
1310
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1313,8 +1313,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1313
1313
|
status.dirty();
|
|
1314
1314
|
}
|
|
1315
1315
|
} else if (check.kind === "jwt") {
|
|
1316
|
-
if (!isValidJWT(
|
|
1317
|
-
ctx = this._getOrReturnCtx(
|
|
1316
|
+
if (!isValidJWT(input2.data, check.alg)) {
|
|
1317
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1318
1318
|
addIssueToContext(ctx, {
|
|
1319
1319
|
validation: "jwt",
|
|
1320
1320
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1323,8 +1323,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1323
1323
|
status.dirty();
|
|
1324
1324
|
}
|
|
1325
1325
|
} else if (check.kind === "cidr") {
|
|
1326
|
-
if (!isValidCidr(
|
|
1327
|
-
ctx = this._getOrReturnCtx(
|
|
1326
|
+
if (!isValidCidr(input2.data, check.version)) {
|
|
1327
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1328
1328
|
addIssueToContext(ctx, {
|
|
1329
1329
|
validation: "cidr",
|
|
1330
1330
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1333,8 +1333,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1333
1333
|
status.dirty();
|
|
1334
1334
|
}
|
|
1335
1335
|
} else if (check.kind === "base64") {
|
|
1336
|
-
if (!base64Regex.test(
|
|
1337
|
-
ctx = this._getOrReturnCtx(
|
|
1336
|
+
if (!base64Regex.test(input2.data)) {
|
|
1337
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1338
1338
|
addIssueToContext(ctx, {
|
|
1339
1339
|
validation: "base64",
|
|
1340
1340
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1343,8 +1343,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1343
1343
|
status.dirty();
|
|
1344
1344
|
}
|
|
1345
1345
|
} else if (check.kind === "base64url") {
|
|
1346
|
-
if (!base64urlRegex.test(
|
|
1347
|
-
ctx = this._getOrReturnCtx(
|
|
1346
|
+
if (!base64urlRegex.test(input2.data)) {
|
|
1347
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1348
1348
|
addIssueToContext(ctx, {
|
|
1349
1349
|
validation: "base64url",
|
|
1350
1350
|
code: ZodIssueCode.invalid_string,
|
|
@@ -1356,7 +1356,7 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
1356
1356
|
util.assertNever(check);
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
|
-
return { status: status.value, value:
|
|
1359
|
+
return { status: status.value, value: input2.data };
|
|
1360
1360
|
}
|
|
1361
1361
|
_regex(regex, validation, message) {
|
|
1362
1362
|
return this.refinement((data) => regex.test(data), {
|
|
@@ -1617,13 +1617,13 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
1617
1617
|
this.max = this.lte;
|
|
1618
1618
|
this.step = this.multipleOf;
|
|
1619
1619
|
}
|
|
1620
|
-
_parse(
|
|
1620
|
+
_parse(input2) {
|
|
1621
1621
|
if (this._def.coerce) {
|
|
1622
|
-
|
|
1622
|
+
input2.data = Number(input2.data);
|
|
1623
1623
|
}
|
|
1624
|
-
const parsedType = this._getType(
|
|
1624
|
+
const parsedType = this._getType(input2);
|
|
1625
1625
|
if (parsedType !== ZodParsedType.number) {
|
|
1626
|
-
const ctx2 = this._getOrReturnCtx(
|
|
1626
|
+
const ctx2 = this._getOrReturnCtx(input2);
|
|
1627
1627
|
addIssueToContext(ctx2, {
|
|
1628
1628
|
code: ZodIssueCode.invalid_type,
|
|
1629
1629
|
expected: ZodParsedType.number,
|
|
@@ -1635,8 +1635,8 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
1635
1635
|
const status = new ParseStatus();
|
|
1636
1636
|
for (const check of this._def.checks) {
|
|
1637
1637
|
if (check.kind === "int") {
|
|
1638
|
-
if (!util.isInteger(
|
|
1639
|
-
ctx = this._getOrReturnCtx(
|
|
1638
|
+
if (!util.isInteger(input2.data)) {
|
|
1639
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1640
1640
|
addIssueToContext(ctx, {
|
|
1641
1641
|
code: ZodIssueCode.invalid_type,
|
|
1642
1642
|
expected: "integer",
|
|
@@ -1646,9 +1646,9 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
1646
1646
|
status.dirty();
|
|
1647
1647
|
}
|
|
1648
1648
|
} else if (check.kind === "min") {
|
|
1649
|
-
const tooSmall = check.inclusive ?
|
|
1649
|
+
const tooSmall = check.inclusive ? input2.data < check.value : input2.data <= check.value;
|
|
1650
1650
|
if (tooSmall) {
|
|
1651
|
-
ctx = this._getOrReturnCtx(
|
|
1651
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1652
1652
|
addIssueToContext(ctx, {
|
|
1653
1653
|
code: ZodIssueCode.too_small,
|
|
1654
1654
|
minimum: check.value,
|
|
@@ -1660,9 +1660,9 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
1660
1660
|
status.dirty();
|
|
1661
1661
|
}
|
|
1662
1662
|
} else if (check.kind === "max") {
|
|
1663
|
-
const tooBig = check.inclusive ?
|
|
1663
|
+
const tooBig = check.inclusive ? input2.data > check.value : input2.data >= check.value;
|
|
1664
1664
|
if (tooBig) {
|
|
1665
|
-
ctx = this._getOrReturnCtx(
|
|
1665
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1666
1666
|
addIssueToContext(ctx, {
|
|
1667
1667
|
code: ZodIssueCode.too_big,
|
|
1668
1668
|
maximum: check.value,
|
|
@@ -1674,8 +1674,8 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
1674
1674
|
status.dirty();
|
|
1675
1675
|
}
|
|
1676
1676
|
} else if (check.kind === "multipleOf") {
|
|
1677
|
-
if (floatSafeRemainder(
|
|
1678
|
-
ctx = this._getOrReturnCtx(
|
|
1677
|
+
if (floatSafeRemainder(input2.data, check.value) !== 0) {
|
|
1678
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1679
1679
|
addIssueToContext(ctx, {
|
|
1680
1680
|
code: ZodIssueCode.not_multiple_of,
|
|
1681
1681
|
multipleOf: check.value,
|
|
@@ -1684,8 +1684,8 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
1684
1684
|
status.dirty();
|
|
1685
1685
|
}
|
|
1686
1686
|
} else if (check.kind === "finite") {
|
|
1687
|
-
if (!Number.isFinite(
|
|
1688
|
-
ctx = this._getOrReturnCtx(
|
|
1687
|
+
if (!Number.isFinite(input2.data)) {
|
|
1688
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1689
1689
|
addIssueToContext(ctx, {
|
|
1690
1690
|
code: ZodIssueCode.not_finite,
|
|
1691
1691
|
message: check.message
|
|
@@ -1696,7 +1696,7 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
1696
1696
|
util.assertNever(check);
|
|
1697
1697
|
}
|
|
1698
1698
|
}
|
|
1699
|
-
return { status: status.value, value:
|
|
1699
|
+
return { status: status.value, value: input2.data };
|
|
1700
1700
|
}
|
|
1701
1701
|
gte(value, message) {
|
|
1702
1702
|
return this.setLimit("min", value, true, errorUtil.toString(message));
|
|
@@ -1848,25 +1848,25 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
1848
1848
|
this.min = this.gte;
|
|
1849
1849
|
this.max = this.lte;
|
|
1850
1850
|
}
|
|
1851
|
-
_parse(
|
|
1851
|
+
_parse(input2) {
|
|
1852
1852
|
if (this._def.coerce) {
|
|
1853
1853
|
try {
|
|
1854
|
-
|
|
1854
|
+
input2.data = BigInt(input2.data);
|
|
1855
1855
|
} catch {
|
|
1856
|
-
return this._getInvalidInput(
|
|
1856
|
+
return this._getInvalidInput(input2);
|
|
1857
1857
|
}
|
|
1858
1858
|
}
|
|
1859
|
-
const parsedType = this._getType(
|
|
1859
|
+
const parsedType = this._getType(input2);
|
|
1860
1860
|
if (parsedType !== ZodParsedType.bigint) {
|
|
1861
|
-
return this._getInvalidInput(
|
|
1861
|
+
return this._getInvalidInput(input2);
|
|
1862
1862
|
}
|
|
1863
1863
|
let ctx = void 0;
|
|
1864
1864
|
const status = new ParseStatus();
|
|
1865
1865
|
for (const check of this._def.checks) {
|
|
1866
1866
|
if (check.kind === "min") {
|
|
1867
|
-
const tooSmall = check.inclusive ?
|
|
1867
|
+
const tooSmall = check.inclusive ? input2.data < check.value : input2.data <= check.value;
|
|
1868
1868
|
if (tooSmall) {
|
|
1869
|
-
ctx = this._getOrReturnCtx(
|
|
1869
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1870
1870
|
addIssueToContext(ctx, {
|
|
1871
1871
|
code: ZodIssueCode.too_small,
|
|
1872
1872
|
type: "bigint",
|
|
@@ -1877,9 +1877,9 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
1877
1877
|
status.dirty();
|
|
1878
1878
|
}
|
|
1879
1879
|
} else if (check.kind === "max") {
|
|
1880
|
-
const tooBig = check.inclusive ?
|
|
1880
|
+
const tooBig = check.inclusive ? input2.data > check.value : input2.data >= check.value;
|
|
1881
1881
|
if (tooBig) {
|
|
1882
|
-
ctx = this._getOrReturnCtx(
|
|
1882
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1883
1883
|
addIssueToContext(ctx, {
|
|
1884
1884
|
code: ZodIssueCode.too_big,
|
|
1885
1885
|
type: "bigint",
|
|
@@ -1890,8 +1890,8 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
1890
1890
|
status.dirty();
|
|
1891
1891
|
}
|
|
1892
1892
|
} else if (check.kind === "multipleOf") {
|
|
1893
|
-
if (
|
|
1894
|
-
ctx = this._getOrReturnCtx(
|
|
1893
|
+
if (input2.data % check.value !== BigInt(0)) {
|
|
1894
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
1895
1895
|
addIssueToContext(ctx, {
|
|
1896
1896
|
code: ZodIssueCode.not_multiple_of,
|
|
1897
1897
|
multipleOf: check.value,
|
|
@@ -1903,10 +1903,10 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
1903
1903
|
util.assertNever(check);
|
|
1904
1904
|
}
|
|
1905
1905
|
}
|
|
1906
|
-
return { status: status.value, value:
|
|
1906
|
+
return { status: status.value, value: input2.data };
|
|
1907
1907
|
}
|
|
1908
|
-
_getInvalidInput(
|
|
1909
|
-
const ctx = this._getOrReturnCtx(
|
|
1908
|
+
_getInvalidInput(input2) {
|
|
1909
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
1910
1910
|
addIssueToContext(ctx, {
|
|
1911
1911
|
code: ZodIssueCode.invalid_type,
|
|
1912
1912
|
expected: ZodParsedType.bigint,
|
|
@@ -2015,13 +2015,13 @@ ZodBigInt.create = (params) => {
|
|
|
2015
2015
|
});
|
|
2016
2016
|
};
|
|
2017
2017
|
var ZodBoolean = class extends ZodType {
|
|
2018
|
-
_parse(
|
|
2018
|
+
_parse(input2) {
|
|
2019
2019
|
if (this._def.coerce) {
|
|
2020
|
-
|
|
2020
|
+
input2.data = Boolean(input2.data);
|
|
2021
2021
|
}
|
|
2022
|
-
const parsedType = this._getType(
|
|
2022
|
+
const parsedType = this._getType(input2);
|
|
2023
2023
|
if (parsedType !== ZodParsedType.boolean) {
|
|
2024
|
-
const ctx = this._getOrReturnCtx(
|
|
2024
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
2025
2025
|
addIssueToContext(ctx, {
|
|
2026
2026
|
code: ZodIssueCode.invalid_type,
|
|
2027
2027
|
expected: ZodParsedType.boolean,
|
|
@@ -2029,7 +2029,7 @@ var ZodBoolean = class extends ZodType {
|
|
|
2029
2029
|
});
|
|
2030
2030
|
return INVALID;
|
|
2031
2031
|
}
|
|
2032
|
-
return OK(
|
|
2032
|
+
return OK(input2.data);
|
|
2033
2033
|
}
|
|
2034
2034
|
};
|
|
2035
2035
|
ZodBoolean.create = (params) => {
|
|
@@ -2040,13 +2040,13 @@ ZodBoolean.create = (params) => {
|
|
|
2040
2040
|
});
|
|
2041
2041
|
};
|
|
2042
2042
|
var ZodDate = class _ZodDate extends ZodType {
|
|
2043
|
-
_parse(
|
|
2043
|
+
_parse(input2) {
|
|
2044
2044
|
if (this._def.coerce) {
|
|
2045
|
-
|
|
2045
|
+
input2.data = new Date(input2.data);
|
|
2046
2046
|
}
|
|
2047
|
-
const parsedType = this._getType(
|
|
2047
|
+
const parsedType = this._getType(input2);
|
|
2048
2048
|
if (parsedType !== ZodParsedType.date) {
|
|
2049
|
-
const ctx2 = this._getOrReturnCtx(
|
|
2049
|
+
const ctx2 = this._getOrReturnCtx(input2);
|
|
2050
2050
|
addIssueToContext(ctx2, {
|
|
2051
2051
|
code: ZodIssueCode.invalid_type,
|
|
2052
2052
|
expected: ZodParsedType.date,
|
|
@@ -2054,8 +2054,8 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
2054
2054
|
});
|
|
2055
2055
|
return INVALID;
|
|
2056
2056
|
}
|
|
2057
|
-
if (Number.isNaN(
|
|
2058
|
-
const ctx2 = this._getOrReturnCtx(
|
|
2057
|
+
if (Number.isNaN(input2.data.getTime())) {
|
|
2058
|
+
const ctx2 = this._getOrReturnCtx(input2);
|
|
2059
2059
|
addIssueToContext(ctx2, {
|
|
2060
2060
|
code: ZodIssueCode.invalid_date
|
|
2061
2061
|
});
|
|
@@ -2065,8 +2065,8 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
2065
2065
|
let ctx = void 0;
|
|
2066
2066
|
for (const check of this._def.checks) {
|
|
2067
2067
|
if (check.kind === "min") {
|
|
2068
|
-
if (
|
|
2069
|
-
ctx = this._getOrReturnCtx(
|
|
2068
|
+
if (input2.data.getTime() < check.value) {
|
|
2069
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
2070
2070
|
addIssueToContext(ctx, {
|
|
2071
2071
|
code: ZodIssueCode.too_small,
|
|
2072
2072
|
message: check.message,
|
|
@@ -2078,8 +2078,8 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
2078
2078
|
status.dirty();
|
|
2079
2079
|
}
|
|
2080
2080
|
} else if (check.kind === "max") {
|
|
2081
|
-
if (
|
|
2082
|
-
ctx = this._getOrReturnCtx(
|
|
2081
|
+
if (input2.data.getTime() > check.value) {
|
|
2082
|
+
ctx = this._getOrReturnCtx(input2, ctx);
|
|
2083
2083
|
addIssueToContext(ctx, {
|
|
2084
2084
|
code: ZodIssueCode.too_big,
|
|
2085
2085
|
message: check.message,
|
|
@@ -2096,7 +2096,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
2096
2096
|
}
|
|
2097
2097
|
return {
|
|
2098
2098
|
status: status.value,
|
|
2099
|
-
value: new Date(
|
|
2099
|
+
value: new Date(input2.data.getTime())
|
|
2100
2100
|
};
|
|
2101
2101
|
}
|
|
2102
2102
|
_addCheck(check) {
|
|
@@ -2149,10 +2149,10 @@ ZodDate.create = (params) => {
|
|
|
2149
2149
|
});
|
|
2150
2150
|
};
|
|
2151
2151
|
var ZodSymbol = class extends ZodType {
|
|
2152
|
-
_parse(
|
|
2153
|
-
const parsedType = this._getType(
|
|
2152
|
+
_parse(input2) {
|
|
2153
|
+
const parsedType = this._getType(input2);
|
|
2154
2154
|
if (parsedType !== ZodParsedType.symbol) {
|
|
2155
|
-
const ctx = this._getOrReturnCtx(
|
|
2155
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
2156
2156
|
addIssueToContext(ctx, {
|
|
2157
2157
|
code: ZodIssueCode.invalid_type,
|
|
2158
2158
|
expected: ZodParsedType.symbol,
|
|
@@ -2160,7 +2160,7 @@ var ZodSymbol = class extends ZodType {
|
|
|
2160
2160
|
});
|
|
2161
2161
|
return INVALID;
|
|
2162
2162
|
}
|
|
2163
|
-
return OK(
|
|
2163
|
+
return OK(input2.data);
|
|
2164
2164
|
}
|
|
2165
2165
|
};
|
|
2166
2166
|
ZodSymbol.create = (params) => {
|
|
@@ -2170,10 +2170,10 @@ ZodSymbol.create = (params) => {
|
|
|
2170
2170
|
});
|
|
2171
2171
|
};
|
|
2172
2172
|
var ZodUndefined = class extends ZodType {
|
|
2173
|
-
_parse(
|
|
2174
|
-
const parsedType = this._getType(
|
|
2173
|
+
_parse(input2) {
|
|
2174
|
+
const parsedType = this._getType(input2);
|
|
2175
2175
|
if (parsedType !== ZodParsedType.undefined) {
|
|
2176
|
-
const ctx = this._getOrReturnCtx(
|
|
2176
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
2177
2177
|
addIssueToContext(ctx, {
|
|
2178
2178
|
code: ZodIssueCode.invalid_type,
|
|
2179
2179
|
expected: ZodParsedType.undefined,
|
|
@@ -2181,7 +2181,7 @@ var ZodUndefined = class extends ZodType {
|
|
|
2181
2181
|
});
|
|
2182
2182
|
return INVALID;
|
|
2183
2183
|
}
|
|
2184
|
-
return OK(
|
|
2184
|
+
return OK(input2.data);
|
|
2185
2185
|
}
|
|
2186
2186
|
};
|
|
2187
2187
|
ZodUndefined.create = (params) => {
|
|
@@ -2191,10 +2191,10 @@ ZodUndefined.create = (params) => {
|
|
|
2191
2191
|
});
|
|
2192
2192
|
};
|
|
2193
2193
|
var ZodNull = class extends ZodType {
|
|
2194
|
-
_parse(
|
|
2195
|
-
const parsedType = this._getType(
|
|
2194
|
+
_parse(input2) {
|
|
2195
|
+
const parsedType = this._getType(input2);
|
|
2196
2196
|
if (parsedType !== ZodParsedType.null) {
|
|
2197
|
-
const ctx = this._getOrReturnCtx(
|
|
2197
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
2198
2198
|
addIssueToContext(ctx, {
|
|
2199
2199
|
code: ZodIssueCode.invalid_type,
|
|
2200
2200
|
expected: ZodParsedType.null,
|
|
@@ -2202,7 +2202,7 @@ var ZodNull = class extends ZodType {
|
|
|
2202
2202
|
});
|
|
2203
2203
|
return INVALID;
|
|
2204
2204
|
}
|
|
2205
|
-
return OK(
|
|
2205
|
+
return OK(input2.data);
|
|
2206
2206
|
}
|
|
2207
2207
|
};
|
|
2208
2208
|
ZodNull.create = (params) => {
|
|
@@ -2216,8 +2216,8 @@ var ZodAny = class extends ZodType {
|
|
|
2216
2216
|
super(...arguments);
|
|
2217
2217
|
this._any = true;
|
|
2218
2218
|
}
|
|
2219
|
-
_parse(
|
|
2220
|
-
return OK(
|
|
2219
|
+
_parse(input2) {
|
|
2220
|
+
return OK(input2.data);
|
|
2221
2221
|
}
|
|
2222
2222
|
};
|
|
2223
2223
|
ZodAny.create = (params) => {
|
|
@@ -2231,8 +2231,8 @@ var ZodUnknown = class extends ZodType {
|
|
|
2231
2231
|
super(...arguments);
|
|
2232
2232
|
this._unknown = true;
|
|
2233
2233
|
}
|
|
2234
|
-
_parse(
|
|
2235
|
-
return OK(
|
|
2234
|
+
_parse(input2) {
|
|
2235
|
+
return OK(input2.data);
|
|
2236
2236
|
}
|
|
2237
2237
|
};
|
|
2238
2238
|
ZodUnknown.create = (params) => {
|
|
@@ -2242,8 +2242,8 @@ ZodUnknown.create = (params) => {
|
|
|
2242
2242
|
});
|
|
2243
2243
|
};
|
|
2244
2244
|
var ZodNever = class extends ZodType {
|
|
2245
|
-
_parse(
|
|
2246
|
-
const ctx = this._getOrReturnCtx(
|
|
2245
|
+
_parse(input2) {
|
|
2246
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
2247
2247
|
addIssueToContext(ctx, {
|
|
2248
2248
|
code: ZodIssueCode.invalid_type,
|
|
2249
2249
|
expected: ZodParsedType.never,
|
|
@@ -2259,10 +2259,10 @@ ZodNever.create = (params) => {
|
|
|
2259
2259
|
});
|
|
2260
2260
|
};
|
|
2261
2261
|
var ZodVoid = class extends ZodType {
|
|
2262
|
-
_parse(
|
|
2263
|
-
const parsedType = this._getType(
|
|
2262
|
+
_parse(input2) {
|
|
2263
|
+
const parsedType = this._getType(input2);
|
|
2264
2264
|
if (parsedType !== ZodParsedType.undefined) {
|
|
2265
|
-
const ctx = this._getOrReturnCtx(
|
|
2265
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
2266
2266
|
addIssueToContext(ctx, {
|
|
2267
2267
|
code: ZodIssueCode.invalid_type,
|
|
2268
2268
|
expected: ZodParsedType.void,
|
|
@@ -2270,7 +2270,7 @@ var ZodVoid = class extends ZodType {
|
|
|
2270
2270
|
});
|
|
2271
2271
|
return INVALID;
|
|
2272
2272
|
}
|
|
2273
|
-
return OK(
|
|
2273
|
+
return OK(input2.data);
|
|
2274
2274
|
}
|
|
2275
2275
|
};
|
|
2276
2276
|
ZodVoid.create = (params) => {
|
|
@@ -2280,8 +2280,8 @@ ZodVoid.create = (params) => {
|
|
|
2280
2280
|
});
|
|
2281
2281
|
};
|
|
2282
2282
|
var ZodArray = class _ZodArray extends ZodType {
|
|
2283
|
-
_parse(
|
|
2284
|
-
const { ctx, status } = this._processInputParams(
|
|
2283
|
+
_parse(input2) {
|
|
2284
|
+
const { ctx, status } = this._processInputParams(input2);
|
|
2285
2285
|
const def = this._def;
|
|
2286
2286
|
if (ctx.parsedType !== ZodParsedType.array) {
|
|
2287
2287
|
addIssueToContext(ctx, {
|
|
@@ -2421,10 +2421,10 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
2421
2421
|
this._cached = { shape, keys };
|
|
2422
2422
|
return this._cached;
|
|
2423
2423
|
}
|
|
2424
|
-
_parse(
|
|
2425
|
-
const parsedType = this._getType(
|
|
2424
|
+
_parse(input2) {
|
|
2425
|
+
const parsedType = this._getType(input2);
|
|
2426
2426
|
if (parsedType !== ZodParsedType.object) {
|
|
2427
|
-
const ctx2 = this._getOrReturnCtx(
|
|
2427
|
+
const ctx2 = this._getOrReturnCtx(input2);
|
|
2428
2428
|
addIssueToContext(ctx2, {
|
|
2429
2429
|
code: ZodIssueCode.invalid_type,
|
|
2430
2430
|
expected: ZodParsedType.object,
|
|
@@ -2432,7 +2432,7 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
2432
2432
|
});
|
|
2433
2433
|
return INVALID;
|
|
2434
2434
|
}
|
|
2435
|
-
const { status, ctx } = this._processInputParams(
|
|
2435
|
+
const { status, ctx } = this._processInputParams(input2);
|
|
2436
2436
|
const { shape, keys: shapeKeys } = this._getCached();
|
|
2437
2437
|
const extraKeys = [];
|
|
2438
2438
|
if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
|
|
@@ -2745,8 +2745,8 @@ ZodObject.lazycreate = (shape, params) => {
|
|
|
2745
2745
|
});
|
|
2746
2746
|
};
|
|
2747
2747
|
var ZodUnion = class extends ZodType {
|
|
2748
|
-
_parse(
|
|
2749
|
-
const { ctx } = this._processInputParams(
|
|
2748
|
+
_parse(input2) {
|
|
2749
|
+
const { ctx } = this._processInputParams(input2);
|
|
2750
2750
|
const options = this._def.options;
|
|
2751
2751
|
function handleResults(results) {
|
|
2752
2752
|
for (const result of results) {
|
|
@@ -2867,8 +2867,8 @@ var getDiscriminator = (type) => {
|
|
|
2867
2867
|
}
|
|
2868
2868
|
};
|
|
2869
2869
|
var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
|
|
2870
|
-
_parse(
|
|
2871
|
-
const { ctx } = this._processInputParams(
|
|
2870
|
+
_parse(input2) {
|
|
2871
|
+
const { ctx } = this._processInputParams(input2);
|
|
2872
2872
|
if (ctx.parsedType !== ZodParsedType.object) {
|
|
2873
2873
|
addIssueToContext(ctx, {
|
|
2874
2874
|
code: ZodIssueCode.invalid_type,
|
|
@@ -2981,8 +2981,8 @@ function mergeValues(a, b) {
|
|
|
2981
2981
|
}
|
|
2982
2982
|
}
|
|
2983
2983
|
var ZodIntersection = class extends ZodType {
|
|
2984
|
-
_parse(
|
|
2985
|
-
const { status, ctx } = this._processInputParams(
|
|
2984
|
+
_parse(input2) {
|
|
2985
|
+
const { status, ctx } = this._processInputParams(input2);
|
|
2986
2986
|
const handleParsed = (parsedLeft, parsedRight) => {
|
|
2987
2987
|
if (isAborted(parsedLeft) || isAborted(parsedRight)) {
|
|
2988
2988
|
return INVALID;
|
|
@@ -3034,8 +3034,8 @@ ZodIntersection.create = (left, right, params) => {
|
|
|
3034
3034
|
});
|
|
3035
3035
|
};
|
|
3036
3036
|
var ZodTuple = class _ZodTuple extends ZodType {
|
|
3037
|
-
_parse(
|
|
3038
|
-
const { status, ctx } = this._processInputParams(
|
|
3037
|
+
_parse(input2) {
|
|
3038
|
+
const { status, ctx } = this._processInputParams(input2);
|
|
3039
3039
|
if (ctx.parsedType !== ZodParsedType.array) {
|
|
3040
3040
|
addIssueToContext(ctx, {
|
|
3041
3041
|
code: ZodIssueCode.invalid_type,
|
|
@@ -3107,8 +3107,8 @@ var ZodRecord = class _ZodRecord extends ZodType {
|
|
|
3107
3107
|
get valueSchema() {
|
|
3108
3108
|
return this._def.valueType;
|
|
3109
3109
|
}
|
|
3110
|
-
_parse(
|
|
3111
|
-
const { status, ctx } = this._processInputParams(
|
|
3110
|
+
_parse(input2) {
|
|
3111
|
+
const { status, ctx } = this._processInputParams(input2);
|
|
3112
3112
|
if (ctx.parsedType !== ZodParsedType.object) {
|
|
3113
3113
|
addIssueToContext(ctx, {
|
|
3114
3114
|
code: ZodIssueCode.invalid_type,
|
|
@@ -3160,8 +3160,8 @@ var ZodMap = class extends ZodType {
|
|
|
3160
3160
|
get valueSchema() {
|
|
3161
3161
|
return this._def.valueType;
|
|
3162
3162
|
}
|
|
3163
|
-
_parse(
|
|
3164
|
-
const { status, ctx } = this._processInputParams(
|
|
3163
|
+
_parse(input2) {
|
|
3164
|
+
const { status, ctx } = this._processInputParams(input2);
|
|
3165
3165
|
if (ctx.parsedType !== ZodParsedType.map) {
|
|
3166
3166
|
addIssueToContext(ctx, {
|
|
3167
3167
|
code: ZodIssueCode.invalid_type,
|
|
@@ -3220,8 +3220,8 @@ ZodMap.create = (keyType, valueType, params) => {
|
|
|
3220
3220
|
});
|
|
3221
3221
|
};
|
|
3222
3222
|
var ZodSet = class _ZodSet extends ZodType {
|
|
3223
|
-
_parse(
|
|
3224
|
-
const { status, ctx } = this._processInputParams(
|
|
3223
|
+
_parse(input2) {
|
|
3224
|
+
const { status, ctx } = this._processInputParams(input2);
|
|
3225
3225
|
if (ctx.parsedType !== ZodParsedType.set) {
|
|
3226
3226
|
addIssueToContext(ctx, {
|
|
3227
3227
|
code: ZodIssueCode.invalid_type,
|
|
@@ -3309,8 +3309,8 @@ var ZodFunction = class _ZodFunction extends ZodType {
|
|
|
3309
3309
|
super(...arguments);
|
|
3310
3310
|
this.validate = this.implement;
|
|
3311
3311
|
}
|
|
3312
|
-
_parse(
|
|
3313
|
-
const { ctx } = this._processInputParams(
|
|
3312
|
+
_parse(input2) {
|
|
3313
|
+
const { ctx } = this._processInputParams(input2);
|
|
3314
3314
|
if (ctx.parsedType !== ZodParsedType.function) {
|
|
3315
3315
|
addIssueToContext(ctx, {
|
|
3316
3316
|
code: ZodIssueCode.invalid_type,
|
|
@@ -3413,8 +3413,8 @@ var ZodLazy = class extends ZodType {
|
|
|
3413
3413
|
get schema() {
|
|
3414
3414
|
return this._def.getter();
|
|
3415
3415
|
}
|
|
3416
|
-
_parse(
|
|
3417
|
-
const { ctx } = this._processInputParams(
|
|
3416
|
+
_parse(input2) {
|
|
3417
|
+
const { ctx } = this._processInputParams(input2);
|
|
3418
3418
|
const lazySchema = this._def.getter();
|
|
3419
3419
|
return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
|
|
3420
3420
|
}
|
|
@@ -3427,9 +3427,9 @@ ZodLazy.create = (getter, params) => {
|
|
|
3427
3427
|
});
|
|
3428
3428
|
};
|
|
3429
3429
|
var ZodLiteral = class extends ZodType {
|
|
3430
|
-
_parse(
|
|
3431
|
-
if (
|
|
3432
|
-
const ctx = this._getOrReturnCtx(
|
|
3430
|
+
_parse(input2) {
|
|
3431
|
+
if (input2.data !== this._def.value) {
|
|
3432
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
3433
3433
|
addIssueToContext(ctx, {
|
|
3434
3434
|
received: ctx.data,
|
|
3435
3435
|
code: ZodIssueCode.invalid_literal,
|
|
@@ -3437,7 +3437,7 @@ var ZodLiteral = class extends ZodType {
|
|
|
3437
3437
|
});
|
|
3438
3438
|
return INVALID;
|
|
3439
3439
|
}
|
|
3440
|
-
return { status: "valid", value:
|
|
3440
|
+
return { status: "valid", value: input2.data };
|
|
3441
3441
|
}
|
|
3442
3442
|
get value() {
|
|
3443
3443
|
return this._def.value;
|
|
@@ -3458,9 +3458,9 @@ function createZodEnum(values, params) {
|
|
|
3458
3458
|
});
|
|
3459
3459
|
}
|
|
3460
3460
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
3461
|
-
_parse(
|
|
3462
|
-
if (typeof
|
|
3463
|
-
const ctx = this._getOrReturnCtx(
|
|
3461
|
+
_parse(input2) {
|
|
3462
|
+
if (typeof input2.data !== "string") {
|
|
3463
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
3464
3464
|
const expectedValues = this._def.values;
|
|
3465
3465
|
addIssueToContext(ctx, {
|
|
3466
3466
|
expected: util.joinValues(expectedValues),
|
|
@@ -3472,8 +3472,8 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
3472
3472
|
if (!this._cache) {
|
|
3473
3473
|
this._cache = new Set(this._def.values);
|
|
3474
3474
|
}
|
|
3475
|
-
if (!this._cache.has(
|
|
3476
|
-
const ctx = this._getOrReturnCtx(
|
|
3475
|
+
if (!this._cache.has(input2.data)) {
|
|
3476
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
3477
3477
|
const expectedValues = this._def.values;
|
|
3478
3478
|
addIssueToContext(ctx, {
|
|
3479
3479
|
received: ctx.data,
|
|
@@ -3482,7 +3482,7 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
3482
3482
|
});
|
|
3483
3483
|
return INVALID;
|
|
3484
3484
|
}
|
|
3485
|
-
return OK(
|
|
3485
|
+
return OK(input2.data);
|
|
3486
3486
|
}
|
|
3487
3487
|
get options() {
|
|
3488
3488
|
return this._def.values;
|
|
@@ -3523,9 +3523,9 @@ var ZodEnum = class _ZodEnum extends ZodType {
|
|
|
3523
3523
|
};
|
|
3524
3524
|
ZodEnum.create = createZodEnum;
|
|
3525
3525
|
var ZodNativeEnum = class extends ZodType {
|
|
3526
|
-
_parse(
|
|
3526
|
+
_parse(input2) {
|
|
3527
3527
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
3528
|
-
const ctx = this._getOrReturnCtx(
|
|
3528
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
3529
3529
|
if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {
|
|
3530
3530
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
3531
3531
|
addIssueToContext(ctx, {
|
|
@@ -3538,7 +3538,7 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
3538
3538
|
if (!this._cache) {
|
|
3539
3539
|
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
3540
3540
|
}
|
|
3541
|
-
if (!this._cache.has(
|
|
3541
|
+
if (!this._cache.has(input2.data)) {
|
|
3542
3542
|
const expectedValues = util.objectValues(nativeEnumValues);
|
|
3543
3543
|
addIssueToContext(ctx, {
|
|
3544
3544
|
received: ctx.data,
|
|
@@ -3547,7 +3547,7 @@ var ZodNativeEnum = class extends ZodType {
|
|
|
3547
3547
|
});
|
|
3548
3548
|
return INVALID;
|
|
3549
3549
|
}
|
|
3550
|
-
return OK(
|
|
3550
|
+
return OK(input2.data);
|
|
3551
3551
|
}
|
|
3552
3552
|
get enum() {
|
|
3553
3553
|
return this._def.values;
|
|
@@ -3564,8 +3564,8 @@ var ZodPromise = class extends ZodType {
|
|
|
3564
3564
|
unwrap() {
|
|
3565
3565
|
return this._def.type;
|
|
3566
3566
|
}
|
|
3567
|
-
_parse(
|
|
3568
|
-
const { ctx } = this._processInputParams(
|
|
3567
|
+
_parse(input2) {
|
|
3568
|
+
const { ctx } = this._processInputParams(input2);
|
|
3569
3569
|
if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
|
|
3570
3570
|
addIssueToContext(ctx, {
|
|
3571
3571
|
code: ZodIssueCode.invalid_type,
|
|
@@ -3597,8 +3597,8 @@ var ZodEffects = class extends ZodType {
|
|
|
3597
3597
|
sourceType() {
|
|
3598
3598
|
return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
3599
3599
|
}
|
|
3600
|
-
_parse(
|
|
3601
|
-
const { status, ctx } = this._processInputParams(
|
|
3600
|
+
_parse(input2) {
|
|
3601
|
+
const { status, ctx } = this._processInputParams(input2);
|
|
3602
3602
|
const effect = this._def.effect || null;
|
|
3603
3603
|
const checkCtx = {
|
|
3604
3604
|
addIssue: (arg) => {
|
|
@@ -3730,12 +3730,12 @@ ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
|
|
|
3730
3730
|
});
|
|
3731
3731
|
};
|
|
3732
3732
|
var ZodOptional = class extends ZodType {
|
|
3733
|
-
_parse(
|
|
3734
|
-
const parsedType = this._getType(
|
|
3733
|
+
_parse(input2) {
|
|
3734
|
+
const parsedType = this._getType(input2);
|
|
3735
3735
|
if (parsedType === ZodParsedType.undefined) {
|
|
3736
3736
|
return OK(void 0);
|
|
3737
3737
|
}
|
|
3738
|
-
return this._def.innerType._parse(
|
|
3738
|
+
return this._def.innerType._parse(input2);
|
|
3739
3739
|
}
|
|
3740
3740
|
unwrap() {
|
|
3741
3741
|
return this._def.innerType;
|
|
@@ -3749,12 +3749,12 @@ ZodOptional.create = (type, params) => {
|
|
|
3749
3749
|
});
|
|
3750
3750
|
};
|
|
3751
3751
|
var ZodNullable = class extends ZodType {
|
|
3752
|
-
_parse(
|
|
3753
|
-
const parsedType = this._getType(
|
|
3752
|
+
_parse(input2) {
|
|
3753
|
+
const parsedType = this._getType(input2);
|
|
3754
3754
|
if (parsedType === ZodParsedType.null) {
|
|
3755
3755
|
return OK(null);
|
|
3756
3756
|
}
|
|
3757
|
-
return this._def.innerType._parse(
|
|
3757
|
+
return this._def.innerType._parse(input2);
|
|
3758
3758
|
}
|
|
3759
3759
|
unwrap() {
|
|
3760
3760
|
return this._def.innerType;
|
|
@@ -3768,8 +3768,8 @@ ZodNullable.create = (type, params) => {
|
|
|
3768
3768
|
});
|
|
3769
3769
|
};
|
|
3770
3770
|
var ZodDefault = class extends ZodType {
|
|
3771
|
-
_parse(
|
|
3772
|
-
const { ctx } = this._processInputParams(
|
|
3771
|
+
_parse(input2) {
|
|
3772
|
+
const { ctx } = this._processInputParams(input2);
|
|
3773
3773
|
let data = ctx.data;
|
|
3774
3774
|
if (ctx.parsedType === ZodParsedType.undefined) {
|
|
3775
3775
|
data = this._def.defaultValue();
|
|
@@ -3793,8 +3793,8 @@ ZodDefault.create = (type, params) => {
|
|
|
3793
3793
|
});
|
|
3794
3794
|
};
|
|
3795
3795
|
var ZodCatch = class extends ZodType {
|
|
3796
|
-
_parse(
|
|
3797
|
-
const { ctx } = this._processInputParams(
|
|
3796
|
+
_parse(input2) {
|
|
3797
|
+
const { ctx } = this._processInputParams(input2);
|
|
3798
3798
|
const newCtx = {
|
|
3799
3799
|
...ctx,
|
|
3800
3800
|
common: {
|
|
@@ -3846,10 +3846,10 @@ ZodCatch.create = (type, params) => {
|
|
|
3846
3846
|
});
|
|
3847
3847
|
};
|
|
3848
3848
|
var ZodNaN = class extends ZodType {
|
|
3849
|
-
_parse(
|
|
3850
|
-
const parsedType = this._getType(
|
|
3849
|
+
_parse(input2) {
|
|
3850
|
+
const parsedType = this._getType(input2);
|
|
3851
3851
|
if (parsedType !== ZodParsedType.nan) {
|
|
3852
|
-
const ctx = this._getOrReturnCtx(
|
|
3852
|
+
const ctx = this._getOrReturnCtx(input2);
|
|
3853
3853
|
addIssueToContext(ctx, {
|
|
3854
3854
|
code: ZodIssueCode.invalid_type,
|
|
3855
3855
|
expected: ZodParsedType.nan,
|
|
@@ -3857,7 +3857,7 @@ var ZodNaN = class extends ZodType {
|
|
|
3857
3857
|
});
|
|
3858
3858
|
return INVALID;
|
|
3859
3859
|
}
|
|
3860
|
-
return { status: "valid", value:
|
|
3860
|
+
return { status: "valid", value: input2.data };
|
|
3861
3861
|
}
|
|
3862
3862
|
};
|
|
3863
3863
|
ZodNaN.create = (params) => {
|
|
@@ -3868,8 +3868,8 @@ ZodNaN.create = (params) => {
|
|
|
3868
3868
|
};
|
|
3869
3869
|
var BRAND = Symbol("zod_brand");
|
|
3870
3870
|
var ZodBranded = class extends ZodType {
|
|
3871
|
-
_parse(
|
|
3872
|
-
const { ctx } = this._processInputParams(
|
|
3871
|
+
_parse(input2) {
|
|
3872
|
+
const { ctx } = this._processInputParams(input2);
|
|
3873
3873
|
const data = ctx.data;
|
|
3874
3874
|
return this._def.type._parse({
|
|
3875
3875
|
data,
|
|
@@ -3882,8 +3882,8 @@ var ZodBranded = class extends ZodType {
|
|
|
3882
3882
|
}
|
|
3883
3883
|
};
|
|
3884
3884
|
var ZodPipeline = class _ZodPipeline extends ZodType {
|
|
3885
|
-
_parse(
|
|
3886
|
-
const { status, ctx } = this._processInputParams(
|
|
3885
|
+
_parse(input2) {
|
|
3886
|
+
const { status, ctx } = this._processInputParams(input2);
|
|
3887
3887
|
if (ctx.common.async) {
|
|
3888
3888
|
const handleAsync = async () => {
|
|
3889
3889
|
const inResult = await this._def.in._parseAsync({
|
|
@@ -3937,8 +3937,8 @@ var ZodPipeline = class _ZodPipeline extends ZodType {
|
|
|
3937
3937
|
}
|
|
3938
3938
|
};
|
|
3939
3939
|
var ZodReadonly = class extends ZodType {
|
|
3940
|
-
_parse(
|
|
3941
|
-
const result = this._def.innerType._parse(
|
|
3940
|
+
_parse(input2) {
|
|
3941
|
+
const result = this._def.innerType._parse(input2);
|
|
3942
3942
|
const freeze = (data) => {
|
|
3943
3943
|
if (isValid(data)) {
|
|
3944
3944
|
data.value = Object.freeze(data.value);
|
|
@@ -4587,8 +4587,8 @@ var TYPERT_REMOTE = {
|
|
|
4587
4587
|
var remote_default = TYPERT_REMOTE;
|
|
4588
4588
|
|
|
4589
4589
|
// src/client/Workbench.tsx
|
|
4590
|
-
var
|
|
4591
|
-
var
|
|
4590
|
+
var import_react10 = require("react");
|
|
4591
|
+
var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4592
4592
|
|
|
4593
4593
|
// src/client/icons.ts
|
|
4594
4594
|
var primitives = __toESM(require("@deepseek-ai/dsh-client-ui-primitives"), 1);
|
|
@@ -5063,11 +5063,11 @@ function deriveCapabilities(config) {
|
|
|
5063
5063
|
if (config.commit.file_scope) caps.push("file_scope");
|
|
5064
5064
|
return caps;
|
|
5065
5065
|
}
|
|
5066
|
-
function preset(id, version,
|
|
5066
|
+
function preset(id, version, label3, description, config, recommendation) {
|
|
5067
5067
|
return {
|
|
5068
5068
|
id,
|
|
5069
5069
|
version,
|
|
5070
|
-
label:
|
|
5070
|
+
label: label3,
|
|
5071
5071
|
description,
|
|
5072
5072
|
capabilities: deriveCapabilities(config),
|
|
5073
5073
|
config,
|
|
@@ -5942,12 +5942,296 @@ async function save(remote, config, workspace, setSavedAt, setSource) {
|
|
|
5942
5942
|
}
|
|
5943
5943
|
}
|
|
5944
5944
|
|
|
5945
|
-
// src/client/
|
|
5945
|
+
// src/client/AdaptivePanel.tsx
|
|
5946
5946
|
var import_react4 = require("react");
|
|
5947
5947
|
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5948
|
+
|
|
5949
|
+
// src/adaptive.ts
|
|
5950
|
+
var META_STAGES = {
|
|
5951
|
+
"requirements-analysis": "\u9700\u6C42\u5206\u6790",
|
|
5952
|
+
"architecture-design": "\u67B6\u6784\u8BBE\u8BA1",
|
|
5953
|
+
"task-orchestration": "\u4EFB\u52A1\u7F16\u6392",
|
|
5954
|
+
"code-development": "\u4EE3\u7801\u5F00\u53D1",
|
|
5955
|
+
"test-validation": "\u6D4B\u8BD5",
|
|
5956
|
+
"code-review": "\u4EE3\u7801\u5BA1\u6838"
|
|
5957
|
+
};
|
|
5958
|
+
|
|
5959
|
+
// src/client/AdaptivePanel.tsx
|
|
5960
|
+
var card = {
|
|
5961
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
5962
|
+
borderRadius: 8,
|
|
5963
|
+
padding: "14px 16px",
|
|
5964
|
+
display: "flex",
|
|
5965
|
+
flexDirection: "column",
|
|
5966
|
+
gap: 8
|
|
5967
|
+
};
|
|
5968
|
+
var grid = { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(230px, 1fr))", gap: 10 };
|
|
5969
|
+
var row = { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" };
|
|
5970
|
+
var label = { fontSize: 12, color: "var(--dsw-alias-label-secondary)" };
|
|
5971
|
+
var input = {
|
|
5972
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
5973
|
+
color: "var(--dsw-alias-label-primary)",
|
|
5974
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
5975
|
+
borderRadius: 6,
|
|
5976
|
+
padding: "6px 8px",
|
|
5977
|
+
minWidth: 180
|
|
5978
|
+
};
|
|
5979
|
+
var SOURCE_ORDER = ["project", "codex-project", "user", "bundled"];
|
|
5980
|
+
function effectiveSource(entries, name) {
|
|
5981
|
+
return entries.filter((entry) => entry.name === name).sort((a, b) => SOURCE_ORDER.indexOf(a.source) - SOURCE_ORDER.indexOf(b.source))[0]?.source ?? "\u7F3A\u5931";
|
|
5982
|
+
}
|
|
5983
|
+
function AdaptivePanel({ workspace, remote }) {
|
|
5984
|
+
const [view, setView] = (0, import_react4.useState)(null);
|
|
5985
|
+
const [draft, setDraft] = (0, import_react4.useState)({});
|
|
5986
|
+
const [skills, setSkills] = (0, import_react4.useState)([]);
|
|
5987
|
+
const [rules, setRules] = (0, import_react4.useState)([]);
|
|
5988
|
+
const [selected, setSelected] = (0, import_react4.useState)(null);
|
|
5989
|
+
const [loading, setLoading] = (0, import_react4.useState)(true);
|
|
5990
|
+
const [saving, setSaving] = (0, import_react4.useState)(false);
|
|
5991
|
+
const [dirty, setDirty] = (0, import_react4.useState)(false);
|
|
5992
|
+
const [message, setMessage] = (0, import_react4.useState)("");
|
|
5993
|
+
const refresh = (0, import_react4.useCallback)(() => {
|
|
5994
|
+
setLoading(true);
|
|
5995
|
+
setMessage("");
|
|
5996
|
+
void Promise.all([remote.readAdaptive(workspace), remote.listSkills(workspace), remote.listRules(workspace)]).then(([config, catalog, ruleCatalog]) => {
|
|
5997
|
+
setLoading(false);
|
|
5998
|
+
if (!config.ok) {
|
|
5999
|
+
setMessage("\u8BFB\u53D6\u81EA\u9002\u5E94\u914D\u7F6E\u5931\u8D25\uFF1A" + describeError(config.error));
|
|
6000
|
+
return;
|
|
6001
|
+
}
|
|
6002
|
+
if (!catalog.ok) {
|
|
6003
|
+
setMessage("\u8BFB\u53D6\u6280\u80FD\u76EE\u5F55\u5931\u8D25\uFF1A" + describeError(catalog.error));
|
|
6004
|
+
return;
|
|
6005
|
+
}
|
|
6006
|
+
if (!ruleCatalog.ok) {
|
|
6007
|
+
setMessage("\u8BFB\u53D6\u89C4\u5219\u76EE\u5F55\u5931\u8D25\uFF1A" + describeError(ruleCatalog.error));
|
|
6008
|
+
return;
|
|
6009
|
+
}
|
|
6010
|
+
setView(config.value);
|
|
6011
|
+
setDraft(config.value.config);
|
|
6012
|
+
setSkills(catalog.value.skills);
|
|
6013
|
+
setRules(ruleCatalog.value.rules);
|
|
6014
|
+
setDirty(false);
|
|
6015
|
+
}, (error) => {
|
|
6016
|
+
setLoading(false);
|
|
6017
|
+
setMessage("\u8BFB\u53D6\u5931\u8D25\uFF1A" + describeError(error));
|
|
6018
|
+
});
|
|
6019
|
+
}, [remote, workspace]);
|
|
6020
|
+
(0, import_react4.useEffect)(() => {
|
|
6021
|
+
refresh();
|
|
6022
|
+
}, [refresh]);
|
|
6023
|
+
const update = (config) => {
|
|
6024
|
+
setDraft(config);
|
|
6025
|
+
setDirty(true);
|
|
6026
|
+
setMessage("");
|
|
6027
|
+
};
|
|
6028
|
+
const addSkill = (meta, name) => {
|
|
6029
|
+
if (!name) return;
|
|
6030
|
+
const meta_bindings = { ...draft.meta_bindings, [meta]: [.../* @__PURE__ */ new Set([...draft.meta_bindings?.[meta] ?? [], name])] };
|
|
6031
|
+
update({ ...draft, meta_bindings });
|
|
6032
|
+
};
|
|
6033
|
+
const removeSkill = (meta, name) => {
|
|
6034
|
+
const meta_bindings = { ...draft.meta_bindings, [meta]: (draft.meta_bindings?.[meta] ?? []).filter((entry) => entry !== name) };
|
|
6035
|
+
update({ ...draft, meta_bindings });
|
|
6036
|
+
};
|
|
6037
|
+
const updateSonar = (patch) => {
|
|
6038
|
+
update({ ...draft, sonar: { mode: "branch", token_env: "SONAR_TOKEN", ...draft.sonar, ...patch } });
|
|
6039
|
+
};
|
|
6040
|
+
const openRules = (name) => {
|
|
6041
|
+
if (effectiveSource(skills, name) !== "project") {
|
|
6042
|
+
setMessage(`\u5F53\u524D ${name} \u6765\u81EA\u975E\u9879\u76EE\u7EA7\uFF1B\u8BF7\u5148\u5728\u201C\u6280\u80FD\u201D\u9875\u521B\u5EFA\u540C\u540D\u9879\u76EE Skill\uFF0C\u518D\u7F16\u8F91\u5B83\u7684 Rule\u3002`);
|
|
6043
|
+
return;
|
|
6044
|
+
}
|
|
6045
|
+
void remote.readProjectSkillProfile({ path: workspace, name }).then((result) => {
|
|
6046
|
+
if (!result.ok) {
|
|
6047
|
+
setMessage("\u8BFB\u53D6\u6280\u80FD\u89C4\u5219\u5931\u8D25\uFF1A" + describeError(result.error));
|
|
6048
|
+
return;
|
|
6049
|
+
}
|
|
6050
|
+
setSelected({ skill: { source: "project", name }, profile: result.value.profile, hash: result.value.hash });
|
|
6051
|
+
}, (error) => setMessage("\u8BFB\u53D6\u6280\u80FD\u89C4\u5219\u5931\u8D25\uFF1A" + describeError(error)));
|
|
6052
|
+
};
|
|
6053
|
+
const saveRules = async (profile) => {
|
|
6054
|
+
if (!selected) return;
|
|
6055
|
+
const result = await remote.writeProjectSkillProfile({
|
|
6056
|
+
path: workspace,
|
|
6057
|
+
name: selected.skill.name,
|
|
6058
|
+
profile,
|
|
6059
|
+
expected_hash: selected.hash
|
|
6060
|
+
});
|
|
6061
|
+
if (!result.ok) throw new Error("\u4FDD\u5B58\u6280\u80FD\u89C4\u5219\u5931\u8D25\uFF1A" + describeError(result.error));
|
|
6062
|
+
setSelected(null);
|
|
6063
|
+
setMessage(`\u5DF2\u4FDD\u5B58 ${selected.skill.name} \u7684\u9879\u76EE Rule\uFF1B\u65B0\u4EFB\u52A1\u5C06\u8BFB\u53D6\u6B64\u914D\u7F6E\u3002`);
|
|
6064
|
+
};
|
|
6065
|
+
const save2 = () => {
|
|
6066
|
+
if (!view) return;
|
|
6067
|
+
setSaving(true);
|
|
6068
|
+
void remote.writeAdaptive({ path: workspace, config: draft, expected_hash: view.hash }).then((result) => {
|
|
6069
|
+
setSaving(false);
|
|
6070
|
+
if (!result.ok) {
|
|
6071
|
+
setMessage("\u4FDD\u5B58\u5931\u8D25\uFF1A" + describeError(result.error));
|
|
6072
|
+
return;
|
|
6073
|
+
}
|
|
6074
|
+
setView(result.value);
|
|
6075
|
+
if (!result.value.ok) {
|
|
6076
|
+
setMessage("\u914D\u7F6E\u672A\u4FDD\u5B58\uFF1A" + result.value.problems.join("\uFF1B"));
|
|
6077
|
+
return;
|
|
6078
|
+
}
|
|
6079
|
+
setDraft(result.value.config);
|
|
6080
|
+
setDirty(false);
|
|
6081
|
+
setMessage("\u5DF2\u4FDD\u5B58\u5230 .dsh/meta.json\uFF1B\u53EA\u5F71\u54CD\u65B0\u5EFA\u4EFB\u52A1\u3002");
|
|
6082
|
+
}, (error) => {
|
|
6083
|
+
setSaving(false);
|
|
6084
|
+
setMessage("\u4FDD\u5B58\u5931\u8D25\uFF1A" + describeError(error));
|
|
6085
|
+
});
|
|
6086
|
+
};
|
|
6087
|
+
const candidates = [...new Set(skills.map((skill) => skill.name))].filter((name) => name !== "eng-delivery" && !(name in META_STAGES)).sort();
|
|
6088
|
+
const sonar = draft.sonar ?? {};
|
|
6089
|
+
return (0, import_react4.createElement)(
|
|
6090
|
+
"div",
|
|
6091
|
+
{ style: { ...styles.section, display: "flex", flexDirection: "column", gap: 16 } },
|
|
6092
|
+
(0, import_react4.createElement)(
|
|
6093
|
+
"div",
|
|
6094
|
+
{ style: card },
|
|
6095
|
+
(0, import_react4.createElement)("strong", null, "\u6309\u9700\u6C42\u9009\u62E9\u6D41\u7A0B"),
|
|
6096
|
+
(0, import_react4.createElement)("span", { style: label }, "\u6BCF\u4E2A\u4EFB\u52A1\u7531\u5927\u6A21\u578B\u5206\u6790\u540E\u9009\u62E9\u590D\u6742\u5EA6\uFF0C\u4EFB\u52A1\u521B\u5EFA\u65F6\u51BB\u7ED3\u9636\u6BB5\u548C\u751F\u6548\u6280\u80FD\uFF1B\u4E0D\u540C\u4F1A\u8BDD\u53EF\u8D70\u4E0D\u540C\u6D41\u7A0B\u3002\u98CE\u9669\u7B49\u7EA7\u72EC\u7ACB\u5224\u65AD\u3002"),
|
|
6097
|
+
(0, import_react4.createElement)("div", { style: grid }, ...(view?.grades ?? []).map((grade) => (0, import_react4.createElement)(
|
|
6098
|
+
"div",
|
|
6099
|
+
{ key: grade.id, style: { ...card, gap: 5 } },
|
|
6100
|
+
(0, import_react4.createElement)("strong", null, `${grade.label} \xB7 ${grade.id}`),
|
|
6101
|
+
(0, import_react4.createElement)("span", { style: label }, grade.guidance),
|
|
6102
|
+
(0, import_react4.createElement)("span", { style: { fontSize: 12 } }, grade.stages.join(" \u2192 "))
|
|
6103
|
+
)))
|
|
6104
|
+
),
|
|
6105
|
+
(0, import_react4.createElement)(
|
|
6106
|
+
"div",
|
|
6107
|
+
{ style: card },
|
|
6108
|
+
(0, import_react4.createElement)("strong", null, "\u5143\u6280\u80FD\u4E0E\u9879\u76EE\u6280\u80FD"),
|
|
6109
|
+
(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"),
|
|
6110
|
+
...Object.entries(META_STAGES).map(([id, stage]) => {
|
|
6111
|
+
const meta = id;
|
|
6112
|
+
const selected2 = draft.meta_bindings?.[meta] ?? [];
|
|
6113
|
+
return (0, import_react4.createElement)(
|
|
6114
|
+
"div",
|
|
6115
|
+
{ key: id, style: { ...card, gap: 6 } },
|
|
6116
|
+
(0, import_react4.createElement)("strong", null, stage),
|
|
6117
|
+
(0, import_react4.createElement)("span", { style: label }, `\u6838\u5FC3\uFF1A${id} \xB7 \u751F\u6548\u6765\u6E90\uFF1A${effectiveSource(skills, id)}`),
|
|
6118
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", onClick: () => openRules(id) }, "\u914D\u7F6E\u6838\u5FC3 Skill \u7684 Rule"),
|
|
6119
|
+
(0, import_react4.createElement)(
|
|
6120
|
+
"div",
|
|
6121
|
+
{ style: row },
|
|
6122
|
+
...selected2.map((name) => (0, import_react4.createElement)("button", {
|
|
6123
|
+
key: name,
|
|
6124
|
+
type: "button",
|
|
6125
|
+
title: "\u79FB\u9664\u6302\u8F7D",
|
|
6126
|
+
style: { ...input, minWidth: 0, cursor: "pointer" },
|
|
6127
|
+
onClick: () => removeSkill(meta, name)
|
|
6128
|
+
}, `${name} \xB7 ${effectiveSource(skills, name)} \xD7`)),
|
|
6129
|
+
...selected2.map((name) => (0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, {
|
|
6130
|
+
key: `rules-${name}`,
|
|
6131
|
+
variant: "outline",
|
|
6132
|
+
size: "sm",
|
|
6133
|
+
onClick: () => openRules(name)
|
|
6134
|
+
}, `\u914D\u7F6E ${name} \u7684 Rule`))
|
|
6135
|
+
),
|
|
6136
|
+
(0, import_react4.createElement)(
|
|
6137
|
+
"select",
|
|
6138
|
+
{
|
|
6139
|
+
style: input,
|
|
6140
|
+
"aria-label": `\u7ED9${stage}\u6302\u8F7D\u9879\u76EE\u6280\u80FD`,
|
|
6141
|
+
value: "",
|
|
6142
|
+
onChange: (event) => addSkill(meta, event.target.value)
|
|
6143
|
+
},
|
|
6144
|
+
(0, import_react4.createElement)("option", { value: "" }, "\u6302\u8F7D\u9644\u52A0\u6280\u80FD\u2026"),
|
|
6145
|
+
...candidates.filter((name) => !selected2.includes(name)).map((name) => (0, import_react4.createElement)("option", { key: name, value: name }, `${name} \xB7 ${effectiveSource(skills, name)}`))
|
|
6146
|
+
)
|
|
6147
|
+
);
|
|
6148
|
+
})
|
|
6149
|
+
),
|
|
6150
|
+
(0, import_react4.createElement)(
|
|
6151
|
+
"div",
|
|
6152
|
+
{ style: card },
|
|
6153
|
+
(0, import_react4.createElement)(
|
|
6154
|
+
"div",
|
|
6155
|
+
{ style: row },
|
|
6156
|
+
(0, import_react4.createElement)("strong", null, "SonarQube \u5BA1\u6838"),
|
|
6157
|
+
(0, import_react4.createElement)(
|
|
6158
|
+
"label",
|
|
6159
|
+
{ style: row },
|
|
6160
|
+
(0, import_react4.createElement)("input", {
|
|
6161
|
+
type: "checkbox",
|
|
6162
|
+
checked: sonar.enabled === true,
|
|
6163
|
+
onChange: (event) => updateSonar({ enabled: event.target.checked })
|
|
6164
|
+
}),
|
|
6165
|
+
"\u542F\u7528\uFF08\u4EC5\u4EE3\u7801\u5BA1\u6838\u9636\u6BB5\uFF09"
|
|
6166
|
+
)
|
|
6167
|
+
),
|
|
6168
|
+
(0, import_react4.createElement)("span", { style: label }, "\u590D\u7528 CI \u626B\u63CF\u7684 ceTaskId\uFF1B\u8D28\u91CF\u95E8\u7981\u6216\u65B0\u4EE3\u7801\u4E2D\u9AD8\u7B49\u7EA7\u95EE\u9898\u672A\u901A\u8FC7\u65F6\u963B\u6B62\u5BA1\u6838\u3002Token \u4EC5\u4ECE\u670D\u52A1\u8FDB\u7A0B\u73AF\u5883\u53D8\u91CF\u8BFB\u53D6\uFF0C\u4E0D\u5199\u5165\u4ED3\u5E93\u3002"),
|
|
6169
|
+
sonar.enabled === true ? (0, import_react4.createElement)(
|
|
6170
|
+
"div",
|
|
6171
|
+
{ style: grid },
|
|
6172
|
+
...[
|
|
6173
|
+
["host_url", "\u670D\u52A1\u5730\u5740", "https://sonar.example"],
|
|
6174
|
+
["project_key", "\u9879\u76EE Key", "my-project"],
|
|
6175
|
+
["token_env", "Token \u73AF\u5883\u53D8\u91CF\u540D", "SONAR_TOKEN"]
|
|
6176
|
+
].map(([key, title, placeholder]) => (0, import_react4.createElement)(
|
|
6177
|
+
"label",
|
|
6178
|
+
{ key, style: { display: "flex", flexDirection: "column", gap: 4 } },
|
|
6179
|
+
(0, import_react4.createElement)("span", { style: label }, title),
|
|
6180
|
+
(0, import_react4.createElement)("input", {
|
|
6181
|
+
style: input,
|
|
6182
|
+
value: sonar[key] ?? "",
|
|
6183
|
+
placeholder,
|
|
6184
|
+
onChange: (event) => updateSonar({ [key]: event.target.value })
|
|
6185
|
+
})
|
|
6186
|
+
)),
|
|
6187
|
+
(0, import_react4.createElement)(
|
|
6188
|
+
"label",
|
|
6189
|
+
{ style: { display: "flex", flexDirection: "column", gap: 4 } },
|
|
6190
|
+
(0, import_react4.createElement)("span", { style: label }, "\u5206\u6790\u5BF9\u8C61"),
|
|
6191
|
+
(0, import_react4.createElement)(
|
|
6192
|
+
"select",
|
|
6193
|
+
{
|
|
6194
|
+
style: input,
|
|
6195
|
+
value: sonar.mode ?? "branch",
|
|
6196
|
+
onChange: (event) => updateSonar({ mode: event.target.value })
|
|
6197
|
+
},
|
|
6198
|
+
(0, import_react4.createElement)("option", { value: "branch" }, "\u5206\u652F"),
|
|
6199
|
+
(0, import_react4.createElement)("option", { value: "pull-request" }, "\u5408\u5E76\u8BF7\u6C42")
|
|
6200
|
+
)
|
|
6201
|
+
)
|
|
6202
|
+
) : null
|
|
6203
|
+
),
|
|
6204
|
+
(0, import_react4.createElement)(
|
|
6205
|
+
"div",
|
|
6206
|
+
{ style: row },
|
|
6207
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", disabled: loading || saving, onClick: refresh }, "\u5237\u65B0"),
|
|
6208
|
+
(0, import_react4.createElement)(
|
|
6209
|
+
import_dsh_client_ui_primitives3.Button,
|
|
6210
|
+
{ variant: "primary", size: "sm", disabled: loading || saving || !dirty, onClick: save2 },
|
|
6211
|
+
saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u81EA\u9002\u5E94\u914D\u7F6E"
|
|
6212
|
+
),
|
|
6213
|
+
(0, import_react4.createElement)("span", { style: label }, "\u65B0\u9879\u76EE\u53EF\u5728\u5DE5\u7A0B\u4F1A\u8BDD\u4E2D\u8C03\u7528 dev_task init_project\uFF1A\u626B\u63CF \u2192 \u9884\u89C8 \u2192 \u5199\u5165\u9879\u76EE\u6280\u80FD\u4E0E\u89C4\u5219\u3002")
|
|
6214
|
+
),
|
|
6215
|
+
message ? (0, import_react4.createElement)("p", { role: "status", style: styles.status }, message) : null,
|
|
6216
|
+
view?.problems.length ? (0, import_react4.createElement)("p", { role: "alert", style: styles.status }, view.problems.join("\uFF1B")) : null,
|
|
6217
|
+
selected ? (0, import_react4.createElement)(SkillRuleDialog, {
|
|
6218
|
+
key: `${selected.skill.source}:${selected.skill.name}`,
|
|
6219
|
+
skill: selected.skill,
|
|
6220
|
+
profile: selected.profile,
|
|
6221
|
+
rules,
|
|
6222
|
+
description: "\u9879\u76EE Skill \u7684\u89C4\u5219\u6863\u6848\u4FDD\u5B58\u5728\u5176 profile.json\uFF0C\u5F71\u54CD\u4E4B\u540E\u521B\u5EFA\u7684\u81EA\u9002\u5E94\u4EFB\u52A1\u3002",
|
|
6223
|
+
onSave: saveRules,
|
|
6224
|
+
onClose: () => setSelected(null)
|
|
6225
|
+
}) : null
|
|
6226
|
+
);
|
|
6227
|
+
}
|
|
6228
|
+
|
|
6229
|
+
// src/client/InitPanel.tsx
|
|
6230
|
+
var import_react5 = require("react");
|
|
6231
|
+
var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5948
6232
|
var MD_LABELS = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
5949
6233
|
var INIT_TIMEOUT_S = 150;
|
|
5950
|
-
var
|
|
6234
|
+
var card2 = {
|
|
5951
6235
|
display: "flex",
|
|
5952
6236
|
flexDirection: "column",
|
|
5953
6237
|
gap: 12,
|
|
@@ -5956,14 +6240,14 @@ var card = {
|
|
|
5956
6240
|
padding: "12px 14px"
|
|
5957
6241
|
};
|
|
5958
6242
|
function InitPanel({ workspace, remote }) {
|
|
5959
|
-
const [view, setView] = (0,
|
|
5960
|
-
const [generating, setGenerating] = (0,
|
|
5961
|
-
const [elapsed, setElapsed] = (0,
|
|
5962
|
-
const [draft, setDraft] = (0,
|
|
5963
|
-
const [editing, setEditing] = (0,
|
|
5964
|
-
const [body2, setBody] = (0,
|
|
5965
|
-
const [msg, setMsg] = (0,
|
|
5966
|
-
(0,
|
|
6243
|
+
const [view, setView] = (0, import_react5.useState)(null);
|
|
6244
|
+
const [generating, setGenerating] = (0, import_react5.useState)(false);
|
|
6245
|
+
const [elapsed, setElapsed] = (0, import_react5.useState)(0);
|
|
6246
|
+
const [draft, setDraft] = (0, import_react5.useState)(null);
|
|
6247
|
+
const [editing, setEditing] = (0, import_react5.useState)(false);
|
|
6248
|
+
const [body2, setBody] = (0, import_react5.useState)("");
|
|
6249
|
+
const [msg, setMsg] = (0, import_react5.useState)("");
|
|
6250
|
+
(0, import_react5.useEffect)(() => {
|
|
5967
6251
|
if (!generating) {
|
|
5968
6252
|
setElapsed(0);
|
|
5969
6253
|
return;
|
|
@@ -5977,13 +6261,13 @@ function InitPanel({ workspace, remote }) {
|
|
|
5977
6261
|
clearInterval(timer);
|
|
5978
6262
|
};
|
|
5979
6263
|
}, [generating]);
|
|
5980
|
-
const refresh = (0,
|
|
6264
|
+
const refresh = (0, import_react5.useCallback)(() => {
|
|
5981
6265
|
void remote.readInit(workspace).then((r) => {
|
|
5982
6266
|
if (r.ok) setView(r.value);
|
|
5983
6267
|
}, () => {
|
|
5984
6268
|
});
|
|
5985
6269
|
}, [remote, workspace]);
|
|
5986
|
-
(0,
|
|
6270
|
+
(0, import_react5.useEffect)(() => {
|
|
5987
6271
|
refresh();
|
|
5988
6272
|
}, [refresh]);
|
|
5989
6273
|
const generate = async () => {
|
|
@@ -6026,45 +6310,45 @@ function InitPanel({ workspace, remote }) {
|
|
|
6026
6310
|
setMsg("");
|
|
6027
6311
|
};
|
|
6028
6312
|
const exists = view?.exists === true;
|
|
6029
|
-
return (0,
|
|
6313
|
+
return (0, import_react5.createElement)(
|
|
6030
6314
|
"div",
|
|
6031
6315
|
{ style: styles.section },
|
|
6032
|
-
(0,
|
|
6316
|
+
(0, import_react5.createElement)(
|
|
6033
6317
|
"div",
|
|
6034
|
-
{ style:
|
|
6035
|
-
(0,
|
|
6318
|
+
{ style: card2 },
|
|
6319
|
+
(0, import_react5.createElement)(
|
|
6036
6320
|
"div",
|
|
6037
6321
|
{ style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" } },
|
|
6038
|
-
(0,
|
|
6039
|
-
(0,
|
|
6040
|
-
view?.path !== void 0 ? (0,
|
|
6322
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.StateDot, { state: exists ? "done" : "ongoing" }),
|
|
6323
|
+
(0, import_react5.createElement)("span", { style: styles.bindingLabel }, exists ? `\u5DF2\u521D\u59CB\u5316 \xB7 ${view.lines} \u884C\uFF08\u4E0A\u9650 200\uFF09` : "\u672A\u521D\u59CB\u5316"),
|
|
6324
|
+
view?.path !== void 0 ? (0, import_react5.createElement)("span", { style: styles.sourceBadge }, `\u5DF2\u5B9A\u4F4D\u5230 ${view.path}`) : null
|
|
6041
6325
|
),
|
|
6042
|
-
(0,
|
|
6326
|
+
(0, import_react5.createElement)(
|
|
6043
6327
|
"p",
|
|
6044
6328
|
{ style: styles.muted },
|
|
6045
6329
|
"\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"
|
|
6046
6330
|
),
|
|
6047
|
-
exists && !editing && draft === null ? (0,
|
|
6331
|
+
exists && !editing && draft === null ? (0, import_react5.createElement)(
|
|
6048
6332
|
"div",
|
|
6049
6333
|
{ style: styles.mdPreview },
|
|
6050
|
-
(0,
|
|
6334
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.MarkdownText, { text: view.content, labels: MD_LABELS })
|
|
6051
6335
|
) : null,
|
|
6052
|
-
draft !== null ? (0,
|
|
6336
|
+
draft !== null ? (0, import_react5.createElement)(
|
|
6053
6337
|
"div",
|
|
6054
6338
|
{ style: styles.section },
|
|
6055
|
-
(0,
|
|
6339
|
+
(0, import_react5.createElement)(
|
|
6056
6340
|
"div",
|
|
6057
6341
|
{ style: styles.sourceRow },
|
|
6058
|
-
(0,
|
|
6059
|
-
(0,
|
|
6342
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.StateDot, { state: "ongoing", size: 8 }),
|
|
6343
|
+
(0, import_react5.createElement)("span", { style: styles.sourceBadge }, `AI \u8349\u7A3F \xB7 ${draft.lines} \u884C \xB7 \u5C1A\u672A\u5199\u5165`)
|
|
6060
6344
|
),
|
|
6061
|
-
(0,
|
|
6345
|
+
(0, import_react5.createElement)(
|
|
6062
6346
|
"div",
|
|
6063
6347
|
{ style: styles.mdPreview },
|
|
6064
|
-
(0,
|
|
6348
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.MarkdownText, { text: draft.content, labels: MD_LABELS })
|
|
6065
6349
|
)
|
|
6066
6350
|
) : null,
|
|
6067
|
-
editing ? (0,
|
|
6351
|
+
editing ? (0, import_react5.createElement)("textarea", {
|
|
6068
6352
|
style: { ...styles.textarea, minHeight: 300 },
|
|
6069
6353
|
placeholder: "AGENTS.md \u6B63\u6587\uFF08Markdown\uFF0C\u2264200 \u884C\uFF09",
|
|
6070
6354
|
value: body2,
|
|
@@ -6072,16 +6356,16 @@ function InitPanel({ workspace, remote }) {
|
|
|
6072
6356
|
setBody(ev.target.value);
|
|
6073
6357
|
}
|
|
6074
6358
|
}) : null,
|
|
6075
|
-
generating ? (0,
|
|
6359
|
+
generating ? (0, import_react5.createElement)(
|
|
6076
6360
|
"p",
|
|
6077
6361
|
{ style: styles.status },
|
|
6078
6362
|
`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`
|
|
6079
6363
|
) : null,
|
|
6080
|
-
msg !== "" ? (0,
|
|
6081
|
-
draft !== null ? (0,
|
|
6364
|
+
msg !== "" ? (0, import_react5.createElement)("p", { style: styles.status }, msg) : null,
|
|
6365
|
+
draft !== null ? (0, import_react5.createElement)(
|
|
6082
6366
|
"div",
|
|
6083
6367
|
{ style: styles.row },
|
|
6084
|
-
(0,
|
|
6368
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6085
6369
|
variant: "primary",
|
|
6086
6370
|
size: "md",
|
|
6087
6371
|
disabled: draft.lines > 200,
|
|
@@ -6090,14 +6374,14 @@ function InitPanel({ workspace, remote }) {
|
|
|
6090
6374
|
void write(draft.content, exists);
|
|
6091
6375
|
}
|
|
6092
6376
|
}, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
|
|
6093
|
-
draft.lines > 200 ? (0,
|
|
6094
|
-
(0,
|
|
6377
|
+
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,
|
|
6378
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "md", onClick: () => {
|
|
6095
6379
|
setDraft(null);
|
|
6096
6380
|
} }, "\u653E\u5F03")
|
|
6097
|
-
) : editing ? (0,
|
|
6381
|
+
) : editing ? (0, import_react5.createElement)(
|
|
6098
6382
|
"div",
|
|
6099
6383
|
{ style: styles.row },
|
|
6100
|
-
(0,
|
|
6384
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6101
6385
|
variant: "primary",
|
|
6102
6386
|
size: "md",
|
|
6103
6387
|
disabled: body2.trim() === "",
|
|
@@ -6106,13 +6390,13 @@ function InitPanel({ workspace, remote }) {
|
|
|
6106
6390
|
void write(body2, exists);
|
|
6107
6391
|
}
|
|
6108
6392
|
}, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
|
|
6109
|
-
(0,
|
|
6393
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "md", onClick: () => {
|
|
6110
6394
|
setEditing(false);
|
|
6111
6395
|
} }, "\u53D6\u6D88")
|
|
6112
|
-
) : (0,
|
|
6396
|
+
) : (0, import_react5.createElement)(
|
|
6113
6397
|
"div",
|
|
6114
6398
|
{ style: styles.row },
|
|
6115
|
-
(0,
|
|
6399
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6116
6400
|
variant: "primary",
|
|
6117
6401
|
size: "md",
|
|
6118
6402
|
disabled: generating,
|
|
@@ -6121,55 +6405,55 @@ function InitPanel({ workspace, remote }) {
|
|
|
6121
6405
|
void generate();
|
|
6122
6406
|
}
|
|
6123
6407
|
}, exists ? "\u91CD\u65B0\u521D\u59CB\u5316\uFF08AI \u626B\u63CF\u8986\u76D6\uFF09" : "\u8BA9 AI \u521D\u59CB\u5316"),
|
|
6124
|
-
exists ? (0,
|
|
6408
|
+
exists ? (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", size: "md", onClick: startEdit }, "\u624B\u52A8\u7F16\u8F91") : null
|
|
6125
6409
|
)
|
|
6126
6410
|
)
|
|
6127
6411
|
);
|
|
6128
6412
|
}
|
|
6129
6413
|
|
|
6130
6414
|
// src/client/SkillManager.tsx
|
|
6131
|
-
var
|
|
6415
|
+
var import_react7 = require("react");
|
|
6132
6416
|
|
|
6133
6417
|
// src/client/ResourceManager.tsx
|
|
6134
|
-
var
|
|
6135
|
-
var
|
|
6418
|
+
var import_react6 = require("react");
|
|
6419
|
+
var import_dsh_client_ui_primitives5 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6136
6420
|
var labels = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
6137
|
-
var levelOf = (
|
|
6421
|
+
var levelOf = (row2) => row2.source === "bundled" ? "bundled" : row2.source.startsWith("user") ? "user" : "project";
|
|
6138
6422
|
var sourceText2 = (source) => source === "bundled" ? "\u5185\u7F6E" : source === "codex-project" ? "\u9879\u76EE \xB7 Codex" : source.startsWith("user") ? "\u4E2A\u4EBA" : "\u9879\u76EE";
|
|
6139
6423
|
var sizeText = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1024 * 1024 ? `${(bytes / 1024).toFixed(1)} KB` : `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
6140
6424
|
var fail = (r) => describeError(r.error ?? "\u64CD\u4F5C\u5931\u8D25");
|
|
6141
6425
|
function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
6142
6426
|
const noun = kind === "skill" ? "\u6280\u80FD" : "\u89C4\u5219";
|
|
6143
|
-
const [rows, setRows] = (0,
|
|
6144
|
-
const [query, setQuery] = (0,
|
|
6145
|
-
const [filter, setFilter] = (0,
|
|
6146
|
-
const [notice, setNotice] = (0,
|
|
6147
|
-
const [error, setError] = (0,
|
|
6148
|
-
const [loading, setLoading] = (0,
|
|
6149
|
-
const [revision, refresh] = (0,
|
|
6150
|
-
const [busy, setBusy] = (0,
|
|
6151
|
-
const [roots, setRoots] = (0,
|
|
6152
|
-
const [importing, setImporting] = (0,
|
|
6153
|
-
const [request, setRequest] = (0,
|
|
6154
|
-
const [preview, setPreview] = (0,
|
|
6155
|
-
const [level, setLevel] = (0,
|
|
6156
|
-
const [manual, setManual] = (0,
|
|
6157
|
-
const [sourceDir, setSourceDir] = (0,
|
|
6158
|
-
const [dirs, setDirs] = (0,
|
|
6159
|
-
const [browsePath, setBrowsePath] = (0,
|
|
6160
|
-
const [editing, setEditing] = (0,
|
|
6161
|
-
const [viewing, setViewing] = (0,
|
|
6162
|
-
const [name, setName] = (0,
|
|
6163
|
-
const [description, setDescription] = (0,
|
|
6164
|
-
const [whenToUse, setWhenToUse] = (0,
|
|
6165
|
-
const [body2, setBody] = (0,
|
|
6166
|
-
const [templateSource, setTemplateSource] = (0,
|
|
6167
|
-
const [deleting, setDeleting] = (0,
|
|
6168
|
-
const
|
|
6169
|
-
const fileEpoch = (0,
|
|
6170
|
-
const browseEpoch = (0,
|
|
6427
|
+
const [rows, setRows] = (0, import_react6.useState)([]);
|
|
6428
|
+
const [query, setQuery] = (0, import_react6.useState)("");
|
|
6429
|
+
const [filter, setFilter] = (0, import_react6.useState)("all");
|
|
6430
|
+
const [notice, setNotice] = (0, import_react6.useState)("");
|
|
6431
|
+
const [error, setError] = (0, import_react6.useState)("");
|
|
6432
|
+
const [loading, setLoading] = (0, import_react6.useState)(true);
|
|
6433
|
+
const [revision, refresh] = (0, import_react6.useState)(0);
|
|
6434
|
+
const [busy, setBusy] = (0, import_react6.useState)(false);
|
|
6435
|
+
const [roots, setRoots] = (0, import_react6.useState)(null);
|
|
6436
|
+
const [importing, setImporting] = (0, import_react6.useState)(false);
|
|
6437
|
+
const [request, setRequest] = (0, import_react6.useState)(null);
|
|
6438
|
+
const [preview, setPreview] = (0, import_react6.useState)(null);
|
|
6439
|
+
const [level, setLevel] = (0, import_react6.useState)("project");
|
|
6440
|
+
const [manual, setManual] = (0, import_react6.useState)(false);
|
|
6441
|
+
const [sourceDir, setSourceDir] = (0, import_react6.useState)("");
|
|
6442
|
+
const [dirs, setDirs] = (0, import_react6.useState)([]);
|
|
6443
|
+
const [browsePath, setBrowsePath] = (0, import_react6.useState)("");
|
|
6444
|
+
const [editing, setEditing] = (0, import_react6.useState)(null);
|
|
6445
|
+
const [viewing, setViewing] = (0, import_react6.useState)(false);
|
|
6446
|
+
const [name, setName] = (0, import_react6.useState)("");
|
|
6447
|
+
const [description, setDescription] = (0, import_react6.useState)("");
|
|
6448
|
+
const [whenToUse, setWhenToUse] = (0, import_react6.useState)("");
|
|
6449
|
+
const [body2, setBody] = (0, import_react6.useState)("");
|
|
6450
|
+
const [templateSource, setTemplateSource] = (0, import_react6.useState)(null);
|
|
6451
|
+
const [deleting, setDeleting] = (0, import_react6.useState)(null);
|
|
6452
|
+
const input2 = (0, import_react6.useRef)(null);
|
|
6453
|
+
const fileEpoch = (0, import_react6.useRef)(0);
|
|
6454
|
+
const browseEpoch = (0, import_react6.useRef)(0);
|
|
6171
6455
|
const readonly = editing !== null && editing !== "new" && (levelOf(editing) === "bundled" || editing.source === "codex-project");
|
|
6172
|
-
(0,
|
|
6456
|
+
(0, import_react6.useEffect)(() => {
|
|
6173
6457
|
let active = true;
|
|
6174
6458
|
setLoading(true);
|
|
6175
6459
|
setRows([]);
|
|
@@ -6196,7 +6480,7 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6196
6480
|
fileEpoch.current++;
|
|
6197
6481
|
};
|
|
6198
6482
|
}, [workspace, remote, kind, revision]);
|
|
6199
|
-
(0,
|
|
6483
|
+
(0, import_react6.useEffect)(() => {
|
|
6200
6484
|
let active = true;
|
|
6201
6485
|
setPreview(null);
|
|
6202
6486
|
if (!request) return;
|
|
@@ -6228,9 +6512,9 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6228
6512
|
};
|
|
6229
6513
|
const choose = () => {
|
|
6230
6514
|
setError("");
|
|
6231
|
-
if (
|
|
6232
|
-
|
|
6233
|
-
|
|
6515
|
+
if (input2.current) {
|
|
6516
|
+
input2.current.value = "";
|
|
6517
|
+
input2.current.click();
|
|
6234
6518
|
}
|
|
6235
6519
|
};
|
|
6236
6520
|
const selected = async (files) => {
|
|
@@ -6293,24 +6577,24 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6293
6577
|
if (epoch === browseEpoch.current) setError(describeError(e));
|
|
6294
6578
|
}
|
|
6295
6579
|
};
|
|
6296
|
-
const edit = async (
|
|
6580
|
+
const edit = async (row2, view = false) => {
|
|
6297
6581
|
setTemplateSource(null);
|
|
6298
|
-
setEditing(
|
|
6582
|
+
setEditing(row2);
|
|
6299
6583
|
setViewing(view);
|
|
6300
|
-
setName(
|
|
6584
|
+
setName(row2 === "new" ? "" : row2.name);
|
|
6301
6585
|
setDescription("");
|
|
6302
6586
|
setWhenToUse("");
|
|
6303
6587
|
setBody("");
|
|
6304
6588
|
setError("");
|
|
6305
|
-
if (
|
|
6589
|
+
if (row2 === "new") {
|
|
6306
6590
|
setLevel("project");
|
|
6307
6591
|
return;
|
|
6308
6592
|
}
|
|
6309
|
-
const lvl = levelOf(
|
|
6593
|
+
const lvl = levelOf(row2);
|
|
6310
6594
|
setLevel(lvl === "user" ? "user" : "project");
|
|
6311
6595
|
setBusy(true);
|
|
6312
6596
|
try {
|
|
6313
|
-
const r = kind === "skill" ? await remote.readSkill({ name:
|
|
6597
|
+
const r = kind === "skill" ? await remote.readSkill({ name: row2.name, level: row2.source === "codex-project" ? "codex-project" : lvl, path: workspace }) : await remote.readRule({ name: row2.name, level: lvl, path: workspace });
|
|
6314
6598
|
if (!r.ok) throw new Error(fail(r));
|
|
6315
6599
|
if (!r.value.ok) throw new Error(r.value.error ?? "\u8BFB\u53D6\u5931\u8D25");
|
|
6316
6600
|
setBody(r.value.content);
|
|
@@ -6325,16 +6609,16 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6325
6609
|
setBusy(false);
|
|
6326
6610
|
}
|
|
6327
6611
|
};
|
|
6328
|
-
const copyTemplate = async (
|
|
6329
|
-
if (busy || levelOf(
|
|
6612
|
+
const copyTemplate = async (row2) => {
|
|
6613
|
+
if (busy || levelOf(row2) !== "bundled") return;
|
|
6330
6614
|
setBusy(true);
|
|
6331
6615
|
setError("");
|
|
6332
6616
|
try {
|
|
6333
|
-
const r = kind === "skill" ? await remote.readSkill({ name:
|
|
6617
|
+
const r = kind === "skill" ? await remote.readSkill({ name: row2.name, level: "bundled", path: workspace }) : await remote.readRule({ name: row2.name, level: "bundled", path: workspace });
|
|
6334
6618
|
if (!r.ok) throw new Error(fail(r));
|
|
6335
6619
|
if (!r.value.ok) throw new Error(r.value.error ?? "\u8BFB\u53D6\u5185\u7F6E\u6837\u672C\u5931\u8D25");
|
|
6336
6620
|
const used = new Set(rows.map((item) => item.name));
|
|
6337
|
-
const base = `${
|
|
6621
|
+
const base = `${row2.name}-copy`;
|
|
6338
6622
|
let candidate = base;
|
|
6339
6623
|
for (let index = 2; used.has(candidate); index++) candidate = `${base}-${index}`;
|
|
6340
6624
|
setName(candidate);
|
|
@@ -6349,7 +6633,7 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6349
6633
|
setDescription("");
|
|
6350
6634
|
setWhenToUse("");
|
|
6351
6635
|
}
|
|
6352
|
-
setTemplateSource(
|
|
6636
|
+
setTemplateSource(row2);
|
|
6353
6637
|
setEditing("new");
|
|
6354
6638
|
setNotice("");
|
|
6355
6639
|
} catch (e) {
|
|
@@ -6398,104 +6682,104 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6398
6682
|
setBusy(false);
|
|
6399
6683
|
}
|
|
6400
6684
|
};
|
|
6401
|
-
const status = () => error ? (0,
|
|
6402
|
-
const targets = () => (0,
|
|
6685
|
+
const status = () => error ? (0, import_react6.createElement)("div", { className: "te-alert", role: "alert" }, error) : null;
|
|
6686
|
+
const targets = () => (0, import_react6.createElement)(
|
|
6403
6687
|
"div",
|
|
6404
6688
|
{ className: "te-targets" },
|
|
6405
|
-
...["project", "user"].map((lvl) => (0,
|
|
6689
|
+
...["project", "user"].map((lvl) => (0, import_react6.createElement)(
|
|
6406
6690
|
"button",
|
|
6407
6691
|
{ type: "button", key: lvl, className: `te-target ${level === lvl ? "selected" : ""}`, "aria-pressed": level === lvl, disabled: busy || editing !== null && editing !== "new", onClick: () => {
|
|
6408
6692
|
setPreview(null);
|
|
6409
6693
|
setLevel(lvl);
|
|
6410
6694
|
} },
|
|
6411
|
-
(0,
|
|
6412
|
-
(0,
|
|
6695
|
+
(0, import_react6.createElement)("strong", null, lvl === "project" ? "\u9879\u76EE\u5171\u4EAB" : "\u4E2A\u4EBA\u5168\u5C40"),
|
|
6696
|
+
(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")
|
|
6413
6697
|
)),
|
|
6414
|
-
(0,
|
|
6698
|
+
(0, import_react6.createElement)("code", { className: "te-path" }, roots?.[level] ?? (level === "project" ? `${workspace}/.dsh/${kind}s` : `DSH_HOME/${kind}s`))
|
|
6415
6699
|
);
|
|
6416
6700
|
const visible = rows.filter((r) => `${r.name} ${r.description ?? ""}`.toLowerCase().includes(query.toLowerCase()) && (filter === "all" || levelOf(r) === filter));
|
|
6417
|
-
return (0,
|
|
6701
|
+
return (0, import_react6.createElement)(
|
|
6418
6702
|
"section",
|
|
6419
6703
|
{ className: "te-resource" },
|
|
6420
|
-
(0,
|
|
6704
|
+
(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) => {
|
|
6421
6705
|
void selected(Array.from(e.target.files ?? []));
|
|
6422
6706
|
} }),
|
|
6423
|
-
(0,
|
|
6707
|
+
(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: () => {
|
|
6424
6708
|
void edit("new");
|
|
6425
|
-
} }, `\u65B0\u5EFA${noun}`), (0,
|
|
6426
|
-
(0,
|
|
6427
|
-
notice ? (0,
|
|
6709
|
+
} }, `\u65B0\u5EFA${noun}`), (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "primary", onClick: choose }, `\u5B89\u88C5${noun}`))),
|
|
6710
|
+
(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")),
|
|
6711
|
+
notice ? (0, import_react6.createElement)("div", { className: "te-success", role: "status" }, notice) : null,
|
|
6428
6712
|
!importing && !editing && !deleting ? status() : null,
|
|
6429
|
-
loading ? (0,
|
|
6713
|
+
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)(
|
|
6430
6714
|
"article",
|
|
6431
|
-
{ className: "te-resource-card", key:
|
|
6432
|
-
(0,
|
|
6433
|
-
(0,
|
|
6434
|
-
(0,
|
|
6435
|
-
(0,
|
|
6436
|
-
void edit(
|
|
6437
|
-
} }, "\u67E5\u770B"), levelOf(
|
|
6438
|
-
void copyTemplate(
|
|
6439
|
-
} }, "\u4EE5\u6B64\u4E3A\u6A21\u677F\u65B0\u5EFA") :
|
|
6440
|
-
void edit(
|
|
6441
|
-
} }, "\u7F16\u8F91") : null, levelOf(
|
|
6442
|
-
setDeleting(
|
|
6715
|
+
{ className: "te-resource-card", key: row2.source + "/" + row2.name },
|
|
6716
|
+
(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" }, sourceText2(row2.source))),
|
|
6717
|
+
(0, import_react6.createElement)("h3", null, row2.name),
|
|
6718
|
+
(0, import_react6.createElement)("p", null, row2.description || "\u9879\u76EE\u7EA6\u5B9A\u4E0E\u6267\u884C\u89C4\u5219"),
|
|
6719
|
+
(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: () => {
|
|
6720
|
+
void edit(row2, true);
|
|
6721
|
+
} }, "\u67E5\u770B"), levelOf(row2) === "bundled" ? (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", size: "sm", disabled: busy, onClick: () => {
|
|
6722
|
+
void copyTemplate(row2);
|
|
6723
|
+
} }, "\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: () => {
|
|
6724
|
+
void edit(row2);
|
|
6725
|
+
} }, "\u7F16\u8F91") : null, levelOf(row2) !== "bundled" && row2.source !== "codex-project" ? (0, import_react6.createElement)("button", { className: "te-delete", onClick: () => {
|
|
6726
|
+
setDeleting(row2);
|
|
6443
6727
|
setError("");
|
|
6444
6728
|
} }, "\u5220\u9664") : null)
|
|
6445
6729
|
))),
|
|
6446
|
-
kind === "skill" ? (0,
|
|
6730
|
+
kind === "skill" ? (0, import_react6.createElement)("button", { className: "te-link", onClick: () => {
|
|
6447
6731
|
setImporting(true);
|
|
6448
6732
|
setManual(true);
|
|
6449
6733
|
setError("");
|
|
6450
6734
|
} }, "\u9AD8\u7EA7\uFF1A\u4ECE Harness \u4E3B\u673A\u8DEF\u5F84\u5B89\u88C5") : null,
|
|
6451
|
-
importing ? (0,
|
|
6735
|
+
importing ? (0, import_react6.createElement)(
|
|
6452
6736
|
ResourceModal,
|
|
6453
|
-
{ 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,
|
|
6737
|
+
{ 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: () => {
|
|
6454
6738
|
void install();
|
|
6455
6739
|
} }, busy ? "\u5904\u7406\u4E2D\u2026" : "\u786E\u8BA4\u5B89\u88C5")) },
|
|
6456
6740
|
targets(),
|
|
6457
|
-
(0,
|
|
6458
|
-
manual ? (0,
|
|
6741
|
+
(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),
|
|
6742
|
+
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) => {
|
|
6459
6743
|
setSourceDir(e.target.value);
|
|
6460
6744
|
setRequest(null);
|
|
6461
|
-
} }), (0,
|
|
6745
|
+
} }), (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", onClick: () => {
|
|
6462
6746
|
void browse(sourceDir);
|
|
6463
|
-
} }, "\u6D4F\u89C8"), (0,
|
|
6747
|
+
} }, "\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: () => {
|
|
6464
6748
|
void browse(browsePath.replace(/[\\/][^\\/]+[\\/]?$/u, "") || "/");
|
|
6465
|
-
} }, "\u2191 \u4E0A\u7EA7\u76EE\u5F55") : null, ...dirs.map((d) => (0,
|
|
6749
|
+
} }, "\u2191 \u4E0A\u7EA7\u76EE\u5F55") : null, ...dirs.map((d) => (0, import_react6.createElement)("button", { key: d.name, onClick: () => {
|
|
6466
6750
|
setRequest(null);
|
|
6467
6751
|
void browse(browsePath.replace(/[\\/]+$/u, "") + "/" + d.name);
|
|
6468
6752
|
} }, d.name + (d.hasSkill ? " \xB7 SKILL.md" : ""))))) : null,
|
|
6469
|
-
busy ? (0,
|
|
6753
|
+
busy ? (0, import_react6.createElement)("p", { role: "status" }, "\u6B63\u5728\u6821\u9A8C\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u5019\u2026") : null,
|
|
6470
6754
|
status(),
|
|
6471
|
-
preview ? (0,
|
|
6755
|
+
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
|
|
6472
6756
|
) : null,
|
|
6473
|
-
editing ? (0,
|
|
6757
|
+
editing ? (0, import_react6.createElement)(
|
|
6474
6758
|
ResourceModal,
|
|
6475
|
-
{ title: editing === "new" ? `\u65B0\u5EFA${noun}` : `${viewing ? "\u67E5\u770B" : "\u7F16\u8F91"}${noun} \xB7 ${name}`, onClose: close, footer: (0,
|
|
6759
|
+
{ 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: () => {
|
|
6476
6760
|
void copyTemplate(editing);
|
|
6477
|
-
} }, "\u4EE5\u6B64\u4E3A\u6A21\u677F\u65B0\u5EFA") : null, !readonly ? (0,
|
|
6761
|
+
} }, "\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: () => {
|
|
6478
6762
|
void save2();
|
|
6479
6763
|
} }, busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58") : null) },
|
|
6480
|
-
!readonly ? targets() : (0,
|
|
6481
|
-
templateSource ? (0,
|
|
6764
|
+
!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"),
|
|
6765
|
+
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,
|
|
6482
6766
|
status(),
|
|
6483
|
-
viewing ? (0,
|
|
6767
|
+
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) })))
|
|
6484
6768
|
) : null,
|
|
6485
|
-
deleting ? (0,
|
|
6769
|
+
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: () => {
|
|
6486
6770
|
void remove();
|
|
6487
|
-
} }, busy ? "\u5220\u9664\u4E2D\u2026" : "\u786E\u8BA4\u6C38\u4E45\u5220\u9664")) }, (0,
|
|
6771
|
+
} }, 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
|
|
6488
6772
|
);
|
|
6489
6773
|
}
|
|
6490
6774
|
|
|
6491
6775
|
// src/client/SkillManager.tsx
|
|
6492
6776
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
6493
6777
|
function SkillManager({ workspace, remote }) {
|
|
6494
|
-
const [config, setConfig] = (0,
|
|
6495
|
-
const [rules, setRules] = (0,
|
|
6496
|
-
const [selected, setSelected] = (0,
|
|
6497
|
-
const [message, setMessage] = (0,
|
|
6498
|
-
(0,
|
|
6778
|
+
const [config, setConfig] = (0, import_react7.useState)(null);
|
|
6779
|
+
const [rules, setRules] = (0, import_react7.useState)([]);
|
|
6780
|
+
const [selected, setSelected] = (0, import_react7.useState)(null);
|
|
6781
|
+
const [message, setMessage] = (0, import_react7.useState)("");
|
|
6782
|
+
(0, import_react7.useEffect)(() => {
|
|
6499
6783
|
let active = true;
|
|
6500
6784
|
void Promise.all([remote.read(workspace), remote.listRules(workspace)]).then(([saved, availableRules]) => {
|
|
6501
6785
|
if (!active) return;
|
|
@@ -6560,15 +6844,15 @@ function SkillManager({ workspace, remote }) {
|
|
|
6560
6844
|
}
|
|
6561
6845
|
|
|
6562
6846
|
// src/client/RuleManager.tsx
|
|
6563
|
-
var
|
|
6847
|
+
var import_react8 = require("react");
|
|
6564
6848
|
function RuleManager(props) {
|
|
6565
|
-
return (0,
|
|
6849
|
+
return (0, import_react8.createElement)(ResourceManager, { ...props, key: props.workspace, kind: "rule" });
|
|
6566
6850
|
}
|
|
6567
6851
|
|
|
6568
6852
|
// src/client/TaskLedger.tsx
|
|
6569
|
-
var
|
|
6570
|
-
var
|
|
6571
|
-
var
|
|
6853
|
+
var import_react9 = require("react");
|
|
6854
|
+
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6855
|
+
var card3 = {
|
|
6572
6856
|
display: "flex",
|
|
6573
6857
|
flexDirection: "column",
|
|
6574
6858
|
gap: 10,
|
|
@@ -6605,10 +6889,10 @@ var badge = {
|
|
|
6605
6889
|
color: "var(--dsw-alias-label-secondary)"
|
|
6606
6890
|
};
|
|
6607
6891
|
function verdictDot(outcome) {
|
|
6608
|
-
return (0,
|
|
6892
|
+
return (0, import_react9.createElement)(import_dsh_client_ui_primitives6.StateDot, { state: outcome === "pass" ? "done" : "error" });
|
|
6609
6893
|
}
|
|
6610
6894
|
function itemStatusDot(status) {
|
|
6611
|
-
return (0,
|
|
6895
|
+
return (0, import_react9.createElement)(import_dsh_client_ui_primitives6.StateDot, { state: status === "done" ? "done" : "ongoing" });
|
|
6612
6896
|
}
|
|
6613
6897
|
function timeText(at) {
|
|
6614
6898
|
return at.slice(0, 19).replace("T", " ");
|
|
@@ -6616,48 +6900,48 @@ function timeText(at) {
|
|
|
6616
6900
|
function itemAudit(item) {
|
|
6617
6901
|
const lines = [];
|
|
6618
6902
|
if (item.dispatch !== void 0) {
|
|
6619
|
-
lines.push((0,
|
|
6903
|
+
lines.push((0, import_react9.createElement)(
|
|
6620
6904
|
"div",
|
|
6621
6905
|
{ key: "dispatch", style: metaLine },
|
|
6622
|
-
(0,
|
|
6623
|
-
(0,
|
|
6624
|
-
(0,
|
|
6906
|
+
(0, import_react9.createElement)("span", { style: badge }, "\u5DF2\u6D3E\u53D1"),
|
|
6907
|
+
(0, import_react9.createElement)("span", null, item.dispatch.description === "" ? "\uFF08\u65E0\u63CF\u8FF0\uFF09" : item.dispatch.description),
|
|
6908
|
+
(0, import_react9.createElement)("span", { style: badge }, timeText(item.dispatch.at))
|
|
6625
6909
|
));
|
|
6626
6910
|
}
|
|
6627
6911
|
if (item.review !== void 0) {
|
|
6628
6912
|
const spec = item.review.spec;
|
|
6629
6913
|
const quality = item.review.quality;
|
|
6630
|
-
lines.push((0,
|
|
6914
|
+
lines.push((0, import_react9.createElement)(
|
|
6631
6915
|
"div",
|
|
6632
6916
|
{ key: "review", style: metaLine },
|
|
6633
6917
|
verdictDot(spec.outcome),
|
|
6634
|
-
(0,
|
|
6635
|
-
(0,
|
|
6918
|
+
(0, import_react9.createElement)("span", null, `\u89C4\u683C\u7B26\u5408 ${spec.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`),
|
|
6919
|
+
(0, import_react9.createElement)("span", null, "\xB7"),
|
|
6636
6920
|
verdictDot(quality.outcome),
|
|
6637
|
-
(0,
|
|
6921
|
+
(0, import_react9.createElement)("span", null, `\u4EE3\u7801\u8D28\u91CF ${quality.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`)
|
|
6638
6922
|
));
|
|
6639
6923
|
const failNotes = [spec, quality].flatMap((stage) => stage.outcome === "fail" ? stage.notes ?? [] : []);
|
|
6640
6924
|
if (failNotes.length > 0) {
|
|
6641
|
-
lines.push((0,
|
|
6925
|
+
lines.push((0, import_react9.createElement)(
|
|
6642
6926
|
"div",
|
|
6643
6927
|
{ key: "notes", style: metaLine },
|
|
6644
|
-
...failNotes.map((note) => (0,
|
|
6928
|
+
...failNotes.map((note) => (0, import_react9.createElement)("span", { key: note, style: badge }, note))
|
|
6645
6929
|
));
|
|
6646
6930
|
}
|
|
6647
6931
|
}
|
|
6648
6932
|
if (lines.length === 0) {
|
|
6649
|
-
lines.push((0,
|
|
6933
|
+
lines.push((0, import_react9.createElement)("div", { key: "none", style: metaLine }, (0, import_react9.createElement)("span", { style: badge }, "\u672A\u6D3E\u53D1 / \u672A\u5BA1\u67E5")));
|
|
6650
6934
|
}
|
|
6651
|
-
return (0,
|
|
6935
|
+
return (0, import_react9.createElement)("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, ...lines);
|
|
6652
6936
|
}
|
|
6653
6937
|
function TaskLedger({ workspace, remote }) {
|
|
6654
|
-
const [tasks, setTasks] = (0,
|
|
6655
|
-
const [error, setError] = (0,
|
|
6656
|
-
const [loading, setLoading] = (0,
|
|
6657
|
-
const [query, setQuery] = (0,
|
|
6658
|
-
const [risk, setRisk] = (0,
|
|
6659
|
-
const [stage, setStage] = (0,
|
|
6660
|
-
const refresh = (0,
|
|
6938
|
+
const [tasks, setTasks] = (0, import_react9.useState)([]);
|
|
6939
|
+
const [error, setError] = (0, import_react9.useState)("");
|
|
6940
|
+
const [loading, setLoading] = (0, import_react9.useState)(true);
|
|
6941
|
+
const [query, setQuery] = (0, import_react9.useState)("");
|
|
6942
|
+
const [risk, setRisk] = (0, import_react9.useState)("all");
|
|
6943
|
+
const [stage, setStage] = (0, import_react9.useState)("all");
|
|
6944
|
+
const refresh = (0, import_react9.useCallback)(() => {
|
|
6661
6945
|
if (workspace === "") return;
|
|
6662
6946
|
setError("");
|
|
6663
6947
|
setLoading(true);
|
|
@@ -6670,57 +6954,58 @@ function TaskLedger({ workspace, remote }) {
|
|
|
6670
6954
|
setError("\u8BFB\u53D6\u53F0\u8D26\u5931\u8D25\uFF1A" + describeError(reason));
|
|
6671
6955
|
});
|
|
6672
6956
|
}, [remote, workspace]);
|
|
6673
|
-
(0,
|
|
6957
|
+
(0, import_react9.useEffect)(() => {
|
|
6674
6958
|
refresh();
|
|
6675
6959
|
}, [refresh]);
|
|
6676
6960
|
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));
|
|
6677
|
-
return (0,
|
|
6961
|
+
return (0, import_react9.createElement)(
|
|
6678
6962
|
"div",
|
|
6679
6963
|
{ style: styles.section },
|
|
6680
|
-
(0,
|
|
6964
|
+
(0, import_react9.createElement)(
|
|
6681
6965
|
"div",
|
|
6682
6966
|
{ className: "te-toolbar" },
|
|
6683
|
-
(0,
|
|
6684
|
-
(0,
|
|
6685
|
-
(0,
|
|
6967
|
+
(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) }),
|
|
6968
|
+
(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")),
|
|
6969
|
+
(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)))
|
|
6686
6970
|
),
|
|
6687
|
-
(0,
|
|
6971
|
+
(0, import_react9.createElement)(
|
|
6688
6972
|
"div",
|
|
6689
6973
|
{ style: headerRow },
|
|
6690
|
-
(0,
|
|
6691
|
-
(0,
|
|
6692
|
-
(0,
|
|
6974
|
+
(0, import_react9.createElement)("span", { style: styles.bindingLabel }, "\u4EFB\u52A1\u53F0\u8D26"),
|
|
6975
|
+
(0, import_react9.createElement)("span", { style: styles.sourceBadge }, "\u53EA\u8BFB \xB7 \u6765\u81EA .dsh/task-*.json"),
|
|
6976
|
+
(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")
|
|
6693
6977
|
),
|
|
6694
|
-
loading ? (0,
|
|
6978
|
+
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\u6D3E\u53D1\u4E0E\u5BA1\u67E5\u7559\u75D5\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)(
|
|
6695
6979
|
"div",
|
|
6696
6980
|
{ style: { display: "flex", flexDirection: "column", gap: 12 } },
|
|
6697
|
-
...visible.map((task) => (0,
|
|
6981
|
+
...visible.map((task) => (0, import_react9.createElement)(
|
|
6698
6982
|
"div",
|
|
6699
|
-
{ key: task.task_id, style:
|
|
6700
|
-
(0,
|
|
6983
|
+
{ key: task.task_id, style: card3 },
|
|
6984
|
+
(0, import_react9.createElement)(
|
|
6701
6985
|
"div",
|
|
6702
6986
|
{ style: headerRow },
|
|
6703
|
-
(0,
|
|
6704
|
-
(0,
|
|
6705
|
-
(0,
|
|
6706
|
-
(0,
|
|
6707
|
-
(0,
|
|
6708
|
-
(0,
|
|
6709
|
-
(0,
|
|
6710
|
-
|
|
6987
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 14, fontWeight: 600, color: "var(--dsw-alias-label-primary)" } }, task.task_id),
|
|
6988
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } }, task.title),
|
|
6989
|
+
(0, import_react9.createElement)("span", { style: badge }, task.stage),
|
|
6990
|
+
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,
|
|
6991
|
+
(0, import_react9.createElement)("span", { style: badge }, task.branch),
|
|
6992
|
+
(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"),
|
|
6993
|
+
(0, import_react9.createElement)("span", { className: "te-badge" }, task.verification_passed ? "\u9A8C\u8BC1\u901A\u8FC7" : "\u5F85\u9A8C\u8BC1"),
|
|
6994
|
+
(0, import_react9.createElement)("span", { className: "te-badge" }, `\u5BA1\u6838\uFF1A${task.review_outcome ?? "pending"}`),
|
|
6995
|
+
task.updated_at ? (0, import_react9.createElement)("span", { style: metaLine }, "\u66F4\u65B0\u4E8E " + timeText(task.updated_at)) : null
|
|
6711
6996
|
),
|
|
6712
|
-
(0,
|
|
6997
|
+
(0, import_react9.createElement)(
|
|
6713
6998
|
"div",
|
|
6714
6999
|
{ style: { display: "flex", flexDirection: "column" } },
|
|
6715
|
-
...task.items.map((item) => (0,
|
|
7000
|
+
...task.items.map((item) => (0, import_react9.createElement)(
|
|
6716
7001
|
"div",
|
|
6717
7002
|
{ key: item.id, style: itemRow },
|
|
6718
|
-
(0,
|
|
7003
|
+
(0, import_react9.createElement)(
|
|
6719
7004
|
"div",
|
|
6720
7005
|
{ style: headerRow },
|
|
6721
7006
|
itemStatusDot(item.status),
|
|
6722
|
-
(0,
|
|
6723
|
-
(0,
|
|
7007
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } }, item.id),
|
|
7008
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 12, color: "var(--dsw-alias-label-secondary)" } }, item.title)
|
|
6724
7009
|
),
|
|
6725
7010
|
itemAudit(item)
|
|
6726
7011
|
))
|
|
@@ -6786,7 +7071,8 @@ var closeStyle = {
|
|
|
6786
7071
|
};
|
|
6787
7072
|
var TABS = [
|
|
6788
7073
|
{ id: "init", label: "\u9879\u76EE\u521D\u59CB\u5316" },
|
|
6789
|
-
{ id: "
|
|
7074
|
+
{ id: "adaptive", label: "\u81EA\u9002\u5E94\u6D41\u7A0B" },
|
|
7075
|
+
{ id: "flow", label: "\u65E7\u7248\u6D41\u7A0B" },
|
|
6790
7076
|
{ id: "tasks", label: "\u4EFB\u52A1\u53F0\u8D26" },
|
|
6791
7077
|
{ id: "skills", label: "\u6280\u80FD" },
|
|
6792
7078
|
{ id: "rules", label: "\u89C4\u5219" }
|
|
@@ -6794,29 +7080,29 @@ var TABS = [
|
|
|
6794
7080
|
function Workbench({ useStore, actions, useWorkspaces, remote }) {
|
|
6795
7081
|
const open = useStore((s) => s.open);
|
|
6796
7082
|
const workspaces = useWorkspaces((s) => s.items);
|
|
6797
|
-
const [tab, setTab] = (0,
|
|
6798
|
-
const [workspace, setWorkspace] = (0,
|
|
7083
|
+
const [tab, setTab] = (0, import_react10.useState)("adaptive");
|
|
7084
|
+
const [workspace, setWorkspace] = (0, import_react10.useState)("");
|
|
6799
7085
|
if (!open) return null;
|
|
6800
7086
|
const current = workspaces.some((w) => w.path === workspace) ? workspace : workspaces[0]?.path ?? "";
|
|
6801
|
-
return (0,
|
|
7087
|
+
return (0, import_react10.createElement)(
|
|
6802
7088
|
"div",
|
|
6803
7089
|
{ style: overlay, className: "te-workbench" },
|
|
6804
|
-
(0,
|
|
6805
|
-
(0,
|
|
7090
|
+
(0, import_react10.createElement)("style", null, workbenchTheme),
|
|
7091
|
+
(0, import_react10.createElement)(
|
|
6806
7092
|
"div",
|
|
6807
7093
|
{ style: header },
|
|
6808
|
-
(0,
|
|
7094
|
+
(0, import_react10.createElement)(
|
|
6809
7095
|
"div",
|
|
6810
7096
|
{ style: headerBrand },
|
|
6811
|
-
(0,
|
|
6812
|
-
(0,
|
|
7097
|
+
(0, import_react10.createElement)(IconSettings, { size: 18 }),
|
|
7098
|
+
(0, import_react10.createElement)(
|
|
6813
7099
|
"div",
|
|
6814
7100
|
{ style: headerText },
|
|
6815
|
-
(0,
|
|
6816
|
-
(0,
|
|
7101
|
+
(0, import_react10.createElement)("span", { style: headerTitle }, "\u5DE5\u7A0B\u4EFB\u52A1"),
|
|
7102
|
+
(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")
|
|
6817
7103
|
)
|
|
6818
7104
|
),
|
|
6819
|
-
(0,
|
|
7105
|
+
(0, import_react10.createElement)(
|
|
6820
7106
|
"button",
|
|
6821
7107
|
{
|
|
6822
7108
|
type: "button",
|
|
@@ -6832,43 +7118,43 @@ function Workbench({ useStore, actions, useWorkspaces, remote }) {
|
|
|
6832
7118
|
event.currentTarget.style.background = "transparent";
|
|
6833
7119
|
}
|
|
6834
7120
|
},
|
|
6835
|
-
(0,
|
|
7121
|
+
(0, import_react10.createElement)(IconClose, { size: 16 })
|
|
6836
7122
|
)
|
|
6837
7123
|
),
|
|
6838
|
-
(0,
|
|
7124
|
+
(0, import_react10.createElement)(
|
|
6839
7125
|
"div",
|
|
6840
7126
|
{ style: tabbar },
|
|
6841
|
-
...TABS.map((t) => (0,
|
|
7127
|
+
...TABS.map((t) => (0, import_react10.createElement)(import_dsh_client_ui_primitives7.Pill, { key: t.id, active: tab === t.id, onClick: () => {
|
|
6842
7128
|
setTab(t.id);
|
|
6843
7129
|
} }, t.label)),
|
|
6844
|
-
workspaces.length > 0 ? (0,
|
|
7130
|
+
workspaces.length > 0 ? (0, import_react10.createElement)("select", {
|
|
6845
7131
|
style: selectStyle,
|
|
6846
7132
|
"aria-label": "\u5F53\u524D\u5DE5\u4F5C\u533A",
|
|
6847
7133
|
value: current,
|
|
6848
7134
|
onChange: (ev) => {
|
|
6849
7135
|
setWorkspace(ev.target.value);
|
|
6850
7136
|
}
|
|
6851
|
-
}, ...workspaces.map((w) => (0,
|
|
7137
|
+
}, ...workspaces.map((w) => (0, import_react10.createElement)("option", { key: w.path, value: w.path }, w.title || w.path))) : null
|
|
6852
7138
|
),
|
|
6853
|
-
(0,
|
|
7139
|
+
(0, import_react10.createElement)(
|
|
6854
7140
|
"div",
|
|
6855
7141
|
{ style: body },
|
|
6856
|
-
(0,
|
|
7142
|
+
(0, import_react10.createElement)(
|
|
6857
7143
|
"div",
|
|
6858
7144
|
{ className: "te-content", key: current },
|
|
6859
|
-
(0,
|
|
6860
|
-
current === "" ? (0,
|
|
7145
|
+
(0, import_react10.createElement)("p", { style: { ...styles.hint, marginBottom: 10 }, title: current }, "\u5DE5\u4F5C\u533A \xB7 " + current),
|
|
7146
|
+
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 }) : tab === "flow" ? (0, import_react10.createElement)(TaskEngineSection, { workspace: current, remote }) : 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 })
|
|
6861
7147
|
)
|
|
6862
7148
|
)
|
|
6863
7149
|
);
|
|
6864
7150
|
}
|
|
6865
7151
|
|
|
6866
7152
|
// src/client/TriggerButton.tsx
|
|
6867
|
-
var
|
|
7153
|
+
var import_react11 = require("react");
|
|
6868
7154
|
var hover = "var(--dsw-alias-bg-layer-2)";
|
|
6869
|
-
var
|
|
7155
|
+
var label2 = "var(--dsw-alias-label-primary)";
|
|
6870
7156
|
function TriggerButton({ wide, actions }) {
|
|
6871
|
-
return (0,
|
|
7157
|
+
return (0, import_react11.createElement)(
|
|
6872
7158
|
"button",
|
|
6873
7159
|
{
|
|
6874
7160
|
type: "button",
|
|
@@ -6895,7 +7181,7 @@ function TriggerButton({ wide, actions }) {
|
|
|
6895
7181
|
border: "none",
|
|
6896
7182
|
background: "transparent",
|
|
6897
7183
|
cursor: "pointer",
|
|
6898
|
-
color:
|
|
7184
|
+
color: label2,
|
|
6899
7185
|
borderRadius: wide ? 12 : "50%",
|
|
6900
7186
|
padding: wide ? "0 10px 0 8px" : 0,
|
|
6901
7187
|
// The native settings row bleeds 2px past its seat on both sides so its
|
|
@@ -6908,8 +7194,8 @@ function TriggerButton({ wide, actions }) {
|
|
|
6908
7194
|
transition: "background 120ms ease"
|
|
6909
7195
|
}
|
|
6910
7196
|
},
|
|
6911
|
-
(0,
|
|
6912
|
-
wide ? (0,
|
|
7197
|
+
(0, import_react11.createElement)(IconSettings, { size: wide ? 16 : 18 }),
|
|
7198
|
+
wide ? (0, import_react11.createElement)("span", { style: { fontSize: 14, lineHeight: "22px" } }, "\u5DE5\u7A0B\u6D41\u7A0B") : null
|
|
6913
7199
|
);
|
|
6914
7200
|
}
|
|
6915
7201
|
|