@qwen-code/qwen-code 0.18.0-preview.1 → 0.18.0-preview.2

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.
Files changed (107) hide show
  1. package/bundled/qc-helper/SKILL.md +1 -2
  2. package/bundled/qc-helper/docs/configuration/settings.md +17 -19
  3. package/bundled/qc-helper/docs/features/_meta.ts +0 -3
  4. package/bundled/qc-helper/docs/features/commands.md +14 -12
  5. package/bundled/qc-helper/docs/features/scheduled-tasks.md +1 -1
  6. package/bundled/qc-helper/docs/features/sub-agents.md +39 -0
  7. package/chunks/{agent-SXS4NQWS.js → agent-QB7TZ4HW.js} +22 -16
  8. package/chunks/agent-headless-APVHH7QM.js +50 -0
  9. package/chunks/{anthropicContentGenerator-4QBVSFSJ.js → anthropicContentGenerator-M45EVVRM.js} +4 -4
  10. package/chunks/{askUserQuestion-NOOLRWCJ.js → askUserQuestion-WM2KHM3K.js} +2 -2
  11. package/chunks/{ca-WRHFBIDH.js → ca-BARBRL6N.js} +48 -1
  12. package/chunks/{chunk-G763GDO6.js → chunk-2ZTWI7KH.js} +15 -3
  13. package/chunks/chunk-64WXLC72.js +98 -0
  14. package/chunks/{chunk-NQZ33PWX.js → chunk-7YKXFA3D.js} +11 -11
  15. package/chunks/chunk-AJIR24J2.js +59 -0
  16. package/chunks/{chunk-ERREX2ES.js → chunk-AVW55ZCO.js} +61 -23
  17. package/chunks/{chunk-SHUT5MQY.js → chunk-CNHFPN7T.js} +1 -1
  18. package/chunks/{chunk-5RNZ2QKF.js → chunk-CNSMKPK6.js} +1 -1
  19. package/chunks/{chunk-BBTV54KB.js → chunk-CWV3SJZS.js} +2 -2
  20. package/chunks/{chunk-GBEPNWYB.js → chunk-GX7VH5JQ.js} +1 -1
  21. package/chunks/chunk-HGJPQK33.js +2231 -0
  22. package/chunks/chunk-HV3ZZ7G4.js +159 -0
  23. package/chunks/{chunk-ZW7GBCRE.js → chunk-HXJE7VOG.js} +20 -31
  24. package/chunks/{chunk-PLYZAP4W.js → chunk-ICOI4E4S.js} +1 -1
  25. package/chunks/{chunk-6VFG3EUJ.js → chunk-JUGRPQAB.js} +1 -1
  26. package/chunks/{chunk-AVLOK27J.js → chunk-JVQOQ3OU.js} +1 -1
  27. package/chunks/{chunk-R5PDRHEF.js → chunk-JXAZUMDW.js} +67 -45
  28. package/chunks/{chunk-UABFCMPA.js → chunk-KC6ZMJ5X.js} +3 -1
  29. package/chunks/chunk-LD2XBG6Z.js +102 -0
  30. package/chunks/{chunk-MVX64PNU.js → chunk-LR62TEET.js} +1 -1
  31. package/chunks/{chunk-JMLIPZUU.js → chunk-MVIVIPCU.js} +3 -3
  32. package/chunks/{chunk-KOA52UTF.js → chunk-NW5QBUYO.js} +6 -6
  33. package/chunks/{chunk-JSYEZAYV.js → chunk-P4J26VDS.js} +2 -2
  34. package/chunks/{chunk-SCHRFI7O.js → chunk-PAEBHDIO.js} +1 -1
  35. package/chunks/{chunk-6KH2Q7XN.js → chunk-QCG6KPNM.js} +3685 -1897
  36. package/chunks/chunk-SKBPNJEW.js +45 -0
  37. package/chunks/{chunk-F5ORN4YO.js → chunk-UAMOBVVW.js} +1 -1
  38. package/chunks/chunk-XBFVXFB2.js +216 -0
  39. package/chunks/{chunk-D46KOV3C.js → chunk-Y7R6H6FT.js} +1 -1
  40. package/chunks/{chunk-F6FLCHCS.js → chunk-ZK4AMNIU.js} +39 -12
  41. package/chunks/{computer-use-CT6MU6P3.js → computer-use-B7VIUI7F.js} +22 -16
  42. package/chunks/contextCommand-63RZ3O5R.js +52 -0
  43. package/chunks/{cron-create-PIPMXQN4.js → cron-create-FI5LJVUS.js} +2 -2
  44. package/chunks/{cron-delete-6Y5XIDMS.js → cron-delete-ZGUXWBTG.js} +2 -2
  45. package/chunks/{cron-list-A4WNRUWZ.js → cron-list-QNNZGMN3.js} +2 -2
  46. package/chunks/{de-M5RPB2NB.js → de-YGKK2BC4.js} +48 -1
  47. package/chunks/{edit-A4YK7AIB.js → edit-6UBTS2J5.js} +23 -17
  48. package/chunks/{en-UMYKQAZE.js → en-HSQQNQUB.js} +73 -2
  49. package/chunks/{enter-worktree-VNEQINLC.js → enter-worktree-NN7LIXCM.js} +22 -16
  50. package/chunks/{exit-worktree-AVSMXC33.js → exit-worktree-GGSS5KIE.js} +22 -16
  51. package/chunks/{exitPlanMode-5SQYVROD.js → exitPlanMode-H323NHB2.js} +22 -16
  52. package/chunks/{fr-MPYXXXPW.js → fr-JXBKPJKQ.js} +48 -1
  53. package/chunks/{geminiContentGenerator-CR2WGARL.js → geminiContentGenerator-I4H2NLJG.js} +4 -4
  54. package/chunks/{glob-5V32KOG5.js → glob-OLCX57MD.js} +22 -16
  55. package/chunks/{grep-PUTEPBR4.js → grep-7HXIMDOW.js} +22 -16
  56. package/chunks/{ja-NFZ32AB3.js → ja-TGPZSP2B.js} +48 -1
  57. package/chunks/{keychain-token-storage-UHGOCDD6.js → keychain-token-storage-LB46DAEK.js} +2 -2
  58. package/chunks/{ls-34DLNYCD.js → ls-6PEZUK6O.js} +3 -3
  59. package/chunks/{lsp-NCDEHH3V.js → lsp-JZSJOVT7.js} +2 -2
  60. package/chunks/{monitor-EJBR5VCR.js → monitor-SQO7MVAV.js} +22 -16
  61. package/chunks/{notebook-edit-DZHGPP2L.js → notebook-edit-72L3EBAL.js} +23 -17
  62. package/chunks/{openaiContentGenerator-4QNV3CHM.js → openaiContentGenerator-FTR7CDWF.js} +12 -11
  63. package/chunks/{pt-BR43FRBA.js → pt-TIBG6BIO.js} +48 -1
  64. package/chunks/{qwenContentGenerator-3XOCEMQO.js → qwenContentGenerator-U5UFQ566.js} +24 -18
  65. package/chunks/{qwenOAuth2-KRJT35QH.js → qwenOAuth2-EFSECGHF.js} +4 -4
  66. package/chunks/{read-file-VZ2SQQIX.js → read-file-UA64EEQC.js} +8 -8
  67. package/chunks/{ripGrep-SBIZCPOL.js → ripGrep-WSYCWZVK.js} +22 -16
  68. package/chunks/{ru-DQCW2KHD.js → ru-JBCHCK4L.js} +48 -1
  69. package/chunks/{scheduler-H32DZVDV.js → scheduler-VBASHOCA.js} +22 -16
  70. package/chunks/send-message-OYJZ5TPG.js +244 -0
  71. package/chunks/{serve-56G4B5W6.js → serve-A7E2OJDR.js} +45 -36
  72. package/chunks/{shell-Q77KNP4N.js → shell-3NFOT6F5.js} +22 -16
  73. package/chunks/{skill-CLWFJYBG.js → skill-RA5YUREY.js} +10 -10
  74. package/chunks/{src-47L2LUOU.js → src-NFCMARMT.js} +182 -23
  75. package/chunks/{syntheticOutput-T5SWX3YF.js → syntheticOutput-DETQ2YM6.js} +3 -3
  76. package/chunks/task-create-Y3ZKTJIG.js +19 -0
  77. package/chunks/task-list-ONXJ3I3A.js +151 -0
  78. package/chunks/{task-stop-3VHAQMYM.js → task-stop-UHDC4N5B.js} +2 -2
  79. package/chunks/task-update-TCNOU3P5.js +397 -0
  80. package/chunks/team-create-6SR4OVRG.js +313 -0
  81. package/chunks/team-delete-EJ4U4DDP.js +114 -0
  82. package/chunks/{todoWrite-EAGJGKO5.js → todoWrite-TEYDRS5L.js} +4 -4
  83. package/chunks/{tool-search-Q75AYDTP.js → tool-search-OD435A3X.js} +8 -8
  84. package/chunks/{web-fetch-SS6IKK6N.js → web-fetch-6W67H5PO.js} +4 -4
  85. package/chunks/workflow-62DHH4EO.js +708 -0
  86. package/chunks/{write-file-RENGC25N.js → write-file-475L5OPP.js} +23 -17
  87. package/chunks/{zh-TW-IQZ4AD5M.js → zh-TW-G3HFHVVT.js} +74 -6
  88. package/chunks/{zh-6VFXOAR5.js → zh-VCLWO26Y.js} +77 -6
  89. package/cli.js +6417 -3115
  90. package/examples/agent/qwen-extension.json +1 -0
  91. package/examples/commands/qwen-extension.json +1 -0
  92. package/examples/context/qwen-extension.json +1 -0
  93. package/examples/mcp-server/qwen-extension.json +1 -0
  94. package/examples/skills/qwen-extension.json +1 -0
  95. package/locales/ca.js +51 -0
  96. package/locales/de.js +51 -0
  97. package/locales/en.js +83 -2
  98. package/locales/fr.js +53 -2
  99. package/locales/ja.js +52 -2
  100. package/locales/pt.js +52 -2
  101. package/locales/ru.js +53 -2
  102. package/locales/zh-TW.js +85 -11
  103. package/locales/zh.js +89 -11
  104. package/package.json +2 -2
  105. package/bundled/qc-helper/docs/features/checkpointing.md +0 -77
  106. package/chunks/contextCommand-YODJQYIV.js +0 -46
  107. package/chunks/send-message-YYF56TS7.js +0 -151
