frely-cli 0.23.3 → 0.23.5

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 CHANGED
@@ -90,8 +90,8 @@ To check the connection, ask the client to list the top-level names in your work
90
90
 
91
91
  ## More features
92
92
 
93
- - **Frely-hosted Agents**: `frely agent install <distribution-id> --host claude-code` installs an Agent as a local Skill; `frely agent run` calls it. [More](https://cli.frely.cloud/docs/help/install-agents-and-items/)
94
- - **Marketplace Prompts and Skills**: `frely item install <username/skill-name> --host claude-code`. Paid parts install only when your account holds a pass. `frely item update` lists installed items that have a newer version; it changes nothing until you run `frely item update <folder>`. [More](https://cli.frely.cloud/docs/help/install-agents-and-items/)
93
+ - **Frely-hosted Agents**: `frely item install <username/name> --host claude-code` installs an Agent as a local Skill; `frely agent run <username/name>` calls it. [More](https://cli.frely.cloud/docs/help/install-agents-and-items/)
94
+ - **Marketplace Prompts and Skills**: `frely item install <username/name> --host claude-code` (the same command installs Agents too; add `@3` for version 3). Paid parts install only when your account holds a pass. `frely item update` lists installed items that have a newer version; it changes nothing until you run `frely item update <folder>`. [More](https://cli.frely.cloud/docs/help/install-agents-and-items/)
95
95
  - **Local model sharing**: `frely provider share ollama` publishes a loopback model server as your personal Frely Provider. [More](https://cli.frely.cloud/docs/help/share-local-model/)
96
96
  - **Your account from the terminal**: `frely api list|describe|call`. [More](https://cli.frely.cloud/docs/help/manage-account-from-cli/)
97
97
 
package/README.zh-CN.md CHANGED
@@ -89,8 +89,8 @@ FrelyMCP 是整个账号共用的一个 MCP 地址:`https://mcp.frely.cloud/mc
89
89
 
90
90
  ## 更多功能
91
91
 
92
- - **Frely 托管的 Agent**:`frely agent install <distribution-id> --host claude-code` 安装为本地 Skill,`frely agent run` 调用。[详情](https://cli.frely.cloud/docs/help/install-agents-and-items/)
93
- - **市场里的 Prompt 和 Skill**:`frely item install <username/skill-name> --host claude-code`,付费部分需要账号持有通行证。[详情](https://cli.frely.cloud/docs/help/install-agents-and-items/)
92
+ - **Frely 托管的 Agent**:`frely item install <username/name> --host claude-code` 安装为本地 Skill,`frely agent run <username/name>` 调用。[详情](https://cli.frely.cloud/docs/help/install-agents-and-items/)
93
+ - **市场里的 Prompt 和 Skill**:`frely item install <username/name> --host claude-code`(Agent 也用同一条命令,加 `@3` 指定版本 3),付费部分需要账号持有通行证。[详情](https://cli.frely.cloud/docs/help/install-agents-and-items/)
94
94
  - **本地模型共享**:`frely provider share ollama` 把本机模型服务发布为你的个人 Frely Provider。[详情](https://cli.frely.cloud/docs/help/share-local-model/)
95
95
  - **在终端管理账号**:`frely api list|describe|call`。[详情](https://cli.frely.cloud/docs/help/manage-account-from-cli/)
96
96
 
@@ -138,31 +138,49 @@ export declare const COMMANDS: readonly [{
138
138
  readonly purpose: "Without a folder, list the installed marketplace items and say which have a newer version; nothing is changed. With a folder, install the newer version into that folder, after you decide to. Frely never updates an item by itself. A folder you edited is refused, and a new version needs a new review (frely item trust) unless Frely's scan passed for it.";
139
139
  }, {
140
140
  readonly id: "item.install";
141
- readonly usage: "frely item install <username/skill-name> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <path>] [--json]";
141
+ readonly usage: "frely item install <username/name[@version]> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <path>] [--json]";
142
142
  readonly auth: "cloud-oauth";
143
143
  readonly effect: "local-write";
144
144
  readonly purpose: "Install a download-install Prompt or Skill from the marketplace through Frely Cloud. The paid part is installed only with a valid pass; otherwise the command prints how to buy one. Skills go to the host Skill folder, Prompts to --dir (default: current directory). Scripts are saved without execute permission.";
145
+ }, {
146
+ readonly id: "remote.tools";
147
+ readonly usage: "frely remote tools <username/name> [--json]";
148
+ readonly auth: "cloud-oauth";
149
+ readonly effect: "remote-read";
150
+ readonly purpose: "List the tools of a remote MCP product from the marketplace, with their input schemas, without configuring it in an MCP client. The first use asks Frely for a key that works only for this MCP.";
151
+ }, {
152
+ readonly id: "remote.call";
153
+ readonly usage: "frely remote call <username/name> <tool> [--json '<object>' | --input <file>]";
154
+ readonly auth: "cloud-oauth";
155
+ readonly effect: "remote-call";
156
+ readonly purpose: "Call one tool of a remote MCP product and print the result as JSON (exit code 1 when the tool reports an error). Each call is billed or needs a pass exactly as in an MCP client; ask the user before a call that writes data they did not ask for.";
157
+ }, {
158
+ readonly id: "remote.config";
159
+ readonly usage: "frely remote config <username/name> [--write <file>]";
160
+ readonly auth: "cloud-oauth";
161
+ readonly effect: "remote-write";
162
+ readonly purpose: "Get a new key for one remote MCP product (it replaces the previous one) and print the mcpServers JSON that MCP clients take for it; with --write the entry is merged into that JSON file (created 0600) instead of printed. The key works only for this MCP.";
145
163
  }, {
146
164
  readonly id: "agent.install";
147
- readonly usage: "frely agent install <distribution-id|manifest-url> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <project>] [--api-key-stdin] [--json]";
165
+ readonly usage: "frely agent install <username/name[@version]> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <project>] [--api-key-stdin] [--json]";
148
166
  readonly auth: "optional-api-key";
149
167
  readonly effect: "local-write";
150
168
  readonly purpose: "Install the public Agent's trigger Skill; an API key goes only through stdin to secure storage.";
151
169
  }, {
152
170
  readonly id: "agent.run";
153
- readonly usage: "frely agent run <distribution-id> (--input <text>|--input-stdin) [--json]";
171
+ readonly usage: "frely agent run <username/name> (--input <text>|--input-stdin) [--json]";
154
172
  readonly auth: "installed-api-key-or-account";
155
173
  readonly effect: "remote-call";
156
174
  readonly purpose: "Send the complete relevant user request to the installed Agent through model-scoped MCP. Usage may be billed.";
157
175
  }, {
158
176
  readonly id: "agent.status";
159
- readonly usage: "frely agent status (<distribution-id>|--api-key-stdin [--relay <url>]) [--json]";
177
+ readonly usage: "frely agent status (<username/name>|--api-key-stdin [--relay <url>]) [--json]";
160
178
  readonly auth: "none-or-api-key";
161
179
  readonly effect: "read";
162
180
  readonly purpose: "Inspect an installed Agent Skill and, for API-key installs, its Key budget. With --api-key-stdin, read that Key's budget without installing or logging in.";
163
181
  }, {
164
182
  readonly id: "agent.remove";
165
- readonly usage: "frely agent remove <distribution-id> [--json]";
183
+ readonly usage: "frely agent remove <username/name> [--json]";
166
184
  readonly auth: "none";
167
185
  readonly effect: "local-write";
168
186
  readonly purpose: "Remove an installed Agent Skill and its saved API key.";
@@ -409,31 +427,49 @@ export declare function agentHelp(): {
409
427
  readonly purpose: "Without a folder, list the installed marketplace items and say which have a newer version; nothing is changed. With a folder, install the newer version into that folder, after you decide to. Frely never updates an item by itself. A folder you edited is refused, and a new version needs a new review (frely item trust) unless Frely's scan passed for it.";
410
428
  }, {
411
429
  readonly id: "item.install";
412
- readonly usage: "frely item install <username/skill-name> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <path>] [--json]";
430
+ readonly usage: "frely item install <username/name[@version]> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <path>] [--json]";
413
431
  readonly auth: "cloud-oauth";
414
432
  readonly effect: "local-write";
415
433
  readonly purpose: "Install a download-install Prompt or Skill from the marketplace through Frely Cloud. The paid part is installed only with a valid pass; otherwise the command prints how to buy one. Skills go to the host Skill folder, Prompts to --dir (default: current directory). Scripts are saved without execute permission.";
434
+ }, {
435
+ readonly id: "remote.tools";
436
+ readonly usage: "frely remote tools <username/name> [--json]";
437
+ readonly auth: "cloud-oauth";
438
+ readonly effect: "remote-read";
439
+ readonly purpose: "List the tools of a remote MCP product from the marketplace, with their input schemas, without configuring it in an MCP client. The first use asks Frely for a key that works only for this MCP.";
440
+ }, {
441
+ readonly id: "remote.call";
442
+ readonly usage: "frely remote call <username/name> <tool> [--json '<object>' | --input <file>]";
443
+ readonly auth: "cloud-oauth";
444
+ readonly effect: "remote-call";
445
+ readonly purpose: "Call one tool of a remote MCP product and print the result as JSON (exit code 1 when the tool reports an error). Each call is billed or needs a pass exactly as in an MCP client; ask the user before a call that writes data they did not ask for.";
446
+ }, {
447
+ readonly id: "remote.config";
448
+ readonly usage: "frely remote config <username/name> [--write <file>]";
449
+ readonly auth: "cloud-oauth";
450
+ readonly effect: "remote-write";
451
+ readonly purpose: "Get a new key for one remote MCP product (it replaces the previous one) and print the mcpServers JSON that MCP clients take for it; with --write the entry is merged into that JSON file (created 0600) instead of printed. The key works only for this MCP.";
416
452
  }, {
417
453
  readonly id: "agent.install";
418
- readonly usage: "frely agent install <distribution-id|manifest-url> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <project>] [--api-key-stdin] [--json]";
454
+ readonly usage: "frely agent install <username/name[@version]> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <project>] [--api-key-stdin] [--json]";
419
455
  readonly auth: "optional-api-key";
420
456
  readonly effect: "local-write";
421
457
  readonly purpose: "Install the public Agent's trigger Skill; an API key goes only through stdin to secure storage.";
422
458
  }, {
423
459
  readonly id: "agent.run";
424
- readonly usage: "frely agent run <distribution-id> (--input <text>|--input-stdin) [--json]";
460
+ readonly usage: "frely agent run <username/name> (--input <text>|--input-stdin) [--json]";
425
461
  readonly auth: "installed-api-key-or-account";
426
462
  readonly effect: "remote-call";
427
463
  readonly purpose: "Send the complete relevant user request to the installed Agent through model-scoped MCP. Usage may be billed.";
428
464
  }, {
429
465
  readonly id: "agent.status";
430
- readonly usage: "frely agent status (<distribution-id>|--api-key-stdin [--relay <url>]) [--json]";
466
+ readonly usage: "frely agent status (<username/name>|--api-key-stdin [--relay <url>]) [--json]";
431
467
  readonly auth: "none-or-api-key";
432
468
  readonly effect: "read";
433
469
  readonly purpose: "Inspect an installed Agent Skill and, for API-key installs, its Key budget. With --api-key-stdin, read that Key's budget without installing or logging in.";
434
470
  }, {
435
471
  readonly id: "agent.remove";
436
- readonly usage: "frely agent remove <distribution-id> [--json]";
472
+ readonly usage: "frely agent remove <username/name> [--json]";
437
473
  readonly auth: "none";
438
474
  readonly effect: "local-write";
439
475
  readonly purpose: "Remove an installed Agent Skill and its saved API key.";
@@ -23,11 +23,14 @@ export const COMMANDS = [
23
23
  { id: "item.trust", usage: "frely item trust <folder> [--check]", auth: "none", effect: "local-write", purpose: "Remember that the installed files of an item were reviewed, or with --check print trusted / not reviewed (exit 1 when not reviewed). A new version must be reviewed again." },
24
24
  { id: "item.run", usage: "frely item run <script> [args...]", auth: "cloud-oauth", effect: "local-execution", purpose: "Run an encrypted paid script of an installed item inside the Frely command sandbox. The placeholder file at the script's path calls this for you. The access lease is renewed when it is near its end; without a valid pass the script does not run." },
25
25
  { id: "item.update", usage: "frely item update [<folder>] [--json]", auth: "cloud-oauth", effect: "local-write", purpose: "Without a folder, list the installed marketplace items and say which have a newer version; nothing is changed. With a folder, install the newer version into that folder, after you decide to. Frely never updates an item by itself. A folder you edited is refused, and a new version needs a new review (frely item trust) unless Frely's scan passed for it." },
26
- { id: "item.install", usage: "frely item install <username/skill-name> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <path>] [--json]", auth: "cloud-oauth", effect: "local-write", purpose: "Install a download-install Prompt or Skill from the marketplace through Frely Cloud. The paid part is installed only with a valid pass; otherwise the command prints how to buy one. Skills go to the host Skill folder, Prompts to --dir (default: current directory). Scripts are saved without execute permission." },
27
- { id: "agent.install", usage: "frely agent install <distribution-id|manifest-url> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <project>] [--api-key-stdin] [--json]", auth: "optional-api-key", effect: "local-write", purpose: "Install the public Agent's trigger Skill; an API key goes only through stdin to secure storage." },
28
- { id: "agent.run", usage: "frely agent run <distribution-id> (--input <text>|--input-stdin) [--json]", auth: "installed-api-key-or-account", effect: "remote-call", purpose: "Send the complete relevant user request to the installed Agent through model-scoped MCP. Usage may be billed." },
29
- { id: "agent.status", usage: "frely agent status (<distribution-id>|--api-key-stdin [--relay <url>]) [--json]", auth: "none-or-api-key", effect: "read", purpose: "Inspect an installed Agent Skill and, for API-key installs, its Key budget. With --api-key-stdin, read that Key's budget without installing or logging in." },
30
- { id: "agent.remove", usage: "frely agent remove <distribution-id> [--json]", auth: "none", effect: "local-write", purpose: "Remove an installed Agent Skill and its saved API key." },
26
+ { id: "item.install", usage: "frely item install <username/name[@version]> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <path>] [--json]", auth: "cloud-oauth", effect: "local-write", purpose: "Install a download-install Prompt or Skill from the marketplace through Frely Cloud. The paid part is installed only with a valid pass; otherwise the command prints how to buy one. Skills go to the host Skill folder, Prompts to --dir (default: current directory). Scripts are saved without execute permission." },
27
+ { id: "remote.tools", usage: "frely remote tools <username/name> [--json]", auth: "cloud-oauth", effect: "remote-read", purpose: "List the tools of a remote MCP product from the marketplace, with their input schemas, without configuring it in an MCP client. The first use asks Frely for a key that works only for this MCP." },
28
+ { id: "remote.call", usage: "frely remote call <username/name> <tool> [--json '<object>' | --input <file>]", auth: "cloud-oauth", effect: "remote-call", purpose: "Call one tool of a remote MCP product and print the result as JSON (exit code 1 when the tool reports an error). Each call is billed or needs a pass exactly as in an MCP client; ask the user before a call that writes data they did not ask for." },
29
+ { id: "remote.config", usage: "frely remote config <username/name> [--write <file>]", auth: "cloud-oauth", effect: "remote-write", purpose: "Get a new key for one remote MCP product (it replaces the previous one) and print the mcpServers JSON that MCP clients take for it; with --write the entry is merged into that JSON file (created 0600) instead of printed. The key works only for this MCP." },
30
+ { id: "agent.install", usage: "frely agent install <username/name[@version]> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <project>] [--api-key-stdin] [--json]", auth: "optional-api-key", effect: "local-write", purpose: "Install the public Agent's trigger Skill; an API key goes only through stdin to secure storage." },
31
+ { id: "agent.run", usage: "frely agent run <username/name> (--input <text>|--input-stdin) [--json]", auth: "installed-api-key-or-account", effect: "remote-call", purpose: "Send the complete relevant user request to the installed Agent through model-scoped MCP. Usage may be billed." },
32
+ { id: "agent.status", usage: "frely agent status (<username/name>|--api-key-stdin [--relay <url>]) [--json]", auth: "none-or-api-key", effect: "read", purpose: "Inspect an installed Agent Skill and, for API-key installs, its Key budget. With --api-key-stdin, read that Key's budget without installing or logging in." },
33
+ { id: "agent.remove", usage: "frely agent remove <username/name> [--json]", auth: "none", effect: "local-write", purpose: "Remove an installed Agent Skill and its saved API key." },
31
34
  { id: "provider.share", usage: "frely provider share [ollama|openai-compatible] [--url <loopback-v1-url>] [--models <a,b>] [--slot <slot-id>] [--name <name>]", auth: "account", effect: "remote-write", purpose: "Publish a local model Provider. If a prepared Provider on this device is not finished, resume it instead." },
32
35
  { id: "provider.list", usage: "frely provider list [--json]", auth: "account", effect: "read", purpose: "List configured local Providers." },
33
36
  { id: "tunnel", usage: "frely tunnel <host>:<port> [--local-port N]", auth: "none", effect: "local-execution", purpose: "Run inside a sandboxed command (run_command): listen on 127.0.0.1:<local-port> (default: the same port) and forward each TCP connection to host:port through the command sandbox's proxy, so database and redis clients connect to 127.0.0.1 without turning the sandbox off. Start it in the same command as the client, for example `frely tunnel db.example.com:5432 & sleep 1; psql -h 127.0.0.1 ...`. Prints the local address and runs until killed." },
@@ -76,7 +79,7 @@ const GROUPS = [
76
79
  { title: "Marketplace items", ids: ["item.install", "item.update", "item.run", "item.trust"] },
77
80
  { title: "Providers", ids: ["provider.share", "provider.list"] },
78
81
  { title: "Command sandbox", ids: ["tunnel", "sandbox.proxy"] },
79
- { title: "API", ids: ["api"] },
82
+ { title: "API", ids: ["api", "remote.tools", "remote.call", "remote.config"] },
80
83
  ];
81
84
  // Short, flag-light forms for the human `--help` overview. The full usage
82
85
  // strings (with every flag) live on COMMANDS and stay in `frely help --agent
@@ -93,19 +96,22 @@ const SHORT_USAGE = {
93
96
  "mcp.local": "frely mcp local list|add <name> (--url <address>|-- <command>)|remove <name>",
94
97
  "mcp.lifecycle": "frely mcp status|stop|remove",
95
98
  "skill.install": "frely skill install [--host <host>]",
96
- "item.install": "frely item install <username/skill-name> [--host <host>]",
99
+ "item.install": "frely item install <username/name[@version]> [--host <host>]",
97
100
  "item.update": "frely item update [<folder>]",
98
101
  "item.run": "frely item run <script> [args...]",
99
102
  "item.trust": "frely item trust <folder> [--check]",
100
- "agent.install": "frely agent install <distribution-id> [--host <host>] [--api-key-stdin]",
101
- "agent.run": "frely agent run <distribution-id> (--input <text>|--input-stdin)",
102
- "agent.status": "frely agent status <distribution-id>",
103
- "agent.remove": "frely agent remove <distribution-id>",
103
+ "agent.install": "frely agent install <username/name> [--host <host>] [--api-key-stdin]",
104
+ "agent.run": "frely agent run <username/name> (--input <text>|--input-stdin)",
105
+ "agent.status": "frely agent status <username/name>",
106
+ "agent.remove": "frely agent remove <username/name>",
104
107
  "provider.share": "frely provider share [ollama|openai-compatible] [--models <a,b>]",
105
108
  "provider.list": "frely provider list",
106
109
  tunnel: "frely tunnel <host>:<port> [--local-port N]",
107
110
  "sandbox.proxy": "frely sandbox proxy [<url> [--no-proxy <list>] | --clear]",
108
111
  api: "frely api list|describe|call",
112
+ "remote.tools": "frely remote tools <username/name> [--json]",
113
+ "remote.call": "frely remote call <username/name> <tool> [--json '<object>']",
114
+ "remote.config": "frely remote config <username/name> [--write <file>]",
109
115
  };
110
116
  export function cliUsage() {
111
117
  const lines = ["Usage: frely <command>\n"];
@@ -1 +1 @@
1
- {"version":3,"file":"agent-help.js","sourceRoot":"","sources":["../src/agent-help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,+KAA+K,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,ybAAyb,EAAE;IAC9rB,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,+EAA+E,EAAE;IACtK,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,kCAAkC,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,cAAc,EAAE,OAA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AC,CAAC;IACvE,OAAO,WAAW,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,OAAO,sEAAsE;UACzE,CAAC,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,GAAG,WAAW,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;UAChH,kFAAkF;UAClF,6VAA6V;UAC7V,iHAAiH;UACjH,8LAA8L,CAAC;AACrM,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { applyDataDir, activeDataDir } from "./data-dir.js";
3
3
  import { update } from "./update/update.js";
4
- import { requireMcpAuthorization, inspectMcpMetadataOrQuarantine, revokeMcpAuthorization, generateMcpKey, parseMcpDays, MCP_DEFAULT_DAYS } from "./mcp-authorization.js";
5
- import { realpath } from "node:fs/promises";
4
+ import { requireMcpAuthorization, inspectMcpMetadata, inspectMcpMetadataOrQuarantine, revokeMcpAuthorization, generateMcpKey, parseMcpDays, MCP_DEFAULT_DAYS } from "./mcp-authorization.js";
5
+ import { chmod, readFile, realpath, stat, writeFile } from "node:fs/promises";
6
6
  import { homedir } from "node:os";
7
7
  import { sshProxyConnect } from "./runtime/ssh-proxy.js";
8
8
  import { parseTunnelArguments, startTunnel, tunnelUsage } from "./runtime/tunnel.js";
@@ -35,15 +35,29 @@ import { getKeyBudget, KeyBudgetError, publicKeyBudgetError } from "./key-budget
35
35
  import { runNetwork, publicNetworkError } from "./network.js";
36
36
  import { runComputerCommand } from "./computer/command.js";
37
37
  import { runComputerMcpServer } from "./computer/server.js";
38
- import { agentManifestUrl, installSkillAdapter, invokeInstalledAgent, publicSkillAccessError, removeSkillAdapter, skillAdapterStatus } from "./skill/access.js";
39
- import { installCloudItem, parseItemRef, trustCloudItem } from "./skill/cloud-item.js";
38
+ import { agentManifestUrl, installSkillAdapter, invokeInstalledAgent, publicSkillAccessError, removeSkillAdapter, resolveAgentTarget, SkillAccessError, skillAdapterStatus } from "./skill/access.js";
39
+ import { CloudToolError, installCloudItem, parseItemRef, trustCloudItem } from "./skill/cloud-item.js";
40
40
  import { checkItemUpdates, updateCloudItem } from "./skill/item-update.js";
41
41
  import { runSealedScript } from "./skill/sealed-run.js";
42
42
  import { installEntrySkill } from "./skill/entry.js";
43
+ import { callRemoteTool, connectRemoteMcp, installRemoteMcpSkill, isNotASkill, listRemoteTools, mcpClientConfig, parseMcpName, RemoteMcpError } from "./skill/remote-mcp.js";
43
44
  import { callCloudTool } from "./cloud.js";
44
45
  import { createInterface } from "node:readline/promises";
45
46
  import { runUninstall } from "./uninstall.js";
46
47
  const DEFAULT_EMAIL_LOGIN_MCP_DAYS = MCP_DEFAULT_DAYS;
48
+ /** Installs a published Agent as a local trigger Skill, from `username/name[@version]` (or the distribution id older scripts use). */
49
+ async function installAgent(target, args) {
50
+ const host = skillHost(option(args, "--host") ?? "generic");
51
+ const scope = skillScope(option(args, "--scope") ?? "global");
52
+ const apiKey = args.includes("--api-key-stdin") ? await readStdinSecret(8192) : undefined;
53
+ const relayUrl = normalizeRelayUrl((await inspectAuth().catch(() => null))?.relayUrl);
54
+ const projectDir = option(args, "--dir");
55
+ const value = await installSkillAdapter({ manifestUrl: agentManifestUrl(target, relayUrl), host, scope, ...(projectDir ? { cwd: resolve(projectDir) } : {}), ...(apiKey ? { apiKey } : {}) });
56
+ if (args.includes("--json"))
57
+ stdout.write(`${JSON.stringify(value)}\n`);
58
+ else
59
+ stdout.write(`Agent: ${value.name}\nSkill: ${value.skillPath}\nAuth: ${value.authMode}\nState: ${value.state}\n${value.hostAction ? `Host action: ${value.hostAction}\n` : ""}`);
60
+ }
47
61
  async function main() {
48
62
  const args = normalizeMcpArgs(applyDataDir(process.argv.slice(2)));
49
63
  const command = args[0];
@@ -110,6 +124,66 @@ async function main() {
110
124
  process.exitCode = 2;
111
125
  return;
112
126
  }
127
+ if (command === "remote") {
128
+ const action = args[1];
129
+ const ref = args[2];
130
+ if (action !== "tools" && action !== "call" && action !== "config") {
131
+ stdout.write(subcommandUsage("remote"));
132
+ return;
133
+ }
134
+ if (!ref || ref.startsWith("-"))
135
+ throw new Error(`Usage: frely remote ${action} <username/name>${action === "call" ? " <tool> [--json '<object>' | --input <file>]" : ""}`);
136
+ parseMcpName(ref);
137
+ const deps = { call: callCloudTool };
138
+ try {
139
+ if (action === "tools") {
140
+ const tools = await listRemoteTools(ref, deps);
141
+ if (args.includes("--json"))
142
+ stdout.write(`${JSON.stringify(tools, null, 2)}\n`);
143
+ else
144
+ stdout.write(tools.map((tool) => `${tool.name}${tool.description ? `: ${tool.description.replace(/\s+/gu, " ").slice(0, 200)}` : ""}\n`).join(""));
145
+ return;
146
+ }
147
+ if (action === "config") {
148
+ const connection = await connectRemoteMcp(ref, deps);
149
+ const config = mcpClientConfig(connection);
150
+ const file = option(args, "--write");
151
+ if (file === undefined) {
152
+ stdout.write(`${JSON.stringify(config, null, 2)}\n`);
153
+ return;
154
+ }
155
+ await mergeMcpServers(file, config.mcpServers);
156
+ stdout.write(`Wrote ${Object.keys(config.mcpServers)[0]} to ${file}. The file holds a key that works only for ${connection.name}; keep it private.\n`);
157
+ return;
158
+ }
159
+ const tool = args[3];
160
+ if (!tool || tool.startsWith("-"))
161
+ throw new Error("Usage: frely remote call <username/name> <tool> [--json '<object>' | --input <file>]");
162
+ if (args.includes("--json") && args.includes("--input"))
163
+ throw new Error("Use --json or --input.");
164
+ const inline = option(args, "--json"), path = option(args, "--input");
165
+ const text = path !== undefined ? await readInputFile(path) : inline ?? "{}";
166
+ let input;
167
+ try {
168
+ input = JSON.parse(text);
169
+ }
170
+ catch {
171
+ throw new Error("The tool arguments must be a JSON object.");
172
+ }
173
+ if (input === null || typeof input !== "object" || Array.isArray(input))
174
+ throw new Error("The tool arguments must be a JSON object.");
175
+ const result = await callRemoteTool(ref, tool, input, deps);
176
+ stdout.write(`${JSON.stringify(result, null, 2)}\n`);
177
+ if (result?.isError === true)
178
+ process.exitCode = 1;
179
+ return;
180
+ }
181
+ catch (error) {
182
+ if (error instanceof RemoteMcpError)
183
+ throw new Error(error.message);
184
+ throw error;
185
+ }
186
+ }
113
187
  if (command === "network") {
114
188
  const value = await runNetwork(args);
115
189
  if (args.includes("--json"))
@@ -127,23 +201,15 @@ async function main() {
127
201
  if (action === "install") {
128
202
  const target = args[2];
129
203
  if (!target || target.startsWith("-"))
130
- throw new Error("Usage: frely agent install <distribution-id|manifest-url> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <project>] [--api-key-stdin] [--json]");
131
- const host = skillHost(option(args, "--host") ?? "generic");
132
- const scope = skillScope(option(args, "--scope") ?? "global");
133
- const apiKey = args.includes("--api-key-stdin") ? await readStdinSecret(8192) : undefined;
134
- const relayUrl = normalizeRelayUrl((await inspectAuth().catch(() => null))?.relayUrl);
135
- const projectDir = option(args, "--dir");
136
- const value = await installSkillAdapter({ manifestUrl: agentManifestUrl(target, relayUrl), host, scope, ...(projectDir ? { cwd: resolve(projectDir) } : {}), ...(apiKey ? { apiKey } : {}) });
137
- if (args.includes("--json"))
138
- stdout.write(`${JSON.stringify(value)}\n`);
139
- else
140
- stdout.write(`Agent: ${value.name}\nSkill: ${value.skillPath}\nAuth: ${value.authMode}\nState: ${value.state}\n${value.hostAction ? `Host action: ${value.hostAction}\n` : ""}`);
204
+ throw new Error("Usage: frely agent install <username/name[@version]> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <project>] [--api-key-stdin] [--json]");
205
+ await installAgent(target, args);
141
206
  return;
142
207
  }
143
208
  if (action === "run") {
144
- const distributionId = args[2];
145
- if (!distributionId || distributionId.startsWith("-"))
146
- throw new Error("Usage: frely agent run <distribution-id> (--input <text>|--input-stdin) [--json]");
209
+ const target = args[2];
210
+ if (!target || target.startsWith("-"))
211
+ throw new Error("Usage: frely agent run <username/name> (--input <text>|--input-stdin) [--json]");
212
+ const distributionId = await resolveAgentTarget(target, normalizeRelayUrl((await inspectAuth().catch(() => null))?.relayUrl));
147
213
  const task = args.includes("--input-stdin") ? await readStdinText(128 * 1024) : option(args, "--input");
148
214
  if (!task)
149
215
  throw new Error("Agent input is required. Use --input or --input-stdin.");
@@ -162,9 +228,10 @@ async function main() {
162
228
  stdout.write(JSON.stringify({ ok: true, budget }, null, json ? undefined : 2) + "\n");
163
229
  return;
164
230
  }
165
- const distributionId = args[2];
166
- if (!distributionId || distributionId.startsWith("-"))
167
- throw new KeyBudgetError("input_invalid", "Usage: frely agent status (<distribution-id>|--api-key-stdin [--relay <url>]) [--json]");
231
+ const target = args[2];
232
+ if (!target || target.startsWith("-"))
233
+ throw new KeyBudgetError("input_invalid", "Usage: frely agent status (<username/name>|--api-key-stdin [--relay <url>]) [--json]");
234
+ const distributionId = await resolveAgentTarget(target, normalizeRelayUrl((await inspectAuth().catch(() => null))?.relayUrl));
168
235
  const status = await skillAdapterStatus(distributionId);
169
236
  let budget;
170
237
  if (status.installed && status.authMode === "api-key") {
@@ -180,9 +247,10 @@ async function main() {
180
247
  return;
181
248
  }
182
249
  if (action === "remove") {
183
- const distributionId = args[2];
184
- if (!distributionId || distributionId.startsWith("-"))
185
- throw new Error("Usage: frely agent remove <distribution-id> [--json]");
250
+ const target = args[2];
251
+ if (!target || target.startsWith("-"))
252
+ throw new Error("Usage: frely agent remove <username/name> [--json]");
253
+ const distributionId = await resolveAgentTarget(target, normalizeRelayUrl((await inspectAuth().catch(() => null))?.relayUrl));
186
254
  const value = await removeSkillAdapter(distributionId);
187
255
  if (args.includes("--json"))
188
256
  stdout.write(`${JSON.stringify(value)}\n`);
@@ -266,11 +334,35 @@ async function main() {
266
334
  }
267
335
  const itemRef = args[2];
268
336
  if (!itemRef || itemRef.startsWith("-"))
269
- throw new Error("Usage: frely item install <username/skill-name[@version]> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <path>] [--json]");
337
+ throw new Error("Usage: frely item install <username/name[@version]> [--host chatgpt|codex|claude-code|pi|generic] [--scope global|project] [--dir <path>] [--json]");
338
+ // Skills, Prompts and Agents are named alike. An Agent's manifest is public, so it is asked first; a name no Agent has is a Skill or Prompt.
339
+ if (/^creator_distribution_/u.test(itemRef) || args.includes("--api-key-stdin")) {
340
+ await installAgent(itemRef, args);
341
+ return;
342
+ }
343
+ if (!(/^cloud_skill_|^skill_/u.test(itemRef))) {
344
+ const installed = await installAgent(itemRef, args).then(() => true, (error) => { if (error instanceof SkillAccessError && error.code === "agent_not_found")
345
+ return false; throw error; });
346
+ if (installed)
347
+ return;
348
+ }
270
349
  const host = skillHost(option(args, "--host") ?? "generic");
271
350
  const scope = skillScope(option(args, "--scope") ?? "global");
272
351
  const dir = option(args, "--dir");
273
- const value = await installCloudItem({ ...parseItemRef(itemRef), call: callCloudTool, host, scope, ...(dir ? { dir } : {}) });
352
+ const value = await installCloudItem({ ...parseItemRef(itemRef), call: callCloudTool, host, scope, ...(dir ? { dir } : {}) }).catch(async (error) => {
353
+ // A name that is not a Skill may be a remote MCP: install the Skill that uses it through `frely remote`.
354
+ if (!isNotASkill(error) || itemRef.includes("@") || !/^[^/@]+\/[^/@]+$/u.test(itemRef))
355
+ throw error;
356
+ return installRemoteMcpSkill({ ref: itemRef, call: callCloudTool, host, scope, ...(dir ? { dir } : {}) }).catch((mcpError) => { throw isNotASkill(mcpError) || (mcpError instanceof CloudToolError && mcpError.code === "remote_mcp_not_found") ? error : mcpError; });
357
+ });
358
+ if ("tools" in value) {
359
+ if (args.includes("--json")) {
360
+ stdout.write(`${JSON.stringify(value)}\n`);
361
+ return;
362
+ }
363
+ stdout.write(`MCP: ${value.name}\nPath: ${value.path}\nTools: ${value.tools}\nThe Skill calls this MCP through frely remote; no MCP client configuration is needed. Restart or reload the agent session so it rescans Skills.\n`);
364
+ return;
365
+ }
274
366
  if (args.includes("--json")) {
275
367
  stdout.write(`${JSON.stringify(value)}\n`);
276
368
  return;
@@ -514,7 +606,9 @@ async function main() {
514
606
  process.env.FRELY_CREDENTIAL_STORE = serviceCredentialStore;
515
607
  await requireLogin();
516
608
  const providerOnly = args.includes("--provider-only");
517
- const workspace = providerOnly ? undefined : resolve(option(args, "--workspace") || process.cwd());
609
+ // Without --workspace (a service re-registered by hand, Windows after a reboot) use the workspace the device MCP grant is bound to; a different directory never matches the grant and would leave remote execution disabled.
610
+ const grantWorkspace = providerOnly || option(args, "--workspace") ? undefined : (await inspectMcpMetadata().catch(() => null))?.grant.workspace;
611
+ const workspace = providerOnly ? undefined : resolve(option(args, "--workspace") || grantWorkspace || process.cwd());
518
612
  const nodeLog = (message) => process.stderr.write(`${message}\n`);
519
613
  const controller = new AbortController();
520
614
  const stop = () => controller.abort();
@@ -680,6 +774,29 @@ function skillScope(value) {
680
774
  return value;
681
775
  throw new Error("--scope must be global or project.");
682
776
  }
777
+ async function readInputFile(path) {
778
+ const info = await stat(path);
779
+ if (!info.isFile() || info.size > 512 * 1024)
780
+ throw new Error("--input must be a file of at most 512 KiB.");
781
+ return readFile(path, "utf8");
782
+ }
783
+ /** Adds the entries to the file's `mcpServers`, keeping everything else; the file is created readable only by its owner. */
784
+ async function mergeMcpServers(path, servers) {
785
+ let current = {};
786
+ try {
787
+ const parsed = JSON.parse(await readFile(path, "utf8"));
788
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
789
+ throw new Error("not an object");
790
+ current = parsed;
791
+ }
792
+ catch (error) {
793
+ if (error.code !== "ENOENT")
794
+ throw new Error(`${path} is not a JSON object; left unchanged.`);
795
+ }
796
+ const existing = current.mcpServers !== null && typeof current.mcpServers === "object" && !Array.isArray(current.mcpServers) ? current.mcpServers : {};
797
+ await writeFile(path, `${JSON.stringify({ ...current, mcpServers: { ...existing, ...servers } }, null, 2)}\n`, { mode: 0o600 });
798
+ await chmod(path, 0o600);
799
+ }
683
800
  async function readStdinText(maxBytes) {
684
801
  let value = "";
685
802
  for await (const chunk of stdin) {