@ai-setting/roy-agent-cli 1.6.12 → 1.6.13

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/index.js CHANGED
@@ -60,6 +60,305 @@ var __legacyMetadataTS = (k, v) => {
60
60
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
61
61
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
62
62
 
63
+ // src/lib/markdown-renderer.ts
64
+ import { TracedAs } from "@ai-setting/roy-agent-core";
65
+ function newState() {
66
+ return {
67
+ inCodeFence: false,
68
+ fenceLang: "",
69
+ pendingBold: false,
70
+ pendingItalic: false,
71
+ pendingInlineCode: false,
72
+ pendingHeading: false,
73
+ pendingLinkBuf: null,
74
+ lineBuf: "",
75
+ tailBuf: ""
76
+ };
77
+ }
78
+ var ANSI, MAX_LINK_BUFFER = 256, MarkdownRenderer;
79
+ var init_markdown_renderer = __esm(() => {
80
+ ANSI = {
81
+ RESET: "\x1B[0m",
82
+ BOLD_ON: "\x1B[1m",
83
+ BOLD_OFF: "\x1B[22m",
84
+ DIM: "\x1B[2m",
85
+ UNDERLINE_ON: "\x1B[4m",
86
+ UNDERLINE_OFF: "\x1B[24m",
87
+ ITALIC_ON: "\x1B[3m",
88
+ ITALIC_OFF: "\x1B[23m",
89
+ FG_WHITE: "\x1B[37m",
90
+ FG_DEFAULT: "\x1B[39m",
91
+ FG_CYAN: "\x1B[36m",
92
+ FG_BLUE: "\x1B[34m",
93
+ FG_BRIGHT_CYAN: "\x1B[96m",
94
+ FG_BRIGHT_BLUE: "\x1B[94m",
95
+ BG_DEFAULT: "\x1B[49m",
96
+ BG_GRAY: "\x1B[100m"
97
+ };
98
+ MarkdownRenderer = class MarkdownRenderer {
99
+ state = newState();
100
+ _accumulated = "";
101
+ push(delta) {
102
+ const out = this.renderDelta(delta);
103
+ this._accumulated += out;
104
+ return out;
105
+ }
106
+ flush() {
107
+ const result = this._accumulated + this.closePendingStyles();
108
+ this._accumulated = "";
109
+ return result;
110
+ }
111
+ reset() {
112
+ this.state = newState();
113
+ this._accumulated = "";
114
+ }
115
+ canApplyInlineStyle() {
116
+ return !this.state.inCodeFence && !this.state.pendingInlineCode;
117
+ }
118
+ isLineStart() {
119
+ return this.state.lineBuf.trim() === "";
120
+ }
121
+ pushTail(s) {
122
+ this.state.tailBuf = (this.state.tailBuf + s).slice(-64);
123
+ }
124
+ tryResolveLink(buf) {
125
+ const m = /^\[([^\]\n]+)\]\(([^)\s]+)\)/.exec(buf);
126
+ if (!m)
127
+ return null;
128
+ return { text: m[1] ?? "", url: m[2] ?? "" };
129
+ }
130
+ closePendingStyles() {
131
+ let suffix = "";
132
+ if (this.state.pendingBold)
133
+ suffix += ANSI.BOLD_OFF;
134
+ if (this.state.pendingItalic)
135
+ suffix += ANSI.ITALIC_OFF;
136
+ if (this.state.pendingInlineCode)
137
+ suffix += ANSI.RESET;
138
+ if (this.state.pendingHeading) {
139
+ suffix += ANSI.RESET;
140
+ this.state.pendingHeading = false;
141
+ }
142
+ if (this.state.pendingLinkBuf !== null) {
143
+ suffix += this.state.pendingLinkBuf;
144
+ this.state.pendingLinkBuf = null;
145
+ }
146
+ if (this.state.inCodeFence)
147
+ suffix += `└─
148
+ `;
149
+ return suffix;
150
+ }
151
+ emitChar(out, ch) {
152
+ if (ch === `
153
+ `) {
154
+ this.state.lineBuf = "";
155
+ if (this.state.pendingHeading) {
156
+ out += ANSI.RESET;
157
+ this.state.pendingHeading = false;
158
+ }
159
+ } else {
160
+ this.state.lineBuf += ch;
161
+ }
162
+ this.pushTail(ch);
163
+ return out + ch;
164
+ }
165
+ renderDelta(delta) {
166
+ let out = "";
167
+ let i = 0;
168
+ while (i < delta.length) {
169
+ const remaining = delta.slice(i);
170
+ let advance = 1;
171
+ let handled = false;
172
+ if (this.state.pendingLinkBuf !== null) {
173
+ const buf = this.state.pendingLinkBuf + remaining;
174
+ const resolved = this.tryResolveLink(buf);
175
+ if (resolved) {
176
+ const matchedLen = resolved.text.length + resolved.url.length + 4;
177
+ const after = buf.slice(matchedLen);
178
+ this.state.pendingLinkBuf = null;
179
+ this.pushTail(buf.slice(0, matchedLen));
180
+ out += ANSI.UNDERLINE_ON + ANSI.FG_BRIGHT_CYAN + resolved.text + ANSI.RESET + ANSI.DIM + " (" + resolved.url + ")" + ANSI.RESET;
181
+ this.state.lineBuf = "l";
182
+ for (const ch of after) {
183
+ out = this.emitChar(out, ch);
184
+ }
185
+ i += remaining.length;
186
+ continue;
187
+ }
188
+ if (buf.length > MAX_LINK_BUFFER || buf.includes(`
189
+ `) || /\[/.test(buf.slice(1))) {
190
+ for (const ch of buf) {
191
+ out = this.emitChar(out, ch);
192
+ }
193
+ this.state.pendingLinkBuf = null;
194
+ i += remaining.length;
195
+ continue;
196
+ }
197
+ this.state.pendingLinkBuf = buf;
198
+ this.pushTail(remaining);
199
+ i += remaining.length;
200
+ continue;
201
+ }
202
+ if (remaining.startsWith("```")) {
203
+ handled = true;
204
+ if (this.state.inCodeFence) {
205
+ this.state.inCodeFence = false;
206
+ out += `└─
207
+ `;
208
+ advance = 3;
209
+ this.pushTail("```");
210
+ } else if (!this.state.pendingInlineCode) {
211
+ this.state.inCodeFence = true;
212
+ const afterTicks = remaining.slice(3);
213
+ const nlIdx = afterTicks.indexOf(`
214
+ `);
215
+ let lang;
216
+ if (nlIdx === -1) {
217
+ lang = afterTicks.trim() || "code";
218
+ out += `
219
+ ┌─ ${lang}`;
220
+ advance = remaining.length;
221
+ this.pushTail("```" + afterTicks);
222
+ } else {
223
+ lang = afterTicks.slice(0, nlIdx).trim() || "code";
224
+ out += `
225
+ ┌─ ${lang}
226
+ `;
227
+ advance = 3 + nlIdx + 1;
228
+ this.pushTail("```" + afterTicks.slice(0, nlIdx + 1));
229
+ }
230
+ this.state.fenceLang = lang;
231
+ } else {
232
+ advance = 1;
233
+ this.pushTail("`");
234
+ }
235
+ } else if (remaining[0] === "`" && !this.state.inCodeFence) {
236
+ handled = true;
237
+ if (this.state.pendingInlineCode) {
238
+ this.state.pendingInlineCode = false;
239
+ out += ANSI.RESET;
240
+ } else {
241
+ this.state.pendingInlineCode = true;
242
+ out += ANSI.BG_GRAY + ANSI.FG_WHITE;
243
+ }
244
+ advance = 1;
245
+ this.pushTail("`");
246
+ } else if (remaining.startsWith("**") && this.canApplyInlineStyle()) {
247
+ handled = true;
248
+ out += this.state.pendingBold ? ANSI.BOLD_OFF : ANSI.BOLD_ON;
249
+ this.state.pendingBold = !this.state.pendingBold;
250
+ advance = 2;
251
+ this.pushTail("**");
252
+ } else if (remaining[0] === "*" && this.canApplyInlineStyle() && !this.state.pendingBold) {
253
+ handled = true;
254
+ out += this.state.pendingItalic ? ANSI.ITALIC_OFF : ANSI.ITALIC_ON;
255
+ this.state.pendingItalic = !this.state.pendingItalic;
256
+ advance = 1;
257
+ this.pushTail("*");
258
+ } else if (remaining[0] === "#" && this.isLineStart() && this.canApplyInlineStyle()) {
259
+ handled = true;
260
+ let hashes = 0;
261
+ while (i + hashes < delta.length && delta[i + hashes] === "#" && hashes < 6) {
262
+ hashes++;
263
+ }
264
+ const level = Math.min(hashes, 6);
265
+ let spaceLen = 0;
266
+ while (i + hashes + spaceLen < delta.length && delta[i + hashes + spaceLen] === " ") {
267
+ spaceLen++;
268
+ }
269
+ advance = hashes + spaceLen;
270
+ this.pushTail(delta.slice(i, i + advance));
271
+ const barChar = "━";
272
+ const barLen = Math.max(3, 7 - level);
273
+ const bar = barChar.repeat(barLen);
274
+ const colorByLevel = [
275
+ ANSI.FG_BRIGHT_CYAN,
276
+ ANSI.FG_CYAN,
277
+ ANSI.FG_BLUE,
278
+ ANSI.FG_BRIGHT_BLUE,
279
+ ANSI.FG_DEFAULT,
280
+ ANSI.FG_DEFAULT
281
+ ];
282
+ const color = colorByLevel[level - 1] ?? ANSI.FG_DEFAULT;
283
+ out += color + bar + ANSI.RESET + `
284
+ `;
285
+ out += ANSI.BOLD_ON + color;
286
+ this.state.lineBuf = "h";
287
+ this.state.pendingHeading = true;
288
+ } else if (remaining[0] === "-" && this.isLineStart() && this.canApplyInlineStyle()) {
289
+ handled = true;
290
+ out += ANSI.FG_CYAN + "•" + ANSI.FG_DEFAULT + " ";
291
+ this.state.lineBuf = "-";
292
+ advance = 1;
293
+ this.pushTail("-");
294
+ } else if (remaining[0] === ">" && this.isLineStart() && this.canApplyInlineStyle()) {
295
+ handled = true;
296
+ out += ANSI.DIM + "│ " + ANSI.RESET;
297
+ this.state.lineBuf = " ";
298
+ advance = 1;
299
+ this.pushTail(">");
300
+ } else if (remaining[0] === "[" && this.canApplyInlineStyle()) {
301
+ const m = /^\[([^\]\n]+)\]\(([^)\s]+)\)/.exec(remaining);
302
+ if (m) {
303
+ handled = true;
304
+ const text = m[1] ?? "";
305
+ const url = m[2] ?? "";
306
+ advance = m[0].length;
307
+ this.pushTail(m[0]);
308
+ out += ANSI.UNDERLINE_ON + ANSI.FG_BRIGHT_CYAN + text + ANSI.RESET + ANSI.DIM + " (" + url + ")" + ANSI.RESET;
309
+ this.state.lineBuf = "l";
310
+ } else {
311
+ handled = true;
312
+ this.state.pendingLinkBuf = "[";
313
+ this.pushTail("[");
314
+ advance = 1;
315
+ }
316
+ }
317
+ if (!handled) {
318
+ out = this.emitChar(out, remaining[0]);
319
+ advance = 1;
320
+ }
321
+ i += advance;
322
+ }
323
+ return out;
324
+ }
325
+ };
326
+ __legacyDecorateClassTS([
327
+ TracedAs("markdown.render-delta", {
328
+ recordParams: true,
329
+ recordResult: true,
330
+ paramFilter: (args) => {
331
+ const a = args && args[0];
332
+ return {
333
+ "delta.length": (a && typeof a === "string" ? a.length : 0) ?? 0,
334
+ "delta.tail-window": (a && typeof a === "string" ? a.slice(-3) : "") ?? ""
335
+ };
336
+ },
337
+ resultFilter: (result) => {
338
+ const self = null;
339
+ const state = self ? self.state : undefined;
340
+ const len = result && typeof result === "string" ? result.length : 0;
341
+ const r = {
342
+ "output.length": len
343
+ };
344
+ if (state) {
345
+ r["state.inCodeFence"] = state.inCodeFence;
346
+ r["state.pendingBold"] = state.pendingBold;
347
+ } else {
348
+ r["state.inCodeFence"] = false;
349
+ r["state.pendingBold"] = false;
350
+ }
351
+ return r;
352
+ }
353
+ }),
354
+ __legacyMetadataTS("design:type", Function),
355
+ __legacyMetadataTS("design:paramtypes", [
356
+ String
357
+ ]),
358
+ __legacyMetadataTS("design:returntype", String)
359
+ ], MarkdownRenderer.prototype, "push", null);
360
+ });
361
+
63
362
  // src/services/stream-output.service.ts