@@ -0,0 +1,159 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import {
4
+ createTask
5
+ } from "./chunk-HGJPQK33.js";
6
+ import {
7
+ resolveActiveTeamName
8
+ } from "./chunk-LD2XBG6Z.js";
9
+ import {
10
+ BaseDeclarativeTool,
11
+ BaseToolInvocation,
12
+ ToolDisplayNames,
13
+ ToolNames
14
+ } from "./chunk-2ZTWI7KH.js";
15
+ import {
16
+ init_esbuild_shims
17
+ } from "./chunk-A4BMJM77.js";
18
+ import {
19
+ __name
20
+ } from "./chunk-J2S4EL5Y.js";
21
+
22
+ // packages/core/src/tools/task-create.ts
23
+ init_esbuild_shims();
24
+ var CONFIRMATION_DESCRIPTION_LIMIT = 2e3;
25
+ function truncateForConfirmation(text) {
26
+ if (text.length <= CONFIRMATION_DESCRIPTION_LIMIT) return text;
27
+ return `${text.slice(0, CONFIRMATION_DESCRIPTION_LIMIT)}
28
+ \u2026 (${text.length - CONFIRMATION_DESCRIPTION_LIMIT} more characters)`;
29
+ }
30
+ __name(truncateForConfirmation, "truncateForConfirmation");
31
+ var TaskCreateInvocation = class extends BaseToolInvocation {
32
+ constructor(config, params) {
33
+ super(params);
34
+ this.config = config;
35
+ }
36
+ static {
37
+ __name(this, "TaskCreateInvocation");
38
+ }
39
+ getDescription() {
40
+ return `Create task: ${this.params.subject}`;
41
+ }
42
+ /**
43
+ * A task's `description` becomes the prompt an idle teammate auto-claims
44
+ * and executes with full tool access — the same privileged-sink shape as
45
+ * `send_message`, where free-form text turns into a new instruction for
46
+ * another agent. The base default `'allow'` short-circuits the classifier
47
+ * in AUTO mode, so override to `'ask'` to keep that injection path under
48
+ * the classifier / human-in-the-loop.
49
+ */
50
+ async getDefaultPermission() {
51
+ return "ask";
52
+ }
53
+ /**
54
+ * Unlike the one-line getDescription() used for transcript rendering,
55
+ * the confirmation prompt must show the instruction text itself: the
56
+ * `description` is what an idle teammate will auto-claim and execute
57
+ * with full tool access, so it is exactly what the human is approving.
58
+ */
59
+ getConfirmationDetails(_abortSignal) {
60
+ const details = {
61
+ type: "info",
62
+ title: "Confirm TaskCreate",
63
+ prompt: `Create task: ${this.params.subject}
64
+
65
+ ` + truncateForConfirmation(this.params.description),
66
+ onConfirm: /* @__PURE__ */ __name(async () => {
67
+ }, "onConfirm")
68
+ };
69
+ return Promise.resolve(details);
70
+ }
71
+ async execute() {
72
+ const teamName = resolveActiveTeamName(
73
+ this.config.getTeamContext()?.teamName
74
+ );
75
+ if (!teamName) {
76
+ const msg = "No active team. Create a team first.";
77
+ return {
78
+ llmContent: msg,
79
+ returnDisplay: msg,
80
+ error: { message: msg }
81
+ };
82
+ }
83
+ const task = await createTask(teamName, {
84
+ subject: this.params.subject,
85
+ description: this.params.description,
86
+ activeForm: this.params.activeForm,
87
+ metadata: this.params.metadata
88
+ });
89
+ const llmContent = `Task #${task.id} created: "${task.subject}"`;
90
+ return { llmContent, returnDisplay: llmContent };
91
+ }
92
+ };
93
+ var TaskCreateTool = class _TaskCreateTool extends BaseDeclarativeTool {
94
+ constructor(config) {
95
+ super(
96
+ _TaskCreateTool.Name,
97
+ ToolDisplayNames.TASK_CREATE,
98
+ "Create a new task in the team task list. Tasks are automatically assigned to idle teammates.",
99
+ "other" /* Other */,
100
+ {
101
+ type: "object",
102
+ properties: {
103
+ subject: {
104
+ type: "string",
105
+ description: "Short title for the task.",
106
+ maxLength: 200
107
+ },
108
+ description: {
109
+ type: "string",
110
+ description: "Detailed description of the task.",
111
+ maxLength: 1e4
112
+ },
113
+ activeForm: {
114
+ type: "string",
115
+ maxLength: 200,
116
+ description: 'Present tense label for UI (e.g., "Running tests").'
117
+ },
118
+ metadata: {
119
+ type: "object",
120
+ description: "Optional arbitrary metadata."
121
+ }
122
+ },
123
+ required: ["subject", "description"],
124
+ additionalProperties: false
125
+ }
126
+ );
127
+ this.config = config;
128
+ }
129
+ static {
130
+ __name(this, "TaskCreateTool");
131
+ }
132
+ static Name = ToolNames.TASK_CREATE;
133
+ createInvocation(params) {
134
+ return new TaskCreateInvocation(this.config, params);
135
+ }
136
+ /**
137
+ * Forward the task content to the classifier. The base sentinel `''`
138
+ * projects to an empty args object, so without this override the AUTO
139
+ * classifier rules on `task_create({})` — the injected payload that
140
+ * `getDefaultPermission() === 'ask'` exists to inspect would be
141
+ * invisible to it. Mirrors `send_message`'s projection.
142
+ */
143
+ toAutoClassifierInput(params) {
144
+ return {
145
+ subject: params.subject,
146
+ description: params.description
147
+ };
148
+ }
149
+ };
150
+
151
+ export {
152
+ truncateForConfirmation,
153
+ TaskCreateTool
154
+ };
155
+ /**
156
+ * @license
157
+ * Copyright 2025 Qwen
158
+ * SPDX-License-Identifier: Apache-2.0
159
+ */
@@ -6,7 +6,7 @@ import {
6
6
  getLanguageSettingsOptions,
7
7
  t,
8
8
  writeStderrLine
9
- } from "./chunk-NQZ33PWX.js";
9
+ } from "./chunk-7YKXFA3D.js";
10
10
  import {
11
11
  DEFAULT_STOP_HOOK_BLOCK_CAP,
12
12
  DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
@@ -15,21 +15,21 @@ import {
15
15
  SkillError,
16
16
  ideContextStore,
17
17
  require_main
18
- } from "./chunk-6KH2Q7XN.js";
18
+ } from "./chunk-QCG6KPNM.js";
19
19
  import {
20
20
  isWithinRoot,
21
21
  stripRuntimeSnapshotPrefix
22
- } from "./chunk-F6FLCHCS.js";
22
+ } from "./chunk-ZK4AMNIU.js";
23
23
  import {
24
24
  atomicWriteFileSync
25
- } from "./chunk-F5ORN4YO.js";
25
+ } from "./chunk-UAMOBVVW.js";
26
26
  import {
27
27
  FatalConfigError,
28
28
  QWEN_DIR,
29
29
  Storage,
30
30
  createDebugLogger,
31
31
  getErrorMessage
32
- } from "./chunk-R5PDRHEF.js";
32
+ } from "./chunk-JXAZUMDW.js";
33
33
  import {
34
34
  init_esbuild_shims
35
35
  } from "./chunk-A4BMJM77.js";
