nomoreide 0.1.72 → 0.1.74
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 +48 -0
- package/dist/cli/agents.d.ts +2 -0
- package/dist/cli/agents.js +43 -0
- package/dist/cli/agents.js.map +1 -0
- package/dist/cli/commands.d.ts +3 -1
- package/dist/cli/commands.js +21 -14
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/daemon.d.ts +15 -0
- package/dist/cli/daemon.js +139 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/cli/profile.d.ts +2 -0
- package/dist/cli/profile.js +167 -0
- package/dist/cli/profile.js.map +1 -0
- package/dist/core/agent-env-actions.d.ts +4 -4
- package/dist/core/agent-profiles/registry-config.d.ts +1 -1
- package/dist/core/agent-profiles/registry-config.js +4 -1
- package/dist/core/agent-profiles/registry-config.js.map +1 -1
- package/dist/core/agent-terminal.d.ts +6 -0
- package/dist/core/agent-terminal.js +16 -0
- package/dist/core/agent-terminal.js.map +1 -0
- package/dist/core/app-version.d.ts +2 -0
- package/dist/core/app-version.js +16 -0
- package/dist/core/app-version.js.map +1 -0
- package/dist/core/config-store.js +1 -0
- package/dist/core/config-store.js.map +1 -1
- package/dist/core/daemon-client.d.ts +66 -0
- package/dist/core/daemon-client.js +121 -0
- package/dist/core/daemon-client.js.map +1 -0
- package/dist/core/daemon-lifecycle.d.ts +59 -0
- package/dist/core/daemon-lifecycle.js +147 -0
- package/dist/core/daemon-lifecycle.js.map +1 -0
- package/dist/core/db-peek.d.ts +4 -0
- package/dist/core/db-peek.js +2 -0
- package/dist/core/db-peek.js.map +1 -1
- package/dist/core/repo-onboard.d.ts +8 -8
- package/dist/core/service-health.js +6 -1
- package/dist/core/service-health.js.map +1 -1
- package/dist/core/service-registry.d.ts +5 -3
- package/dist/core/service-registry.js +8 -5
- package/dist/core/service-registry.js.map +1 -1
- package/dist/core/terminal-manager.d.ts +3 -0
- package/dist/core/terminal-manager.js +2 -0
- package/dist/core/terminal-manager.js.map +1 -1
- package/dist/core/terminal-session.d.ts +7 -0
- package/dist/core/terminal-session.js +6 -0
- package/dist/core/terminal-session.js.map +1 -1
- package/dist/core/types.d.ts +6 -0
- package/dist/core/workflows.d.ts +7 -19
- package/dist/core/workflows.js +9 -21
- package/dist/core/workflows.js.map +1 -1
- package/dist/index.js +22 -5
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +11 -7
- package/dist/mcp/server.js +15 -34
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/agent.js +15 -5
- package/dist/mcp/tools/agent.js.map +1 -1
- package/dist/mcp/tools/context.d.ts +6 -8
- package/dist/mcp/tools/context.js.map +1 -1
- package/dist/mcp/tools/database.js +13 -17
- package/dist/mcp/tools/database.js.map +1 -1
- package/dist/mcp/tools/services.d.ts +5 -0
- package/dist/mcp/tools/services.js +31 -21
- package/dist/mcp/tools/services.js.map +1 -1
- package/dist/tui/app.d.ts +4 -2
- package/dist/tui/app.js +19 -16
- package/dist/tui/app.js.map +1 -1
- package/dist/web/client/assets/{code-editor-fZ2dpXfw.js → code-editor-GK07_DNL.js} +1 -1
- package/dist/web/client/assets/index-C8kH2Crm.css +1 -0
- package/dist/web/client/assets/index-D7ZrdlUm.js +219 -0
- package/dist/web/client/index.html +2 -2
- package/dist/web/routes/agent-chat-routes.d.ts +1 -1
- package/dist/web/routes/agent-chat-routes.js +3 -4
- package/dist/web/routes/agent-chat-routes.js.map +1 -1
- package/dist/web/routes/context.d.ts +6 -0
- package/dist/web/routes/context.js.map +1 -1
- package/dist/web/routes/dashboard-routes.js +27 -1
- package/dist/web/routes/dashboard-routes.js.map +1 -1
- package/dist/web/routes/database-routes.js +3 -0
- package/dist/web/routes/database-routes.js.map +1 -1
- package/dist/web/routes/shell-routes.js +1 -0
- package/dist/web/routes/shell-routes.js.map +1 -1
- package/dist/web/routes/terminal-routes.js +33 -0
- package/dist/web/routes/terminal-routes.js.map +1 -1
- package/dist/web/routes/workflow-routes.d.ts +2 -2
- package/dist/web/routes/workflow-routes.js +2 -2
- package/dist/web/server.d.ts +2 -0
- package/dist/web/server.js +2 -1
- package/dist/web/server.js.map +1 -1
- package/package.json +2 -1
- package/dist/web/client/assets/index-CraqLFuO.js +0 -222
- package/dist/web/client/assets/index-n7aEcfkd.css +0 -1
- package/dist/web/ui-lifecycle.d.ts +0 -30
- package/dist/web/ui-lifecycle.js +0 -129
- package/dist/web/ui-lifecycle.js.map +0 -1
package/README.md
CHANGED
|
@@ -212,6 +212,9 @@ graph TD
|
|
|
212
212
|
| Database browse and SQL query | | | ✓ | ✓ |
|
|
213
213
|
| Human-approved SQL writes | | | ✓ | |
|
|
214
214
|
| Agent tools, hooks, plugins, usage | | | ✓ | |
|
|
215
|
+
| Agent environments (live MCPs & skills) | ✓ | | ✓ | ✓ |
|
|
216
|
+
| Agent profiles (snapshot / apply / share) | ✓ | | ✓ | ✓ |
|
|
217
|
+
| Hosted profile registry (publish / install) | ✓ | | ✓ | ✓ |
|
|
215
218
|
| Safe Git (no force-push, no reset) | ✓ | ✓ | ✓ | ✓ |
|
|
216
219
|
|
|
217
220
|
---
|
|
@@ -316,6 +319,36 @@ nomoreide git add-repo app --path /path/to/repo
|
|
|
316
319
|
nomoreide git select-repo app
|
|
317
320
|
```
|
|
318
321
|
|
|
322
|
+
### Agent Environments & Profiles
|
|
323
|
+
|
|
324
|
+
Inspect and manage your coding agents' MCP servers and skills (Claude Code,
|
|
325
|
+
Codex CLI, Antigravity), and bundle them into portable profiles. Formerly the
|
|
326
|
+
standalone `brainctl` package — see the
|
|
327
|
+
[migration guide](docs/brainctl-migration.md).
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
# Live agent configuration (read-only)
|
|
331
|
+
nomoreide agents status # per-agent install state, MCP + skill counts
|
|
332
|
+
nomoreide agents doctor # config sanity checks
|
|
333
|
+
nomoreide agents read claude # dump one agent's live config as JSON
|
|
334
|
+
|
|
335
|
+
# Profiles: named bundles of MCP servers + skills
|
|
336
|
+
nomoreide profile list
|
|
337
|
+
nomoreide profile snapshot claude my-setup # capture an agent's live config
|
|
338
|
+
nomoreide profile apply my-setup codex --dry-run
|
|
339
|
+
nomoreide profile apply my-setup codex # backs up the config first
|
|
340
|
+
nomoreide profile export my-setup # credential-redacted .tar.gz
|
|
341
|
+
nomoreide profile import my-setup.tar.gz --as teammate-setup
|
|
342
|
+
|
|
343
|
+
# Hosted registry (sign in via the web UI, or set BRAINCTL_API_TOKEN)
|
|
344
|
+
nomoreide profile publish my-setup --slug my-setup --title "My Setup"
|
|
345
|
+
nomoreide profile install my-setup
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Exports and published packages never contain raw secrets — secret-looking
|
|
349
|
+
values are redacted to `${credentials.*}` placeholders that importers fill
|
|
350
|
+
from their own environment.
|
|
351
|
+
|
|
319
352
|
---
|
|
320
353
|
|
|
321
354
|
## MCP Tools
|
|
@@ -383,6 +416,21 @@ All tools are prefixed with `nomoreide_` and are available to any connected MCP
|
|
|
383
416
|
| `nomoreide_github_get_commit_ci` | Inspect commit check status |
|
|
384
417
|
| `nomoreide_github_list_workflow_runs` | List recent GitHub Actions workflow runs |
|
|
385
418
|
|
|
419
|
+
### Agent Environment & Profile Tools
|
|
420
|
+
|
|
421
|
+
| Tool | Description |
|
|
422
|
+
|---|---|
|
|
423
|
+
| `nomoreide_agents_status` / `nomoreide_agents_read_configs` | Live agent install state and MCP/skill configuration |
|
|
424
|
+
| `nomoreide_agents_doctor` | Agent config sanity checks |
|
|
425
|
+
| `nomoreide_agents_add_mcp` / `nomoreide_agents_remove_mcp` | Add or remove an MCP server (config backed up first) |
|
|
426
|
+
| `nomoreide_agents_move_mcp_scope` / `nomoreide_agents_move_skill_scope` | Copy/move MCPs and skills between agents and scopes |
|
|
427
|
+
| `nomoreide_agents_snapshot_agent` | Back up an agent's config files |
|
|
428
|
+
| `nomoreide_profiles_list` / `get` / `create` / `update` / `delete` | Profile CRUD |
|
|
429
|
+
| `nomoreide_profiles_snapshot` / `nomoreide_profiles_apply` | Capture a live agent into a profile / apply one (dry-run preview) |
|
|
430
|
+
| `nomoreide_profiles_export` / `nomoreide_profiles_import` | Credential-redacted portable archives |
|
|
431
|
+
| `nomoreide_profiles_publish` / `nomoreide_profiles_install_from_registry` | Share profiles through the hosted registry |
|
|
432
|
+
| `nomoreide_profiles_register_github` | Register a GitHub repo as a registry profile |
|
|
433
|
+
|
|
386
434
|
---
|
|
387
435
|
|
|
388
436
|
## Example Configurations
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getAgentAvailability, readAllAgentConfigs, runAgentDoctor, AGENT_NAMES, } from "../core/agent-env/index.js";
|
|
2
|
+
import { UsageError } from "./errors.js";
|
|
3
|
+
const USAGE = "Usage: nomoreide agents [status|doctor|read [claude|codex|antigravity]]";
|
|
4
|
+
/** Agent Environments on the CLI (ROR-64) — read-only, same core as UI/MCP. */
|
|
5
|
+
export async function runAgentsCli(subcommand, args, stdout) {
|
|
6
|
+
const cwd = process.cwd();
|
|
7
|
+
if (subcommand === undefined || subcommand === "status") {
|
|
8
|
+
const [availability, configs] = await Promise.all([
|
|
9
|
+
getAgentAvailability(),
|
|
10
|
+
readAllAgentConfigs({ cwd }),
|
|
11
|
+
]);
|
|
12
|
+
const byAgent = new Map(availability.map((entry) => [entry.agent, entry]));
|
|
13
|
+
stdout("Agent\tInstalled\tMCPs\tSkills\tConfig");
|
|
14
|
+
for (const config of configs) {
|
|
15
|
+
const installed = byAgent.get(config.agent)?.available ? "yes" : "no";
|
|
16
|
+
const mcpCount = Object.keys(config.mcpServers).length +
|
|
17
|
+
Object.keys(config.remoteMcpServers).length +
|
|
18
|
+
Object.keys(config.projectMcpServers).length +
|
|
19
|
+
Object.keys(config.projectRemoteMcpServers).length;
|
|
20
|
+
stdout(`${config.agent}\t${installed}\t${mcpCount}\t${config.skills.length}\t${config.exists ? config.configPath : "(none)"}`);
|
|
21
|
+
}
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
if (subcommand === "doctor") {
|
|
25
|
+
const result = await runAgentDoctor({ cwd });
|
|
26
|
+
for (const check of result.checks) {
|
|
27
|
+
stdout(`${check.status === "ok" ? "ok" : "warn"}\t${check.label}\t${check.message}`);
|
|
28
|
+
}
|
|
29
|
+
return result.hasIssues ? 1 : 0;
|
|
30
|
+
}
|
|
31
|
+
if (subcommand === "read") {
|
|
32
|
+
const agent = args.find((arg) => !arg.startsWith("--"));
|
|
33
|
+
if (agent && !AGENT_NAMES.includes(agent)) {
|
|
34
|
+
throw new UsageError(`Unknown agent "${agent}". Use one of: ${AGENT_NAMES.join(", ")}`);
|
|
35
|
+
}
|
|
36
|
+
const configs = await readAllAgentConfigs({ cwd });
|
|
37
|
+
const selected = agent ? configs.filter((config) => config.agent === agent) : configs;
|
|
38
|
+
stdout(JSON.stringify(agent ? selected[0] : selected, null, 2));
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
throw new UsageError(USAGE);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/cli/agents.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,WAAW,GAEZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,KAAK,GAAG,yEAAyE,CAAC;AAExF,+EAA+E;AAC/E,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,UAA8B,EAC9B,IAAc,EACd,MAA8B;IAE9B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAE1B,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;QACxD,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACh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
|
|
2
3
|
configPath?: string;
|
|
3
|
-
logDir?: string;
|
|
4
4
|
stdout?: (line: string) => void;
|
|
5
5
|
stderr?: (line: string) => void;
|
|
6
|
+
/** Injectable for tests; defaults to the machine-global daemon. */
|
|
7
|
+
daemon?: DaemonConnection;
|
|
6
8
|
}
|
|
7
9
|
export declare function runCli(args: string[], options?: CliOptions): Promise<number>;
|
package/dist/cli/commands.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { resolve } from "node:path";
|
|
2
1
|
import { ConfigStore, ConfigValidationError, defaultGlobalConfigPath, } from "../core/config-store.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { createDaemonConnection, } from "../core/daemon-client.js";
|
|
3
|
+
import { runAgentsCli } from "./agents.js";
|
|
5
4
|
import { UsageError } from "./errors.js";
|
|
6
5
|
import { parseFlags } from "./flags.js";
|
|
7
6
|
import { runGitCli } from "./git.js";
|
|
8
|
-
|
|
7
|
+
import { runProfileCli } from "./profile.js";
|
|
8
|
+
const USAGE = "Usage: nomoreide [mcp|setup|tui|web|daemon|git|agents|profile|list|logs|start|stop|restart|add]";
|
|
9
9
|
const MCP_SETUP_LINES = [
|
|
10
10
|
"NoMoreIDE MCP setup",
|
|
11
11
|
"",
|
|
@@ -29,10 +29,9 @@ export async function runCli(args, options = {}) {
|
|
|
29
29
|
const stdout = options.stdout ?? ((line) => console.log(line));
|
|
30
30
|
const stderr = options.stderr ?? ((line) => console.error(line));
|
|
31
31
|
const configStore = new ConfigStore(options.configPath ?? defaultGlobalConfigPath());
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const manager = new ProcessManager({ configStore, logStore });
|
|
32
|
+
// Runtime commands (start/stop/restart/logs) talk to the shared daemon so
|
|
33
|
+
// services outlive this CLI invocation and are visible to every session.
|
|
34
|
+
const daemon = options.daemon ?? createDaemonConnection();
|
|
36
35
|
try {
|
|
37
36
|
const [command, subcommand, ...rest] = args;
|
|
38
37
|
if (command === "setup") {
|
|
@@ -44,6 +43,12 @@ export async function runCli(args, options = {}) {
|
|
|
44
43
|
if (command === "git") {
|
|
45
44
|
return await runGitCli(subcommand, rest, stdout, configStore);
|
|
46
45
|
}
|
|
46
|
+
if (command === "agents") {
|
|
47
|
+
return await runAgentsCli(subcommand, rest, stdout);
|
|
48
|
+
}
|
|
49
|
+
if (command === "profile") {
|
|
50
|
+
return await runProfileCli(subcommand, rest, stdout);
|
|
51
|
+
}
|
|
47
52
|
if (command === "add" && subcommand === "service") {
|
|
48
53
|
const name = rest[0];
|
|
49
54
|
const flags = parseFlags(rest.slice(1));
|
|
@@ -127,7 +132,8 @@ export async function runCli(args, options = {}) {
|
|
|
127
132
|
if (!name) {
|
|
128
133
|
throw new UsageError("service name is required");
|
|
129
134
|
}
|
|
130
|
-
|
|
135
|
+
const client = await daemon.client();
|
|
136
|
+
for (const entry of await client.logs(name, 200)) {
|
|
131
137
|
stdout(`${entry.timestamp}\t${entry.stream}\t${entry.text}`);
|
|
132
138
|
}
|
|
133
139
|
return 0;
|
|
@@ -139,15 +145,16 @@ export async function runCli(args, options = {}) {
|
|
|
139
145
|
}
|
|
140
146
|
const config = await configStore.load();
|
|
141
147
|
const isBundle = config.bundles.some((bundle) => bundle.name === name);
|
|
148
|
+
const client = await daemon.client();
|
|
142
149
|
const result = command === "start"
|
|
143
150
|
? isBundle
|
|
144
|
-
? await
|
|
145
|
-
: await
|
|
151
|
+
? await client.startBundle(name)
|
|
152
|
+
: await client.startService(name)
|
|
146
153
|
: command === "stop"
|
|
147
154
|
? isBundle
|
|
148
|
-
? await
|
|
149
|
-
: await
|
|
150
|
-
: await
|
|
155
|
+
? await client.stopBundle(name)
|
|
156
|
+
: await client.stopService(name)
|
|
157
|
+
: await client.restartService(name);
|
|
151
158
|
stdout(JSON.stringify(result, null, 2));
|
|
152
159
|
return 0;
|
|
153
160
|
}
|
package/dist/cli/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,GAEvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,KAAK,GACT,iGAAiG,CAAC;AAEpG,MAAM,eAAe,GAAG;IACtB,qBAAqB;IACrB,EAAE;IACF,cAAc;IACd,kEAAkE;IAClE,EAAE;IACF,YAAY;IACZ,+CAA+C;IAC/C,EAAE;IACF,aAAa;IACb,mCAAmC;IACnC,4EAA4E;IAC5E,EAAE;IACF,gCAAgC;IAChC,QAAQ;IACR,EAAE;IACF,kCAAkC;IAClC,oLAAoL;CACrL,CAAC;AAUF,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,IAAc,EACd,UAAsB,EAAE;IAExB,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACvE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACzE,MAAM,WAAW,GAAG,IAAI,WAAW,CACjC,OAAO,CAAC,UAAU,IAAI,uBAAuB,EAAE,CAChD,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AW,CAAC,IAAI,CAAC;oBAChC,CAAC,CAAC,MAAM,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC;gBACnC,CAAC,CAAC,OAAO,KAAK,MAAM;oBAClB,CAAC,CAAC,QAAQ;wBACR,CAAC,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC;wBAC/B,CAAC,CAAC,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;oBAClC,CAAC,CAAC,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAE1C,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YACxC,OAAO,CAAC,CAAC;QACX,CAAC;QAED,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/D,OAAO,KAAK,YAAY,UAAU,IAAI,KAAK,YAAY,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface DaemonCliOptions {
|
|
2
|
+
statePath?: string;
|
|
3
|
+
port?: number;
|
|
4
|
+
stdout?: (line: string) => void;
|
|
5
|
+
stderr?: (line: string) => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* `nomoreide daemon [status|stop|restart] [--port=N]`.
|
|
9
|
+
*
|
|
10
|
+
* Bare `nomoreide daemon` runs the machine-global daemon in the foreground —
|
|
11
|
+
* the process `ensureDaemon()` spawns detached. It owns every spawned service
|
|
12
|
+
* and uses global state dirs (`~/.nomoreide/logs`, `~/.nomoreide`), so any
|
|
13
|
+
* session on the machine sees the same services and logs.
|
|
14
|
+
*/
|
|
15
|
+
export declare function runDaemonCli(args: string[], options?: DaemonCliOptions): Promise<number>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { rmSync } from "node:fs";
|
|
2
|
+
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { appVersion } from "../core/app-version.js";
|
|
6
|
+
import { DaemonClient } from "../core/daemon-client.js";
|
|
7
|
+
import { defaultDaemonStatePath, ensureDaemon, probeDaemon, readDaemonState, resolveDaemonPort, } from "../core/daemon-lifecycle.js";
|
|
8
|
+
import { createWebServer } from "../web/server.js";
|
|
9
|
+
/**
|
|
10
|
+
* `nomoreide daemon [status|stop|restart] [--port=N]`.
|
|
11
|
+
*
|
|
12
|
+
* Bare `nomoreide daemon` runs the machine-global daemon in the foreground —
|
|
13
|
+
* the process `ensureDaemon()` spawns detached. It owns every spawned service
|
|
14
|
+
* and uses global state dirs (`~/.nomoreide/logs`, `~/.nomoreide`), so any
|
|
15
|
+
* session on the machine sees the same services and logs.
|
|
16
|
+
*/
|
|
17
|
+
export async function runDaemonCli(args, options = {}) {
|
|
18
|
+
const stdout = options.stdout ?? ((line) => console.log(line));
|
|
19
|
+
const stderr = options.stderr ?? ((line) => console.error(line));
|
|
20
|
+
const statePath = options.statePath ?? defaultDaemonStatePath();
|
|
21
|
+
const subcommand = args.find((arg) => !arg.startsWith("--"));
|
|
22
|
+
const portArg = args.find((arg) => arg.startsWith("--port="));
|
|
23
|
+
const port = options.port ??
|
|
24
|
+
(portArg ? Number(portArg.slice("--port=".length)) : resolveDaemonPort());
|
|
25
|
+
if (subcommand === "status") {
|
|
26
|
+
return await printStatus(statePath, port, stdout);
|
|
27
|
+
}
|
|
28
|
+
if (subcommand === "stop") {
|
|
29
|
+
return await stopDaemon(statePath, port, stdout, stderr);
|
|
30
|
+
}
|
|
31
|
+
if (subcommand === "restart") {
|
|
32
|
+
const stopped = await stopDaemon(statePath, port, stdout, stderr);
|
|
33
|
+
if (stopped !== 0)
|
|
34
|
+
return stopped;
|
|
35
|
+
const result = await ensureDaemon({ statePath, port });
|
|
36
|
+
stdout(`NoMoreIDE daemon restarted: ${result.url} (pid ${result.pid})`);
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
if (subcommand !== undefined) {
|
|
40
|
+
stderr("Usage: nomoreide daemon [status|stop|restart] [--port=N]");
|
|
41
|
+
return 1;
|
|
42
|
+
}
|
|
43
|
+
return await runDaemon(statePath, port, stderr);
|
|
44
|
+
}
|
|
45
|
+
async function runDaemon(statePath, port, stderr) {
|
|
46
|
+
const stateDir = join(homedir(), ".nomoreide");
|
|
47
|
+
let server;
|
|
48
|
+
try {
|
|
49
|
+
server = await createWebServer({
|
|
50
|
+
logDir: join(stateDir, "logs"),
|
|
51
|
+
cwd: process.cwd(),
|
|
52
|
+
port,
|
|
53
|
+
onDaemonShutdown: async () => {
|
|
54
|
+
await rm(statePath, { force: true });
|
|
55
|
+
process.exit(0);
|
|
56
|
+
},
|
|
57
|
+
}).start();
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
const code = error.code;
|
|
61
|
+
if (code === "EADDRINUSE") {
|
|
62
|
+
// Spawn race: another daemon won the bind — exit quietly so the
|
|
63
|
+
// session that spawned us adopts the winner via its health poll.
|
|
64
|
+
stderr(`NoMoreIDE daemon already listening on port ${port}; exiting.`);
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
const state = {
|
|
70
|
+
pid: process.pid,
|
|
71
|
+
url: server.url,
|
|
72
|
+
port: server.port,
|
|
73
|
+
version: appVersion(),
|
|
74
|
+
startedAt: new Date().toISOString(),
|
|
75
|
+
};
|
|
76
|
+
await mkdir(dirname(statePath), { recursive: true });
|
|
77
|
+
await writeFile(statePath, `${JSON.stringify(state, null, 2)}\n`, "utf8");
|
|
78
|
+
// ProcessManager's signal handlers stop services then re-raise; this exit
|
|
79
|
+
// hook only has to clear the state file so the next ensureDaemon respawns.
|
|
80
|
+
process.once("exit", () => {
|
|
81
|
+
try {
|
|
82
|
+
rmSync(statePath, { force: true });
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
// Best effort — a stale file is also caught by the pid-liveness check.
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
stderr(`NoMoreIDE daemon v${state.version}: ${server.url} (pid ${state.pid})`);
|
|
89
|
+
return await new Promise(() => {
|
|
90
|
+
// Runs until a signal or /api/daemon/shutdown exits the process.
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async function printStatus(statePath, port, stdout) {
|
|
94
|
+
const state = await readDaemonState(statePath);
|
|
95
|
+
const url = state?.url ?? `http://127.0.0.1:${port}`;
|
|
96
|
+
const probe = await probeDaemon(url);
|
|
97
|
+
if (probe.kind !== "nomoreide") {
|
|
98
|
+
stdout(`NoMoreIDE daemon: not running (probed ${url})`);
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
const version = probe.health.version ?? state?.version ?? "unknown";
|
|
102
|
+
const pid = probe.health.pid ?? state?.pid;
|
|
103
|
+
stdout(`NoMoreIDE daemon: running at ${url} (pid ${pid ?? "?"}, v${version})`);
|
|
104
|
+
const client = new DaemonClient(url);
|
|
105
|
+
const status = await client.status();
|
|
106
|
+
const services = Object.values(status.services);
|
|
107
|
+
const running = services.filter((service) => service.state === "running");
|
|
108
|
+
stdout(`Services: ${running.length} running / ${services.length} known`);
|
|
109
|
+
for (const service of running) {
|
|
110
|
+
stdout(` ${service.name} pid ${service.pid ?? "?"} ${service.url ?? ""}`);
|
|
111
|
+
}
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
114
|
+
async function stopDaemon(statePath, port, stdout, stderr) {
|
|
115
|
+
const state = await readDaemonState(statePath);
|
|
116
|
+
const url = state?.url ?? `http://127.0.0.1:${port}`;
|
|
117
|
+
const probe = await probeDaemon(url);
|
|
118
|
+
if (probe.kind === "down") {
|
|
119
|
+
await rm(statePath, { force: true });
|
|
120
|
+
stdout("NoMoreIDE daemon is not running.");
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
if (probe.kind === "foreign") {
|
|
124
|
+
stderr(`Port at ${url} is held by a non-NoMoreIDE process; not touching it.`);
|
|
125
|
+
return 1;
|
|
126
|
+
}
|
|
127
|
+
await new DaemonClient(url).shutdown();
|
|
128
|
+
const deadline = Date.now() + 10_000;
|
|
129
|
+
while (Date.now() < deadline) {
|
|
130
|
+
if ((await probeDaemon(url)).kind === "down") {
|
|
131
|
+
stdout("NoMoreIDE daemon stopped (all services shut down).");
|
|
132
|
+
return 0;
|
|
133
|
+
}
|
|
134
|
+
await new Promise((resolveSleep) => setTimeout(resolveSleep, 200));
|
|
135
|
+
}
|
|
136
|
+
stderr("Daemon did not exit within 10s; its services may still be stopping.");
|
|
137
|
+
return 1;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=daemon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daemon.js","sourceRoot":"","sources":["../../src/cli/daemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,WAAW,EACX,eAAe,EACf,iBAAiB,GAElB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC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MAAM,GAAG,GAAG,KAAK,EAAE,GAAG,IAAI,oBAAoB,IAAI,EAAE,CAAC;IACrD,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1B,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACrC,MAAM,CAAC,kCAAkC,CAAC,CAAC;QAC3C,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,CAAC,WAAW,GAAG,uDAAuD,CAAC,CAAC;QAC9E,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;IACrC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;QAC7B,IAAI,CAAC,MAAM,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC7C,MAAM,CAAC,oDAAoD,CAAC,CAAC;YAC7D,OAAO,CAAC,CAAC;QACX,CAAC;QACD,MAAM,IAAI,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,UAAU,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,CAAC,qEAAqE,CAAC,CAAC;IAC9E,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { applyProfile, createRegistryTokenManager, deleteProfile, exportProfile, getProfile, importProfile, installProfileFromRegistry, listProfiles, previewProfileApply, publishProfileToRegistry, resolveRegistryApiBaseUrl, resolveRegistryApiToken, snapshotProfileFromAgent, } from "../core/agent-profiles/index.js";
|
|
2
|
+
import { AGENT_NAMES } from "../core/agent-env/index.js";
|
|
3
|
+
import { UsageError } from "./errors.js";
|
|
4
|
+
import { parseFlags } from "./flags.js";
|
|
5
|
+
const USAGE = [
|
|
6
|
+
"Usage: nomoreide profile <subcommand>",
|
|
7
|
+
" list saved profiles",
|
|
8
|
+
" show <name> full profile JSON",
|
|
9
|
+
" snapshot <agent> <name> [--description <text>]",
|
|
10
|
+
" apply <name> <agent> [--dry-run] [--skip-mcps a,b] [--skip-skills x,y]",
|
|
11
|
+
" export <name> [--output <path>] credential-redacted .tar.gz",
|
|
12
|
+
" import <archive> [--force] [--as <name>]",
|
|
13
|
+
" delete <name>",
|
|
14
|
+
" publish <name> --slug <slug> --title <title> [--version <v>] [--summary <text>]",
|
|
15
|
+
" install <slug> [--force] [--as <name>] install from the hosted registry",
|
|
16
|
+
].join("\n");
|
|
17
|
+
/** Agent profiles on the CLI (ROR-64) — same core as the UI and MCP tools. */
|
|
18
|
+
export async function runProfileCli(subcommand, args, stdout) {
|
|
19
|
+
const cwd = process.cwd();
|
|
20
|
+
const flags = parseFlags(args);
|
|
21
|
+
const positional = args.filter((arg, index) => {
|
|
22
|
+
if (arg.startsWith("--"))
|
|
23
|
+
return false;
|
|
24
|
+
const previous = args[index - 1];
|
|
25
|
+
return !(previous?.startsWith("--") && !previous.includes("="));
|
|
26
|
+
});
|
|
27
|
+
const has = (flag) => args.includes(flag);
|
|
28
|
+
if (subcommand === undefined || subcommand === "list") {
|
|
29
|
+
const profiles = await listProfiles();
|
|
30
|
+
if (profiles.length === 0) {
|
|
31
|
+
stdout("No profiles yet. Create one with: nomoreide profile snapshot <agent> <name>");
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
stdout("Name\tMCPs\tSkills\tUpdated\tDescription");
|
|
35
|
+
for (const profile of profiles) {
|
|
36
|
+
stdout(`${profile.name}\t${profile.mcpCount}\t${profile.skillCount}\t${profile.updatedAt}\t${profile.description ?? ""}`);
|
|
37
|
+
}
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
if (subcommand === "show") {
|
|
41
|
+
const name = requirePositional(positional[0], "profile name");
|
|
42
|
+
stdout(JSON.stringify(await getProfile(name), null, 2));
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
45
|
+
if (subcommand === "snapshot") {
|
|
46
|
+
const agent = requireAgent(positional[0]);
|
|
47
|
+
const name = requirePositional(positional[1], "profile name");
|
|
48
|
+
const profile = await snapshotProfileFromAgent({
|
|
49
|
+
agent,
|
|
50
|
+
name,
|
|
51
|
+
description: flags.description,
|
|
52
|
+
cwd,
|
|
53
|
+
});
|
|
54
|
+
stdout(`Snapshotted ${agent} into "${profile.name}" (${Object.keys(profile.mcps).length} MCPs, ${profile.skills.length} skills)`);
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
57
|
+
if (subcommand === "apply") {
|
|
58
|
+
const name = requirePositional(positional[0], "profile name");
|
|
59
|
+
const agent = requireAgent(positional[1]);
|
|
60
|
+
if (has("--dry-run")) {
|
|
61
|
+
const preview = await previewProfileApply({ cwd, name, agent });
|
|
62
|
+
stdout("Item\tStatus");
|
|
63
|
+
for (const item of preview.items) {
|
|
64
|
+
const warnings = item.warnings.length > 0 ? ` (${item.warnings.join("; ")})` : "";
|
|
65
|
+
stdout(`${item.category} ${item.name}\t${item.status}${warnings}`);
|
|
66
|
+
}
|
|
67
|
+
if (preview.unresolvedCredentials.length > 0) {
|
|
68
|
+
stdout(`Unresolved credentials: ${preview.unresolvedCredentials.join(", ")}`);
|
|
69
|
+
}
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
72
|
+
const result = await applyProfile({
|
|
73
|
+
cwd,
|
|
74
|
+
name,
|
|
75
|
+
agent,
|
|
76
|
+
skip: { mcps: splitList(flags.skipMcps), skills: splitList(flags.skipSkills) },
|
|
77
|
+
});
|
|
78
|
+
stdout(`Applied "${result.profile}" to ${result.agent}: ${result.mcpsApplied.length} MCPs, ${result.skillsApplied.length} skills` +
|
|
79
|
+
(result.skipped.length > 0 ? `, skipped ${result.skipped.join(", ")}` : ""));
|
|
80
|
+
for (const backup of result.backups)
|
|
81
|
+
stdout(`Backup: ${backup}`);
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
84
|
+
if (subcommand === "export") {
|
|
85
|
+
const name = requirePositional(positional[0], "profile name");
|
|
86
|
+
const result = await exportProfile({ name, outputPath: flags.output, cwd });
|
|
87
|
+
stdout(`Exported to ${result.archivePath} (credentials redacted)`);
|
|
88
|
+
if (result.credentials.length > 0) {
|
|
89
|
+
stdout(`Importers must supply: ${result.credentials.map((spec) => spec.key).join(", ")}`);
|
|
90
|
+
}
|
|
91
|
+
return 0;
|
|
92
|
+
}
|
|
93
|
+
if (subcommand === "import") {
|
|
94
|
+
const archivePath = requirePositional(positional[0], "archive path");
|
|
95
|
+
const result = await importProfile({ archivePath, force: has("--force"), as: flags.as });
|
|
96
|
+
stdout(`Imported "${result.name}" (${result.mcpCount} MCPs, ${result.skillCount} skills)`);
|
|
97
|
+
reportMissingCredentials(result.missingCredentials, stdout);
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
100
|
+
if (subcommand === "delete") {
|
|
101
|
+
const name = requirePositional(positional[0], "profile name");
|
|
102
|
+
await deleteProfile(name);
|
|
103
|
+
stdout(`Deleted profile "${name}"`);
|
|
104
|
+
return 0;
|
|
105
|
+
}
|
|
106
|
+
if (subcommand === "publish") {
|
|
107
|
+
const name = requirePositional(positional[0], "profile name");
|
|
108
|
+
if (!flags.slug || !flags.title)
|
|
109
|
+
throw new UsageError("--slug and --title are required");
|
|
110
|
+
const tokenManager = createRegistryTokenManager();
|
|
111
|
+
if ((await tokenManager.getAccessToken()) === null) {
|
|
112
|
+
throw new UsageError("Not signed in to the registry. Sign in from the web UI (Agent Environments) or set BRAINCTL_API_TOKEN.");
|
|
113
|
+
}
|
|
114
|
+
const result = await publishProfileToRegistry({
|
|
115
|
+
name,
|
|
116
|
+
slug: flags.slug,
|
|
117
|
+
title: flags.title,
|
|
118
|
+
summary: flags.summary,
|
|
119
|
+
version: flags.version,
|
|
120
|
+
cwd,
|
|
121
|
+
apiBaseUrl: await resolveRegistryApiBaseUrl(),
|
|
122
|
+
fetch: (input, init) => tokenManager.authenticatedFetch(typeof input === "string" ? input : input.toString(), init),
|
|
123
|
+
});
|
|
124
|
+
stdout(`Published "${result.slug}" v${result.version} to the registry (credentials redacted)`);
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
127
|
+
if (subcommand === "install") {
|
|
128
|
+
const slug = requirePositional(positional[0], "registry slug");
|
|
129
|
+
const result = await installProfileFromRegistry({
|
|
130
|
+
slug,
|
|
131
|
+
force: has("--force"),
|
|
132
|
+
as: flags.as,
|
|
133
|
+
apiBaseUrl: await resolveRegistryApiBaseUrl(),
|
|
134
|
+
token: (await resolveRegistryApiToken())?.token,
|
|
135
|
+
});
|
|
136
|
+
stdout(`Installed "${result.name}" v${result.version} (${result.mcpCount} MCPs, ${result.skillCount} skills)`);
|
|
137
|
+
reportMissingCredentials(result.missingCredentials, stdout);
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
throw new UsageError(USAGE);
|
|
141
|
+
}
|
|
142
|
+
function requirePositional(value, label) {
|
|
143
|
+
if (!value)
|
|
144
|
+
throw new UsageError(`${label} is required`);
|
|
145
|
+
return value;
|
|
146
|
+
}
|
|
147
|
+
function requireAgent(value) {
|
|
148
|
+
if (!value || !AGENT_NAMES.includes(value)) {
|
|
149
|
+
throw new UsageError(`agent is required (one of: ${AGENT_NAMES.join(", ")})`);
|
|
150
|
+
}
|
|
151
|
+
return value;
|
|
152
|
+
}
|
|
153
|
+
function splitList(value) {
|
|
154
|
+
if (!value)
|
|
155
|
+
return undefined;
|
|
156
|
+
const items = value
|
|
157
|
+
.split(",")
|
|
158
|
+
.map((item) => item.trim())
|
|
159
|
+
.filter(Boolean);
|
|
160
|
+
return items.length > 0 ? items : undefined;
|
|
161
|
+
}
|
|
162
|
+
function reportMissingCredentials(missing, stdout) {
|
|
163
|
+
if (missing.length === 0)
|
|
164
|
+
return;
|
|
165
|
+
stdout(`Credentials still needed (placeholders kept): ${missing.map((spec) => spec.key).join(", ")}`);
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/cli/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,0BAA0B,EAC1B,aAAa,EACb,aAAa,EACb,UAAU,EACV,aAAa,EACb,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAkB,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,KAAK,GAAG;IACZ,uCAAuC;IACvC,wDAAwD;IACxD,2DAA2D;IAC3D,kDAAkD;IAClD,0EAA0E;IAC1E,oEAAoE;IACpE,4CAA4C;IAC5C,iBAAiB;IACjB,mFAAmF;IACnF,6EAA6E;CAC9E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,UAA8B,EAC9B,IAAc,EACd,MAA8B;IAE9B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5C,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QACvC,MAAM,QAAQ,GA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AC9F,CAAC;AACJ,CAAC"}
|
|
@@ -18,7 +18,7 @@ export declare const pendingChangeSchema: z.ZodObject<{
|
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
19
|
action: "remove" | "copy" | "move";
|
|
20
20
|
name: string;
|
|
21
|
-
category: "
|
|
21
|
+
category: "skill" | "mcp";
|
|
22
22
|
sourceAgent: "claude" | "codex" | "antigravity";
|
|
23
23
|
sourceScope: "user" | "project";
|
|
24
24
|
targetAgent?: "claude" | "codex" | "antigravity" | undefined;
|
|
@@ -26,7 +26,7 @@ export declare const pendingChangeSchema: z.ZodObject<{
|
|
|
26
26
|
}, {
|
|
27
27
|
action: "remove" | "copy" | "move";
|
|
28
28
|
name: string;
|
|
29
|
-
category: "
|
|
29
|
+
category: "skill" | "mcp";
|
|
30
30
|
sourceAgent: "claude" | "codex" | "antigravity";
|
|
31
31
|
sourceScope?: "user" | "project" | undefined;
|
|
32
32
|
targetAgent?: "claude" | "codex" | "antigravity" | undefined;
|
|
@@ -44,7 +44,7 @@ export declare const pendingChangesSchema: z.ZodArray<z.ZodObject<{
|
|
|
44
44
|
}, "strip", z.ZodTypeAny, {
|
|
45
45
|
action: "remove" | "copy" | "move";
|
|
46
46
|
name: string;
|
|
47
|
-
category: "
|
|
47
|
+
category: "skill" | "mcp";
|
|
48
48
|
sourceAgent: "claude" | "codex" | "antigravity";
|
|
49
49
|
sourceScope: "user" | "project";
|
|
50
50
|
targetAgent?: "claude" | "codex" | "antigravity" | undefined;
|
|
@@ -52,7 +52,7 @@ export declare const pendingChangesSchema: z.ZodArray<z.ZodObject<{
|
|
|
52
52
|
}, {
|
|
53
53
|
action: "remove" | "copy" | "move";
|
|
54
54
|
name: string;
|
|
55
|
-
category: "
|
|
55
|
+
category: "skill" | "mcp";
|
|
56
56
|
sourceAgent: "claude" | "codex" | "antigravity";
|
|
57
57
|
sourceScope?: "user" | "project" | undefined;
|
|
58
58
|
targetAgent?: "claude" | "codex" | "antigravity" | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const DEFAULT_REGISTRY_API_BASE_URL = "https://api.brainctl.net";
|
|
2
|
-
export declare const DEFAULT_REGISTRY_FRONTEND_URL = "https://
|
|
2
|
+
export declare const DEFAULT_REGISTRY_FRONTEND_URL = "https://www.brainctl.net";
|
|
3
3
|
export type RegistryConfigKey = "apiBaseUrl" | "apiToken" | "apiRefreshToken" | "apiFrontendUrl";
|
|
4
4
|
export interface RegistryConfig {
|
|
5
5
|
apiBaseUrl?: string;
|