openfox 0.2.4 → 1.0.0

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 (64) hide show
  1. package/dist/agent-defaults/builder.agent.md +3 -7
  2. package/dist/agent-defaults/code-reviewer.agent.md +1 -2
  3. package/dist/agent-defaults/debugger.agent.md +1 -2
  4. package/dist/agent-defaults/planner.agent.md +2 -9
  5. package/dist/agent-defaults/test-generator.agent.md +1 -1
  6. package/dist/agent-defaults/verifier.agent.md +4 -5
  7. package/dist/ask-3RK5YJZE.js +19 -0
  8. package/dist/auto-compaction-7LNZ5J3W.js +23 -0
  9. package/dist/{branch.api-WDHKZJS6.js → branch.api-XADFZZAA.js} +2 -2
  10. package/dist/chat-handler-T7SLWZ4E.js +201 -0
  11. package/dist/chunk-22CTURMH.js +128 -0
  12. package/dist/chunk-2KSCZSXQ.js +680 -0
  13. package/dist/{chunk-S5NRIWEU.js → chunk-2TBNG7CS.js} +12 -12
  14. package/dist/{chunk-4Z2OZ6NX.js → chunk-3EHGGBWE.js} +29 -2
  15. package/dist/{chunk-GZ7ZVJIW.js → chunk-3UQACISJ.js} +159 -49
  16. package/dist/{chunk-AF7XS4OI.js → chunk-5YQAXUKO.js} +4 -1
  17. package/dist/{chunk-MTX5Y3V3.js → chunk-7IOZFJBW.js} +2 -2
  18. package/dist/chunk-BU2ZYOEA.js +1067 -0
  19. package/dist/chunk-M2C5GEQR.js +137 -0
  20. package/dist/{chunk-U62ZECSQ.js → chunk-PNBH3RAX.js} +2 -2
  21. package/dist/chunk-QDEKU5RL.js +75 -0
  22. package/dist/chunk-QYP5HQV4.js +438 -0
  23. package/dist/{chunk-O4W4555H.js → chunk-RAZQTQK2.js} +1353 -1134
  24. package/dist/chunk-S4QKTRGJ.js +343 -0
  25. package/dist/{chunk-ARFK3RZW.js → chunk-TPT6HP4H.js} +1 -1
  26. package/dist/chunk-TVQOONDR.js +75 -0
  27. package/dist/{chunk-5ZUU23XF.js → chunk-U6BUT37A.js} +286 -33
  28. package/dist/chunk-VZXXJKSQ.js +314 -0
  29. package/dist/{chunk-26NRL3HX.js → chunk-XFXOSPYH.js} +3 -2
  30. package/dist/{chunk-N2XYX4ZA.js → chunk-XKFPU2FA.js} +13 -2
  31. package/dist/{chunk-FUUYYDVG.js → chunk-YB2574C6.js} +2841 -4507
  32. package/dist/cli/dev.js +4 -3
  33. package/dist/cli/index.js +4 -3
  34. package/dist/{config-GIXXE4VK.js → config-GIFCEJDU.js} +11 -6
  35. package/dist/events-G6CKHDNZ.js +114 -0
  36. package/dist/folding-O52L65VN.js +37 -0
  37. package/dist/{init-2EJ5AC7Z.js → init-MKTUIGZU.js} +46 -13
  38. package/dist/orchestrator-UGXX7JRQ.js +39 -0
  39. package/dist/package.json +9 -2
  40. package/dist/{paths-4BPXWB2W.js → paths-MM76AWYB.js} +2 -2
  41. package/dist/processor-KLHKDILM.js +236 -0
  42. package/dist/{project-creator-CWPKRIKI.js → project-creator-KAQXMZCT.js} +9 -8
  43. package/dist/projects-GSMMEVSO.js +19 -0
  44. package/dist/{protocol-BFFz3WM0.d.ts → protocol-BZ6OIASP.d.ts} +71 -50
  45. package/dist/protocol-WQENDK72.js +88 -0
  46. package/dist/{provider-QEVVNYOX.js → provider-4KTWU6IV.js} +41 -9
  47. package/dist/runtime-config-2XJJIMSC.js +9 -0
  48. package/dist/{serve-RYEBLJVN.js → serve-UK6B6G2O.js} +38 -18
  49. package/dist/server/index.d.ts +81 -27
  50. package/dist/server/index.js +19 -11
  51. package/dist/{settings-D5O3TMLD.js → settings-NCLN4JDZ.js} +4 -4
  52. package/dist/shared/index.d.ts +2 -2
  53. package/dist/shared/index.js +1 -1
  54. package/dist/tools-SGBQE736.js +48 -0
  55. package/dist/vision-fallback-63VPBSEN.js +22 -0
  56. package/dist/web/assets/{index-DHmZmhnR.css → index-BsaaC0X0.css} +32 -1
  57. package/dist/web/assets/index-CvO7QkGh.js +141 -0
  58. package/dist/web/index.html +2 -2
  59. package/dist/web/sounds/typing.mp3 +0 -0
  60. package/dist/workflow-defaults/default.workflow.json +1 -1
  61. package/package.json +9 -2
  62. package/dist/chunk-L4XDA3V7.js +0 -218
  63. package/dist/tools-QMIIDJTV.js +0 -48
  64. package/dist/web/assets/index-CAD7Iv_d.js +0 -122
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createProject
3
- } from "./chunk-N2XYX4ZA.js";
4
- import "./chunk-4Z2OZ6NX.js";
5
- import "./chunk-U62ZECSQ.js";
3
+ } from "./chunk-XKFPU2FA.js";
4
+ import "./chunk-3EHGGBWE.js";
5
+ import "./chunk-PNBH3RAX.js";
6
6
 