64
363
  var exports_stream_output_service = {};
65
364
  __export(exports_stream_output_service, {
@@ -70,262 +369,278 @@ __export(exports_stream_output_service, {
70
369
  COLORS: () => COLORS
71
370
  });
72
371
  import chalk2 from "chalk";
73
- import { createLogger as createLogger2 } from "@ai-setting/roy-agent-core";
372
+ import { createLogger as createLogger2, TracedAs as TracedAs2 } from "@ai-setting/roy-agent-core";
74
373
  function resetStreamAbort() {
75
374
  streamAbortSignal.aborted = false;
76
375
  }
77
376
  function abortStream() {
78
377
  streamAbortSignal.aborted = true;
79
378
  }
80
-
81
- class StreamOutputService {
82
- fullText = "";
83
- fullReasoning = "";
84
- options;
85
- usageInfo;
86
- contextWindow;
87
- contextThreshold;
88
- isFirstText = true;
89
- reasoningStarted = false;
90
- thinkingPrinted = false;
91
- reasoningBuffer = "";
92
- reasoningClosedByText = false;
93
- constructor(options = {}) {
94
- this.options = options;
95
- }
96
- setOptions(options) {
97
- this.options = { ...this.options, ...options };
98
- }
99
- setContextInfo(window, threshold) {
100
- this.contextWindow = window;
101
- this.contextThreshold = threshold;
102
- }
103
- checkAbort() {
104
- if (streamAbortSignal.aborted) {
105
- console.log(`
379
+ var logger2, COLORS, streamAbortSignal, StreamOutputService;
380
+ var init_stream_output_service = __esm(() => {
381
+ init_markdown_renderer();
382
+ logger2 = createLogger2("stream-output");
383
+ COLORS = {
384
+ userInput: chalk2.cyan,
385
+ userInputPrefix: chalk2.cyan("❯"),
386
+ assistant: chalk2.green,
387
+ system: chalk2.yellow,
388
+ reasoning: chalk2.dim.gray,
389
+ toolCall: chalk2.magenta,
390
+ toolResult: chalk2.blue,
391
+ error: chalk2.red,
392
+ progress: chalk2.dim
393
+ };
394
+ streamAbortSignal = {
395
+ aborted: false
396
+ };
397
+ StreamOutputService = class StreamOutputService {
398
+ fullText = "";
399
+ fullReasoning = "";
400
+ options;
401
+ usageInfo;
402
+ contextWindow;
403
+ contextThreshold;
404
+ isFirstText = true;
405
+ reasoningStarted = false;
406
+ thinkingPrinted = false;
407
+ reasoningBuffer = "";
408
+ markdownRenderer = new MarkdownRenderer;
409
+ reasoningClosedByText = false;
410
+ constructor(options = {}) {
411
+ this.options = options;
412
+ }
413
+ setOptions(options) {
414
+ this.options = { ...this.options, ...options };
415
+ }
416
+ setContextInfo(window, threshold) {
417
+ this.contextWindow = window;
418
+ this.contextThreshold = threshold;
419
+ }
420
+ checkAbort() {
421
+ if (streamAbortSignal.aborted) {
422
+ console.log(`
106
423
  ${COLORS.system("[已中断]")}
107
424
  `);
108
- return true;
425
+ return true;
426
+ }
427
+ return false;
109
428
  }
110
- return false;
111
- }
112
- handleEvent(event) {
113
- if (this.checkAbort()) {
114
- return;
429
+ handleEvent(event) {
430
+ if (this.checkAbort()) {
431
+ return;
432
+ }
433
+ const { type, payload } = event;
434
+ switch (type) {
435
+ case "llm.start":
436
+ this.handleStart(payload);
437
+ break;
438
+ case "llm.text":
439
+ this.handleText(payload);
440
+ break;
441
+ case "llm.reasoning":
442
+ this.handleReasoning(payload);
443
+ break;
444
+ case "tool.call":
445
+ this.handleToolCall(payload);
446
+ break;
447
+ case "tool.result":
448
+ this.handleToolResult(payload);
449
+ break;
450
+ case "tool.error":
451
+ this.handleToolError(payload);
452
+ break;
453
+ case "llm.completed":
454
+ this.handleCompleted(payload);
455
+ break;
456
+ }
115
457
  }
116
- const { type, payload } = event;
117
- switch (type) {
118
- case "llm.start":
119
- this.handleStart(payload);
120
- break;
121
- case "llm.text":
122
- this.handleText(payload);
123
- break;
124
- case "llm.reasoning":
125
- this.handleReasoning(payload);
126
- break;
127
- case "tool.call":
128
- this.handleToolCall(payload);
129
- break;
130
- case "tool.result":
131
- this.handleToolResult(payload);
132
- break;
133
- case "tool.error":
134
- this.handleToolError(payload);
135
- break;
136
- case "llm.completed":
137
- this.handleCompleted(payload);
138
- break;
458
+ handleStart(payload) {
459
+ this.reasoningClosedByText = false;
460
+ this.reasoningBuffer = "";
461
+ this.fullReasoning = "";
462
+ this.isFirstText = true;
463
+ this.reasoningStarted = false;
464
+ this.thinkingPrinted = false;
465
+ if (payload.metadata?.model) {}
139
466
  }
140
- }
141
- handleStart(payload) {
142
- this.reasoningClosedByText = false;
143
- this.reasoningBuffer = "";
144
- this.fullReasoning = "";
145
- this.isFirstText = true;
146
- this.reasoningStarted = false;
147
- this.thinkingPrinted = false;
148
- if (payload.metadata?.model) {}
149
- }
150
- clearThinkingPlaceholder() {
151
- if (!this.thinkingPrinted) {
152
- this.thinkingPrinted = true;
153
- process.stdout.write("\r" + " ".repeat(80) + "\r");
467
+ clearThinkingPlaceholder() {
468
+ if (!this.thinkingPrinted) {
469
+ this.thinkingPrinted = true;
470
+ process.stdout.write("\r" + " ".repeat(80) + "\r");
471
+ }
154
472
  }
155
- }
156
- flushReasoningBuffer() {
157
- if (!this.reasoningBuffer)
158
- return;
159
- if (this.reasoningStarted)
160
- return;
161
- this.clearThinkingPlaceholder();
162
- this.reasoningStarted = true;
163
- process.stdout.write(`
473
+ flushReasoningBuffer() {
474
+ if (!this.reasoningBuffer)
475
+ return;
476
+ if (this.reasoningStarted)
477
+ return;
478
+ this.clearThinkingPlaceholder();
479
+ this.reasoningStarted = true;
480
+ process.stdout.write(`
164
481
 
165
482
  ` + COLORS.reasoning("┌─ 思考过程 ─") + `
166
483
  `);
167
- process.stdout.write(COLORS.reasoning(this.reasoningBuffer));
168
- this.reasoningBuffer = "";
169
- }
170
- closeReasoningBlock() {
171
- this.flushReasoningBuffer();
172
- if (this.reasoningStarted) {
173
- const len = this.fullReasoning.length;
174
- const dividerWidth = len === 0 ? 8 : Math.max(8, Math.min(40, len));
175
- process.stdout.write(COLORS.reasoning(`
484
+ process.stdout.write(COLORS.reasoning(this.reasoningBuffer));
485
+ this.reasoningBuffer = "";
486
+ }
487
+ closeReasoningBlock() {
488
+ this.flushReasoningBuffer();
489
+ if (this.reasoningStarted) {
490
+ const len = this.fullReasoning.length;
491
+ const dividerWidth = len === 0 ? 8 : Math.max(8, Math.min(40, len));
492
+ process.stdout.write(COLORS.reasoning(`
176
493
  └` + "─".repeat(dividerWidth) + `
177
494
  `));
178
- this.reasoningStarted = false;
495
+ this.reasoningStarted = false;
496
+ }
179
497
  }
180
- }
181
- handleText(payload) {
182
- this.clearThinkingPlaceholder();
183
- const text = payload.delta ?? payload.content ?? "";
184
- if (!text || !text.trim())
185
- return;
186
- this.closeReasoningBlock();
187
- this.reasoningClosedByText = true;
188
- if (this.isFirstText) {
189
- process.stdout.write(`
498
+ handleText(payload) {
499
+ this.clearThinkingPlaceholder();
500
+ const text = payload.delta ?? payload.content ?? "";
501
+ if (!text || !text.trim())
502
+ return;
503
+ this.closeReasoningBlock();
504
+ this.reasoningClosedByText = true;
505
+ if (this.isFirstText) {
506
+ process.stdout.write(`
190
507
  `);
191
- this.isFirstText = false;
192
- }
193
- process.stdout.write(COLORS.assistant(text));
194
- this.fullText += text;
195
- }
196
- handleReasoning(payload) {
197
- if (payload.phase === "end")
198
- return;
199
- if (!this.options.showReasoning)
200
- return;
201
- const delta = payload.delta ?? this.extractReasoningDelta(payload.content);
202
- if (!delta)
203
- return;
204
- this.fullReasoning += delta;
205
- if (this.reasoningStarted) {
206
- process.stdout.write(COLORS.reasoning(delta));
207
- return;
508
+ this.isFirstText = false;
509
+ }
510
+ const rendered = this.markdownRenderer.push(text);
511
+ process.stdout.write(COLORS.assistant(rendered));
512
+ this.fullText += text;
208
513
  }
209
- if (this.reasoningClosedByText)
210
- return;
211
- this.reasoningBuffer += delta;
212
- if (this.reasoningBuffer.length >= 15) {
213
- this.flushReasoningBuffer();
514
+ handleReasoning(payload) {
515
+ if (payload.phase === "end")
516
+ return;
517
+ if (!this.options.showReasoning)
518
+ return;
519
+ const delta = payload.delta ?? this.extractReasoningDelta(payload.content);
520
+ if (!delta)
521
+ return;
522
+ this.fullReasoning += delta;
523
+ if (this.reasoningStarted) {
524
+ process.stdout.write(COLORS.reasoning(delta));
525
+ return;
526
+ }
527
+ if (this.reasoningClosedByText)
528
+ return;
529
+ this.reasoningBuffer += delta;
530
+ if (this.reasoningBuffer.length >= 15) {
531
+ this.flushReasoningBuffer();
532
+ }
214
533
  }
215
- }
216
- extractReasoningDelta(content) {
217
- if (!content)
534
+ extractReasoningDelta(content) {
535
+ if (!content)
536
+ return "";
537
+ if (content.startsWith(this.fullReasoning)) {
538
+ return content.slice(this.fullReasoning.length);
539
+ }
218
540
  return "";
219
- if (content.startsWith(this.fullReasoning)) {
220
- return content.slice(this.fullReasoning.length);
221
541
  }
222
- return "";
223
- }
224
- handleToolCall(payload) {
225
- if (!this.options.showToolCalls)
226
- return;
227
- const name = payload.name ?? "unknown";
228
- const argsStr = payload.arguments ? JSON.stringify(payload.arguments) : "";
229
- this.clearThinkingPlaceholder();
230
- this.closeReasoningBlock();
231
- process.stdout.write(`
232
- ` + COLORS.toolCall(`\uD83D\uDD27 [Tool] ${name}${argsStr ? ` ${argsStr}` : ""}`) + `
542
+ handleToolCall(payload) {
543
+ if (!this.options.showToolCalls)
544
+ return;
545
+ const name = payload.name ?? "unknown";
546
+ this.clearThinkingPlaceholder();
547
+ this.closeReasoningBlock();
548
+ process.stdout.write(`
549
+ ` + COLORS.toolCall(`\uD83D\uDD27 [Tool] ${name} call`) + `
233
550
  `);
234
- }
235
- handleToolResult(payload) {
236
- if (!this.options.showToolResults)
237
- return;
238
- this.closeReasoningBlock();
239
- const name = payload.name ?? "unknown";
240
- const result = payload.result?.output ?? payload.result?.error ?? "无输出";
241
- process.stdout.write(`
551
+ }
552
+ handleToolResult(payload) {
553
+ if (!this.options.showToolResults)
554
+ return;
555
+ this.closeReasoningBlock();
556
+ const name = payload.name ?? "unknown";
557
+ const result = payload.result?.output ?? payload.result?.error ?? "无输出";
558
+ process.stdout.write(`
242
559
  ` + COLORS.toolResult(`\uD83D\uDCE4 ${name}: ${String(result).substring(0, 200)}`) + `
243
560
  `);
244
- }
245
- handleToolError(payload) {
246
- if (!this.options.showToolCalls && !this.options.showToolResults)
247
- return;
248
- this.closeReasoningBlock();
249
- process.stdout.write(`
561
+ }
562
+ handleToolError(payload) {
563
+ if (!this.options.showToolCalls && !this.options.showToolResults)
564
+ return;
565
+ this.closeReasoningBlock();
566
+ process.stdout.write(`
250
567
  ` + COLORS.error(`❌ ${payload.toolName ?? "unknown"}: ${payload.error ?? "unknown error"}`) + `
251
568
  `);
252
- }
253
- handleCompleted(payload) {
254
- process.stdout.write(`
569
+ }
570
+ handleCompleted(payload) {
571
+ process.stdout.write(`
255
572
  `);
256
- this.closeReasoningBlock();
257
- const metadata = payload.metadata;
258
- if (metadata?.model || metadata?.usage) {
259
- let modelName = metadata.model || "";
260
- let providerId;
261
- if (modelName.includes("/")) {
262
- const parts = modelName.split("/");
263
- providerId = parts[0];
264
- modelName = parts[parts.length - 1];
265
- }
266
- this.usageInfo = {
267
- model: modelName,
268
- providerId,
269
- promptTokens: metadata.usage?.promptTokens,
270
- completionTokens: metadata.usage?.completionTokens,
271
- totalTokens: metadata.usage?.totalTokens,
272
- cacheRead: metadata.usage?.cacheRead,
273
- cacheWrite: metadata.usage?.cacheWrite
274
- };
275
- const logData = {
276
- promptTokens: this.usageInfo.promptTokens,
277
- completionTokens: this.usageInfo.completionTokens,
278
- totalTokens: this.usageInfo.totalTokens,
279
- cacheRead: this.usageInfo.cacheRead,
280
- cacheWrite: this.usageInfo.cacheWrite
281
- };
282
- if (this.contextWindow !== undefined) {
283
- logData.contextWindow = this.contextWindow;
284
- if (this.contextThreshold !== undefined) {
285
- logData.contextThreshold = this.contextThreshold;
286
- if (this.usageInfo.totalTokens && this.contextWindow) {
287
- const usageRate = (this.usageInfo.totalTokens / this.contextWindow * 100).toFixed(1);
288
- logData.usageRate = `${usageRate}%`;
573
+ this.closeReasoningBlock();
574
+ const metadata = payload.metadata;
575
+ if (metadata?.model || metadata?.usage) {
576
+ let modelName = metadata.model || "";
577
+ let providerId;
578
+ if (modelName.includes("/")) {
579
+ const parts = modelName.split("/");
580
+ providerId = parts[0];
581
+ modelName = parts[parts.length - 1];
582
+ }
583
+ this.usageInfo = {
584
+ model: modelName,
585
+ providerId,
586
+ promptTokens: metadata.usage?.promptTokens,
587
+ completionTokens: metadata.usage?.completionTokens,
588
+ totalTokens: metadata.usage?.totalTokens,
589
+ cacheRead: metadata.usage?.cacheRead,
590
+ cacheWrite: metadata.usage?.cacheWrite
591
+ };
592
+ const logData = {
593
+ promptTokens: this.usageInfo.promptTokens,
594
+ completionTokens: this.usageInfo.completionTokens,
595
+ totalTokens: this.usageInfo.totalTokens,
596
+ cacheRead: this.usageInfo.cacheRead,
597
+ cacheWrite: this.usageInfo.cacheWrite
598
+ };
599
+ if (this.contextWindow !== undefined) {
600
+ logData.contextWindow = this.contextWindow;
601
+ if (this.contextThreshold !== undefined) {
602
+ logData.contextThreshold = this.contextThreshold;
603
+ if (this.usageInfo.totalTokens && this.contextWindow) {
604
+ const usageRate = (this.usageInfo.totalTokens / this.contextWindow * 100).toFixed(1);
605
+ logData.usageRate = `${usageRate}%`;
606
+ }
289
607
  }
290
608
  }
609
+ logger2.info(`[LLM] ${modelName}`, logData);
291
610
  }
292
- logger2.info(`[LLM] ${modelName}`, logData);
293
611
  }
294
- }
295
- getFullText() {
296
- return this.fullText;
297
- }
298
- getUsageInfo() {
299
- return this.usageInfo;
300
- }
301
- reset() {
302
- this.fullText = "";
303
- this.fullReasoning = "";
304
- this.reasoningBuffer = "";
305
- this.usageInfo = undefined;
306
- this.isFirstText = true;
307
- this.reasoningStarted = false;
308
- this.reasoningClosedByText = false;
309
- this.thinkingPrinted = false;
310
- }
311
- }
312
- var logger2, COLORS, streamAbortSignal;
313
- var init_stream_output_service = __esm(() => {
314
- logger2 = createLogger2("stream-output");
315
- COLORS = {
316
- userInput: chalk2.cyan,
317
- userInputPrefix: chalk2.cyan("❯"),
318
- assistant: chalk2.green,
319
- system: chalk2.yellow,
320
- reasoning: chalk2.dim.gray,
321
- toolCall: chalk2.magenta,
322
- toolResult: chalk2.blue,
323
- error: chalk2.red,
324
- progress: chalk2.dim
325
- };
326
- streamAbortSignal = {
327
- aborted: false
612
+ getFullText() {
613
+ return this.fullText;
614
+ }
615
+ getUsageInfo() {
616
+ return this.usageInfo;
617
+ }
618
+ reset() {
619
+ this.fullText = "";
620
+ this.fullReasoning = "";
621
+ this.reasoningBuffer = "";
622
+ this.usageInfo = undefined;
623
+ this.isFirstText = true;
624
+ this.reasoningStarted = false;
625
+ this.reasoningClosedByText = false;
626
+ this.thinkingPrinted = false;
627
+ }
328
628
  };
629
+ __legacyDecorateClassTS([
630
+ TracedAs2("stream.handle-text", {
631
+ recordParams: true,
632
+ recordResult: false,
633
+ paramFilter: (args) => ({
634
+ "payload.delta.length": args[0]?.delta?.length ?? 0,
635
+ "payload.content.length": args[0]?.content?.length ?? 0
636
+ })
637
+ }),
638
+ __legacyMetadataTS("design:type", Function),
639
+ __legacyMetadataTS("design:paramtypes", [
640
+ Object
641
+ ]),
642
+ __legacyMetadataTS("design:returntype", undefined)
643
+ ], StreamOutputService.prototype, "handleText", null);
329
644
  });
330
645
 
331
646
  // src/commands/shared/clipboard-helper.ts
@@ -431,7 +746,7 @@ function parseSlashCommand(input) {
431
746
  }
432
747
  }
433
748
 
434
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/identity.js
749
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/identity.js
435
750
  var require_identity = __commonJS((exports) => {
436
751
  var ALIAS = Symbol.for("yaml.alias");
437
752
  var DOC = Symbol.for("yaml.document");
@@ -485,7 +800,7 @@ var require_identity = __commonJS((exports) => {
485
800
  exports.isSeq = isSeq;
486
801
  });
487
802
 
488
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/visit.js
803
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/visit.js
489
804
  var require_visit = __commonJS((exports) => {
490
805
  var identity = require_identity();
491
806
  var BREAK = Symbol("break visit");
@@ -640,7 +955,7 @@ var require_visit = __commonJS((exports) => {
640
955
  exports.visitAsync = visitAsync;
641
956
  });
642
957
 
643
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/directives.js
958
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/doc/directives.js
644
959
  var require_directives = __commonJS((exports) => {
645
960
  var identity = require_identity();
646
961
  var visit = require_visit();
@@ -792,7 +1107,7 @@ var require_directives = __commonJS((exports) => {
792
1107
  exports.Directives = Directives;
793
1108
  });
794
1109
 
795
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/anchors.js
1110
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/doc/anchors.js
796
1111
  var require_anchors = __commonJS((exports) => {
797
1112
  var identity = require_identity();
798
1113
  var visit = require_visit();
@@ -854,7 +1169,7 @@ var require_anchors = __commonJS((exports) => {
854
1169
  exports.findNewAnchor = findNewAnchor;
855
1170
  });
856
1171
 
857
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/applyReviver.js
1172
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/doc/applyReviver.js
858
1173
  var require_applyReviver = __commonJS((exports) => {
859
1174
  function applyReviver(reviver, obj, key, val) {
860
1175
  if (val && typeof val === "object") {
@@ -901,7 +1216,7 @@ var require_applyReviver = __commonJS((exports) => {
901
1216
  exports.applyReviver = applyReviver;
902
1217
  });
903
1218
 
904
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/toJS.js
1219
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/toJS.js
905
1220
  var require_toJS = __commonJS((exports) => {
906
1221
  var identity = require_identity();
907
1222
  function toJS(value, arg, ctx) {
@@ -928,7 +1243,7 @@ var require_toJS = __commonJS((exports) => {
928
1243
  exports.toJS = toJS;
929
1244
  });
930
1245
 
931
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Node.js
1246
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/Node.js
932
1247
  var require_Node = __commonJS((exports) => {
933
1248
  var applyReviver = require_applyReviver();
934
1249
  var identity = require_identity();
@@ -965,7 +1280,7 @@ var require_Node = __commonJS((exports) => {
965
1280
  exports.NodeBase = NodeBase;
966
1281
  });
967
1282
 
968
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Alias.js
1283
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/Alias.js
969
1284
  var require_Alias = __commonJS((exports) => {
970
1285
  var anchors = require_anchors();
971
1286
  var visit = require_visit();
@@ -1075,7 +1390,7 @@ var require_Alias = __commonJS((exports) => {
1075
1390
  exports.Alias = Alias;
1076
1391
  });
1077
1392
 
1078
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Scalar.js
1393
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/Scalar.js
1079
1394
  var require_Scalar = __commonJS((exports) => {
1080
1395
  var identity = require_identity();
1081
1396
  var Node = require_Node();
@@ -1103,7 +1418,7 @@ var require_Scalar = __commonJS((exports) => {
1103
1418
  exports.isScalarValue = isScalarValue;
1104
1419
  });
1105
1420
 
1106
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/createNode.js
1421
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/doc/createNode.js
1107
1422
  var require_createNode = __commonJS((exports) => {
1108
1423
  var Alias = require_Alias();
1109
1424
  var identity = require_identity();
@@ -1175,7 +1490,7 @@ var require_createNode = __commonJS((exports) => {
1175
1490
  exports.createNode = createNode;
1176
1491
  });
1177
1492
 
1178
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Collection.js
1493
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/Collection.js
1179
1494
  var require_Collection = __commonJS((exports) => {
1180
1495
  var createNode = require_createNode();
1181
1496
  var identity = require_identity();
@@ -1290,7 +1605,7 @@ var require_Collection = __commonJS((exports) => {
1290
1605
  exports.isEmptyPath = isEmptyPath;
1291
1606
  });
1292
1607
 
1293
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyComment.js
1608
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyComment.js
1294
1609
  var require_stringifyComment = __commonJS((exports) => {
1295
1610
  var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
1296
1611
  function indentComment(comment, indent) {
@@ -1307,7 +1622,7 @@ var require_stringifyComment = __commonJS((exports) => {
1307
1622
  exports.stringifyComment = stringifyComment;
1308
1623
  });
1309
1624
 
1310
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/foldFlowLines.js
1625
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/foldFlowLines.js
1311
1626
  var require_foldFlowLines = __commonJS((exports) => {
1312
1627
  var FOLD_FLOW = "flow";
1313
1628
  var FOLD_BLOCK = "block";
@@ -1444,7 +1759,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
1444
1759
  exports.foldFlowLines = foldFlowLines;
1445
1760
  });
1446
1761
 
1447
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyString.js
1762
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyString.js
1448
1763
  var require_stringifyString = __commonJS((exports) => {
1449
1764
  var Scalar = require_Scalar();
1450
1765
  var foldFlowLines = require_foldFlowLines();
@@ -1742,7 +2057,7 @@ ${indent}`);
1742
2057
  exports.stringifyString = stringifyString;
1743
2058
  });
1744
2059
 
1745
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringify.js
2060
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringify.js
1746
2061
  var require_stringify = __commonJS((exports) => {
1747
2062
  var anchors = require_anchors();
1748
2063
  var identity = require_identity();
@@ -1863,7 +2178,7 @@ ${ctx.indent}${str}`;
1863
2178
  exports.stringify = stringify;
1864
2179
  });
1865
2180
 
1866
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyPair.js
2181
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyPair.js
1867
2182
  var require_stringifyPair = __commonJS((exports) => {
1868
2183
  var identity = require_identity();
1869
2184
  var Scalar = require_Scalar();
@@ -1999,7 +2314,7 @@ ${ctx.indent}`;
1999
2314
  exports.stringifyPair = stringifyPair;
2000
2315
  });
2001
2316
 
2002
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/log.js
2317
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/log.js
2003
2318
  var require_log = __commonJS((exports) => {
2004
2319
  var node_process = __require("process");
2005
2320
  function debug(logLevel, ...messages) {
@@ -2018,7 +2333,7 @@ var require_log = __commonJS((exports) => {
2018
2333
  exports.warn = warn;
2019
2334
  });
2020
2335
 
2021
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/merge.js
2336
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/merge.js
2022
2337
  var require_merge = __commonJS((exports) => {
2023
2338
  var identity = require_identity();
2024
2339
  var Scalar = require_Scalar();
@@ -2075,7 +2390,7 @@ var require_merge = __commonJS((exports) => {
2075
2390
  exports.merge = merge;
2076
2391
  });
2077
2392
 
2078
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/addPairToJSMap.js
2393
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/addPairToJSMap.js
2079
2394
  var require_addPairToJSMap = __commonJS((exports) => {
2080
2395
  var log = require_log();
2081
2396
  var merge = require_merge();
@@ -2136,7 +2451,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
2136
2451
  exports.addPairToJSMap = addPairToJSMap;
2137
2452
  });
2138
2453
 
2139
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/Pair.js
2454
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/Pair.js
2140
2455
  var require_Pair = __commonJS((exports) => {
2141
2456
  var createNode = require_createNode();
2142
2457
  var stringifyPair = require_stringifyPair();
@@ -2174,7 +2489,7 @@ var require_Pair = __commonJS((exports) => {
2174
2489
  exports.createPair = createPair;
2175
2490
  });
2176
2491
 
2177
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyCollection.js
2492
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyCollection.js
2178
2493
  var require_stringifyCollection = __commonJS((exports) => {
2179
2494
  var identity = require_identity();
2180
2495
  var stringify = require_stringify();
@@ -2326,7 +2641,7 @@ ${indent}${end}`;
2326
2641
  exports.stringifyCollection = stringifyCollection;
2327
2642
  });
2328
2643
 
2329
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLMap.js
2644
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/YAMLMap.js
2330
2645
  var require_YAMLMap = __commonJS((exports) => {
2331
2646
  var stringifyCollection = require_stringifyCollection();
2332
2647
  var addPairToJSMap = require_addPairToJSMap();
@@ -2453,7 +2768,7 @@ var require_YAMLMap = __commonJS((exports) => {
2453
2768
  exports.findPair = findPair;
2454
2769
  });
2455
2770
 
2456
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/map.js
2771
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/common/map.js
2457
2772
  var require_map = __commonJS((exports) => {
2458
2773
  var identity = require_identity();
2459
2774
  var YAMLMap = require_YAMLMap();
@@ -2472,7 +2787,7 @@ var require_map = __commonJS((exports) => {
2472
2787
  exports.map = map;
2473
2788
  });
2474
2789
 
2475
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/nodes/YAMLSeq.js
2790
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/nodes/YAMLSeq.js
2476
2791
  var require_YAMLSeq = __commonJS((exports) => {
2477
2792
  var createNode = require_createNode();
2478
2793
  var stringifyCollection = require_stringifyCollection();
@@ -2565,7 +2880,7 @@ var require_YAMLSeq = __commonJS((exports) => {
2565
2880
  exports.YAMLSeq = YAMLSeq;
2566
2881
  });
2567
2882
 
2568
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/seq.js
2883
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/common/seq.js
2569
2884
  var require_seq = __commonJS((exports) => {
2570
2885
  var identity = require_identity();
2571
2886
  var YAMLSeq = require_YAMLSeq();
@@ -2584,7 +2899,7 @@ var require_seq = __commonJS((exports) => {
2584
2899
  exports.seq = seq;
2585
2900
  });
2586
2901
 
2587
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/string.js
2902
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/common/string.js
2588
2903
  var require_string = __commonJS((exports) => {
2589
2904
  var stringifyString = require_stringifyString();
2590
2905
  var string = {
@@ -2600,7 +2915,7 @@ var require_string = __commonJS((exports) => {
2600
2915
  exports.string = string;
2601
2916
  });
2602
2917
 
2603
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/common/null.js
2918
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/common/null.js
2604
2919
  var require_null = __commonJS((exports) => {
2605
2920
  var Scalar = require_Scalar();
2606
2921
  var nullTag = {
@@ -2615,7 +2930,7 @@ var require_null = __commonJS((exports) => {
2615
2930
  exports.nullTag = nullTag;
2616
2931
  });
2617
2932
 
2618
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/bool.js
2933
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/core/bool.js
2619
2934
  var require_bool = __commonJS((exports) => {
2620
2935
  var Scalar = require_Scalar();
2621
2936
  var boolTag = {
@@ -2636,7 +2951,7 @@ var require_bool = __commonJS((exports) => {
2636
2951
  exports.boolTag = boolTag;
2637
2952
  });
2638
2953
 
2639
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyNumber.js
2954
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyNumber.js
2640
2955
  var require_stringifyNumber = __commonJS((exports) => {
2641
2956
  function stringifyNumber({ format, minFractionDigits, tag, value }) {
2642
2957
  if (typeof value === "bigint")
@@ -2660,7 +2975,7 @@ var require_stringifyNumber = __commonJS((exports) => {
2660
2975
  exports.stringifyNumber = stringifyNumber;
2661
2976
  });
2662
2977
 
2663
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/float.js
2978
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/core/float.js
2664
2979
  var require_float = __commonJS((exports) => {
2665
2980
  var Scalar = require_Scalar();
2666
2981
  var stringifyNumber = require_stringifyNumber();
@@ -2703,7 +3018,7 @@ var require_float = __commonJS((exports) => {
2703
3018
  exports.floatNaN = floatNaN;
2704
3019
  });
2705
3020
 
2706
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/int.js
3021
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/core/int.js
2707
3022
  var require_int = __commonJS((exports) => {
2708
3023
  var stringifyNumber = require_stringifyNumber();
2709
3024
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
@@ -2745,7 +3060,7 @@ var require_int = __commonJS((exports) => {
2745
3060
  exports.intOct = intOct;
2746
3061
  });
2747
3062
 
2748
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/core/schema.js
3063
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/core/schema.js
2749
3064
  var require_schema = __commonJS((exports) => {
2750
3065
  var map = require_map();
2751
3066
  var _null = require_null();
@@ -2770,7 +3085,7 @@ var require_schema = __commonJS((exports) => {
2770
3085
  exports.schema = schema;
2771
3086
  });
2772
3087
 
2773
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/json/schema.js
3088
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/json/schema.js
2774
3089
  var require_schema2 = __commonJS((exports) => {
2775
3090
  var Scalar = require_Scalar();
2776
3091
  var map = require_map();
@@ -2834,7 +3149,7 @@ var require_schema2 = __commonJS((exports) => {
2834
3149
  exports.schema = schema;
2835
3150
  });
2836
3151
 
2837
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/binary.js
3152
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/binary.js
2838
3153
  var require_binary = __commonJS((exports) => {
2839
3154
  var node_buffer = __require("buffer");
2840
3155
  var Scalar = require_Scalar();
@@ -2889,7 +3204,7 @@ var require_binary = __commonJS((exports) => {
2889
3204
  exports.binary = binary;
2890
3205
  });
2891
3206
 
2892
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
3207
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
2893
3208
  var require_pairs = __commonJS((exports) => {
2894
3209
  var identity = require_identity();
2895
3210
  var Pair = require_Pair();
@@ -2964,7 +3279,7 @@ ${cn.comment}` : item.comment;
2964
3279
  exports.resolvePairs = resolvePairs;
2965
3280
  });
2966
3281
 
2967
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/omap.js
3282
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/omap.js
2968
3283
  var require_omap = __commonJS((exports) => {
2969
3284
  var identity = require_identity();
2970
3285
  var toJS = require_toJS();
@@ -3036,7 +3351,7 @@ var require_omap = __commonJS((exports) => {
3036
3351
  exports.omap = omap;
3037
3352
  });
3038
3353
 
3039
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/bool.js
3354
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/bool.js
3040
3355
  var require_bool2 = __commonJS((exports) => {
3041
3356
  var Scalar = require_Scalar();
3042
3357
  function boolStringify({ value, source }, ctx) {
@@ -3065,7 +3380,7 @@ var require_bool2 = __commonJS((exports) => {
3065
3380
  exports.trueTag = trueTag;
3066
3381
  });
3067
3382
 
3068
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/float.js
3383
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/float.js
3069
3384
  var require_float2 = __commonJS((exports) => {
3070
3385
  var Scalar = require_Scalar();
3071
3386
  var stringifyNumber = require_stringifyNumber();
@@ -3111,7 +3426,7 @@ var require_float2 = __commonJS((exports) => {
3111
3426
  exports.floatNaN = floatNaN;
3112
3427
  });
3113
3428
 
3114
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/int.js
3429
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/int.js
3115
3430
  var require_int2 = __commonJS((exports) => {
3116
3431
  var stringifyNumber = require_stringifyNumber();
3117
3432
  var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
@@ -3187,7 +3502,7 @@ var require_int2 = __commonJS((exports) => {
3187
3502
  exports.intOct = intOct;
3188
3503
  });
3189
3504
 
3190
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/set.js
3505
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/set.js
3191
3506
  var require_set = __commonJS((exports) => {
3192
3507
  var identity = require_identity();
3193
3508
  var Pair = require_Pair();
@@ -3270,7 +3585,7 @@ var require_set = __commonJS((exports) => {
3270
3585
  exports.set = set;
3271
3586
  });
3272
3587
 
3273
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
3588
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
3274
3589
  var require_timestamp = __commonJS((exports) => {
3275
3590
  var stringifyNumber = require_stringifyNumber();
3276
3591
  function parseSexagesimal(str, asBigInt) {
@@ -3352,7 +3667,7 @@ var require_timestamp = __commonJS((exports) => {
3352
3667
  exports.timestamp = timestamp;
3353
3668
  });
3354
3669
 
3355
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/yaml-1.1/schema.js
3670
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/yaml-1.1/schema.js
3356
3671
  var require_schema3 = __commonJS((exports) => {
3357
3672
  var map = require_map();
3358
3673
  var _null = require_null();
@@ -3393,7 +3708,7 @@ var require_schema3 = __commonJS((exports) => {
3393
3708
  exports.schema = schema;
3394
3709
  });
3395
3710
 
3396
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/tags.js
3711
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/tags.js
3397
3712
  var require_tags = __commonJS((exports) => {
3398
3713
  var map = require_map();
3399
3714
  var _null = require_null();
@@ -3484,7 +3799,7 @@ var require_tags = __commonJS((exports) => {
3484
3799
  exports.getTags = getTags;
3485
3800
  });
3486
3801
 
3487
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/schema/Schema.js
3802
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/schema/Schema.js
3488
3803
  var require_Schema = __commonJS((exports) => {
3489
3804
  var identity = require_identity();
3490
3805
  var map = require_map();
@@ -3514,7 +3829,7 @@ var require_Schema = __commonJS((exports) => {
3514
3829
  exports.Schema = Schema;
3515
3830
  });
3516
3831
 
3517
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/stringify/stringifyDocument.js
3832
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/stringify/stringifyDocument.js
3518
3833
  var require_stringifyDocument = __commonJS((exports) => {
3519
3834
  var identity = require_identity();
3520
3835
  var stringify = require_stringify();
@@ -3594,7 +3909,7 @@ var require_stringifyDocument = __commonJS((exports) => {
3594
3909
  exports.stringifyDocument = stringifyDocument;
3595
3910
  });
3596
3911
 
3597
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/doc/Document.js
3912
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/doc/Document.js
3598
3913
  var require_Document = __commonJS((exports) => {
3599
3914
  var Alias = require_Alias();
3600
3915
  var Collection = require_Collection();
@@ -3829,7 +4144,7 @@ var require_Document = __commonJS((exports) => {
3829
4144
  exports.Document = Document;
3830
4145
  });
3831
4146
 
3832
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/errors.js
4147
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/errors.js
3833
4148
  var require_errors = __commonJS((exports) => {
3834
4149
  class YAMLError extends Error {
3835
4150
  constructor(name, pos, code, message) {
@@ -3894,7 +4209,7 @@ ${pointer}
3894
4209
  exports.prettifyError = prettifyError;
3895
4210
  });
3896
4211
 
3897
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-props.js
4212
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-props.js
3898
4213
  var require_resolve_props = __commonJS((exports) => {
3899
4214
  function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
3900
4215
  let spaceBefore = false;
@@ -4024,7 +4339,7 @@ var require_resolve_props = __commonJS((exports) => {
4024
4339
  exports.resolveProps = resolveProps;
4025
4340
  });
4026
4341
 
4027
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-contains-newline.js
4342
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/util-contains-newline.js
4028
4343
  var require_util_contains_newline = __commonJS((exports) => {
4029
4344
  function containsNewline(key) {
4030
4345
  if (!key)
@@ -4064,7 +4379,7 @@ var require_util_contains_newline = __commonJS((exports) => {
4064
4379
  exports.containsNewline = containsNewline;
4065
4380
  });
4066
4381
 
4067
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-flow-indent-check.js
4382
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/util-flow-indent-check.js
4068
4383
  var require_util_flow_indent_check = __commonJS((exports) => {
4069
4384
  var utilContainsNewline = require_util_contains_newline();
4070
4385
  function flowIndentCheck(indent, fc, onError) {
@@ -4079,7 +4394,7 @@ var require_util_flow_indent_check = __commonJS((exports) => {
4079
4394
  exports.flowIndentCheck = flowIndentCheck;
4080
4395
  });
4081
4396
 
4082
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-map-includes.js
4397
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/util-map-includes.js
4083
4398
  var require_util_map_includes = __commonJS((exports) => {
4084
4399
  var identity = require_identity();
4085
4400
  function mapIncludes(ctx, items, search) {
@@ -4092,7 +4407,7 @@ var require_util_map_includes = __commonJS((exports) => {
4092
4407
  exports.mapIncludes = mapIncludes;
4093
4408
  });
4094
4409
 
4095
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-map.js
4410
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-block-map.js
4096
4411
  var require_resolve_block_map = __commonJS((exports) => {
4097
4412
  var Pair = require_Pair();
4098
4413
  var YAMLMap = require_YAMLMap();
@@ -4199,7 +4514,7 @@ var require_resolve_block_map = __commonJS((exports) => {
4199
4514
  exports.resolveBlockMap = resolveBlockMap;
4200
4515
  });
4201
4516
 
4202
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-seq.js
4517
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-block-seq.js
4203
4518
  var require_resolve_block_seq = __commonJS((exports) => {
4204
4519
  var YAMLSeq = require_YAMLSeq();
4205
4520
  var resolveProps = require_resolve_props();
@@ -4247,7 +4562,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
4247
4562
  exports.resolveBlockSeq = resolveBlockSeq;
4248
4563
  });
4249
4564
 
4250
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-end.js
4565
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-end.js
4251
4566
  var require_resolve_end = __commonJS((exports) => {
4252
4567
  function resolveEnd(end, offset, reqSpace, onError) {
4253
4568
  let comment = "";
@@ -4287,7 +4602,7 @@ var require_resolve_end = __commonJS((exports) => {
4287
4602
  exports.resolveEnd = resolveEnd;
4288
4603
  });
4289
4604
 
4290
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-collection.js
4605
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-flow-collection.js
4291
4606
  var require_resolve_flow_collection = __commonJS((exports) => {
4292
4607
  var identity = require_identity();
4293
4608
  var Pair = require_Pair();
@@ -4478,7 +4793,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
4478
4793
  exports.resolveFlowCollection = resolveFlowCollection;
4479
4794
  });
4480
4795
 
4481
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-collection.js
4796
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/compose-collection.js
4482
4797
  var require_compose_collection = __commonJS((exports) => {
4483
4798
  var identity = require_identity();
4484
4799
  var Scalar = require_Scalar();
@@ -4540,7 +4855,7 @@ var require_compose_collection = __commonJS((exports) => {
4540
4855
  exports.composeCollection = composeCollection;
4541
4856
  });
4542
4857
 
4543
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-block-scalar.js
4858
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-block-scalar.js
4544
4859
  var require_resolve_block_scalar = __commonJS((exports) => {
4545
4860
  var Scalar = require_Scalar();
4546
4861
  function resolveBlockScalar(ctx, scalar, onError) {
@@ -4733,7 +5048,7 @@ var require_resolve_block_scalar = __commonJS((exports) => {
4733
5048
  exports.resolveBlockScalar = resolveBlockScalar;
4734
5049
  });
4735
5050
 
4736
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/resolve-flow-scalar.js
5051
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/resolve-flow-scalar.js
4737
5052
  var require_resolve_flow_scalar = __commonJS((exports) => {
4738
5053
  var Scalar = require_Scalar();
4739
5054
  var resolveEnd = require_resolve_end();
@@ -4950,7 +5265,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
4950
5265
  exports.resolveFlowScalar = resolveFlowScalar;
4951
5266
  });
4952
5267
 
4953
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-scalar.js
5268
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/compose-scalar.js
4954
5269
  var require_compose_scalar = __commonJS((exports) => {
4955
5270
  var identity = require_identity();
4956
5271
  var Scalar = require_Scalar();
@@ -5028,7 +5343,7 @@ var require_compose_scalar = __commonJS((exports) => {
5028
5343
  exports.composeScalar = composeScalar;
5029
5344
  });
5030
5345
 
5031
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/util-empty-scalar-position.js
5346
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/util-empty-scalar-position.js
5032
5347
  var require_util_empty_scalar_position = __commonJS((exports) => {
5033
5348
  function emptyScalarPosition(offset, before, pos) {
5034
5349
  if (before) {
@@ -5055,7 +5370,7 @@ var require_util_empty_scalar_position = __commonJS((exports) => {
5055
5370
  exports.emptyScalarPosition = emptyScalarPosition;
5056
5371
  });
5057
5372
 
5058
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-node.js
5373
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/compose-node.js
5059
5374
  var require_compose_node = __commonJS((exports) => {
5060
5375
  var Alias = require_Alias();
5061
5376
  var identity = require_identity();
@@ -5158,7 +5473,7 @@ var require_compose_node = __commonJS((exports) => {
5158
5473
  exports.composeNode = composeNode;
5159
5474
  });
5160
5475
 
5161
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/compose-doc.js
5476
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/compose-doc.js
5162
5477
  var require_compose_doc = __commonJS((exports) => {
5163
5478
  var Document = require_Document();
5164
5479
  var composeNode = require_compose_node();
@@ -5198,7 +5513,7 @@ var require_compose_doc = __commonJS((exports) => {
5198
5513
  exports.composeDoc = composeDoc;
5199
5514
  });
5200
5515
 
5201
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/compose/composer.js
5516
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/compose/composer.js
5202
5517
  var require_composer = __commonJS((exports) => {
5203
5518
  var node_process = __require("process");
5204
5519
  var directives = require_directives();
@@ -5284,10 +5599,8 @@ ${cb}` : comment;
5284
5599
  }
5285
5600
  }
5286
5601
  if (afterDoc) {
5287
- for (let i = 0;i < this.errors.length; ++i)
5288
- doc.errors.push(this.errors[i]);
5289
- for (let i = 0;i < this.warnings.length; ++i)
5290
- doc.warnings.push(this.warnings[i]);
5602
+ Array.prototype.push.apply(doc.errors, this.errors);
5603
+ Array.prototype.push.apply(doc.warnings, this.warnings);
5291
5604
  } else {
5292
5605
  doc.errors = this.errors;
5293
5606
  doc.warnings = this.warnings;
@@ -5389,7 +5702,7 @@ ${end.comment}` : end.comment;
5389
5702
  exports.Composer = Composer;
5390
5703
  });
5391
5704
 
5392
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst-scalar.js
5705
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/cst-scalar.js
5393
5706
  var require_cst_scalar = __commonJS((exports) => {
5394
5707
  var resolveBlockScalar = require_resolve_block_scalar();
5395
5708
  var resolveFlowScalar = require_resolve_flow_scalar();
@@ -5579,7 +5892,7 @@ var require_cst_scalar = __commonJS((exports) => {
5579
5892
  exports.setScalarValue = setScalarValue;
5580
5893
  });
5581
5894
 
5582
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst-stringify.js
5895
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/cst-stringify.js
5583
5896
  var require_cst_stringify = __commonJS((exports) => {
5584
5897
  var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
5585
5898
  function stringifyToken(token) {
@@ -5637,7 +5950,7 @@ var require_cst_stringify = __commonJS((exports) => {
5637
5950
  exports.stringify = stringify;
5638
5951
  });
5639
5952
 
5640
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst-visit.js
5953
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/cst-visit.js
5641
5954
  var require_cst_visit = __commonJS((exports) => {
5642
5955
  var BREAK = Symbol("break visit");
5643
5956
  var SKIP = Symbol("skip children");
@@ -5696,7 +6009,7 @@ var require_cst_visit = __commonJS((exports) => {
5696
6009
  exports.visit = visit;
5697
6010
  });
5698
6011
 
5699
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/cst.js
6012
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/cst.js
5700
6013
  var require_cst = __commonJS((exports) => {
5701
6014
  var cstScalar = require_cst_scalar();
5702
6015
  var cstStringify = require_cst_stringify();
@@ -5797,7 +6110,7 @@ var require_cst = __commonJS((exports) => {
5797
6110
  exports.tokenType = tokenType;
5798
6111
  });
5799
6112
 
5800
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/lexer.js
6113
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/lexer.js
5801
6114
  var require_lexer = __commonJS((exports) => {
5802
6115
  var cst = require_cst();
5803
6116
  function isEmpty(ch) {
@@ -5999,7 +6312,7 @@ var require_lexer = __commonJS((exports) => {
5999
6312
  const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
6000
6313
  this.indentNext = this.indentValue + 1;
6001
6314
  this.indentValue += n;
6002
- return "block-start";
6315
+ return yield* this.parseBlockStart();
6003
6316
  }
6004
6317
  return "doc";
6005
6318
  }
@@ -6306,37 +6619,26 @@ var require_lexer = __commonJS((exports) => {
6306
6619
  return 0;
6307
6620
  }
6308
6621
  *pushIndicators() {
6309
- let n = 0;
6310
- loop:
6311
- while (true) {
6312
- switch (this.charAt(0)) {
6313
- case "!":
6314
- n += yield* this.pushTag();
6315
- n += yield* this.pushSpaces(true);
6316
- continue loop;
6317
- case "&":
6318
- n += yield* this.pushUntil(isNotAnchorChar);
6319
- n += yield* this.pushSpaces(true);
6320
- continue loop;
6321
- case "-":
6322
- case "?":
6323
- case ":": {
6324
- const inFlow = this.flowLevel > 0;
6325
- const ch1 = this.charAt(1);
6326
- if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
6327
- if (!inFlow)
6328
- this.indentNext = this.indentValue + 1;
6329
- else if (this.flowKey)
6330
- this.flowKey = false;
6331
- n += yield* this.pushCount(1);
6332
- n += yield* this.pushSpaces(true);
6333
- continue loop;
6334
- }
6335
- }
6622
+ switch (this.charAt(0)) {
6623
+ case "!":
6624
+ return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
6625
+ case "&":
6626
+ return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
6627
+ case "-":
6628
+ case "?":
6629
+ case ":": {
6630
+ const inFlow = this.flowLevel > 0;
6631
+ const ch1 = this.charAt(1);
6632
+ if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
6633
+ if (!inFlow)
6634
+ this.indentNext = this.indentValue + 1;
6635
+ else if (this.flowKey)
6636
+ this.flowKey = false;
6637
+ return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
6336
6638
  }
6337
- break loop;
6338
6639
  }
6339
- return n;
6640
+ }
6641
+ return 0;
6340
6642
  }
6341
6643
  *pushTag() {
6342
6644
  if (this.charAt(1) === "<") {
@@ -6394,7 +6696,7 @@ var require_lexer = __commonJS((exports) => {
6394
6696
  exports.Lexer = Lexer;
6395
6697
  });
6396
6698
 
6397
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/line-counter.js
6699
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/line-counter.js
6398
6700
  var require_line_counter = __commonJS((exports) => {
6399
6701
  class LineCounter {
6400
6702
  constructor() {
@@ -6422,7 +6724,7 @@ var require_line_counter = __commonJS((exports) => {
6422
6724
  exports.LineCounter = LineCounter;
6423
6725
  });
6424
6726
 
6425
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/parse/parser.js
6727
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/parse/parser.js
6426
6728
  var require_parser = __commonJS((exports) => {
6427
6729
  var node_process = __require("process");
6428
6730
  var cst = require_cst();
@@ -6490,13 +6792,6 @@ var require_parser = __commonJS((exports) => {
6490
6792
  while (prev[++i]?.type === "space") {}
6491
6793
  return prev.splice(i, prev.length);
6492
6794
  }
6493
- function arrayPushArray(target, source) {
6494
- if (source.length < 1e5)
6495
- Array.prototype.push.apply(target, source);
6496
- else
6497
- for (let i = 0;i < source.length; ++i)
6498
- target.push(source[i]);
6499
- }
6500
6795
  function fixFlowSeqItems(fc) {
6501
6796
  if (fc.start.type === "flow-seq-start") {
6502
6797
  for (const it of fc.items) {
@@ -6506,11 +6801,11 @@ var require_parser = __commonJS((exports) => {
6506
6801
  delete it.key;
6507
6802
  if (isFlowToken(it.value)) {
6508
6803
  if (it.value.end)
6509
- arrayPushArray(it.value.end, it.sep);
6804
+ Array.prototype.push.apply(it.value.end, it.sep);
6510
6805
  else
6511
6806
  it.value.end = it.sep;
6512
6807
  } else
6513
- arrayPushArray(it.start, it.sep);
6808
+ Array.prototype.push.apply(it.start, it.sep);
6514
6809
  delete it.sep;
6515
6810
  }
6516
6811
  }
@@ -6850,7 +7145,7 @@ var require_parser = __commonJS((exports) => {
6850
7145
  const prev = map.items[map.items.length - 2];
6851
7146
  const end = prev?.value?.end;
6852
7147
  if (Array.isArray(end)) {
6853
- arrayPushArray(end, it.start);
7148
+ Array.prototype.push.apply(end, it.start);
6854
7149
  end.push(this.sourceToken);
6855
7150
  map.items.pop();
6856
7151
  return;
@@ -7038,7 +7333,7 @@ var require_parser = __commonJS((exports) => {
7038
7333
  const prev = seq.items[seq.items.length - 2];
7039
7334
  const end = prev?.value?.end;
7040
7335
  if (Array.isArray(end)) {
7041
- arrayPushArray(end, it.start);
7336
+ Array.prototype.push.apply(end, it.start);
7042
7337
  end.push(this.sourceToken);
7043
7338
  seq.items.pop();
7044
7339
  return;
@@ -7278,7 +7573,7 @@ var require_parser = __commonJS((exports) => {
7278
7573
  exports.Parser = Parser;
7279
7574
  });
7280
7575
 
7281
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/public-api.js
7576
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/public-api.js
7282
7577
  var require_public_api = __commonJS((exports) => {
7283
7578
  var composer = require_composer();
7284
7579
  var Document = require_Document();
@@ -7372,7 +7667,7 @@ var require_public_api = __commonJS((exports) => {
7372
7667
  exports.stringify = stringify;
7373
7668
  });
7374
7669
 
7375
- // ../../node_modules/.bun/yaml@2.9.0/node_modules/yaml/dist/index.js
7670
+ // ../../node_modules/.pnpm/yaml@2.8.4/node_modules/yaml/dist/index.js
7376
7671
  var require_dist = __commonJS((exports) => {
7377
7672
  var composer = require_composer();
7378
7673
  var Document = require_Document();
@@ -7425,7 +7720,7 @@ var require_dist = __commonJS((exports) => {
7425
7720
  var require_package = __commonJS((exports, module) => {
7426
7721
  module.exports = {
7427
7722
  name: "@ai-setting/roy-agent-cli",
7428
- version: "1.6.12",
7723
+ version: "1.6.13",
7429
7724
  type: "module",
7430
7725
  description: "CLI for roy-agent - Non-interactive command execution",
7431
7726
  main: "./dist/index.js",
@@ -7849,12 +8144,24 @@ class EnvironmentService {
7849
8144
  });
7850
8145
  this.taskComponent = new TaskComponent;
7851
8146
  const taskComponent = this.taskComponent;
8147
+ const taskConfig = {};
8148
+ if (options?.taskStorage) {
8149
+ if (options.taskStorage.type || options.taskStorage.dbPath) {
8150
+ taskConfig.storage = {
8151
+ type: options.taskStorage.type || "sqlite",
8152
+ ...options.taskStorage.dbPath ? { dbPath: options.taskStorage.dbPath } : {}
8153
+ };
8154
+ }
8155
+ }
7852
8156
  await taskComponent.init({
7853
8157
  name: "task",
7854
8158
  version: "1.0.0",
7855
8159
  enabled: true,
7856
8160
  env,
7857
- options: { configComponent }
8161
+ options: {
8162
+ configComponent,
8163
+ config: Object.keys(taskConfig).length > 0 ? taskConfig : undefined
8164
+ }
7858
8165
  });
7859
8166
  this.skillComponent = new SkillComponent;
7860
8167
  const skillComponent = this.skillComponent;
@@ -8119,7 +8426,7 @@ import {
8119
8426
  ContextError,
8120
8427
  ErrorCodes,
8121
8428
  getTracerProvider,
8122
- TracedAs
8429
+ TracedAs as TracedAs3
8123
8430
  } from "@ai-setting/roy-agent-core";
8124
8431
  import { createLogger as createLogger3 } from "@ai-setting/roy-agent-core";
8125
8432
  var logger3 = createLogger3("context-handler");
@@ -8323,7 +8630,7 @@ class ContextHandlerService {
8323
8630
  }
8324
8631
  }
8325
8632
  __legacyDecorateClassTS([
8326
- TracedAs("context-handler.compactSessionWithTwoPhases", { recordParams: true, recordResult: true }),
8633
+ TracedAs3("context-handler.compactSessionWithTwoPhases", { recordParams: true, recordResult: true }),
8327
8634
  __legacyMetadataTS("design:type", Function),
8328
8635
  __legacyMetadataTS("design:paramtypes", [
8329
8636
  String,
@@ -8332,7 +8639,7 @@ __legacyDecorateClassTS([
8332
8639
  __legacyMetadataTS("design:returntype", typeof Promise === "undefined" ? Object : Promise)
8333
8640
  ], ContextHandlerService.prototype, "compactSessionWithTwoPhases", null);
8334
8641
  __legacyDecorateClassTS([
8335
- TracedAs("context-handler.constructQuery"),
8642
+ TracedAs3("context-handler.constructQuery"),
8336
8643
  __legacyMetadataTS("design:type", Function),
8337
8644
  __legacyMetadataTS("design:paramtypes", [
8338
8645
  typeof SessionCheckpoint === "undefined" ? Object : SessionCheckpoint,
@@ -8437,7 +8744,7 @@ class TaskEventHandler {
8437
8744
  logOperationAdded(payload) {
8438
8745
  const op = payload.operation;
8439
8746
  console.log(`\uD83D\uDCCB Operation added to task #${payload.taskId}:`);
8440
- console.log(` [${op.actionType}] ${op.actionTitle}`);
8747
+ console.log(` [${op.milestoneType}] ${op.milestoneTitle}`);
8441
8748
  console.log(` Session: ${op.sessionId}`);
8442
8749
  }
8443
8750
  logTaskDelegated(payload) {
@@ -9032,7 +9339,7 @@ class SessionManager {
9032
9339
 
9033
9340
  // src/commands/shared/query-executor.ts
9034
9341
  init_stream_output_service();
9035
- import { ContextError as ContextError3, ErrorCodes as ErrorCodes3, TracedAs as TracedAs2 } from "@ai-setting/roy-agent-core";
9342
+ import { ContextError as ContextError3, ErrorCodes as ErrorCodes3, TracedAs as TracedAs4 } from "@ai-setting/roy-agent-core";
9036
9343
  class QueryExecutor {
9037
9344
  env;
9038
9345
  sessionComponent;
@@ -9205,7 +9512,7 @@ class QueryExecutor {
9205
9512
  }
9206
9513
  }
9207
9514
  __legacyDecorateClassTS([
9208
- TracedAs2("cli.query-executor.execute", { recordParams: true, log: true }),
9515
+ TracedAs4("cli.query-executor.execute", { recordParams: true, log: true }),
9209
9516
  __legacyMetadataTS("design:type", Function),
9210
9517
  __legacyMetadataTS("design:paramtypes", [
9211
9518
  Object,
@@ -9413,7 +9720,7 @@ function extractTriggerSessionId(event) {
9413
9720
  }
9414
9721
 
9415
9722
  // src/commands/shared/event-handler.ts
9416
- import { TracedAs as TracedAs3 } from "@ai-setting/roy-agent-core";
9723
+ import { TracedAs as TracedAs5 } from "@ai-setting/roy-agent-core";
9417
9724
  class EventHandler {
9418
9725
  env;
9419
9726
  eventTypes;
@@ -9600,7 +9907,7 @@ class EventHandler {
9600
9907
  }
9601
9908
  }
9602
9909
  __legacyDecorateClassTS([
9603
- TracedAs3("cli.event-handler.handleEvent", { recordParams: true }),
9910
+ TracedAs5("cli.event-handler.handleEvent", { recordParams: true }),
9604
9911
  __legacyMetadataTS("design:type", Function),
9605
9912
  __legacyMetadataTS("design:paramtypes", [
9606
9913
  typeof EnvEvent === "undefined" ? Object : EnvEvent
@@ -9641,7 +9948,7 @@ class InputHandler {
9641
9948
  }
9642
9949
 
9643
9950
  // src/commands/interactive-event-sources.ts
9644
- import { TracedAs as TracedAs4 } from "@ai-setting/roy-agent-core";
9951
+ import { TracedAs as TracedAs6 } from "@ai-setting/roy-agent-core";
9645
9952
  async function startSingleEventSource(eventSourceComponent, output, eventSourceId) {
9646
9953
  return EventSourceStarter.instance.runSingle(eventSourceComponent, output, eventSourceId);
9647
9954
  }
@@ -9659,7 +9966,7 @@ class EventSourceStarter {
9659
9966
  }
9660
9967
  }
9661
9968
  __legacyDecorateClassTS([
9662
- TracedAs4("interactive.startEventSources", { recordParams: false, log: false }),
9969
+ TracedAs6("interactive.startEventSources", { recordParams: false, log: false }),
9663
9970
  __legacyMetadataTS("design:type", Function),
9664
9971
  __legacyMetadataTS("design:paramtypes", [
9665
9972
  Array,
@@ -9669,7 +9976,7 @@ __legacyDecorateClassTS([
9669
9976
  __legacyMetadataTS("design:returntype", typeof Promise === "undefined" ? Object : Promise)
9670
9977
  ], EventSourceStarter.prototype, "run", null);
9671
9978
  __legacyDecorateClassTS([
9672
- TracedAs4("interactive.startSingleEventSource", { recordParams: false, log: false }),
9979
+ TracedAs6("interactive.startSingleEventSource", { recordParams: false, log: false }),
9673
9980
  __legacyMetadataTS("design:type", Function),
9674
9981
  __legacyMetadataTS("design:paramtypes", [
9675
9982
  typeof EventSourceComponentInterface === "undefined" ? Object : EventSourceComponentInterface,
@@ -13293,10 +13600,14 @@ Current Status: ${result.task.current_status}`);
13293
13600
  Operations (${result.operations.length}):
13294
13601
  `));
13295
13602
  result.operations.forEach((op, i) => {
13296
- output.log(` ${i + 1}. [${op.actionType}] ${op.actionTitle}`);
13603
+ const actionColor = op.milestoneType === "completed" ? chalk20.green : op.milestoneType === "milestone" ? chalk20.blue : op.milestoneType === "problem" ? chalk20.red : chalk20.gray;
13604
+ output.log(` ${i + 1}. ` + actionColor(`[${op.milestoneType}]`) + ` ${op.milestoneTitle}`);
13297
13605
  output.log(` Session: ${op.sessionId} | Time: ${op.timestamp}`);
13298
- if (op.actionDescription) {
13299
- output.log(` ${op.actionDescription}`);
13606
+ if (op.milestoneDescription) {
13607
+ output.log(` ${op.milestoneDescription}`);
13608
+ }
13609
+ if (op.processDescription) {
13610
+ output.log(chalk20.gray(` \uD83D\uDCCB 过程概要: ${op.processDescription}`));
13300
13611
  }
13301
13612
  });
13302
13613
  }
@@ -13481,9 +13792,9 @@ var UpdateCommand = {
13481
13792
  await taskComponent.createOperation({
13482
13793
  taskId: args.id,
13483
13794
  sessionId: currentSessionId,
13484
- actionType: "progress",
13485
- actionTitle: args.current_status || `Updated: ${args.status || `${args.progress}%`}`,
13486
- actionDescription: JSON.stringify({
13795
+ milestoneType: "progress",
13796
+ milestoneTitle: args.current_status || `Updated: ${args.status || `${args.progress}%`}`,
13797
+ milestoneDescription: JSON.stringify({
13487
13798
  status: args.status,
13488
13799
  progress: args.progress
13489
13800
  })
@@ -13620,9 +13931,9 @@ var CompleteCommand = {
13620
13931
  await taskComponent.createOperation({
13621
13932
  taskId: args.id,
13622
13933
  sessionId: currentSessionId,
13623
- actionType: "completed",
13624
- actionTitle: "Task archived",
13625
- actionDescription: "归档任务"
13934
+ milestoneType: "completed",
13935
+ milestoneTitle: "Task archived",
13936
+ milestoneDescription: "归档任务"
13626
13937
  });
13627
13938
  }
13628
13939
  } else {
@@ -13708,11 +14019,14 @@ Operations for Task #${task.id}: ${task.title}
13708
14019
  output.log(chalk25.gray("No operations found."));
13709
14020
  } else {
13710
14021
  operations.forEach((op, i) => {
13711
- const actionColor = op.actionType === "completed" ? chalk25.green : op.actionType === "milestone" ? chalk25.blue : op.actionType === "problem" ? chalk25.red : chalk25.gray;
13712
- output.log(`${chalk25.bold(a.offset + i + 1)}. ` + actionColor(`[${op.actionType}]`) + ` ${op.actionTitle}`);
14022
+ const actionColor = op.milestoneType === "completed" ? chalk25.green : op.milestoneType === "milestone" ? chalk25.blue : op.milestoneType === "problem" ? chalk25.red : chalk25.gray;
14023
+ output.log(`${chalk25.bold(a.offset + i + 1)}. ` + actionColor(`[${op.milestoneType}]`) + ` ${op.milestoneTitle}`);
13713
14024
  output.log(` Session: ${chalk25.cyan(op.sessionId)} | Time: ${op.timestamp}`);
13714
- if (op.actionDescription) {
13715
- output.log(` ${op.actionDescription}`);
14025
+ if (op.milestoneDescription) {
14026
+ output.log(` ${op.milestoneDescription}`);
14027
+ }
14028
+ if (op.processDescription) {
14029
+ output.log(chalk25.gray(` \uD83D\uDCCB 过程概要: ${op.processDescription}`));
13716
14030
  }
13717
14031
  output.log("");
13718
14032
  });