@godv61/dsh-task-engine 0.19.1 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -4207,7 +4207,8 @@ var initViewSchema = external_exports.object({
4207
4207
  });
4208
4208
  var initWriteRequestSchema = external_exports.object({
4209
4209
  path: external_exports.string(),
4210
- content: external_exports.string()
4210
+ content: external_exports.string(),
4211
+ overwrite: external_exports.boolean().optional()
4211
4212
  });
4212
4213
  var initWriteResultSchema = external_exports.object({
4213
4214
  ok: external_exports.boolean(),
@@ -4581,8 +4582,8 @@ function validateWorkflow(config) {
4581
4582
  if (!config.stages.includes(artifact.stage)) {
4582
4583
  problems.push(`artifact ${index + 1}: stage "${artifact.stage}" is not a stage`);
4583
4584
  }
4584
- const key = `${artifact.stage}:${artifact.id}`;
4585
- if (artifactKeys.has(key)) problems.push(`duplicate artifact "${key}"`);
4585
+ const key = artifact.id;
4586
+ if (artifactKeys.has(key)) problems.push(`duplicate artifact id "${key}" (ids are unique across all stages)`);
4586
4587
  artifactKeys.add(key);
4587
4588
  if (artifact.fields.length === 0) {
4588
4589
  problems.push(`artifact ${index + 1} ("${artifact.id}"): fields must not be empty`);
@@ -4653,7 +4654,7 @@ var STANDARD = {
4653
4654
  commit: {
4654
4655
  policy: "task",
4655
4656
  message_pattern: "^\u3010(\\S+)\u3011\u3010(?:TASK|T\\d+)\u3011.+",
4656
- message_hint: "\u3010<module>\u3011\u3010TASK/T1\u3011\u8BF4\u660E \u2014\u2014 \u5199\u7ED3\u679C\uFF0C\u4E0D\u5199\u7A7A\u6CDB\u52A8\u4F5C",
4657
+ message_hint: "\u3010<task_id>\u3011\u3010TASK/T1\u3011\u8BF4\u660E \u2014\u2014 \u7B2C\u4E00\u6BB5\u586B\u672C\u4EFB\u52A1 id\uFF08\u5982 GREET-001\uFF09\uFF0C\u5199\u7ED3\u679C\u4E0D\u5199\u7A7A\u6CDB\u52A8\u4F5C",
4657
4658
  checkpoints: ["\u4EA4\u4ED8"],
4658
4659
  file_scope: true
4659
4660
  },
@@ -4680,7 +4681,7 @@ var AGILE = {
4680
4681
  commit: {
4681
4682
  policy: "item",
4682
4683
  message_pattern: "^\u3010(\\S+)\u3011\u3010T\\d+\u3011.+",
4683
- message_hint: "\u3010<module>\u3011\u3010T1\u3011\u8BF4\u660E",
4684
+ message_hint: "\u3010<task_id>\u3011\u3010T1\u3011\u8BF4\u660E \u2014\u2014 \u7B2C\u4E00\u6BB5\u586B\u672C\u4EFB\u52A1 id",
4684
4685
  checkpoints: ["\u4EA4\u4ED8"],
4685
4686
  file_scope: true
4686
4687
  },
@@ -5071,9 +5072,9 @@ function InitPanel({ workspace, remote }) {
5071
5072
  }
5072
5073
  setDraft(r.value);
5073
5074
  };
5074
- const write = async (content) => {
5075
+ const write = async (content, overwrite) => {
5075
5076
  setMsg("");
5076
- const r = await remote.writeInit({ path: workspace, content });
5077
+ const r = await remote.writeInit({ path: workspace, content, overwrite });
5077
5078
  if (!r.ok) {
5078
5079
  setMsg("\u4FDD\u5B58\u5931\u8D25\uFF1A" + describeError(r.error));
5079
5080
  return;
@@ -5141,7 +5142,8 @@ function InitPanel({ workspace, remote }) {
5141
5142
  size: "md",
5142
5143
  disabled: draft.lines > 200,
5143
5144
  onClick: () => {
5144
- void write(draft.content);
5145
+ if (exists && !window.confirm("\u786E\u5B9A\u8986\u76D6\u73B0\u6709 AGENTS.md\uFF1F")) return;
5146
+ void write(draft.content, exists);
5145
5147
  }
5146
5148
  }, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
5147
5149
  draft.lines > 200 ? (0, import_react2.createElement)("span", { style: styles.sourceBadge }, `\u8349\u7A3F ${draft.lines} \u884C\u8D85\u9650\uFF0C\u8BF7\u70B9\u300C\u653E\u5F03\u300D\u540E\u91CD\u8BD5`) : null,
@@ -5156,7 +5158,8 @@ function InitPanel({ workspace, remote }) {
5156
5158
  size: "md",
5157
5159
  disabled: body2.trim() === "",
5158
5160
  onClick: () => {
5159
- void write(body2);
5161
+ if (exists && !window.confirm("\u786E\u5B9A\u8986\u76D6\u73B0\u6709 AGENTS.md\uFF1F")) return;
5162
+ void write(body2, exists);
5160
5163
  }
5161
5164
  }, exists ? "\u4FDD\u5B58\u5E76\u8986\u76D6" : "\u4FDD\u5B58"),
5162
5165
  (0, import_react2.createElement)(import_dsh_client_ui_primitives2.Button, { variant: "ghost", size: "md", onClick: () => {