openfox 2.0.62 → 2.0.64

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 (40) hide show
  1. package/README.md +14 -0
  2. package/dist/{chat-handler-TRAITVLO.js → chat-handler-LI4R4Z2E.js} +11 -11
  3. package/dist/{chunk-L4WACPUX.js → chunk-73N5CJH3.js} +5 -5
  4. package/dist/{chunk-BKTBHEPY.js → chunk-HZNY77HZ.js} +32 -42
  5. package/dist/{chunk-QZRS2RF5.js → chunk-JFQSQO2N.js} +362 -92
  6. package/dist/{chunk-3WL5YCP6.js → chunk-O3G6X5CT.js} +6 -6
  7. package/dist/{chunk-GJU35MDV.js → chunk-OESYKZCM.js} +2 -2
  8. package/dist/{chunk-JKLPWTUN.js → chunk-QBYQ7KDX.js} +9 -4
  9. package/dist/{chunk-NVPVDDQZ.js → chunk-QJ5FH5DP.js} +14 -10
  10. package/dist/{chunk-H774GQJW.js → chunk-RYIREJAW.js} +234 -40
  11. package/dist/{chunk-WEB4WBUF.js → chunk-WD75RSGR.js} +149 -117
  12. package/dist/{chunk-43UFGATL.js → chunk-WGAAQASA.js} +31 -9
  13. package/dist/{chunk-6VDCH5ML.js → chunk-X5YCWKNS.js} +4 -4
  14. package/dist/cli/dev.js +1 -1
  15. package/dist/cli/index.js +1 -1
  16. package/dist/{client-KRFGMNGN.js → client-LAKW7TA5.js} +3 -3
  17. package/dist/{compactor-Q33AJPCQ.js → compactor-I3N56PSJ.js} +4 -4
  18. package/dist/{config-GMQUPNBY.js → config-EUMVEFHU.js} +2 -2
  19. package/dist/{orchestrator-TQ23BAFQ.js → orchestrator-PFN7C5JI.js} +14 -14
  20. package/dist/package.json +5 -1
  21. package/dist/{processor-3ZOFGZP5.js → processor-AYYXP5NS.js} +13 -12
  22. package/dist/protocol-Cq66hdDX.d.ts +375 -0
  23. package/dist/provider/index.d.ts +129 -0
  24. package/dist/provider/index.js +1 -0
  25. package/dist/{provider-LBYBC5AG.js → provider-GYOW4OWQ.js} +7 -9
  26. package/dist/{provider-manager-ABEUYU3K.js → provider-manager-HRHNF73A.js} +4 -5
  27. package/dist/{serve-CNA5NKOR.js → serve-54KALE6R.js} +15 -16
  28. package/dist/server/index.d.ts +6 -87
  29. package/dist/server/index.js +12 -13
  30. package/dist/{server-CI5IEBOC.js → server-Z2A5YZM6.js} +10 -14
  31. package/dist/shared/index.d.ts +3 -2
  32. package/dist/{tools-33FQNFKC.js → tools-R6LPK6OS.js} +7 -7
  33. package/dist/types-CDZakn7f.d.ts +89 -0
  34. package/dist/{protocol-J7khRG62.d.ts → types-akHmgvBk.d.ts} +17 -373
  35. package/dist/web/assets/{index-CETZPQXr.js → index-CkE65FP4.js} +74 -73
  36. package/dist/web/assets/{index-BGkyTfuQ.css → index-DvPmgi8F.css} +1 -1
  37. package/dist/web/index.html +2 -2
  38. package/dist/web/sw.js +1 -1
  39. package/package.json +5 -1
  40. package/dist/chunk-M3RB4IF6.js +0 -114
package/README.md CHANGED
@@ -81,6 +81,20 @@ openfox provider remove # Remove provider
81
81
  - **LSP Integration**: Immediate feedback on code validity
82
82
  - **Real-Time Metrics**: Prefill time, generation speed, context usage
83
83
 
