@virtengine/openfleet 0.25.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 (120) hide show
  1. package/.env.example +914 -0
  2. package/LICENSE +190 -0
  3. package/README.md +500 -0
  4. package/agent-endpoint.mjs +918 -0
  5. package/agent-hook-bridge.mjs +230 -0
  6. package/agent-hooks.mjs +1188 -0
  7. package/agent-pool.mjs +2403 -0
  8. package/agent-prompts.mjs +689 -0
  9. package/agent-sdk.mjs +141 -0
  10. package/anomaly-detector.mjs +1195 -0
  11. package/autofix.mjs +1294 -0
  12. package/claude-shell.mjs +708 -0
  13. package/cli.mjs +906 -0
  14. package/codex-config.mjs +1274 -0
  15. package/codex-model-profiles.mjs +135 -0
  16. package/codex-shell.mjs +762 -0
  17. package/config-doctor.mjs +613 -0
  18. package/config.mjs +1720 -0
  19. package/conflict-resolver.mjs +248 -0
  20. package/container-runner.mjs +450 -0
  21. package/copilot-shell.mjs +827 -0
  22. package/daemon-restart-policy.mjs +56 -0
  23. package/diff-stats.mjs +282 -0
  24. package/error-detector.mjs +829 -0
  25. package/fetch-runtime.mjs +34 -0
  26. package/fleet-coordinator.mjs +838 -0
  27. package/get-telegram-chat-id.mjs +71 -0
  28. package/git-safety.mjs +170 -0
  29. package/github-reconciler.mjs +403 -0
  30. package/hook-profiles.mjs +651 -0
  31. package/kanban-adapter.mjs +4491 -0
  32. package/lib/logger.mjs +645 -0
  33. package/maintenance.mjs +828 -0
  34. package/merge-strategy.mjs +1171 -0
  35. package/monitor.mjs +12207 -0
  36. package/openfleet.config.example.json +115 -0
  37. package/openfleet.schema.json +465 -0
  38. package/package.json +203 -0
  39. package/postinstall.mjs +187 -0
  40. package/pr-cleanup-daemon.mjs +978 -0
  41. package/preflight.mjs +408 -0
  42. package/prepublish-check.mjs +90 -0
  43. package/presence.mjs +328 -0
  44. package/primary-agent.mjs +282 -0
  45. package/publish.mjs +151 -0
  46. package/repo-root.mjs +29 -0
  47. package/restart-controller.mjs +100 -0
  48. package/review-agent.mjs +557 -0
  49. package/rotate-agent-logs.sh +133 -0
  50. package/sdk-conflict-resolver.mjs +973 -0
  51. package/session-tracker.mjs +880 -0
  52. package/setup.mjs +3937 -0
  53. package/shared-knowledge.mjs +410 -0
  54. package/shared-state-manager.mjs +841 -0
  55. package/shared-workspace-cli.mjs +199 -0
  56. package/shared-workspace-registry.mjs +537 -0
  57. package/shared-workspaces.json +18 -0
  58. package/startup-service.mjs +1070 -0
  59. package/sync-engine.mjs +1063 -0
  60. package/task-archiver.mjs +801 -0
  61. package/task-assessment.mjs +550 -0
  62. package/task-claims.mjs +924 -0
  63. package/task-complexity.mjs +581 -0
  64. package/task-executor.mjs +5111 -0
  65. package/task-store.mjs +753 -0
  66. package/telegram-bot.mjs +9281 -0
  67. package/telegram-sentinel.mjs +2010 -0
  68. package/ui/app.js +867 -0
  69. package/ui/app.legacy.js +1464 -0
  70. package/ui/app.monolith.js +2488 -0
  71. package/ui/components/charts.js +226 -0
  72. package/ui/components/chat-view.js +567 -0
  73. package/ui/components/command-palette.js +587 -0
  74. package/ui/components/diff-viewer.js +190 -0
  75. package/ui/components/forms.js +327 -0
  76. package/ui/components/kanban-board.js +451 -0
  77. package/ui/components/session-list.js +305 -0
  78. package/ui/components/shared.js +473 -0
  79. package/ui/index.html +70 -0
  80. package/ui/modules/api.js +297 -0
  81. package/ui/modules/icons.js +461 -0
  82. package/ui/modules/router.js +81 -0
  83. package/ui/modules/settings-schema.js +261 -0
  84. package/ui/modules/state.js +679 -0
  85. package/ui/modules/telegram.js +331 -0
  86. package/ui/modules/utils.js +270 -0
  87. package/ui/styles/animations.css +140 -0
  88. package/ui/styles/base.css +98 -0
  89. package/ui/styles/components.css +1915 -0
  90. package/ui/styles/kanban.css +286 -0
  91. package/ui/styles/layout.css +809 -0
  92. package/ui/styles/sessions.css +827 -0
  93. package/ui/styles/variables.css +188 -0
  94. package/ui/styles.css +141 -0
  95. package/ui/styles.monolith.css +1046 -0
  96. package/ui/tabs/agents.js +1417 -0
  97. package/ui/tabs/chat.js +74 -0
  98. package/ui/tabs/control.js +887 -0
  99. package/ui/tabs/dashboard.js +515 -0
  100. package/ui/tabs/infra.js +537 -0
  101. package/ui/tabs/logs.js +783 -0
  102. package/ui/tabs/settings.js +1487 -0
  103. package/ui/tabs/tasks.js +1385 -0
  104. package/ui-server.mjs +4073 -0
  105. package/update-check.mjs +465 -0
  106. package/utils.mjs +172 -0
  107. package/ve-kanban.mjs +654 -0
  108. package/ve-kanban.ps1 +1365 -0
  109. package/ve-kanban.sh +18 -0
  110. package/ve-orchestrator.mjs +340 -0
  111. package/ve-orchestrator.ps1 +6546 -0
  112. package/ve-orchestrator.sh +18 -0
  113. package/vibe-kanban-wrapper.mjs +41 -0
  114. package/vk-error-resolver.mjs +470 -0
  115. package/vk-log-stream.mjs +914 -0
  116. package/whatsapp-channel.mjs +520 -0
  117. package/workspace-monitor.mjs +581 -0
  118. package/workspace-reaper.mjs +405 -0
  119. package/workspace-registry.mjs +238 -0
  120. package/worktree-manager.mjs +1266 -0