@@ -14964,26 +14964,6 @@ var SETTINGS_SCHEMA = {
14964
14964
  }
14965
14965
  }
14966
14966
  },
14967
- checkpointing: {
14968
- type: "object",
14969
- label: "Checkpointing",
14970
- category: "General",
14971
- requiresRestart: true,
14972
- default: {},
14973
- description: "Session checkpointing settings.",
14974
- showInDialog: false,
14975
- properties: {
14976
- enabled: {
14977
- type: "boolean",
14978
- label: "Enable Checkpointing",
14979
- category: "General",
14980
- requiresRestart: true,
14981
- default: false,
14982
- description: "Enable session checkpointing for recovery",
14983
- showInDialog: false
14984
- }
14985
- }
14986
- },
14987
14967
  debugKeystrokeLogging: {
14988
14968
  type: "boolean",
14989
14969
  label: "Debug Keystroke Logging",
@@ -15548,7 +15528,7 @@ var SETTINGS_SCHEMA = {
15548
15528
  type: "object",
15549
15529
  properties: {
15550
15530
  propagateTraceContext: {
15551
- description: "Requires `telemetry.enabled: true`. Inject W3C `traceparent` header on outbound `fetch` requests (LLM SDK calls, MCP StreamableHTTP, WebFetch, ...). Default: false \u2014 trace context stays internal to the operator's OTLP collector and is NOT written onto third-party request streams. Set true only when you want cross-process trace stitching with an OTel-aware LLM provider (e.g. ARMS+DashScope). Client HTTP spans are still emitted in either case; this flag only governs the wire `traceparent` header.",
15531
+ description: "Requires `telemetry.enabled: true`. Inject W3C `traceparent` on outbound `fetch` requests (LLM SDK calls, MCP StreamableHTTP, WebFetch, ...) AND as a `TRACEPARENT` environment variable in shell child processes (Bash tool, hooks, monitor). When enabled, any existing `TRACEPARENT` in the parent environment is overwritten with qwen-code's own trace context. Default: false \u2014 trace context stays internal to the operator's OTLP collector. Set true when you want cross-process trace stitching with an OTel-aware LLM provider (e.g. ARMS+DashScope) or need shell scripts / CLI tools to participate in distributed tracing.",
15552
15532
  type: "boolean",
15553
15533
  default: false
15554
15534
  }
@@ -15717,8 +15697,8 @@ var SETTINGS_SCHEMA = {
15717
15697
  label: "Split Tool Result Media",
15718
15698
  category: "Generation Configuration",
15719
15699
  requiresRestart: false,
15720
- default: false,
15721
- description: 'When true, media (images / audio / video / files) returned by MCP tool calls is split into a follow-up user message instead of being embedded in the tool message. Required for strict OpenAI-compatible servers (e.g., LM Studio) that reject non-text content on `role: "tool"` messages with HTTP 400 "Invalid \'messages\' in payload". Default false preserves the prior behavior for permissive providers. See QwenLM/qwen-code#3616.',
15700
+ default: true,
15701
+ description: 'When true, media (images / audio / video / files) returned by tool calls \u2014 including the built-in read_file and MCP tools \u2014 is split into a follow-up user message instead of being embedded in the `role: "tool"` message. The OpenAI Chat Completions spec only permits text on tool messages, so strict OpenAI-compatible servers (e.g., doubao / new-api / LM Studio) silently drop or reject embedded media and the model never sees an image read via read_file (QwenLM/qwen-code#4876, #3616). Default true is spec-compliant and safe for permissive providers; set false only to restore the legacy embed-in-tool-message behavior.',
15722
15702
  parentKey: "generationConfig",
15723
15703
  showInDialog: false
15724
15704
  },
@@ -16849,8 +16829,17 @@ var SETTINGS_SCHEMA = {
16849
16829
  label: "Enable Cron/Loop Tools",
16850
16830
  category: "Experimental",
16851
16831
  requiresRestart: true,
16832
+ default: true,
16833
+ description: "Enable in-session cron/loop tools. When enabled, the model can create recurring prompts using cron_create, cron_list, and cron_delete tools. Can be disabled via QWEN_CODE_DISABLE_CRON=1 environment variable.",
16834
+ showInDialog: true
16835
+ },
16836
+ agentTeam: {
16837
+ type: "boolean",
16838
+ label: "Enable Agent Team",
16839
+ category: "Experimental",
16840
+ requiresRestart: true,
16852
16841
  default: false,
16853
- description: "Enable in-session cron/loop tools (experimental). When enabled, the model can create recurring prompts using cron_create, cron_list, and cron_delete tools. Can also be enabled via QWEN_CODE_ENABLE_CRON=1 environment variable.",
16842
+ description: "Enable agent team collaboration tools (experimental). When enabled, the model can create agent teams and coordinate work using team_create, team_delete, send_message, task_create, task_update, and task_list tools. Can also be enabled via QWEN_CODE_ENABLE_AGENT_TEAM=1 environment variable.",
16854
16843
  showInDialog: true
16855
16844
  },
16856
16845
  emitToolUseSummaries: {
@@ -19149,7 +19138,7 @@ __name(getPackageJson, "getPackageJson");
19149
19138
  // packages/cli/src/utils/version.ts
19150
19139
  async function getCliVersion() {
19151
19140
  const pkgJson = await getPackageJson();
19152
- return "0.18.0-preview.1";
19141
+ return "0.18.0-preview.2";
19153
19142
  }
19154
19143
  __name(getCliVersion, "getCliVersion");
19155
19144
 
@@ -19244,7 +19233,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds, options) => {
19244
19233
 
19245
19234
  // packages/cli/src/generated/git-commit.ts
19246
19235
  init_esbuild_shims();
19247
- var GIT_COMMIT_INFO = "25fe43ce5";
19236
+ var GIT_COMMIT_INFO = "c78b0394e";
19248
19237
 
19249
19238
  // packages/cli/src/utils/systemInfo.ts
19250
19239
  var debugLogger4 = createDebugLogger("STATUS");
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-R5PDRHEF.js";
5
+ } from "./chunk-JXAZUMDW.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-R5PDRHEF.js";
5
+ } from "./chunk-JXAZUMDW.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -5,7 +5,7 @@ import {
5
5
  Storage,
6
6
  resolvePath,
7
7
  sanitizeCwd
8
- } from "./chunk-R5PDRHEF.js";
8
+ } from "./chunk-JXAZUMDW.js";
9
9
  import {
10
10
  init_esbuild_shims
11
11
  } from "./chunk-A4BMJM77.js";
