openfox 2.0.0-beta.5 → 2.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/{chat-handler-BM6EBFKS.js → chat-handler-XIAY7O5X.js} +14 -27
  2. package/dist/{chunk-NNEHZT3V.js → chunk-2ZS2B5HW.js} +11 -3
  3. package/dist/{chunk-HGAMIPFO.js → chunk-7FDY3EOH.js} +18 -176
  4. package/dist/{chunk-V6DYJV5R.js → chunk-7TTEGAO6.js} +12 -10
  5. package/dist/{chunk-T4HV6GS5.js → chunk-BVHFMAVN.js} +1 -1
  6. package/dist/{chunk-OBD6D5ZO.js → chunk-CDDMHSZF.js} +4 -4
  7. package/dist/{chunk-X36JIWSF.js → chunk-DFITQ75T.js} +135 -147
  8. package/dist/{chunk-HHAJ3QF6.js → chunk-EMJGF3A7.js} +9 -24
  9. package/dist/{chunk-RF2JGDSS.js → chunk-IGSZUXQP.js} +3 -3
  10. package/dist/{chunk-I67T2E5K.js → chunk-KAYUPVHQ.js} +6 -6
  11. package/dist/{chunk-CLGRPDZT.js → chunk-LN22TXNK.js} +196 -91
  12. package/dist/{chunk-UH27FDT7.js → chunk-NPHYEUYE.js} +124 -12
  13. package/dist/{chunk-DFWGWULB.js → chunk-QN5ST54E.js} +2935 -3127
  14. package/dist/{chunk-PSJIT5LZ.js → chunk-RFNEDBVO.js} +4 -4
  15. package/dist/chunk-RI6GAMNP.js +13 -0
  16. package/dist/{chunk-XL7SW5B4.js → chunk-XJEOP6XU.js} +5 -4
  17. package/dist/cli/dev.js +1 -1
  18. package/dist/cli/index.js +1 -1
  19. package/dist/compactor-TDNRM3A7.js +9 -0
  20. package/dist/{config-YU7NYZYG.js → config-QUT7YZQ7.js} +9 -8
  21. package/dist/{events-T37KTNCX.js → events-PQ3KTI5H.js} +8 -7
  22. package/dist/{folding-IIKWAGG2.js → folding-CXORTBAU.js} +2 -2
  23. package/dist/{orchestrator-JTUHXF7C.js → orchestrator-GAOENX5Q.js} +18 -22
  24. package/dist/package.json +1 -1
  25. package/dist/{processor-66YBBQ6B.js → processor-6VIYGURD.js} +8 -9
  26. package/dist/{protocol-CiYlonA5.d.ts → protocol-CDOV1pyc.d.ts} +11 -0
  27. package/dist/{protocol-ALBHLBBF.js → protocol-CN24IKQN.js} +3 -5
  28. package/dist/{provider-HTJEB3ON.js → provider-4T6BVPMD.js} +25 -10
  29. package/dist/{serve-EUEQ6ERI.js → serve-W3ETJJP3.js} +25 -26
  30. package/dist/server/index.d.ts +1 -6
  31. package/dist/server/index.js +15 -16
  32. package/dist/{settings-VRAOAPLA.js → settings-6XX56F3F.js} +2 -2
  33. package/dist/shared/index.d.ts +2 -2
  34. package/dist/shared/index.js +1 -1
  35. package/dist/{tools-56LACLKH.js → tools-SDXWIYSA.js} +11 -13
  36. package/dist/web/assets/index-Dm6t3VVB.js +299 -0
  37. package/dist/web/assets/{index-C5gaXnFj.css → index-aa3jRAZ9.css} +2 -2
  38. package/dist/web/index.html +2 -2
  39. package/dist/web/sw.js +1 -1
  40. package/dist/workflow-defaults/default.workflow.json +3 -3
  41. package/package.json +1 -1
  42. package/dist/auto-compaction-2ZAYDXGF.js +0 -27
  43. package/dist/chunk-CGZHLM3K.js +0 -70
  44. package/dist/chunk-SZKEGZIB.js +0 -140
  45. package/dist/runtime-config-NPSPMRDA.js +0 -9
  46. package/dist/vision-fallback-3MIZZ6NQ.js +0 -22
  47. package/dist/web/assets/index-DQ2Vv-Yl.js +0 -317
  48. /package/dist/web/{workbox-7fc22fbe.js → workbox-8c29f6e4.js} +0 -0