@@ -0,0 +1,135 @@
1
+ const DEFAULT_ACTIVE_PROFILE = "xl";
2
+ const DEFAULT_SUBAGENT_PROFILE = "m";
3
+
4
+ function clean(value) {
5
+ return String(value ?? "").trim();
6
+ }
7
+
8
+ function normalizeProfileName(value, fallback = DEFAULT_ACTIVE_PROFILE) {
9
+ const raw = clean(value).toLowerCase();
10
+ if (!raw) return fallback;
11
+ return raw.replace(/[^a-z0-9_-]/g, "") || fallback;
12
+ }
13
+
14
+ function profilePrefix(name) {
15
+ return `CODEX_MODEL_PROFILE_${name.toUpperCase()}_`;
16
+ }
17
+
18
+ function inferGlobalProvider(env) {
19
+ const baseUrl = clean(env.OPENAI_BASE_URL).toLowerCase();
20
+ if (baseUrl.includes(".openai.azure.com")) return "azure";
21
+ return "openai";
22
+ }
23
+
24
+ function normalizeProvider(value, fallback) {
25
+ const raw = clean(value).toLowerCase();
26
+ if (!raw) return fallback;
27
+ if (["azure", "azure-openai", "azure_openai"].includes(raw)) {
28
+ return "azure";
29
+ }
30
+ if (["openai", "default"].includes(raw)) {
31
+ return "openai";
32
+ }
33
+ if (["compatible", "openai-compatible", "openai_compatible"].includes(raw)) {
34
+ return "compatible";
35
+ }
36
+ return fallback;
37
+ }
38
+
39
+ function readProfileField(env, profileName, field) {
40
+ return clean(env[`${profilePrefix(profileName)}${field}`]);
41
+ }
42
+
43
+ function profileRecord(env, profileName, globalProvider) {
44
+ const provider = normalizeProvider(
45
+ readProfileField(env, profileName, "PROVIDER"),
46
+ globalProvider,
47
+ );
48
+ const model =
49
+ readProfileField(env, profileName, "MODEL") ||
50
+ (profileName === "xl" ? "gpt-5.3-codex" : profileName === "m" ? "gpt-5.1-codex-mini" : "");
51
+ const baseUrl = readProfileField(env, profileName, "BASE_URL");
52
+ const apiKey = readProfileField(env, profileName, "API_KEY");
53
+ const apiKeyEnv = readProfileField(env, profileName, "API_KEY_ENV");
54
+ const subagentModel = readProfileField(env, profileName, "SUBAGENT_MODEL");
55
+ return {
56
+ name: profileName,
57
+ provider,
58
+ model,
59
+ baseUrl,
60
+ apiKey,
61
+ apiKeyEnv,
62
+ subagentModel,
63
+ };
64
+ }
65
+
66
+ /**
67
+ * Resolve codex model/provider profile configuration from env vars.
68
+ * Applies active profile values onto runtime env keys (`CODEX_MODEL`,
69
+ * `OPENAI_BASE_URL`, `OPENAI_API_KEY`, `AZURE_OPENAI_API_KEY`) while keeping
70
+ * sensible fallbacks to global env vars.
71
+ */
72
+ export function resolveCodexProfileRuntime(envInput = process.env) {
73
+ const sourceEnv = { ...envInput };
74
+ const activeProfile = normalizeProfileName(
75
+ sourceEnv.CODEX_MODEL_PROFILE,
76
+ DEFAULT_ACTIVE_PROFILE,
77
+ );
78
+ const subagentProfile = normalizeProfileName(
79
+ sourceEnv.CODEX_MODEL_PROFILE_SUBAGENT || sourceEnv.CODEX_SUBAGENT_PROFILE,
80
+ DEFAULT_SUBAGENT_PROFILE,
81
+ );
82
+
83
+ const globalProvider = inferGlobalProvider(sourceEnv);
84
+ const active = profileRecord(sourceEnv, activeProfile, globalProvider);
85
+ const sub = profileRecord(sourceEnv, subagentProfile, globalProvider);
86
+
87
+ const env = { ...sourceEnv };
88
+
89
+ if (active.model) {
90
+ env.CODEX_MODEL = active.model;
91
+ }
92
+ if (active.baseUrl) {
93
+ env.OPENAI_BASE_URL = active.baseUrl;
94
+ }
95
+
96
+ const profileApiKey = active.apiKey;
97
+ const resolvedProvider = active.provider || globalProvider;
98
+
99
+ if (profileApiKey) {
100
+ if (resolvedProvider === "azure") {
101
+ env.AZURE_OPENAI_API_KEY = profileApiKey;
102
+ if (!env.OPENAI_API_KEY) {
103
+ env.OPENAI_API_KEY = profileApiKey;
104
+ }
105
+ } else {
106
+ env.OPENAI_API_KEY = profileApiKey;
107
+ if (!env.AZURE_OPENAI_API_KEY && resolvedProvider === "compatible") {
108
+ env.AZURE_OPENAI_API_KEY = "";
109
+ }
110
+ }
111
+ }
112
+
113
+ if (resolvedProvider === "azure") {
114
+ if (!clean(env.AZURE_OPENAI_API_KEY) && clean(env.OPENAI_API_KEY)) {
115
+ env.AZURE_OPENAI_API_KEY = env.OPENAI_API_KEY;
116
+ }
117
+ }
118
+
119
+ if (!clean(env.CODEX_SUBAGENT_MODEL)) {
120
+ env.CODEX_SUBAGENT_MODEL =
121
+ sub.subagentModel || sub.model || active.subagentModel || "gpt-5.1-codex-mini";
122
+ }
123
+
124
+ env.CODEX_MODEL_PROFILE = activeProfile;
125
+ env.CODEX_MODEL_PROFILE_SUBAGENT = subagentProfile;
126
+
127
+ return {
128
+ env,
129
+ activeProfile,
130
+ subagentProfile,
131
+ active,
132
+ subagent: sub,
133
+ provider: resolvedProvider,
134
+ };
135
+ }