frely-cli 0.23.10 → 0.23.12
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/dist/agent/local/approvals.js +14 -18
- package/dist/agent/local/approvals.js.map +1 -1
- package/dist/agent/run-store.d.ts +85 -0
- package/dist/agent/run-store.js +155 -0
- package/dist/agent/run-store.js.map +1 -0
- package/dist/agent/run.d.ts +45 -0
- package/dist/agent/run.js +254 -0
- package/dist/agent/run.js.map +1 -0
- package/dist/agent/workspace-read.d.ts +78 -0
- package/dist/agent/workspace-read.js +292 -0
- package/dist/agent/workspace-read.js.map +1 -0
- package/dist/agent-help.d.ts +44 -8
- package/dist/agent-help.js +9 -3
- package/dist/agent-help.js.map +1 -1
- package/dist/approval-code.d.ts +4 -0
- package/dist/approval-code.js +15 -0
- package/dist/approval-code.js.map +1 -0
- package/dist/cloud.d.ts +8 -51
- package/dist/cloud.js +33 -284
- package/dist/cloud.js.map +1 -1
- package/dist/controller/approval-wait.d.ts +21 -0
- package/dist/controller/approval-wait.js +28 -0
- package/dist/controller/approval-wait.js.map +1 -0
- package/dist/controller/client.d.ts +6 -3
- package/dist/controller/client.js +7 -8
- package/dist/controller/client.js.map +1 -1
- package/dist/controller/commands.d.ts +3 -6
- package/dist/controller/commands.js +30 -31
- package/dist/controller/commands.js.map +1 -1
- package/dist/controller/session.d.ts +7 -2
- package/dist/controller/session.js +79 -22
- package/dist/controller/session.js.map +1 -1
- package/dist/index.js +83 -16
- package/dist/index.js.map +1 -1
- package/dist/mcp-authorization.d.ts +3 -3
- package/dist/mcp-authorization.js +13 -15
- package/dist/mcp-authorization.js.map +1 -1
- package/dist/mcp-command.js +3 -2
- package/dist/mcp-command.js.map +1 -1
- package/dist/share/control.d.ts +10 -1
- package/dist/share/control.js +45 -2
- package/dist/share/control.js.map +1 -1
- package/dist/share/run.d.ts +0 -5
- package/dist/share/run.js +3 -14
- package/dist/share/run.js.map +1 -1
- package/dist/skill/access.d.ts +28 -4
- package/dist/skill/access.js +78 -17
- package/dist/skill/access.js.map +1 -1
- package/dist/skill/entry.d.ts +1 -1
- package/dist/skill/entry.js +1 -1
- package/dist/skill/router.d.ts +76 -0
- package/dist/skill/router.js +99 -42
- package/dist/skill/router.js.map +1 -1
- package/package.json +1 -1
- package/skills/frely-cli/SKILL.md +2 -2
package/dist/skill/access.js
CHANGED
|
@@ -2,7 +2,7 @@ import { homedir } from "node:os";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { LOGIN_REFRESH_UNAVAILABLE, requireLogin } from "../auth.js";
|
|
4
4
|
import { credentialStore as secureCredentialStore } from "../credential-store.js";
|
|
5
|
-
import { remoteAgentMcpInvoker, SkillInvocationError } from "./router.js";
|
|
5
|
+
import { remoteAgentMcpInvoker, remoteAgentTaskClient, SkillInvocationError } from "./router.js";
|
|
6
6
|
import { findManagedSkillByInstallName, ManagedSkillError, managedSkillRoot, managedSkillState, readManagedSkill, removeManagedSkill, skillSlug, writeManagedSkill, } from "./managed.js";
|
|
7
7
|
const MANIFEST_SCHEMA = "frely.virtual-model.public.v1";
|
|
8
8
|
const DISTRIBUTION_ID = /^creator_distribution_[a-f0-9]{24}$/u;
|
|
@@ -133,10 +133,9 @@ export async function removeSkillAdapter(distributionId, home = homedir(), store
|
|
|
133
133
|
await removeManagedSkill(record, home);
|
|
134
134
|
return Object.freeze({ ok: true, removed: true, distributionId });
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
/** The installed record plus the credential that calls it. Shared by the single-shot call and the tool round trips. */
|
|
137
|
+
async function openInstalledAgent(input) {
|
|
137
138
|
assertDistributionId(input.distributionId);
|
|
138
|
-
if (!input.task.trim() || Buffer.byteLength(input.task, "utf8") > MAX_TASK_BYTES)
|
|
139
|
-
throw new SkillAccessError("input_invalid", "Agent input must be non-empty and at most 128 KiB.");
|
|
140
139
|
const record = await readManagedSkill(input.distributionId, input.home ?? homedir());
|
|
141
140
|
if (!record)
|
|
142
141
|
throw new SkillAccessError("target_not_installed", "The Frely Skill target is not installed.");
|
|
@@ -158,27 +157,89 @@ export async function invokeInstalledAgent(input) {
|
|
|
158
157
|
token = login.credential.value;
|
|
159
158
|
credential = login.credential;
|
|
160
159
|
}
|
|
160
|
+
return { record, token, credential };
|
|
161
|
+
}
|
|
162
|
+
function remoteCallError(error, authMode) {
|
|
163
|
+
if (error instanceof SkillInvocationError && error.code === "entitlement_required")
|
|
164
|
+
return new SkillAccessError("entitlement_required", "This Frely Agent is not available to the configured credential.");
|
|
165
|
+
if (error instanceof SkillInvocationError && error.code === "payment_required")
|
|
166
|
+
return new SkillAccessError("payment_required", "Not enough Frely Credit. Run `frely api call credit_products.list` and `frely api call payment_checkout.create` (pass useImmediately:true) to get a payment link for the user, then retry once they have paid.");
|
|
167
|
+
if (error instanceof SkillInvocationError && error.code === "remote_authorization_failed")
|
|
168
|
+
return new SkillAccessError("remote_authorization_failed", authMode === "api-key" ? "The model-scoped API key was rejected. Reinstall with frely item install <username/name> --api-key-stdin." : "Frely authorization failed. Run `frely login` again.");
|
|
169
|
+
return new SkillAccessError("remote_call_failed", error instanceof SkillInvocationError && error.details.remoteCode ? `The remote Frely Agent call failed (${error.details.remoteCode}).` : "The remote Frely Agent call failed.");
|
|
170
|
+
}
|
|
171
|
+
export async function invokeInstalledAgent(input) {
|
|
172
|
+
assertDistributionId(input.distributionId);
|
|
173
|
+
if (!input.task.trim() || Buffer.byteLength(input.task, "utf8") > MAX_TASK_BYTES)
|
|
174
|
+
throw new SkillAccessError("input_invalid", "Agent input must be non-empty and at most 128 KiB.");
|
|
175
|
+
const { record, token, credential } = await openInstalledAgent(input);
|
|
176
|
+
const target = { relayUrl: new URL(record.mcpUrl).origin, modelId: record.modelId, token, ...(credential ? { credential } : {}) };
|
|
177
|
+
const tasks = input.taskClient ?? remoteAgentTaskClient;
|
|
178
|
+
let taskId;
|
|
161
179
|
try {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
modelId: record.modelId,
|
|
165
|
-
token,
|
|
166
|
-
...(credential ? { credential } : {}),
|
|
180
|
+
let result = await (input.remoteInvoker ?? remoteAgentMcpInvoker).invoke({
|
|
181
|
+
...target,
|
|
167
182
|
task: input.task,
|
|
183
|
+
...(input.progressSummary === undefined ? {} : { progressSummary: input.progressSummary }),
|
|
168
184
|
...(input.signal ? { signal: input.signal } : {}),
|
|
169
185
|
});
|
|
186
|
+
// A long call returns `running` after about 50 seconds; the task goes on at Frely, so wait for it here (reading is free).
|
|
187
|
+
while (result.state === "running" && result.taskId !== undefined) {
|
|
188
|
+
taskId = result.taskId;
|
|
189
|
+
if (result.progressSummary)
|
|
190
|
+
input.onProgress?.(result.progressSummary);
|
|
191
|
+
result = await tasks.status({ ...target, taskId, wait: true, ...(input.signal ? { signal: input.signal } : {}) });
|
|
192
|
+
}
|
|
193
|
+
if (result.state === "failed" || result.state === "canceled")
|
|
194
|
+
throw new SkillInvocationError("remote_call_failed");
|
|
170
195
|
return Object.freeze({ ok: true, distributionId: record.distributionId, modelId: record.modelId, text: result.text, ...(result.usage ? { usage: result.usage } : {}) });
|
|
171
196
|
}
|
|
172
197
|
catch (error) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
198
|
+
// The caller gave up (Ctrl-C, `frely agent cancel`): stop the task at Frely too, so it does not keep running and billing.
|
|
199
|
+
if (taskId !== undefined && input.signal?.aborted)
|
|
200
|
+
await tasks.cancel({ ...target, taskId }).catch(() => undefined);
|
|
201
|
+
throw remoteCallError(error, record.authMode);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/** The Agent cannot take caller tools (`client_tools_unsupported`); the run then falls back to one plain call. */
|
|
205
|
+
export class ClientToolsUnsupportedError extends Error {
|
|
206
|
+
constructor() {
|
|
207
|
+
super("This Agent does not support local file tools.");
|
|
208
|
+
this.name = "ClientToolsUnsupportedError";
|
|
180
209
|
}
|
|
181
210
|
}
|
|
211
|
+
/** Resolve the credential once and return a handle for several tool rounds; each round is billed on its own. */
|
|
212
|
+
export async function openInstalledAgentSession(input) {
|
|
213
|
+
const { record, token, credential } = await openInstalledAgent(input);
|
|
214
|
+
const invoker = input.remoteInvoker ?? remoteAgentMcpInvoker;
|
|
215
|
+
return {
|
|
216
|
+
distributionId: record.distributionId,
|
|
217
|
+
modelId: record.modelId,
|
|
218
|
+
async turn(turn) {
|
|
219
|
+
if (!turn.task.trim() || Buffer.byteLength(turn.task, "utf8") > MAX_TASK_BYTES)
|
|
220
|
+
throw new SkillAccessError("input_invalid", "Agent input must be non-empty and at most 128 KiB.");
|
|
221
|
+
if (invoker.invokeTurn === undefined)
|
|
222
|
+
throw new ClientToolsUnsupportedError();
|
|
223
|
+
try {
|
|
224
|
+
return await invoker.invokeTurn({
|
|
225
|
+
relayUrl: new URL(record.mcpUrl).origin,
|
|
226
|
+
modelId: record.modelId,
|
|
227
|
+
token,
|
|
228
|
+
...(credential ? { credential } : {}),
|
|
229
|
+
task: turn.task,
|
|
230
|
+
tools: turn.tools,
|
|
231
|
+
items: turn.items,
|
|
232
|
+
...(turn.signal ? { signal: turn.signal } : {}),
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
if (error instanceof SkillInvocationError && error.details.remoteCode === "client_tools_unsupported")
|
|
237
|
+
throw new ClientToolsUnsupportedError();
|
|
238
|
+
throw remoteCallError(error, record.authMode);
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
}
|
|
182
243
|
function assertApiKey(value) {
|
|
183
244
|
const bytes = Buffer.byteLength(value, "utf8");
|
|
184
245
|
if (bytes < 8 || bytes > 8192 || /[\x00-\x20\x7f]/u.test(value)) {
|
|
@@ -294,7 +355,7 @@ function renderSkill(manifest, slug) {
|
|
|
294
355
|
const description = oneLine(manifest.clientTrigger?.description ?? manifest.description ?? `Use ${manifest.name} through Frely when the user's task matches this Agent.`).slice(0, 900);
|
|
295
356
|
const capabilities = manifest.capabilities.length === 0 ? "- Use the published Agent for tasks described by this Skill." : manifest.capabilities.map((capability) => `- ${capability.id}${capability.description ? `: ${oneLine(capability.description)}` : ""}`).join("\n");
|
|
296
357
|
const triggers = manifest.clientTrigger?.when.map((condition) => `- ${oneLine(condition)}`).join("\n") ?? `- The user explicitly asks for ${oneLine(manifest.name)} or their task matches its published capabilities.`;
|
|
297
|
-
return `---\nname: ${slug}\ndescription: ${JSON.stringify(description)}\ncompatibility: ${JSON.stringify("Requires frely-cli and network access to Frely.")}\nmetadata:\n frely-distribution-id: ${JSON.stringify(manifest.id)}\n frely-model-id: ${JSON.stringify(manifest.modelId)}\n---\n\n# ${oneLine(manifest.name)}\n\nThe Agent runs remotely on Frely; this Skill contains only trigger and invocation instructions.\n\n## When to use\n\n${triggers}\n\n## Public capabilities\n\n${capabilities}\n\n## Execute\n\nPass the user's complete relevant request to stdin of:\n\n\`frely agent run ${manifest.id} --input-stdin --json\`\n\nDo not put credentials in the command and do not replace the user's current model provider. Return the result to the user. If the user asked you to act on it (for example, carry out a plan), do so with your own tools, following your usual confirmation rules. A call can take several minutes
|
|
358
|
+
return `---\nname: ${slug}\ndescription: ${JSON.stringify(description)}\ncompatibility: ${JSON.stringify("Requires frely-cli and network access to Frely.")}\nmetadata:\n frely-distribution-id: ${JSON.stringify(manifest.id)}\n frely-model-id: ${JSON.stringify(manifest.modelId)}\n---\n\n# ${oneLine(manifest.name)}\n\nThe Agent runs remotely on Frely; this Skill contains only trigger and invocation instructions.\n\n## When to use\n\n${triggers}\n\n## Public capabilities\n\n${capabilities}\n\n## Execute\n\nPass the user's complete relevant request to stdin of:\n\n\`frely agent run ${manifest.id} --input-stdin --json\`\n\nDo not put credentials in the command and do not replace the user's current model provider. Return the result to the user. If the user asked you to act on it (for example, carry out a plan), do so with your own tools, following your usual confirmation rules. A call can take several minutes. If your command is cut off, run \`frely agent result --last --wait\` instead of calling again. If the user asked not to see progress updates (for example in their AGENTS.md), add \`--no-progress-summary\` to the run command. If the result starts with NEED_FILES, read those files yourself and call again with the original task plus them. If the remote call fails, surface the returned state instead of inventing current external facts.\n`;
|
|
298
359
|
}
|
|
299
360
|
function hostAction(host) {
|
|
300
361
|
if (host === "chatgpt")
|
package/dist/skill/access.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.js","sourceRoot":"","sources":["../../src/skill/access.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAwB,MAAM,wBAAwB,CAAC;AACxG,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAA8B,MAAM,aAAa,CAAC;AACtG,OAAO,EACL,6BAA6B,EAC7B,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,iBAAiB,GAGlB,MAAM,cAAc,CAAC;AAEtB,MAAM,eAAe,GAAG,+BAA+B,CAAC;AACxD,MAAM,eAAe,GAAG,sCAAsC,CAAC;AAC/D,MAAM,kBAAkB,GAAG,GAAG,GAAG,IAAI,CAAC;AACtC,MAAM,cAAc,GAAG,GAAG,GAAG,IAAI,CAAC;AAClC,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC;AAwBlE,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAE9B;IADX,YACW,IAAkT,EAC3T,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHN,SAAI,GAAJ,IAAI,CAA8S;QAI3T,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;AAED,sFAAsF;AACtF,MAAM,UAAU,GAAG,4DAA4D,CAAC;AAEhF,oKAAoK;AACpK,MAAM,UAAU,gB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,CAAC,WAAW,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC1E,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,KAAK,aAAa,IAAI,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtF,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,QAAQ,CAAC;QAAE,MAAM,IAAI,gBAAgB,CAAC,IAAI,EAAE,qEAAqE,CAAC,CAAC;IAC9L,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAa,IAAU,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC;IAAE,MAAM,IAAI,gBAAgB,CAAC,sBAAsB,EAAE,mCAAmC,CAAC,CAAC,CAAC,CAAC;AACjL,SAAS,MAAM,CAAC,KAAc,IAAoC,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAgC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1L,SAAS,OAAO,CAAC,KAAa,IAAY,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC"}
|
package/dist/skill/entry.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SkillHost, type SkillScope } from "./managed.js";
|
|
2
2
|
export declare const ENTRY_SKILL_ID = "frely-entry";
|
|
3
3
|
/** Teaches an agent with a shell to use Frely through the CLI, and when to offer FrelyMCP. */
|
|
4
|
-
export declare const ENTRY_SKILL = "---\nname: frely\ndescription: Use when the user wants to work with their Frely account or the Frely marketplace through the frely CLI (credits, API keys, plans, orders, installing a Frely Skill or Agent), or wants to connect a computer or an AI client to FrelyMCP.\n---\n\nUse the installed `frely` CLI. Do not rely on remembered syntax: run `frely help --agent --json` for the current command contract, and `frely update` if a command is missing.\n\n## Sign in\n\nRun `frely doctor --json` to see whether the CLI is signed in. If not, ask the user for their email, run `frely login --email <address>`, ask them for the 6-digit code from the email, then run `frely login --code <code>`. New addresses are registered by the same steps. Do not add `--mcp`: it opens this computer to remote clients.\n\n## Account and marketplace\n\n- Account operations (API keys, Credit, plans, orders, Creator items): `frely api list`, `frely api describe <tool>`, `frely api call <tool> --json '{...}'`. The first call needs a browser authorization the user completes; if it fails because there is no terminal, tell the user to run the command once themselves.\n- Ask the user before any call that spends Credit, buys something or changes credentials. Some actions also need a one-time approval on the Frely website; give the user the link from the error.\n- Install a marketplace Skill or Prompt: `frely item install <username/skill-name> --host <your host>`; add `--scope project --dir <project>` to install it for one project instead of globally. Install a published Agent: `frely agent install <username/name> --host <your host>`, then `frely agent run`. If `frely agent run` returns `payment_required`, the balance is too low: do not ask the user to sign in again; run `frely api call credit_products.list --json '{}'`, ask which amount, then `frely api call payment_checkout.create` with `useImmediately` true, give the user the returned `checkoutUrl`, and retry once they have paid. If the install output says Frely has not scanned a Skill, read every file in it before you use it, and tell the user if anything looks unsafe.\n- Use a marketplace MCP without configuring it in your client: `frely item install <username/mcp-name>` installs a Skill that calls it through `frely remote tools|call <username/mcp-name>`. Each call is billed or needs a pass as in any MCP client. `frely remote config <username/mcp-name>` prints the `mcpServers` JSON for clients that should connect to that one MCP directly.\n\n## What needs FrelyMCP\n\nThe steps above work without FrelyMCP. FrelyMCP is only needed to control another computer, use Cloud MCPs the user bought, drive a connected browser, or use Frely from a client with no shell (web ChatGPT or Claude).\n\nCheck whether you already have it: your tool list has Frely tools such as `list_devices` or `frely_list`; or run `claude mcp list` (Claude Code) or `codex mcp list` (Codex) and look for `frely`.\n\nIf the user's request needs FrelyMCP and you do not have it, say so once in this conversation, in your own words: this needs Frely's remote connection, everything else already works, and setting it up takes one browser approval. Do nothing until the user agrees, and do not raise it again if they decline or when the request does not need it. If they agree:\n\n1. Run `frely mcp start`. When it prints a sign-in or approval link, send the link and keep the command running while the user approves. It prints the MCP URL.\n2. Add it to your client: `claude mcp add --transport http frely \"https://mcp.frely.cloud/mcp\"` or `codex mcp add frely --url \"https://mcp.frely.cloud/mcp\"`. For any other client, give the user the URL and ask them to add it as a remote MCP server with OAuth.\n3. Tell the user to finish the OAuth authorization in their browser, then check with \"list my Frely devices\".\n\nNever put keys or tokens on a command line or in a file; use `--api-key-stdin` where the CLI offers it.\n";
|
|
4
|
+
export declare const ENTRY_SKILL = "---\nname: frely\ndescription: Use when the user wants to work with their Frely account or the Frely marketplace through the frely CLI (credits, API keys, plans, orders, installing a Frely Skill or Agent), or wants to connect a computer or an AI client to FrelyMCP.\n---\n\nUse the installed `frely` CLI. Do not rely on remembered syntax: run `frely help --agent --json` for the current command contract, and `frely update` if a command is missing.\n\n## Sign in\n\nRun `frely doctor --json` to see whether the CLI is signed in. If not, ask the user for their email, run `frely login --email <address>`, ask them for the 6-digit code from the email, then run `frely login --code <code>`. New addresses are registered by the same steps. Do not add `--mcp`: it opens this computer to remote clients.\n\n## Account and marketplace\n\n- Account operations (API keys, Credit, plans, orders, Creator items): `frely api list`, `frely api describe <tool>`, `frely api call <tool> --json '{...}'`. The first call needs a browser authorization the user completes; if it fails because there is no terminal, tell the user to run the command once themselves.\n- Ask the user before any call that spends Credit, buys something or changes credentials. Some actions also need a one-time approval on the Frely website; give the user the link from the error.\n- Install a marketplace Skill or Prompt: `frely item install <username/skill-name> --host <your host>`; add `--scope project --dir <project>` to install it for one project instead of globally. Install a published Agent: `frely agent install <username/name> --host <your host>`, then `frely agent run`. When an Agent needs the user's project files, add `--read` (optionally `--read <dir>`): the Agent can then read files of that directory through read-only tools that run on this computer, only the files it asks for; `.git`, `.env*`, key files and git-ignored files are never sent, and the result lists the files read. Tell the user before you add it. If `frely agent run` returns `payment_required`, the balance is too low: do not ask the user to sign in again; run `frely api call credit_products.list --json '{}'`, ask which amount, then `frely api call payment_checkout.create` with `useImmediately` true, give the user the returned `checkoutUrl`, and retry once they have paid. If the install output says Frely has not scanned a Skill, read every file in it before you use it, and tell the user if anything looks unsafe.\n- Use a marketplace MCP without configuring it in your client: `frely item install <username/mcp-name>` installs a Skill that calls it through `frely remote tools|call <username/mcp-name>`. Each call is billed or needs a pass as in any MCP client. `frely remote config <username/mcp-name>` prints the `mcpServers` JSON for clients that should connect to that one MCP directly.\n\n## What needs FrelyMCP\n\nThe steps above work without FrelyMCP. FrelyMCP is only needed to control another computer, use Cloud MCPs the user bought, drive a connected browser, or use Frely from a client with no shell (web ChatGPT or Claude).\n\nCheck whether you already have it: your tool list has Frely tools such as `list_devices` or `frely_list`; or run `claude mcp list` (Claude Code) or `codex mcp list` (Codex) and look for `frely`.\n\nIf the user's request needs FrelyMCP and you do not have it, say so once in this conversation, in your own words: this needs Frely's remote connection, everything else already works, and setting it up takes one browser approval. Do nothing until the user agrees, and do not raise it again if they decline or when the request does not need it. If they agree:\n\n1. Run `frely mcp start`. When it prints a sign-in or approval link, send the link and keep the command running while the user approves. It prints the MCP URL.\n2. Add it to your client: `claude mcp add --transport http frely \"https://mcp.frely.cloud/mcp\"` or `codex mcp add frely --url \"https://mcp.frely.cloud/mcp\"`. For any other client, give the user the URL and ask them to add it as a remote MCP server with OAuth.\n3. Tell the user to finish the OAuth authorization in their browser, then check with \"list my Frely devices\".\n\nNever put keys or tokens on a command line or in a file; use `--api-key-stdin` where the CLI offers it.\n";
|
|
5
5
|
export interface EntrySkillInstallResult {
|
|
6
6
|
readonly name: "frely";
|
|
7
7
|
readonly path: string;
|
package/dist/skill/entry.js
CHANGED
|
@@ -21,7 +21,7 @@ Run \`frely doctor --json\` to see whether the CLI is signed in. If not, ask the
|
|
|
21
21
|
|
|
22
22
|
- Account operations (API keys, Credit, plans, orders, Creator items): \`frely api list\`, \`frely api describe <tool>\`, \`frely api call <tool> --json '{...}'\`. The first call needs a browser authorization the user completes; if it fails because there is no terminal, tell the user to run the command once themselves.
|
|
23
23
|
- Ask the user before any call that spends Credit, buys something or changes credentials. Some actions also need a one-time approval on the Frely website; give the user the link from the error.
|
|
24
|
-
- Install a marketplace Skill or Prompt: \`frely item install <username/skill-name> --host <your host>\`; add \`--scope project --dir <project>\` to install it for one project instead of globally. Install a published Agent: \`frely agent install <username/name> --host <your host>\`, then \`frely agent run\`. If \`frely agent run\` returns \`payment_required\`, the balance is too low: do not ask the user to sign in again; run \`frely api call credit_products.list --json '{}'\`, ask which amount, then \`frely api call payment_checkout.create\` with \`useImmediately\` true, give the user the returned \`checkoutUrl\`, and retry once they have paid. If the install output says Frely has not scanned a Skill, read every file in it before you use it, and tell the user if anything looks unsafe.
|
|
24
|
+
- Install a marketplace Skill or Prompt: \`frely item install <username/skill-name> --host <your host>\`; add \`--scope project --dir <project>\` to install it for one project instead of globally. Install a published Agent: \`frely agent install <username/name> --host <your host>\`, then \`frely agent run\`. When an Agent needs the user's project files, add \`--read\` (optionally \`--read <dir>\`): the Agent can then read files of that directory through read-only tools that run on this computer, only the files it asks for; \`.git\`, \`.env*\`, key files and git-ignored files are never sent, and the result lists the files read. Tell the user before you add it. If \`frely agent run\` returns \`payment_required\`, the balance is too low: do not ask the user to sign in again; run \`frely api call credit_products.list --json '{}'\`, ask which amount, then \`frely api call payment_checkout.create\` with \`useImmediately\` true, give the user the returned \`checkoutUrl\`, and retry once they have paid. If the install output says Frely has not scanned a Skill, read every file in it before you use it, and tell the user if anything looks unsafe.
|
|
25
25
|
- Use a marketplace MCP without configuring it in your client: \`frely item install <username/mcp-name>\` installs a Skill that calls it through \`frely remote tools|call <username/mcp-name>\`. Each call is billed or needs a pass as in any MCP client. \`frely remote config <username/mcp-name>\` prints the \`mcpServers\` JSON for clients that should connect to that one MCP directly.
|
|
26
26
|
|
|
27
27
|
## What needs FrelyMCP
|
package/dist/skill/router.d.ts
CHANGED
|
@@ -6,9 +6,15 @@ export interface SkillCapability {
|
|
|
6
6
|
readonly level: SkillCapabilityLevel;
|
|
7
7
|
readonly entrypoints: readonly SkillEntrypoint[];
|
|
8
8
|
}
|
|
9
|
+
export type AgentTaskState = "running" | "completed" | "failed" | "canceled";
|
|
9
10
|
export interface SkillInvocationResult {
|
|
10
11
|
readonly text: string;
|
|
11
12
|
readonly usage?: Readonly<Record<string, unknown>>;
|
|
13
|
+
/** Set by the Gateway for an Agent call: `running` means the task goes on and `taskId` reads it later. */
|
|
14
|
+
readonly state?: AgentTaskState;
|
|
15
|
+
readonly taskId?: string;
|
|
16
|
+
/** The running Agent's newest one-line progress; absent when progress is off or nothing was reported yet. */
|
|
17
|
+
readonly progressSummary?: string;
|
|
12
18
|
}
|
|
13
19
|
export declare class SkillInvocationError extends Error {
|
|
14
20
|
readonly code: "payment_required" | "entitlement_required" | "remote_authorization_failed" | "capability_unavailable" | "remote_call_failed";
|
|
@@ -25,7 +31,58 @@ export declare class SkillInvocationError extends Error {
|
|
|
25
31
|
readonly registrationUrl?: string;
|
|
26
32
|
}>);
|
|
27
33
|
}
|
|
34
|
+
/** A function tool the caller runs locally (read-only workspace bridge), in the shape `invoke` accepts as `tools`. */
|
|
35
|
+
export interface CallerToolDefinition {
|
|
36
|
+
readonly type: "function";
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly description: string;
|
|
39
|
+
readonly parameters: Readonly<Record<string, unknown>>;
|
|
40
|
+
}
|
|
41
|
+
/** One continuation entry of a tool round trip (`items` of `invoke`). */
|
|
42
|
+
export type CallerItem = {
|
|
43
|
+
readonly type: "function_call";
|
|
44
|
+
readonly call_id: string;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly arguments: string;
|
|
47
|
+
} | {
|
|
48
|
+
readonly type: "function_call_output";
|
|
49
|
+
readonly call_id: string;
|
|
50
|
+
readonly output: string;
|
|
51
|
+
};
|
|
52
|
+
export interface AgentTurnUsage {
|
|
53
|
+
readonly input_tokens: number;
|
|
54
|
+
readonly output_tokens: number;
|
|
55
|
+
readonly total_tokens: number;
|
|
56
|
+
}
|
|
57
|
+
/** One `invoke` round with caller tools: either the final answer or the local tool calls the Agent asked for. */
|
|
58
|
+
export type AgentTurnResult = {
|
|
59
|
+
readonly status: "completed";
|
|
60
|
+
readonly text: string;
|
|
61
|
+
readonly requestId?: string;
|
|
62
|
+
readonly usage?: AgentTurnUsage;
|
|
63
|
+
} | {
|
|
64
|
+
readonly status: "tool_calls";
|
|
65
|
+
readonly calls: readonly {
|
|
66
|
+
readonly callId: string;
|
|
67
|
+
readonly name: string;
|
|
68
|
+
readonly arguments: string;
|
|
69
|
+
}[];
|
|
70
|
+
readonly items: readonly CallerItem[];
|
|
71
|
+
readonly requestId?: string;
|
|
72
|
+
readonly usage?: AgentTurnUsage;
|
|
73
|
+
};
|
|
28
74
|
export interface RemoteAgentMcpInvoker {
|
|
75
|
+
/** One round with caller-executed tools. Absent on invokers that only support a single text round. */
|
|
76
|
+
invokeTurn?(input: {
|
|
77
|
+
readonly relayUrl: string;
|
|
78
|
+
readonly modelId: string;
|
|
79
|
+
readonly token: string;
|
|
80
|
+
readonly credential?: AuthCredential;
|
|
81
|
+
readonly task: string;
|
|
82
|
+
readonly tools: readonly CallerToolDefinition[];
|
|
83
|
+
readonly items: readonly CallerItem[];
|
|
84
|
+
readonly signal?: AbortSignal;
|
|
85
|
+
}): Promise<AgentTurnResult>;
|
|
29
86
|
invoke(input: {
|
|
30
87
|
readonly relayUrl: string;
|
|
31
88
|
readonly modelId: string;
|
|
@@ -33,9 +90,27 @@ export interface RemoteAgentMcpInvoker {
|
|
|
33
90
|
readonly credential?: AuthCredential;
|
|
34
91
|
readonly task: string;
|
|
35
92
|
readonly capabilityId?: string;
|
|
93
|
+
/** Sent only when given; otherwise the Gateway uses the account's setting. */
|
|
94
|
+
readonly progressSummary?: boolean;
|
|
36
95
|
readonly signal?: AbortSignal;
|
|
37
96
|
}): Promise<SkillInvocationResult>;
|
|
38
97
|
}
|
|
98
|
+
export interface RemoteAgentTaskInput {
|
|
99
|
+
readonly relayUrl: string;
|
|
100
|
+
readonly modelId: string;
|
|
101
|
+
readonly token: string;
|
|
102
|
+
readonly credential?: AuthCredential;
|
|
103
|
+
readonly taskId: string;
|
|
104
|
+
readonly signal?: AbortSignal;
|
|
105
|
+
}
|
|
106
|
+
export interface RemoteAgentTaskClient {
|
|
107
|
+
/** Reads a task (task_status); with `wait` the Gateway holds the request up to 50 seconds. Free. */
|
|
108
|
+
status(input: RemoteAgentTaskInput & {
|
|
109
|
+
readonly wait: boolean;
|
|
110
|
+
}): Promise<SkillInvocationResult>;
|
|
111
|
+
/** Cancels a running task (task_cancel); what ran so far is billed. */
|
|
112
|
+
cancel(input: RemoteAgentTaskInput): Promise<SkillInvocationResult>;
|
|
113
|
+
}
|
|
39
114
|
export interface SkillRouterOptions {
|
|
40
115
|
readonly relayUrl?: string;
|
|
41
116
|
readonly modelId: string;
|
|
@@ -54,3 +129,4 @@ export interface SkillRouterOptions {
|
|
|
54
129
|
export declare function invokeSkill(options: SkillRouterOptions): Promise<SkillInvocationResult>;
|
|
55
130
|
/** Minimal stateless MCP client used by the router's remote path. */
|
|
56
131
|
export declare const remoteAgentMcpInvoker: RemoteAgentMcpInvoker;
|
|
132
|
+
export declare const remoteAgentTaskClient: RemoteAgentTaskClient;
|
package/dist/skill/router.js
CHANGED
|
@@ -63,53 +63,110 @@ export async function invokeSkill(options) {
|
|
|
63
63
|
/** Minimal stateless MCP client used by the router's remote path. */
|
|
64
64
|
export const remoteAgentMcpInvoker = {
|
|
65
65
|
async invoke(input) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
body: JSON.stringify({
|
|
77
|
-
jsonrpc: "2.0",
|
|
78
|
-
id: "skill-invoke",
|
|
79
|
-
method: "tools/call",
|
|
80
|
-
params: {
|
|
81
|
-
name: "invoke",
|
|
82
|
-
arguments: {
|
|
83
|
-
input: input.task,
|
|
84
|
-
...(input.capabilityId === undefined ? {} : { capabilityId: input.capabilityId }),
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
}),
|
|
88
|
-
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
89
|
-
});
|
|
90
|
-
const payload = await response.json().catch(() => null);
|
|
91
|
-
if (!response.ok || !isRecord(payload)) {
|
|
66
|
+
return taskResult(await postInvoke(input, {
|
|
67
|
+
input: input.task,
|
|
68
|
+
...(input.capabilityId === undefined ? {} : { capabilityId: input.capabilityId }),
|
|
69
|
+
...(input.progressSummary === undefined ? {} : { progressSummary: input.progressSummary }),
|
|
70
|
+
}));
|
|
71
|
+
},
|
|
72
|
+
async invokeTurn(input) {
|
|
73
|
+
const result = await postInvoke(input, { input: input.task, tools: input.tools, ...(input.items.length === 0 ? {} : { items: input.items }) });
|
|
74
|
+
if (result === undefined || result.isError === true)
|
|
92
75
|
throw new SkillInvocationError("remote_authorization_failed");
|
|
76
|
+
const structured = isRecord(result.structuredContent) ? result.structuredContent : {};
|
|
77
|
+
const requestId = typeof structured.request_id === "string" ? { requestId: structured.request_id.slice(0, 128) } : {};
|
|
78
|
+
const usage = turnUsage(structured.usage);
|
|
79
|
+
const extra = { ...requestId, ...(usage === undefined ? {} : { usage }) };
|
|
80
|
+
if (structured.status === "tool_calls") {
|
|
81
|
+
const calls = (Array.isArray(structured.calls) ? structured.calls : []).flatMap((call) => isRecord(call) && typeof call.callId === "string" && typeof call.name === "string" && typeof call.arguments === "string"
|
|
82
|
+
? [{ callId: call.callId, name: call.name, arguments: call.arguments }]
|
|
83
|
+
: []);
|
|
84
|
+
const items = (Array.isArray(structured.items) ? structured.items : []).flatMap((item) => isRecord(item) && item.type === "function_call" && typeof item.call_id === "string" && typeof item.name === "string" && typeof item.arguments === "string"
|
|
85
|
+
? [{ type: "function_call", call_id: item.call_id, name: item.name, arguments: item.arguments }]
|
|
86
|
+
: []);
|
|
87
|
+
if (calls.length === 0 || items.length === 0)
|
|
88
|
+
throw new SkillInvocationError("remote_call_failed");
|
|
89
|
+
return Object.freeze({ status: "tool_calls", calls, items, ...extra });
|
|
93
90
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
// Any other code is passed on as is; only a failed HTTP call or an empty result means the login was refused.
|
|
97
|
-
if (data.code === "payment_required" || data.code === "entitlement_required" || data.code === "capability_unavailable")
|
|
98
|
-
throw new SkillInvocationError(data.code);
|
|
99
|
-
throw new SkillInvocationError("remote_call_failed", typeof data.code === "string" ? { remoteCode: data.code.slice(0, 64) } : {});
|
|
100
|
-
}
|
|
101
|
-
const result = isRecord(payload.result) ? payload.result : undefined;
|
|
102
|
-
const content = result && Array.isArray(result.content) ? result.content : [];
|
|
103
|
-
const text = content
|
|
104
|
-
.filter((item) => isRecord(item) && item.type === "text" && typeof item.text === "string")
|
|
105
|
-
.map((item) => item.text)
|
|
106
|
-
.join("");
|
|
107
|
-
if (result === undefined || result.isError === true || text.length === 0) {
|
|
91
|
+
const text = resultText(result);
|
|
92
|
+
if (text.length === 0)
|
|
108
93
|
throw new SkillInvocationError("remote_authorization_failed");
|
|
109
|
-
}
|
|
110
|
-
|
|
94
|
+
return Object.freeze({ status: "completed", text, ...extra });
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
export const remoteAgentTaskClient = {
|
|
98
|
+
async status(input) {
|
|
99
|
+
return taskResult(await postInvoke(input, { taskId: input.taskId, ...(input.wait ? { wait: true } : {}) }, "task_status"));
|
|
100
|
+
},
|
|
101
|
+
async cancel(input) {
|
|
102
|
+
return taskResult(await postInvoke(input, { taskId: input.taskId }, "task_cancel"));
|
|
111
103
|
},
|
|
112
104
|
};
|
|
105
|
+
/** The text and, for an Agent task, its state, task id and newest progress line. */
|
|
106
|
+
function taskResult(result) {
|
|
107
|
+
const text = resultText(result);
|
|
108
|
+
if (result === undefined || result.isError === true || text.length === 0) {
|
|
109
|
+
throw new SkillInvocationError("remote_authorization_failed");
|
|
110
|
+
}
|
|
111
|
+
const structured = isRecord(result.structuredContent) ? result.structuredContent : {};
|
|
112
|
+
const state = structured.state === "running" || structured.state === "completed" || structured.state === "failed" || structured.state === "canceled" ? structured.state : undefined;
|
|
113
|
+
const taskId = typeof structured.taskId === "string" && /^[A-Za-z0-9_-]{1,128}$/u.test(structured.taskId) ? structured.taskId : undefined;
|
|
114
|
+
const progressSummary = typeof structured.progressSummary === "string" && structured.progressSummary.length > 0 ? structured.progressSummary.slice(0, 200) : undefined;
|
|
115
|
+
return Object.freeze({
|
|
116
|
+
text,
|
|
117
|
+
...(state === undefined ? {} : { state }),
|
|
118
|
+
...(taskId === undefined ? {} : { taskId }),
|
|
119
|
+
...(progressSummary === undefined ? {} : { progressSummary }),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/** POST one tools/call (`invoke` unless told otherwise) and return its JSON-RPC result, or throw the typed error the router callers expect. */
|
|
123
|
+
async function postInvoke(input, args, tool = "invoke") {
|
|
124
|
+
const endpoint = new URL(`/mcp/${encodeURIComponent(input.modelId)}`, input.relayUrl);
|
|
125
|
+
const response = await fetch(endpoint, {
|
|
126
|
+
method: "POST",
|
|
127
|
+
headers: {
|
|
128
|
+
accept: "application/json",
|
|
129
|
+
"content-type": "application/json",
|
|
130
|
+
...(input.credential?.scheme === "cookie"
|
|
131
|
+
? { cookie: input.credential.value }
|
|
132
|
+
: { authorization: `Bearer ${input.token}` }),
|
|
133
|
+
},
|
|
134
|
+
body: JSON.stringify({
|
|
135
|
+
jsonrpc: "2.0",
|
|
136
|
+
id: "skill-invoke",
|
|
137
|
+
method: "tools/call",
|
|
138
|
+
params: { name: tool, arguments: args },
|
|
139
|
+
}),
|
|
140
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
141
|
+
});
|
|
142
|
+
const payload = await response.json().catch(() => null);
|
|
143
|
+
if (!response.ok || !isRecord(payload)) {
|
|
144
|
+
throw new SkillInvocationError("remote_authorization_failed");
|
|
145
|
+
}
|
|
146
|
+
if (isRecord(payload.error)) {
|
|
147
|
+
const data = isRecord(payload.error.data) ? payload.error.data : {};
|
|
148
|
+
// Any other code is passed on as is; only a failed HTTP call or an empty result means the login was refused.
|
|
149
|
+
if (data.code === "payment_required" || data.code === "entitlement_required" || data.code === "capability_unavailable")
|
|
150
|
+
throw new SkillInvocationError(data.code);
|
|
151
|
+
throw new SkillInvocationError("remote_call_failed", typeof data.code === "string" ? { remoteCode: data.code.slice(0, 64) } : {});
|
|
152
|
+
}
|
|
153
|
+
return isRecord(payload.result) ? payload.result : undefined;
|
|
154
|
+
}
|
|
155
|
+
function resultText(result) {
|
|
156
|
+
const content = result && Array.isArray(result.content) ? result.content : [];
|
|
157
|
+
return content
|
|
158
|
+
.filter((item) => isRecord(item) && item.type === "text" && typeof item.text === "string")
|
|
159
|
+
.map((item) => item.text)
|
|
160
|
+
.join("");
|
|
161
|
+
}
|
|
162
|
+
function turnUsage(value) {
|
|
163
|
+
if (!isRecord(value))
|
|
164
|
+
return undefined;
|
|
165
|
+
const { input_tokens: input, output_tokens: output, total_tokens: total } = value;
|
|
166
|
+
return [input, output, total].every((n) => typeof n === "number" && Number.isSafeInteger(n) && n >= 0)
|
|
167
|
+
? { input_tokens: input, output_tokens: output, total_tokens: total }
|
|
168
|
+
: undefined;
|
|
169
|
+
}
|
|
113
170
|
function isRecord(value) {
|
|
114
171
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
115
172
|
}
|
package/dist/skill/router.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/skill/router.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,6BAA6B,GAE9B,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../src/skill/router.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iB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K,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ Run `frely help --agent --json` for the installed CLI's current capabilities and
|
|
|
7
7
|
|
|
8
8
|
Follow the returned command contract instead of remembered command syntax. If the command is unavailable, report that the installed CLI needs an update.
|
|
9
9
|
|
|
10
|
-
When `frely api call` is refused because the owner must approve it, rerun it with `--wait`: tell the user the approval link first, then run the command in the foreground (tool timeout of at least 10 minutes, never backgrounded or killed). It
|
|
10
|
+
When `frely api call` is refused because the owner must approve it, rerun it with `--wait`: tell the user the approval link first, then run the command in the foreground (tool timeout of at least 10 minutes, never backgrounded or killed). It runs the call once, by itself, as soon as the user approves on their phone or the web, so the user does not need to tell you; if you cannot keep a foreground command open, run `frely permission wait <approval code>` in the background (the refusal shows it) and rerun the call when it exits 0.
|
|
11
11
|
|
|
12
12
|
## Control the user's devices
|
|
13
13
|
|
|
@@ -15,4 +15,4 @@ When `frely api call` is refused because the owner must approve it, rerun it wit
|
|
|
15
15
|
|
|
16
16
|
Use `--out <file>` for large output instead of printing it. Exit codes: 0 done, 1 the CLI itself, 2 the tool or remote command failed, 3 approval needed, 4 not authorized (`frely controller login`), 5 device offline (the output says to run `frely mcp start` there), 6 limit reached.
|
|
17
17
|
|
|
18
|
-
On exit code 3 the output has an approval link and a `frely permission wait <
|
|
18
|
+
On exit code 3 the output has an approval link and a `frely permission wait <approval code>` command. Give the user the link, then run `frely permission wait <short code> --then '<the original command>'` in the background: it runs the original command by itself once they approve, so they do not need to tell you. Do not read `~/.config/frely`.
|