84
+ ## Plugins
85
+
86
+ OpenFox supports provider plugins loaded from the `plugins` directory inside its configuration folder. Plugins can add authentication methods, transports, provider presets, and model discovery without adding provider-specific code to the OpenFox core.
87
+
88
+ Default plugin directories:
89
+
90
+ - macOS: `~/Library/Application Support/openfox/plugins`
91
+ - Linux: `${XDG_CONFIG_HOME:-~/.config}/openfox/plugins`
92
+ - Windows: `%APPDATA%\openfox\plugins`
93
+
94
+ Restart OpenFox after installing or updating a plugin.
95
+
96
+ To authenticate with a ChatGPT Plus or Pro account, you can install the [`openfox-chatgpt`](https://github.com/arthurlacoste/openfox-chatgpt) plugin.
97
+
84
98
  ## Screenshots
85
99
 
86
100
  _Homepage — Project overview and session history_
@@ -2,15 +2,20 @@ import {
2
2
  buildRunChatTurnParams,
3
3
  finalizeTurnCompletion,
4
4
  generateSessionNameForSession
5
- } from "./chunk-NVPVDDQZ.js";
5
+ } from "./chunk-QJ5FH5DP.js";
6
6
  import {
7
7
  runChatTurn
8
- } from "./chunk-L4WACPUX.js";
9
- import "./chunk-WEB4WBUF.js";
8
+ } from "./chunk-73N5CJH3.js";
9
+ import "./chunk-WD75RSGR.js";
10
+ import "./chunk-X5YCWKNS.js";
10
11
  import "./chunk-LBGHZLLH.js";
11
12
  import "./chunk-BGTEIA2S.js";
12
13
  import "./chunk-PK2RMVMB.js";
13
14
  import "./chunk-NWO6GRYE.js";
