milaidy 1.0.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/LICENSE +8 -0
- package/README.md +538 -0
- package/dist/argv-CfSowvEA.js +63 -0
- package/dist/config-B-mboG4v.js +4 -0
- package/dist/eliza-CPJjgw-e.js +1491 -0
- package/dist/eliza.js +2192 -0
- package/dist/entry.js +232 -0
- package/dist/index.js +209 -0
- package/dist/links-BFKlWqSe.js +15 -0
- package/dist/paths-D_yh1DEJ.js +69 -0
- package/dist/plugins-cli-B7kSre2c.js +134 -0
- package/dist/program-6KwWwKKh.js +510 -0
- package/dist/register.agents-CPVmSjMG.js +17 -0
- package/dist/register.browser-B2ooXxNx.js +15 -0
- package/dist/register.channels-CMYQ6K6Y.js +42 -0
- package/dist/register.cron-D91lY1_Y.js +9 -0
- package/dist/register.devices-rU5I5L_y.js +13 -0
- package/dist/register.gateway-82SLAvw3.js +22 -0
- package/dist/register.hooks-B_XTBEkt.js +9 -0
- package/dist/register.logs-BgEGcPd8.js +10 -0
- package/dist/register.models-BJt9eVgZ.js +26 -0
- package/dist/register.nodes-B5xY1s8a.js +9 -0
- package/dist/register.skills-SFQqYIhg.js +10 -0
- package/dist/register.subclis-uF_AsbWR.js +187 -0
- package/dist/run-main-XODklzS-.js +56 -0
- package/dist/theme-DBvtuGeq.js +36 -0
- package/dist/utils-C1AUpp_V.js +42 -0
- package/dist/version-Cpn3yr5D.js +26 -0
- package/dist/workspace-Co3Wul2D.js +206 -0
- package/dist/workspace-DCA6MNVK.js +350 -0
- package/docs/.i18n/README.md +31 -0
- package/docs/.i18n/glossary.zh-CN.json +210 -0
- package/docs/.i18n/zh-CN.tm.jsonl +1329 -0
- package/docs/CNAME +1 -0
- package/docs/automation/cron-jobs.md +468 -0
- package/docs/automation/cron-vs-heartbeat.md +254 -0
- package/docs/automation/gmail-pubsub.md +256 -0
- package/docs/automation/poll.md +69 -0
- package/docs/automation/webhook.md +163 -0
- package/docs/bedrock.md +176 -0
- package/docs/brave-search.md +41 -0
- package/docs/broadcast-groups.md +442 -0
- package/docs/cli/acp.md +170 -0
- package/docs/cli/agent.md +24 -0
- package/docs/cli/agents.md +75 -0
- package/docs/cli/approvals.md +50 -0
- package/docs/cli/browser.md +107 -0
- package/docs/cli/channels.md +79 -0
- package/docs/cli/config.md +50 -0
- package/docs/cli/configure.md +33 -0
- package/docs/cli/cron.md +42 -0
- package/docs/cli/dashboard.md +16 -0
- package/docs/cli/devices.md +67 -0
- package/docs/cli/directory.md +63 -0
- package/docs/cli/dns.md +23 -0
- package/docs/cli/docs.md +15 -0
- package/docs/cli/doctor.md +41 -0
- package/docs/cli/gateway.md +199 -0
- package/docs/cli/health.md +21 -0
- package/docs/cli/hooks.md +291 -0
- package/docs/cli/index.md +1029 -0
- package/docs/cli/logs.md +24 -0
- package/docs/cli/memory.md +45 -0
- package/docs/cli/message.md +239 -0
- package/docs/cli/models.md +79 -0
- package/docs/cli/node.md +112 -0
- package/docs/cli/nodes.md +73 -0
- package/docs/cli/onboard.md +29 -0
- package/docs/cli/pairing.md +21 -0
- package/docs/cli/plugins.md +62 -0
- package/docs/cli/reset.md +17 -0
- package/docs/cli/sandbox.md +152 -0
- package/docs/cli/security.md +26 -0
- package/docs/cli/sessions.md +16 -0
- package/docs/cli/setup.md +29 -0
- package/docs/cli/skills.md +26 -0
- package/docs/cli/status.md +26 -0
- package/docs/cli/system.md +60 -0
- package/docs/cli/tui.md +23 -0
- package/docs/cli/uninstall.md +17 -0
- package/docs/cli/update.md +98 -0
- package/docs/cli/voicecall.md +34 -0
- package/docs/cli/webhooks.md +25 -0
- package/docs/concepts/agent-loop.md +146 -0
- package/docs/concepts/agent-workspace.md +229 -0
- package/docs/concepts/agent.md +122 -0
- package/docs/concepts/architecture.md +129 -0
- package/docs/concepts/channel-routing.md +114 -0
- package/docs/concepts/compaction.md +61 -0
- package/docs/concepts/context.md +159 -0
- package/docs/concepts/features.md +53 -0
- package/docs/concepts/group-messages.md +84 -0
- package/docs/concepts/groups.md +373 -0
- package/docs/concepts/markdown-formatting.md +130 -0
- package/docs/concepts/memory.md +546 -0
- package/docs/concepts/messages.md +154 -0
- package/docs/concepts/model-failover.md +149 -0
- package/docs/concepts/model-providers.md +315 -0
- package/docs/concepts/models.md +208 -0
- package/docs/concepts/multi-agent.md +376 -0
- package/docs/concepts/oauth.md +145 -0
- package/docs/concepts/plugins.md +454 -0
- package/docs/concepts/presence.md +102 -0
- package/docs/concepts/queue.md +89 -0
- package/docs/concepts/retry.md +69 -0
- package/docs/concepts/secrets.md +300 -0
- package/docs/concepts/session-pruning.md +122 -0
- package/docs/concepts/session-tool.md +193 -0
- package/docs/concepts/session.md +188 -0
- package/docs/concepts/sessions.md +10 -0
- package/docs/concepts/skills.md +392 -0
- package/docs/concepts/streaming.md +135 -0
- package/docs/concepts/system-prompt.md +114 -0
- package/docs/concepts/timezone.md +91 -0
- package/docs/concepts/typebox.md +289 -0
- package/docs/concepts/typing-indicators.md +68 -0
- package/docs/concepts/usage-tracking.md +35 -0
- package/docs/custom.css +4 -0
- package/docs/date-time.md +128 -0
- package/docs/debugging.md +162 -0
- package/docs/docs.json +1599 -0
- package/docs/environment.md +81 -0
- package/docs/hooks.md +876 -0
- package/docs/index.md +179 -0
- package/docs/install/ansible.md +208 -0
- package/docs/install/bun.md +59 -0
- package/docs/install/development-channels.md +75 -0
- package/docs/install/docker.md +567 -0
- package/docs/install/index.md +185 -0
- package/docs/install/installer.md +123 -0
- package/docs/install/migrating.md +192 -0
- package/docs/install/nix.md +96 -0
- package/docs/install/node.md +78 -0
- package/docs/install/uninstall.md +128 -0
- package/docs/install/updating.md +228 -0
- package/docs/logging.md +350 -0
- package/docs/multi-agent-sandbox-tools.md +395 -0
- package/docs/network.md +54 -0
- package/docs/nodes/audio.md +114 -0
- package/docs/nodes/camera.md +156 -0
- package/docs/nodes/images.md +72 -0
- package/docs/nodes/index.md +341 -0
- package/docs/nodes/location-command.md +113 -0
- package/docs/nodes/media-understanding.md +379 -0
- package/docs/nodes/talk.md +90 -0
- package/docs/nodes/voicewake.md +65 -0
- package/docs/northflank.mdx +53 -0
- package/docs/perplexity.md +80 -0
- package/docs/platforms/android.md +129 -0
- package/docs/platforms/digitalocean.md +262 -0
- package/docs/platforms/exe-dev.md +125 -0
- package/docs/platforms/fly.md +486 -0
- package/docs/platforms/gcp.md +503 -0
- package/docs/platforms/hetzner.md +330 -0
- package/docs/platforms/index.md +53 -0
- package/docs/platforms/ios.md +106 -0
- package/docs/platforms/linux.md +94 -0
- package/docs/platforms/mac/bundled-gateway.md +73 -0
- package/docs/platforms/mac/canvas.md +125 -0
- package/docs/platforms/mac/child-process.md +69 -0
- package/docs/platforms/mac/dev-setup.md +102 -0
- package/docs/platforms/mac/health.md +34 -0
- package/docs/platforms/mac/icon.md +31 -0
- package/docs/platforms/mac/logging.md +57 -0
- package/docs/platforms/mac/menu-bar.md +81 -0
- package/docs/platforms/mac/peekaboo.md +65 -0
- package/docs/platforms/mac/permissions.md +44 -0
- package/docs/platforms/mac/release.md +85 -0
- package/docs/platforms/mac/remote.md +83 -0
- package/docs/platforms/mac/signing.md +47 -0
- package/docs/platforms/mac/skills.md +33 -0
- package/docs/platforms/mac/voice-overlay.md +60 -0
- package/docs/platforms/mac/voicewake.md +67 -0
- package/docs/platforms/mac/webchat.md +41 -0
- package/docs/platforms/mac/xpc.md +61 -0
- package/docs/platforms/macos-vm.md +281 -0
- package/docs/platforms/macos.md +203 -0
- package/docs/platforms/oracle.md +303 -0
- package/docs/platforms/raspberry-pi.md +358 -0
- package/docs/platforms/windows.md +159 -0
- package/docs/plugin.md +651 -0
- package/docs/plugins/agent-tools.md +99 -0
- package/docs/plugins/manifest.md +71 -0
- package/docs/plugins/voice-call.md +273 -0
- package/docs/plugins/zalouser.md +70 -0
- package/docs/providers/anthropic.md +152 -0
- package/docs/providers/claude-max-api-proxy.md +148 -0
- package/docs/providers/cloudflare-ai-gateway.md +71 -0
- package/docs/providers/deepgram.md +93 -0
- package/docs/providers/glm.md +33 -0
- package/docs/providers/index.md +63 -0
- package/docs/providers/minimax.md +208 -0
- package/docs/providers/models.md +51 -0
- package/docs/providers/moonshot.md +142 -0
- package/docs/providers/ollama.md +223 -0
- package/docs/providers/openai.md +62 -0
- package/docs/providers/opencode.md +36 -0
- package/docs/providers/openrouter.md +37 -0
- package/docs/providers/qwen.md +53 -0
- package/docs/providers/synthetic.md +99 -0
- package/docs/providers/venice.md +267 -0
- package/docs/providers/vercel-ai-gateway.md +50 -0
- package/docs/providers/xiaomi.md +64 -0
- package/docs/providers/zai.md +36 -0
- package/docs/railway.mdx +99 -0
- package/docs/reference/templates/AGENTS.md +9 -0
- package/docs/reference/templates/BOOTSTRAP.md +3 -0
- package/docs/reference/templates/HEARTBEAT.md +3 -0
- package/docs/reference/templates/IDENTITY.md +3 -0
- package/docs/reference/templates/TOOLS.md +3 -0
- package/docs/reference/templates/USER.md +3 -0
- package/docs/render.mdx +165 -0
- package/docs/start/docs-directory.md +63 -0
- package/docs/start/getting-started.md +212 -0
- package/docs/start/milaidy.md +247 -0
- package/docs/start/onboarding.md +258 -0
- package/docs/start/pairing.md +86 -0
- package/docs/start/quickstart.md +81 -0
- package/docs/start/setup.md +149 -0
- package/docs/start/showcase.md +416 -0
- package/docs/start/wizard.md +418 -0
- package/docs/testing.md +368 -0
- package/docs/token-use.md +112 -0
- package/docs/tools/agent-send.md +53 -0
- package/docs/tools/apply-patch.md +50 -0
- package/docs/tools/browser-linux-troubleshooting.md +139 -0
- package/docs/tools/browser-login.md +68 -0
- package/docs/tools/browser.md +576 -0
- package/docs/tools/chrome-extension.md +178 -0
- package/docs/tools/clawhub.md +257 -0
- package/docs/tools/creating-skills.md +54 -0
- package/docs/tools/elevated.md +57 -0
- package/docs/tools/exec-approvals.md +246 -0
- package/docs/tools/exec.md +179 -0
- package/docs/tools/firecrawl.md +61 -0
- package/docs/tools/index.md +508 -0
- package/docs/tools/llm-task.md +115 -0
- package/docs/tools/reactions.md +22 -0
- package/docs/tools/skills-config.md +76 -0
- package/docs/tools/skills.md +300 -0
- package/docs/tools/slash-commands.md +196 -0
- package/docs/tools/subagents.md +151 -0
- package/docs/tools/thinking.md +73 -0
- package/docs/tools/web.md +261 -0
- package/docs/tui.md +159 -0
- package/docs/vps.md +43 -0
- package/docs/web/control-ui.md +221 -0
- package/docs/web/dashboard.md +46 -0
- package/docs/web/index.md +116 -0
- package/docs/web/webchat.md +49 -0
- package/milaidy.mjs +14 -0
- package/package.json +271 -0
- package/skills/.cache/catalog.json +88519 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
import { t as registerSubCliCommands } from "./register.subclis-uF_AsbWR.js";
|
|
2
|
+
import { t as isTruthyEnvValue } from "./entry.js";
|
|
3
|
+
import "./paths-D_yh1DEJ.js";
|
|
4
|
+
import { n as theme, t as isRich } from "./theme-DBvtuGeq.js";
|
|
5
|
+
import { r as setVerbose } from "./utils-C1AUpp_V.js";
|
|
6
|
+
import { t as formatDocsLink } from "./links-BFKlWqSe.js";
|
|
7
|
+
import { a as hasHelpOrVersion, i as getVerboseFlag, n as getCommandPath } from "./argv-CfSowvEA.js";
|
|
8
|
+
import { t as VERSION } from "./version-Cpn3yr5D.js";
|
|
9
|
+
import { createRequire } from "node:module";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
import fs from "node:fs";
|
|
12
|
+
import { Command } from "commander";
|
|
13
|
+
|
|
14
|
+
//#region src/cli/program/register.config.ts
|
|
15
|
+
function registerConfigCli(program) {
|
|
16
|
+
const config = program.command("config").description("Config helpers (get/set/unset). Run without subcommand for the wizard.");
|
|
17
|
+
config.command("get <key>").description("Get a config value").action(async (key) => {
|
|
18
|
+
const { loadMilaidyConfig } = await import("./config-B-mboG4v.js");
|
|
19
|
+
let milaidyConfig;
|
|
20
|
+
try {
|
|
21
|
+
milaidyConfig = await loadMilaidyConfig();
|
|
22
|
+
} catch {
|
|
23
|
+
console.error("[milaidy] Could not load config.");
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
const parts = key.split(".");
|
|
27
|
+
let value = milaidyConfig;
|
|
28
|
+
for (const part of parts) if (value && typeof value === "object") value = value[part];
|
|
29
|
+
else {
|
|
30
|
+
value = void 0;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
if (value === void 0) console.log(`${theme.muted("(not set)")}`);
|
|
34
|
+
else console.log(typeof value === "object" ? JSON.stringify(value, null, 2) : String(value));
|
|
35
|
+
});
|
|
36
|
+
config.command("set <key> <value>").description("Set a config value").action(async (key, value) => {
|
|
37
|
+
console.log(`[milaidy] config set ${key} = ${value}`);
|
|
38
|
+
console.log(`${theme.muted("Config set not yet fully implemented.")}`);
|
|
39
|
+
console.log(`${theme.muted("Edit ~/.milaidy/milaidy.json directly for now.")}`);
|
|
40
|
+
});
|
|
41
|
+
config.command("unset <key>").description("Remove a config value").action(async (key) => {
|
|
42
|
+
console.log(`[milaidy] config unset ${key}`);
|
|
43
|
+
console.log(`${theme.muted("Config unset not yet fully implemented.")}`);
|
|
44
|
+
console.log(`${theme.muted("Edit ~/.milaidy/milaidy.json directly for now.")}`);
|
|
45
|
+
});
|
|
46
|
+
config.command("path").description("Print the config file path").action(async () => {
|
|
47
|
+
const configPath = process.env.MILAIDY_CONFIG_PATH ?? "~/.milaidy/milaidy.json";
|
|
48
|
+
console.log(configPath);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/cli/cli-utils.ts
|
|
54
|
+
async function runCommandWithRuntime(runtime, action, onError) {
|
|
55
|
+
try {
|
|
56
|
+
await action();
|
|
57
|
+
} catch (err) {
|
|
58
|
+
if (onError) {
|
|
59
|
+
onError(err);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
runtime.error(String(err));
|
|
63
|
+
runtime.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/cli/program/register.configure.ts
|
|
69
|
+
const defaultRuntime$2 = {
|
|
70
|
+
error: console.error,
|
|
71
|
+
exit: process.exit
|
|
72
|
+
};
|
|
73
|
+
function registerConfigureCommand(program) {
|
|
74
|
+
program.command("configure").description("Interactive prompt to set up credentials, devices, and agent defaults").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/configuration", "docs.milaidy.ai/configuration")}\n`).option("--section <section>", "Configure a specific section (repeatable)", (value, previous) => [...previous, value], []).action(async (opts) => {
|
|
75
|
+
await runCommandWithRuntime(defaultRuntime$2, async () => {
|
|
76
|
+
const sections = Array.isArray(opts.section) ? opts.section : [];
|
|
77
|
+
console.log(`\n${theme.heading("Milaidy Configuration")}\n`);
|
|
78
|
+
if (sections.length > 0) console.log(`Sections: ${sections.join(", ")}`);
|
|
79
|
+
console.log("Available configuration sections:");
|
|
80
|
+
console.log(` ${theme.command("models")} Model provider API keys`);
|
|
81
|
+
console.log(` ${theme.command("channels")} Channel credentials (Discord, Telegram, etc.)`);
|
|
82
|
+
console.log(` ${theme.command("agent")} Agent name, bio, and system prompt`);
|
|
83
|
+
console.log(` ${theme.command("gateway")} Gateway port and bind settings`);
|
|
84
|
+
console.log(` ${theme.command("workspace")} Agent workspace directory\n`);
|
|
85
|
+
console.log(`${theme.muted("Tip:")} Use 'milaidy config set <key> <value>' to set individual values.`);
|
|
86
|
+
console.log(`${theme.muted("Tip:")} Edit ~/.milaidy/milaidy.json directly for full control.\n`);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/cli/program/register.dashboard.ts
|
|
93
|
+
function registerDashboardCommand(program) {
|
|
94
|
+
program.command("dashboard").description("Open the Control UI with your current token").option("--port <port>", "Gateway port", process.env.MILAIDY_GATEWAY_PORT ?? "18789").option("--url <url>", "Gateway URL (overrides --port)").action(async (opts) => {
|
|
95
|
+
const port = opts.port ?? "18789";
|
|
96
|
+
const url = opts.url ?? `http://localhost:${port}`;
|
|
97
|
+
console.log(`${theme.muted("→")} Opening Control UI: ${url}`);
|
|
98
|
+
const { exec } = await import("node:child_process");
|
|
99
|
+
exec(`${process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open"} ${url}`, (err) => {
|
|
100
|
+
if (err) {
|
|
101
|
+
console.log(`${theme.warn("Could not open browser automatically.")}`);
|
|
102
|
+
console.log(`${theme.muted("Open manually:")} ${url}`);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region src/cli/program/register.doctor.ts
|
|
110
|
+
function registerDoctorCommand(program) {
|
|
111
|
+
program.command("doctor").description("Health checks + quick fixes for the gateway and channels").action(async () => {
|
|
112
|
+
console.log(`\n${theme.heading("Milaidy Doctor")}\n`);
|
|
113
|
+
console.log("Running health checks...\n");
|
|
114
|
+
const nodeVersion = process.version;
|
|
115
|
+
if (Number.parseInt(nodeVersion.slice(1).split(".")[0] ?? "0", 10) >= 22) console.log(` ${theme.success("✓")} Node.js ${nodeVersion}`);
|
|
116
|
+
else console.log(` ${theme.error("✗")} Node.js ${nodeVersion} (requires >= 22.12.0)`);
|
|
117
|
+
try {
|
|
118
|
+
const { loadMilaidyConfig } = await import("./config-B-mboG4v.js");
|
|
119
|
+
await loadMilaidyConfig();
|
|
120
|
+
console.log(` ${theme.success("✓")} Config file loaded`);
|
|
121
|
+
} catch {
|
|
122
|
+
console.log(` ${theme.warn("!")} No config file found — run 'milaidy setup'`);
|
|
123
|
+
}
|
|
124
|
+
if (Boolean(process.env.ANTHROPIC_API_KEY || process.env.OPENAI_API_KEY || process.env.GOOGLE_API_KEY || process.env.GROQ_API_KEY || process.env.XAI_API_KEY || process.env.OPENROUTER_API_KEY || process.env.OLLAMA_BASE_URL)) console.log(` ${theme.success("✓")} At least one model provider API key configured`);
|
|
125
|
+
else console.log(` ${theme.warn("!")} No model provider API key found — set one in .env or milaidy.json`);
|
|
126
|
+
console.log();
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/cli/program/register.setup.ts
|
|
132
|
+
const defaultRuntime$1 = {
|
|
133
|
+
error: console.error,
|
|
134
|
+
exit: process.exit
|
|
135
|
+
};
|
|
136
|
+
function registerSetupCommand(program) {
|
|
137
|
+
program.command("setup").description("Initialize ~/.milaidy/milaidy.json and the agent workspace").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/getting-started/setup", "docs.milaidy.ai/getting-started/setup")}\n`).option("--workspace <dir>", "Agent workspace directory").option("--wizard", "Run the interactive onboarding wizard", false).action(async (opts) => {
|
|
138
|
+
await runCommandWithRuntime(defaultRuntime$1, async () => {
|
|
139
|
+
const { loadMilaidyConfig } = await import("./config-B-mboG4v.js");
|
|
140
|
+
const { ensureAgentWorkspace, resolveDefaultAgentWorkspaceDir } = await import("./workspace-Co3Wul2D.js");
|
|
141
|
+
let config;
|
|
142
|
+
try {
|
|
143
|
+
config = await loadMilaidyConfig();
|
|
144
|
+
console.log(`${theme.success("✓")} Config loaded`);
|
|
145
|
+
} catch {
|
|
146
|
+
console.log(`${theme.muted("→")} No config found, using defaults`);
|
|
147
|
+
config = {};
|
|
148
|
+
}
|
|
149
|
+
const workspaceDir = opts.workspace ?? config?.agents?.defaults?.workspace ?? resolveDefaultAgentWorkspaceDir();
|
|
150
|
+
await ensureAgentWorkspace({
|
|
151
|
+
dir: workspaceDir,
|
|
152
|
+
ensureBootstrapFiles: true
|
|
153
|
+
});
|
|
154
|
+
console.log(`${theme.success("✓")} Agent workspace ready: ${workspaceDir}`);
|
|
155
|
+
if (opts.wizard) {
|
|
156
|
+
console.log(`\n${theme.muted("Interactive wizard not yet implemented.")}`);
|
|
157
|
+
console.log(`${theme.muted("Use 'milaidy configure' for interactive setup.")}`);
|
|
158
|
+
}
|
|
159
|
+
console.log(`\n${theme.success("Setup complete.")}`);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/cli/program/register.start.ts
|
|
166
|
+
const defaultRuntime = {
|
|
167
|
+
error: console.error,
|
|
168
|
+
exit: process.exit
|
|
169
|
+
};
|
|
170
|
+
function registerStartCommand(program) {
|
|
171
|
+
program.command("start").description("Start the ElizaOS agent runtime").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/getting-started", "docs.milaidy.ai/getting-started")}\n`).action(async () => {
|
|
172
|
+
await runCommandWithRuntime(defaultRuntime, async () => {
|
|
173
|
+
const { startEliza } = await import("./eliza-CPJjgw-e.js");
|
|
174
|
+
await startEliza();
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
program.command("run").description("Start the ElizaOS agent runtime (alias for start)").action(async () => {
|
|
178
|
+
await runCommandWithRuntime(defaultRuntime, async () => {
|
|
179
|
+
const { startEliza } = await import("./eliza-CPJjgw-e.js");
|
|
180
|
+
await startEliza();
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/cli/program/register.status.ts
|
|
187
|
+
function registerStatusHealthSessionsCommands(program) {
|
|
188
|
+
program.command("status").description("Show channel health and recent session recipients").option("--json", "Output JSON").option("--deep", "Run deep probes").option("--all", "Show all details (read-only/pasteable)").option("--usage", "Show usage statistics").option("--verbose", "Verbose output").option("--timeout <ms>", "Probe timeout in milliseconds", "10000").action(async () => {
|
|
189
|
+
console.log("[milaidy] Status — not yet fully implemented.");
|
|
190
|
+
console.log("[milaidy] Use the Control UI dashboard for status monitoring.");
|
|
191
|
+
});
|
|
192
|
+
program.command("health").description("Fetch health from the running gateway").option("--json", "Output JSON").option("--verbose", "Verbose output").option("--timeout <ms>", "Probe timeout in milliseconds", "10000").action(async () => {
|
|
193
|
+
console.log("[milaidy] Health — not yet fully implemented.");
|
|
194
|
+
});
|
|
195
|
+
program.command("sessions").description("List stored conversation sessions").option("--json", "Output JSON").option("--store <name>", "Filter by store name").option("--active <filter>", "Filter by active state").action(async () => {
|
|
196
|
+
console.log("[milaidy] Sessions — not yet fully implemented.");
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/cli/program/command-registry.ts
|
|
202
|
+
const commandRegistry = [
|
|
203
|
+
{
|
|
204
|
+
id: "start",
|
|
205
|
+
register: ({ program }) => registerStartCommand(program)
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
id: "setup",
|
|
209
|
+
register: ({ program }) => registerSetupCommand(program)
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
id: "configure",
|
|
213
|
+
register: ({ program }) => registerConfigureCommand(program)
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "config",
|
|
217
|
+
register: ({ program }) => registerConfigCli(program)
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "doctor",
|
|
221
|
+
register: ({ program }) => registerDoctorCommand(program)
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: "dashboard",
|
|
225
|
+
register: ({ program }) => registerDashboardCommand(program)
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
id: "status-health-sessions",
|
|
229
|
+
register: ({ program }) => registerStatusHealthSessionsCommands(program)
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: "subclis",
|
|
233
|
+
register: ({ program, argv }) => registerSubCliCommands(program, argv)
|
|
234
|
+
}
|
|
235
|
+
];
|
|
236
|
+
function registerProgramCommands(program, ctx, argv = process.argv) {
|
|
237
|
+
for (const entry of commandRegistry) entry.register({
|
|
238
|
+
program,
|
|
239
|
+
ctx,
|
|
240
|
+
argv
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/cli/channel-options.ts
|
|
246
|
+
/** Known channel IDs in display order */
|
|
247
|
+
const CHAT_CHANNEL_ORDER = [
|
|
248
|
+
"discord",
|
|
249
|
+
"telegram",
|
|
250
|
+
"slack",
|
|
251
|
+
"whatsapp",
|
|
252
|
+
"signal",
|
|
253
|
+
"imessage",
|
|
254
|
+
"matrix",
|
|
255
|
+
"msteams",
|
|
256
|
+
"googlechat"
|
|
257
|
+
];
|
|
258
|
+
function dedupe(values) {
|
|
259
|
+
const seen = /* @__PURE__ */ new Set();
|
|
260
|
+
const resolved = [];
|
|
261
|
+
for (const value of values) {
|
|
262
|
+
if (!value || seen.has(value)) continue;
|
|
263
|
+
seen.add(value);
|
|
264
|
+
resolved.push(value);
|
|
265
|
+
}
|
|
266
|
+
return resolved;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Get the list of available channel options for CLI.
|
|
270
|
+
* Plugin channels are no longer supported.
|
|
271
|
+
*/
|
|
272
|
+
function resolveCliChannelOptions() {
|
|
273
|
+
return dedupe([...CHAT_CHANNEL_ORDER]);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
//#endregion
|
|
277
|
+
//#region src/cli/program/context.ts
|
|
278
|
+
function createProgramContext() {
|
|
279
|
+
const channelOptions = resolveCliChannelOptions();
|
|
280
|
+
return {
|
|
281
|
+
programVersion: VERSION,
|
|
282
|
+
channelOptions,
|
|
283
|
+
messageChannelOptions: channelOptions.join("|"),
|
|
284
|
+
agentChannelOptions: ["last", ...channelOptions].join("|")
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/infra/git-commit.ts
|
|
290
|
+
const formatCommit = (value) => {
|
|
291
|
+
if (!value) return null;
|
|
292
|
+
const trimmed = value.trim();
|
|
293
|
+
if (!trimmed) return null;
|
|
294
|
+
return trimmed.length > 7 ? trimmed.slice(0, 7) : trimmed;
|
|
295
|
+
};
|
|
296
|
+
const resolveGitHead = (startDir) => {
|
|
297
|
+
let current = startDir;
|
|
298
|
+
for (let i = 0; i < 12; i += 1) {
|
|
299
|
+
const gitPath = path.join(current, ".git");
|
|
300
|
+
try {
|
|
301
|
+
const stat = fs.statSync(gitPath);
|
|
302
|
+
if (stat.isDirectory()) return path.join(gitPath, "HEAD");
|
|
303
|
+
if (stat.isFile()) {
|
|
304
|
+
const match = fs.readFileSync(gitPath, "utf-8").match(/gitdir:\s*(.+)/i);
|
|
305
|
+
if (match?.[1]) {
|
|
306
|
+
const resolved = path.resolve(current, match[1].trim());
|
|
307
|
+
return path.join(resolved, "HEAD");
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
} catch {}
|
|
311
|
+
const parent = path.dirname(current);
|
|
312
|
+
if (parent === current) break;
|
|
313
|
+
current = parent;
|
|
314
|
+
}
|
|
315
|
+
return null;
|
|
316
|
+
};
|
|
317
|
+
let cachedCommit;
|
|
318
|
+
const readCommitFromPackageJson = () => {
|
|
319
|
+
try {
|
|
320
|
+
const pkg = createRequire(import.meta.url)("../../package.json");
|
|
321
|
+
return formatCommit(pkg.gitHead ?? pkg.githead ?? null);
|
|
322
|
+
} catch {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
const readCommitFromBuildInfo = () => {
|
|
327
|
+
try {
|
|
328
|
+
const require = createRequire(import.meta.url);
|
|
329
|
+
for (const candidate of ["../build-info.json", "./build-info.json"]) try {
|
|
330
|
+
const formatted = formatCommit(require(candidate).commit ?? null);
|
|
331
|
+
if (formatted) return formatted;
|
|
332
|
+
} catch {}
|
|
333
|
+
return null;
|
|
334
|
+
} catch {
|
|
335
|
+
return null;
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
const resolveCommitHash = (options = {}) => {
|
|
339
|
+
if (cachedCommit !== void 0) return cachedCommit;
|
|
340
|
+
const env = options.env ?? process.env;
|
|
341
|
+
const normalized = formatCommit(env.GIT_COMMIT?.trim() || env.GIT_SHA?.trim());
|
|
342
|
+
if (normalized) {
|
|
343
|
+
cachedCommit = normalized;
|
|
344
|
+
return cachedCommit;
|
|
345
|
+
}
|
|
346
|
+
const buildInfoCommit = readCommitFromBuildInfo();
|
|
347
|
+
if (buildInfoCommit) {
|
|
348
|
+
cachedCommit = buildInfoCommit;
|
|
349
|
+
return cachedCommit;
|
|
350
|
+
}
|
|
351
|
+
const pkgCommit = readCommitFromPackageJson();
|
|
352
|
+
if (pkgCommit) {
|
|
353
|
+
cachedCommit = pkgCommit;
|
|
354
|
+
return cachedCommit;
|
|
355
|
+
}
|
|
356
|
+
try {
|
|
357
|
+
const headPath = resolveGitHead(options.cwd ?? process.cwd());
|
|
358
|
+
if (!headPath) {
|
|
359
|
+
cachedCommit = null;
|
|
360
|
+
return cachedCommit;
|
|
361
|
+
}
|
|
362
|
+
const head = fs.readFileSync(headPath, "utf-8").trim();
|
|
363
|
+
if (!head) {
|
|
364
|
+
cachedCommit = null;
|
|
365
|
+
return cachedCommit;
|
|
366
|
+
}
|
|
367
|
+
if (head.startsWith("ref:")) {
|
|
368
|
+
const ref = head.replace(/^ref:\s*/i, "").trim();
|
|
369
|
+
const refPath = path.resolve(path.dirname(headPath), ref);
|
|
370
|
+
cachedCommit = formatCommit(fs.readFileSync(refPath, "utf-8").trim());
|
|
371
|
+
return cachedCommit;
|
|
372
|
+
}
|
|
373
|
+
cachedCommit = formatCommit(head);
|
|
374
|
+
return cachedCommit;
|
|
375
|
+
} catch {
|
|
376
|
+
cachedCommit = null;
|
|
377
|
+
return cachedCommit;
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region src/cli/banner.ts
|
|
383
|
+
let bannerEmitted = false;
|
|
384
|
+
const graphemeSegmenter = typeof Intl !== "undefined" && "Segmenter" in Intl ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null;
|
|
385
|
+
const hasJsonFlag = (argv) => argv.some((arg) => arg === "--json" || arg.startsWith("--json="));
|
|
386
|
+
const hasVersionFlag = (argv) => argv.some((arg) => arg === "--version" || arg === "-V" || arg === "-v");
|
|
387
|
+
function formatCliBannerLine(version, options = {}) {
|
|
388
|
+
const commitLabel = options.commit ?? resolveCommitHash({ env: options.env }) ?? "unknown";
|
|
389
|
+
const rich = options.richTty ?? isRich();
|
|
390
|
+
const title = "🌹 Milaidy";
|
|
391
|
+
if (rich) return `${theme.heading(title)} ${theme.info(version)} ${theme.muted(`(${commitLabel})`)}`;
|
|
392
|
+
return `${title} ${version} (${commitLabel})`;
|
|
393
|
+
}
|
|
394
|
+
function emitCliBanner(version, options = {}) {
|
|
395
|
+
if (bannerEmitted) return;
|
|
396
|
+
const argv = options.argv ?? process.argv;
|
|
397
|
+
if (!process.stdout.isTTY) return;
|
|
398
|
+
if (hasJsonFlag(argv)) return;
|
|
399
|
+
if (hasVersionFlag(argv)) return;
|
|
400
|
+
const line = formatCliBannerLine(version, options);
|
|
401
|
+
process.stdout.write(`\n${line}\n\n`);
|
|
402
|
+
bannerEmitted = true;
|
|
403
|
+
}
|
|
404
|
+
function hasEmittedCliBanner() {
|
|
405
|
+
return bannerEmitted;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
//#endregion
|
|
409
|
+
//#region src/cli/cli-name.ts
|
|
410
|
+
const DEFAULT_CLI_NAME = "milaidy";
|
|
411
|
+
const KNOWN_CLI_NAMES = new Set([DEFAULT_CLI_NAME]);
|
|
412
|
+
const CLI_PREFIX_RE = /^(?:((?:pnpm|npm|bunx|npx)\s+))?(milaidy)\b/;
|
|
413
|
+
function resolveCliName(argv = process.argv) {
|
|
414
|
+
const argv1 = argv[1];
|
|
415
|
+
if (!argv1) return DEFAULT_CLI_NAME;
|
|
416
|
+
const base = path.basename(argv1).trim();
|
|
417
|
+
if (KNOWN_CLI_NAMES.has(base)) return base;
|
|
418
|
+
return DEFAULT_CLI_NAME;
|
|
419
|
+
}
|
|
420
|
+
function replaceCliName(command, cliName = resolveCliName()) {
|
|
421
|
+
if (!command.trim()) return command;
|
|
422
|
+
if (!CLI_PREFIX_RE.test(command)) return command;
|
|
423
|
+
return command.replace(CLI_PREFIX_RE, (_match, runner) => {
|
|
424
|
+
return `${runner ?? ""}${cliName}`;
|
|
425
|
+
});
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
//#endregion
|
|
429
|
+
//#region src/cli/program/help.ts
|
|
430
|
+
const CLI_NAME = resolveCliName();
|
|
431
|
+
const EXAMPLES = [
|
|
432
|
+
["milaidy start", "Start the ElizaOS agent runtime."],
|
|
433
|
+
["milaidy gateway", "Run the WebSocket Gateway locally."],
|
|
434
|
+
["milaidy --dev gateway", "Run a dev Gateway (isolated state/config) on ws://127.0.0.1:19001."],
|
|
435
|
+
["milaidy gateway --force", "Kill anything bound to the default gateway port, then start it."],
|
|
436
|
+
["milaidy dashboard", "Open the Control UI in your browser."],
|
|
437
|
+
["milaidy setup", "Initialize ~/.milaidy/milaidy.json and the agent workspace."],
|
|
438
|
+
["milaidy configure", "Interactive setup for credentials and agent defaults."],
|
|
439
|
+
["milaidy config set agents.defaults.model.primary claude-sonnet-4-20250514", "Set the default model."],
|
|
440
|
+
["milaidy plugins list", "List available ElizaOS plugins."]
|
|
441
|
+
];
|
|
442
|
+
function configureProgramHelp(program, ctx) {
|
|
443
|
+
program.name(CLI_NAME).description("").version(ctx.programVersion).option("--dev", "Dev profile: isolate state under ~/.milaidy-dev, default gateway port 19001, and shift derived ports (browser/canvas)").option("--profile <name>", "Use a named profile (isolates MILAIDY_STATE_DIR/MILAIDY_CONFIG_PATH under ~/.milaidy-<name>)");
|
|
444
|
+
program.option("--no-color", "Disable ANSI colors", false);
|
|
445
|
+
program.configureHelp({
|
|
446
|
+
optionTerm: (option) => theme.option(option.flags),
|
|
447
|
+
subcommandTerm: (cmd) => theme.command(cmd.name())
|
|
448
|
+
});
|
|
449
|
+
program.configureOutput({
|
|
450
|
+
writeOut: (str) => {
|
|
451
|
+
const colored = str.replace(/^Usage:/gm, theme.heading("Usage:")).replace(/^Options:/gm, theme.heading("Options:")).replace(/^Commands:/gm, theme.heading("Commands:"));
|
|
452
|
+
process.stdout.write(colored);
|
|
453
|
+
},
|
|
454
|
+
writeErr: (str) => process.stderr.write(str),
|
|
455
|
+
outputError: (str, write) => write(theme.error(str))
|
|
456
|
+
});
|
|
457
|
+
if (process.argv.includes("-V") || process.argv.includes("--version") || process.argv.includes("-v")) {
|
|
458
|
+
console.log(ctx.programVersion);
|
|
459
|
+
process.exit(0);
|
|
460
|
+
}
|
|
461
|
+
program.addHelpText("beforeAll", () => {
|
|
462
|
+
if (hasEmittedCliBanner()) return "";
|
|
463
|
+
const rich = isRich();
|
|
464
|
+
return `\n${formatCliBannerLine(ctx.programVersion, { richTty: rich })}\n`;
|
|
465
|
+
});
|
|
466
|
+
const fmtExamples = EXAMPLES.map(([cmd, desc]) => ` ${theme.command(replaceCliName(cmd, CLI_NAME))}\n ${theme.muted(desc)}`).join("\n");
|
|
467
|
+
program.addHelpText("afterAll", ({ command }) => {
|
|
468
|
+
if (command !== program) return "";
|
|
469
|
+
const docs = formatDocsLink("/cli", "docs.milaidy.ai/cli");
|
|
470
|
+
return `\n${theme.heading("Examples:")}\n${fmtExamples}\n\n${theme.muted("Docs:")} ${docs}\n`;
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
//#endregion
|
|
475
|
+
//#region src/cli/program/preaction.ts
|
|
476
|
+
function setProcessTitleForCommand(actionCommand) {
|
|
477
|
+
let current = actionCommand;
|
|
478
|
+
while (current.parent && current.parent.parent) current = current.parent;
|
|
479
|
+
const name = current.name();
|
|
480
|
+
const cliName = resolveCliName();
|
|
481
|
+
if (!name || name === cliName) return;
|
|
482
|
+
process.title = `${cliName}-${name}`;
|
|
483
|
+
}
|
|
484
|
+
function registerPreActionHooks(program, programVersion) {
|
|
485
|
+
program.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
486
|
+
setProcessTitleForCommand(actionCommand);
|
|
487
|
+
const argv = process.argv;
|
|
488
|
+
if (hasHelpOrVersion(argv)) return;
|
|
489
|
+
const commandPath = getCommandPath(argv, 2);
|
|
490
|
+
if (!(isTruthyEnvValue(process.env.MILAIDY_HIDE_BANNER) || commandPath[0] === "update" || commandPath[0] === "completion")) emitCliBanner(programVersion);
|
|
491
|
+
const verbose = getVerboseFlag(argv, { includeDebug: true });
|
|
492
|
+
setVerbose(verbose);
|
|
493
|
+
if (!verbose) process.env.NODE_NO_WARNINGS ??= "1";
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region src/cli/program/build-program.ts
|
|
499
|
+
function buildProgram() {
|
|
500
|
+
const program = new Command();
|
|
501
|
+
const ctx = createProgramContext();
|
|
502
|
+
const argv = process.argv;
|
|
503
|
+
configureProgramHelp(program, ctx);
|
|
504
|
+
registerPreActionHooks(program, ctx.programVersion);
|
|
505
|
+
registerProgramCommands(program, ctx, argv);
|
|
506
|
+
return program;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
//#endregion
|
|
510
|
+
export { buildProgram };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { n as theme } from "./theme-DBvtuGeq.js";
|
|
2
|
+
|
|
3
|
+
//#region src/cli/program/register.agents.ts
|
|
4
|
+
function registerAgentsCli(program) {
|
|
5
|
+
const agents = program.command("agents").description("Manage isolated agents (workspaces + auth + routing)");
|
|
6
|
+
agents.command("list").description("List configured agents").option("--json", "Output JSON").option("--bindings", "Show channel bindings").action(async () => {
|
|
7
|
+
console.log("[milaidy] Agents list — not yet fully implemented.");
|
|
8
|
+
console.log(`${theme.muted("Agents are managed via ElizaOS character files.")}`);
|
|
9
|
+
});
|
|
10
|
+
agents.command("create").description("Create a new agent workspace").argument("<name>", "Agent name").action(async (name) => {
|
|
11
|
+
console.log(`[milaidy] Creating agent workspace for: ${name}`);
|
|
12
|
+
console.log("[milaidy] Agent creation — not yet fully implemented.");
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { registerAgentsCli };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/cli/program/register.browser.ts
|
|
2
|
+
function registerBrowserCli(program) {
|
|
3
|
+
const browser = program.command("browser").description("Manage Milaidy's dedicated browser (Chrome/Chromium)");
|
|
4
|
+
browser.command("extension").description("Chrome extension management").action(async () => {
|
|
5
|
+
console.log("[milaidy] Browser extension management:");
|
|
6
|
+
console.log(" milaidy browser extension install — Install the Chrome extension files");
|
|
7
|
+
console.log(" milaidy browser extension path — Print the extension directory path");
|
|
8
|
+
});
|
|
9
|
+
browser.command("launch").description("Launch the dedicated browser").action(async () => {
|
|
10
|
+
console.log("[milaidy] Browser launch — not yet fully implemented.");
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { registerBrowserCli };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import "./paths-D_yh1DEJ.js";
|
|
2
|
+
import { n as theme } from "./theme-DBvtuGeq.js";
|
|
3
|
+
import "./utils-C1AUpp_V.js";
|
|
4
|
+
import { t as formatDocsLink } from "./links-BFKlWqSe.js";
|
|
5
|
+
|
|
6
|
+
//#region src/cli/program/register.channels.ts
|
|
7
|
+
function registerChannelsCli(program) {
|
|
8
|
+
const channels = program.command("channels").description("Channel management").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/channels", "docs.milaidy.ai/channels")}\n`);
|
|
9
|
+
channels.command("list").description("List configured channels").option("--json", "Output JSON").action(async () => {
|
|
10
|
+
const { loadMilaidyConfig } = await import("./config-B-mboG4v.js");
|
|
11
|
+
let config;
|
|
12
|
+
try {
|
|
13
|
+
config = await loadMilaidyConfig();
|
|
14
|
+
} catch {
|
|
15
|
+
config = {};
|
|
16
|
+
}
|
|
17
|
+
const channelsConfig = config.channels ?? {};
|
|
18
|
+
const names = Object.keys(channelsConfig);
|
|
19
|
+
if (names.length === 0) {
|
|
20
|
+
console.log("No channels configured. Use 'milaidy configure --section channels' to set up channels.");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
console.log("\nConfigured channels:\n");
|
|
24
|
+
for (const name of names) console.log(` ${theme.command(name)}`);
|
|
25
|
+
console.log();
|
|
26
|
+
});
|
|
27
|
+
channels.command("status").description("Show channel health and connection status").option("--probe", "Probe channels for connectivity").option("--json", "Output JSON").action(async () => {
|
|
28
|
+
console.log("[milaidy] Channel status — not yet fully implemented.");
|
|
29
|
+
console.log("[milaidy] Use the Control UI dashboard for channel monitoring.");
|
|
30
|
+
});
|
|
31
|
+
channels.command("login").description("Link a channel account").argument("[channel]", "Channel to link (e.g. whatsapp, telegram)").option("--verbose", "Show detailed connection logs").action(async (channel) => {
|
|
32
|
+
if (!channel) {
|
|
33
|
+
console.log("Usage: milaidy channels login <channel>");
|
|
34
|
+
console.log("Available: discord, telegram, slack, whatsapp, signal, imessage");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
console.log(`[milaidy] Channel login for ${channel} — not yet fully implemented.`);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { registerChannelsCli };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/cli/program/register.cron.ts
|
|
2
|
+
function registerCronCli(program) {
|
|
3
|
+
program.command("cron").description("Cron scheduler").command("list").description("List scheduled jobs").option("--json", "Output JSON").action(async () => {
|
|
4
|
+
console.log("[milaidy] Cron list — not yet fully implemented.");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { registerCronCli };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/cli/program/register.devices.ts
|
|
2
|
+
function registerDevicesCli(program) {
|
|
3
|
+
const devices = program.command("devices").description("Device pairing + token management");
|
|
4
|
+
devices.command("list").description("List paired devices").option("--json", "Output JSON").action(async () => {
|
|
5
|
+
console.log("[milaidy] Devices list — not yet fully implemented.");
|
|
6
|
+
});
|
|
7
|
+
devices.command("pair").description("Pair a new device").action(async () => {
|
|
8
|
+
console.log("[milaidy] Device pairing — not yet fully implemented.");
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
export { registerDevicesCli };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "./paths-D_yh1DEJ.js";
|
|
2
|
+
import { n as theme } from "./theme-DBvtuGeq.js";
|
|
3
|
+
import "./utils-C1AUpp_V.js";
|
|
4
|
+
import { t as formatDocsLink } from "./links-BFKlWqSe.js";
|
|
5
|
+
|
|
6
|
+
//#region src/cli/program/register.gateway.ts
|
|
7
|
+
function registerGatewayCli(program) {
|
|
8
|
+
const gateway = program.command("gateway").description("Run the WebSocket Gateway").addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/gateway", "docs.milaidy.ai/gateway")}\n`).option("--port <port>", "Gateway port", process.env.MILAIDY_GATEWAY_PORT ?? "18789").option("--bind <address>", "Bind address", "loopback").option("--force", "Kill anything bound to the port, then start").option("--reset", "Reset gateway state before starting").action(async (opts) => {
|
|
9
|
+
console.log(`[milaidy] Starting gateway on port ${opts.port}...`);
|
|
10
|
+
console.log("[milaidy] Gateway command not yet fully implemented — see openclaw-classic.");
|
|
11
|
+
console.log("[milaidy] Use 'bun run gateway:dev' for development.");
|
|
12
|
+
});
|
|
13
|
+
gateway.command("status").description("Show gateway service status").option("--url <url>", "Gateway URL to probe").option("--timeout <ms>", "Probe timeout in milliseconds", "10000").option("--json", "Output JSON").action(async (_opts) => {
|
|
14
|
+
console.log("[milaidy] Gateway status check — not yet implemented.");
|
|
15
|
+
});
|
|
16
|
+
gateway.command("stop").description("Stop the running gateway").action(async () => {
|
|
17
|
+
console.log("[milaidy] Gateway stop — not yet implemented.");
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { registerGatewayCli };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/cli/program/register.hooks.ts
|
|
2
|
+
function registerHooksCli(program) {
|
|
3
|
+
program.command("hooks").description("Hooks tooling").command("list").description("List registered hooks").option("--json", "Output JSON").action(async () => {
|
|
4
|
+
console.log("[milaidy] Hooks list — not yet fully implemented.");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { registerHooksCli };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/cli/program/register.logs.ts
|
|
2
|
+
function registerLogsCli(program) {
|
|
3
|
+
program.command("logs").description("Gateway logs").command("tail").description("Tail gateway logs").option("--lines <n>", "Number of lines to show", "50").option("--follow", "Follow log output").action(async () => {
|
|
4
|
+
console.log("[milaidy] Logs tail — not yet fully implemented.");
|
|
5
|
+
console.log("[milaidy] Use the Control UI dashboard for live log viewing.");
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { registerLogsCli };
|