@tt-a1i/hive 0.6.0-alpha.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.
- package/CHANGELOG.md +12 -0
- package/LICENSE +202 -0
- package/README.md +175 -0
- package/SECURITY.md +48 -0
- package/dist/bin/team +7 -0
- package/dist/bin/team.cmd +2 -0
- package/dist/src/cli/hive.d.ts +9 -0
- package/dist/src/cli/hive.js +104 -0
- package/dist/src/cli/hive.js.map +1 -0
- package/dist/src/cli/team.d.ts +1 -0
- package/dist/src/cli/team.js +137 -0
- package/dist/src/cli/team.js.map +1 -0
- package/dist/src/server/agent-command-resolver.d.ts +8 -0
- package/dist/src/server/agent-command-resolver.js +72 -0
- package/dist/src/server/agent-command-resolver.js.map +1 -0
- package/dist/src/server/agent-launch-cache.d.ts +20 -0
- package/dist/src/server/agent-launch-cache.js +55 -0
- package/dist/src/server/agent-launch-cache.js.map +1 -0
- package/dist/src/server/agent-manager-support.d.ts +7 -0
- package/dist/src/server/agent-manager-support.js +68 -0
- package/dist/src/server/agent-manager-support.js.map +1 -0
- package/dist/src/server/agent-manager.d.ts +51 -0
- package/dist/src/server/agent-manager.js +92 -0
- package/dist/src/server/agent-manager.js.map +1 -0
- package/dist/src/server/agent-run-bootstrap.d.ts +62 -0
- package/dist/src/server/agent-run-bootstrap.js +64 -0
- package/dist/src/server/agent-run-bootstrap.js.map +1 -0
- package/dist/src/server/agent-run-exit-handler.d.ts +8 -0
- package/dist/src/server/agent-run-exit-handler.js +27 -0
- package/dist/src/server/agent-run-exit-handler.js.map +1 -0
- package/dist/src/server/agent-run-start-context.d.ts +24 -0
- package/dist/src/server/agent-run-start-context.js +2 -0
- package/dist/src/server/agent-run-start-context.js.map +1 -0
- package/dist/src/server/agent-run-starter.d.ts +23 -0
- package/dist/src/server/agent-run-starter.js +117 -0
- package/dist/src/server/agent-run-starter.js.map +1 -0
- package/dist/src/server/agent-run-store.d.ts +47 -0
- package/dist/src/server/agent-run-store.js +131 -0
- package/dist/src/server/agent-run-store.js.map +1 -0
- package/dist/src/server/agent-run-sync.d.ts +10 -0
- package/dist/src/server/agent-run-sync.js +25 -0
- package/dist/src/server/agent-run-sync.js.map +1 -0
- package/dist/src/server/agent-runtime-active-run.d.ts +3 -0
- package/dist/src/server/agent-runtime-active-run.js +11 -0
- package/dist/src/server/agent-runtime-active-run.js.map +1 -0
- package/dist/src/server/agent-runtime-close.d.ts +4 -0
- package/dist/src/server/agent-runtime-close.js +15 -0
- package/dist/src/server/agent-runtime-close.js.map +1 -0
- package/dist/src/server/agent-runtime-contract.d.ts +31 -0
- package/dist/src/server/agent-runtime-contract.js +2 -0
- package/dist/src/server/agent-runtime-contract.js.map +1 -0
- package/dist/src/server/agent-runtime-flow-adapter.d.ts +10 -0
- package/dist/src/server/agent-runtime-flow-adapter.js +15 -0
- package/dist/src/server/agent-runtime-flow-adapter.js.map +1 -0
- package/dist/src/server/agent-runtime-list-runs.d.ts +3 -0
- package/dist/src/server/agent-runtime-list-runs.js +19 -0
- package/dist/src/server/agent-runtime-list-runs.js.map +1 -0
- package/dist/src/server/agent-runtime-ports.d.ts +22 -0
- package/dist/src/server/agent-runtime-ports.js +2 -0
- package/dist/src/server/agent-runtime-ports.js.map +1 -0
- package/dist/src/server/agent-runtime-stop-run.d.ts +4 -0
- package/dist/src/server/agent-runtime-stop-run.js +17 -0
- package/dist/src/server/agent-runtime-stop-run.js.map +1 -0
- package/dist/src/server/agent-runtime-types.d.ts +4 -0
- package/dist/src/server/agent-runtime-types.js +2 -0
- package/dist/src/server/agent-runtime-types.js.map +1 -0
- package/dist/src/server/agent-runtime.d.ts +8 -0
- package/dist/src/server/agent-runtime.js +101 -0
- package/dist/src/server/agent-runtime.js.map +1 -0
- package/dist/src/server/agent-session-store.d.ts +7 -0
- package/dist/src/server/agent-session-store.js +52 -0
- package/dist/src/server/agent-session-store.js.map +1 -0
- package/dist/src/server/agent-startup-instructions.d.ts +13 -0
- package/dist/src/server/agent-startup-instructions.js +26 -0
- package/dist/src/server/agent-startup-instructions.js.map +1 -0
- package/dist/src/server/agent-stdin-dispatcher.d.ts +19 -0
- package/dist/src/server/agent-stdin-dispatcher.js +60 -0
- package/dist/src/server/agent-stdin-dispatcher.js.map +1 -0
- package/dist/src/server/agent-tokens.d.ts +15 -0
- package/dist/src/server/agent-tokens.js +26 -0
- package/dist/src/server/agent-tokens.js.map +1 -0
- package/dist/src/server/app-state-store.d.ts +10 -0
- package/dist/src/server/app-state-store.js +15 -0
- package/dist/src/server/app-state-store.js.map +1 -0
- package/dist/src/server/app.d.ts +14 -0
- package/dist/src/server/app.js +118 -0
- package/dist/src/server/app.js.map +1 -0
- package/dist/src/server/claude-command-defaults.d.ts +1 -0
- package/dist/src/server/claude-command-defaults.js +6 -0
- package/dist/src/server/claude-command-defaults.js.map +1 -0
- package/dist/src/server/claude-session-coordinator.d.ts +10 -0
- package/dist/src/server/claude-session-coordinator.js +69 -0
- package/dist/src/server/claude-session-coordinator.js.map +1 -0
- package/dist/src/server/claude-session-support.d.ts +1 -0
- package/dist/src/server/claude-session-support.js +2 -0
- package/dist/src/server/claude-session-support.js.map +1 -0
- package/dist/src/server/command-preset-defaults.d.ts +11 -0
- package/dist/src/server/command-preset-defaults.js +52 -0
- package/dist/src/server/command-preset-defaults.js.map +1 -0
- package/dist/src/server/command-preset-store.d.ts +49 -0
- package/dist/src/server/command-preset-store.js +90 -0
- package/dist/src/server/command-preset-store.js.map +1 -0
- package/dist/src/server/dispatch-ledger-serializer.d.ts +15 -0
- package/dist/src/server/dispatch-ledger-serializer.js +15 -0
- package/dist/src/server/dispatch-ledger-serializer.js.map +1 -0
- package/dist/src/server/dispatch-ledger-store.d.ts +45 -0
- package/dist/src/server/dispatch-ledger-store.js +196 -0
- package/dist/src/server/dispatch-ledger-store.js.map +1 -0
- package/dist/src/server/env-sync-message.d.ts +9 -0
- package/dist/src/server/env-sync-message.js +30 -0
- package/dist/src/server/env-sync-message.js.map +1 -0
- package/dist/src/server/fs-browse.d.ts +25 -0
- package/dist/src/server/fs-browse.js +130 -0
- package/dist/src/server/fs-browse.js.map +1 -0
- package/dist/src/server/fs-pick-folder.d.ts +25 -0
- package/dist/src/server/fs-pick-folder.js +132 -0
- package/dist/src/server/fs-pick-folder.js.map +1 -0
- package/dist/src/server/fs-sandbox.d.ts +13 -0
- package/dist/src/server/fs-sandbox.js +26 -0
- package/dist/src/server/fs-sandbox.js.map +1 -0
- package/dist/src/server/hive-team-guidance.d.ts +2 -0
- package/dist/src/server/hive-team-guidance.js +14 -0
- package/dist/src/server/hive-team-guidance.js.map +1 -0
- package/dist/src/server/http-errors.d.ts +16 -0
- package/dist/src/server/http-errors.js +33 -0
- package/dist/src/server/http-errors.js.map +1 -0
- package/dist/src/server/live-run-registry.d.ts +21 -0
- package/dist/src/server/live-run-registry.js +53 -0
- package/dist/src/server/live-run-registry.js.map +1 -0
- package/dist/src/server/message-log-store.d.ts +48 -0
- package/dist/src/server/message-log-store.js +144 -0
- package/dist/src/server/message-log-store.js.map +1 -0
- package/dist/src/server/orchestrator-autostart.d.ts +30 -0
- package/dist/src/server/orchestrator-autostart.js +103 -0
- package/dist/src/server/orchestrator-autostart.js.map +1 -0
- package/dist/src/server/orchestrator-launch.d.ts +22 -0
- package/dist/src/server/orchestrator-launch.js +75 -0
- package/dist/src/server/orchestrator-launch.js.map +1 -0
- package/dist/src/server/post-start-input-writer.d.ts +6 -0
- package/dist/src/server/post-start-input-writer.js +118 -0
- package/dist/src/server/post-start-input-writer.js.map +1 -0
- package/dist/src/server/preset-launch-support.d.ts +6 -0
- package/dist/src/server/preset-launch-support.js +67 -0
- package/dist/src/server/preset-launch-support.js.map +1 -0
- package/dist/src/server/pty-output-bus.d.ts +8 -0
- package/dist/src/server/pty-output-bus.js +33 -0
- package/dist/src/server/pty-output-bus.js.map +1 -0
- package/dist/src/server/recovery-summary.d.ts +10 -0
- package/dist/src/server/recovery-summary.js +89 -0
- package/dist/src/server/recovery-summary.js.map +1 -0
- package/dist/src/server/restart-policy-support.d.ts +23 -0
- package/dist/src/server/restart-policy-support.js +12 -0
- package/dist/src/server/restart-policy-support.js.map +1 -0
- package/dist/src/server/restart-policy.d.ts +14 -0
- package/dist/src/server/restart-policy.js +42 -0
- package/dist/src/server/restart-policy.js.map +1 -0
- package/dist/src/server/role-template-store.d.ts +44 -0
- package/dist/src/server/role-template-store.js +71 -0
- package/dist/src/server/role-template-store.js.map +1 -0
- package/dist/src/server/role-templates.d.ts +7 -0
- package/dist/src/server/role-templates.js +55 -0
- package/dist/src/server/role-templates.js.map +1 -0
- package/dist/src/server/route-helpers.d.ts +7 -0
- package/dist/src/server/route-helpers.js +48 -0
- package/dist/src/server/route-helpers.js.map +1 -0
- package/dist/src/server/route-types.d.ts +58 -0
- package/dist/src/server/route-types.js +2 -0
- package/dist/src/server/route-types.js.map +1 -0
- package/dist/src/server/routes-dispatches.d.ts +2 -0
- package/dist/src/server/routes-dispatches.js +53 -0
- package/dist/src/server/routes-dispatches.js.map +1 -0
- package/dist/src/server/routes-fs.d.ts +2 -0
- package/dist/src/server/routes-fs.js +25 -0
- package/dist/src/server/routes-fs.js.map +1 -0
- package/dist/src/server/routes-runtime.d.ts +2 -0
- package/dist/src/server/routes-runtime.js +46 -0
- package/dist/src/server/routes-runtime.js.map +1 -0
- package/dist/src/server/routes-settings.d.ts +2 -0
- package/dist/src/server/routes-settings.js +124 -0
- package/dist/src/server/routes-settings.js.map +1 -0
- package/dist/src/server/routes-tasks.d.ts +2 -0
- package/dist/src/server/routes-tasks.js +25 -0
- package/dist/src/server/routes-tasks.js.map +1 -0
- package/dist/src/server/routes-team.d.ts +2 -0
- package/dist/src/server/routes-team.js +50 -0
- package/dist/src/server/routes-team.js.map +1 -0
- package/dist/src/server/routes-ui.d.ts +2 -0
- package/dist/src/server/routes-ui.js +8 -0
- package/dist/src/server/routes-ui.js.map +1 -0
- package/dist/src/server/routes-workspaces.d.ts +2 -0
- package/dist/src/server/routes-workspaces.js +154 -0
- package/dist/src/server/routes-workspaces.js.map +1 -0
- package/dist/src/server/routes.d.ts +6 -0
- package/dist/src/server/routes.js +36 -0
- package/dist/src/server/routes.js.map +1 -0
- package/dist/src/server/runtime-database.d.ts +2 -0
- package/dist/src/server/runtime-database.js +13 -0
- package/dist/src/server/runtime-database.js.map +1 -0
- package/dist/src/server/runtime-message-builders.d.ts +6 -0
- package/dist/src/server/runtime-message-builders.js +52 -0
- package/dist/src/server/runtime-message-builders.js.map +1 -0
- package/dist/src/server/runtime-restart-policy.d.ts +14 -0
- package/dist/src/server/runtime-restart-policy.js +11 -0
- package/dist/src/server/runtime-restart-policy.js.map +1 -0
- package/dist/src/server/runtime-store-helpers.d.ts +71 -0
- package/dist/src/server/runtime-store-helpers.js +174 -0
- package/dist/src/server/runtime-store-helpers.js.map +1 -0
- package/dist/src/server/runtime-store.d.ts +70 -0
- package/dist/src/server/runtime-store.js +82 -0
- package/dist/src/server/runtime-store.js.map +1 -0
- package/dist/src/server/session-capture-claude.d.ts +11 -0
- package/dist/src/server/session-capture-claude.js +78 -0
- package/dist/src/server/session-capture-claude.js.map +1 -0
- package/dist/src/server/session-capture-codex.d.ts +5 -0
- package/dist/src/server/session-capture-codex.js +72 -0
- package/dist/src/server/session-capture-codex.js.map +1 -0
- package/dist/src/server/session-capture-gemini.d.ts +5 -0
- package/dist/src/server/session-capture-gemini.js +80 -0
- package/dist/src/server/session-capture-gemini.js.map +1 -0
- package/dist/src/server/session-capture-opencode.d.ts +4 -0
- package/dist/src/server/session-capture-opencode.js +43 -0
- package/dist/src/server/session-capture-opencode.js.map +1 -0
- package/dist/src/server/session-capture.d.ts +71 -0
- package/dist/src/server/session-capture.js +92 -0
- package/dist/src/server/session-capture.js.map +1 -0
- package/dist/src/server/settings-store.d.ts +19 -0
- package/dist/src/server/settings-store.js +22 -0
- package/dist/src/server/settings-store.js.map +1 -0
- package/dist/src/server/sqlite-schema-v10.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v10.js +14 -0
- package/dist/src/server/sqlite-schema-v10.js.map +1 -0
- package/dist/src/server/sqlite-schema-v11.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v11.js +11 -0
- package/dist/src/server/sqlite-schema-v11.js.map +1 -0
- package/dist/src/server/sqlite-schema-v12.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v12.js +22 -0
- package/dist/src/server/sqlite-schema-v12.js.map +1 -0
- package/dist/src/server/sqlite-schema-v13.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v13.js +5 -0
- package/dist/src/server/sqlite-schema-v13.js.map +1 -0
- package/dist/src/server/sqlite-schema-v14.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v14.js +85 -0
- package/dist/src/server/sqlite-schema-v14.js.map +1 -0
- package/dist/src/server/sqlite-schema-v5.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v5.js +62 -0
- package/dist/src/server/sqlite-schema-v5.js.map +1 -0
- package/dist/src/server/sqlite-schema-v7.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v7.js +71 -0
- package/dist/src/server/sqlite-schema-v7.js.map +1 -0
- package/dist/src/server/sqlite-schema-v8.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v8.js +7 -0
- package/dist/src/server/sqlite-schema-v8.js.map +1 -0
- package/dist/src/server/sqlite-schema-v9.d.ts +2 -0
- package/dist/src/server/sqlite-schema-v9.js +7 -0
- package/dist/src/server/sqlite-schema-v9.js.map +1 -0
- package/dist/src/server/sqlite-schema.d.ts +3 -0
- package/dist/src/server/sqlite-schema.js +185 -0
- package/dist/src/server/sqlite-schema.js.map +1 -0
- package/dist/src/server/system-message.d.ts +1 -0
- package/dist/src/server/system-message.js +2 -0
- package/dist/src/server/system-message.js.map +1 -0
- package/dist/src/server/tasks-file-watcher.d.ts +8 -0
- package/dist/src/server/tasks-file-watcher.js +60 -0
- package/dist/src/server/tasks-file-watcher.js.map +1 -0
- package/dist/src/server/tasks-file.d.ts +11 -0
- package/dist/src/server/tasks-file.js +33 -0
- package/dist/src/server/tasks-file.js.map +1 -0
- package/dist/src/server/tasks-websocket-server.d.ts +7 -0
- package/dist/src/server/tasks-websocket-server.js +72 -0
- package/dist/src/server/tasks-websocket-server.js.map +1 -0
- package/dist/src/server/team-authz.d.ts +13 -0
- package/dist/src/server/team-authz.js +33 -0
- package/dist/src/server/team-authz.js.map +1 -0
- package/dist/src/server/team-list-serializer.d.ts +8 -0
- package/dist/src/server/team-list-serializer.js +8 -0
- package/dist/src/server/team-list-serializer.js.map +1 -0
- package/dist/src/server/team-operations.d.ts +41 -0
- package/dist/src/server/team-operations.js +105 -0
- package/dist/src/server/team-operations.js.map +1 -0
- package/dist/src/server/terminal-flow-control.d.ts +19 -0
- package/dist/src/server/terminal-flow-control.js +117 -0
- package/dist/src/server/terminal-flow-control.js.map +1 -0
- package/dist/src/server/terminal-protocol.d.ts +29 -0
- package/dist/src/server/terminal-protocol.js +42 -0
- package/dist/src/server/terminal-protocol.js.map +1 -0
- package/dist/src/server/terminal-state-mirror.d.ts +15 -0
- package/dist/src/server/terminal-state-mirror.js +47 -0
- package/dist/src/server/terminal-state-mirror.js.map +1 -0
- package/dist/src/server/terminal-stream-hub.d.ts +9 -0
- package/dist/src/server/terminal-stream-hub.js +179 -0
- package/dist/src/server/terminal-stream-hub.js.map +1 -0
- package/dist/src/server/terminal-ws-server.d.ts +5 -0
- package/dist/src/server/terminal-ws-server.js +85 -0
- package/dist/src/server/terminal-ws-server.js.map +1 -0
- package/dist/src/server/ui-auth-helpers.d.ts +4 -0
- package/dist/src/server/ui-auth-helpers.js +23 -0
- package/dist/src/server/ui-auth-helpers.js.map +1 -0
- package/dist/src/server/ui-auth.d.ts +5 -0
- package/dist/src/server/ui-auth.js +13 -0
- package/dist/src/server/ui-auth.js.map +1 -0
- package/dist/src/server/workspace-store-contract.d.ts +28 -0
- package/dist/src/server/workspace-store-contract.js +2 -0
- package/dist/src/server/workspace-store-contract.js.map +1 -0
- package/dist/src/server/workspace-store-hydration.d.ts +5 -0
- package/dist/src/server/workspace-store-hydration.js +64 -0
- package/dist/src/server/workspace-store-hydration.js.map +1 -0
- package/dist/src/server/workspace-store-mutations.d.ts +13 -0
- package/dist/src/server/workspace-store-mutations.js +49 -0
- package/dist/src/server/workspace-store-mutations.js.map +1 -0
- package/dist/src/server/workspace-store-support.d.ts +29 -0
- package/dist/src/server/workspace-store-support.js +25 -0
- package/dist/src/server/workspace-store-support.js.map +1 -0
- package/dist/src/server/workspace-store.d.ts +5 -0
- package/dist/src/server/workspace-store.js +114 -0
- package/dist/src/server/workspace-store.js.map +1 -0
- package/dist/src/shared/types.d.ts +36 -0
- package/dist/src/shared/types.js +2 -0
- package/dist/src/shared/types.js.map +1 -0
- package/package.json +108 -0
- package/scripts/fix-runtime-artifacts.mjs +33 -0
- package/web/dist/assets/addon-fit-DX4qG4td.js +1 -0
- package/web/dist/assets/index-CjlaoOoA.css +1 -0
- package/web/dist/assets/index-CwdRvXrs.js +63 -0
- package/web/dist/assets/xterm-B-qIQCd3.js +16 -0
- package/web/dist/favicon.svg +58 -0
- package/web/dist/index.html +22 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable user-facing changes will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## 0.6.0-alpha.0 - Unreleased
|
|
6
|
+
|
|
7
|
+
- Prepared Hive for public preview package distribution.
|
|
8
|
+
- Added Apache-2.0 licensing metadata and repository support documents.
|
|
9
|
+
- Documented supported platforms, supported CLI presets, first-run flow, safety
|
|
10
|
+
model, and troubleshooting guidance.
|
|
11
|
+
- Added package smoke validation for packaged runtime startup.
|
|
12
|
+
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
https://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. Do not include
|
|
183
|
+
the brackets. The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 tt-a1i contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Hive
|
|
2
|
+
|
|
3
|
+
Hive is a local multi-agent workspace for CLI coding agents. It turns Claude
|
|
4
|
+
Code, Codex, OpenCode, Gemini, and custom CLI agents into a visible team running
|
|
5
|
+
on your machine: one Orchestrator owns the plan, worker agents execute tasks in
|
|
6
|
+
their own PTYs, and the web UI keeps tasks, terminals, and reports in one place.
|
|
7
|
+
|
|
8
|
+
Hive is built for people who already use CLI coding agents and want a tighter
|
|
9
|
+
way to coordinate several of them without giving up each agent's native
|
|
10
|
+
terminal workflow.
|
|
11
|
+
|
|
12
|
+
> Public preview status: macOS, Linux, and Windows are the Tier 1 targets.
|
|
13
|
+
|
|
14
|
+
## 60 Second Start
|
|
15
|
+
|
|
16
|
+
After the package is published:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm i -g @tt-a1i/hive
|
|
20
|
+
hive --port 4010
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
or:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx @tt-a1i/hive --port 4010
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Open the printed local URL, usually `http://127.0.0.1:4010/`.
|
|
30
|
+
|
|
31
|
+
First run flow:
|
|
32
|
+
|
|
33
|
+
1. Add a workspace by picking or pasting a project folder.
|
|
34
|
+
2. Choose an Orchestrator preset.
|
|
35
|
+
3. Hive creates `<workspace>/.hive/tasks.md`, starts the Orchestrator PTY, and
|
|
36
|
+
injects the internal `team` command into agent sessions.
|
|
37
|
+
4. Add workers from the Team Members panel.
|
|
38
|
+
5. The Orchestrator sends work with `team send <worker-name> "<task>"`; workers
|
|
39
|
+
reply with `team report`.
|
|
40
|
+
|
|
41
|
+
## What It Does
|
|
42
|
+
|
|
43
|
+
- Keeps each agent in an isolated recoverable PTY.
|
|
44
|
+
- Shows workspaces, team members, task state, and terminal output in one local
|
|
45
|
+
web UI.
|
|
46
|
+
- Uses `.hive/tasks.md` as the workspace task graph so the plan remains visible
|
|
47
|
+
outside the app.
|
|
48
|
+
- Injects the internal `team` command only inside agent sessions; it does not
|
|
49
|
+
install a global `team` command.
|
|
50
|
+
- Stores runtime metadata under `~/.config/hive` by default, or under
|
|
51
|
+
`HIVE_DATA_DIR` when set.
|
|
52
|
+
|
|
53
|
+
## Supported Agent Presets
|
|
54
|
+
|
|
55
|
+
| Preset | Command expected on PATH | Notes |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| Claude Code | `claude` | Built-in default preset. |
|
|
58
|
+
| Codex | `codex` | Uses the local Codex CLI. |
|
|
59
|
+
| OpenCode | `opencode` | Uses the local OpenCode CLI. |
|
|
60
|
+
| Gemini | `gemini` | Uses the local Gemini CLI. |
|
|
61
|
+
| Custom | Any executable | Configure command and args in the UI. |
|
|
62
|
+
|
|
63
|
+
Hive does not install these CLIs for you. Install and authenticate each agent
|
|
64
|
+
CLI before selecting it in Hive.
|
|
65
|
+
|
|
66
|
+
## Platform Support
|
|
67
|
+
|
|
68
|
+
| Platform | Status | Notes |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| macOS | Tier 1 | Local development and release verification target. |
|
|
71
|
+
| Linux | Tier 1 | CI verification target; folder picking expects `zenity` when using the native picker. |
|
|
72
|
+
| Windows | Tier 1 | CI verification target; folder picking uses Windows PowerShell and the packaged internal `team.cmd`. |
|
|
73
|
+
|
|
74
|
+
## Safety Model
|
|
75
|
+
|
|
76
|
+
Hive is a local development tool, not a hosted multi-user service.
|
|
77
|
+
|
|
78
|
+
- The runtime binds to `127.0.0.1`. Do not expose the Hive port through a public
|
|
79
|
+
tunnel, reverse proxy, or shared network interface.
|
|
80
|
+
- Built-in presets intentionally use each CLI's non-interactive or bypass mode
|
|
81
|
+
where available. Treat workers as able to run arbitrary shell commands inside
|
|
82
|
+
the selected workspace.
|
|
83
|
+
- Only open trusted workspaces. A worker has the same filesystem access as the
|
|
84
|
+
shell account running Hive.
|
|
85
|
+
- Agent tokens are session scoped, generated by the local runtime, injected into
|
|
86
|
+
agent process environments, and not intended as internet-facing credentials.
|
|
87
|
+
- Hive has no multi-user authentication boundary. If another process can reach
|
|
88
|
+
the local port from the same machine, treat it as trusted local access.
|
|
89
|
+
|
|
90
|
+
See [SECURITY.md](SECURITY.md) before using Hive with sensitive repositories.
|
|
91
|
+
|
|
92
|
+
## Development
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pnpm install
|
|
96
|
+
pnpm dev
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The development runtime uses `127.0.0.1:4010`; the Vite web server uses
|
|
100
|
+
`127.0.0.1:5180` and proxies API and WebSocket traffic to the runtime.
|
|
101
|
+
|
|
102
|
+
Useful checks:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pnpm check
|
|
106
|
+
pnpm build
|
|
107
|
+
pnpm test
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Production-Style Local Run
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
pnpm build
|
|
114
|
+
node dist/src/cli/hive.js --port 4010
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The production server serves `web/dist` directly. No separate Vite server is
|
|
118
|
+
needed after `pnpm build`.
|
|
119
|
+
|
|
120
|
+
Use an isolated data directory when testing:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
HIVE_DATA_DIR=/tmp/hive-data node dist/src/cli/hive.js --port 4010
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Troubleshooting
|
|
127
|
+
|
|
128
|
+
**Agent CLI not found**
|
|
129
|
+
|
|
130
|
+
Check that the selected command is installed, authenticated, executable from the
|
|
131
|
+
same shell, and available on `PATH`.
|
|
132
|
+
|
|
133
|
+
**Port already in use**
|
|
134
|
+
|
|
135
|
+
Start Hive with a different local port:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
hive --port 4020
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Native PTY install fails**
|
|
142
|
+
|
|
143
|
+
Hive depends on `node-pty`, which ships native binaries. Use Node.js 22+, keep
|
|
144
|
+
your package manager cache clean, and verify your platform is macOS, Linux, or
|
|
145
|
+
Windows.
|
|
146
|
+
|
|
147
|
+
**Folder picker does not open on Linux**
|
|
148
|
+
|
|
149
|
+
Install `zenity`, or paste the workspace path manually.
|
|
150
|
+
|
|
151
|
+
**Folder picker does not open on Windows**
|
|
152
|
+
|
|
153
|
+
Verify Windows PowerShell is available as `powershell.exe`, or paste the
|
|
154
|
+
workspace path manually.
|
|
155
|
+
|
|
156
|
+
**Tasks file conflict banner appears**
|
|
157
|
+
|
|
158
|
+
Hive detected a newer `.hive/tasks.md` on disk. Use `Reload` to accept the file
|
|
159
|
+
from disk, or `Keep Local` to keep the editor contents and save again.
|
|
160
|
+
|
|
161
|
+
## Package Release
|
|
162
|
+
|
|
163
|
+
Release commands are intentionally separate from normal development:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
pnpm release:dry
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
That command runs linting, the production build, the full test suite, npm
|
|
170
|
+
packlist validation, and a tarball install smoke test. Tag pushes matching `v*`
|
|
171
|
+
run the GitHub Actions release workflow; the publish job requires `NPM_TOKEN`.
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
Apache-2.0. See [LICENSE](LICENSE).
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
Hive is a local development tool for coordinating CLI agents. It is not a
|
|
4
|
+
hosted service and does not provide a multi-user security boundary.
|
|
5
|
+
|
|
6
|
+
## Supported Versions
|
|
7
|
+
|
|
8
|
+
| Version | Supported |
|
|
9
|
+
| --- | --- |
|
|
10
|
+
| 0.6.x alpha | Security fixes accepted during public preview. |
|
|
11
|
+
| Earlier versions | Not supported. |
|
|
12
|
+
|
|
13
|
+
## Reporting a Vulnerability
|
|
14
|
+
|
|
15
|
+
If GitHub Security Advisories are available for this repository, use a private
|
|
16
|
+
advisory. Otherwise, open a minimal GitHub issue asking for a private contact
|
|
17
|
+
path and do not include exploit details in the public issue.
|
|
18
|
+
|
|
19
|
+
Please include:
|
|
20
|
+
|
|
21
|
+
- Hive version or commit SHA.
|
|
22
|
+
- Operating system and Node.js version.
|
|
23
|
+
- Whether the issue affects the local runtime, packaged install, web UI, PTY
|
|
24
|
+
process handling, or the injected `team` command.
|
|
25
|
+
- A minimal reproduction when it is safe to share.
|
|
26
|
+
|
|
27
|
+
## Local Runtime Safety
|
|
28
|
+
|
|
29
|
+
- Hive binds to `127.0.0.1` by default. Do not expose the runtime port to the
|
|
30
|
+
internet or to an untrusted network.
|
|
31
|
+
- Built-in presets may pass each CLI's non-interactive or bypass flag so worker
|
|
32
|
+
agents can continue without manual permission prompts.
|
|
33
|
+
- Treat workers as able to run arbitrary shell commands with the permissions of
|
|
34
|
+
the user account that launched Hive.
|
|
35
|
+
- Only open trusted workspaces. Hive intentionally gives agents access to the
|
|
36
|
+
selected workspace so they can edit files and run project commands.
|
|
37
|
+
- Agent tokens are generated by the local runtime, injected into agent process
|
|
38
|
+
environments, and intended only for local agent-to-runtime calls.
|
|
39
|
+
- Do not paste Hive agent tokens, terminal output, or workspace logs into public
|
|
40
|
+
reports if they include private repository or machine details.
|
|
41
|
+
|
|
42
|
+
## Out of Scope for Public Preview
|
|
43
|
+
|
|
44
|
+
- Running Hive as a shared server for multiple users.
|
|
45
|
+
- Exposing Hive through a public tunnel or reverse proxy.
|
|
46
|
+
- Windows production support.
|
|
47
|
+
- Sandboxing third-party CLI agents beyond the controls provided by those CLIs.
|
|
48
|
+
|
package/dist/bin/team
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { type RuntimeStore } from '../server/runtime-store.js';
|
|
3
|
+
interface RunHiveCommandResult {
|
|
4
|
+
port: number;
|
|
5
|
+
close: () => Promise<void>;
|
|
6
|
+
store: RuntimeStore;
|
|
7
|
+
}
|
|
8
|
+
export declare const runHiveCommand: (argv: string[]) => Promise<RunHiveCommandResult>;
|
|
9
|
+
export type { RunHiveCommandResult };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { once } from 'node:events';
|
|
3
|
+
import { realpathSync } from 'node:fs';
|
|
4
|
+
import { homedir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
import { createAgentManager } from '../server/agent-manager.js';
|
|
8
|
+
import { createApp } from '../server/app.js';
|
|
9
|
+
import { createRuntimeStore } from '../server/runtime-store.js';
|
|
10
|
+
const parsePort = (argv) => {
|
|
11
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
12
|
+
if (argv[index] !== '--port') {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
const value = argv[index + 1];
|
|
16
|
+
if (!value) {
|
|
17
|
+
throw new Error('Usage: hive [--port <port>]');
|
|
18
|
+
}
|
|
19
|
+
const port = Number.parseInt(value, 10);
|
|
20
|
+
if (Number.isNaN(port) || port < 0) {
|
|
21
|
+
throw new Error(`Invalid port: ${value}`);
|
|
22
|
+
}
|
|
23
|
+
return port;
|
|
24
|
+
}
|
|
25
|
+
return 3000;
|
|
26
|
+
};
|
|
27
|
+
const resolveDataDir = () => process.env.HIVE_DATA_DIR || join(homedir(), '.config', 'hive');
|
|
28
|
+
export const runHiveCommand = async (argv) => {
|
|
29
|
+
const port = parsePort(argv);
|
|
30
|
+
const dataDir = resolveDataDir();
|
|
31
|
+
const app = createApp({
|
|
32
|
+
store: createRuntimeStore({
|
|
33
|
+
agentManager: createAgentManager(),
|
|
34
|
+
dataDir,
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
app.server.listen(port, '127.0.0.1');
|
|
38
|
+
await Promise.race([
|
|
39
|
+
once(app.server, 'listening'),
|
|
40
|
+
once(app.server, 'error').then(([error]) => {
|
|
41
|
+
throw error;
|
|
42
|
+
}),
|
|
43
|
+
]);
|
|
44
|
+
const address = app.server.address();
|
|
45
|
+
if (!address || typeof address === 'string') {
|
|
46
|
+
throw new Error('Server did not bind to an inet port');
|
|
47
|
+
}
|
|
48
|
+
let closePromise = null;
|
|
49
|
+
const close = async () => {
|
|
50
|
+
if (closePromise) {
|
|
51
|
+
return closePromise;
|
|
52
|
+
}
|
|
53
|
+
closePromise = (async () => {
|
|
54
|
+
process.off('SIGTERM', gracefulShutdown);
|
|
55
|
+
process.off('SIGINT', gracefulShutdown);
|
|
56
|
+
await new Promise((resolve, reject) => {
|
|
57
|
+
app.server.close((error) => {
|
|
58
|
+
if (error) {
|
|
59
|
+
reject(error);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
resolve();
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
await app.store.close();
|
|
66
|
+
})();
|
|
67
|
+
return closePromise;
|
|
68
|
+
};
|
|
69
|
+
const gracefulShutdown = () => {
|
|
70
|
+
void close()
|
|
71
|
+
.then(() => {
|
|
72
|
+
process.exit(0);
|
|
73
|
+
})
|
|
74
|
+
.catch((error) => {
|
|
75
|
+
console.error(error);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
process.once('SIGTERM', gracefulShutdown);
|
|
80
|
+
process.once('SIGINT', gracefulShutdown);
|
|
81
|
+
console.log(`Hive running at http://127.0.0.1:${address.port}`);
|
|
82
|
+
void app.store.autostartConfiguredAgents({ hivePort: String(address.port) }).then((results) => {
|
|
83
|
+
for (const result of results) {
|
|
84
|
+
if (!result.ok && result.error) {
|
|
85
|
+
console.warn(`Failed to autostart ${result.agent_id}: ${result.error}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
port: address.port,
|
|
91
|
+
close,
|
|
92
|
+
store: app.store,
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
const isMainModule = process.argv[1]
|
|
96
|
+
? fileURLToPath(import.meta.url) === realpathSync(process.argv[1])
|
|
97
|
+
: false;
|
|
98
|
+
if (isMainModule) {
|
|
99
|
+
runHiveCommand(process.argv.slice(2)).catch((error) => {
|
|
100
|
+
console.error(error);
|
|
101
|
+
process.exit(1);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=hive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hive.js","sourceRoot":"","sources":["../../../src/cli/hive.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,kBAAkB,EAAqB,MAAM,4BAA4B,CAAA;AAQlF,MAAM,SAAS,GAAG,CAAC,IAAc,EAAE,EAAE;IACnC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC7B,SAAQ;QACV,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAA;QAC7B,IAAI,CAAC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