@@ -5,40 +5,38 @@ import {
5
5
  generateSessionName,
6
6
  getSessionMessageCount,
7
7
  needsNameGenerationCheck
8
- } from "./chunk-OBD6D5ZO.js";
8
+ } from "./chunk-CDDMHSZF.js";
9
9
  import {
10
10
  runChatTurn
11
- } from "./chunk-X36JIWSF.js";
12
- import "./chunk-DFWGWULB.js";
13
- import "./chunk-PSJIT5LZ.js";
14
- import "./chunk-XAMAYRDA.js";
11
+ } from "./chunk-DFITQ75T.js";
12
+ import "./chunk-QN5ST54E.js";
15
13
  import "./chunk-DL6ZILAF.js";
16
14
  import "./chunk-PBGOZMVY.js";
17
15
  import "./chunk-VRGRAQDG.js";
18
- import "./chunk-HGAMIPFO.js";
19
16
  import {
20
17
  getEventStore
21
- } from "./chunk-UH27FDT7.js";
22
- import "./chunk-FBGWG4N6.js";
23
- import "./chunk-XL7SW5B4.js";
18
+ } from "./chunk-NPHYEUYE.js";
19
+ import "./chunk-XJEOP6XU.js";
24
20
  import {
25
21
  createChatMessageMessage,
26
22
  createPhaseChangedMessage,
27
23
  createSessionRunningMessage
28
- } from "./chunk-V6DYJV5R.js";
24
+ } from "./chunk-7TTEGAO6.js";
29
25
  import "./chunk-BJYPTN5S.js";
30
- import "./chunk-T4HV6GS5.js";
31
- import "./chunk-CQGTEGKL.js";
32
- import "./chunk-CGZHLM3K.js";
33
- import "./chunk-SZKEGZIB.js";
26
+ import "./chunk-RFNEDBVO.js";
27
+ import "./chunk-XAMAYRDA.js";
28
+ import "./chunk-FBGWG4N6.js";
29
+ import "./chunk-BVHFMAVN.js";
30
+ import "./chunk-7FDY3EOH.js";
34
31
  import {
35
32
  logger
36
33
  } from "./chunk-K44MW7JJ.js";
34
+ import "./chunk-CQGTEGKL.js";
37
35
 
38
36
  // src/server/session/chat-handler.ts
39
37
  var activeAgents = /* @__PURE__ */ new Map();