@@ -2,6 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  init_esm,
5
+ isSpanContextValid,
5
6
  trace
6
7
  } from "./chunk-WFVXF3OM.js";
7
8
  import {
@@ -648,12 +649,6 @@ var Storage = class _Storage {
648
649
  getProjectRoot() {
649
650
  return this.targetDir;
650
651
  }
651
- getHistoryDir() {
652
- const hash = getProjectHash(this.getProjectRoot());
653
- const historyDir = path2.join(_Storage.getRuntimeBaseDir(), "history");
654
- const targetDir = path2.join(historyDir, hash);
655
- return targetDir;
656
- }
657
652
  getWorkspaceSettingsPath() {
658
653
  return path2.join(this.getQwenDir(), "settings.json");
659
654
  }
@@ -729,13 +724,9 @@ async function updateSymlink(linkPath, targetPath, options) {
729
724
  }
730
725
  __name(updateSymlink, "updateSymlink");
731
726
 
732
- // packages/core/src/utils/debugLogger.ts
727
+ // packages/core/src/telemetry/trace-context.ts
733
728
  init_esbuild_shims();
734
729
  init_esm();
735
- import { promises as fs4 } from "node:fs";
736
- import path4 from "node:path";
737
- import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
738
- import util from "node:util";
739
730
 
740
731
  // packages/core/src/telemetry/session-context.ts
741
732
  init_esbuild_shims();
@@ -755,7 +746,63 @@ function getCurrentSessionId() {
755
746
  }
756
747
  __name(getCurrentSessionId, "getCurrentSessionId");
757
748
 
749
+ // packages/core/src/telemetry/trace-context.ts
750
+ function extractTraceContext(span) {
751
+ const ctx = span?.spanContext();
752
+ if (ctx && isSpanContextValid(ctx)) {
753
+ return {
754
+ traceId: ctx.traceId,
755
+ spanId: ctx.spanId,
756
+ traceFlags: ctx.traceFlags
757
+ };
758
+ }
759
+ return null;
760
+ }
761
+ __name(extractTraceContext, "extractTraceContext");
762
+ function getActiveSpanTraceContext() {
763
+ try {
764
+ return extractTraceContext(trace.getActiveSpan());
765
+ } catch {
766
+ return null;
767
+ }
768
+ }
769
+ __name(getActiveSpanTraceContext, "getActiveSpanTraceContext");
770
+ function getSessionRootTraceContext() {
771
+ try {
772
+ const sessionCtx = getSessionContext();
773
+ return extractTraceContext(
774
+ sessionCtx ? trace.getSpan(sessionCtx) : void 0
775
+ );
776
+ } catch {
777
+ return null;
778
+ }
779
+ }
780
+ __name(getSessionRootTraceContext, "getSessionRootTraceContext");
781
+ function getTraceContext() {
782
+ return getActiveSpanTraceContext() ?? getSessionRootTraceContext();
783
+ }
784
+ __name(getTraceContext, "getTraceContext");
785
+ function formatTraceparent(ctx) {
786
+ const flags = (ctx.traceFlags & 255).toString(16).padStart(2, "0");
787
+ return `00-${ctx.traceId}-${ctx.spanId}-${flags}`;
788
+ }
789
+ __name(formatTraceparent, "formatTraceparent");
790
+ var shellTracePropagationEnabled = false;
791
+ function setShellTracePropagation(enabled) {
792
+ shellTracePropagationEnabled = enabled;
793
+ }
794
+ __name(setShellTracePropagation, "setShellTracePropagation");
795
+ function isShellTracePropagationEnabled() {
796
+ return shellTracePropagationEnabled;
797
+ }
798
+ __name(isShellTracePropagationEnabled, "isShellTracePropagationEnabled");
799
+
758
800
  // packages/core/src/utils/debugLogger.ts
801
+ init_esbuild_shims();
802
+ import { promises as fs4 } from "node:fs";
803
+ import path4 from "node:path";
804
+ import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
805
+ import util from "node:util";
759
806
  var ensureDebugDirPromise = null;
760
807
  var ensuredDebugDirPath = null;
761
808
  var hasWriteFailure = false;
@@ -794,40 +841,6 @@ function formatArgs(args) {
794
841
  }).map((arg) => typeof arg === "string" ? arg : util.inspect(arg)).join(" ");
795
842
  }
