@aria-cli/cli 1.0.57 → 1.0.59
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/bin/aria.mjs +799 -668
- package/package.json +17 -76
- package/dist/.tsbuildinfo +0 -1
- package/dist/attached-local-control-client.js +0 -826
- package/dist/bootstrap-local-control-client.js +0 -2
- package/dist/capability-aware-method-proxy.js +0 -42
- package/dist/cli-context.js +0 -160
- package/dist/commands/arions.js +0 -174
- package/dist/commands/auth.js +0 -123
- package/dist/commands/daemon.js +0 -367
- package/dist/commands/definitions.js +0 -176
- package/dist/commands/index.js +0 -80
- package/dist/commands/login-handler.js +0 -1108
- package/dist/commands/logout-handler.js +0 -92
- package/dist/commands/memory-handlers.js +0 -89
- package/dist/commands/pairing.js +0 -60
- package/dist/commands/runtime-cutover-reset-command.js +0 -12
- package/dist/commands/runtime-cutover-reset.js +0 -265
- package/dist/commands/terminal-setup.js +0 -84
- package/dist/config/aria-config.js +0 -238
- package/dist/config/index.js +0 -3
- package/dist/config/loader.js +0 -97
- package/dist/config.js +0 -142
- package/dist/daemon-info.js +0 -10
- package/dist/ensure-daemon.js +0 -128
- package/dist/entrypoints/command-mode.js +0 -5
- package/dist/entrypoints/daemon.js +0 -50
- package/dist/entrypoints/headless-stdio.js +0 -25
- package/dist/entrypoints/interactive.js +0 -80
- package/dist/event-loop-watchdog.js +0 -73
- package/dist/headless/auth-orchestrator.js +0 -508
- package/dist/headless/auth-service.js +0 -43
- package/dist/headless/bootstrap-fast-path.js +0 -112
- package/dist/headless/call-command.js +0 -143
- package/dist/headless/daemon-service.js +0 -318
- package/dist/headless/hook-actions.js +0 -235
- package/dist/headless/hook-service.js +0 -42
- package/dist/headless/kernel-services.js +0 -216
- package/dist/headless/kernel.js +0 -785
- package/dist/headless/operations/arion.js +0 -119
- package/dist/headless/operations/auth.js +0 -45
- package/dist/headless/operations/client.js +0 -31
- package/dist/headless/operations/config.js +0 -69
- package/dist/headless/operations/daemon.js +0 -47
- package/dist/headless/operations/hook.js +0 -56
- package/dist/headless/operations/index.js +0 -11
- package/dist/headless/operations/memory.js +0 -102
- package/dist/headless/operations/message.js +0 -279
- package/dist/headless/operations/model.js +0 -100
- package/dist/headless/operations/peer.js +0 -56
- package/dist/headless/operations/run.js +0 -24
- package/dist/headless/operations/session.js +0 -90
- package/dist/headless/operations/system.js +0 -19
- package/dist/headless/operations/utils.js +0 -35
- package/dist/headless/run-orchestrator.js +0 -703
- package/dist/headless/stdio-server.js +0 -439
- package/dist/history/SessionHistory.js +0 -8
- package/dist/history/SessionHistoryClient.js +0 -186
- package/dist/history/conversation-message.js +0 -112
- package/dist/history/index.js +0 -8
- package/dist/history/jsonl-replay.js +0 -154
- package/dist/history/repair-tool-pairing.js +0 -84
- package/dist/history/stall-phase-bridge.js +0 -11
- package/dist/history/turn-accumulator.js +0 -427
- package/dist/index.js +0 -7
- package/dist/ink-repl.js +0 -4183
- package/dist/local-control-bootstrap.js +0 -26
- package/dist/local-control-client.js +0 -2
- package/dist/local-control-error-reporting.js +0 -34
- package/dist/local-control-http-client.js +0 -362
- package/dist/local-control-lazy-wrapper.js +0 -363
- package/dist/local-control-manager.js +0 -146
- package/dist/main.js +0 -62
- package/dist/network-security.js +0 -62
- package/dist/networking-server.js +0 -38
- package/dist/peer-identity.js +0 -23
- package/dist/polling-subscription.js +0 -34
- package/dist/relaunch.js +0 -617
- package/dist/release-notes.js +0 -35
- package/dist/repl-cleanup.js +0 -47
- package/dist/runtime/configure-bun-sqlite.js +0 -3
- package/dist/runtime/crash-handlers.js +0 -111
- package/dist/runtime/interactive-invocation.js +0 -39
- package/dist/runtime/internal-mode.js +0 -14
- package/dist/runtime/launch-spec.js +0 -64
- package/dist/runtime/owner-lease.js +0 -44
- package/dist/runtime/public-mode.js +0 -20
- package/dist/runtime/run-internal-mode.js +0 -18
- package/dist/runtime/runtime-kind.js +0 -32
- package/dist/runtime/spawn-aria.js +0 -38
- package/dist/selectable-client.js +0 -2
- package/dist/selectable-peer.js +0 -2
- package/dist/session.js +0 -203
- package/dist/slash-commands.js +0 -80
- package/dist/sounds.js +0 -210
- package/dist/ui/App.js +0 -526
- package/dist/ui/components/AnthropicMethodPicker.js +0 -6
- package/dist/ui/components/ArionPrompt.js +0 -15
- package/dist/ui/components/AutocompleteDropdown.js +0 -23
- package/dist/ui/components/AutonomySelector.js +0 -55
- package/dist/ui/components/Banner.js +0 -98
- package/dist/ui/components/ConversationHistory.js +0 -175
- package/dist/ui/components/CopilotDeviceLoginFlow.js +0 -88
- package/dist/ui/components/CopilotSourcePicker.js +0 -50
- package/dist/ui/components/Cost.js +0 -10
- package/dist/ui/components/CustomSelect/option-map.js +0 -30
- package/dist/ui/components/CustomSelect/select-option.js +0 -13
- package/dist/ui/components/CustomSelect/select.js +0 -42
- package/dist/ui/components/CustomSelect/use-select-state.js +0 -179
- package/dist/ui/components/CustomSelect/use-select.js +0 -15
- package/dist/ui/components/ErrorDisplay.js +0 -35
- package/dist/ui/components/FallbackToolUseRejectedMessage.js +0 -7
- package/dist/ui/components/FileEditToolUpdatedMessage.js +0 -57
- package/dist/ui/components/HandoffMarker.js +0 -18
- package/dist/ui/components/HighlightedCode.js +0 -21
- package/dist/ui/components/InputArea.js +0 -187
- package/dist/ui/components/Message.js +0 -25
- package/dist/ui/components/OAuthLoginFlow.js +0 -113
- package/dist/ui/components/OutputTruncation.js +0 -35
- package/dist/ui/components/PermissionPrompt.js +0 -79
- package/dist/ui/components/PipelineTimingPanel.js +0 -15
- package/dist/ui/components/ProviderMethodPicker.js +0 -61
- package/dist/ui/components/ProviderPicker.js +0 -63
- package/dist/ui/components/RenderItemView.js +0 -71
- package/dist/ui/components/Spinner.js +0 -46
- package/dist/ui/components/StatusBar.js +0 -95
- package/dist/ui/components/StreamingIndicator.js +0 -55
- package/dist/ui/components/StructuredDiff.js +0 -168
- package/dist/ui/components/TextInputOverlay.js +0 -43
- package/dist/ui/components/ThinkingBlock.js +0 -82
- package/dist/ui/components/ToolCost.js +0 -17
- package/dist/ui/components/ToolExecution.js +0 -61
- package/dist/ui/components/ToolHeader.js +0 -51
- package/dist/ui/components/ToolRenderLayoutContext.js +0 -14
- package/dist/ui/components/ToolResultWrapper.js +0 -6
- package/dist/ui/components/ToolUseLoader.js +0 -35
- package/dist/ui/components/TraceWaterfall.js +0 -91
- package/dist/ui/components/index.js +0 -33
- package/dist/ui/components/messages/AssistantTextMessage.js +0 -25
- package/dist/ui/components/messages/UserImageMessage.js +0 -12
- package/dist/ui/components/messages/UserTextMessage.js +0 -12
- package/dist/ui/components/overlays/ArionSelector.js +0 -68
- package/dist/ui/components/overlays/ClientSelector.js +0 -62
- package/dist/ui/components/overlays/CommandPalette.js +0 -67
- package/dist/ui/components/overlays/DaemonControl.js +0 -87
- package/dist/ui/components/overlays/InviteShareOverlay.js +0 -15
- package/dist/ui/components/overlays/JoinInviteOverlay.js +0 -32
- package/dist/ui/components/overlays/MemoryBrowser.js +0 -100
- package/dist/ui/components/overlays/MessageSelector.js +0 -123
- package/dist/ui/components/overlays/ModelSelector.js +0 -211
- package/dist/ui/components/overlays/PairRequestOverlay.js +0 -42
- package/dist/ui/components/overlays/PeerSelector.js +0 -84
- package/dist/ui/components/overlays/SessionSelector.js +0 -102
- package/dist/ui/components/overlays/SoundSelector.js +0 -86
- package/dist/ui/components/overlays/ThemeSelector.js +0 -139
- package/dist/ui/components/overlays/index.js +0 -15
- package/dist/ui/components/permissions/BashPermissionRequest/BashPermissionRequest.js +0 -53
- package/dist/ui/components/permissions/FallbackPermissionRequest.js +0 -56
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +0 -76
- package/dist/ui/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +0 -18
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +0 -64
- package/dist/ui/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +0 -26
- package/dist/ui/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +0 -141
- package/dist/ui/components/permissions/PermissionRequest.js +0 -70
- package/dist/ui/components/permissions/PermissionRequestTitle.js +0 -41
- package/dist/ui/components/permissions/hooks.js +0 -10
- package/dist/ui/components/permissions/toolUseOptions.js +0 -68
- package/dist/ui/components/permissions/utils.js +0 -10
- package/dist/ui/components/text-input/Cursor.js +0 -326
- package/dist/ui/components/text-input/TextInput.js +0 -231
- package/dist/ui/components/text-input/imagePaste.js +0 -28
- package/dist/ui/components/text-input/index.js +0 -6
- package/dist/ui/components/text-input/useDoublePress.js +0 -30
- package/dist/ui/components/text-input/useTextInput.js +0 -245
- package/dist/ui/components/tool-types.js +0 -9
- package/dist/ui/constants/figures.js +0 -4
- package/dist/ui/constants/index.js +0 -3
- package/dist/ui/display-mode.js +0 -93
- package/dist/ui/display-policy.js +0 -19
- package/dist/ui/hooks/index.js +0 -6
- package/dist/ui/hooks/useCommandAutocomplete.js +0 -93
- package/dist/ui/hooks/useDoublePress.js +0 -37
- package/dist/ui/hooks/useIndicatorState.js +0 -55
- package/dist/ui/hooks/useInterval.js +0 -23
- package/dist/ui/hooks/useKeyboardShortcuts.js +0 -127
- package/dist/ui/hooks/useTerminalSize.js +0 -55
- package/dist/ui/hooks/useUnifiedMessages.js +0 -117
- package/dist/ui/indicator-state.js +0 -44
- package/dist/ui/markdown/highlight.js +0 -44
- package/dist/ui/markdown/index.js +0 -1460
- package/dist/ui/markdown/tokenizer.js +0 -24
- package/dist/ui/render-item.js +0 -5
- package/dist/ui/screens/REPL.js +0 -119
- package/dist/ui/screens/approval-lifecycle.js +0 -38
- package/dist/ui/status-line.js +0 -72
- package/dist/ui/theme/index.js +0 -51
- package/dist/ui/theme/themes/claude-dark-daltonized.js +0 -51
- package/dist/ui/theme/themes/claude-dark.js +0 -50
- package/dist/ui/theme/themes/claude-light-daltonized.js +0 -51
- package/dist/ui/theme/themes/claude-light.js +0 -50
- package/dist/ui/theme/themes/dark-accessible.js +0 -18
- package/dist/ui/theme/themes/dark.js +0 -49
- package/dist/ui/theme/themes/light-accessible.js +0 -18
- package/dist/ui/theme/themes/light.js +0 -49
- package/dist/ui/theme/types.js +0 -3
- package/dist/ui/theme.js +0 -142
- package/dist/ui/to-render-items.js +0 -145
- package/dist/ui/tools/AgentTool/index.js +0 -30
- package/dist/ui/tools/ArchitectTool/index.js +0 -31
- package/dist/ui/tools/AskUserTool/index.js +0 -46
- package/dist/ui/tools/BashTool/BashToolResultMessage.js +0 -11
- package/dist/ui/tools/BashTool/OutputLine.js +0 -21
- package/dist/ui/tools/BashTool/index.js +0 -91
- package/dist/ui/tools/BrowseTool/index.js +0 -43
- package/dist/ui/tools/BrowserTool/index.js +0 -47
- package/dist/ui/tools/CbmTool/index.js +0 -188
- package/dist/ui/tools/CheckDelegationTool/index.js +0 -46
- package/dist/ui/tools/CheckMessagesTool/index.js +0 -85
- package/dist/ui/tools/CreateQuipTool/index.js +0 -30
- package/dist/ui/tools/CreateSkillTool/index.js +0 -22
- package/dist/ui/tools/CreateToolTool/index.js +0 -31
- package/dist/ui/tools/DelegateRemoteTool/index.js +0 -42
- package/dist/ui/tools/DeployTool/index.js +0 -47
- package/dist/ui/tools/FffTool/index.js +0 -103
- package/dist/ui/tools/FileEditTool/index.js +0 -67
- package/dist/ui/tools/FileReadTool/index.js +0 -68
- package/dist/ui/tools/FileWriteTool/index.js +0 -61
- package/dist/ui/tools/ForkTool/index.js +0 -47
- package/dist/ui/tools/FrgTool/index.js +0 -96
- package/dist/ui/tools/GetThreadTool/index.js +0 -39
- package/dist/ui/tools/GlobTool/index.js +0 -50
- package/dist/ui/tools/GrepTool/index.js +0 -84
- package/dist/ui/tools/HatchArionTool/index.js +0 -36
- package/dist/ui/tools/LearnSkillTool/index.js +0 -22
- package/dist/ui/tools/LearnTool/index.js +0 -43
- package/dist/ui/tools/LearnToolTool/index.js +0 -22
- package/dist/ui/tools/ListClientsTool/index.js +0 -39
- package/dist/ui/tools/LspTool/index.js +0 -261
- package/dist/ui/tools/MCPTool/index.js +0 -33
- package/dist/ui/tools/ManageNetworkTool/index.js +0 -53
- package/dist/ui/tools/MemoryReadTool/index.js +0 -64
- package/dist/ui/tools/MemoryWriteTool/index.js +0 -20
- package/dist/ui/tools/NotebookEditTool/index.js +0 -33
- package/dist/ui/tools/NotebookReadTool/index.js +0 -25
- package/dist/ui/tools/OutlookReadTool/index.js +0 -66
- package/dist/ui/tools/OutlookReplyTool/index.js +0 -49
- package/dist/ui/tools/OutlookSendTool/index.js +0 -49
- package/dist/ui/tools/PauseDelegationTool/index.js +0 -35
- package/dist/ui/tools/ProbeTool/index.js +0 -121
- package/dist/ui/tools/ProcessTool/index.js +0 -66
- package/dist/ui/tools/QuestListTool/index.js +0 -46
- package/dist/ui/tools/QuestReportTool/index.js +0 -49
- package/dist/ui/tools/QuestUpdateTool/index.js +0 -87
- package/dist/ui/tools/QuipCommentTool/index.js +0 -69
- package/dist/ui/tools/QuipReadTool/index.js +0 -71
- package/dist/ui/tools/RestArionTool/index.js +0 -32
- package/dist/ui/tools/RestartTool/index.js +0 -35
- package/dist/ui/tools/ResumeDelegationTool/index.js +0 -35
- package/dist/ui/tools/RetireArionTool/index.js +0 -32
- package/dist/ui/tools/RgTool/index.js +0 -73
- package/dist/ui/tools/SearchKnowledgeTool/index.js +0 -43
- package/dist/ui/tools/SearchMessagesTool/index.js +0 -43
- package/dist/ui/tools/SelfDiagnoseTool/index.js +0 -61
- package/dist/ui/tools/SendMessageTool/index.js +0 -45
- package/dist/ui/tools/SerenaTool/index.js +0 -124
- package/dist/ui/tools/SessionHistoryTool/index.js +0 -52
- package/dist/ui/tools/SgTool/index.js +0 -80
- package/dist/ui/tools/SlackReactTool/index.js +0 -41
- package/dist/ui/tools/SlackReadTool/index.js +0 -48
- package/dist/ui/tools/SlackSendTool/index.js +0 -45
- package/dist/ui/tools/SpawnWorkerTool/index.js +0 -33
- package/dist/ui/tools/StickerRequestTool/index.js +0 -19
- package/dist/ui/tools/ThinkTool/index.js +0 -17
- package/dist/ui/tools/UgTool/index.js +0 -108
- package/dist/ui/tools/UseSkillTool/index.js +0 -22
- package/dist/ui/tools/WakeArionTool/index.js +0 -32
- package/dist/ui/tools/WebFetchTool/index.js +0 -56
- package/dist/ui/tools/WebSearchTool/index.js +0 -44
- package/dist/ui/tools/lsTool/index.js +0 -58
- package/dist/ui/tools/registry.js +0 -197
- package/dist/ui/tools/tool-renderer.js +0 -11
- package/dist/ui/tools/truncation.js +0 -35
- package/dist/ui/types/anthropic.js +0 -4
- package/dist/ui/types/index.js +0 -2
- package/dist/ui/types/message.js +0 -3
- package/dist/ui/types/tool.js +0 -4
- package/dist/ui/utils/array.js +0 -4
- package/dist/ui/utils/cursor.js +0 -131
- package/dist/ui/utils/diff.js +0 -120
- package/dist/ui/utils/format.js +0 -42
- package/dist/ui/utils/fuzzy.js +0 -59
- package/dist/ui/utils/index.js +0 -11
- package/dist/ui/utils/keys.js +0 -8
- package/dist/ui/utils/patch.js +0 -17
- package/dist/ui/utils/risk.js +0 -114
- package/dist/ui/utils/terminal-image.js +0 -70
- package/dist/ui/utils/validation.js +0 -48
- package/dist/ui/verb-pairs.js +0 -248
- package/dist/ui.js +0 -131
- package/src/entrypoints/command-mode.ts +0 -5
- package/src/entrypoints/daemon.ts +0 -54
- package/src/entrypoints/headless-stdio.ts +0 -27
- package/src/entrypoints/interactive.ts +0 -112
- package/src/main.ts +0 -72
- package/src/runtime/configure-bun-sqlite.ts +0 -3
- package/src/runtime/crash-handlers.ts +0 -128
- package/src/runtime/interactive-invocation.test.ts +0 -42
- package/src/runtime/interactive-invocation.ts +0 -51
- package/src/runtime/internal-mode.test.ts +0 -19
- package/src/runtime/internal-mode.ts +0 -24
- package/src/runtime/launch-spec.test.ts +0 -26
- package/src/runtime/launch-spec.ts +0 -84
- package/src/runtime/owner-lease.ts +0 -52
- package/src/runtime/public-mode.test.ts +0 -18
- package/src/runtime/public-mode.ts +0 -19
- package/src/runtime/run-internal-mode.ts +0 -19
- package/src/runtime/runtime-kind.test.ts +0 -23
- package/src/runtime/runtime-kind.ts +0 -41
- package/src/runtime/spawn-aria.ts +0 -62
package/dist/commands/daemon.js
DELETED
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Daemon command - monitor-style projection over the shared daemon service.
|
|
3
|
-
*
|
|
4
|
-
* The CLI wrapper only parses options, starts/stops the daemon via the
|
|
5
|
-
* canonical `daemon.*` service, prints human status lines, and stays resident
|
|
6
|
-
* until interrupted. It must not own runtime bootstrap semantics directly.
|
|
7
|
-
*/
|
|
8
|
-
import * as fs from "node:fs";
|
|
9
|
-
import * as path from "node:path";
|
|
10
|
-
import { createCliContext } from "../cli-context.js";
|
|
11
|
-
import { loadConfig } from "../config.js";
|
|
12
|
-
import { createDaemonService } from "../headless/daemon-service.js";
|
|
13
|
-
function formatStorageDiagnostics(storage) {
|
|
14
|
-
if (!storage || typeof storage !== "object") {
|
|
15
|
-
return [];
|
|
16
|
-
}
|
|
17
|
-
const lines = [];
|
|
18
|
-
const storageRecord = storage;
|
|
19
|
-
for (const [label, raw] of Object.entries(storageRecord)) {
|
|
20
|
-
if (!raw || typeof raw !== "object")
|
|
21
|
-
continue;
|
|
22
|
-
const value = raw;
|
|
23
|
-
const parts = [
|
|
24
|
-
`backend=${String(value.backend ?? "unknown")}`,
|
|
25
|
-
`extensions=${String(value.loadableExtensions ?? false)}`,
|
|
26
|
-
`customSQLite=${String(value.customSQLiteConfigured ?? false)}`,
|
|
27
|
-
];
|
|
28
|
-
if (typeof value.sqliteVec === "boolean") {
|
|
29
|
-
parts.push(`sqliteVec=${String(value.sqliteVec)}`);
|
|
30
|
-
}
|
|
31
|
-
if (typeof value.vectorSearchMode === "string") {
|
|
32
|
-
parts.push(`vectorMode=${value.vectorSearchMode}`);
|
|
33
|
-
}
|
|
34
|
-
if (typeof value.customSQLitePath === "string") {
|
|
35
|
-
parts.push(`sqlitePath=${value.customSQLitePath}`);
|
|
36
|
-
}
|
|
37
|
-
lines.push(`[daemon] storage.${label} ${parts.join(" · ")}`);
|
|
38
|
-
}
|
|
39
|
-
return lines;
|
|
40
|
-
}
|
|
41
|
-
function parsePositiveInt(raw, field, fallback) {
|
|
42
|
-
if (raw === undefined || raw.trim() === "")
|
|
43
|
-
return fallback;
|
|
44
|
-
const value = Number.parseInt(raw, 10);
|
|
45
|
-
if (!Number.isFinite(value) || value <= 0) {
|
|
46
|
-
throw new Error(`${field} must be a positive integer`);
|
|
47
|
-
}
|
|
48
|
-
return value;
|
|
49
|
-
}
|
|
50
|
-
function parseCsv(raw) {
|
|
51
|
-
if (!raw)
|
|
52
|
-
return undefined;
|
|
53
|
-
const values = raw
|
|
54
|
-
.split(",")
|
|
55
|
-
.map((entry) => entry.trim())
|
|
56
|
-
.filter((entry) => entry.length > 0);
|
|
57
|
-
return values.length > 0 ? values : undefined;
|
|
58
|
-
}
|
|
59
|
-
function parsePort(raw, fallback) {
|
|
60
|
-
if (raw === undefined || raw.trim() === "")
|
|
61
|
-
return fallback;
|
|
62
|
-
const value = Number.parseInt(raw, 10);
|
|
63
|
-
if (!Number.isFinite(value) || value < 0) {
|
|
64
|
-
throw new Error("port must be a non-negative integer (0 = OS-assigned)");
|
|
65
|
-
}
|
|
66
|
-
return value;
|
|
67
|
-
}
|
|
68
|
-
function parseDaemonOptions(options) {
|
|
69
|
-
return {
|
|
70
|
-
arion: options.arion,
|
|
71
|
-
port: parsePort(options.port, 0),
|
|
72
|
-
intervalMs: parsePositiveInt(options.intervalMs, "intervalMs", 60_000),
|
|
73
|
-
allowedToolCategories: parseCsv(options.allowedToolCategories),
|
|
74
|
-
allowedShellCommands: parseCsv(options.allowedShellCommands),
|
|
75
|
-
maxWriteOpsPerMinute: options.maxWriteOpsPerMinute !== undefined
|
|
76
|
-
? parsePositiveInt(options.maxWriteOpsPerMinute, "maxWriteOpsPerMinute", 30)
|
|
77
|
-
: undefined,
|
|
78
|
-
maxGitPushesPerHour: options.maxGitPushesPerHour !== undefined
|
|
79
|
-
? parsePositiveInt(options.maxGitPushesPerHour, "maxGitPushesPerHour", 5)
|
|
80
|
-
: undefined,
|
|
81
|
-
foreground: options.foreground === true,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
function waitForAbort(signal) {
|
|
85
|
-
if (signal.aborted)
|
|
86
|
-
return Promise.resolve();
|
|
87
|
-
return new Promise((resolve) => {
|
|
88
|
-
signal.addEventListener("abort", () => resolve(), { once: true });
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
function toDaemonInput(options) {
|
|
92
|
-
return {
|
|
93
|
-
...(options.arion ? { arion: options.arion } : {}),
|
|
94
|
-
...(options.port >= 0 ? { port: options.port } : {}),
|
|
95
|
-
intervalMs: options.intervalMs,
|
|
96
|
-
...(options.allowedToolCategories
|
|
97
|
-
? { allowedToolCategories: options.allowedToolCategories }
|
|
98
|
-
: {}),
|
|
99
|
-
...(options.allowedShellCommands ? { allowedShellCommands: options.allowedShellCommands } : {}),
|
|
100
|
-
...(typeof options.maxWriteOpsPerMinute === "number"
|
|
101
|
-
? { maxWriteOpsPerMinute: options.maxWriteOpsPerMinute }
|
|
102
|
-
: {}),
|
|
103
|
-
...(typeof options.maxGitPushesPerHour === "number"
|
|
104
|
-
? { maxGitPushesPerHour: options.maxGitPushesPerHour }
|
|
105
|
-
: {}),
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
export function buildSafetyPolicy(options) {
|
|
109
|
-
const policy = {};
|
|
110
|
-
if (options.allowedToolCategories) {
|
|
111
|
-
policy.allowedToolCategories = options.allowedToolCategories;
|
|
112
|
-
}
|
|
113
|
-
if (options.allowedShellCommands) {
|
|
114
|
-
policy.allowedShellCommands = options.allowedShellCommands;
|
|
115
|
-
}
|
|
116
|
-
if (typeof options.maxWriteOpsPerMinute === "number") {
|
|
117
|
-
policy.maxWriteOpsPerMinute = options.maxWriteOpsPerMinute;
|
|
118
|
-
}
|
|
119
|
-
if (typeof options.maxGitPushesPerHour === "number") {
|
|
120
|
-
policy.maxGitPushesPerHour = options.maxGitPushesPerHour;
|
|
121
|
-
}
|
|
122
|
-
return policy;
|
|
123
|
-
}
|
|
124
|
-
export async function runDaemonFromCli(options = {}) {
|
|
125
|
-
const parsed = parseDaemonOptions(options);
|
|
126
|
-
await runDaemon(parsed);
|
|
127
|
-
}
|
|
128
|
-
export async function stopDaemonFromCli() {
|
|
129
|
-
const { resolveRuntimeRootDirectory, findRuntimeOwnerRecordByAriaHome, removeRuntimeOwnerRecord, } = await import("@aria-cli/server");
|
|
130
|
-
const { getAriaDir } = await import("../config.js");
|
|
131
|
-
const ariaHome = getAriaDir();
|
|
132
|
-
const runtimeRoot = resolveRuntimeRootDirectory();
|
|
133
|
-
const owner = findRuntimeOwnerRecordByAriaHome(runtimeRoot, ariaHome);
|
|
134
|
-
if (!owner) {
|
|
135
|
-
console.log("[daemon] no running daemon found");
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
try {
|
|
139
|
-
process.kill(owner.runtimePid, "SIGINT");
|
|
140
|
-
console.log(`[daemon] sent SIGINT to pid ${owner.runtimePid}`);
|
|
141
|
-
// Wait for process to exit
|
|
142
|
-
const deadline = Date.now() + 5_000;
|
|
143
|
-
while (Date.now() < deadline) {
|
|
144
|
-
try {
|
|
145
|
-
process.kill(owner.runtimePid, 0);
|
|
146
|
-
await new Promise((r) => setTimeout(r, 200));
|
|
147
|
-
}
|
|
148
|
-
catch {
|
|
149
|
-
break; // Process exited
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
// Force kill if still alive
|
|
153
|
-
try {
|
|
154
|
-
process.kill(owner.runtimePid, 0);
|
|
155
|
-
process.kill(owner.runtimePid, "SIGKILL");
|
|
156
|
-
console.log(`[daemon] force-killed pid ${owner.runtimePid}`);
|
|
157
|
-
}
|
|
158
|
-
catch {
|
|
159
|
-
// Already dead — good
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
catch {
|
|
163
|
-
// PID doesn't exist — stale record
|
|
164
|
-
}
|
|
165
|
-
removeRuntimeOwnerRecord(runtimeRoot, owner.nodeId);
|
|
166
|
-
console.log("[daemon] stopped");
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Check whether a PID is alive via signal 0.
|
|
170
|
-
*/
|
|
171
|
-
function checkPidAlive(pid) {
|
|
172
|
-
try {
|
|
173
|
-
process.kill(pid, 0);
|
|
174
|
-
return true;
|
|
175
|
-
}
|
|
176
|
-
catch {
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Read the PID written to the flock-based daemon lock file (debugging aid only).
|
|
182
|
-
*/
|
|
183
|
-
function readLockFilePid(ariaHome) {
|
|
184
|
-
const lockPath = path.join(ariaHome, "daemon-launcher.lock");
|
|
185
|
-
try {
|
|
186
|
-
const content = fs.readFileSync(lockPath, "utf-8").trim();
|
|
187
|
-
const pid = Number.parseInt(content, 10);
|
|
188
|
-
return Number.isFinite(pid) && pid > 0 ? pid : null;
|
|
189
|
-
}
|
|
190
|
-
catch {
|
|
191
|
-
return null;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Format an ISO timestamp into a human-friendly relative description.
|
|
196
|
-
*/
|
|
197
|
-
function formatRelativeTime(isoString) {
|
|
198
|
-
const then = new Date(isoString).getTime();
|
|
199
|
-
const now = Date.now();
|
|
200
|
-
const diffMs = now - then;
|
|
201
|
-
if (diffMs < 0)
|
|
202
|
-
return isoString;
|
|
203
|
-
const seconds = Math.floor(diffMs / 1000);
|
|
204
|
-
if (seconds < 60)
|
|
205
|
-
return `${seconds}s ago`;
|
|
206
|
-
const minutes = Math.floor(seconds / 60);
|
|
207
|
-
if (minutes < 60)
|
|
208
|
-
return `${minutes}m ago`;
|
|
209
|
-
const hours = Math.floor(minutes / 60);
|
|
210
|
-
if (hours < 24)
|
|
211
|
-
return `${hours}h ${minutes % 60}m ago`;
|
|
212
|
-
const days = Math.floor(hours / 24);
|
|
213
|
-
return `${days}d ${hours % 24}h ago`;
|
|
214
|
-
}
|
|
215
|
-
export async function statusDaemonFromCli() {
|
|
216
|
-
const { resolveRuntimeRootDirectory, findRuntimeOwnerRecordByAriaHome, } = await import("@aria-cli/server");
|
|
217
|
-
const { getAriaDir } = await import("../config.js");
|
|
218
|
-
const ariaHome = getAriaDir();
|
|
219
|
-
const runtimeRoot = resolveRuntimeRootDirectory();
|
|
220
|
-
// ── Lock file info ─────────────────────────────────────────────
|
|
221
|
-
const lockPid = readLockFilePid(ariaHome);
|
|
222
|
-
const lockAlive = lockPid !== null && checkPidAlive(lockPid);
|
|
223
|
-
// ── Runtime owner record ───────────────────────────────────────
|
|
224
|
-
const owner = findRuntimeOwnerRecordByAriaHome(runtimeRoot, ariaHome);
|
|
225
|
-
if (!owner && !lockPid) {
|
|
226
|
-
console.log("[daemon] not running");
|
|
227
|
-
console.log(` ARIA_HOME: ${ariaHome}`);
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
// Determine overall status
|
|
231
|
-
const ownerPidAlive = owner ? checkPidAlive(owner.runtimePid) : false;
|
|
232
|
-
const running = ownerPidAlive || lockAlive;
|
|
233
|
-
if (running) {
|
|
234
|
-
console.log("[daemon] running ✓");
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
console.log("[daemon] stale (process dead, records remain)");
|
|
238
|
-
}
|
|
239
|
-
// ── Lock file details ──────────────────────────────────────────
|
|
240
|
-
console.log("");
|
|
241
|
-
console.log(" Lock file:");
|
|
242
|
-
if (lockPid !== null) {
|
|
243
|
-
console.log(` PID: ${lockPid} ${lockAlive ? "(alive)" : "(dead)"}`);
|
|
244
|
-
console.log(` Path: ${path.join(ariaHome, "daemon-launcher.lock")}`);
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
console.log(" (no lock file)");
|
|
248
|
-
}
|
|
249
|
-
// ── Runtime owner record details ───────────────────────────────
|
|
250
|
-
console.log("");
|
|
251
|
-
console.log(" Runtime owner record:");
|
|
252
|
-
if (owner) {
|
|
253
|
-
console.log(` PID: ${owner.runtimePid} ${ownerPidAlive ? "(alive)" : "(dead)"}`);
|
|
254
|
-
console.log(` Node ID: ${owner.nodeId}`);
|
|
255
|
-
console.log(` Runtime ID: ${owner.runtimeId}`);
|
|
256
|
-
if (owner.displayNameSnapshot) {
|
|
257
|
-
console.log(` Name: ${owner.displayNameSnapshot}`);
|
|
258
|
-
}
|
|
259
|
-
console.log(` Socket: ${owner.runtimeSocket}`);
|
|
260
|
-
console.log(` Started: ${owner.startedAt} (${formatRelativeTime(owner.startedAt)})`);
|
|
261
|
-
console.log(` Heartbeat: ${owner.lastHeartbeat} (${formatRelativeTime(owner.lastHeartbeat)})`);
|
|
262
|
-
console.log(` Generation: ${owner.ownerGeneration}`);
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
console.log(" (no owner record)");
|
|
266
|
-
}
|
|
267
|
-
// ── Consistency warnings ───────────────────────────────────────
|
|
268
|
-
const warnings = [];
|
|
269
|
-
if (lockPid !== null && owner && lockPid !== owner.runtimePid) {
|
|
270
|
-
warnings.push(`Lock file PID (${lockPid}) differs from owner record PID (${owner.runtimePid})`);
|
|
271
|
-
}
|
|
272
|
-
if (owner && !ownerPidAlive) {
|
|
273
|
-
warnings.push(`Owner record PID ${owner.runtimePid} is dead — run 'aria daemon stop' to clean up`);
|
|
274
|
-
}
|
|
275
|
-
if (lockPid !== null && !lockAlive && !owner) {
|
|
276
|
-
warnings.push(`Lock file PID ${lockPid} is dead with no owner record — stale lock (will auto-recover on next start)`);
|
|
277
|
-
}
|
|
278
|
-
if (warnings.length > 0) {
|
|
279
|
-
console.log("");
|
|
280
|
-
console.log(" ⚠ Warnings:");
|
|
281
|
-
for (const w of warnings) {
|
|
282
|
-
console.log(` - ${w}`);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
console.log("");
|
|
286
|
-
console.log(` ARIA_HOME: ${ariaHome}`);
|
|
287
|
-
}
|
|
288
|
-
export async function restartDaemonFromCli(options = {}) {
|
|
289
|
-
await stopDaemonFromCli();
|
|
290
|
-
await new Promise((r) => setTimeout(r, 500));
|
|
291
|
-
const { ensureDaemon } = await import("../ensure-daemon.js");
|
|
292
|
-
const cliContext = await createCliContext();
|
|
293
|
-
const conn = await ensureDaemon(cliContext);
|
|
294
|
-
const peers = await conn.control.listPeers();
|
|
295
|
-
console.log(`[daemon] restarted (${peers.length} peers connected)`);
|
|
296
|
-
await cliContext.pool?.closeAll?.();
|
|
297
|
-
}
|
|
298
|
-
async function runDaemon(options) {
|
|
299
|
-
const config = loadConfig();
|
|
300
|
-
const arionName = options.arion?.trim() || config.activeArion?.trim() || "ARIA";
|
|
301
|
-
const cliContext = await createCliContext({ startupMode: "daemon" });
|
|
302
|
-
const daemonService = createDaemonService({
|
|
303
|
-
cli: cliContext,
|
|
304
|
-
cwd: process.cwd(),
|
|
305
|
-
arionName,
|
|
306
|
-
});
|
|
307
|
-
try {
|
|
308
|
-
const status = await daemonService.start(toDaemonInput(options));
|
|
309
|
-
console.log(`[daemon] runtime node ${String(status.nodeId ?? "unknown")}`);
|
|
310
|
-
console.log(`[daemon] runtime ${String(status.runtimeId ?? "unknown")} listening on port ${String(status.port ?? "unknown")}`);
|
|
311
|
-
console.log(`[daemon] running arion "${arionName}" (interval ${options.intervalMs}ms)`);
|
|
312
|
-
for (const line of formatStorageDiagnostics(status.storage)) {
|
|
313
|
-
console.log(line);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
catch (err) {
|
|
317
|
-
console.error(`[daemon] Runtime startup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
318
|
-
process.exitCode = 1;
|
|
319
|
-
await cliContext.pool.closeAll().catch(() => { });
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
// ── Default mode: print status and exit ──────────────────────────
|
|
323
|
-
// The detached daemon child is self-sufficient. The CLI wrapper does
|
|
324
|
-
// not need to stay resident. Use --foreground to keep a monitor alive.
|
|
325
|
-
if (!options.foreground) {
|
|
326
|
-
console.log("[daemon] started (use --foreground to keep this process as a monitor)");
|
|
327
|
-
await cliContext.pool.closeAll().catch(() => { });
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
// ── Foreground monitor mode ──────────────────────────────────────
|
|
331
|
-
// Stay resident and poll status. Ctrl-C stops both this monitor and
|
|
332
|
-
// the daemon (via shouldStopOnShutdown).
|
|
333
|
-
console.log("[daemon] foreground monitor active (Ctrl-C to stop daemon)");
|
|
334
|
-
const controller = new AbortController();
|
|
335
|
-
const onSigint = () => controller.abort();
|
|
336
|
-
const onSigterm = () => controller.abort();
|
|
337
|
-
const onSighup = () => {
|
|
338
|
-
// Attached-client terminal hangups must not stop the runtime by themselves.
|
|
339
|
-
};
|
|
340
|
-
process.on("SIGINT", onSigint);
|
|
341
|
-
process.on("SIGTERM", onSigterm);
|
|
342
|
-
process.on("SIGHUP", onSighup);
|
|
343
|
-
const statusPoll = setInterval(() => {
|
|
344
|
-
void daemonService.status({}).catch(() => { });
|
|
345
|
-
}, Math.min(Math.max(options.intervalMs, 1_000), 5_000));
|
|
346
|
-
try {
|
|
347
|
-
await waitForAbort(controller.signal);
|
|
348
|
-
}
|
|
349
|
-
finally {
|
|
350
|
-
clearInterval(statusPoll);
|
|
351
|
-
try {
|
|
352
|
-
if (controller.signal.aborted && daemonService.shouldStopOnShutdown?.()) {
|
|
353
|
-
await daemonService.stop?.(toDaemonInput(options));
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
catch {
|
|
357
|
-
// Stop is best-effort during shutdown.
|
|
358
|
-
}
|
|
359
|
-
await daemonService.releaseAll?.();
|
|
360
|
-
await cliContext.pool.closeAll().catch(() => { });
|
|
361
|
-
process.removeListener("SIGINT", onSigint);
|
|
362
|
-
process.removeListener("SIGTERM", onSigterm);
|
|
363
|
-
process.removeListener("SIGHUP", onSighup);
|
|
364
|
-
console.log("[daemon] stopped");
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
//# sourceMappingURL=daemon.js.map
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Command definitions for the CLI
|
|
3
|
-
*/
|
|
4
|
-
export const COMMANDS = [
|
|
5
|
-
// Arion commands
|
|
6
|
-
{
|
|
7
|
-
name: "become",
|
|
8
|
-
description: "Switch to another arion",
|
|
9
|
-
usage: "/become <name>",
|
|
10
|
-
args: ["<name>"],
|
|
11
|
-
requiresArgs: true,
|
|
12
|
-
},
|
|
13
|
-
{ name: "arions", description: "List all arions", args: [] },
|
|
14
|
-
{
|
|
15
|
-
name: "hatch",
|
|
16
|
-
description: "Create a new arion",
|
|
17
|
-
usage: "/hatch <name> [description]",
|
|
18
|
-
args: ["<name>", "[description]"],
|
|
19
|
-
requiresArgs: true,
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: "rest",
|
|
23
|
-
description: "Put an arion to rest",
|
|
24
|
-
usage: "/rest <name>",
|
|
25
|
-
args: ["<name>"],
|
|
26
|
-
requiresArgs: true,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "wake",
|
|
30
|
-
description: "Wake a resting arion",
|
|
31
|
-
usage: "/wake <name>",
|
|
32
|
-
args: ["<name>"],
|
|
33
|
-
requiresArgs: true,
|
|
34
|
-
},
|
|
35
|
-
// Model commands
|
|
36
|
-
{
|
|
37
|
-
name: "model",
|
|
38
|
-
description: "Change or view current AI model",
|
|
39
|
-
usage: "/model [name|list|refresh] [--provider <name>] [--use-env]",
|
|
40
|
-
args: ["[name|list|refresh]", "[--provider <name>]", "[--use-env]"],
|
|
41
|
-
},
|
|
42
|
-
// Safety commands
|
|
43
|
-
{
|
|
44
|
-
name: "autonomy",
|
|
45
|
-
description: "Change permission approval policy",
|
|
46
|
-
usage: "/autonomy [level]",
|
|
47
|
-
args: ["[level]"],
|
|
48
|
-
},
|
|
49
|
-
// Sound commands
|
|
50
|
-
{
|
|
51
|
-
name: "sound",
|
|
52
|
-
description: "Open sound preferences or toggle notifications",
|
|
53
|
-
usage: "/sound [on|off]",
|
|
54
|
-
args: ["[on|off]"],
|
|
55
|
-
},
|
|
56
|
-
// Memory commands
|
|
57
|
-
{
|
|
58
|
-
name: "remember",
|
|
59
|
-
description: "Store a memory",
|
|
60
|
-
usage: "/remember <text>",
|
|
61
|
-
args: ["<text>"],
|
|
62
|
-
requiresArgs: true,
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: "recall",
|
|
66
|
-
description: "Search memories",
|
|
67
|
-
usage: "/recall <query>",
|
|
68
|
-
args: ["<query>"],
|
|
69
|
-
requiresArgs: true,
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: "recall_knowledge",
|
|
73
|
-
description: "Search learned tools (skills, procedures, techniques)",
|
|
74
|
-
usage: "/recall_knowledge <topic>",
|
|
75
|
-
args: ["<topic>"],
|
|
76
|
-
requiresArgs: true,
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: "send",
|
|
80
|
-
description: "Send a peer or same-home client message through the runtime transport",
|
|
81
|
-
usage: "/send <peer-name|node-id|client-id> <message>",
|
|
82
|
-
args: ["<peer-name|node-id|client-id>", "<message>"],
|
|
83
|
-
requiresArgs: true,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: "forget",
|
|
87
|
-
description: "Delete a memory",
|
|
88
|
-
usage: "/forget <id>",
|
|
89
|
-
args: ["<id>"],
|
|
90
|
-
requiresArgs: true,
|
|
91
|
-
},
|
|
92
|
-
{ name: "memories", description: "Browse all memories", args: [] },
|
|
93
|
-
// Session commands
|
|
94
|
-
{
|
|
95
|
-
name: "resume",
|
|
96
|
-
description: "Resume a previous session",
|
|
97
|
-
args: ["[session-id]"],
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: "fork",
|
|
101
|
-
description: "Fork the current session into a new branch",
|
|
102
|
-
usage: "/fork [session-id] [message-count] [--stay]",
|
|
103
|
-
args: ["[session-id]", "[message-count]", "[--stay]"],
|
|
104
|
-
},
|
|
105
|
-
{ name: "clear", description: "Clear the screen", args: [] },
|
|
106
|
-
// Auth commands
|
|
107
|
-
{
|
|
108
|
-
name: "login",
|
|
109
|
-
description: "Authenticate with provider (bedrock, anthropic, openai, google, copilot)",
|
|
110
|
-
usage: "/login [provider] [api-key|--profile <label>|--source <gh|device>]",
|
|
111
|
-
args: ["[provider]", "[api-key|flags]"],
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: "logout",
|
|
115
|
-
description: "Disconnect a provider or clear all credentials",
|
|
116
|
-
usage: "/logout [provider|all]",
|
|
117
|
-
args: ["[provider|all]"],
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
name: "auth",
|
|
121
|
-
description: "Auth utilities such as importing env credentials into session scope",
|
|
122
|
-
usage: "/auth import-env [provider ...] | /auth clear-session | /auth status-session",
|
|
123
|
-
args: ["import-env|clear-session|status-session", "[provider ...]"],
|
|
124
|
-
},
|
|
125
|
-
// System commands
|
|
126
|
-
{ name: "help", description: "Show available commands", args: [] },
|
|
127
|
-
{
|
|
128
|
-
name: "daemon",
|
|
129
|
-
description: "Open daemon control panel or run start/stop/restart",
|
|
130
|
-
usage: "/daemon [start|stop|restart]",
|
|
131
|
-
args: ["[start|stop|restart]"],
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
name: "terminal-setup",
|
|
135
|
-
description: "Install Shift+Enter newline key binding for supported terminals",
|
|
136
|
-
usage: "/terminal-setup",
|
|
137
|
-
args: [],
|
|
138
|
-
},
|
|
139
|
-
// Display commands
|
|
140
|
-
{
|
|
141
|
-
name: "theme",
|
|
142
|
-
description: "View or change the color theme",
|
|
143
|
-
usage: "/theme [name]",
|
|
144
|
-
args: ["[name]"],
|
|
145
|
-
},
|
|
146
|
-
// Peer discovery commands
|
|
147
|
-
{
|
|
148
|
-
name: "invite",
|
|
149
|
-
description: "Create an internet invite token",
|
|
150
|
-
usage: "/invite [label]",
|
|
151
|
-
args: ["[label]"],
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: "join",
|
|
155
|
-
description: "Accept an internet invite token",
|
|
156
|
-
usage: "/join [token]",
|
|
157
|
-
args: ["[token]"],
|
|
158
|
-
},
|
|
159
|
-
{ name: "peers", description: "Show nearby peers and connect", args: [] },
|
|
160
|
-
{ name: "clients", description: "Show same-home attached clients", args: [] },
|
|
161
|
-
{ name: "exit", description: "Exit ARIA", args: [] },
|
|
162
|
-
];
|
|
163
|
-
/**
|
|
164
|
-
* Get a command by name
|
|
165
|
-
*/
|
|
166
|
-
export function getCommand(name) {
|
|
167
|
-
return COMMANDS.find((c) => c.name === name);
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Filter commands by prefix
|
|
171
|
-
*/
|
|
172
|
-
export function filterCommands(prefix) {
|
|
173
|
-
const lower = prefix.toLowerCase();
|
|
174
|
-
return COMMANDS.filter((c) => c.name.toLowerCase().startsWith(lower));
|
|
175
|
-
}
|
|
176
|
-
//# sourceMappingURL=definitions.js.map
|
package/dist/commands/index.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ARIA CLI Commands - Command infrastructure using Commander.js
|
|
3
|
-
*/
|
|
4
|
-
import { Command } from "commander";
|
|
5
|
-
import { createArionsCommand } from "./arions.js";
|
|
6
|
-
import { createAuthCommand } from "./auth.js";
|
|
7
|
-
import { runDaemonFromCli, stopDaemonFromCli, statusDaemonFromCli, restartDaemonFromCli, } from "./daemon.js";
|
|
8
|
-
import { createHeadlessCallCommand } from "../headless/call-command.js";
|
|
9
|
-
import { createPairingCommand } from "./pairing.js";
|
|
10
|
-
import { createRuntimeCutoverResetCommand } from "./runtime-cutover-reset-command.js";
|
|
11
|
-
import { startHeadlessStdioServer } from "../headless/stdio-server.js";
|
|
12
|
-
// Create the main program
|
|
13
|
-
export const program = new Command();
|
|
14
|
-
import { CLI_VERSION } from "../release-notes.js";
|
|
15
|
-
program
|
|
16
|
-
.name("aria")
|
|
17
|
-
.description("ARIA - Adaptive Reasoning Intelligence Agent")
|
|
18
|
-
.version(CLI_VERSION);
|
|
19
|
-
// Arions command - Manage Arion personas
|
|
20
|
-
program.addCommand(createArionsCommand());
|
|
21
|
-
// Auth command - Manage API keys
|
|
22
|
-
program.addCommand(createAuthCommand());
|
|
23
|
-
// Pairing command - End-user internet invite/join
|
|
24
|
-
program.addCommand(createPairingCommand());
|
|
25
|
-
program
|
|
26
|
-
.command("headless")
|
|
27
|
-
.description("Run the persistent headless stdio control server")
|
|
28
|
-
.option("--arion <name>", "Arion name for per-Arion session context")
|
|
29
|
-
.action(async (options) => {
|
|
30
|
-
await startHeadlessStdioServer({
|
|
31
|
-
cwd: process.cwd(),
|
|
32
|
-
arionName: options.arion,
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
program.addCommand(createHeadlessCallCommand());
|
|
36
|
-
// Daemon command group
|
|
37
|
-
const daemonCmd = program.command("daemon").description("Manage the ARIA daemon");
|
|
38
|
-
daemonCmd
|
|
39
|
-
.command("start", { isDefault: true })
|
|
40
|
-
.description("Start the daemon (default: launch and exit; use --foreground to stay resident)")
|
|
41
|
-
.option("--arion <name>", "Run daemon for a specific Arion")
|
|
42
|
-
.option("--port <port>", "Server port (default: 0 = OS-assigned)")
|
|
43
|
-
.option("--interval-ms <ms>", "Wake loop interval in milliseconds (default: 60000)")
|
|
44
|
-
.option("--foreground", "Stay resident as a monitor (Ctrl-C stops the daemon)")
|
|
45
|
-
.option("--allowed-tool-categories <list>", "Comma-separated tool category allowlist")
|
|
46
|
-
.option("--allowed-shell-commands <list>", "Comma-separated shell command prefix allowlist")
|
|
47
|
-
.option("--max-write-ops-per-minute <count>", "Rate limit for write operations per minute")
|
|
48
|
-
.option("--max-git-pushes-per-hour <count>", "Rate limit for git pushes per hour")
|
|
49
|
-
.action(async (options) => {
|
|
50
|
-
await runDaemonFromCli(options);
|
|
51
|
-
});
|
|
52
|
-
daemonCmd
|
|
53
|
-
.command("stop")
|
|
54
|
-
.description("Stop the running daemon")
|
|
55
|
-
.action(async () => {
|
|
56
|
-
await stopDaemonFromCli();
|
|
57
|
-
});
|
|
58
|
-
daemonCmd
|
|
59
|
-
.command("status")
|
|
60
|
-
.description("Show daemon status, lock holder, and runtime details")
|
|
61
|
-
.action(async () => {
|
|
62
|
-
await statusDaemonFromCli();
|
|
63
|
-
});
|
|
64
|
-
daemonCmd
|
|
65
|
-
.command("restart")
|
|
66
|
-
.description("Stop the daemon and start a fresh one")
|
|
67
|
-
.action(async () => {
|
|
68
|
-
await restartDaemonFromCli();
|
|
69
|
-
});
|
|
70
|
-
program.addCommand(createRuntimeCutoverResetCommand());
|
|
71
|
-
// Export for use in bin/aria.js
|
|
72
|
-
export { createArionsCommand } from "./arions.js";
|
|
73
|
-
export { createAuthCommand } from "./auth.js";
|
|
74
|
-
export { createHeadlessCallCommand } from "../headless/call-command.js";
|
|
75
|
-
export { runDaemonFromCli } from "./daemon.js";
|
|
76
|
-
export { createPairingCommand } from "./pairing.js";
|
|
77
|
-
export { createRuntimeCutoverResetCommand } from "./runtime-cutover-reset-command.js";
|
|
78
|
-
export { startHeadlessStdioServer } from "../headless/stdio-server.js";
|
|
79
|
-
export { runtimeCutoverResetCommand } from "./runtime-cutover-reset.js";
|
|
80
|
-
//# sourceMappingURL=index.js.map
|