@godv61/dsh-task-engine 0.28.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.adaptive-test.mjs +189 -0
- package/.hook-test.mjs +19 -2
- package/.workflow-test.mjs +6 -4
- package/README.md +22 -16
- package/docs/CHANGELOG.md +14 -1
- package/docs/README.md +6 -5
- package/docs/adaptive-workflows.md +72 -0
- package/docs/configuration.md +4 -4
- package/docs/faq.md +15 -7
- package/docs/getting-started.md +8 -5
- package/docs/manual-legacy.html +380 -0
- package/docs/manual.html +126 -380
- package/docs/roadmap.md +7 -8
- 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 +800 -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 +5 -4
- package/preset/enable.mjs +2 -2
- package/preset/persona.md +4 -2
- package/scripts/verify-dsh-compat.mjs +14 -3
- package/scripts/verify-package.mjs +7 -3
- 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 +6 -2
- 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);
|
|
@@ -4290,10 +4290,91 @@ var resourceRequestSchema = external_exports.object({
|
|
|
4290
4290
|
var resourcePreviewSchema = external_exports.object({ ok: external_exports.boolean(), name: external_exports.string(), description: external_exports.string(), content: external_exports.string(), target: external_exports.string(), files: external_exports.number(), bytes: external_exports.number(), hash: external_exports.string(), conflict: external_exports.boolean(), error: external_exports.string().optional() });
|
|
4291
4291
|
var resourceRootsRequestSchema = external_exports.object({ kind: external_exports.enum(["skill", "rule"]), path: external_exports.string() });
|
|
4292
4292
|
var resourceRootsSchema = external_exports.object({ project: external_exports.string(), user: external_exports.string() });
|
|
4293
|
+
var adaptiveConfigSchema = external_exports.object({
|
|
4294
|
+
meta_bindings: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())).optional(),
|
|
4295
|
+
sonar: external_exports.object({
|
|
4296
|
+
enabled: external_exports.boolean().optional(),
|
|
4297
|
+
host_url: external_exports.string().optional(),
|
|
4298
|
+
project_key: external_exports.string().optional(),
|
|
4299
|
+
mode: external_exports.enum(["branch", "pull-request"]).optional(),
|
|
4300
|
+
token_env: external_exports.string().optional()
|
|
4301
|
+
}).optional()
|
|
4302
|
+
});
|
|
4303
|
+
var adaptiveViewSchema = external_exports.object({
|
|
4304
|
+
ok: external_exports.boolean(),
|
|
4305
|
+
source: external_exports.enum(["default", "project", "invalid"]),
|
|
4306
|
+
config: adaptiveConfigSchema,
|
|
4307
|
+
hash: external_exports.string(),
|
|
4308
|
+
problems: external_exports.array(external_exports.string()),
|
|
4309
|
+
grades: external_exports.array(external_exports.object({ id: external_exports.string(), label: external_exports.string(), guidance: external_exports.string(), stages: external_exports.array(external_exports.string()) }))
|
|
4310
|
+
});
|
|
4311
|
+
var adaptiveWriteRequestSchema = external_exports.object({ path: external_exports.string(), config: adaptiveConfigSchema, expected_hash: external_exports.string() });
|
|
4312
|
+
var projectSkillProfileRequestSchema = external_exports.object({ path: external_exports.string(), name: external_exports.string() });
|
|
4313
|
+
var projectSkillProfileWriteRequestSchema = projectSkillProfileRequestSchema.extend({
|
|
4314
|
+
profile: skillProfileSchema,
|
|
4315
|
+
expected_hash: external_exports.string()
|
|
4316
|
+
});
|
|
4317
|
+
var projectSkillProfileViewSchema = external_exports.object({ profile: skillProfileSchema, hash: external_exports.string() });
|
|
4293
4318
|
var PACKAGE = "@godv61/dsh-task-engine";
|
|
4294
4319
|
var TYPERT_REMOTE = {
|
|
4295
4320
|
package: PACKAGE,
|
|
4296
4321
|
descriptors: [
|
|
4322
|
+
{
|
|
4323
|
+
id: `${PACKAGE}#task-engine/readAdaptive`,
|
|
4324
|
+
service: "taskEngineController",
|
|
4325
|
+
namespace: "task-engine",
|
|
4326
|
+
method: "readAdaptive",
|
|
4327
|
+
invocation: { kind: "direct" },
|
|
4328
|
+
parameters: [{
|
|
4329
|
+
name: "path",
|
|
4330
|
+
wire: "path",
|
|
4331
|
+
source: "json",
|
|
4332
|
+
codec: { mode: "strict", typeSymbol: "string", create: () => external_exports.string(), schema: external_exports.string() }
|
|
4333
|
+
}],
|
|
4334
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#AdaptiveConfigView`, create: () => adaptiveViewSchema, schema: adaptiveViewSchema }
|
|
4335
|
+
},
|
|
4336
|
+
{
|
|
4337
|
+
id: `${PACKAGE}#task-engine/writeAdaptive`,
|
|
4338
|
+
service: "taskEngineController",
|
|
4339
|
+
namespace: "task-engine",
|
|
4340
|
+
method: "writeAdaptive",
|
|
4341
|
+
invocation: { kind: "direct" },
|
|
4342
|
+
parameters: [{
|
|
4343
|
+
name: "request",
|
|
4344
|
+
wire: "request",
|
|
4345
|
+
source: "json",
|
|
4346
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#AdaptiveWriteRequest`, create: () => adaptiveWriteRequestSchema, schema: adaptiveWriteRequestSchema }
|
|
4347
|
+
}],
|
|
4348
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#AdaptiveConfigView`, create: () => adaptiveViewSchema, schema: adaptiveViewSchema }
|
|
4349
|
+
},
|
|
4350
|
+
{
|
|
4351
|
+
id: `${PACKAGE}#task-engine/readProjectSkillProfile`,
|
|
4352
|
+
service: "taskEngineController",
|
|
4353
|
+
namespace: "task-engine",
|
|
4354
|
+
method: "readProjectSkillProfile",
|
|
4355
|
+
invocation: { kind: "direct" },
|
|
4356
|
+
parameters: [{
|
|
4357
|
+
name: "request",
|
|
4358
|
+
wire: "request",
|
|
4359
|
+
source: "json",
|
|
4360
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ProjectSkillProfileRequest`, create: () => projectSkillProfileRequestSchema, schema: projectSkillProfileRequestSchema }
|
|
4361
|
+
}],
|
|
4362
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ProjectSkillProfileView`, create: () => projectSkillProfileViewSchema, schema: projectSkillProfileViewSchema }
|
|
4363
|
+
},
|
|
4364
|
+
{
|
|
4365
|
+
id: `${PACKAGE}#task-engine/writeProjectSkillProfile`,
|
|
4366
|
+
service: "taskEngineController",
|
|
4367
|
+
namespace: "task-engine",
|
|
4368
|
+
method: "writeProjectSkillProfile",
|
|
4369
|
+
invocation: { kind: "direct" },
|
|
4370
|
+
parameters: [{
|
|
4371
|
+
name: "request",
|
|
4372
|
+
wire: "request",
|
|
4373
|
+
source: "json",
|
|
4374
|
+
codec: { mode: "strict", typeSymbol: `${PACKAGE}/types#ProjectSkillProfileWriteRequest`, create: () => projectSkillProfileWriteRequestSchema, schema: projectSkillProfileWriteRequestSchema }
|
|
4375
|
+
}],
|
|
4376
|
+
result: { mode: "strict", typeSymbol: `${PACKAGE}/types#ProjectSkillProfileView`, create: () => projectSkillProfileViewSchema, schema: projectSkillProfileViewSchema }
|
|
4377
|
+
},
|
|
4297
4378
|
...["previewResource", "importResource"].map((method) => ({
|
|
4298
4379
|
id: `${PACKAGE}#task-engine/${method}`,
|
|
4299
4380
|
service: "taskEngineController",
|
|
@@ -4587,8 +4668,8 @@ var TYPERT_REMOTE = {
|
|
|
4587
4668
|
var remote_default = TYPERT_REMOTE;
|
|
4588
4669
|
|
|
4589
4670
|
// src/client/Workbench.tsx
|
|
4590
|
-
var
|
|
4591
|
-
var
|
|
4671
|
+
var import_react10 = require("react");
|
|
4672
|
+
var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4592
4673
|
|
|
4593
4674
|
// src/client/icons.ts
|
|
4594
4675
|
var primitives = __toESM(require("@deepseek-ai/dsh-client-ui-primitives"), 1);
|
|
@@ -5063,11 +5144,11 @@ function deriveCapabilities(config) {
|
|
|
5063
5144
|
if (config.commit.file_scope) caps.push("file_scope");
|
|
5064
5145
|
return caps;
|
|
5065
5146
|
}
|
|
5066
|
-
function preset(id, version,
|
|
5147
|
+
function preset(id, version, label3, description, config, recommendation) {
|
|
5067
5148
|
return {
|
|
5068
5149
|
id,
|
|
5069
5150
|
version,
|
|
5070
|
-
label:
|
|
5151
|
+
label: label3,
|
|
5071
5152
|
description,
|
|
5072
5153
|
capabilities: deriveCapabilities(config),
|
|
5073
5154
|
config,
|
|
@@ -5942,12 +6023,296 @@ async function save(remote, config, workspace, setSavedAt, setSource) {
|
|
|
5942
6023
|
}
|
|
5943
6024
|
}
|
|
5944
6025
|
|
|
5945
|
-
// src/client/
|
|
6026
|
+
// src/client/AdaptivePanel.tsx
|
|
5946
6027
|
var import_react4 = require("react");
|
|
5947
6028
|
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6029
|
+
|
|
6030
|
+
// src/adaptive.ts
|
|
6031
|
+
var META_STAGES = {
|
|
6032
|
+
"requirements-analysis": "\u9700\u6C42\u5206\u6790",
|
|
6033
|
+
"architecture-design": "\u67B6\u6784\u8BBE\u8BA1",
|
|
6034
|
+
"task-orchestration": "\u4EFB\u52A1\u7F16\u6392",
|
|
6035
|
+
"code-development": "\u4EE3\u7801\u5F00\u53D1",
|
|
6036
|
+
"test-validation": "\u6D4B\u8BD5",
|
|
6037
|
+
"code-review": "\u4EE3\u7801\u5BA1\u6838"
|
|
6038
|
+
};
|
|
6039
|
+
|
|
6040
|
+
// src/client/AdaptivePanel.tsx
|
|
6041
|
+
var card = {
|
|
6042
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
6043
|
+
borderRadius: 8,
|
|
6044
|
+
padding: "14px 16px",
|
|
6045
|
+
display: "flex",
|
|
6046
|
+
flexDirection: "column",
|
|
6047
|
+
gap: 8
|
|
6048
|
+
};
|
|
6049
|
+
var grid = { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(230px, 1fr))", gap: 10 };
|
|
6050
|
+
var row = { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" };
|
|
6051
|
+
var label = { fontSize: 12, color: "var(--dsw-alias-label-secondary)" };
|
|
6052
|
+
var input = {
|
|
6053
|
+
background: "var(--dsw-alias-bg-layer-1)",
|
|
6054
|
+
color: "var(--dsw-alias-label-primary)",
|
|
6055
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
6056
|
+
borderRadius: 6,
|
|
6057
|
+
padding: "6px 8px",
|
|
6058
|
+
minWidth: 180
|
|
6059
|
+
};
|
|
6060
|
+
var SOURCE_ORDER = ["project", "codex-project", "user", "bundled"];
|
|
6061
|
+
function effectiveSource(entries, name) {
|
|
6062
|
+
return entries.filter((entry) => entry.name === name).sort((a, b) => SOURCE_ORDER.indexOf(a.source) - SOURCE_ORDER.indexOf(b.source))[0]?.source ?? "\u7F3A\u5931";
|
|
6063
|
+
}
|
|
6064
|
+
function AdaptivePanel({ workspace, remote }) {
|
|
6065
|
+
const [view, setView] = (0, import_react4.useState)(null);
|
|
6066
|
+
const [draft, setDraft] = (0, import_react4.useState)({});
|
|
6067
|
+
const [skills, setSkills] = (0, import_react4.useState)([]);
|
|
6068
|
+
const [rules, setRules] = (0, import_react4.useState)([]);
|
|
6069
|
+
const [selected, setSelected] = (0, import_react4.useState)(null);
|
|
6070
|
+
const [loading, setLoading] = (0, import_react4.useState)(true);
|
|
6071
|
+
const [saving, setSaving] = (0, import_react4.useState)(false);
|
|
6072
|
+
const [dirty, setDirty] = (0, import_react4.useState)(false);
|
|
6073
|
+
const [message, setMessage] = (0, import_react4.useState)("");
|
|
6074
|
+
const refresh = (0, import_react4.useCallback)(() => {
|
|
6075
|
+
setLoading(true);
|
|
6076
|
+
setMessage("");
|
|
6077
|
+
void Promise.all([remote.readAdaptive(workspace), remote.listSkills(workspace), remote.listRules(workspace)]).then(([config, catalog, ruleCatalog]) => {
|
|
6078
|
+
setLoading(false);
|
|
6079
|
+
if (!config.ok) {
|
|
6080
|
+
setMessage("\u8BFB\u53D6\u81EA\u9002\u5E94\u914D\u7F6E\u5931\u8D25\uFF1A" + describeError(config.error));
|
|
6081
|
+
return;
|
|
6082
|
+
}
|
|
6083
|
+
if (!catalog.ok) {
|
|
6084
|
+
setMessage("\u8BFB\u53D6\u6280\u80FD\u76EE\u5F55\u5931\u8D25\uFF1A" + describeError(catalog.error));
|
|
6085
|
+
return;
|
|
6086
|
+
}
|
|
6087
|
+
if (!ruleCatalog.ok) {
|
|
6088
|
+
setMessage("\u8BFB\u53D6\u89C4\u5219\u76EE\u5F55\u5931\u8D25\uFF1A" + describeError(ruleCatalog.error));
|
|
6089
|
+
return;
|
|
6090
|
+
}
|
|
6091
|
+
setView(config.value);
|
|
6092
|
+
setDraft(config.value.config);
|
|
6093
|
+
setSkills(catalog.value.skills);
|
|
6094
|
+
setRules(ruleCatalog.value.rules);
|
|
6095
|
+
setDirty(false);
|
|
6096
|
+
}, (error) => {
|
|
6097
|
+
setLoading(false);
|
|
6098
|
+
setMessage("\u8BFB\u53D6\u5931\u8D25\uFF1A" + describeError(error));
|
|
6099
|
+
});
|
|
6100
|
+
}, [remote, workspace]);
|
|
6101
|
+
(0, import_react4.useEffect)(() => {
|
|
6102
|
+
refresh();
|
|
6103
|
+
}, [refresh]);
|
|
6104
|
+
const update = (config) => {
|
|
6105
|
+
setDraft(config);
|
|
6106
|
+
setDirty(true);
|
|
6107
|
+
setMessage("");
|
|
6108
|
+
};
|
|
6109
|
+
const addSkill = (meta, name) => {
|
|
6110
|
+
if (!name) return;
|
|
6111
|
+
const meta_bindings = { ...draft.meta_bindings, [meta]: [.../* @__PURE__ */ new Set([...draft.meta_bindings?.[meta] ?? [], name])] };
|
|
6112
|
+
update({ ...draft, meta_bindings });
|
|
6113
|
+
};
|
|
6114
|
+
const removeSkill = (meta, name) => {
|
|
6115
|
+
const meta_bindings = { ...draft.meta_bindings, [meta]: (draft.meta_bindings?.[meta] ?? []).filter((entry) => entry !== name) };
|
|
6116
|
+
update({ ...draft, meta_bindings });
|
|
6117
|
+
};
|
|
6118
|
+
const updateSonar = (patch) => {
|
|
6119
|
+
update({ ...draft, sonar: { mode: "branch", token_env: "SONAR_TOKEN", ...draft.sonar, ...patch } });
|
|
6120
|
+
};
|
|
6121
|
+
const openRules = (name) => {
|
|
6122
|
+
if (effectiveSource(skills, name) !== "project") {
|
|
6123
|
+
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`);
|
|
6124
|
+
return;
|
|
6125
|
+
}
|
|
6126
|
+
void remote.readProjectSkillProfile({ path: workspace, name }).then((result) => {
|
|
6127
|
+
if (!result.ok) {
|
|
6128
|
+
setMessage("\u8BFB\u53D6\u6280\u80FD\u89C4\u5219\u5931\u8D25\uFF1A" + describeError(result.error));
|
|
6129
|
+
return;
|
|
6130
|
+
}
|
|
6131
|
+
setSelected({ skill: { source: "project", name }, profile: result.value.profile, hash: result.value.hash });
|
|
6132
|
+
}, (error) => setMessage("\u8BFB\u53D6\u6280\u80FD\u89C4\u5219\u5931\u8D25\uFF1A" + describeError(error)));
|
|
6133
|
+
};
|
|
6134
|
+
const saveRules = async (profile) => {
|
|
6135
|
+
if (!selected) return;
|
|
6136
|
+
const result = await remote.writeProjectSkillProfile({
|
|
6137
|
+
path: workspace,
|
|
6138
|
+
name: selected.skill.name,
|
|
6139
|
+
profile,
|
|
6140
|
+
expected_hash: selected.hash
|
|
6141
|
+
});
|
|
6142
|
+
if (!result.ok) throw new Error("\u4FDD\u5B58\u6280\u80FD\u89C4\u5219\u5931\u8D25\uFF1A" + describeError(result.error));
|
|
6143
|
+
setSelected(null);
|
|
6144
|
+
setMessage(`\u5DF2\u4FDD\u5B58 ${selected.skill.name} \u7684\u9879\u76EE Rule\uFF1B\u65B0\u4EFB\u52A1\u5C06\u8BFB\u53D6\u6B64\u914D\u7F6E\u3002`);
|
|
6145
|
+
};
|
|
6146
|
+
const save2 = () => {
|
|
6147
|
+
if (!view) return;
|
|
6148
|
+
setSaving(true);
|
|
6149
|
+
void remote.writeAdaptive({ path: workspace, config: draft, expected_hash: view.hash }).then((result) => {
|
|
6150
|
+
setSaving(false);
|
|
6151
|
+
if (!result.ok) {
|
|
6152
|
+
setMessage("\u4FDD\u5B58\u5931\u8D25\uFF1A" + describeError(result.error));
|
|
6153
|
+
return;
|
|
6154
|
+
}
|
|
6155
|
+
setView(result.value);
|
|
6156
|
+
if (!result.value.ok) {
|
|
6157
|
+
setMessage("\u914D\u7F6E\u672A\u4FDD\u5B58\uFF1A" + result.value.problems.join("\uFF1B"));
|
|
6158
|
+
return;
|
|
6159
|
+
}
|
|
6160
|
+
setDraft(result.value.config);
|
|
6161
|
+
setDirty(false);
|
|
6162
|
+
setMessage("\u5DF2\u4FDD\u5B58\u5230 .dsh/meta.json\uFF1B\u53EA\u5F71\u54CD\u65B0\u5EFA\u4EFB\u52A1\u3002");
|
|
6163
|
+
}, (error) => {
|
|
6164
|
+
setSaving(false);
|
|
6165
|
+
setMessage("\u4FDD\u5B58\u5931\u8D25\uFF1A" + describeError(error));
|
|
6166
|
+
});
|
|
6167
|
+
};
|
|
6168
|
+
const candidates = [...new Set(skills.map((skill) => skill.name))].filter((name) => name !== "eng-delivery" && !(name in META_STAGES)).sort();
|
|
6169
|
+
const sonar = draft.sonar ?? {};
|
|
6170
|
+
return (0, import_react4.createElement)(
|
|
6171
|
+
"div",
|
|
6172
|
+
{ style: { ...styles.section, display: "flex", flexDirection: "column", gap: 16 } },
|
|
6173
|
+
(0, import_react4.createElement)(
|
|
6174
|
+
"div",
|
|
6175
|
+
{ style: card },
|
|
6176
|
+
(0, import_react4.createElement)("strong", null, "\u6309\u9700\u6C42\u9009\u62E9\u6D41\u7A0B"),
|
|
6177
|
+
(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"),
|
|
6178
|
+
(0, import_react4.createElement)("div", { style: grid }, ...(view?.grades ?? []).map((grade) => (0, import_react4.createElement)(
|
|
6179
|
+
"div",
|
|
6180
|
+
{ key: grade.id, style: { ...card, gap: 5 } },
|
|
6181
|
+
(0, import_react4.createElement)("strong", null, `${grade.label} \xB7 ${grade.id}`),
|
|
6182
|
+
(0, import_react4.createElement)("span", { style: label }, grade.guidance),
|
|
6183
|
+
(0, import_react4.createElement)("span", { style: { fontSize: 12 } }, grade.stages.join(" \u2192 "))
|
|
6184
|
+
)))
|
|
6185
|
+
),
|
|
6186
|
+
(0, import_react4.createElement)(
|
|
6187
|
+
"div",
|
|
6188
|
+
{ style: card },
|
|
6189
|
+
(0, import_react4.createElement)("strong", null, "\u5143\u6280\u80FD\u4E0E\u9879\u76EE\u6280\u80FD"),
|
|
6190
|
+
(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"),
|
|
6191
|
+
...Object.entries(META_STAGES).map(([id, stage]) => {
|
|
6192
|
+
const meta = id;
|
|
6193
|
+
const selected2 = draft.meta_bindings?.[meta] ?? [];
|
|
6194
|
+
return (0, import_react4.createElement)(
|
|
6195
|
+
"div",
|
|
6196
|
+
{ key: id, style: { ...card, gap: 6 } },
|
|
6197
|
+
(0, import_react4.createElement)("strong", null, stage),
|
|
6198
|
+
(0, import_react4.createElement)("span", { style: label }, `\u6838\u5FC3\uFF1A${id} \xB7 \u751F\u6548\u6765\u6E90\uFF1A${effectiveSource(skills, id)}`),
|
|
6199
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", onClick: () => openRules(id) }, "\u914D\u7F6E\u6838\u5FC3 Skill \u7684 Rule"),
|
|
6200
|
+
(0, import_react4.createElement)(
|
|
6201
|
+
"div",
|
|
6202
|
+
{ style: row },
|
|
6203
|
+
...selected2.map((name) => (0, import_react4.createElement)("button", {
|
|
6204
|
+
key: name,
|
|
6205
|
+
type: "button",
|
|
6206
|
+
title: "\u79FB\u9664\u6302\u8F7D",
|
|
6207
|
+
style: { ...input, minWidth: 0, cursor: "pointer" },
|
|
6208
|
+
onClick: () => removeSkill(meta, name)
|
|
6209
|
+
}, `${name} \xB7 ${effectiveSource(skills, name)} \xD7`)),
|
|
6210
|
+
...selected2.map((name) => (0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, {
|
|
6211
|
+
key: `rules-${name}`,
|
|
6212
|
+
variant: "outline",
|
|
6213
|
+
size: "sm",
|
|
6214
|
+
onClick: () => openRules(name)
|
|
6215
|
+
}, `\u914D\u7F6E ${name} \u7684 Rule`))
|
|
6216
|
+
),
|
|
6217
|
+
(0, import_react4.createElement)(
|
|
6218
|
+
"select",
|
|
6219
|
+
{
|
|
6220
|
+
style: input,
|
|
6221
|
+
"aria-label": `\u7ED9${stage}\u6302\u8F7D\u9879\u76EE\u6280\u80FD`,
|
|
6222
|
+
value: "",
|
|
6223
|
+
onChange: (event) => addSkill(meta, event.target.value)
|
|
6224
|
+
},
|
|
6225
|
+
(0, import_react4.createElement)("option", { value: "" }, "\u6302\u8F7D\u9644\u52A0\u6280\u80FD\u2026"),
|
|
6226
|
+
...candidates.filter((name) => !selected2.includes(name)).map((name) => (0, import_react4.createElement)("option", { key: name, value: name }, `${name} \xB7 ${effectiveSource(skills, name)}`))
|
|
6227
|
+
)
|
|
6228
|
+
);
|
|
6229
|
+
})
|
|
6230
|
+
),
|
|
6231
|
+
(0, import_react4.createElement)(
|
|
6232
|
+
"div",
|
|
6233
|
+
{ style: card },
|
|
6234
|
+
(0, import_react4.createElement)(
|
|
6235
|
+
"div",
|
|
6236
|
+
{ style: row },
|
|
6237
|
+
(0, import_react4.createElement)("strong", null, "SonarQube \u5BA1\u6838"),
|
|
6238
|
+
(0, import_react4.createElement)(
|
|
6239
|
+
"label",
|
|
6240
|
+
{ style: row },
|
|
6241
|
+
(0, import_react4.createElement)("input", {
|
|
6242
|
+
type: "checkbox",
|
|
6243
|
+
checked: sonar.enabled === true,
|
|
6244
|
+
onChange: (event) => updateSonar({ enabled: event.target.checked })
|
|
6245
|
+
}),
|
|
6246
|
+
"\u542F\u7528\uFF08\u4EC5\u4EE3\u7801\u5BA1\u6838\u9636\u6BB5\uFF09"
|
|
6247
|
+
)
|
|
6248
|
+
),
|
|
6249
|
+
(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"),
|
|
6250
|
+
sonar.enabled === true ? (0, import_react4.createElement)(
|
|
6251
|
+
"div",
|
|
6252
|
+
{ style: grid },
|
|
6253
|
+
...[
|
|
6254
|
+
["host_url", "\u670D\u52A1\u5730\u5740", "https://sonar.example"],
|
|
6255
|
+
["project_key", "\u9879\u76EE Key", "my-project"],
|
|
6256
|
+
["token_env", "Token \u73AF\u5883\u53D8\u91CF\u540D", "SONAR_TOKEN"]
|
|
6257
|
+
].map(([key, title, placeholder]) => (0, import_react4.createElement)(
|
|
6258
|
+
"label",
|
|
6259
|
+
{ key, style: { display: "flex", flexDirection: "column", gap: 4 } },
|
|
6260
|
+
(0, import_react4.createElement)("span", { style: label }, title),
|
|
6261
|
+
(0, import_react4.createElement)("input", {
|
|
6262
|
+
style: input,
|
|
6263
|
+
value: sonar[key] ?? "",
|
|
6264
|
+
placeholder,
|
|
6265
|
+
onChange: (event) => updateSonar({ [key]: event.target.value })
|
|
6266
|
+
})
|
|
6267
|
+
)),
|
|
6268
|
+
(0, import_react4.createElement)(
|
|
6269
|
+
"label",
|
|
6270
|
+
{ style: { display: "flex", flexDirection: "column", gap: 4 } },
|
|
6271
|
+
(0, import_react4.createElement)("span", { style: label }, "\u5206\u6790\u5BF9\u8C61"),
|
|
6272
|
+
(0, import_react4.createElement)(
|
|
6273
|
+
"select",
|
|
6274
|
+
{
|
|
6275
|
+
style: input,
|
|
6276
|
+
value: sonar.mode ?? "branch",
|
|
6277
|
+
onChange: (event) => updateSonar({ mode: event.target.value })
|
|
6278
|
+
},
|
|
6279
|
+
(0, import_react4.createElement)("option", { value: "branch" }, "\u5206\u652F"),
|
|
6280
|
+
(0, import_react4.createElement)("option", { value: "pull-request" }, "\u5408\u5E76\u8BF7\u6C42")
|
|
6281
|
+
)
|
|
6282
|
+
)
|
|
6283
|
+
) : null
|
|
6284
|
+
),
|
|
6285
|
+
(0, import_react4.createElement)(
|
|
6286
|
+
"div",
|
|
6287
|
+
{ style: row },
|
|
6288
|
+
(0, import_react4.createElement)(import_dsh_client_ui_primitives3.Button, { variant: "outline", size: "sm", disabled: loading || saving, onClick: refresh }, "\u5237\u65B0"),
|
|
6289
|
+
(0, import_react4.createElement)(
|
|
6290
|
+
import_dsh_client_ui_primitives3.Button,
|
|
6291
|
+
{ variant: "primary", size: "sm", disabled: loading || saving || !dirty, onClick: save2 },
|
|
6292
|
+
saving ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u81EA\u9002\u5E94\u914D\u7F6E"
|
|
6293
|
+
),
|
|
6294
|
+
(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")
|
|
6295
|
+
),
|
|
6296
|
+
message ? (0, import_react4.createElement)("p", { role: "status", style: styles.status }, message) : null,
|
|
6297
|
+
view?.problems.length ? (0, import_react4.createElement)("p", { role: "alert", style: styles.status }, view.problems.join("\uFF1B")) : null,
|
|
6298
|
+
selected ? (0, import_react4.createElement)(SkillRuleDialog, {
|
|
6299
|
+
key: `${selected.skill.source}:${selected.skill.name}`,
|
|
6300
|
+
skill: selected.skill,
|
|
6301
|
+
profile: selected.profile,
|
|
6302
|
+
rules,
|
|
6303
|
+
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",
|
|
6304
|
+
onSave: saveRules,
|
|
6305
|
+
onClose: () => setSelected(null)
|
|
6306
|
+
}) : null
|
|
6307
|
+
);
|
|
6308
|
+
}
|
|
6309
|
+
|
|
6310
|
+
// src/client/InitPanel.tsx
|
|
6311
|
+
var import_react5 = require("react");
|
|
6312
|
+
var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5948
6313
|
var MD_LABELS = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
5949
6314
|
var INIT_TIMEOUT_S = 150;
|
|
5950
|
-
var
|
|
6315
|
+
var card2 = {
|
|
5951
6316
|
display: "flex",
|
|
5952
6317
|
flexDirection: "column",
|
|
5953
6318
|
gap: 12,
|
|
@@ -5956,14 +6321,14 @@ var card = {
|
|
|
5956
6321
|
padding: "12px 14px"
|
|
5957
6322
|
};
|
|
5958
6323
|
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,
|
|
6324
|
+
const [view, setView] = (0, import_react5.useState)(null);
|
|
6325
|
+
const [generating, setGenerating] = (0, import_react5.useState)(false);
|
|
6326
|
+
const [elapsed, setElapsed] = (0, import_react5.useState)(0);
|
|
6327
|
+
const [draft, setDraft] = (0, import_react5.useState)(null);
|
|
6328
|
+
const [editing, setEditing] = (0, import_react5.useState)(false);
|
|
6329
|
+
const [body2, setBody] = (0, import_react5.useState)("");
|
|
6330
|
+
const [msg, setMsg] = (0, import_react5.useState)("");
|
|
6331
|
+
(0, import_react5.useEffect)(() => {
|
|
5967
6332
|
if (!generating) {
|
|
5968
6333
|
setElapsed(0);
|
|
5969
6334
|
return;
|
|
@@ -5977,13 +6342,13 @@ function InitPanel({ workspace, remote }) {
|
|
|
5977
6342
|
clearInterval(timer);
|
|
5978
6343
|
};
|
|
5979
6344
|
}, [generating]);
|
|
5980
|
-
const refresh = (0,
|
|
6345
|
+
const refresh = (0, import_react5.useCallback)(() => {
|
|
5981
6346
|
void remote.readInit(workspace).then((r) => {
|
|
5982
6347
|
if (r.ok) setView(r.value);
|
|
5983
6348
|
}, () => {
|
|
5984
6349
|
});
|
|
5985
6350
|
}, [remote, workspace]);
|
|
5986
|
-
(0,
|
|
6351
|
+
(0, import_react5.useEffect)(() => {
|
|
5987
6352
|
refresh();
|
|
5988
6353
|
}, [refresh]);
|
|
5989
6354
|
const generate = async () => {
|
|
@@ -6026,45 +6391,45 @@ function InitPanel({ workspace, remote }) {
|
|
|
6026
6391
|
setMsg("");
|
|
6027
6392
|
};
|
|
6028
6393
|
const exists = view?.exists === true;
|
|
6029
|
-
return (0,
|
|
6394
|
+
return (0, import_react5.createElement)(
|
|
6030
6395
|
"div",
|
|
6031
6396
|
{ style: styles.section },
|
|
6032
|
-
(0,
|
|
6397
|
+
(0, import_react5.createElement)(
|
|
6033
6398
|
"div",
|
|
6034
|
-
{ style:
|
|
6035
|
-
(0,
|
|
6399
|
+
{ style: card2 },
|
|
6400
|
+
(0, import_react5.createElement)(
|
|
6036
6401
|
"div",
|
|
6037
6402
|
{ style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" } },
|
|
6038
|
-
(0,
|
|
6039
|
-
(0,
|
|
6040
|
-
view?.path !== void 0 ? (0,
|
|
6403
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.StateDot, { state: exists ? "done" : "ongoing" }),
|
|
6404
|
+
(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"),
|
|
6405
|
+
view?.path !== void 0 ? (0, import_react5.createElement)("span", { style: styles.sourceBadge }, `\u5DF2\u5B9A\u4F4D\u5230 ${view.path}`) : null
|
|
6041
6406
|
),
|
|
6042
|
-
(0,
|
|
6407
|
+
(0, import_react5.createElement)(
|
|
6043
6408
|
"p",
|
|
6044
6409
|
{ style: styles.muted },
|
|
6045
6410
|
"\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
6411
|
),
|
|
6047
|
-
exists && !editing && draft === null ? (0,
|
|
6412
|
+
exists && !editing && draft === null ? (0, import_react5.createElement)(
|
|
6048
6413
|
"div",
|
|
6049
6414
|
{ style: styles.mdPreview },
|
|
6050
|
-
(0,
|
|
6415
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.MarkdownText, { text: view.content, labels: MD_LABELS })
|
|
6051
6416
|
) : null,
|
|
6052
|
-
draft !== null ? (0,
|
|
6417
|
+
draft !== null ? (0, import_react5.createElement)(
|
|
6053
6418
|
"div",
|
|
6054
6419
|
{ style: styles.section },
|
|
6055
|
-
(0,
|
|
6420
|
+
(0, import_react5.createElement)(
|
|
6056
6421
|
"div",
|
|
6057
6422
|
{ style: styles.sourceRow },
|
|
6058
|
-
(0,
|
|
6059
|
-
(0,
|
|
6423
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.StateDot, { state: "ongoing", size: 8 }),
|
|
6424
|
+
(0, import_react5.createElement)("span", { style: styles.sourceBadge }, `AI \u8349\u7A3F \xB7 ${draft.lines} \u884C \xB7 \u5C1A\u672A\u5199\u5165`)
|
|
6060
6425
|
),
|
|
6061
|
-
(0,
|
|
6426
|
+
(0, import_react5.createElement)(
|
|
6062
6427
|
"div",
|
|
6063
6428
|
{ style: styles.mdPreview },
|
|
6064
|
-
(0,
|
|
6429
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.MarkdownText, { text: draft.content, labels: MD_LABELS })
|
|
6065
6430
|
)
|
|
6066
6431
|
) : null,
|
|
6067
|
-
editing ? (0,
|
|
6432
|
+
editing ? (0, import_react5.createElement)("textarea", {
|
|
6068
6433
|
style: { ...styles.textarea, minHeight: 300 },
|
|
6069
6434
|
placeholder: "AGENTS.md \u6B63\u6587\uFF08Markdown\uFF0C\u2264200 \u884C\uFF09",
|
|
6070
6435
|
value: body2,
|
|
@@ -6072,16 +6437,16 @@ function InitPanel({ workspace, remote }) {
|
|
|
6072
6437
|
setBody(ev.target.value);
|
|
6073
6438
|
}
|
|
6074
6439
|
}) : null,
|
|
6075
|
-
generating ? (0,
|
|
6440
|
+
generating ? (0, import_react5.createElement)(
|
|
6076
6441
|
"p",
|
|
6077
6442
|
{ style: styles.status },
|
|
6078
6443
|
`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
6444
|
) : null,
|
|
6080
|
-
msg !== "" ? (0,
|
|
6081
|
-
draft !== null ? (0,
|
|
6445
|
+
msg !== "" ? (0, import_react5.createElement)("p", { style: styles.status }, msg) : null,
|
|
6446
|
+
draft !== null ? (0, import_react5.createElement)(
|
|
6082
6447
|
"div",
|
|
6083
6448
|
{ style: styles.row },
|
|
6084
|
-
(0,
|
|
6449
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6085
6450
|
variant: "primary",
|
|
6086
6451
|
size: "md",
|
|
6087
6452
|
disabled: draft.lines > 200,
|
|
@@ -6090,14 +6455,14 @@ function InitPanel({ workspace, remote }) {
|
|
|
6090
6455
|
void write(draft.content, exists);
|
|
6091
6456
|
}
|
|
6092
6457
|
}, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
|
|
6093
|
-
draft.lines > 200 ? (0,
|
|
6094
|
-
(0,
|
|
6458
|
+
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,
|
|
6459
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "md", onClick: () => {
|
|
6095
6460
|
setDraft(null);
|
|
6096
6461
|
} }, "\u653E\u5F03")
|
|
6097
|
-
) : editing ? (0,
|
|
6462
|
+
) : editing ? (0, import_react5.createElement)(
|
|
6098
6463
|
"div",
|
|
6099
6464
|
{ style: styles.row },
|
|
6100
|
-
(0,
|
|
6465
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6101
6466
|
variant: "primary",
|
|
6102
6467
|
size: "md",
|
|
6103
6468
|
disabled: body2.trim() === "",
|
|
@@ -6106,13 +6471,13 @@ function InitPanel({ workspace, remote }) {
|
|
|
6106
6471
|
void write(body2, exists);
|
|
6107
6472
|
}
|
|
6108
6473
|
}, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
|
|
6109
|
-
(0,
|
|
6474
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "ghost", size: "md", onClick: () => {
|
|
6110
6475
|
setEditing(false);
|
|
6111
6476
|
} }, "\u53D6\u6D88")
|
|
6112
|
-
) : (0,
|
|
6477
|
+
) : (0, import_react5.createElement)(
|
|
6113
6478
|
"div",
|
|
6114
6479
|
{ style: styles.row },
|
|
6115
|
-
(0,
|
|
6480
|
+
(0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, {
|
|
6116
6481
|
variant: "primary",
|
|
6117
6482
|
size: "md",
|
|
6118
6483
|
disabled: generating,
|
|
@@ -6121,55 +6486,55 @@ function InitPanel({ workspace, remote }) {
|
|
|
6121
6486
|
void generate();
|
|
6122
6487
|
}
|
|
6123
6488
|
}, exists ? "\u91CD\u65B0\u521D\u59CB\u5316\uFF08AI \u626B\u63CF\u8986\u76D6\uFF09" : "\u8BA9 AI \u521D\u59CB\u5316"),
|
|
6124
|
-
exists ? (0,
|
|
6489
|
+
exists ? (0, import_react5.createElement)(import_dsh_client_ui_primitives4.Button, { variant: "outline", size: "md", onClick: startEdit }, "\u624B\u52A8\u7F16\u8F91") : null
|
|
6125
6490
|
)
|
|
6126
6491
|
)
|
|
6127
6492
|
);
|
|
6128
6493
|
}
|
|
6129
6494
|
|
|
6130
6495
|
// src/client/SkillManager.tsx
|
|
6131
|
-
var
|
|
6496
|
+
var import_react7 = require("react");
|
|
6132
6497
|
|
|
6133
6498
|
// src/client/ResourceManager.tsx
|
|
6134
|
-
var
|
|
6135
|
-
var
|
|
6499
|
+
var import_react6 = require("react");
|
|
6500
|
+
var import_dsh_client_ui_primitives5 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6136
6501
|
var labels = { code: { copyLabel: "\u590D\u5236", copiedLabel: "\u5DF2\u590D\u5236" }, footnotes: "\u811A\u6CE8" };
|
|
6137
|
-
var levelOf = (
|
|
6502
|
+
var levelOf = (row2) => row2.source === "bundled" ? "bundled" : row2.source.startsWith("user") ? "user" : "project";
|
|
6138
6503
|
var sourceText2 = (source) => source === "bundled" ? "\u5185\u7F6E" : source === "codex-project" ? "\u9879\u76EE \xB7 Codex" : source.startsWith("user") ? "\u4E2A\u4EBA" : "\u9879\u76EE";
|
|
6139
6504
|
var sizeText = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1024 * 1024 ? `${(bytes / 1024).toFixed(1)} KB` : `${(bytes / 1024 / 1024).toFixed(1)} MB`;
|
|
6140
6505
|
var fail = (r) => describeError(r.error ?? "\u64CD\u4F5C\u5931\u8D25");
|
|
6141
6506
|
function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
6142
6507
|
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,
|
|
6508
|
+
const [rows, setRows] = (0, import_react6.useState)([]);
|
|
6509
|
+
const [query, setQuery] = (0, import_react6.useState)("");
|
|
6510
|
+
const [filter, setFilter] = (0, import_react6.useState)("all");
|
|
6511
|
+
const [notice, setNotice] = (0, import_react6.useState)("");
|
|
6512
|
+
const [error, setError] = (0, import_react6.useState)("");
|
|
6513
|
+
const [loading, setLoading] = (0, import_react6.useState)(true);
|
|
6514
|
+
const [revision, refresh] = (0, import_react6.useState)(0);
|
|
6515
|
+
const [busy, setBusy] = (0, import_react6.useState)(false);
|
|
6516
|
+
const [roots, setRoots] = (0, import_react6.useState)(null);
|
|
6517
|
+
const [importing, setImporting] = (0, import_react6.useState)(false);
|
|
6518
|
+
const [request, setRequest] = (0, import_react6.useState)(null);
|
|
6519
|
+
const [preview, setPreview] = (0, import_react6.useState)(null);
|
|
6520
|
+
const [level, setLevel] = (0, import_react6.useState)("project");
|
|
6521
|
+
const [manual, setManual] = (0, import_react6.useState)(false);
|
|
6522
|
+
const [sourceDir, setSourceDir] = (0, import_react6.useState)("");
|
|
6523
|
+
const [dirs, setDirs] = (0, import_react6.useState)([]);
|
|
6524
|
+
const [browsePath, setBrowsePath] = (0, import_react6.useState)("");
|
|
6525
|
+
const [editing, setEditing] = (0, import_react6.useState)(null);
|
|
6526
|
+
const [viewing, setViewing] = (0, import_react6.useState)(false);
|
|
6527
|
+
const [name, setName] = (0, import_react6.useState)("");
|
|
6528
|
+
const [description, setDescription] = (0, import_react6.useState)("");
|
|
6529
|
+
const [whenToUse, setWhenToUse] = (0, import_react6.useState)("");
|
|
6530
|
+
const [body2, setBody] = (0, import_react6.useState)("");
|
|
6531
|
+
const [templateSource, setTemplateSource] = (0, import_react6.useState)(null);
|
|
6532
|
+
const [deleting, setDeleting] = (0, import_react6.useState)(null);
|
|
6533
|
+
const input2 = (0, import_react6.useRef)(null);
|
|
6534
|
+
const fileEpoch = (0, import_react6.useRef)(0);
|
|
6535
|
+
const browseEpoch = (0, import_react6.useRef)(0);
|
|
6171
6536
|
const readonly = editing !== null && editing !== "new" && (levelOf(editing) === "bundled" || editing.source === "codex-project");
|
|
6172
|
-
(0,
|
|
6537
|
+
(0, import_react6.useEffect)(() => {
|
|
6173
6538
|
let active = true;
|
|
6174
6539
|
setLoading(true);
|
|
6175
6540
|
setRows([]);
|
|
@@ -6196,7 +6561,7 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6196
6561
|
fileEpoch.current++;
|
|
6197
6562
|
};
|
|
6198
6563
|
}, [workspace, remote, kind, revision]);
|
|
6199
|
-
(0,
|
|
6564
|
+
(0, import_react6.useEffect)(() => {
|
|
6200
6565
|
let active = true;
|
|
6201
6566
|
setPreview(null);
|
|
6202
6567
|
if (!request) return;
|
|
@@ -6228,9 +6593,9 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6228
6593
|
};
|
|
6229
6594
|
const choose = () => {
|
|
6230
6595
|
setError("");
|
|
6231
|
-
if (
|
|
6232
|
-
|
|
6233
|
-
|
|
6596
|
+
if (input2.current) {
|
|
6597
|
+
input2.current.value = "";
|
|
6598
|
+
input2.current.click();
|
|
6234
6599
|
}
|
|
6235
6600
|
};
|
|
6236
6601
|
const selected = async (files) => {
|
|
@@ -6293,24 +6658,24 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6293
6658
|
if (epoch === browseEpoch.current) setError(describeError(e));
|
|
6294
6659
|
}
|
|
6295
6660
|
};
|
|
6296
|
-
const edit = async (
|
|
6661
|
+
const edit = async (row2, view = false) => {
|
|
6297
6662
|
setTemplateSource(null);
|
|
6298
|
-
setEditing(
|
|
6663
|
+
setEditing(row2);
|
|
6299
6664
|
setViewing(view);
|
|
6300
|
-
setName(
|
|
6665
|
+
setName(row2 === "new" ? "" : row2.name);
|
|
6301
6666
|
setDescription("");
|
|
6302
6667
|
setWhenToUse("");
|
|
6303
6668
|
setBody("");
|
|
6304
6669
|
setError("");
|
|
6305
|
-
if (
|
|
6670
|
+
if (row2 === "new") {
|
|
6306
6671
|
setLevel("project");
|
|
6307
6672
|
return;
|
|
6308
6673
|
}
|
|
6309
|
-
const lvl = levelOf(
|
|
6674
|
+
const lvl = levelOf(row2);
|
|
6310
6675
|
setLevel(lvl === "user" ? "user" : "project");
|
|
6311
6676
|
setBusy(true);
|
|
6312
6677
|
try {
|
|
6313
|
-
const r = kind === "skill" ? await remote.readSkill({ name:
|
|
6678
|
+
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
6679
|
if (!r.ok) throw new Error(fail(r));
|
|
6315
6680
|
if (!r.value.ok) throw new Error(r.value.error ?? "\u8BFB\u53D6\u5931\u8D25");
|
|
6316
6681
|
setBody(r.value.content);
|
|
@@ -6325,16 +6690,16 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6325
6690
|
setBusy(false);
|
|
6326
6691
|
}
|
|
6327
6692
|
};
|
|
6328
|
-
const copyTemplate = async (
|
|
6329
|
-
if (busy || levelOf(
|
|
6693
|
+
const copyTemplate = async (row2) => {
|
|
6694
|
+
if (busy || levelOf(row2) !== "bundled") return;
|
|
6330
6695
|
setBusy(true);
|
|
6331
6696
|
setError("");
|
|
6332
6697
|
try {
|
|
6333
|
-
const r = kind === "skill" ? await remote.readSkill({ name:
|
|
6698
|
+
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
6699
|
if (!r.ok) throw new Error(fail(r));
|
|
6335
6700
|
if (!r.value.ok) throw new Error(r.value.error ?? "\u8BFB\u53D6\u5185\u7F6E\u6837\u672C\u5931\u8D25");
|
|
6336
6701
|
const used = new Set(rows.map((item) => item.name));
|
|
6337
|
-
const base = `${
|
|
6702
|
+
const base = `${row2.name}-copy`;
|
|
6338
6703
|
let candidate = base;
|
|
6339
6704
|
for (let index = 2; used.has(candidate); index++) candidate = `${base}-${index}`;
|
|
6340
6705
|
setName(candidate);
|
|
@@ -6349,7 +6714,7 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6349
6714
|
setDescription("");
|
|
6350
6715
|
setWhenToUse("");
|
|
6351
6716
|
}
|
|
6352
|
-
setTemplateSource(
|
|
6717
|
+
setTemplateSource(row2);
|
|
6353
6718
|
setEditing("new");
|
|
6354
6719
|
setNotice("");
|
|
6355
6720
|
} catch (e) {
|
|
@@ -6398,104 +6763,104 @@ function ResourceManager({ workspace, remote, kind, onConfigureSkill }) {
|
|
|
6398
6763
|
setBusy(false);
|
|
6399
6764
|
}
|
|
6400
6765
|
};
|
|
6401
|
-
const status = () => error ? (0,
|
|
6402
|
-
const targets = () => (0,
|
|
6766
|
+
const status = () => error ? (0, import_react6.createElement)("div", { className: "te-alert", role: "alert" }, error) : null;
|
|
6767
|
+
const targets = () => (0, import_react6.createElement)(
|
|
6403
6768
|
"div",
|
|
6404
6769
|
{ className: "te-targets" },
|
|
6405
|
-
...["project", "user"].map((lvl) => (0,
|
|
6770
|
+
...["project", "user"].map((lvl) => (0, import_react6.createElement)(
|
|
6406
6771
|
"button",
|
|
6407
6772
|
{ type: "button", key: lvl, className: `te-target ${level === lvl ? "selected" : ""}`, "aria-pressed": level === lvl, disabled: busy || editing !== null && editing !== "new", onClick: () => {
|
|
6408
6773
|
setPreview(null);
|
|
6409
6774
|
setLevel(lvl);
|
|
6410
6775
|
} },
|
|
6411
|
-
(0,
|
|
6412
|
-
(0,
|
|
6776
|
+
(0, import_react6.createElement)("strong", null, lvl === "project" ? "\u9879\u76EE\u5171\u4EAB" : "\u4E2A\u4EBA\u5168\u5C40"),
|
|
6777
|
+
(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
6778
|
)),
|
|
6414
|
-
(0,
|
|
6779
|
+
(0, import_react6.createElement)("code", { className: "te-path" }, roots?.[level] ?? (level === "project" ? `${workspace}/.dsh/${kind}s` : `DSH_HOME/${kind}s`))
|
|
6415
6780
|
);
|
|
6416
6781
|
const visible = rows.filter((r) => `${r.name} ${r.description ?? ""}`.toLowerCase().includes(query.toLowerCase()) && (filter === "all" || levelOf(r) === filter));
|
|
6417
|
-
return (0,
|
|
6782
|
+
return (0, import_react6.createElement)(
|
|
6418
6783
|
"section",
|
|
6419
6784
|
{ className: "te-resource" },
|
|
6420
|
-
(0,
|
|
6785
|
+
(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
6786
|
void selected(Array.from(e.target.files ?? []));
|
|
6422
6787
|
} }),
|
|
6423
|
-
(0,
|
|
6788
|
+
(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
6789
|
void edit("new");
|
|
6425
|
-
} }, `\u65B0\u5EFA${noun}`), (0,
|
|
6426
|
-
(0,
|
|
6427
|
-
notice ? (0,
|
|
6790
|
+
} }, `\u65B0\u5EFA${noun}`), (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "primary", onClick: choose }, `\u5B89\u88C5${noun}`))),
|
|
6791
|
+
(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")),
|
|
6792
|
+
notice ? (0, import_react6.createElement)("div", { className: "te-success", role: "status" }, notice) : null,
|
|
6428
6793
|
!importing && !editing && !deleting ? status() : null,
|
|
6429
|
-
loading ? (0,
|
|
6794
|
+
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
6795
|
"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(
|
|
6796
|
+
{ className: "te-resource-card", key: row2.source + "/" + row2.name },
|
|
6797
|
+
(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))),
|
|
6798
|
+
(0, import_react6.createElement)("h3", null, row2.name),
|
|
6799
|
+
(0, import_react6.createElement)("p", null, row2.description || "\u9879\u76EE\u7EA6\u5B9A\u4E0E\u6267\u884C\u89C4\u5219"),
|
|
6800
|
+
(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: () => {
|
|
6801
|
+
void edit(row2, true);
|
|
6802
|
+
} }, "\u67E5\u770B"), levelOf(row2) === "bundled" ? (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "ghost", size: "sm", disabled: busy, onClick: () => {
|
|
6803
|
+
void copyTemplate(row2);
|
|
6804
|
+
} }, "\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: () => {
|
|
6805
|
+
void edit(row2);
|
|
6806
|
+
} }, "\u7F16\u8F91") : null, levelOf(row2) !== "bundled" && row2.source !== "codex-project" ? (0, import_react6.createElement)("button", { className: "te-delete", onClick: () => {
|
|
6807
|
+
setDeleting(row2);
|
|
6443
6808
|
setError("");
|
|
6444
6809
|
} }, "\u5220\u9664") : null)
|
|
6445
6810
|
))),
|
|
6446
|
-
kind === "skill" ? (0,
|
|
6811
|
+
kind === "skill" ? (0, import_react6.createElement)("button", { className: "te-link", onClick: () => {
|
|
6447
6812
|
setImporting(true);
|
|
6448
6813
|
setManual(true);
|
|
6449
6814
|
setError("");
|
|
6450
6815
|
} }, "\u9AD8\u7EA7\uFF1A\u4ECE Harness \u4E3B\u673A\u8DEF\u5F84\u5B89\u88C5") : null,
|
|
6451
|
-
importing ? (0,
|
|
6816
|
+
importing ? (0, import_react6.createElement)(
|
|
6452
6817
|
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,
|
|
6818
|
+
{ 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
6819
|
void install();
|
|
6455
6820
|
} }, busy ? "\u5904\u7406\u4E2D\u2026" : "\u786E\u8BA4\u5B89\u88C5")) },
|
|
6456
6821
|
targets(),
|
|
6457
|
-
(0,
|
|
6458
|
-
manual ? (0,
|
|
6822
|
+
(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),
|
|
6823
|
+
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
6824
|
setSourceDir(e.target.value);
|
|
6460
6825
|
setRequest(null);
|
|
6461
|
-
} }), (0,
|
|
6826
|
+
} }), (0, import_react6.createElement)(import_dsh_client_ui_primitives5.Button, { variant: "outline", onClick: () => {
|
|
6462
6827
|
void browse(sourceDir);
|
|
6463
|
-
} }, "\u6D4F\u89C8"), (0,
|
|
6828
|
+
} }, "\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
6829
|
void browse(browsePath.replace(/[\\/][^\\/]+[\\/]?$/u, "") || "/");
|
|
6465
|
-
} }, "\u2191 \u4E0A\u7EA7\u76EE\u5F55") : null, ...dirs.map((d) => (0,
|
|
6830
|
+
} }, "\u2191 \u4E0A\u7EA7\u76EE\u5F55") : null, ...dirs.map((d) => (0, import_react6.createElement)("button", { key: d.name, onClick: () => {
|
|
6466
6831
|
setRequest(null);
|
|
6467
6832
|
void browse(browsePath.replace(/[\\/]+$/u, "") + "/" + d.name);
|
|
6468
6833
|
} }, d.name + (d.hasSkill ? " \xB7 SKILL.md" : ""))))) : null,
|
|
6469
|
-
busy ? (0,
|
|
6834
|
+
busy ? (0, import_react6.createElement)("p", { role: "status" }, "\u6B63\u5728\u6821\u9A8C\u6587\u4EF6\uFF0C\u8BF7\u7A0D\u5019\u2026") : null,
|
|
6470
6835
|
status(),
|
|
6471
|
-
preview ? (0,
|
|
6836
|
+
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
6837
|
) : null,
|
|
6473
|
-
editing ? (0,
|
|
6838
|
+
editing ? (0, import_react6.createElement)(
|
|
6474
6839
|
ResourceModal,
|
|
6475
|
-
{ title: editing === "new" ? `\u65B0\u5EFA${noun}` : `${viewing ? "\u67E5\u770B" : "\u7F16\u8F91"}${noun} \xB7 ${name}`, onClose: close, footer: (0,
|
|
6840
|
+
{ 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
6841
|
void copyTemplate(editing);
|
|
6477
|
-
} }, "\u4EE5\u6B64\u4E3A\u6A21\u677F\u65B0\u5EFA") : null, !readonly ? (0,
|
|
6842
|
+
} }, "\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
6843
|
void save2();
|
|
6479
6844
|
} }, busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58") : null) },
|
|
6480
|
-
!readonly ? targets() : (0,
|
|
6481
|
-
templateSource ? (0,
|
|
6845
|
+
!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"),
|
|
6846
|
+
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
6847
|
status(),
|
|
6483
|
-
viewing ? (0,
|
|
6848
|
+
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
6849
|
) : null,
|
|
6485
|
-
deleting ? (0,
|
|
6850
|
+
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
6851
|
void remove();
|
|
6487
|
-
} }, busy ? "\u5220\u9664\u4E2D\u2026" : "\u786E\u8BA4\u6C38\u4E45\u5220\u9664")) }, (0,
|
|
6852
|
+
} }, 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
6853
|
);
|
|
6489
6854
|
}
|
|
6490
6855
|
|
|
6491
6856
|
// src/client/SkillManager.tsx
|
|
6492
6857
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
6493
6858
|
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,
|
|
6859
|
+
const [config, setConfig] = (0, import_react7.useState)(null);
|
|
6860
|
+
const [rules, setRules] = (0, import_react7.useState)([]);
|
|
6861
|
+
const [selected, setSelected] = (0, import_react7.useState)(null);
|
|
6862
|
+
const [message, setMessage] = (0, import_react7.useState)("");
|
|
6863
|
+
(0, import_react7.useEffect)(() => {
|
|
6499
6864
|
let active = true;
|
|
6500
6865
|
void Promise.all([remote.read(workspace), remote.listRules(workspace)]).then(([saved, availableRules]) => {
|
|
6501
6866
|
if (!active) return;
|
|
@@ -6560,15 +6925,15 @@ function SkillManager({ workspace, remote }) {
|
|
|
6560
6925
|
}
|
|
6561
6926
|
|
|
6562
6927
|
// src/client/RuleManager.tsx
|
|
6563
|
-
var
|
|
6928
|
+
var import_react8 = require("react");
|
|
6564
6929
|
function RuleManager(props) {
|
|
6565
|
-
return (0,
|
|
6930
|
+
return (0, import_react8.createElement)(ResourceManager, { ...props, key: props.workspace, kind: "rule" });
|
|
6566
6931
|
}
|
|
6567
6932
|
|
|
6568
6933
|
// src/client/TaskLedger.tsx
|
|
6569
|
-
var
|
|
6570
|
-
var
|
|
6571
|
-
var
|
|
6934
|
+
var import_react9 = require("react");
|
|
6935
|
+
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6936
|
+
var card3 = {
|
|
6572
6937
|
display: "flex",
|
|
6573
6938
|
flexDirection: "column",
|
|
6574
6939
|
gap: 10,
|
|
@@ -6605,10 +6970,10 @@ var badge = {
|
|
|
6605
6970
|
color: "var(--dsw-alias-label-secondary)"
|
|
6606
6971
|
};
|
|
6607
6972
|
function verdictDot(outcome) {
|
|
6608
|
-
return (0,
|
|
6973
|
+
return (0, import_react9.createElement)(import_dsh_client_ui_primitives6.StateDot, { state: outcome === "pass" ? "done" : "error" });
|
|
6609
6974
|
}
|
|
6610
6975
|
function itemStatusDot(status) {
|
|
6611
|
-
return (0,
|
|
6976
|
+
return (0, import_react9.createElement)(import_dsh_client_ui_primitives6.StateDot, { state: status === "done" ? "done" : "ongoing" });
|
|
6612
6977
|
}
|
|
6613
6978
|
function timeText(at) {
|
|
6614
6979
|
return at.slice(0, 19).replace("T", " ");
|
|
@@ -6616,48 +6981,48 @@ function timeText(at) {
|
|
|
6616
6981
|
function itemAudit(item) {
|
|
6617
6982
|
const lines = [];
|
|
6618
6983
|
if (item.dispatch !== void 0) {
|
|
6619
|
-
lines.push((0,
|
|
6984
|
+
lines.push((0, import_react9.createElement)(
|
|
6620
6985
|
"div",
|
|
6621
6986
|
{ key: "dispatch", style: metaLine },
|
|
6622
|
-
(0,
|
|
6623
|
-
(0,
|
|
6624
|
-
(0,
|
|
6987
|
+
(0, import_react9.createElement)("span", { style: badge }, "\u5DF2\u6D3E\u53D1"),
|
|
6988
|
+
(0, import_react9.createElement)("span", null, item.dispatch.description === "" ? "\uFF08\u65E0\u63CF\u8FF0\uFF09" : item.dispatch.description),
|
|
6989
|
+
(0, import_react9.createElement)("span", { style: badge }, timeText(item.dispatch.at))
|
|
6625
6990
|
));
|
|
6626
6991
|
}
|
|
6627
6992
|
if (item.review !== void 0) {
|
|
6628
6993
|
const spec = item.review.spec;
|
|
6629
6994
|
const quality = item.review.quality;
|
|
6630
|
-
lines.push((0,
|
|
6995
|
+
lines.push((0, import_react9.createElement)(
|
|
6631
6996
|
"div",
|
|
6632
6997
|
{ key: "review", style: metaLine },
|
|
6633
6998
|
verdictDot(spec.outcome),
|
|
6634
|
-
(0,
|
|
6635
|
-
(0,
|
|
6999
|
+
(0, import_react9.createElement)("span", null, `\u89C4\u683C\u7B26\u5408 ${spec.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`),
|
|
7000
|
+
(0, import_react9.createElement)("span", null, "\xB7"),
|
|
6636
7001
|
verdictDot(quality.outcome),
|
|
6637
|
-
(0,
|
|
7002
|
+
(0, import_react9.createElement)("span", null, `\u4EE3\u7801\u8D28\u91CF ${quality.outcome === "pass" ? "\u901A\u8FC7" : "\u4E0D\u901A\u8FC7"}`)
|
|
6638
7003
|
));
|
|
6639
7004
|
const failNotes = [spec, quality].flatMap((stage) => stage.outcome === "fail" ? stage.notes ?? [] : []);
|
|
6640
7005
|
if (failNotes.length > 0) {
|
|
6641
|
-
lines.push((0,
|
|
7006
|
+
lines.push((0, import_react9.createElement)(
|
|
6642
7007
|
"div",
|
|
6643
7008
|
{ key: "notes", style: metaLine },
|
|
6644
|
-
...failNotes.map((note) => (0,
|
|
7009
|
+
...failNotes.map((note) => (0, import_react9.createElement)("span", { key: note, style: badge }, note))
|
|
6645
7010
|
));
|
|
6646
7011
|
}
|
|
6647
7012
|
}
|
|
6648
7013
|
if (lines.length === 0) {
|
|
6649
|
-
lines.push((0,
|
|
7014
|
+
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
7015
|
}
|
|
6651
|
-
return (0,
|
|
7016
|
+
return (0, import_react9.createElement)("div", { style: { display: "flex", flexDirection: "column", gap: 4 } }, ...lines);
|
|
6652
7017
|
}
|
|
6653
7018
|
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,
|
|
7019
|
+
const [tasks, setTasks] = (0, import_react9.useState)([]);
|
|
7020
|
+
const [error, setError] = (0, import_react9.useState)("");
|
|
7021
|
+
const [loading, setLoading] = (0, import_react9.useState)(true);
|
|
7022
|
+
const [query, setQuery] = (0, import_react9.useState)("");
|
|
7023
|
+
const [risk, setRisk] = (0, import_react9.useState)("all");
|
|
7024
|
+
const [stage, setStage] = (0, import_react9.useState)("all");
|
|
7025
|
+
const refresh = (0, import_react9.useCallback)(() => {
|
|
6661
7026
|
if (workspace === "") return;
|
|
6662
7027
|
setError("");
|
|
6663
7028
|
setLoading(true);
|
|
@@ -6670,57 +7035,58 @@ function TaskLedger({ workspace, remote }) {
|
|
|
6670
7035
|
setError("\u8BFB\u53D6\u53F0\u8D26\u5931\u8D25\uFF1A" + describeError(reason));
|
|
6671
7036
|
});
|
|
6672
7037
|
}, [remote, workspace]);
|
|
6673
|
-
(0,
|
|
7038
|
+
(0, import_react9.useEffect)(() => {
|
|
6674
7039
|
refresh();
|
|
6675
7040
|
}, [refresh]);
|
|
6676
7041
|
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,
|
|
7042
|
+
return (0, import_react9.createElement)(
|
|
6678
7043
|
"div",
|
|
6679
7044
|
{ style: styles.section },
|
|
6680
|
-
(0,
|
|
7045
|
+
(0, import_react9.createElement)(
|
|
6681
7046
|
"div",
|
|
6682
7047
|
{ className: "te-toolbar" },
|
|
6683
|
-
(0,
|
|
6684
|
-
(0,
|
|
6685
|
-
(0,
|
|
7048
|
+
(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) }),
|
|
7049
|
+
(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")),
|
|
7050
|
+
(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
7051
|
),
|
|
6687
|
-
(0,
|
|
7052
|
+
(0, import_react9.createElement)(
|
|
6688
7053
|
"div",
|
|
6689
7054
|
{ style: headerRow },
|
|
6690
|
-
(0,
|
|
6691
|
-
(0,
|
|
6692
|
-
(0,
|
|
7055
|
+
(0, import_react9.createElement)("span", { style: styles.bindingLabel }, "\u4EFB\u52A1\u53F0\u8D26"),
|
|
7056
|
+
(0, import_react9.createElement)("span", { style: styles.sourceBadge }, "\u53EA\u8BFB \xB7 \u6765\u81EA .dsh/task-*.json"),
|
|
7057
|
+
(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
7058
|
),
|
|
6694
|
-
loading ? (0,
|
|
7059
|
+
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
7060
|
"div",
|
|
6696
7061
|
{ style: { display: "flex", flexDirection: "column", gap: 12 } },
|
|
6697
|
-
...visible.map((task) => (0,
|
|
7062
|
+
...visible.map((task) => (0, import_react9.createElement)(
|
|
6698
7063
|
"div",
|
|
6699
|
-
{ key: task.task_id, style:
|
|
6700
|
-
(0,
|
|
7064
|
+
{ key: task.task_id, style: card3 },
|
|
7065
|
+
(0, import_react9.createElement)(
|
|
6701
7066
|
"div",
|
|
6702
7067
|
{ style: headerRow },
|
|
6703
|
-
(0,
|
|
6704
|
-
(0,
|
|
6705
|
-
(0,
|
|
6706
|
-
(0,
|
|
6707
|
-
(0,
|
|
6708
|
-
(0,
|
|
6709
|
-
(0,
|
|
6710
|
-
|
|
7068
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 14, fontWeight: 600, color: "var(--dsw-alias-label-primary)" } }, task.task_id),
|
|
7069
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } }, task.title),
|
|
7070
|
+
(0, import_react9.createElement)("span", { style: badge }, task.stage),
|
|
7071
|
+
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,
|
|
7072
|
+
(0, import_react9.createElement)("span", { style: badge }, task.branch),
|
|
7073
|
+
(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"),
|
|
7074
|
+
(0, import_react9.createElement)("span", { className: "te-badge" }, task.verification_passed ? "\u9A8C\u8BC1\u901A\u8FC7" : "\u5F85\u9A8C\u8BC1"),
|
|
7075
|
+
(0, import_react9.createElement)("span", { className: "te-badge" }, `\u5BA1\u6838\uFF1A${task.review_outcome ?? "pending"}`),
|
|
7076
|
+
task.updated_at ? (0, import_react9.createElement)("span", { style: metaLine }, "\u66F4\u65B0\u4E8E " + timeText(task.updated_at)) : null
|
|
6711
7077
|
),
|
|
6712
|
-
(0,
|
|
7078
|
+
(0, import_react9.createElement)(
|
|
6713
7079
|
"div",
|
|
6714
7080
|
{ style: { display: "flex", flexDirection: "column" } },
|
|
6715
|
-
...task.items.map((item) => (0,
|
|
7081
|
+
...task.items.map((item) => (0, import_react9.createElement)(
|
|
6716
7082
|
"div",
|
|
6717
7083
|
{ key: item.id, style: itemRow },
|
|
6718
|
-
(0,
|
|
7084
|
+
(0, import_react9.createElement)(
|
|
6719
7085
|
"div",
|
|
6720
7086
|
{ style: headerRow },
|
|
6721
7087
|
itemStatusDot(item.status),
|
|
6722
|
-
(0,
|
|
6723
|
-
(0,
|
|
7088
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 13, color: "var(--dsw-alias-label-primary)" } }, item.id),
|
|
7089
|
+
(0, import_react9.createElement)("span", { style: { fontSize: 12, color: "var(--dsw-alias-label-secondary)" } }, item.title)
|
|
6724
7090
|
),
|
|
6725
7091
|
itemAudit(item)
|
|
6726
7092
|
))
|
|
@@ -6786,7 +7152,8 @@ var closeStyle = {
|
|
|
6786
7152
|
};
|
|
6787
7153
|
var TABS = [
|
|
6788
7154
|
{ id: "init", label: "\u9879\u76EE\u521D\u59CB\u5316" },
|
|
6789
|
-
{ id: "
|
|
7155
|
+
{ id: "adaptive", label: "\u81EA\u9002\u5E94\u6D41\u7A0B" },
|
|
7156
|
+
{ id: "flow", label: "\u65E7\u7248\u6D41\u7A0B" },
|
|
6790
7157
|
{ id: "tasks", label: "\u4EFB\u52A1\u53F0\u8D26" },
|
|
6791
7158
|
{ id: "skills", label: "\u6280\u80FD" },
|
|
6792
7159
|
{ id: "rules", label: "\u89C4\u5219" }
|
|
@@ -6794,29 +7161,29 @@ var TABS = [
|
|
|
6794
7161
|
function Workbench({ useStore, actions, useWorkspaces, remote }) {
|
|
6795
7162
|
const open = useStore((s) => s.open);
|
|
6796
7163
|
const workspaces = useWorkspaces((s) => s.items);
|
|
6797
|
-
const [tab, setTab] = (0,
|
|
6798
|
-
const [workspace, setWorkspace] = (0,
|
|
7164
|
+
const [tab, setTab] = (0, import_react10.useState)("adaptive");
|
|
7165
|
+
const [workspace, setWorkspace] = (0, import_react10.useState)("");
|
|
6799
7166
|
if (!open) return null;
|
|
6800
7167
|
const current = workspaces.some((w) => w.path === workspace) ? workspace : workspaces[0]?.path ?? "";
|
|
6801
|
-
return (0,
|
|
7168
|
+
return (0, import_react10.createElement)(
|
|
6802
7169
|
"div",
|
|
6803
7170
|
{ style: overlay, className: "te-workbench" },
|
|
6804
|
-
(0,
|
|
6805
|
-
(0,
|
|
7171
|
+
(0, import_react10.createElement)("style", null, workbenchTheme),
|
|
7172
|
+
(0, import_react10.createElement)(
|
|
6806
7173
|
"div",
|
|
6807
7174
|
{ style: header },
|
|
6808
|
-
(0,
|
|
7175
|
+
(0, import_react10.createElement)(
|
|
6809
7176
|
"div",
|
|
6810
7177
|
{ style: headerBrand },
|
|
6811
|
-
(0,
|
|
6812
|
-
(0,
|
|
7178
|
+
(0, import_react10.createElement)(IconSettings, { size: 18 }),
|
|
7179
|
+
(0, import_react10.createElement)(
|
|
6813
7180
|
"div",
|
|
6814
7181
|
{ style: headerText },
|
|
6815
|
-
(0,
|
|
6816
|
-
(0,
|
|
7182
|
+
(0, import_react10.createElement)("span", { style: headerTitle }, "\u5DE5\u7A0B\u4EFB\u52A1"),
|
|
7183
|
+
(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
7184
|
)
|
|
6818
7185
|
),
|
|
6819
|
-
(0,
|
|
7186
|
+
(0, import_react10.createElement)(
|
|
6820
7187
|
"button",
|
|
6821
7188
|
{
|
|
6822
7189
|
type: "button",
|
|
@@ -6832,43 +7199,43 @@ function Workbench({ useStore, actions, useWorkspaces, remote }) {
|
|
|
6832
7199
|
event.currentTarget.style.background = "transparent";
|
|
6833
7200
|
}
|
|
6834
7201
|
},
|
|
6835
|
-
(0,
|
|
7202
|
+
(0, import_react10.createElement)(IconClose, { size: 16 })
|
|
6836
7203
|
)
|
|
6837
7204
|
),
|
|
6838
|
-
(0,
|
|
7205
|
+
(0, import_react10.createElement)(
|
|
6839
7206
|
"div",
|
|
6840
7207
|
{ style: tabbar },
|
|
6841
|
-
...TABS.map((t) => (0,
|
|
7208
|
+
...TABS.map((t) => (0, import_react10.createElement)(import_dsh_client_ui_primitives7.Pill, { key: t.id, active: tab === t.id, onClick: () => {
|
|
6842
7209
|
setTab(t.id);
|
|
6843
7210
|
} }, t.label)),
|
|
6844
|
-
workspaces.length > 0 ? (0,
|
|
7211
|
+
workspaces.length > 0 ? (0, import_react10.createElement)("select", {
|
|
6845
7212
|
style: selectStyle,
|
|
6846
7213
|
"aria-label": "\u5F53\u524D\u5DE5\u4F5C\u533A",
|
|
6847
7214
|
value: current,
|
|
6848
7215
|
onChange: (ev) => {
|
|
6849
7216
|
setWorkspace(ev.target.value);
|
|
6850
7217
|
}
|
|
6851
|
-
}, ...workspaces.map((w) => (0,
|
|
7218
|
+
}, ...workspaces.map((w) => (0, import_react10.createElement)("option", { key: w.path, value: w.path }, w.title || w.path))) : null
|
|
6852
7219
|
),
|
|
6853
|
-
(0,
|
|
7220
|
+
(0, import_react10.createElement)(
|
|
6854
7221
|
"div",
|
|
6855
7222
|
{ style: body },
|
|
6856
|
-
(0,
|
|
7223
|
+
(0, import_react10.createElement)(
|
|
6857
7224
|
"div",
|
|
6858
7225
|
{ className: "te-content", key: current },
|
|
6859
|
-
(0,
|
|
6860
|
-
current === "" ? (0,
|
|
7226
|
+
(0, import_react10.createElement)("p", { style: { ...styles.hint, marginBottom: 10 }, title: current }, "\u5DE5\u4F5C\u533A \xB7 " + current),
|
|
7227
|
+
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
7228
|
)
|
|
6862
7229
|
)
|
|
6863
7230
|
);
|
|
6864
7231
|
}
|
|
6865
7232
|
|
|
6866
7233
|
// src/client/TriggerButton.tsx
|
|
6867
|
-
var
|
|
7234
|
+
var import_react11 = require("react");
|
|
6868
7235
|
var hover = "var(--dsw-alias-bg-layer-2)";
|
|
6869
|
-
var
|
|
7236
|
+
var label2 = "var(--dsw-alias-label-primary)";
|
|
6870
7237
|
function TriggerButton({ wide, actions }) {
|
|
6871
|
-
return (0,
|
|
7238
|
+
return (0, import_react11.createElement)(
|
|
6872
7239
|
"button",
|
|
6873
7240
|
{
|
|
6874
7241
|
type: "button",
|
|
@@ -6895,7 +7262,7 @@ function TriggerButton({ wide, actions }) {
|
|
|
6895
7262
|
border: "none",
|
|
6896
7263
|
background: "transparent",
|
|
6897
7264
|
cursor: "pointer",
|
|
6898
|
-
color:
|
|
7265
|
+
color: label2,
|
|
6899
7266
|
borderRadius: wide ? 12 : "50%",
|
|
6900
7267
|
padding: wide ? "0 10px 0 8px" : 0,
|
|
6901
7268
|
// The native settings row bleeds 2px past its seat on both sides so its
|
|
@@ -6908,8 +7275,8 @@ function TriggerButton({ wide, actions }) {
|
|
|
6908
7275
|
transition: "background 120ms ease"
|
|
6909
7276
|
}
|
|
6910
7277
|
},
|
|
6911
|
-
(0,
|
|
6912
|
-
wide ? (0,
|
|
7278
|
+
(0, import_react11.createElement)(IconSettings, { size: wide ? 16 : 18 }),
|
|
7279
|
+
wide ? (0, import_react11.createElement)("span", { style: { fontSize: 14, lineHeight: "22px" } }, "\u5DE5\u7A0B\u6D41\u7A0B") : null
|
|
6913
7280
|
);
|
|
6914
7281
|
}
|
|
6915
7282
|
|