796
843
  __name(formatArgs, "formatArgs");
797
- var ZERO_TRACE_ID = "00000000000000000000000000000000";
798
- function getActiveSpanTraceContext() {
799
- try {
800
- const activeSpan = trace.getActiveSpan();
801
- if (activeSpan) {
802
- const ctx = activeSpan.spanContext();
803
- if (ctx.traceId !== ZERO_TRACE_ID) {
804
- return { traceId: ctx.traceId, spanId: ctx.spanId };
805
- }
806
- }
807
- return null;
808
- } catch {
809
- return null;
810
- }
811
- }
812
- __name(getActiveSpanTraceContext, "getActiveSpanTraceContext");
813
- function getSessionRootTraceContext() {
814
- try {
815
- const sessionContext2 = getSessionContext();
816
- const sessionSpan = sessionContext2 ? trace.getSpan(sessionContext2) : null;
817
- const ctx = sessionSpan?.spanContext();
818
- if (ctx && ctx.traceId !== ZERO_TRACE_ID) {
819
- return { traceId: ctx.traceId, spanId: ctx.spanId };
820
- }
821
- return null;
822
- } catch {
823
- return null;
824
- }
825
- }
826
- __name(getSessionRootTraceContext, "getSessionRootTraceContext");
827
- function getTraceContext() {
828
- return getActiveSpanTraceContext() ?? getSessionRootTraceContext();
829
- }
830
- __name(getTraceContext, "getTraceContext");
831
844
  function buildLogLine(level, message, tag, traceCtx) {
832
845
  const timestamp = (/* @__PURE__ */ new Date()).toISOString();
833
846
  const tagPart = tag ? ` [${tag}]` : "";
@@ -952,6 +965,10 @@ export {
952
965
  setSessionContext,
953
966
  getSessionContext,
954
967
  getCurrentSessionId,
968
+ getTraceContext,
969
+ formatTraceparent,
970
+ setShellTracePropagation,
971
+ isShellTracePropagationEnabled,
955
972
  isDebugLoggingDegraded,
956
973
  resetDebugLoggingState,
957
974
  setDebugLogSession,
@@ -968,3 +985,8 @@ export {
968
985
  * Copyright 2025 Qwen Code
969
986
  * SPDX-License-Identifier: Apache-2.0
970
987
  */
988
+ /**
989
+ * @license
990
+ * Copyright 2025 Qwen
991
+ * SPDX-License-Identifier: Apache-2.0
992
+ */
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-R5PDRHEF.js";
5
+ } from "./chunk-JXAZUMDW.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -108,6 +108,7 @@ var DefaultHookOutput = class {
108
108
  stopReason;
109
109
  suppressOutput;
110
110
  systemMessage;
111
+ terminalSequence;
111
112
  decision;
112
113
  reason;
113
114
  hookSpecificOutput;
@@ -116,6 +117,7 @@ var DefaultHookOutput = class {
116
117
  this.stopReason = data.stopReason;
117
118
  this.suppressOutput = data.suppressOutput;
118
119
  this.systemMessage = data.systemMessage;
120
+ this.terminalSequence = data.terminalSequence;
119
121
  this.decision = data.decision;
120
122
  this.reason = data.reason;
121
123
  this.hookSpecificOutput = data.hookSpecificOutput;
@@ -0,0 +1,102 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import {
4
+ init_esbuild_shims
5
+ } from "./chunk-A4BMJM77.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-J2S4EL5Y.js";
9
+
10
+ // packages/core/src/agents/team/identity.ts
11
+ init_esbuild_shims();
12
+ import { AsyncLocalStorage } from "node:async_hooks";
13
+ var teammateIdentityStore = new AsyncLocalStorage();
14
+ function getTeammateContext() {
15
+ return teammateIdentityStore.getStore();
16
+ }
17
+ __name(getTeammateContext, "getTeammateContext");
18
+ function isInProcessTeammate() {
19
+ return teammateIdentityStore.getStore() !== void 0;
20
+ }
21
+ __name(isInProcessTeammate, "isInProcessTeammate");
22
+ function getAgentName() {
23
+ return teammateIdentityStore.getStore()?.agentName;
24
+ }
25
+ __name(getAgentName, "getAgentName");
26
+ function getTeamName() {
27
+ return teammateIdentityStore.getStore()?.teamName;
28
+ }
29
+ __name(getTeamName, "getTeamName");
30
+ function resolveActiveTeamName(fallback) {
31
+ return getTeamName() ?? fallback;
32
+ }
33
+ __name(resolveActiveTeamName, "resolveActiveTeamName");
34
+ var isTeammate = isInProcessTeammate;
35
+ function isTeamLead() {
36
+ return teammateIdentityStore.getStore()?.isTeamLead ?? false;
37
+ }
38
+ __name(isTeamLead, "isTeamLead");
39
+ function getTeammateColor() {
40
+ return teammateIdentityStore.getStore()?.color;
41
+ }
42
+ __name(getTeammateColor, "getTeammateColor");
43
+ function runWithTeammateIdentity(identity, fn) {
44
+ return teammateIdentityStore.run(identity, fn);
45
+ }
46
+ __name(runWithTeammateIdentity, "runWithTeammateIdentity");
47
+
48
+ // packages/core/src/agents/team/types.ts
49
+ init_esbuild_shims();
50
+ var MAX_TEAMMATES = 10;
51
+ var LEADER_NAME = "leader";
52
+ var TEAMS_DIR = "teams";
53
+ var TASKS_DIR = "tasks";
54
+ var TEAM_CONFIG_FILENAME = "config.json";
55
+ var INBOXES_DIR = "inboxes";
56
+ var TEAMMATE_COLORS = [
57
+ "#FF6B6B",
58
+ // red
59
+ "#4ECDC4",
60
+ // teal
61
+ "#45B7D1",
62
+ // blue
63
+ "#FFA07A",
64
+ // salmon
65
+ "#98D8C8",
66
+ // mint
67
+ "#DDA0DD",
68
+ // plum
69
+ "#F0E68C",
70
+ // khaki
71
+ "#87CEEB",
72
+ // sky blue
73
+ "#FFB347",
74
+ // orange
75
+ "#B0E0E6"
76
+ // powder blue
77
+ ];
78
+
79
+ export {
80
+ teammateIdentityStore,
81
+ getTeammateContext,
82
+ isInProcessTeammate,
83
+ getAgentName,
84
+ getTeamName,
85
+ resolveActiveTeamName,
86
+ isTeammate,
87
+ isTeamLead,
88
+ getTeammateColor,
89
+ runWithTeammateIdentity,
90
+ MAX_TEAMMATES,
91
+ LEADER_NAME,
92
+ TEAMS_DIR,
93
+ TASKS_DIR,
94
+ TEAM_CONFIG_FILENAME,
95
+ INBOXES_DIR,
96
+ TEAMMATE_COLORS
97
+ };
98
+ /**
99
+ * @license
100
+ * Copyright 2025 Qwen
101
+ * SPDX-License-Identifier: Apache-2.0
102
+ */
@@ -2,7 +2,7 @@
2
2
  "use strict";
3
3
  import {
4
4
  createDebugLogger
5
- } from "./chunk-R5PDRHEF.js";
5
+ } from "./chunk-JXAZUMDW.js";
6
6
  import {
7
7
  init_esbuild_shims
8
8
  } from "./chunk-A4BMJM77.js";
@@ -2,14 +2,14 @@
2
2
  "use strict";
3
3
  import {
4
4
  formatFetchErrorForUser
5
- } from "./chunk-GBEPNWYB.js";
5
+ } from "./chunk-GX7VH5JQ.js";
6
6
  import {
7
7
  atomicWriteFile
8
- } from "./chunk-F5ORN4YO.js";
8
+ } from "./chunk-UAMOBVVW.js";
9
9
  import {
10
10
  Storage,
11
11
  createDebugLogger
12
- } from "./chunk-R5PDRHEF.js";
12
+ } from "./chunk-JXAZUMDW.js";
13
13
  import {
14
14
  init_esbuild_shims
15
15
  } from "./chunk-A4BMJM77.js";
