@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,199 @@
1
+ import {
2
+ claimSharedWorkspace,
3
+ formatSharedWorkspaceDetail,
4
+ formatSharedWorkspaceSummary,
5
+ loadSharedWorkspaceRegistry,
6
+ releaseSharedWorkspace,
7
+ resolveSharedWorkspace,
8
+ sweepExpiredLeases,
9
+ } from "./shared-workspace-registry.mjs";
10
+
11
+ const args = process.argv.slice(2);
12
+ const command = (args[0] || "").toLowerCase();
13
+ const actor = process.env.USER || process.env.USERNAME || "cli";
14
+
15
+ function parseCommonFlags(tokens) {
16
+ const parsed = {
17
+ workspaceId: null,
18
+ owner: null,
19
+ ttlMinutes: null,
20
+ note: "",
21
+ reason: "",
22
+ force: false,
23
+ registryPath: null,
24
+ auditPath: null,
25
+ };
26
+ for (let i = 0; i < tokens.length; i++) {
27
+ const token = tokens[i];
28
+ if (token === "--owner") {
29
+ parsed.owner = tokens[i + 1];
30
+ i++;
31
+ continue;
32
+ }
33
+ if (token === "--ttl") {
34
+ parsed.ttlMinutes = Number(tokens[i + 1]);
35
+ i++;
36
+ continue;
37
+ }
38
+ if (token === "--note") {
39
+ parsed.note = tokens.slice(i + 1).join(" ");
40
+ break;
41
+ }
42
+ if (token === "--reason") {
43
+ parsed.reason = tokens.slice(i + 1).join(" ");
44
+ break;
45
+ }
46
+ if (token === "--force") {
47
+ parsed.force = true;
48
+ continue;
49
+ }
50
+ if (token === "--registry") {
51
+ parsed.registryPath = tokens[i + 1];
52
+ i++;
53
+ continue;
54
+ }
55
+ if (token === "--audit") {
56
+ parsed.auditPath = tokens[i + 1];
57
+ i++;
58
+ continue;
59
+ }
60
+ if (!parsed.workspaceId) {
61
+ parsed.workspaceId = token;
62
+ }
63
+ }
64
+ return parsed;
65
+ }
66
+
67
+ function printHelp() {
68
+ console.log(
69
+ [
70
+ "Shared cloud workspaces registry",
71
+ "",
72
+ "Usage:",
73
+ " node shared-workspace-cli.mjs list",
74
+ " node shared-workspace-cli.mjs show <workspace-id>",
75
+ " node shared-workspace-cli.mjs claim <workspace-id> [--owner <id>] [--ttl <minutes>] [--note <text>]",
76
+ " node shared-workspace-cli.mjs release <workspace-id> [--owner <id>] [--reason <text>] [--force]",
77
+ "",
78
+ "Flags:",
79
+ " --registry <path> Override registry path",
80
+ " --audit <path> Override audit log path",
81
+ " --ttl <minutes> Lease TTL override",
82
+ " --owner <id> Lease owner",
83
+ " --note <text> Lease note (claim)",
84
+ " --reason <text> Release reason",
85
+ " --force Force claim/release",
86
+ ].join("\n"),
87
+ );
88
+ }
89
+
90
+ async function handleList(tokens) {
91
+ const parsed = parseCommonFlags(tokens);
92
+ const registry = await loadSharedWorkspaceRegistry({
93
+ registryPath: parsed.registryPath,
94
+ auditPath: parsed.auditPath,
95
+ });
96
+ const sweep = await sweepExpiredLeases({
97
+ registry,
98
+ actor,
99
+ auditPath: parsed.auditPath,
100
+ registryPath: parsed.registryPath,
101
+ });
102
+ console.log(formatSharedWorkspaceSummary(sweep.registry));
103
+ }
104
+
105
+ async function handleShow(tokens) {
106
+ const parsed = parseCommonFlags(tokens);
107
+ if (!parsed.workspaceId) {
108
+ console.error("Missing workspace id.");
109
+ return;
110
+ }
111
+ const registry = await loadSharedWorkspaceRegistry({
112
+ registryPath: parsed.registryPath,
113
+ auditPath: parsed.auditPath,
114
+ });
115
+ await sweepExpiredLeases({
116
+ registry,
117
+ actor,
118
+ auditPath: parsed.auditPath,
119
+ registryPath: parsed.registryPath,
120
+ });
121
+ const workspace = resolveSharedWorkspace(registry, parsed.workspaceId);
122
+ console.log(formatSharedWorkspaceDetail(workspace));
123
+ }
124
+
125
+ async function handleClaim(tokens) {
126
+ const parsed = parseCommonFlags(tokens);
127
+ if (!parsed.workspaceId) {
128
+ console.error("Missing workspace id.");
129
+ return;
130
+ }
131
+ const result = await claimSharedWorkspace({
132
+ workspaceId: parsed.workspaceId,
133
+ owner: parsed.owner,
134
+ ttlMinutes: parsed.ttlMinutes,
135
+ note: parsed.note,
136
+ force: parsed.force,
137
+ registryPath: parsed.registryPath,
138
+ auditPath: parsed.auditPath,
139
+ actor,
140
+ });
141
+ if (result.error) {
142
+ console.error(`Error: ${result.error}`);
143
+ return;
144
+ }
145
+ console.log(
146
+ `Claimed ${result.workspace.id} for ${result.lease.owner} (expires ${result.lease.lease_expires_at})`,
147
+ );
148
+ }
149
+
150
+ async function handleRelease(tokens) {
151
+ const parsed = parseCommonFlags(tokens);
152
+ if (!parsed.workspaceId) {
153
+ console.error("Missing workspace id.");
154
+ return;
155
+ }
156
+ const result = await releaseSharedWorkspace({
157
+ workspaceId: parsed.workspaceId,
158
+ owner: parsed.owner,
159
+ reason: parsed.reason,
160
+ force: parsed.force,
161
+ registryPath: parsed.registryPath,
162
+ auditPath: parsed.auditPath,
163
+ actor,
164
+ });
165
+ if (result.error) {
166
+ console.error(`Error: ${result.error}`);
167
+ return;
168
+ }
169
+ console.log(`Released ${result.workspace.id}`);
170
+ }
171
+
172
+ async function main() {
173
+ switch (command) {
174
+ case "list":
175
+ await handleList(args.slice(1));
176
+ break;
177
+ case "show":
178
+ await handleShow(args.slice(1));
179
+ break;
180
+ case "claim":
181
+ await handleClaim(args.slice(1));
182
+ break;
183
+ case "release":
184
+ await handleRelease(args.slice(1));
185
+ break;
186
+ case "help":
187
+ case "-h":
188
+ case "--help":
189
+ case "":
190
+ printHelp();
191
+ break;
192
+ default:
193
+ console.error(`Unknown command: ${command}`);
194
+ printHelp();
195
+ process.exitCode = 1;
196
+ }
197
+ }
198
+
199
+ await main();