15
+ import {
16
+ getEventStore
17
+ } from "./chunk-AIJE3RYH.js";
18
+ import "./chunk-TMUBLQFC.js";
14
19
  import {
15
20
  createChatMessageMessage,
16
21
  createPhaseChangedMessage,
@@ -19,20 +24,15 @@ import {
19
24
  import "./chunk-EU3WWTFH.js";
20
25
  import "./chunk-SVSKQYFH.js";
21
26
  import "./chunk-YQ3SOPBI.js";
22
- import "./chunk-6VDCH5ML.js";
23
- import {
24
- getEventStore
25
- } from "./chunk-AIJE3RYH.js";
26
- import "./chunk-TMUBLQFC.js";
27
27
  import "./chunk-ZPIZLTWU.js";
28
28
  import "./chunk-J2GP3J3X.js";
29
+ import "./chunk-V4IE7HJY.js";
29
30
  import "./chunk-YHEQTVFV.js";
30
31
  import "./chunk-Z6W4YHJB.js";
31
32
  import "./chunk-K44MW7JJ.js";
32
33
  import "./chunk-YD6NDTKF.js";
33
- import "./chunk-43UFGATL.js";
34
+ import "./chunk-WGAAQASA.js";
34
35
  import "./chunk-CQGTEGKL.js";
35
- import "./chunk-V4IE7HJY.js";
36
36
  import "./chunk-5WRI5ZAA.js";
37
37
 
38
38
  // src/server/session/chat-handler.ts
@@ -154,4 +154,4 @@ export {
154
154
  startChatSession,
155
155
  stopSessionExecution
156
156
  };
157
- //# sourceMappingURL=chat-handler-TRAITVLO.js.map
157
+ //# sourceMappingURL=chat-handler-LI4R4Z2E.js.map
@@ -10,7 +10,7 @@ import {
10
10
  loadAllAgentsDefault,
11
11
  processEventsForConversation,
12
12
  runTopLevelAgentLoop
13
- } from "./chunk-WEB4WBUF.js";
13
+ } from "./chunk-WD75RSGR.js";
14
14
  import {
15
15
  TurnMetrics,
16
16
  WORKFLOW_KICKOFF_PROMPT,
@@ -19,7 +19,7 @@ import {
19
19
  buildTopLevelSystemPrompt,
20
20
  createChatDoneEvent,
21
21
  createMessageStartEvent
22
- } from "./chunk-6VDCH5ML.js";
22
+ } from "./chunk-X5YCWKNS.js";
23
23
  import {
24
24
  getCurrentContextWindowId,
25
25
  getCurrentWindowMessageOptions,
@@ -65,7 +65,7 @@ function resolveAgentDef(sessionManager, sessionId) {
65
65
  }
66
66
  async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
67
67
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
68
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-33FQNFKC.js");
68
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-R6LPK6OS.js");
69
69
  const tools = getToolRegistryForAgent2(agentDef).definitions;
70
70
  const toolFingerprint = getToolFingerprint(tools);
71
71
  const allAgents = await loadAllAgentsDefault();
@@ -78,7 +78,7 @@ async function buildCachedPrompt(sessionManager, sessionId, agentDef) {
78
78
  async function computeSessionHash(sessionManager, sessionId) {
79
79
  const { instructionContent, skills } = await loadSessionContext(sessionManager, sessionId);
80
80
  const agentDef = await resolveAgentDef(sessionManager, sessionId);
81
- const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-33FQNFKC.js");
81
+ const { getToolRegistryForAgent: getToolRegistryForAgent2 } = await import("./tools-R6LPK6OS.js");
82
82
  const tools = getToolRegistryForAgent2(agentDef).definitions;
83
83
  const toolFingerprint = getToolFingerprint(tools);
84
84
  return computeDynamicContextHash(instructionContent, skills, toolFingerprint);
@@ -383,4 +383,4 @@ export {
383
383
  runAgentTurn,
384
384
  injectWorkflowKickoffIfNeeded
385
385
  };
386
- //# sourceMappingURL=chunk-L4WACPUX.js.map
386
+ //# sourceMappingURL=chunk-73N5CJH3.js.map
@@ -1,10 +1,13 @@
1
+ import {
2
+ appendCompactionPrompt
3
+ } from "./chunk-OESYKZCM.js";
1
4
  import {
2
5
  applyDynamicContext,
3
6
  computeSessionHash,
4
7
  injectWorkflowKickoffIfNeeded,
5
8
  runAgentTurn,
6
9
  runChatTurn
7
- } from "./chunk-L4WACPUX.js";
10
+ } from "./chunk-73N5CJH3.js";
8
11
  import {
9
12
  checkAborted,
10
13
  deleteItemFromDir,
@@ -16,11 +19,20 @@ import {
16
19
  loadAllAgentsDefault,
17
20
  saveItemToDir,
18
21
  spawnShellProcess
19
- } from "./chunk-WEB4WBUF.js";
22
+ } from "./chunk-WD75RSGR.js";
23
+ import {
24
+ TurnMetrics,
25
+ createMessageStartEvent
26
+ } from "./chunk-X5YCWKNS.js";
20
27
  import {
21
28
  getPlatformShell,
22
29
  onProcessEvent
23
30
  } from "./chunk-BGTEIA2S.js";
31
+ import {
32
+ getCurrentContextWindowId,
33
+ getEventStore,
34
+ getRuntimeConfig
35
+ } from "./chunk-AIJE3RYH.js";
24
36
  import {
25
37
  createChatErrorMessage,
26
38
  createChatMessageMessage,
@@ -38,24 +50,6 @@ import {
38
50
  import {
39
51
  provideAnswer
40
52
  } from "./chunk-EU3WWTFH.js";
41
- import {
42
- appendCompactionPrompt
43
- } from "./chunk-GJU35MDV.js";
44
- import {
45
- TurnMetrics,
46
- createMessageStartEvent
47
- } from "./chunk-6VDCH5ML.js";
48
- import {
49
- getCurrentContextWindowId,
50
- getEventStore,
51
- getRuntimeConfig
52
- } from "./chunk-AIJE3RYH.js";
53
- import {
54
- createLLMClient
55
- } from "./chunk-JKLPWTUN.js";
56
- import {
57
- ensureVersionPrefix
58
- } from "./chunk-HNCM3D7Y.js";
59
53
  import {
60
54
  logger
61
55
  } from "./chunk-K44MW7JJ.js";
@@ -1385,7 +1379,7 @@ function processQueueAndRestartTurn(sessionManager, sessionId, drainFn, queueMod
1385
1379
  var activeAgents = /* @__PURE__ */ new Map();
1386
1380
  var abortedSessions = /* @__PURE__ */ new Set();
1387
1381
  var MAX_SEND_QUEUE_SIZE = 1e3;
1388
- function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvider, sessionManager, providerManager) {
1382
+ function createWebSocketServer(httpServer, _config, getLLMClient, getActiveProvider, sessionManager, providerManager) {
1389
1383
  const wss = new WebSocketServer({ server: httpServer });
1390
1384
  const clients = /* @__PURE__ */ new Map();
1391
1385
  moduleClients = clients;
@@ -1395,7 +1389,9 @@ function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvid
1395
1389
  if (!session?.providerId || !session?.providerModel || !providerManager) {
1396
1390
  return getLLMClient();
1397
1391
  }
1398
- const cacheKey = `${session.providerId}:${session.providerModel}`;
1392
+ const resolvedModel = providerManager.resolveModel(session.providerId, session.providerModel);
1393
+ const effectiveModel = resolvedModel ?? session.providerModel;
1394
+ const cacheKey = `${session.providerId}:${effectiveModel}`;
1399
1395
  const cached = sessionLLMClients.get(sessionId);
1400
1396
  if (cached && cached.key === cacheKey) {
1401
1397
  return cached.client;
@@ -1410,26 +1406,20 @@ function createWebSocketServer(httpServer, config, getLLMClient, getActiveProvid
1410
1406
  sessionLLMClients.delete(sessionId);
1411
1407
  return getLLMClient();
1412
1408
  }
1413
- const modelConfig = provider.models.find((m) => m.id === session.providerModel);
1414
- const reasoningEffort = modelConfig?.thinkingEnabled && modelConfig?.thinkingLevel ? modelConfig.thinkingLevel : void 0;
1415
- const baseUrl = ensureVersionPrefix(provider.url);
1416
- const sessionConfig = {
1417
- ...config,
1418
- llm: {
1419
- ...config.llm,
1420
- baseUrl,
1421
- model: session.providerModel,
1422
- ...provider.apiKey && { apiKey: provider.apiKey },
1423
- ...provider.thinkingField && { thinkingField: provider.thinkingField },
1424
- ...reasoningEffort && { reasoningEffort }
1425
- }
1426
- };
1427
- const client = createLLMClient(sessionConfig);
1428
- if (provider.backend !== "unknown") {
1429
- client.setBackend(provider.backend);
1409
+ const client = providerManager.createClient(session.providerId, effectiveModel);
1410
+ if (!client) {
1411
+ logger.warn("Could not create session provider client, falling back to global", {
1412
+ sessionId,
1413
+ providerId: session.providerId,
1414
+ model: session.providerModel
1415
+ });
1416
+ return getLLMClient();
1417
+ }
1418
+ const concreteModel = client.getModel();
1419
+ if (session.providerModel !== concreteModel) {
1420
+ sessionManager.setSessionProvider(sessionId, session.providerId, concreteModel);
1430
1421
  }
1431
- client.setModel(session.providerModel);
1432
- sessionLLMClients.set(sessionId, { key: cacheKey, client });
1422
+ sessionLLMClients.set(sessionId, { key: `${session.providerId}:${concreteModel}`, client });
1433
1423
  return client;
1434
1424
  }
1435
1425
  function getSessionStatsIdentity(sessionId) {
@@ -2102,4 +2092,4 @@ export {
2102
2092
  signalMcpReady,
2103
2093
  createWebSocketServer
2104
2094
  };
2105
- //# sourceMappingURL=chunk-BKTBHEPY.js.map
2095
+ //# sourceMappingURL=chunk-HZNY77HZ.js.map