@@ -2,24 +2,24 @@
2
2
  "use strict";
3
3
  import {
4
4
  t
5
- } from "./chunk-NQZ33PWX.js";
5
+ } from "./chunk-7YKXFA3D.js";
6
6
  import {
7
7
  computeThresholds,
8
8
  getCoreSystemPrompt
9
- } from "./chunk-6KH2Q7XN.js";
9
+ } from "./chunk-QCG6KPNM.js";
10
10
  import {
11
11
  buildSkillLlmContent
12
- } from "./chunk-PLYZAP4W.js";
12
+ } from "./chunk-ICOI4E4S.js";
13
13
  import {
14
14
  DiscoveredMCPTool,
15
15
  uiTelemetryService
16
- } from "./chunk-F6FLCHCS.js";
16
+ } from "./chunk-ZK4AMNIU.js";
17
17
  import {
18
18
  ToolNames
19
- } from "./chunk-G763GDO6.js";
19
+ } from "./chunk-2ZTWI7KH.js";
20
20
  import {
21
21
  DEFAULT_TOKEN_LIMIT
22
- } from "./chunk-D46KOV3C.js";
22
+ } from "./chunk-Y7R6H6FT.js";
23
23
  import {
24
24
  init_esbuild_shims
25
25
  } from "./chunk-A4BMJM77.js";
@@ -2,11 +2,11 @@
2
2
  "use strict";
3
3
  import {
4
4
  atomicWriteFileSync
5
- } from "./chunk-F5ORN4YO.js";
5
+ } from "./chunk-UAMOBVVW.js";
6
6
  import {
7
7
  Storage,
8
8
  createDebugLogger
9
- } from "./chunk-R5PDRHEF.js";
9
+ } from "./chunk-JXAZUMDW.js";
10
10
  import {
11
11
  init_esbuild_shims
12
12
  } from "./chunk-A4BMJM77.js";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-OFEVLU4C.js";
6
6
  import {
7
7
  SchemaValidator
8
- } from "./chunk-G763GDO6.js";
8
+ } from "./chunk-2ZTWI7KH.js";
9
9
  import {
10
10
  init_esbuild_shims
11
11
  } from "./chunk-A4BMJM77.js";