7
7
  // src/server/utils/project-creator.ts
8
8
  import { mkdir } from "fs/promises";
@@ -12,11 +12,11 @@ function validateProjectName(name) {
12
12
  if (!name || name.trim() === "") {
13
13
  return { valid: false, error: "Project name cannot be empty" };
14
14
  }
15
- const validPattern = /^[a-zA-Z0-9._-]+$/;
15
+ const validPattern = /^[a-zA-Z0-9._ -]+$/;
16
16
  if (!validPattern.test(name)) {
17
17
  return {
18
18
  valid: false,
19
- error: "Project name can only contain letters, numbers, hyphens, underscores, and dots"
19
+ error: "Project name can only contain letters, numbers, hyphens, underscores, dots, and spaces"
20
20
  };
21
21
  }
22
22
  if (name.includes("/") || name.includes("\\") || name.includes("..")) {
@@ -39,7 +39,8 @@ async function createDirectoryWithGit(projectName, workdir) {
39
39
  if (!validation.valid) {
40
40
  throw new Error(validation.error);
41
41
  }
42
- const fullPath = join(workdir, projectName);
42
+ const sanitizedName = projectName.trim().replace(/\s+/g, "-");
43
+ const fullPath = join(workdir, sanitizedName);
43
44
  const exists = await directoryExists(fullPath);
44
45
  if (exists) {
45
46
  throw new Error(`Directory already exists: ${fullPath}. Please choose a different name or use the existing directory from Browse Projects.`);
@@ -58,7 +59,7 @@ async function createDirectoryWithGit(projectName, workdir) {
58
59
  const errorMessage = error instanceof Error ? error.message : "Unknown error";
59
60
  throw new Error(`Failed to initialize git repository: ${errorMessage}`);
60
61
  }
61
- const project = createProject(projectName, fullPath);
62
+ const project = createProject(projectName, workdir);
62
63
  return project;
63
64
  }
64
65
  export {
@@ -66,4 +67,4 @@ export {
66
67
  directoryExists,
67
68
  validateProjectName
68
69
  };
69
- //# sourceMappingURL=project-creator-CWPKRIKI.js.map
70
+ //# sourceMappingURL=project-creator-KAQXMZCT.js.map
@@ -0,0 +1,19 @@
1
+ import {
2
+ createProject,
3
+ deleteProject,
4
+ getProject,
5
+ getProjectByWorkdir,
6
+ listProjects,
7
+ updateProject
8
+ } from "./chunk-XKFPU2FA.js";
9
+ import "./chunk-3EHGGBWE.js";
10
+ import "./chunk-PNBH3RAX.js";
11
+ export {
12
+ createProject,
13
+ deleteProject,
14
+ getProject,
15
+ getProjectByWorkdir,
16
+ listProjects,
17
+ updateProject
18
+ };
19
+ //# sourceMappingURL=projects-GSMMEVSO.js.map
@@ -9,6 +9,7 @@ interface Project {
9
9
  type SessionMode = string;
10
10
  type ToolMode = string;
11
11
  type SessionPhase = 'plan' | 'build' | 'verification' | 'blocked' | 'done';
12
+ type DangerLevel = 'normal' | 'dangerous';
12
13
  interface Session {
13
14
  id: string;
14
15
  projectId: string;
@@ -26,6 +27,7 @@ interface Session {
26
27
  contextWindows: ContextWindow[];
27
28
  executionState: ExecutionState | null;
28
29
  metadata: SessionMetadata;
30
+ dangerLevel?: DangerLevel;
29
31
  }
30
32
  interface ContextWindow {
31
33
  id: string;
@@ -252,6 +254,11 @@ interface Message {
252
254
  subAgentType?: string;
253
255
  promptContext?: PromptContext;
254
256
  attachments?: Attachment[];
257
+ metadata?: {
258
+ type: string;
259
+ name: string;
260
+ color: string;
261
+ };
255
262
  }
256
263
  interface ToolCall {
257
264
  id: string;
@@ -303,7 +310,7 @@ interface ToolResult {
303
310
  };
304
311
  metadata?: Record<string, unknown>;
305
312
  }
306
- type ToolName = 'read_file' | 'write_file' | 'edit_file' | 'run_command' | 'glob' | 'grep' | 'ask_user' | 'add_criterion' | 'update_criterion' | 'remove_criterion' | 'get_criteria' | 'complete_criterion' | 'pass_criterion' | 'fail_criterion' | 'todo_write' | 'web_fetch';
313
+ type ToolName = 'read_file' | 'write_file' | 'edit_file' | 'run_command' | 'glob' | 'grep' | 'ask_user' | 'criterion' | 'todo' | 'web_fetch';
307
314
  interface Criterion {
308
315
  id: string;
309
316
  description: string;
@@ -353,6 +360,7 @@ interface ExecutionState {
353
360
  compactionCount: number;
354
361
  startedAt: string;
355
362
  lastActivityAt: string;
363
+ lastModeWithReminder?: string;
356
364
  }
357
365
  interface ContextState {
358
366
  currentTokens: number;
@@ -392,6 +400,12 @@ interface Diagnostic {
392
400
  type LlmBackend = 'vllm' | 'sglang' | 'ollama' | 'llamacpp' | 'unknown';
393
401
  /** Extended backend type including cloud providers */
394
402
  type ProviderBackend = LlmBackend | 'openai' | 'anthropic' | 'auto';
403
+ /** Model configuration with context window */
404
+ interface ModelConfig {
405
+ id: string;
406
+ contextWindow: number;
407
+ source: 'backend' | 'user' | 'default';
408
+ }
395
409
  /** LLM provider configuration */
396
410
  interface Provider {
397
411
  id: string;
@@ -399,7 +413,7 @@ interface Provider {
399
413
  url: string;
400
414
  backend: ProviderBackend;
401
415
  apiKey?: string | undefined;
402
- maxContext?: number | undefined;
416
+ models: ModelConfig[];
403
417
  isActive: boolean;
404
418
  createdAt: string;
405
419
  }
@@ -435,7 +449,7 @@ interface Config {
435
449
  logging?: {
436
450
  level: 'debug' | 'info' | 'warn' | 'error';
437
451
  };
438
- mode?: 'development' | 'production';
452
+ mode?: 'development' | 'production' | 'test';
439
453
  dev?: boolean;
440
454
  /** Configured providers (loaded from global config) */
441
455
  providers?: Provider[] | undefined;
@@ -449,41 +463,16 @@ interface Config {
449
463
  activeWorkflowId?: string | undefined;
450
464
  }
451
465
 
452
- type ClientMessageType = 'project.create' | 'project.create-with-dir' | 'project.list' | 'project.load' | 'project.update' | 'project.delete' | 'session.create' | 'session.load' | 'session.list' | 'session.delete' | 'session.deleteAll' | 'chat.send' | 'chat.stop' | 'chat.continue' | 'mode.switch' | 'mode.accept' | 'criteria.edit' | 'context.compact' | 'runner.launch' | 'path.confirm' | 'settings.get' | 'settings.set' | 'provider.activate' | 'session.setProvider' | 'queue.asap' | 'queue.completion' | 'queue.cancel';
466
+ type ClientMessageType = 'session.load' | 'chat.send' | 'chat.stop' | 'chat.continue' | 'mode.switch' | 'mode.accept' | 'criteria.edit' | 'context.compact' | 'runner.launch' | 'path.confirm' | 'ask.answer' | 'queue.asap' | 'queue.completion' | 'queue.cancel';
453
467
  interface ClientMessage<T = unknown> {
454
468
  id: string;
455
469
  type: ClientMessageType;
456
470
  payload: T;
457
471
  }
458
- interface ProjectCreatePayload {
459
- name: string;
460
- workdir: string;
461
- }
462
- interface ProjectCreateWithDirPayload {
463
- name: string;
464
- }
465
- interface ProjectLoadPayload {
466
- projectId: string;
467
- }
468
- interface ProjectUpdatePayload {
469
- projectId: string;
470
- name?: string;
471
- customInstructions?: string | null;
472
- }
473
- interface ProjectDeletePayload {
474
- projectId: string;
475
- }
476
- interface SessionCreatePayload {
477
- projectId: string;
478
- title?: string;
479
- }
480
472
  interface SessionLoadPayload {
481
473
  sessionId: string;
482
474
  lastEventSeq?: number;
483
475
  }
484
- interface SessionDeleteAllPayload {
485
- projectId: string;
486
- }
487
476
  interface ChatSendPayload {
488
477
  content: string;
489
478
  attachments?: Attachment[];
@@ -496,24 +485,6 @@ interface ModeSwitchPayload {
496
485
  interface CriteriaEditPayload {
497
486
  criteria: Criterion[];
498
487
  }
499
- interface SettingsGetPayload {
500
- key: string;
501
- }
502
- interface SettingsSetPayload {
503
- key: string;
504
- value: string;
505
- }
506
- interface SettingsValuePayload {
507
- key: string;
508
- value: string | null;
509
- }
510
- interface ProviderActivatePayload {
511
- providerId: string;
512
- }
513
- interface SessionSetProviderPayload {
514
- providerId: string;
515
- model?: string;
516
- }
517
488
  interface QueueAsapPayload {
518
489
  content: string;
519
490
  attachments?: Attachment[];
@@ -525,14 +496,19 @@ interface QueueCompletionPayload {
525
496
  interface QueueCancelPayload {
526
497
  queueId: string;
527
498
  }
499
+ interface AskAnswerPayload {
500
+ callId: string;
501
+ answer: string;
502
+ }
528
503
  interface QueuedMessage {
529
504
  queueId: string;
530
505
  mode: 'asap' | 'completion';
531
506
  content: string;
532
507
  attachments?: Attachment[];
533
508
  queuedAt: string;
509
+ messageKind?: string;
534
510
  }
535
- type ServerMessageType = 'project.state' | 'project.list' | 'project.deleted' | 'session.state' | 'session.list' | 'session.deleted' | 'session.deletedAll' | 'session.running' | 'session.name_generated' | 'chat.delta' | 'chat.thinking' | 'chat.tool_preparing' | 'chat.tool_call' | 'chat.tool_output' | 'chat.tool_result' | 'chat.todo' | 'chat.summary' | 'chat.progress' | 'chat.format_retry' | 'chat.message' | 'chat.message_updated' | 'chat.done' | 'chat.error' | 'chat.path_confirmation' | 'mode.changed' | 'phase.changed' | 'task.completed' | 'criteria.updated' | 'context.state' | 'settings.value' | 'provider.changed' | 'queue.state' | 'devServer.output' | 'devServer.state' | 'lsp.diagnostics' | 'error' | 'ack';
511
+ type ServerMessageType = 'project.state' | 'project.list' | 'project.deleted' | 'session.state' | 'session.list' | 'session.deleted' | 'session.deletedAll' | 'session.running' | 'session.name_generated' | 'chat.delta' | 'chat.thinking' | 'chat.tool_preparing' | 'chat.tool_call' | 'chat.tool_output' | 'chat.tool_result' | 'chat.todo' | 'chat.summary' | 'chat.progress' | 'chat.format_retry' | 'chat.message' | 'chat.message_updated' | 'chat.done' | 'chat.vision_fallback' | 'chat.error' | 'chat.path_confirmation' | 'chat.ask_user' | 'mode.changed' | 'phase.changed' | 'task.completed' | 'criteria.updated' | 'context.state' | 'settings.value' | 'provider.changed' | 'queue.state' | 'devServer.output' | 'devServer.state' | 'lsp.diagnostics' | 'error' | 'ack';
536
512
  interface ServerMessage<T = unknown> {
537
513
  id?: string;
538
514
  type: ServerMessageType;
@@ -552,6 +528,14 @@ interface ProjectDeletedPayload {
552
528
  interface SessionStatePayload {
553
529
  session: Session;
554
530
  messages: Message[];
531
+ pendingConfirmations: PendingPathConfirmationPayload[];
532
+ }
533
+ interface PendingPathConfirmationPayload {
534
+ callId: string;
535
+ tool: string;
536
+ paths: string[];
537
+ workdir: string;
538
+ reason: 'outside_workdir' | 'sensitive_file' | 'both' | 'dangerous_command';
555
539
  }
556
540
  interface SessionListPayload {
557
541
  sessions: SessionSummary[];
@@ -607,6 +591,13 @@ interface ChatFormatRetryPayload {
607
591
  attempt: number;
608
592
  maxAttempts: number;
609
593
  }
594
+ interface ChatVisionFallbackPayload {
595
+ type: 'start' | 'done';
596
+ messageId: string;
597
+ attachmentId: string;
598
+ filename?: string;
599
+ description?: string;
600
+ }
610
601
  interface ChatMessagePayload {
611
602
  message: Message;
612
603
  }
@@ -632,7 +623,7 @@ interface ChatErrorPayload {
632
623
  error: string;
633
624
  recoverable: boolean;
634
625
  }
635
- type PathConfirmationReason = 'outside_workdir' | 'sensitive_file' | 'both';
626
+ type PathConfirmationReason = 'outside_workdir' | 'sensitive_file' | 'both' | 'dangerous_command';
636
627
  interface ChatPathConfirmationPayload {
637
628
  callId: string;
638
629
  tool: string;
@@ -643,6 +634,11 @@ interface ChatPathConfirmationPayload {
643
634
  interface PathConfirmPayload {
644
635
  callId: string;
645
636
  approved: boolean;
637
+ alwaysAllow?: boolean;
638
+ }
639
+ interface ChatAskUserPayload {
640
+ callId: string;
641
+ question: string;
646
642
  }
647
643
  interface ModeChangedPayload {
648
644
  mode: SessionMode;
@@ -767,5 +763,30 @@ declare function createClientMessage<T>(type: ClientMessageType, payload: T): Cl
767
763
  declare function createServerMessage<T>(type: ServerMessageType, payload: T, correlationId?: string): ServerMessage<T>;
768
764
  declare function isClientMessage(msg: unknown): msg is ClientMessage;
769
765
  declare function isServerMessage(msg: unknown): msg is ServerMessage;
766
+ type QueueEventType = 'queue.added' | 'queue.drained' | 'queue.cancelled';
767
+ interface QueueAddedEvent {
768
+ type: 'queue.added';
769
+ data: {
770
+ queueId: string;
771
+ mode: 'asap' | 'completion';
772
+ content: string;
773
+ attachments?: Attachment[];
774
+ messageKind?: string;
775
+ queuedAt: string;
776
+ };
777
+ }
778
+ interface QueueDrainedEvent {
779
+ type: 'queue.drained';
780
+ data: {
781
+ queueId: string;
782
+ };
783
+ }
784
+ interface QueueCancelledEvent {
785
+ type: 'queue.cancelled';
786
+ data: {
787
+ queueId: string;
788
+ };
789
+ }
790
+ type QueueEvent = QueueAddedEvent | QueueDrainedEvent | QueueCancelledEvent;
770
791
 
771
- export { type ModelSessionStats as $, type AgentEvent as A, type CriteriaUpdatedPayload as B, type CallStatsDataPoint as C, type Criterion as D, type CriterionAttempt as E, type CriterionStatus as F, type CriterionValidation as G, type DevServerOutputPayload as H, type DevServerStatePayload as I, type Diagnostic as J, type EditContextEdit as K, type EditContextLine as L, type Message as M, type EditContextRegion as N, type ErrorPayload as O, type ExecutionState as P, type FileReadEntry as Q, type InjectedFile as R, type SessionStats as S, type LLMCallStats as T, type LlmBackend as U, type LspDiagnosticsPayload as V, type MessageRole as W, type MessageSegment as X, type MessageStats as Y, type ModeChangedPayload as Z, type ModeSwitchPayload as _, type AskUserEvent as a, type PathConfirmPayload as a0, type PathConfirmationReason as a1, type PhaseChangedPayload as a2, type PreparingToolCall as a3, type Project as a4, type ProjectCreatePayload as a5, type ProjectCreateWithDirPayload as a6, type ProjectDeletePayload as a7, type ProjectDeletedPayload as a8, type ProjectListPayload as a9, type SessionNameGeneratedPayload as aA, type SessionPhase as aB, type SessionRunningPayload as aC, type SessionSetProviderPayload as aD, type SessionStatePayload as aE, type SessionSummary as aF, type SettingsGetPayload as aG, type SettingsSetPayload as aH, type SettingsValuePayload as aI, type StatsDataPoint as aJ, type StatsIdentity as aK, type TaskCompletedPayload as aL, type Todo as aM, type ToolCall as aN, type ToolMode as aO, type ToolName as aP, type ToolResult as aQ, type ValidationResult as aR, createClientMessage as aS, createServerMessage as aT, isClientMessage as aU, isServerMessage as aV, type ProjectLoadPayload as aa, type ProjectStatePayload as ab, type ProjectUpdatePayload as ac, type PromptContext as ad, type PromptContextMessage as ae, type PromptContextTool as af, type PromptRequestOptions as ag, type Provider as ah, type ProviderActivatePayload as ai, type ProviderBackend as aj, type ProviderChangedPayload as ak, type QueueAsapPayload as al, type QueueCancelPayload as am, type QueueCompletionPayload as an, type QueueStatePayload as ao, type QueuedMessage as ap, type RecentUserPrompt as aq, type ServerMessage as ar, type ServerMessageType as as, type Session as at, type SessionCreatePayload as au, type SessionDeleteAllPayload as av, type SessionListPayload as aw, type SessionLoadPayload as ax, type SessionMetadata as ay, type SessionMode as az, type Attachment as b, type ChatDeltaPayload as c, type ChatDonePayload as d, type ChatErrorPayload as e, type ChatFormatRetryPayload as f, type ChatMessagePayload as g, type ChatMessageUpdatedPayload as h, type ChatPathConfirmationPayload as i, type ChatProgressPayload as j, type ChatSendPayload as k, type ChatSummaryPayload as l, type ChatThinkingPayload as m, type ChatTodoPayload as n, type ChatToolCallPayload as o, type ChatToolOutputPayload as p, type ChatToolPreparingPayload as q, type ChatToolResultPayload as r, type ClientMessage as s, type ClientMessageType as t, type Config as u, type ContextCompactionEvent as v, type ContextState as w, type ContextStatePayload as x, type ContextWindow as y, type CriteriaEditPayload as z };
792
+ export { type MessageSegment as $, type AgentEvent as A, type ContextStatePayload as B, type CallStatsDataPoint as C, type ContextWindow as D, type CriteriaEditPayload as E, type CriteriaUpdatedPayload as F, type Criterion as G, type CriterionAttempt as H, type CriterionStatus as I, type CriterionValidation as J, type DangerLevel as K, type DevServerOutputPayload as L, type Message as M, type DevServerStatePayload as N, type Diagnostic as O, type EditContextEdit as P, type EditContextLine as Q, type EditContextRegion as R, type SessionStats as S, type ErrorPayload as T, type ExecutionState as U, type FileReadEntry as V, type InjectedFile as W, type LLMCallStats as X, type LlmBackend as Y, type LspDiagnosticsPayload as Z, type MessageRole as _, type AskAnswerPayload as a, type MessageStats as a0, type ModeChangedPayload as a1, type ModeSwitchPayload as a2, type ModelConfig as a3, type ModelSessionStats as a4, type PathConfirmPayload as a5, type PathConfirmationReason as a6, type PendingPathConfirmationPayload as a7, type PhaseChangedPayload as a8, type PreparingToolCall as a9, type SessionLoadPayload as aA, type SessionMetadata as aB, type SessionMode as aC, type SessionNameGeneratedPayload as aD, type SessionPhase as aE, type SessionRunningPayload as aF, type SessionStatePayload as aG, type SessionSummary as aH, type StatsDataPoint as aI, type StatsIdentity as aJ, type TaskCompletedPayload as aK, type Todo as aL, type ToolCall as aM, type ToolMode as aN, type ToolName as aO, type ToolResult as aP, type ValidationResult as aQ, createClientMessage as aR, createServerMessage as aS, isClientMessage as aT, isServerMessage as aU, type Project as aa, type ProjectDeletedPayload as ab, type ProjectListPayload as ac, type ProjectStatePayload as ad, type PromptContext as ae, type PromptContextMessage as af, type PromptContextTool as ag, type PromptRequestOptions as ah, type Provider as ai, type ProviderBackend as aj, type ProviderChangedPayload as ak, type QueueAddedEvent as al, type QueueAsapPayload as am, type QueueCancelPayload as an, type QueueCancelledEvent as ao, type QueueCompletionPayload as ap, type QueueDrainedEvent as aq, type QueueEvent as ar, type QueueEventType as as, type QueueStatePayload as at, type QueuedMessage as au, type RecentUserPrompt as av, type ServerMessage as aw, type ServerMessageType as ax, type Session as ay, type SessionListPayload as az, type AskUserEvent as b, type Attachment as c, type ChatAskUserPayload as d, type ChatDeltaPayload as e, type ChatDonePayload as f, type ChatErrorPayload as g, type ChatFormatRetryPayload as h, type ChatMessagePayload as i, type ChatMessageUpdatedPayload as j, type ChatPathConfirmationPayload as k, type ChatProgressPayload as l, type ChatSendPayload as m, type ChatSummaryPayload as n, type ChatThinkingPayload as o, type ChatTodoPayload as p, type ChatToolCallPayload as q, type ChatToolOutputPayload as r, type ChatToolPreparingPayload as s, type ChatToolResultPayload as t, type ChatVisionFallbackPayload as u, type ClientMessage as v, type ClientMessageType as w, type Config as x, type ContextCompactionEvent as y, type ContextState as z };
@@ -0,0 +1,88 @@
1
+ import {
2
+ createChatAskUserMessage,
3
+ createChatDeltaMessage,
4
+ createChatDoneMessage,
5
+ createChatErrorMessage,
6
+ createChatFormatRetryMessage,
7
+ createChatMessageMessage,
8
+ createChatMessageUpdatedMessage,
9
+ createChatPathConfirmationMessage,
10
+ createChatProgressMessage,
11
+ createChatSummaryMessage,
12
+ createChatThinkingMessage,
13
+ createChatTodoMessage,
14
+ createChatToolCallMessage,
15
+ createChatToolOutputMessage,
16
+ createChatToolPreparingMessage,
17
+ createChatToolResultMessage,
18
+ createChatVisionFallbackMessage,
19
+ createContextStateMessage,
20
+ createCriteriaUpdatedMessage,
21
+ createErrorMessage,
22
+ createModeChangedMessage,
23
+ createPhaseChangedMessage,
24
+ createProjectListMessage,
25
+ createProjectStateMessage,
26
+ createQueueStateMessage,
27
+ createSessionListMessage,
28
+ createSessionNameGeneratedMessage,
29
+ createSessionRunningMessage,
30
+ createSessionStateMessage,
31
+ isAskAnswerPayload,
32
+ isChatSendPayload,
33
+ isCriteriaEditPayload,
34
+ isModeSwitchPayload,
35
+ isPathConfirmPayload,
36
+ isQueueAsapPayload,
37
+ isQueueCancelPayload,
38
+ isQueueCompletionPayload,
39
+ isSessionLoadPayload,
40
+ parseClientMessage,
41
+ serializeServerMessage,
42
+ storedEventToServerMessage
43
+ } from "./chunk-S4QKTRGJ.js";
44
+ import "./chunk-TPT6HP4H.js";
45
+ export {
46
+ createChatAskUserMessage,
47
+ createChatDeltaMessage,
48
+ createChatDoneMessage,
49
+ createChatErrorMessage,
50
+ createChatFormatRetryMessage,
51
+ createChatMessageMessage,
52
+ createChatMessageUpdatedMessage,
53
+ createChatPathConfirmationMessage,
54
+ createChatProgressMessage,
55
+ createChatSummaryMessage,
56
+ createChatThinkingMessage,
57
+ createChatTodoMessage,
58
+ createChatToolCallMessage,
59
+ createChatToolOutputMessage,
60
+ createChatToolPreparingMessage,
61
+ createChatToolResultMessage,
62
+ createChatVisionFallbackMessage,
63
+ createContextStateMessage,
64
+ createCriteriaUpdatedMessage,
65
+ createErrorMessage,
66
+ createModeChangedMessage,
67
+ createPhaseChangedMessage,
68
+ createProjectListMessage,
69
+ createProjectStateMessage,
70
+ createQueueStateMessage,
71
+ createSessionListMessage,
72
+ createSessionNameGeneratedMessage,
73
+ createSessionRunningMessage,
74
+ createSessionStateMessage,
75
+ isAskAnswerPayload,
76
+ isChatSendPayload,
77
+ isCriteriaEditPayload,
78
+ isModeSwitchPayload,
79
+ isPathConfirmPayload,
80
+ isQueueAsapPayload,
81
+ isQueueCancelPayload,
82
+ isQueueCompletionPayload,
83
+ isSessionLoadPayload,
84
+ parseClientMessage,
85
+ serializeServerMessage,
86
+ storedEventToServerMessage
87
+ };
88
+ //# sourceMappingURL=protocol-WQENDK72.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  fetchAvailableModelsFromBackend
3
- } from "./chunk-L4XDA3V7.js";
3
+ } from "./chunk-QYP5HQV4.js";
4
4
  import {
5
5
  activateProvider,
6
6
  addProvider,
@@ -8,14 +8,15 @@ import {
8
8
  loadGlobalConfig,
9
9
  removeProvider,
10
10
  saveGlobalConfig
11
- } from "./chunk-GZ7ZVJIW.js";
11
+ } from "./chunk-3UQACISJ.js";
12
12
  import {
13
13
  detectBackend,
14
14
  detectModel
15
- } from "./chunk-5ZUU23XF.js";
16
- import "./chunk-26NRL3HX.js";
17
- import "./chunk-U62ZECSQ.js";
18
- import "./chunk-AF7XS4OI.js";
15
+ } from "./chunk-U6BUT37A.js";
16
+ import "./chunk-XFXOSPYH.js";
17
+ import "./chunk-5YQAXUKO.js";
18
+ import "./chunk-M2C5GEQR.js";
19
+ import "./chunk-PNBH3RAX.js";
19
20
 
20
21
  // src/cli/provider.ts
21
22
  import { select, text, password, spinner, log, outro, isCancel, cancel } from "@clack/prompts";
@@ -207,16 +208,47 @@ async function runProviderAdd(mode) {
207
208
  if (isCancel(choice)) return false;
208
209
  return choice === "yes";
209
210
  })();
211
+ const modelsWithContent = [];
212
+ if (availableModels.length > 0) {
213
+ const modelFetchSpinner = spinner();
214
+ modelFetchSpinner.start("Fetching model metadata...");
215
+ try {
216
+ const urlWithV1 = url.includes("/v1") ? url : `${url}/v1`;
217
+ const response = await fetch(`${urlWithV1}/models`, {
218
+ signal: AbortSignal.timeout(1e4)
219
+ });
220
+ if (response.ok) {
221
+ const data = await response.json();
222
+ if (data.data && Array.isArray(data.data)) {
223
+ for (const modelData of data.data) {
224
+ modelsWithContent.push({
225
+ id: modelData.id,
226
+ contextWindow: modelData.max_model_len ?? 2e5,
227
+ source: modelData.max_model_len ? "backend" : "default"
228
+ });
229
+ }
230
+ modelFetchSpinner.stop(`\u2713 Fetched ${modelsWithContent.length} model(s) with context windows`);
231
+ } else {
232
+ modelFetchSpinner.stop("\u26A0 No models in response");
233
+ }
234
+ } else {
235
+ modelFetchSpinner.stop("\u26A0 Could not fetch model metadata");
236
+ }
237
+ } catch {
238
+ modelFetchSpinner.stop("\u26A0 Failed to fetch model metadata");
239
+ }
240
+ }
241
+ const models = modelsWithContent.length > 0 ? modelsWithContent : [];
210
242
  let newConfig = addProvider(config, {
211
243
  name,
212
244
  url,
213
245
  backend: finalBackend,
214
246
  apiKey,
215
- maxContext: 2e5,
247
+ models,
216
248
  isActive: makeActive
217
249
  });
218
250
  if (makeActive) {
219
- const { setDefaultModelSelection } = await import("./config-GIXXE4VK.js");
251
+ const { setDefaultModelSelection } = await import("./config-GIFCEJDU.js");
220
252
  newConfig = setDefaultModelSelection(newConfig, newConfig.providers[newConfig.providers.length - 1].id, selectedModel);
221
253
  }
222
254
  await saveGlobalConfig(mode, newConfig);
@@ -340,4 +372,4 @@ export {
340
372
  runProviderRemove,
341
373
  runProviderUse
342
374
  };
343
- //# sourceMappingURL=provider-QEVVNYOX.js.map
375
+ //# sourceMappingURL=provider-4KTWU6IV.js.map
@@ -0,0 +1,9 @@
1
+ import {
2
+ getRuntimeConfig,
3
+ setRuntimeConfig
4
+ } from "./chunk-TVQOONDR.js";
5
+ export {
6
+ getRuntimeConfig,
7
+ setRuntimeConfig
8
+ };
9
+ //# sourceMappingURL=runtime-config-2XJJIMSC.js.map
@@ -1,34 +1,51 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-O4W4555H.js";
3
+ } from "./chunk-RAZQTQK2.js";
4
+ import "./chunk-VZXXJKSQ.js";
5
+ import "./chunk-YB2574C6.js";
6
+ import "./chunk-QDEKU5RL.js";
7
+ import "./chunk-QYP5HQV4.js";
8
+ import "./chunk-BU2ZYOEA.js";
9
+ import "./chunk-2KSCZSXQ.js";
10
+ import "./chunk-S4QKTRGJ.js";
11
+ import "./chunk-22CTURMH.js";
12
+ import "./chunk-7IOZFJBW.js";
13
+ import "./chunk-XKFPU2FA.js";
14
+ import "./chunk-3EHGGBWE.js";
15
+ import "./chunk-QY7BMXWT.js";
16
+ import "./chunk-TPT6HP4H.js";
4
17
  import {
5
18
  loadConfig
6
- } from "./chunk-FUUYYDVG.js";
7
- import "./chunk-MTX5Y3V3.js";
8
- import "./chunk-N2XYX4ZA.js";
9
- import "./chunk-4Z2OZ6NX.js";
10
- import "./chunk-QY7BMXWT.js";
11
- import "./chunk-ARFK3RZW.js";
12
- import "./chunk-L4XDA3V7.js";
19
+ } from "./chunk-TVQOONDR.js";
13
20
  import {
14
21
  getActiveProvider,
15
22
  getDefaultModel,
16
23
  loadGlobalConfig
17
- } from "./chunk-GZ7ZVJIW.js";
18
- import "./chunk-5ZUU23XF.js";
19
- import "./chunk-26NRL3HX.js";
20
- import {
21
- logger
22
- } from "./chunk-U62ZECSQ.js";
24
+ } from "./chunk-3UQACISJ.js";
25
+ import "./chunk-U6BUT37A.js";
26
+ import "./chunk-XFXOSPYH.js";
23
27
  import {
24
28
  ensureDataDirExists,
25
29
  getDatabasePath,
26
30
  getGlobalConfigPath
27
- } from "./chunk-AF7XS4OI.js";
31
+ } from "./chunk-5YQAXUKO.js";
32
+ import "./chunk-M2C5GEQR.js";
33
+ import {
34
+ logger
35
+ } from "./chunk-PNBH3RAX.js";
28
36
 
29
37
  // src/server/utils/network.ts
30
38
  import os from "os";
31
- import { statSync } from "fs";
39
+ import { statSync, readFileSync } from "fs";
40
+ import { fileURLToPath } from "url";
41
+ import { dirname, join } from "path";
42
+ function getVersion() {
43
+ const __filename = fileURLToPath(import.meta.url);
44
+ const __dirname = dirname(__filename);
45
+ const packageJsonPath = join(__dirname, "../package.json");
46
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
47
+ return packageJson.version;
48
+ }
32
49
  function getNetworkInterfaces() {
33
50
  const interfaces = os.networkInterfaces();
34
51
  const result = [];
@@ -88,7 +105,9 @@ function getDatabaseSize(databasePath) {
88
105
  function displayStartupBanner(config) {
89
106
  const { host, port, databasePath, configPath } = config;
90
107
  const isLocalhost = host === "127.0.0.1";
91
- console.log("\n\u{1F98A} OpenFox v0.1.0\n");
108
+ console.log(`
109
+ \u{1F98A} OpenFox v${getVersion()}
110
+ `);
92
111
  if (isLocalhost) {
93
112
  console.log(` \u{1F310} Server: http://localhost:${port}`);
94
113
  console.log(" \u{1F512} Access: Localhost only");
@@ -154,6 +173,7 @@ async function runServe(options) {
154
173
  providers: globalConfig.providers,
155
174
  activeProviderId: globalConfig.activeProviderId,
156
175
  activeWorkflowId: globalConfig.activeWorkflowId,
176
+ defaultModelSelection: globalConfig.defaultModelSelection,
157
177
  // Workdir precedence: .env override → global config → process.cwd()
158
178
  // Normalize: remove trailing slash to prevent double slashes in paths
159
179
  workdir: (process.env["OPENFOX_WORKDIR"] ?? globalConfig.workspace?.workdir ?? process.cwd()).replace(/\/$/, "")
@@ -174,4 +194,4 @@ async function runServe(options) {
174
194
  export {
175
195
  runServe
176
196
  };
177
- //# sourceMappingURL=serve-RYEBLJVN.js.map
197
+ //# sourceMappingURL=serve-UK6B6G2O.js.map