aimux-cli 0.1.16 → 0.1.19
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/README.md +184 -67
- package/bin/aimux-dev +10 -0
- package/dist/agent-events.js +0 -1
- package/dist/agent-output-parser.js +0 -1
- package/dist/agent-prompt-delivery.js +0 -1
- package/dist/agent-tracker.js +0 -1
- package/dist/agent-watcher.js +0 -1
- package/dist/alert-display.d.ts +21 -0
- package/dist/alert-display.js +85 -0
- package/dist/atomic-write.js +0 -1
- package/dist/attachment-store.d.ts +0 -7
- package/dist/attachment-store.js +2 -87
- package/dist/builtin-metadata-watchers.js +4 -5
- package/dist/claude-hooks.d.ts +1 -0
- package/dist/claude-hooks.js +25 -1
- package/dist/config.d.ts +19 -13
- package/dist/config.js +28 -15
- package/dist/connection-targets.d.ts +8 -0
- package/dist/connection-targets.js +27 -0
- package/dist/context/compactor.js +0 -1
- package/dist/context/context-bridge.js +0 -1
- package/dist/context/context-file.js +0 -1
- package/dist/context/history.js +0 -1
- package/dist/credentials.d.ts +12 -0
- package/dist/credentials.js +48 -0
- package/dist/daemon.d.ts +23 -0
- package/dist/daemon.js +391 -67
- package/dist/dashboard/command-spec.js +0 -1
- package/dist/dashboard/feedback.js +0 -1
- package/dist/dashboard/index.d.ts +13 -10
- package/dist/dashboard/index.js +3 -27
- package/dist/dashboard/operation-failures.js +0 -1
- package/dist/dashboard/order.d.ts +22 -0
- package/dist/dashboard/order.js +54 -0
- package/dist/dashboard/pending-actions.d.ts +39 -10
- package/dist/dashboard/pending-actions.js +166 -37
- package/dist/dashboard/quick-jump.d.ts +2 -1
- package/dist/dashboard/quick-jump.js +7 -5
- package/dist/dashboard/runtime-evidence.js +0 -1
- package/dist/dashboard/session-actions.d.ts +4 -4
- package/dist/dashboard/session-actions.js +1 -2
- package/dist/dashboard/session-registry.d.ts +4 -3
- package/dist/dashboard/session-registry.js +16 -51
- package/dist/dashboard/sort.js +0 -1
- package/dist/dashboard/state.d.ts +1 -1
- package/dist/dashboard/state.js +0 -1
- package/dist/dashboard/targets.js +0 -1
- package/dist/dashboard/ui-state-store.d.ts +16 -1
- package/dist/dashboard/ui-state-store.js +73 -3
- package/dist/debug-state.d.ts +97 -0
- package/dist/debug-state.js +540 -0
- package/dist/debug.d.ts +38 -0
- package/dist/debug.js +219 -16
- package/dist/default-plugins/gh-pr-context.d.ts +2 -1
- package/dist/default-plugins/gh-pr-context.js +17 -12
- package/dist/default-plugins/transcript-length.js +15 -3
- package/dist/fast-control.js +37 -20
- package/dist/hotkeys.js +0 -1
- package/dist/http-client.js +31 -3
- package/dist/key-parser.js +0 -1
- package/dist/last-used.js +0 -1
- package/dist/local-ui-server.d.ts +22 -0
- package/dist/local-ui-server.js +185 -0
- package/dist/login-flow.d.ts +7 -0
- package/dist/login-flow.js +119 -0
- package/dist/main.js +821 -152
- package/dist/managed-launch-env.js +14 -1
- package/dist/metadata-server.d.ts +36 -36
- package/dist/metadata-server.js +638 -138
- package/dist/metadata-store.d.ts +4 -1
- package/dist/metadata-store.js +30 -3
- package/dist/multiplexer/agent-io-methods.d.ts +2 -10
- package/dist/multiplexer/agent-io-methods.js +12 -44
- package/dist/multiplexer/archives.js +8 -10
- package/dist/multiplexer/dashboard-actions-methods.js +0 -1
- package/dist/multiplexer/dashboard-control.js +45 -14
- package/dist/multiplexer/dashboard-interaction.d.ts +8 -2
- package/dist/multiplexer/dashboard-interaction.js +187 -29
- package/dist/multiplexer/dashboard-model.d.ts +10 -3
- package/dist/multiplexer/dashboard-model.js +417 -36
- package/dist/multiplexer/dashboard-ops.d.ts +9 -7
- package/dist/multiplexer/dashboard-ops.js +178 -69
- package/dist/multiplexer/dashboard-state-methods.d.ts +2 -1
- package/dist/multiplexer/dashboard-state-methods.js +3 -3
- package/dist/multiplexer/dashboard-tail-methods.d.ts +22 -10
- package/dist/multiplexer/dashboard-tail-methods.js +164 -48
- package/dist/multiplexer/dashboard-view-methods.d.ts +1 -1
- package/dist/multiplexer/dashboard-view-methods.js +23 -9
- package/dist/multiplexer/graveyard-view-model.d.ts +9 -1
- package/dist/multiplexer/graveyard-view-model.js +39 -1
- package/dist/multiplexer/index.d.ts +15 -12
- package/dist/multiplexer/index.js +64 -44
- package/dist/multiplexer/navigation.js +0 -1
- package/dist/multiplexer/notifications.js +107 -25
- package/dist/multiplexer/persistence-methods.d.ts +31 -4
- package/dist/multiplexer/persistence-methods.js +304 -309
- package/dist/multiplexer/runtime-lifecycle-methods.d.ts +8 -10
- package/dist/multiplexer/runtime-lifecycle-methods.js +104 -87
- package/dist/multiplexer/runtime-state.d.ts +8 -10
- package/dist/multiplexer/runtime-state.js +82 -146
- package/dist/multiplexer/runtime-sync.d.ts +2 -10
- package/dist/multiplexer/runtime-sync.js +3 -19
- package/dist/multiplexer/service-state-snapshot.d.ts +2 -4
- package/dist/multiplexer/service-state-snapshot.js +4 -52
- package/dist/multiplexer/services.d.ts +1 -0
- package/dist/multiplexer/services.js +55 -6
- package/dist/multiplexer/session-capture.d.ts +1 -0
- package/dist/multiplexer/session-capture.js +23 -0
- package/dist/multiplexer/session-launch.d.ts +4 -1
- package/dist/multiplexer/session-launch.js +152 -64
- package/dist/multiplexer/session-runtime-core.d.ts +8 -20
- package/dist/multiplexer/session-runtime-core.js +40 -136
- package/dist/multiplexer/subscreens.js +10 -4
- package/dist/multiplexer/tool-picker.js +0 -1
- package/dist/multiplexer/worktree-graveyard.d.ts +0 -1
- package/dist/multiplexer/worktree-graveyard.js +15 -17
- package/dist/multiplexer/worktrees.js +96 -41
- package/dist/notification-context.js +8 -5
- package/dist/notifications.js +163 -102
- package/dist/notify.d.ts +4 -0
- package/dist/notify.js +14 -1
- package/dist/orchestration-actions.js +0 -1
- package/dist/orchestration-routing.js +0 -1
- package/dist/orchestration.js +0 -1
- package/dist/osc-notifications.js +0 -1
- package/dist/paths.d.ts +32 -7
- package/dist/paths.js +82 -59
- package/dist/pending-actions.d.ts +5 -0
- package/dist/pending-actions.js +13 -0
- package/dist/plugin-runtime.js +9 -3
- package/dist/project-events.d.ts +1 -10
- package/dist/project-events.js +0 -11
- package/dist/project-scanner.d.ts +2 -3
- package/dist/project-scanner.js +58 -130
- package/dist/project-service-manifest.d.ts +1 -3
- package/dist/project-service-manifest.js +1 -4
- package/dist/recency.js +0 -1
- package/dist/recorder.js +0 -1
- package/dist/relay-client.d.ts +30 -0
- package/dist/relay-client.js +190 -0
- package/dist/remote-access.d.ts +16 -0
- package/dist/remote-access.js +90 -0
- package/dist/runtime-core/exchange-derived.d.ts +2 -0
- package/dist/runtime-core/exchange-derived.js +153 -0
- package/dist/runtime-core/exchange-import.d.ts +24 -0
- package/dist/runtime-core/exchange-import.js +317 -0
- package/dist/runtime-core/exchange-store.d.ts +157 -0
- package/dist/runtime-core/exchange-store.js +452 -0
- package/dist/runtime-core/topology-services.d.ts +38 -0
- package/dist/runtime-core/topology-services.js +170 -0
- package/dist/runtime-core/topology-sessions.d.ts +52 -0
- package/dist/runtime-core/topology-sessions.js +238 -0
- package/dist/runtime-core/topology-store.d.ts +171 -0
- package/dist/runtime-core/topology-store.js +419 -0
- package/dist/runtime-core/topology-worktrees.d.ts +60 -0
- package/dist/runtime-core/topology-worktrees.js +199 -0
- package/dist/runtime-migration.d.ts +69 -0
- package/dist/runtime-migration.js +398 -0
- package/dist/session-bootstrap.d.ts +8 -6
- package/dist/session-bootstrap.js +51 -159
- package/dist/session-runtime.d.ts +2 -0
- package/dist/session-runtime.js +1 -1
- package/dist/session-semantics.d.ts +12 -4
- package/dist/session-semantics.js +14 -1
- package/dist/shell-args.js +0 -1
- package/dist/shell-hooks.js +32 -11
- package/dist/shell-state.d.ts +2 -0
- package/dist/shell-state.js +26 -2
- package/dist/status-detector.js +0 -1
- package/dist/statusline-model.d.ts +10 -2
- package/dist/statusline-model.js +106 -31
- package/dist/task-workflow.d.ts +6 -9
- package/dist/task-workflow.js +37 -85
- package/dist/tasks.d.ts +6 -33
- package/dist/tasks.js +46 -89
- package/dist/team.d.ts +29 -0
- package/dist/team.js +40 -1
- package/dist/terminal-host.js +0 -1
- package/dist/threads.d.ts +6 -35
- package/dist/threads.js +89 -99
- package/dist/tmux/doctor.js +0 -1
- package/dist/tmux/inbox-popup.js +37 -16
- package/dist/tmux/runtime-manager.d.ts +3 -0
- package/dist/tmux/runtime-manager.js +21 -5
- package/dist/tmux/session-transport.js +0 -1
- package/dist/tmux/statusline-cache.js +0 -1
- package/dist/tmux/statusline.js +49 -10
- package/dist/tmux/switcher.js +0 -1
- package/dist/tmux/window-open.js +1 -3
- package/dist/tool-output-watchers.d.ts +0 -18
- package/dist/tool-output-watchers.js +0 -323
- package/dist/tui/render/box.js +0 -1
- package/dist/tui/render/text.js +0 -1
- package/dist/tui/screens/dashboard-renderers.js +37 -26
- package/dist/tui/screens/overlay-renderers.d.ts +2 -0
- package/dist/tui/screens/overlay-renderers.js +37 -2
- package/dist/tui/screens/subscreen-renderers.js +7 -1
- package/dist/workflow.js +0 -1
- package/dist/worktree.js +17 -1
- package/dist-ui/_expo/static/css/web-30453ede1678c16acb08b97e83e8646d.css +1 -0
- package/dist-ui/_expo/static/js/web/entry-477c745b2adc79367a4380ecf07d9ff6.js +14620 -0
- package/dist-ui/assets/assets/images/icon.a5413dcd2e811c9f2317d01a28118d8a.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png +0 -0
- package/dist-ui/assets/node_modules/@react-navigation/elements/lib/module/assets/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png +0 -0
- package/dist-ui/assets/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png +0 -0
- package/dist-ui/favicon.ico +0 -0
- package/dist-ui/index.html +38 -0
- package/dist-ui/metadata.json +1 -0
- package/package.json +29 -12
- package/dist/agent-events.js.map +0 -1
- package/dist/agent-message-parts.d.ts +0 -17
- package/dist/agent-message-parts.js +0 -31
- package/dist/agent-message-parts.js.map +0 -1
- package/dist/agent-output-parser.js.map +0 -1
- package/dist/agent-prompt-delivery.js.map +0 -1
- package/dist/agent-tracker.js.map +0 -1
- package/dist/agent-watcher.js.map +0 -1
- package/dist/atomic-write.js.map +0 -1
- package/dist/attachment-store.js.map +0 -1
- package/dist/builtin-metadata-watchers.js.map +0 -1
- package/dist/claude-hooks.js.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/context/compactor.js.map +0 -1
- package/dist/context/context-bridge.js.map +0 -1
- package/dist/context/context-file.js.map +0 -1
- package/dist/context/history.js.map +0 -1
- package/dist/daemon.js.map +0 -1
- package/dist/dashboard/command-spec.js.map +0 -1
- package/dist/dashboard/feedback.js.map +0 -1
- package/dist/dashboard/index.js.map +0 -1
- package/dist/dashboard/operation-failures.js.map +0 -1
- package/dist/dashboard/pending-actions.js.map +0 -1
- package/dist/dashboard/quick-jump.js.map +0 -1
- package/dist/dashboard/runtime-evidence.js.map +0 -1
- package/dist/dashboard/session-actions.js.map +0 -1
- package/dist/dashboard/session-registry.js.map +0 -1
- package/dist/dashboard/sort.js.map +0 -1
- package/dist/dashboard/state.js.map +0 -1
- package/dist/dashboard/targets.js.map +0 -1
- package/dist/dashboard/ui-state-store.js.map +0 -1
- package/dist/debug.js.map +0 -1
- package/dist/default-plugins/gh-pr-context.js.map +0 -1
- package/dist/default-plugins/transcript-length.js.map +0 -1
- package/dist/fast-control.js.map +0 -1
- package/dist/hotkeys.js.map +0 -1
- package/dist/http-client.js.map +0 -1
- package/dist/instance-directory.d.ts +0 -32
- package/dist/instance-directory.js +0 -82
- package/dist/instance-directory.js.map +0 -1
- package/dist/instance-registry.d.ts +0 -39
- package/dist/instance-registry.js +0 -208
- package/dist/instance-registry.js.map +0 -1
- package/dist/key-parser.js.map +0 -1
- package/dist/last-used.js.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/managed-launch-env.js.map +0 -1
- package/dist/metadata-server.js.map +0 -1
- package/dist/metadata-store.js.map +0 -1
- package/dist/multiplexer/agent-io-methods.js.map +0 -1
- package/dist/multiplexer/archives.js.map +0 -1
- package/dist/multiplexer/dashboard-actions-methods.js.map +0 -1
- package/dist/multiplexer/dashboard-control.js.map +0 -1
- package/dist/multiplexer/dashboard-interaction.js.map +0 -1
- package/dist/multiplexer/dashboard-model.js.map +0 -1
- package/dist/multiplexer/dashboard-ops.js.map +0 -1
- package/dist/multiplexer/dashboard-state-methods.js.map +0 -1
- package/dist/multiplexer/dashboard-tail-methods.js.map +0 -1
- package/dist/multiplexer/dashboard-view-methods.js.map +0 -1
- package/dist/multiplexer/graveyard-view-model.js.map +0 -1
- package/dist/multiplexer/index.js.map +0 -1
- package/dist/multiplexer/navigation.js.map +0 -1
- package/dist/multiplexer/notifications.js.map +0 -1
- package/dist/multiplexer/persistence-methods.js.map +0 -1
- package/dist/multiplexer/runtime-lifecycle-methods.js.map +0 -1
- package/dist/multiplexer/runtime-state.js.map +0 -1
- package/dist/multiplexer/runtime-sync.js.map +0 -1
- package/dist/multiplexer/service-state-snapshot.js.map +0 -1
- package/dist/multiplexer/services.js.map +0 -1
- package/dist/multiplexer/session-actions.d.ts +0 -40
- package/dist/multiplexer/session-actions.js +0 -110
- package/dist/multiplexer/session-actions.js.map +0 -1
- package/dist/multiplexer/session-launch.js.map +0 -1
- package/dist/multiplexer/session-runtime-core.js.map +0 -1
- package/dist/multiplexer/subscreens.js.map +0 -1
- package/dist/multiplexer/tool-picker.js.map +0 -1
- package/dist/multiplexer/worktree-graveyard.js.map +0 -1
- package/dist/multiplexer/worktrees.js.map +0 -1
- package/dist/notification-context.js.map +0 -1
- package/dist/notifications.js.map +0 -1
- package/dist/notify.js.map +0 -1
- package/dist/orchestration-actions.js.map +0 -1
- package/dist/orchestration-dispatcher.d.ts +0 -25
- package/dist/orchestration-dispatcher.js +0 -59
- package/dist/orchestration-dispatcher.js.map +0 -1
- package/dist/orchestration-routing.js.map +0 -1
- package/dist/orchestration.js.map +0 -1
- package/dist/osc-notifications.js.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/plugin-runtime.js.map +0 -1
- package/dist/project-events.js.map +0 -1
- package/dist/project-scanner.js.map +0 -1
- package/dist/project-service-manifest.js.map +0 -1
- package/dist/recency.js.map +0 -1
- package/dist/recorder.js.map +0 -1
- package/dist/session-bootstrap.js.map +0 -1
- package/dist/session-input-operations.d.ts +0 -19
- package/dist/session-input-operations.js +0 -46
- package/dist/session-input-operations.js.map +0 -1
- package/dist/session-message-history.d.ts +0 -27
- package/dist/session-message-history.js +0 -105
- package/dist/session-message-history.js.map +0 -1
- package/dist/session-runtime.js.map +0 -1
- package/dist/session-semantics.js.map +0 -1
- package/dist/shell-args.js.map +0 -1
- package/dist/shell-hooks.js.map +0 -1
- package/dist/shell-state.js.map +0 -1
- package/dist/status-detector.js.map +0 -1
- package/dist/statusline-model.js.map +0 -1
- package/dist/task-dispatcher.d.ts +0 -64
- package/dist/task-dispatcher.js +0 -213
- package/dist/task-dispatcher.js.map +0 -1
- package/dist/task-workflow.js.map +0 -1
- package/dist/tasks.js.map +0 -1
- package/dist/team.js.map +0 -1
- package/dist/terminal-host.js.map +0 -1
- package/dist/threads.js.map +0 -1
- package/dist/tmux/doctor.js.map +0 -1
- package/dist/tmux/inbox-popup.js.map +0 -1
- package/dist/tmux/runtime-manager.js.map +0 -1
- package/dist/tmux/session-transport.js.map +0 -1
- package/dist/tmux/statusline-cache.js.map +0 -1
- package/dist/tmux/statusline.js.map +0 -1
- package/dist/tmux/switcher.js.map +0 -1
- package/dist/tmux/window-open.js.map +0 -1
- package/dist/tool-output-watchers.js.map +0 -1
- package/dist/tui/render/box.js.map +0 -1
- package/dist/tui/render/text.js.map +0 -1
- package/dist/tui/screens/dashboard-renderers.js.map +0 -1
- package/dist/tui/screens/overlay-renderers.js.map +0 -1
- package/dist/tui/screens/subscreen-renderers.js.map +0 -1
- package/dist/workflow.js.map +0 -1
- package/dist/worktree.js.map +0 -1
package/dist/attachment-store.js
CHANGED
|
@@ -1,46 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { basename, extname, join } from "node:path";
|
|
1
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
4
3
|
import { getAttachmentsDir } from "./paths.js";
|
|
5
|
-
const MIME_BY_EXT = {
|
|
6
|
-
".png": "image/png",
|
|
7
|
-
".jpg": "image/jpeg",
|
|
8
|
-
".jpeg": "image/jpeg",
|
|
9
|
-
".gif": "image/gif",
|
|
10
|
-
".webp": "image/webp",
|
|
11
|
-
".bmp": "image/bmp",
|
|
12
|
-
".svg": "image/svg+xml",
|
|
13
|
-
};
|
|
14
|
-
export function ingestAttachmentFromPath(path) {
|
|
15
|
-
const trimmedPath = path.trim();
|
|
16
|
-
if (!trimmedPath) {
|
|
17
|
-
throw new Error("attachment path is required");
|
|
18
|
-
}
|
|
19
|
-
const buffer = readFileSync(trimmedPath);
|
|
20
|
-
const filename = basename(trimmedPath) || "image";
|
|
21
|
-
return writeAttachment(buffer, {
|
|
22
|
-
filename,
|
|
23
|
-
mimeType: inferMimeType(filename),
|
|
24
|
-
source: "path",
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
export function ingestAttachmentFromBase64(input) {
|
|
28
|
-
const contentBase64 = input.contentBase64.trim();
|
|
29
|
-
if (!contentBase64) {
|
|
30
|
-
throw new Error("contentBase64 is required");
|
|
31
|
-
}
|
|
32
|
-
const buffer = Buffer.from(contentBase64, "base64");
|
|
33
|
-
if (buffer.length === 0) {
|
|
34
|
-
throw new Error("attachment content is empty");
|
|
35
|
-
}
|
|
36
|
-
const filename = input.filename?.trim() || "image";
|
|
37
|
-
const mimeType = input.mimeType?.trim() || inferMimeType(filename);
|
|
38
|
-
return writeAttachment(buffer, {
|
|
39
|
-
filename,
|
|
40
|
-
mimeType,
|
|
41
|
-
source: "upload",
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
4
|
export function getAttachment(id) {
|
|
45
5
|
const record = loadAttachmentRecord(id);
|
|
46
6
|
return record ? toPublicAttachment(record) : null;
|
|
@@ -55,36 +15,6 @@ export function getAttachmentContent(id) {
|
|
|
55
15
|
buffer: readFileSync(record.contentPath),
|
|
56
16
|
};
|
|
57
17
|
}
|
|
58
|
-
export function resolveAttachmentPath(id) {
|
|
59
|
-
const record = loadAttachmentRecord(id);
|
|
60
|
-
return record?.contentPath ?? null;
|
|
61
|
-
}
|
|
62
|
-
function writeAttachment(buffer, input) {
|
|
63
|
-
ensureAttachmentsDir();
|
|
64
|
-
const sha256 = createHash("sha256").update(buffer).digest("hex");
|
|
65
|
-
const id = `att_${sha256.slice(0, 16)}`;
|
|
66
|
-
const extension = normalizeExtension(extname(input.filename), input.mimeType);
|
|
67
|
-
const contentPath = join(getAttachmentsDir(), `${id}${extension}`);
|
|
68
|
-
const metadataPath = join(getAttachmentsDir(), `${id}.json`);
|
|
69
|
-
if (!existsSync(contentPath)) {
|
|
70
|
-
writeFileSync(contentPath, buffer);
|
|
71
|
-
}
|
|
72
|
-
const record = {
|
|
73
|
-
id,
|
|
74
|
-
kind: "image",
|
|
75
|
-
filename: input.filename,
|
|
76
|
-
mimeType: input.mimeType,
|
|
77
|
-
sizeBytes: buffer.length,
|
|
78
|
-
sha256,
|
|
79
|
-
createdAt: existsSync(metadataPath)
|
|
80
|
-
? loadAttachmentRecord(id)?.createdAt || new Date().toISOString()
|
|
81
|
-
: new Date().toISOString(),
|
|
82
|
-
source: input.source,
|
|
83
|
-
contentPath,
|
|
84
|
-
};
|
|
85
|
-
writeFileSync(metadataPath, `${JSON.stringify(record, null, 2)}\n`, "utf8");
|
|
86
|
-
return toPublicAttachment(record);
|
|
87
|
-
}
|
|
88
18
|
function loadAttachmentRecord(id) {
|
|
89
19
|
const normalizedId = id.trim();
|
|
90
20
|
if (!normalizedId)
|
|
@@ -112,18 +42,3 @@ function toPublicAttachment(record) {
|
|
|
112
42
|
contentUrl: `/attachments/${record.id}/content`,
|
|
113
43
|
};
|
|
114
44
|
}
|
|
115
|
-
function ensureAttachmentsDir() {
|
|
116
|
-
mkdirSync(getAttachmentsDir(), { recursive: true });
|
|
117
|
-
}
|
|
118
|
-
function inferMimeType(filename) {
|
|
119
|
-
return MIME_BY_EXT[extname(filename).toLowerCase()] || "application/octet-stream";
|
|
120
|
-
}
|
|
121
|
-
function normalizeExtension(extension, mimeType) {
|
|
122
|
-
const trimmed = extension.trim().toLowerCase();
|
|
123
|
-
if (trimmed) {
|
|
124
|
-
return trimmed;
|
|
125
|
-
}
|
|
126
|
-
const matched = Object.entries(MIME_BY_EXT).find(([, candidateMime]) => candidateMime === mimeType)?.[0];
|
|
127
|
-
return matched || "";
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=attachment-store.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readdirSync, readFileSync, watch } from "node:fs";
|
|
2
|
-
import { basename, join } from "node:path";
|
|
3
|
-
import { getPlansDir, getStatusDir,
|
|
2
|
+
import { basename, dirname, join } from "node:path";
|
|
3
|
+
import { getPlansDir, getStatusDir, getHistoryDir, getRuntimeExchangePath } from "./paths.js";
|
|
4
4
|
import { debug } from "./debug.js";
|
|
5
5
|
import { readAllTasks } from "./tasks.js";
|
|
6
6
|
import { listSessionIds, readHistory } from "./context/history.js";
|
|
@@ -92,7 +92,7 @@ export function createBuiltinMetadataWatchers(api) {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
|
-
const taskWatcher = new DirectoryWatcher(
|
|
95
|
+
const taskWatcher = new DirectoryWatcher(dirname(getRuntimeExchangePath()), () => {
|
|
96
96
|
const tasks = readAllTasks();
|
|
97
97
|
const latestBySession = new Map();
|
|
98
98
|
for (const task of tasks) {
|
|
@@ -110,8 +110,8 @@ export function createBuiltinMetadataWatchers(api) {
|
|
|
110
110
|
latestBySession.set(sessionId, { message: `${prefix}: ${task.description}`, tone });
|
|
111
111
|
}
|
|
112
112
|
for (const [sessionId, entry] of latestBySession) {
|
|
113
|
-
metadata.log(sessionId, entry.message, { source: "tasks", tone: entry.tone });
|
|
114
113
|
if (lastTaskBySession.get(sessionId) !== entry.message) {
|
|
114
|
+
metadata.log(sessionId, entry.message, { source: "tasks", tone: entry.tone });
|
|
115
115
|
if (taskWatcherPrimed) {
|
|
116
116
|
metadata.emitEvent(sessionId, {
|
|
117
117
|
kind: entry.tone === "error" ? "task_failed" : entry.tone === "success" ? "task_done" : "task_assigned",
|
|
@@ -175,4 +175,3 @@ export function createBuiltinMetadataWatchers(api) {
|
|
|
175
175
|
debug("registered builtin metadata watchers", "plugin");
|
|
176
176
|
return [planWatcher, statusWatcher, taskWatcher, historyWatcher];
|
|
177
177
|
}
|
|
178
|
-
//# sourceMappingURL=builtin-metadata-watchers.js.map
|
package/dist/claude-hooks.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface ClaudeHookPayload {
|
|
|
9
9
|
}
|
|
10
10
|
export declare function getAimuxCliEntryPath(): string;
|
|
11
11
|
export declare function shouldSkipClaudeSessionIdInjection(args: string[]): boolean;
|
|
12
|
+
export declare function extractClaudeBackendSessionIdFromArgs(args: string[]): string | undefined;
|
|
12
13
|
export declare function buildClaudeHookSettings(opts: {
|
|
13
14
|
sessionId: string;
|
|
14
15
|
projectRoot: string;
|
package/dist/claude-hooks.js
CHANGED
|
@@ -13,6 +13,31 @@ export function shouldSkipClaudeSessionIdInjection(args) {
|
|
|
13
13
|
arg === "--continue" ||
|
|
14
14
|
arg === "-c");
|
|
15
15
|
}
|
|
16
|
+
function isUsableSessionIdArg(value) {
|
|
17
|
+
return Boolean(value?.trim() && !value.trim().startsWith("-"));
|
|
18
|
+
}
|
|
19
|
+
export function extractClaudeBackendSessionIdFromArgs(args) {
|
|
20
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
21
|
+
const arg = args[i];
|
|
22
|
+
if (arg === "--session-id" && isUsableSessionIdArg(args[i + 1])) {
|
|
23
|
+
return args[i + 1].trim();
|
|
24
|
+
}
|
|
25
|
+
if (arg.startsWith("--session-id=")) {
|
|
26
|
+
const value = arg.slice("--session-id=".length);
|
|
27
|
+
if (isUsableSessionIdArg(value))
|
|
28
|
+
return value.trim();
|
|
29
|
+
}
|
|
30
|
+
if (arg === "--resume" && isUsableSessionIdArg(args[i + 1])) {
|
|
31
|
+
return args[i + 1].trim();
|
|
32
|
+
}
|
|
33
|
+
if (arg.startsWith("--resume=")) {
|
|
34
|
+
const value = arg.slice("--resume=".length);
|
|
35
|
+
if (isUsableSessionIdArg(value))
|
|
36
|
+
return value.trim();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
16
41
|
function buildClaudeHookCommand(action, sessionId, projectRoot) {
|
|
17
42
|
return [
|
|
18
43
|
shellQuote(process.execPath),
|
|
@@ -103,4 +128,3 @@ export function summarizeClaudeStop(payload) {
|
|
|
103
128
|
const body = pickString(payload.message, object["summary"], object["message"]) ?? "Claude completed its turn.";
|
|
104
129
|
return { subtitle, body };
|
|
105
130
|
}
|
|
106
|
-
//# sourceMappingURL=claude-hooks.js.map
|
package/dist/config.d.ts
CHANGED
|
@@ -25,29 +25,33 @@ export interface StatuslineConfig {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
export interface RuntimeConfig {
|
|
28
|
-
/** Whether aimux injects automatic session preamble
|
|
28
|
+
/** Whether aimux injects automatic session preamble instructions. */
|
|
29
29
|
agentPreambleEnabled: boolean;
|
|
30
30
|
tmux: TmuxRuntimeConfig;
|
|
31
31
|
}
|
|
32
|
+
export type LogLevel = "error" | "warn" | "info" | "debug" | "trace";
|
|
33
|
+
export interface LoggingConfig {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
level: LogLevel;
|
|
36
|
+
/** Category names to include. "*" includes all categories. */
|
|
37
|
+
categories: string[];
|
|
38
|
+
/** Rotate the active log file after it reaches this size. */
|
|
39
|
+
maxBytes: number;
|
|
40
|
+
/** Number of rotated log files to keep. */
|
|
41
|
+
maxFiles: number;
|
|
42
|
+
}
|
|
32
43
|
export interface AimuxConfig {
|
|
33
44
|
defaultTool: string;
|
|
34
45
|
contextMaxEntries: number;
|
|
35
46
|
liveWindowSize: number;
|
|
36
47
|
compactEveryNTurns: number;
|
|
48
|
+
logging: LoggingConfig;
|
|
37
49
|
notifications: NotificationConfig;
|
|
38
50
|
statusline: StatuslineConfig;
|
|
39
51
|
runtime: RuntimeConfig;
|
|
40
52
|
worktrees: WorktreeConfig;
|
|
41
53
|
tools: Record<string, ToolConfig>;
|
|
42
54
|
}
|
|
43
|
-
export interface SessionCaptureConfig {
|
|
44
|
-
/** Directory to watch for new files. Supports {home}, {yyyy}, {mm}, {dd} */
|
|
45
|
-
dir: string;
|
|
46
|
-
/** Regex to extract session ID from filename */
|
|
47
|
-
pattern: string;
|
|
48
|
-
/** Delay before first check in ms */
|
|
49
|
-
delayMs: number;
|
|
50
|
-
}
|
|
51
55
|
export interface ToolConfig {
|
|
52
56
|
command: string;
|
|
53
57
|
args: string[];
|
|
@@ -67,10 +71,10 @@ export interface ToolConfig {
|
|
|
67
71
|
resumeFallback?: string[];
|
|
68
72
|
/** Flag to set a session ID when starting, with {sessionId} placeholder, e.g. ["--session-id", "{sessionId}"] */
|
|
69
73
|
sessionIdFlag?: string[];
|
|
70
|
-
/**
|
|
71
|
-
sessionCapture?: SessionCaptureConfig;
|
|
72
|
-
/** File to write preamble instructions to (created on start, removed on exit), e.g. "AGENTS.md" */
|
|
74
|
+
/** Optional file to write preamble instructions to; disabled by default to avoid surprise repo edits. */
|
|
73
75
|
instructionsFile?: string;
|
|
76
|
+
/** Codex config key used for durable standing instructions, e.g. "developer_instructions" */
|
|
77
|
+
developerInstructionsConfigKey?: string | null;
|
|
74
78
|
/** Regex patterns that indicate the tool is idle/waiting for input */
|
|
75
79
|
promptPatterns?: string[];
|
|
76
80
|
/** Regex patterns to detect user prompts in terminal output (for turn extraction) */
|
|
@@ -82,7 +86,9 @@ export interface ToolConfig {
|
|
|
82
86
|
* Load config with hierarchy: defaults → global (~/.aimux/config.json) → project (.aimux/config.json)
|
|
83
87
|
* Project settings override global, global overrides defaults.
|
|
84
88
|
*/
|
|
85
|
-
export declare function loadConfig(
|
|
89
|
+
export declare function loadConfig(opts?: {
|
|
90
|
+
includeGlobal?: boolean;
|
|
91
|
+
}): AimuxConfig;
|
|
86
92
|
/** Save config to project-level .aimux/config.json */
|
|
87
93
|
export declare function saveConfig(config: AimuxConfig): void;
|
|
88
94
|
/** Save config to global ~/.aimux/config.json */
|
package/dist/config.js
CHANGED
|
@@ -6,6 +6,13 @@ const DEFAULT_CONFIG = {
|
|
|
6
6
|
contextMaxEntries: 20,
|
|
7
7
|
liveWindowSize: 20,
|
|
8
8
|
compactEveryNTurns: 50,
|
|
9
|
+
logging: {
|
|
10
|
+
enabled: false,
|
|
11
|
+
level: "info",
|
|
12
|
+
categories: ["*"],
|
|
13
|
+
maxBytes: 10_000_000,
|
|
14
|
+
maxFiles: 5,
|
|
15
|
+
},
|
|
9
16
|
notifications: {
|
|
10
17
|
enabled: true,
|
|
11
18
|
onPrompt: true,
|
|
@@ -38,7 +45,7 @@ const DEFAULT_CONFIG = {
|
|
|
38
45
|
preambleFlag: ["--append-system-prompt"],
|
|
39
46
|
sessionIdFlag: ["--session-id", "{sessionId}"],
|
|
40
47
|
resumeArgs: ["--resume", "{sessionId}"],
|
|
41
|
-
resumeByBackendSessionId:
|
|
48
|
+
resumeByBackendSessionId: true,
|
|
42
49
|
resumeFallback: ["--continue"],
|
|
43
50
|
promptPatterns: ["^> $", "\\$ $"],
|
|
44
51
|
turnPatterns: ["^[❯>]\\s*(.+)", "^❯\\s+(.+)", "^>\\s+(.+)"],
|
|
@@ -51,12 +58,7 @@ const DEFAULT_CONFIG = {
|
|
|
51
58
|
resumeArgs: ["resume", "{sessionId}"],
|
|
52
59
|
resumeByBackendSessionId: true,
|
|
53
60
|
resumeFallback: ["resume", "--last"],
|
|
54
|
-
|
|
55
|
-
sessionCapture: {
|
|
56
|
-
dir: "{home}/.codex/sessions/{yyyy}/{mm}/{dd}",
|
|
57
|
-
pattern: "([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\\.jsonl$",
|
|
58
|
-
delayMs: 2000,
|
|
59
|
-
},
|
|
61
|
+
developerInstructionsConfigKey: "developer_instructions",
|
|
60
62
|
promptPatterns: ["^> $"],
|
|
61
63
|
turnPatterns: ["^[>❯]\\s*(.+)"],
|
|
62
64
|
},
|
|
@@ -73,15 +75,30 @@ const DEFAULT_CONFIG = {
|
|
|
73
75
|
function cloneJson(value) {
|
|
74
76
|
return JSON.parse(JSON.stringify(value));
|
|
75
77
|
}
|
|
78
|
+
function hasSessionPlaceholder(args) {
|
|
79
|
+
return Boolean(args?.some((arg) => arg.includes("{sessionId}")));
|
|
80
|
+
}
|
|
81
|
+
function normalizeConfig(config) {
|
|
82
|
+
const claude = config.tools.claude;
|
|
83
|
+
if (claude?.command === "claude" &&
|
|
84
|
+
hasSessionPlaceholder(claude.sessionIdFlag) &&
|
|
85
|
+
hasSessionPlaceholder(claude.resumeArgs)) {
|
|
86
|
+
// Current Claude Code supports pairing --session-id with --resume <id>.
|
|
87
|
+
// Treat older generated configs that set this false as stale rather than
|
|
88
|
+
// silently launching a fresh Claude under an existing aimux row.
|
|
89
|
+
claude.resumeByBackendSessionId = true;
|
|
90
|
+
}
|
|
91
|
+
return config;
|
|
92
|
+
}
|
|
76
93
|
/**
|
|
77
94
|
* Load config with hierarchy: defaults → global (~/.aimux/config.json) → project (.aimux/config.json)
|
|
78
95
|
* Project settings override global, global overrides defaults.
|
|
79
96
|
*/
|
|
80
|
-
export function loadConfig() {
|
|
97
|
+
export function loadConfig(opts = {}) {
|
|
81
98
|
let config = cloneJson(DEFAULT_CONFIG);
|
|
82
99
|
// Layer 1: global config
|
|
83
100
|
const globalPath = getGlobalConfigPath();
|
|
84
|
-
if (existsSync(globalPath)) {
|
|
101
|
+
if (opts.includeGlobal !== false && existsSync(globalPath)) {
|
|
85
102
|
try {
|
|
86
103
|
const globalRaw = JSON.parse(readFileSync(globalPath, "utf-8"));
|
|
87
104
|
config = deepMerge(config, globalRaw);
|
|
@@ -97,7 +114,7 @@ export function loadConfig() {
|
|
|
97
114
|
}
|
|
98
115
|
catch { }
|
|
99
116
|
}
|
|
100
|
-
return config;
|
|
117
|
+
return normalizeConfig(config);
|
|
101
118
|
}
|
|
102
119
|
/** Save config to project-level .aimux/config.json */
|
|
103
120
|
export function saveConfig(config) {
|
|
@@ -115,11 +132,8 @@ export function saveGlobalConfig(config) {
|
|
|
115
132
|
}
|
|
116
133
|
writeFileSync(getGlobalConfigPath(), JSON.stringify(config, null, 2) + "\n");
|
|
117
134
|
}
|
|
118
|
-
const GITIGNORE_CONTENTS = `# Runtime-private
|
|
135
|
+
const GITIGNORE_CONTENTS = `# Runtime-private service/project state (lives in ~/.aimux/projects/)
|
|
119
136
|
state.json
|
|
120
|
-
graveyard.json
|
|
121
|
-
sessions.json
|
|
122
|
-
instances.json
|
|
123
137
|
|
|
124
138
|
# Agent-facing shared artifacts
|
|
125
139
|
context/
|
|
@@ -178,4 +192,3 @@ function deepMerge(a, b) {
|
|
|
178
192
|
}
|
|
179
193
|
return result;
|
|
180
194
|
}
|
|
181
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function isDevelopmentRuntime(): boolean;
|
|
2
|
+
export declare function resolveWebAppUrl(override?: string): string;
|
|
3
|
+
export declare function resolveRelayUrl(): string;
|
|
4
|
+
export declare const CONNECTION_TARGET_DEFAULTS: {
|
|
5
|
+
readonly prodWebAppUrl: "https://aimux.app";
|
|
6
|
+
readonly prodRelayUrl: "wss://relay.aimux.app";
|
|
7
|
+
readonly devWebAppUrl: "http://localhost:8081";
|
|
8
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const PROD_WEB_APP_URL = "https://aimux.app";
|
|
2
|
+
const PROD_RELAY_URL = "wss://relay.aimux.app";
|
|
3
|
+
const DEV_WEB_APP_URL = "http://localhost:8081";
|
|
4
|
+
function cleanUrl(value) {
|
|
5
|
+
return value.replace(/\/$/, "");
|
|
6
|
+
}
|
|
7
|
+
function optionalEnv(value) {
|
|
8
|
+
const trimmed = value?.trim();
|
|
9
|
+
return trimmed ? trimmed : undefined;
|
|
10
|
+
}
|
|
11
|
+
export function isDevelopmentRuntime() {
|
|
12
|
+
return process.env.AIMUX_ENV === "development";
|
|
13
|
+
}
|
|
14
|
+
export function resolveWebAppUrl(override) {
|
|
15
|
+
const value = optionalEnv(override) ??
|
|
16
|
+
optionalEnv(process.env.AIMUX_WEB_APP_URL) ??
|
|
17
|
+
(isDevelopmentRuntime() ? DEV_WEB_APP_URL : PROD_WEB_APP_URL);
|
|
18
|
+
return cleanUrl(value);
|
|
19
|
+
}
|
|
20
|
+
export function resolveRelayUrl() {
|
|
21
|
+
return cleanUrl(optionalEnv(process.env.AIMUX_RELAY_URL) ?? PROD_RELAY_URL);
|
|
22
|
+
}
|
|
23
|
+
export const CONNECTION_TARGET_DEFAULTS = {
|
|
24
|
+
prodWebAppUrl: PROD_WEB_APP_URL,
|
|
25
|
+
prodRelayUrl: PROD_RELAY_URL,
|
|
26
|
+
devWebAppUrl: DEV_WEB_APP_URL,
|
|
27
|
+
};
|
package/dist/context/history.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface AimuxCredentials {
|
|
2
|
+
version: 1;
|
|
3
|
+
relayUrl: string;
|
|
4
|
+
token: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
remoteEnabled: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function loadCredentials(): AimuxCredentials | null;
|
|
10
|
+
export declare function saveCredentials(creds: AimuxCredentials): void;
|
|
11
|
+
export declare function clearCredentials(): "cleared" | "none" | "failed";
|
|
12
|
+
export declare function setRemoteEnabled(enabled: boolean): AimuxCredentials | null;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Stored CLI credentials for relay access (`~/.aimux/auth.json`).
|
|
2
|
+
//
|
|
3
|
+
// Populated by `aimux login` (browser flow). The daemon reads this to connect
|
|
4
|
+
// to the relay. The token is a long-lived relay-signed JWT — not a Clerk
|
|
5
|
+
// session token — so it survives daemon restarts and runs for ~90 days.
|
|
6
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync, rmSync, chmodSync } from "node:fs";
|
|
7
|
+
import { dirname } from "node:path";
|
|
8
|
+
import { getAuthPath } from "./paths.js";
|
|
9
|
+
export function loadCredentials() {
|
|
10
|
+
const path = getAuthPath();
|
|
11
|
+
if (!existsSync(path))
|
|
12
|
+
return null;
|
|
13
|
+
try {
|
|
14
|
+
const parsed = JSON.parse(readFileSync(path, "utf-8"));
|
|
15
|
+
if (parsed.version !== 1 || !parsed.token || !parsed.relayUrl)
|
|
16
|
+
return null;
|
|
17
|
+
return parsed;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export function saveCredentials(creds) {
|
|
24
|
+
const path = getAuthPath();
|
|
25
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
26
|
+
writeFileSync(path, `${JSON.stringify(creds, null, 2)}\n`, { mode: 0o600 });
|
|
27
|
+
chmodSync(path, 0o600);
|
|
28
|
+
}
|
|
29
|
+
export function clearCredentials() {
|
|
30
|
+
const path = getAuthPath();
|
|
31
|
+
if (!existsSync(path))
|
|
32
|
+
return "none";
|
|
33
|
+
try {
|
|
34
|
+
rmSync(path, { force: true });
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return "failed";
|
|
38
|
+
}
|
|
39
|
+
return "cleared";
|
|
40
|
+
}
|
|
41
|
+
export function setRemoteEnabled(enabled) {
|
|
42
|
+
const creds = loadCredentials();
|
|
43
|
+
if (!creds)
|
|
44
|
+
return null;
|
|
45
|
+
const next = { ...creds, remoteEnabled: enabled };
|
|
46
|
+
saveCredentials(next);
|
|
47
|
+
return next;
|
|
48
|
+
}
|
package/dist/daemon.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { type RelayStatusSnapshot } from "./relay-client.js";
|
|
2
|
+
export declare function getDaemonHost(): string;
|
|
3
|
+
export declare function getDaemonPort(): number;
|
|
1
4
|
export interface AimuxDaemonInfo {
|
|
2
5
|
pid: number;
|
|
3
6
|
port: number;
|
|
@@ -26,14 +29,34 @@ export declare function stopProjectService(projectRoot: string): Promise<Project
|
|
|
26
29
|
export declare function projectServiceStatus(projectRoot: string): Promise<ProjectServiceState | null>;
|
|
27
30
|
export declare class AimuxDaemon {
|
|
28
31
|
private server;
|
|
32
|
+
private relayClient;
|
|
29
33
|
private readonly children;
|
|
34
|
+
private readonly projectEnsurePromises;
|
|
30
35
|
private state;
|
|
31
36
|
start(): Promise<void>;
|
|
37
|
+
private connectRelayIfConfigured;
|
|
38
|
+
getRelayStatus(): RelayStatusSnapshot | {
|
|
39
|
+
status: "off";
|
|
40
|
+
};
|
|
41
|
+
enableRelay(): RelayStatusSnapshot | {
|
|
42
|
+
status: "off";
|
|
43
|
+
};
|
|
44
|
+
disableRelay(): {
|
|
45
|
+
status: "off";
|
|
46
|
+
};
|
|
32
47
|
stop(): void;
|
|
33
48
|
private refreshState;
|
|
34
49
|
private spawnProjectService;
|
|
35
50
|
private ensureProject;
|
|
51
|
+
private ensureProjectUnlocked;
|
|
52
|
+
private replaceProjectServiceAfterExit;
|
|
53
|
+
private terminateProjectService;
|
|
54
|
+
private waitForProjectServiceExit;
|
|
36
55
|
private stopProject;
|
|
56
|
+
routeRequest(method: string, path: string, body?: unknown, headers?: Record<string, string>): Promise<{
|
|
57
|
+
status: number;
|
|
58
|
+
body: unknown;
|
|
59
|
+
}>;
|
|
37
60
|
private handle;
|
|
38
61
|
}
|
|
39
62
|
export {};
|