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