40
38
  async function startChatSession(sessionId, content, deps, options) {
41
- const { sessionManager, llmClient, statsIdentity, broadcastForSession } = deps;
39
+ const { sessionManager, llmClient, broadcastForSession } = deps;
42
40
  const session = sessionManager.getSession(sessionId);
43
41
  if (!session) {
44
42
  throw new Error("Session not found");
@@ -60,17 +58,6 @@ async function startChatSession(sessionId, content, deps, options) {
60
58
  sessionManager.setRunning(sessionId, true);
61
59
  broadcastForSession(sessionId, createSessionRunningMessage(true));
62
60
  try {
63
- const { maybeAutoCompactContext } = await import("./auto-compaction-2ZAYDXGF.js");
64
- await maybeAutoCompactContext({
65
- sessionManager,
66
- sessionId,
67
- llmClient,
68
- statsIdentity,
69
- signal: controller.signal
70
- });
71
- if (controller.signal.aborted) {
72
- return;
73
- }
74
61
  const userMessage = sessionManager.addMessage(sessionId, {
75
62
  role: "user",
76
63
  content,
@@ -174,4 +161,4 @@ export {
174
161
  startChatSession,
175
162
  stopSessionExecution
176
163
  };
177
- //# sourceMappingURL=chat-handler-BM6EBFKS.js.map
164
+ //# sourceMappingURL=chat-handler-XIAY7O5X.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  detectModel
3
- } from "./chunk-HHAJ3QF6.js";
3
+ } from "./chunk-EMJGF3A7.js";
4
4
  import {
5
5
  detectBackend
6
- } from "./chunk-HGAMIPFO.js";
6
+ } from "./chunk-7FDY3EOH.js";
7
7
  import {
8
8
  getGlobalConfigPath
9
9
  } from "./chunk-CQGTEGKL.js";
@@ -71,6 +71,7 @@ var providerSchema = z.object({
71
71
  models: z.array(modelConfigSchema).default([]),
72
72
  isActive: z.boolean(),
73
73
  createdAt: z.string(),
74
+ isLocal: z.boolean().optional(),
74
75
  // Deprecated: model field kept for migration, will be removed after migration
75
76
  model: z.string().optional(),
76
77
  // Deprecated: maxContext kept for migration
@@ -323,6 +324,12 @@ function addProvider(config, provider) {
323
324
  }
324
325
  };
325
326
  }
327
+ function updateProvider(config, providerId, updates) {
328
+ return {
329
+ ...config,
330
+ providers: config.providers.map((p) => p.id === providerId ? { ...p, ...updates } : p)
331
+ };
332
+ }
326
333
  function removeProvider(config, providerId) {
327
334
  const currentProviders = config.providers ?? [];
328
335
  const filtered = currentProviders.filter((p) => p.id !== providerId);
@@ -431,8 +438,9 @@ export {
431
438
  getDefaultModel,
432
439
  setDefaultModelSelection,
433
440
  addProvider,
441
+ updateProvider,
434
442
  removeProvider,
435
443
  activateProvider,
436
444
  mergeConfigs
437
445
  };
438
- //# sourceMappingURL=chunk-NNEHZT3V.js.map
446
+ //# sourceMappingURL=chunk-2ZS2B5HW.js.map
@@ -1,6 +1,3 @@
1
- import {
2
- describeImageFromDataUrl
3
- } from "./chunk-SZKEGZIB.js";
4
1
  import {
5
2
  logger
6
3
  } from "./chunk-K44MW7JJ.js";
@@ -362,6 +359,9 @@ function getModelProfile(modelName) {
362
359
  }
363
360
  return DEFAULT_PROFILE;
364
361
  }
362
+ function modelSupportsVision(modelName) {
363
+ return getModelProfile(modelName).supportsVision;
364
+ }
365
365
 
366
366
  // src/server/llm/client-pure.ts
367
367
  function buildModelParams(params) {
@@ -372,27 +372,16 @@ function buildModelParams(params) {
372
372
  ...params.maxTokens !== void 0 && { maxTokens: params.maxTokens }
373
373
  };
374
374
  }
375
- function buildAttachmentContent(msgContent, attachments, modelSupportsVision) {
375
+ function buildAttachmentContent(msgContent, attachments, modelSupportsVision2) {
376
376
  const content = [];
377
377
  if (msgContent?.trim()) {
378
378
  content.push({ type: "text", text: msgContent });
379
379
  }
380
380
  for (const attachment of attachments) {
381
- content.push(convertAttachmentSync(attachment, modelSupportsVision));
381
+ content.push(convertAttachmentSync(attachment, modelSupportsVision2));
382
382
  }
383
383
  return content;
384
384
  }
385
- async function convertMessagesWithOptions(messages, profile, visionFallbackEnabled, userVisionOverride, signal, onVisionFallbackStart, onVisionFallbackDone) {
386
- const modelSupportsVision = userVisionOverride ?? profile.supportsVision ?? false;
387
- const options = {
388
- modelSupportsVision,
389
- visionFallbackEnabled,
390
- signal,
391
- onVisionFallbackStart,
392
- onVisionFallbackDone
393
- };
394
- return needsVisionFallback(messages, modelSupportsVision, visionFallbackEnabled) ? await convertMessagesWithFallback(messages, options) : convertMessages(messages, { modelSupportsVision, visionFallbackEnabled: false });
395
- }
396
385
  function convertToolCalls(toolCalls) {
397
386
  return toolCalls.map((toolCall) => ({
398
387
  id: toolCall.id,
@@ -416,8 +405,8 @@ function buildAssistantMessage(msg) {
416
405
  }
417
406
  return result;
418
407
  }
419
- function convertAttachmentSync(attachment, modelSupportsVision) {
420
- if (modelSupportsVision) {
408
+ function convertAttachmentSync(attachment, modelSupportsVision2) {
409
+ if (modelSupportsVision2) {
421
410
  return {
422
411
  type: "image_url",
423
412
  image_url: { url: attachment.data }
@@ -428,68 +417,14 @@ function convertAttachmentSync(attachment, modelSupportsVision) {
428
417
  text: `[Image: ${attachment.filename || "image"}] (vision not supported, cannot describe)`
429
418
  };
430
419
  }
431
- function createAttachmentForConversion(data, filename, id) {
432
- return {
433
- data,
434
- ...filename !== void 0 && { filename },
435
- ...id !== void 0 && { id }
436
- };
437
- }
438
- async function convertAttachmentWithFallback(attachment, options) {
439
- logger.debug("[VisionFallback] convertAttachmentWithFallback called", {
440
- filename: attachment.filename,
441
- id: attachment.id,
442
- hasCallbacks: !!options.onVisionFallbackStart
443
- });
444
- if (options.modelSupportsVision) {
445
- logger.debug("[VisionFallback] Model supports vision - passing image directly");
446
- return {
447
- type: "image_url",
448
- image_url: { url: attachment.data }
449
- };
450
- }
451
- if (!options.visionFallbackEnabled) {
452
- logger.debug("[VisionFallback] Fallback disabled - returning placeholder");
453
- return {
454
- type: "text",
455
- text: `[Image: ${attachment.filename || "image"}] (vision not supported)`
456
- };
457
- }
458
- const attachmentId = attachment.id ?? crypto.randomUUID();
459
- const filename = attachment.filename;
460
- logger.debug("[VisionFallback] Starting delegation for:", { attachmentId, filename });
461
- options.onVisionFallbackStart?.(attachmentId, filename);
462
- const context = filename ? `File: ${filename}` : void 0;
463
- const description = await describeImageFromDataUrl(attachment.data, { context, signal: options.signal });
464
- logger.debug("[VisionFallback] Delegation complete:", { attachmentId, descriptionLength: description.length });
465
- options.onVisionFallbackDone?.(attachmentId, description);
466
- return {
467
- type: "text",
468
- text: `[Image: ${attachment.filename || "image"}] ${description}`
469
- };
470
- }
471
- async function buildAttachmentContentWithFallback(msgContent, attachments, options) {
472
- const content = [];
473
- if (msgContent?.trim()) {
474
- content.push({ type: "text", text: msgContent });
475
- }
476
- for (const attachment of attachments) {
477
- const convertedContent = await convertAttachmentWithFallback(
478
- createAttachmentForConversion(attachment.data, attachment.filename, attachment.id),
479
- options
480
- );
481
- content.push(convertedContent);
482
- }
483
- return content;
484
- }
485
- function convertMessages(messages, options) {
420
+ function convertMessages(messages, modelSupportsVision2) {
486
421
  const filtered = messages.filter((msg) => {
487
422
  return !(msg.role === "assistant" && !msg.content?.trim() && (!msg.toolCalls || msg.toolCalls.length === 0));
488
423
  });
489
424
  return filtered.map((msg) => {
490
425
  if (msg.role === "tool") {
491
426
  if (msg.attachments && msg.attachments.length > 0) {
492
- const content = buildAttachmentContent(msg.content, msg.attachments, options.modelSupportsVision);
427
+ const content = buildAttachmentContent(msg.content, msg.attachments, modelSupportsVision2);
493
428
  return {
494
429
  role: "tool",
495
430
  content,
@@ -506,7 +441,7 @@ function convertMessages(messages, options) {
506
441
  return buildAssistantMessage(msg);
507
442
  }
508
443
  if (msg.role === "user" && msg.attachments && msg.attachments.length > 0) {
509
- const content = buildAttachmentContent(msg.content, msg.attachments, options.modelSupportsVision);
444
+ const content = buildAttachmentContent(msg.content, msg.attachments, modelSupportsVision2);
510
445
  return {
511
446
  role: "user",
512
447
  content
@@ -518,49 +453,6 @@ function convertMessages(messages, options) {
518
453
  };
519
454
  });
520
455
  }
521
- async function convertMessagesWithFallback(messages, options) {
522
- logger.debug("[VisionFallback] convertMessagesWithFallback called", { messageCount: messages.length });
523
- const filtered = messages.filter((msg) => {
524
- return !(msg.role === "assistant" && !msg.content?.trim() && (!msg.toolCalls || msg.toolCalls.length === 0));
525
- });
526
- const converted = [];
527
- for (const msg of filtered) {
528
- if (msg.role === "tool") {
529
- if (msg.attachments && msg.attachments.length > 0) {
530
- const content = await buildAttachmentContentWithFallback(msg.content, msg.attachments, options);
531
- converted.push({
532
- role: "tool",
533
- content,
534
- tool_call_id: msg.toolCallId
535
- });
536
- } else {
537
- converted.push({
538
- role: "tool",
539
- content: msg.content,
540
- tool_call_id: msg.toolCallId
541
- });
542
- }
543
- continue;
544
- }
545
- if (msg.role === "assistant") {
546
- converted.push(buildAssistantMessage(msg));
547
- continue;
548
- }
549
- if (msg.role === "user" && msg.attachments && msg.attachments.length > 0) {
550
- const content = await buildAttachmentContentWithFallback(msg.content, msg.attachments, options);
551
- converted.push({
552
- role: "user",
553
- content
554
- });
555
- continue;
556
- }
557
- converted.push({
558
- role: msg.role,
559
- content: msg.content
560
- });
561
- }
562
- return converted;
563
- }
564
456
  function convertTools(tools) {
565
457
  return tools.map((tool) => ({
566
458
  type: "function",
@@ -571,30 +463,10 @@ function convertTools(tools) {
571
463
  }
572
464
  }));
573
465
  }
574
- function needsVisionFallback(messages, modelSupportsVision, visionFallbackEnabled) {
575
- const hasAttachments = messages.some(
576
- (msg) => msg.attachments && msg.attachments.length > 0 || msg.role === "tool" && msg.attachments && msg.attachments.length > 0
577
- );
578
- const result = hasAttachments && !modelSupportsVision && visionFallbackEnabled;
579
- logger.debug("[VisionFallback] needsVisionFallback check", {
580
- hasAttachments,
581
- modelSupportsVision,
582
- visionFallbackEnabled,
583
- result
584
- });
585
- return result;
586
- }
587
- async function buildChatCompletionCreateParams(model, request, profile, capabilities, disableThinking, visionFallbackEnabled, isStreaming, onVisionFallbackStart, onVisionFallbackDone) {
466
+ async function buildChatCompletionCreateParams(model, request, profile, capabilities, disableThinking, isStreaming) {
588
467
  const userVisionOverride = request.modelSettings?.supportsVision;
589
- const convertedMessages = await convertMessagesWithOptions(
590
- request.messages,
591
- profile,
592
- visionFallbackEnabled,
593
- userVisionOverride,
594
- request.signal,
595
- onVisionFallbackStart,
596
- onVisionFallbackDone
597
- );
468
+ const modelSupportsVision2 = userVisionOverride ?? profile.supportsVision ?? false;
469
+ const convertedMessages = convertMessages(request.messages, modelSupportsVision2);
598
470
  const temperature = request.modelSettings?.temperature ?? request.temperature ?? profile.temperature;
599
471
  const maxTokens = request.modelSettings?.maxTokens ?? request.maxTokens ?? profile.defaultMaxTokens;
600
472
  const topP = request.modelSettings?.topP ?? profile.topP;
@@ -623,26 +495,14 @@ async function buildChatCompletionCreateParams(model, request, profile, capabili
623
495
  return { params, modelParams };
624
496
  }
625
497
  async function buildCreateParamsFromInput(input, isStreaming) {
626
- const {
627
- model,
628
- request,
629
- profile,
630
- capabilities,
631
- disableThinking,
632
- visionFallbackEnabled = false,
633
- onVisionFallbackStart,
634
- onVisionFallbackDone
635
- } = input;
498
+ const { model, request, profile, capabilities, disableThinking } = input;
636
499
  return buildChatCompletionCreateParams(
637
500
  model,
638
501
  request,
639
502
  profile,
640
503
  capabilities,
641
504
  !!disableThinking,
642
- visionFallbackEnabled,
643
- isStreaming,
644
- onVisionFallbackStart,
645
- onVisionFallbackDone
505
+ isStreaming
646
506
  );
647
507
  }
648
508
  var buildNonStreamingCreateParams = (input) => buildCreateParamsFromInput(input, false);
@@ -677,13 +537,7 @@ function extractThinking(content) {
677
537
  }
678
538
 
679
539
  // src/server/llm/streaming.ts
680
- var XML_TOOL_PATTERNS = ["<tool_call>", "<function=", "</tool_call>", "<parameter="];
681
- function hasXmlToolPattern(text) {
682
- return XML_TOOL_PATTERNS.some((p) => text.includes(p));
683
- }
684
540
  async function* streamWithSegments(client, request) {
685
- const xmlAbortController = new AbortController();
686
- const combinedSignal = request.signal ? AbortSignal.any([request.signal, xmlAbortController.signal]) : xmlAbortController.signal;
687
541
  let content = "";
688
542
  let thinkingContent = "";
689
543
  let response = null;
@@ -705,7 +559,7 @@ async function* streamWithSegments(client, request) {
705
559
  currentThinkingSegment = "";
706
560
  };
707
561
  try {
708
- for await (const event of client.stream({ ...request, signal: combinedSignal })) {
562
+ for await (const event of client.stream(request)) {
709
563
  switch (event.type) {
710
564
  case "text_delta":
711
565
  if (firstTokenTime === null) {
@@ -714,11 +568,6 @@ async function* streamWithSegments(client, request) {
714
568
  flushThinking();
715
569
  content += event.content;
716
570
  currentTextSegment += event.content;
717
- if (!request.disableXmlProtection && hasXmlToolPattern(content)) {
718
- xmlAbortController.abort();
719
- yield { type: "xml_tool_abort" };
720
- return null;
721
- }
722
571
  yield { type: "text_delta", content: event.content };
723
572
  break;
724
573
  case "thinking_delta":
@@ -728,11 +577,6 @@ async function* streamWithSegments(client, request) {
728
577
  flushText();
729
578
  thinkingContent += event.content;
730
579
  currentThinkingSegment += event.content;
731
- if (!request.disableXmlProtection && hasXmlToolPattern(thinkingContent)) {
732
- xmlAbortController.abort();
733
- yield { type: "xml_tool_abort" };
734
- return null;
735
- }
736
580
  yield { type: "thinking_delta", content: event.content };
737
581
  break;
738
582
  case "tool_call_delta":
@@ -756,9 +600,6 @@ async function* streamWithSegments(client, request) {
756
600
  }
757
601
  }
758
602
  } catch (error) {
759
- if (error instanceof Error && error.name === "AbortError") {
760
- return null;
761
- }
762
603
  yield { type: "error", error: error instanceof Error ? error.message : "Unknown error" };
763
604
  return null;
764
605
  }
@@ -791,6 +632,7 @@ async function* streamWithSegments(client, request) {
791
632
 
792
633
  export {
793
634
  getModelProfile,
635
+ modelSupportsVision,
794
636
  getBackendCapabilities,
795
637
  detectBackend,
796
638
  getBackendDisplayName,
@@ -801,4 +643,4 @@ export {
801
643
  extractThinking,
802
644
  streamWithSegments
803
645
  };
804
- //# sourceMappingURL=chunk-HGAMIPFO.js.map
646
+ //# sourceMappingURL=chunk-7FDY3EOH.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createServerMessage,
3
3
  isClientMessage
4
- } from "./chunk-T4HV6GS5.js";
4
+ } from "./chunk-BVHFMAVN.js";
5
5
 
6
6
  // src/server/ws/protocol.ts
7
7
  function enrichMessagesWithToolResults(messages) {
@@ -94,8 +94,14 @@ function createChatTodoMessage(todos) {
94
94
  function createChatProgressMessage(message, phase) {
95
95
  return createServerMessage("chat.progress", { message, ...phase ? { phase } : {} });
96
96
  }
97
- function createChatFormatRetryMessage(attempt, maxAttempts) {
98
- return createServerMessage("chat.format_retry", { attempt, maxAttempts });
97
+ function createChatFormatRetryMessage(attempt, maxAttempts, pattern, field, matchedContent) {
98
+ return createServerMessage("chat.format_retry", {
99
+ attempt,
100
+ maxAttempts,
101
+ ...pattern !== void 0 ? { pattern } : {},
102
+ ...field !== void 0 ? { field } : {},
103
+ ...matchedContent !== void 0 ? { matchedContent } : {}
104
+ });
99
105
  }
100
106
  function createChatMessageMessage(message) {
101
107
  return createServerMessage("chat.message", { message });
@@ -120,9 +126,6 @@ function createChatPathConfirmationMessage(callId, tool, paths, workdir, reason)
120
126
  function createChatAskUserMessage(callId, question) {
121
127
  return createServerMessage("chat.ask_user", { callId, question });
122
128
  }
123
- function createChatVisionFallbackMessage(payload) {
124
- return createServerMessage("chat.vision_fallback", payload);
125
- }
126
129
  function createModeChangedMessage(mode, auto, reason) {
127
130
  return createServerMessage("mode.changed", { mode, auto, ...reason ? { reason } : {} });
128
131
  }
@@ -280,9 +283,9 @@ function storedEventToServerMessage(event) {
280
283
  const data = event.data;
281
284
  return createChatAskUserMessage(data.callId, data.question);
282
285
  }
283
- case "format.retry": {
286
+ case "pattern.retry": {
284
287
  const data = event.data;
285
- return createChatFormatRetryMessage(data.attempt, data.maxAttempts);
288
+ return createChatFormatRetryMessage(data.attempt, data.maxAttempts, data.pattern, data.field, data.matchedContent);
286
289
  }
287
290
  case "turn.snapshot":
288
291
  case "context.compacted":
@@ -317,7 +320,6 @@ export {
317
320
  createChatErrorMessage,
318
321
  createChatPathConfirmationMessage,
319
322
  createChatAskUserMessage,
320
- createChatVisionFallbackMessage,
321
323
  createModeChangedMessage,
322
324
  createPhaseChangedMessage,
323
325
  createCriteriaUpdatedMessage,
@@ -331,4 +333,4 @@ export {
331
333
  createQueueStateMessage,
332
334
  storedEventToServerMessage
333
335
  };
334
- //# sourceMappingURL=chunk-V6DYJV5R.js.map
336
+ //# sourceMappingURL=chunk-7TTEGAO6.js.map
@@ -26,4 +26,4 @@ export {
26
26
  isClientMessage,
27
27
  isServerMessage
28
28
  };
29
- //# sourceMappingURL=chunk-T4HV6GS5.js.map
29
+ //# sourceMappingURL=chunk-BVHFMAVN.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  getEventStore,
3
3
  updateSessionMetadata
4
- } from "./chunk-UH27FDT7.js";
4
+ } from "./chunk-NPHYEUYE.js";
5
5
  import {
6
6
  buildMessagesFromStoredEvents,
7
7
  foldPendingConfirmations
8
- } from "./chunk-XL7SW5B4.js";
8
+ } from "./chunk-XJEOP6XU.js";
9
9
  import {
10
10
  createContextStateMessage,
11
11
  createSessionStateMessage
12
- } from "./chunk-V6DYJV5R.js";
12
+ } from "./chunk-7TTEGAO6.js";
13
13
  import {
14
14
  logger
15
15
  } from "./chunk-K44MW7JJ.js";
@@ -143,4 +143,4 @@ export {
143
143
  needsNameGenerationCheck,
144
144
  applyGeneratedSessionName
145
145
  };
146
- //# sourceMappingURL=chunk-OBD6D5ZO.js.map
146
+ //# sourceMappingURL=chunk-CDDMHSZF.js.map