harnessed 4.0.0 → 4.0.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/dist/cli.mjs CHANGED
@@ -1271,7 +1271,7 @@ var init_auto_install = __esm({
1271
1271
 
1272
1272
  // package.json
1273
1273
  var package_default = {
1274
- version: "4.0.0"};
1274
+ version: "4.0.1"};
1275
1275
 
1276
1276
  // src/manifest/errors.ts
1277
1277
  function instancePathToKeyPath(instancePath) {
@@ -4397,6 +4397,7 @@ var INTERACTIVE_COMMANDS = /* @__PURE__ */ new Set([
4397
4397
  ]);
4398
4398
  var ORCHESTRATOR_COMMANDS = /* @__PURE__ */ new Set(["auto", "plan", "task", "verify"]);
4399
4399
  var MARKER = `<!-- harnessed-generated:v3.4.4 -->`;
4400
+ var LANG_DIRECTIVE = `> **Language**: respond to the user in the language set by \`env.HARNESSED_USER_LANG\` (e.g. \`zh-Hans\` \u2192 \u7B80\u4F53\u4E2D\u6587, \`en\` \u2192 English). If unset, mirror the user's input language. Keep code / commands / identifiers / error messages / URLs verbatim.`;
4400
4401
  function spawnLoopSteps(indent) {
4401
4402
  const i = indent;
4402
4403
  return [
@@ -4414,6 +4415,8 @@ function buildInteractiveBody(name, prompt) {
4414
4415
  ``,
4415
4416
  prompt.description,
4416
4417
  ``,
4418
+ LANG_DIRECTIVE,
4419
+ ``,
4417
4420
  `## How to run (interactive \u2014 in THIS session)`,
4418
4421
  ``,
4419
4422
  `Clarification requires real user dialogue. Spawned subagents cannot ask the user questions, so run this stage directly in this session \u2014 do NOT spawn it.`,
@@ -4447,6 +4450,8 @@ function buildOrchestratorBody(name, prompt) {
4447
4450
  ``,
4448
4451
  prompt.description,
4449
4452
  ``,
4453
+ LANG_DIRECTIVE,
4454
+ ``,
4450
4455
  `## How to run (orchestrator \u2014 clarify in THIS session, then drive native subagent spawns)`,
4451
4456
  ``,
4452
4457
  `harnessed is the orchestration brain: \`harnessed gates\` tells you which subs fire, \`harnessed prompt\` gives you each sub's spawn-ready prompt. YOU (the main session) do the spawning with CC-native Task / Agent tools \u2014 keeping the session responsive, enabling Agent Teams, and letting clarification round-trips reach the user.`,
@@ -4475,6 +4480,8 @@ function buildExecutionBody(name, prompt) {
4475
4480
  ``,
4476
4481
  prompt.description,
4477
4482
  ``,
4483
+ LANG_DIRECTIVE,
4484
+ ``,
4478
4485
  `## How to run (execution \u2014 native subagent spawn)`,
4479
4486
  ``,
4480
4487
  `harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a CC-native Task / Agent tool (keeps the session responsive + lets clarification round-trips reach the user).`,
@@ -5704,6 +5711,22 @@ async function runWorkflow(yamlPath, vars, opts = {}) {
5704
5711
  var DEFAULT_MAX_ITERATIONS = 20;
5705
5712
  var DEFAULT_MODEL = "sonnet";
5706
5713
  var DEFAULT_SPECIALIST = "Implementation Engineer";
5714
+ var LANG_NAMES = {
5715
+ en: "English",
5716
+ "zh-Hans": "\u7B80\u4F53\u4E2D\u6587 (Simplified Chinese)",
5717
+ "zh-CN": "\u7B80\u4F53\u4E2D\u6587 (Simplified Chinese)",
5718
+ "zh-Hant": "\u7E41\u9AD4\u4E2D\u6587 (Traditional Chinese)",
5719
+ "zh-TW": "\u7E41\u9AD4\u4E2D\u6587 (Traditional Chinese)"
5720
+ };
5721
+ function buildLanguageSection() {
5722
+ const code = process.env.HARNESSED_USER_LANG;
5723
+ if (!code) return "";
5724
+ const name = LANG_NAMES[code] ?? code;
5725
+ return `
5726
+ ## Language
5727
+ Respond in ${name}. Keep code, commands, file/identifier/API names, error messages, stack traces, URLs, commit hashes, and version numbers in their original form (do not translate or transliterate them).
5728
+ `;
5729
+ }
5707
5730
  var PROTOCOLS = `
5708
5731
  ## Completion protocol
5709
5732
  When done emit: <promise>COMPLETE</promise>
@@ -5750,7 +5773,7 @@ ${raw.task}
5750
5773
 
5751
5774
  ` : "";
5752
5775
  const fullPrompt = `${taskSection}${body}
5753
- ${PROTOCOLS}`;
5776
+ ${PROTOCOLS}${buildLanguageSection()}`;
5754
5777
  if (raw.json) {
5755
5778
  const maxIterations = await resolveMaxIterations2(sub, packageRoot);
5756
5779
  const rp = rolePrompts[sub];