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/agent-help.js.map
CHANGED
|
@@ -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,oMAAoM,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,knBAAknB,EAAE;IAC54B,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,OAAO,EAAE,khBAAkhB,EAAE;IAC7oB,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,4BAA4B,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,uJAAuJ,EAAE;IACvQ,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,wHAAwH,EAAE;IAC/M,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,2BAA2B,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,O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,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,MAAM,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC;IAC3B,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;SACtE,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,KAAK,IAAI,CAAC,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"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** How an eight-letter approval code is shown to people: ABCD-EFGH. Anything else is shown as it came. */
|
|
2
|
+
export declare function formatApprovalCode(code: string): string;
|
|
3
|
+
/** The approval code in a `/device?g=` link, shown as ABCD-EFGH, or null when the link carries none. */
|
|
4
|
+
export declare function approvalCodeOfLink(link: string): string | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** How an eight-letter approval code is shown to people: ABCD-EFGH. Anything else is shown as it came. */
|
|
2
|
+
export function formatApprovalCode(code) {
|
|
3
|
+
return /^[A-HJ-NP-Z]{8}$/u.test(code) ? `${code.slice(0, 4)}-${code.slice(4)}` : code;
|
|
4
|
+
}
|
|
5
|
+
/** The approval code in a `/device?g=` link, shown as ABCD-EFGH, or null when the link carries none. */
|
|
6
|
+
export function approvalCodeOfLink(link) {
|
|
7
|
+
try {
|
|
8
|
+
const code = new URL(link).searchParams.get("g");
|
|
9
|
+
return code ? formatApprovalCode(code) : null;
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=approval-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-code.js","sourceRoot":"","sources":["../src/approval-code.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACxF,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,IAAI,CAAC;QAAC,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAAC,OAAO,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;AACjI,CAAC"}
|
package/dist/cloud.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
/** Names this installation on the web console ("Frely CLI Cloud (host)"). Display only: the server limits the client by its device binding (see bindCloudClient), not by this name. */
|
|
3
|
-
export declare function cloudClientName(host?: string): string;
|
|
1
|
+
import { type ApprovalOutcome, type ApprovalRef } from "./controller/approval-wait.js";
|
|
4
2
|
/** The server's `permission_required` or `confirmation_required` tool failure as a one-line hint, or null for any other result. */
|
|
5
3
|
export declare function permissionHint(result: object): string | null;
|
|
6
4
|
type CallResult = {
|
|
@@ -9,58 +7,17 @@ type CallResult = {
|
|
|
9
7
|
[key: string]: unknown;
|
|
10
8
|
};
|
|
11
9
|
/**
|
|
12
|
-
* After a `permission_required` or `confirmation_required` refusal
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
10
|
+
* After a `permission_required` or `confirmation_required` refusal: waits for the owner's decision with the one shared wait, then runs the call
|
|
11
|
+
* again exactly once, and only when the approval is `approved`. A denied, expired or already-used approval, or a time-out, gives back the refusal
|
|
12
|
+
* without running anything. A confirmation is repeated with the same approvalCode; the server lets it through once. The repeat is never retried,
|
|
13
|
+
* so a write whose outcome was lost is not replayed (it is reported as it came back).
|
|
16
14
|
*/
|
|
17
|
-
export declare function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
sleep?: (ms: number) => Promise<void>;
|
|
21
|
-
}): Promise<CallResult>;
|
|
22
|
-
/**
|
|
23
|
-
* Registration metadata for the Cloud OAuth client. The callback is an http loopback URL, so the client must declare
|
|
24
|
-
* itself `native`: the server treats an unspecified type as `web` and rejects every http redirect URI of a web client.
|
|
25
|
-
*/
|
|
26
|
-
export declare function cloudClientMetadata(redirectUrl: string, host?: string): OAuthClientMetadata & {
|
|
27
|
-
application_type: "native";
|
|
28
|
-
};
|
|
29
|
-
export declare const API_USAGE = "Frely API \u2014 call your Frely account's business operations (keys, credits, orders, Creator items\u2026).\n frely api list [--group <name>] [--json]\n frely api describe <tool>\n frely api call <tool> [--json '<object>' | --input <file>] [--wait]\n\n\"list\" prints the operations grouped by area with a one-line description each; add --json for the full tool list.\nOther results are JSON. The first command opens a browser for authorization;\nfrely logout also revokes it. This authorization is separate from device MCP.\nCalls may create resources or incur usage. Failed writes are never replayed automatically.\nA new device may only read non-sensitive data; for anything else the error links to the web\nconsole page where you grant it (passkey or authenticator code required).\nWith --wait, a call that needs approval prints the link, then blocks until the owner decides and\ncontinues by itself: it returns the real result once approved, or the refusal when denied or expired.\n";
|
|
30
|
-
interface StoredCloud {
|
|
31
|
-
version: 1;
|
|
32
|
-
resource: string;
|
|
33
|
-
redirectUrl: string;
|
|
34
|
-
client?: OAuthClientInformationMixed;
|
|
35
|
-
/** The device this client was last bound to on the server; the binding is what makes the client this computer's CLI. */
|
|
36
|
-
bound?: {
|
|
37
|
-
clientId: string;
|
|
38
|
-
deviceId: string;
|
|
39
|
-
};
|
|
40
|
-
tokens?: OAuthTokens;
|
|
41
|
-
expiresAt?: number;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Tells the server which enrolled device this Cloud client belongs to, so it is limited and shown as this computer's CLI. The server decides by
|
|
45
|
-
* this binding, not by the client's name. Skipped when the same client was already bound to the same device; throws when the server refuses.
|
|
46
|
-
*/
|
|
47
|
-
export declare function bindCloudClient(stored: Pick<StoredCloud, "client" | "bound">, device: {
|
|
48
|
-
deviceId: string;
|
|
49
|
-
}, post: (body: {
|
|
50
|
-
clientId: string;
|
|
51
|
-
deviceId: string;
|
|
52
|
-
}) => Promise<Response>): Promise<{
|
|
53
|
-
clientId: string;
|
|
54
|
-
deviceId: string;
|
|
55
|
-
} | null>;
|
|
56
|
-
/** True when this computer still holds the older Cloud MCP authorization that `frely api` used before it moved onto the controller connection. */
|
|
57
|
-
export declare function hasLegacyCloudAuthorization(): Promise<boolean>;
|
|
15
|
+
export declare function rerunAfterApproval(first: CallResult, call: (input: Record<string, unknown>) => Promise<CallResult>, input: Record<string, unknown>, wait: (ref: ApprovalRef, timeoutMs: number) => Promise<ApprovalOutcome>, now?: () => number): Promise<CallResult>;
|
|
16
|
+
export declare const API_USAGE = "Frely API \u2014 call your Frely account's business operations (keys, credits, orders, Creator items\u2026).\n frely api list [--group <name>] [--json]\n frely api describe <tool>\n frely api call <tool> [--json '<object>' | --input <file>] [--wait]\n\n\"list\" prints the operations grouped by area with a one-line description each; add --json for the full tool list.\nOther results are JSON. The first command asks you to approve this computer in your browser (the same approval as frely controller login);\nfrely logout also revokes it. Without a terminal it prints the approval link and exits; run it again after approving.\nCalls may create resources or incur usage. Failed writes are never replayed automatically.\nA new device may only read non-sensitive data; for anything else the error links to the web\nconsole page where you grant it (passkey or authenticator code required).\nWith --wait, a call that needs approval prints the link, then blocks until the owner decides and\ncontinues by itself: it returns the real result once approved, or the refusal when denied or expired.\n";
|
|
17
|
+
/** Revokes and forgets the Cloud authorization an older CLI left behind; there is nothing to do on a computer that never had one. */
|
|
58
18
|
export declare function logoutCloud(): Promise<void>;
|
|
59
|
-
export declare const NON_INTERACTIVE_AUTHORIZATION = "Cloud authorization is required, but this is not an interactive terminal. Run frely api list in a terminal you can type in to authorize in the browser once, then run this command again.";
|
|
60
19
|
/** True when a person can finish a browser authorization: both stdin and stderr (where the link is printed) are terminals. */
|
|
61
20
|
export declare function isInteractiveTerminal(): boolean;
|
|
62
|
-
/** The underlying failure as ": <one line, at most 200 characters>", or "" when there is none. */
|
|
63
|
-
export declare function failureCause(error: unknown): string;
|
|
64
21
|
interface ListedTool {
|
|
65
22
|
name: string;
|
|
66
23
|
description?: string;
|
package/dist/cloud.js
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
2
|
-
import { hostname } from "node:os";
|
|
3
|
-
import { createServer } from "node:http";
|
|
4
1
|
import { readFile, stat } from "node:fs/promises";
|
|
5
|
-
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
6
|
-
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
7
|
-
import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
8
2
|
import { credentialStore } from "./credential-store.js";
|
|
9
|
-
import { inspectAuth, normalizeRelayUrl
|
|
10
|
-
import { VERSION } from "./version.js";
|
|
3
|
+
import { inspectAuth, normalizeRelayUrl } from "./auth.js";
|
|
11
4
|
import { CloudToolError } from "./skill/cloud-item.js";
|
|
12
|
-
import { ensureDevice, relayFetch } from "./device/control.js";
|
|
13
5
|
import { openController } from "./controller/client.js";
|
|
14
|
-
import {
|
|
6
|
+
import { waitForApproval } from "./controller/approval-wait.js";
|
|
15
7
|
const SERVICE = "frely-cli-cloud-v1";
|
|
16
|
-
/** Names this installation on the web console ("Frely CLI Cloud (host)"). Display only: the server limits the client by its device binding (see bindCloudClient), not by this name. */
|
|
17
|
-
export function cloudClientName(host = hostname()) {
|
|
18
|
-
const safe = host.replace(/[^A-Za-z0-9._ -]/g, "").trim().slice(0, 40);
|
|
19
|
-
return safe ? `Frely CLI Cloud (${safe})` : "Frely CLI Cloud";
|
|
20
|
-
}
|
|
21
8
|
/** The server's `permission_required` or `confirmation_required` tool failure as a one-line hint, or null for any other result. */
|
|
22
9
|
export function permissionHint(result) {
|
|
23
10
|
const { isError, content } = result;
|
|
@@ -36,11 +23,12 @@ export function permissionHint(result) {
|
|
|
36
23
|
if (url.protocol !== "https:" && url.hostname !== "127.0.0.1" && url.hostname !== "localhost")
|
|
37
24
|
continue;
|
|
38
25
|
if (error.code === "confirmation_required") {
|
|
39
|
-
if (typeof error.
|
|
26
|
+
if (typeof error.approvalCode !== "string" || !/^[A-HJ-NP-Z]{8}$/.test(error.approvalCode))
|
|
40
27
|
continue;
|
|
41
|
-
return `${typeof error.summary === "string" ? error.summary + "\n" : ""}Approve this in your browser (
|
|
28
|
+
return `${typeof error.summary === "string" ? error.summary + "\n" : ""}Approve this in your browser: ${url.toString()}\nCode: ${error.approvalCode.slice(0, 4)}-${error.approvalCode.slice(4)}\nThen run the same call again with "approvalCode":"${error.approvalCode}" added to the input, or add --wait to let the CLI wait and run it once. To wait in the background: frely permission wait ${error.approvalCode}`;
|
|
42
29
|
}
|
|
43
|
-
|
|
30
|
+
const waiting = typeof error.shortCode === "string" && /^[A-Za-z]{8}$/.test(error.shortCode) ? `\nTo wait in the background: frely permission wait ${error.shortCode}, then run the call again (or use --wait).` : "";
|
|
31
|
+
return `This device needs ${need}${typeof error.group === "string" ? " to " + error.group : ""}. Grant it in your browser (passkey or authenticator code required): ${url.toString()}${waiting}`;
|
|
44
32
|
}
|
|
45
33
|
catch { /* Not a permission failure. */ }
|
|
46
34
|
}
|
|
@@ -66,40 +54,30 @@ function toolError(result) {
|
|
|
66
54
|
return null;
|
|
67
55
|
}
|
|
68
56
|
/**
|
|
69
|
-
* After a `permission_required` or `confirmation_required` refusal
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
57
|
+
* After a `permission_required` or `confirmation_required` refusal: waits for the owner's decision with the one shared wait, then runs the call
|
|
58
|
+
* again exactly once, and only when the approval is `approved`. A denied, expired or already-used approval, or a time-out, gives back the refusal
|
|
59
|
+
* without running anything. A confirmation is repeated with the same approvalCode; the server lets it through once. The repeat is never retried,
|
|
60
|
+
* so a write whose outcome was lost is not replayed (it is reported as it came back).
|
|
73
61
|
*/
|
|
74
|
-
export async function
|
|
75
|
-
const { intervalMs = 3000, now = Date.now, sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)) } = options;
|
|
62
|
+
export async function rerunAfterApproval(first, call, input, wait, now = Date.now) {
|
|
76
63
|
const start = toolError(first);
|
|
77
|
-
if (!start ||
|
|
64
|
+
if (!start || (start.code !== "permission_required" && start.code !== "confirmation_required"))
|
|
78
65
|
return first;
|
|
79
|
-
const
|
|
80
|
-
|
|
66
|
+
const approvalCode = start.code === "confirmation_required" && typeof start.approvalCode === "string" ? start.approvalCode : undefined;
|
|
67
|
+
const shortCode = start.code === "permission_required" && typeof start.shortCode === "string" ? start.shortCode : undefined;
|
|
68
|
+
const code = approvalCode ?? shortCode;
|
|
69
|
+
if (!code)
|
|
81
70
|
return first;
|
|
82
71
|
const expires = typeof start.expiresAt === "string" || typeof start.expiresAt === "number" ? new Date(start.expiresAt).getTime() : NaN;
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (!pending)
|
|
91
|
-
return last;
|
|
72
|
+
const budget = Math.min(Number.isFinite(expires) ? expires - now() : WAIT_DEFAULT_MS, WAIT_MAX_MS);
|
|
73
|
+
const outcome = await wait({ code }, Math.max(budget, 0));
|
|
74
|
+
if (outcome.status !== "approved") {
|
|
75
|
+
process.stderr.write(outcome.status === "used" ? "This approval was already used for a call; not repeating it. Check that call's result.\n"
|
|
76
|
+
: outcome.status === "pending" ? "Still waiting for the owner. Run the same command with --wait to keep waiting.\n"
|
|
77
|
+
: outcome.status === "error" ? outcome.message + "\n" : `The request was ${outcome.status}.\n`);
|
|
78
|
+
return first;
|
|
92
79
|
}
|
|
93
|
-
return
|
|
94
|
-
}
|
|
95
|
-
const SCOPE = "openid profile offline_access cloud:read cloud:write cloud:execute cloud:publish";
|
|
96
|
-
/**
|
|
97
|
-
* Registration metadata for the Cloud OAuth client. The callback is an http loopback URL, so the client must declare
|
|
98
|
-
* itself `native`: the server treats an unspecified type as `web` and rejects every http redirect URI of a web client.
|
|
99
|
-
*/
|
|
100
|
-
export function cloudClientMetadata(redirectUrl, host = hostname()) {
|
|
101
|
-
return { client_name: cloudClientName(host), application_type: "native", redirect_uris: [redirectUrl],
|
|
102
|
-
grant_types: ["authorization_code", "refresh_token"], response_types: ["code"], token_endpoint_auth_method: "none", scope: SCOPE };
|
|
80
|
+
return call(approvalCode ? { ...input, approvalCode } : input);
|
|
103
81
|
}
|
|
104
82
|
export const API_USAGE = `Frely API — call your Frely account's business operations (keys, credits, orders, Creator items…).
|
|
105
83
|
frely api list [--group <name>] [--json]
|
|
@@ -107,43 +85,21 @@ export const API_USAGE = `Frely API — call your Frely account's business opera
|
|
|
107
85
|
frely api call <tool> [--json '<object>' | --input <file>] [--wait]
|
|
108
86
|
|
|
109
87
|
"list" prints the operations grouped by area with a one-line description each; add --json for the full tool list.
|
|
110
|
-
Other results are JSON. The first command
|
|
111
|
-
frely logout also revokes it.
|
|
88
|
+
Other results are JSON. The first command asks you to approve this computer in your browser (the same approval as frely controller login);
|
|
89
|
+
frely logout also revokes it. Without a terminal it prints the approval link and exits; run it again after approving.
|
|
112
90
|
Calls may create resources or incur usage. Failed writes are never replayed automatically.
|
|
113
91
|
A new device may only read non-sensitive data; for anything else the error links to the web
|
|
114
92
|
console page where you grant it (passkey or authenticator code required).
|
|
115
93
|
With --wait, a call that needs approval prints the link, then blocks until the owner decides and
|
|
116
94
|
continues by itself: it returns the real result once approved, or the refusal when denied or expired.
|
|
117
95
|
`;
|
|
118
|
-
/**
|
|
119
|
-
* Tells the server which enrolled device this Cloud client belongs to, so it is limited and shown as this computer's CLI. The server decides by
|
|
120
|
-
* this binding, not by the client's name. Skipped when the same client was already bound to the same device; throws when the server refuses.
|
|
121
|
-
*/
|
|
122
|
-
export async function bindCloudClient(stored, device, post) {
|
|
123
|
-
const clientId = stored.client?.client_id;
|
|
124
|
-
if (!clientId)
|
|
125
|
-
return null;
|
|
126
|
-
if (stored.bound?.clientId === clientId && stored.bound.deviceId === device.deviceId)
|
|
127
|
-
return stored.bound;
|
|
128
|
-
const response = await post({ clientId, deviceId: device.deviceId });
|
|
129
|
-
if (!response.ok) {
|
|
130
|
-
const payload = await response.json().catch(() => null);
|
|
131
|
-
const message = payload?.error?.message ?? payload?.message;
|
|
132
|
-
throw new Error(typeof message === "string" ? message : `The server refused to link this Cloud authorization to this computer (HTTP ${response.status}).`);
|
|
133
|
-
}
|
|
134
|
-
return { clientId, deviceId: device.deviceId };
|
|
135
|
-
}
|
|
136
96
|
async function cloudIdentity() {
|
|
137
97
|
const account = await inspectAuth();
|
|
138
98
|
const origin = normalizeRelayUrl(account.relayUrl);
|
|
139
99
|
const resource = origin + "/mcp";
|
|
140
100
|
return { origin, resource, userId: account.user?.id, key: resource + "|" + (account.user?.id ?? "cloud") };
|
|
141
101
|
}
|
|
142
|
-
/**
|
|
143
|
-
export async function hasLegacyCloudAuthorization() {
|
|
144
|
-
const identity = await cloudIdentity();
|
|
145
|
-
return Boolean(await credentialStore.getPassword(SERVICE, identity.key));
|
|
146
|
-
}
|
|
102
|
+
/** Revokes and forgets the Cloud authorization an older CLI left behind; there is nothing to do on a computer that never had one. */
|
|
147
103
|
export async function logoutCloud() {
|
|
148
104
|
const identity = await cloudIdentity();
|
|
149
105
|
const raw = await credentialStore.getPassword(SERVICE, identity.key);
|
|
@@ -165,176 +121,10 @@ export async function logoutCloud() {
|
|
|
165
121
|
}
|
|
166
122
|
await credentialStore.deletePassword(SERVICE, identity.key);
|
|
167
123
|
}
|
|
168
|
-
export const NON_INTERACTIVE_AUTHORIZATION = "Cloud authorization is required, but this is not an interactive terminal. Run frely api list in a terminal you can type in to authorize in the browser once, then run this command again.";
|
|
169
124
|
/** True when a person can finish a browser authorization: both stdin and stderr (where the link is printed) are terminals. */
|
|
170
125
|
export function isInteractiveTerminal() {
|
|
171
126
|
return process.stdin.isTTY === true && process.stderr.isTTY === true;
|
|
172
127
|
}
|
|
173
|
-
async function connectCloud() {
|
|
174
|
-
const identity = await cloudIdentity();
|
|
175
|
-
const raw = await credentialStore.getPassword(SERVICE, identity.key);
|
|
176
|
-
let stored = raw ? JSON.parse(raw) : { version: 1, resource: identity.resource, redirectUrl: "" };
|
|
177
|
-
if (stored.version !== 1 || stored.resource !== identity.resource)
|
|
178
|
-
throw new Error("Cloud credentials are invalid. Run frely logout, then frely login.");
|
|
179
|
-
const state = randomUUID();
|
|
180
|
-
let verifier = "";
|
|
181
|
-
let listener;
|
|
182
|
-
let timer;
|
|
183
|
-
let resolveCode;
|
|
184
|
-
let rejectCode;
|
|
185
|
-
let pendingCode;
|
|
186
|
-
const closeListener = async () => {
|
|
187
|
-
if (timer)
|
|
188
|
-
clearTimeout(timer);
|
|
189
|
-
if (listener?.listening)
|
|
190
|
-
await new Promise(resolve => listener.close(() => resolve()));
|
|
191
|
-
};
|
|
192
|
-
const listen = async (port) => {
|
|
193
|
-
listener = createServer((request, response) => {
|
|
194
|
-
const url = new URL(request.url ?? "/", stored.redirectUrl || "http://127.0.0.1");
|
|
195
|
-
if (url.pathname !== "/callback" || url.searchParams.get("state") !== state) {
|
|
196
|
-
response.writeHead(400);
|
|
197
|
-
response.end("Invalid authorization callback.");
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
const code = url.searchParams.get("code");
|
|
201
|
-
response.setHeader("content-type", "text/plain; charset=utf-8");
|
|
202
|
-
response.setHeader("cache-control", "no-store");
|
|
203
|
-
if (!code || url.searchParams.has("error")) {
|
|
204
|
-
response.writeHead(400);
|
|
205
|
-
response.end("Authorization was not completed.");
|
|
206
|
-
rejectCode?.(new Error("Cloud authorization was declined."));
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
response.end("Frely Cloud is authorized. You can close this window.");
|
|
210
|
-
resolveCode?.(code);
|
|
211
|
-
});
|
|
212
|
-
await new Promise((resolve, reject) => {
|
|
213
|
-
listener.once("error", reject);
|
|
214
|
-
listener.listen(port, "127.0.0.1", resolve);
|
|
215
|
-
});
|
|
216
|
-
const address = listener.address();
|
|
217
|
-
if (!address || typeof address === "string")
|
|
218
|
-
throw new Error("Cloud callback could not start.");
|
|
219
|
-
return "http://127.0.0.1:" + address.port + "/callback";
|
|
220
|
-
};
|
|
221
|
-
if (!stored.redirectUrl)
|
|
222
|
-
stored.redirectUrl = await listen(0);
|
|
223
|
-
const callback = new URL(stored.redirectUrl);
|
|
224
|
-
if (callback.protocol !== "http:" || callback.hostname !== "127.0.0.1" || callback.pathname !== "/callback" || !callback.port || callback.username || callback.password || callback.search || callback.hash) {
|
|
225
|
-
await closeListener();
|
|
226
|
-
throw new Error("Stored Cloud callback is invalid.");
|
|
227
|
-
}
|
|
228
|
-
const save = () => credentialStore.setPassword(SERVICE, identity.key, JSON.stringify(stored));
|
|
229
|
-
const provider = {
|
|
230
|
-
redirectUrl: stored.redirectUrl,
|
|
231
|
-
clientMetadata: cloudClientMetadata(stored.redirectUrl),
|
|
232
|
-
state: () => state,
|
|
233
|
-
clientInformation: () => stored.client,
|
|
234
|
-
saveClientInformation: async (client) => { stored.client = client; await save(); },
|
|
235
|
-
tokens: () => stored.tokens,
|
|
236
|
-
saveTokens: async (tokens) => {
|
|
237
|
-
// This checks account selection; signature/audience verification remains on the server.
|
|
238
|
-
if (identity.userId) {
|
|
239
|
-
let subject;
|
|
240
|
-
try {
|
|
241
|
-
subject = JSON.parse(Buffer.from(tokens.access_token.split(".")[1] ?? "", "base64url").toString()).sub;
|
|
242
|
-
}
|
|
243
|
-
catch { /* Rejected below. */ }
|
|
244
|
-
if (subject !== identity.userId)
|
|
245
|
-
throw new Error("Cloud authorization used another account. Use the account shown by frely doctor.");
|
|
246
|
-
}
|
|
247
|
-
stored.tokens = tokens;
|
|
248
|
-
stored.expiresAt = Date.now() + (tokens.expires_in ?? 600) * 1000;
|
|
249
|
-
await save();
|
|
250
|
-
},
|
|
251
|
-
saveCodeVerifier: value => { verifier = value; },
|
|
252
|
-
codeVerifier: () => { if (!verifier)
|
|
253
|
-
throw new Error("Cloud PKCE verifier is missing."); return verifier; },
|
|
254
|
-
redirectToAuthorization: async (url) => {
|
|
255
|
-
if (url.origin !== identity.origin)
|
|
256
|
-
throw new Error("Unexpected Cloud authorization server.");
|
|
257
|
-
if (!listener)
|
|
258
|
-
await listen(Number(callback.port));
|
|
259
|
-
// Scripts and AI tools cannot complete a browser authorization: fail now instead of waiting out the timeout.
|
|
260
|
-
if (!isInteractiveTerminal())
|
|
261
|
-
throw new Error(NON_INTERACTIVE_AUTHORIZATION);
|
|
262
|
-
pendingCode = new Promise((resolve, reject) => { resolveCode = resolve; rejectCode = reject; });
|
|
263
|
-
// Attach immediately so a callback rejection never becomes an unhandled promise.
|
|
264
|
-
pendingCode.catch(() => undefined);
|
|
265
|
-
timer = setTimeout(() => rejectCode?.(new Error("Cloud authorization timed out.")), 300000);
|
|
266
|
-
process.stderr.write("Authorize Frely Cloud in your browser (waiting up to 5 minutes):\n" + url.toString() + "\n");
|
|
267
|
-
openVerificationUrl(url.toString());
|
|
268
|
-
},
|
|
269
|
-
validateResourceURL: async (_serverUrl, resource) => {
|
|
270
|
-
if (resource !== undefined && resource !== identity.resource)
|
|
271
|
-
throw new Error("Cloud resource mismatch.");
|
|
272
|
-
return new URL(identity.resource);
|
|
273
|
-
},
|
|
274
|
-
invalidateCredentials: async (scope) => {
|
|
275
|
-
if (scope === "all" || scope === "client") {
|
|
276
|
-
delete stored.client;
|
|
277
|
-
delete stored.bound;
|
|
278
|
-
}
|
|
279
|
-
if (scope === "all" || scope === "tokens") {
|
|
280
|
-
delete stored.tokens;
|
|
281
|
-
delete stored.expiresAt;
|
|
282
|
-
}
|
|
283
|
-
if (scope === "all" || scope === "verifier")
|
|
284
|
-
verifier = "";
|
|
285
|
-
await save();
|
|
286
|
-
},
|
|
287
|
-
};
|
|
288
|
-
const cloudFetch = async (input, init) => {
|
|
289
|
-
const url = new URL(input instanceof Request ? input.url : input.toString());
|
|
290
|
-
if (url.origin !== identity.origin)
|
|
291
|
-
throw new Error("Cloud discovery cannot send credentials to another origin.");
|
|
292
|
-
return fetch(input, { ...init, redirect: "error", signal: init?.signal
|
|
293
|
-
? AbortSignal.any([init.signal, AbortSignal.timeout(180000)]) : AbortSignal.timeout(180000) });
|
|
294
|
-
};
|
|
295
|
-
const makeTransport = () => new StreamableHTTPClientTransport(new URL(identity.resource), {
|
|
296
|
-
authProvider: provider, fetch: cloudFetch, reconnectionOptions: { maxRetries: 0, initialReconnectionDelay: 1000, maxReconnectionDelay: 1000, reconnectionDelayGrowFactor: 1 },
|
|
297
|
-
});
|
|
298
|
-
const transport = makeTransport();
|
|
299
|
-
let client = new Client({ name: "frely-cli-cloud", version: VERSION });
|
|
300
|
-
try {
|
|
301
|
-
try {
|
|
302
|
-
await client.connect(transport);
|
|
303
|
-
}
|
|
304
|
-
catch (error) {
|
|
305
|
-
if (!(error instanceof UnauthorizedError) || !pendingCode)
|
|
306
|
-
throw error;
|
|
307
|
-
await transport.finishAuth(await pendingCode);
|
|
308
|
-
// A started transport refuses a second start(): the first connect already started it, so reconnect on a fresh one that reads the stored tokens.
|
|
309
|
-
await transport.close().catch(() => undefined);
|
|
310
|
-
client = new Client({ name: "frely-cli-cloud", version: VERSION });
|
|
311
|
-
await client.connect(makeTransport());
|
|
312
|
-
}
|
|
313
|
-
// No call is made before the server knows this authorization belongs to this computer: an unbound client is not limited by approved permissions.
|
|
314
|
-
const device = await ensureDevice();
|
|
315
|
-
const account = await requireLogin();
|
|
316
|
-
const bound = await bindCloudClient(stored, device, body => relayFetch(account.config.relayUrl, account.credential, "/api/user/device-relay/cloud-client", { method: "POST", body: JSON.stringify(body) }));
|
|
317
|
-
if (bound && bound !== stored.bound) {
|
|
318
|
-
stored.bound = bound;
|
|
319
|
-
await save();
|
|
320
|
-
}
|
|
321
|
-
await closeListener();
|
|
322
|
-
return { client, close: () => client.close() };
|
|
323
|
-
}
|
|
324
|
-
catch (error) {
|
|
325
|
-
await closeListener();
|
|
326
|
-
await client.close().catch(() => undefined);
|
|
327
|
-
if (error instanceof Error && error.message === NON_INTERACTIVE_AUTHORIZATION)
|
|
328
|
-
throw error;
|
|
329
|
-
throw new Error(`Cloud connection or authorization failed${failureCause(error)}. Confirm app availability and account selection, then run the command again. No business call was replayed.`);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
/** The underlying failure as ": <one line, at most 200 characters>", or "" when there is none. */
|
|
333
|
-
export function failureCause(error) {
|
|
334
|
-
const message = error instanceof Error ? error.message : typeof error === "string" ? error : "";
|
|
335
|
-
const line = message.replace(/\s+/g, " ").trim();
|
|
336
|
-
return line ? ": " + (line.length > 200 ? line.slice(0, 199) + "…" : line) : "";
|
|
337
|
-
}
|
|
338
128
|
function firstSentence(text) {
|
|
339
129
|
const flat = (text ?? "").replace(/\s+/g, " ").trim();
|
|
340
130
|
const end = flat.search(/[.。!?](\s|$)/);
|
|
@@ -410,48 +200,7 @@ export async function runApi(args) {
|
|
|
410
200
|
throw new Error("Cloud input must be a JSON object.");
|
|
411
201
|
input = value;
|
|
412
202
|
}
|
|
413
|
-
|
|
414
|
-
if (await readSession().catch(() => null) !== null || !await hasLegacyCloudAuthorization())
|
|
415
|
-
return runApiViaController({ action, name, options, fullJson, wait, input });
|
|
416
|
-
process.stderr.write("This computer still uses the older Cloud authorization for frely api. It stops working in the next version: run frely controller login to move to the new one.\n");
|
|
417
|
-
const session = await connectCloud();
|
|
418
|
-
try {
|
|
419
|
-
const all = [];
|
|
420
|
-
const cursors = new Set();
|
|
421
|
-
let cursor;
|
|
422
|
-
do {
|
|
423
|
-
const page = await session.client.listTools(cursor === undefined ? {} : { cursor });
|
|
424
|
-
all.push(...page.tools);
|
|
425
|
-
cursor = page.nextCursor;
|
|
426
|
-
if (cursor && (cursors.has(cursor) || cursors.size >= 100))
|
|
427
|
-
throw new Error("Invalid Cloud tool pagination.");
|
|
428
|
-
if (cursor)
|
|
429
|
-
cursors.add(cursor);
|
|
430
|
-
} while (cursor);
|
|
431
|
-
if (action === "list") {
|
|
432
|
-
const group = options.get("--group");
|
|
433
|
-
const tools = all.filter(tool => !group || tool.name.startsWith(group + "."));
|
|
434
|
-
return fullJson ? { value: { tools } } : { text: formatApiList(tools) };
|
|
435
|
-
}
|
|
436
|
-
const tool = all.find(tool => tool.name === name);
|
|
437
|
-
if (!tool)
|
|
438
|
-
throw new Error("Cloud tool is unavailable or not authorized: " + name);
|
|
439
|
-
if (action === "describe")
|
|
440
|
-
return { value: tool };
|
|
441
|
-
const call = (arguments_) => session.client.callTool({ name: name, arguments: arguments_ }, undefined, { timeout: 180000 });
|
|
442
|
-
let result = await call(input);
|
|
443
|
-
const hint = permissionHint(result);
|
|
444
|
-
if (hint)
|
|
445
|
-
process.stderr.write(hint + "\n");
|
|
446
|
-
if (hint && wait) {
|
|
447
|
-
process.stderr.write("Waiting for approval; this command continues by itself once the owner decides (up to 10 minutes).\n");
|
|
448
|
-
result = await waitForApproval(result, call, input);
|
|
449
|
-
}
|
|
450
|
-
return { value: result, failed: result.isError === true };
|
|
451
|
-
}
|
|
452
|
-
finally {
|
|
453
|
-
await session.close();
|
|
454
|
-
}
|
|
203
|
+
return runApiViaController({ action, name, options, fullJson, wait, input });
|
|
455
204
|
}
|
|
456
205
|
/** `frely api` on the controller connection: the account tools are FrelyMCP's frely_list and frely_call, so the answers and approvals are the same as in an AI client. */
|
|
457
206
|
async function runApiViaController(request) {
|
|
@@ -471,8 +220,8 @@ async function runApiViaController(request) {
|
|
|
471
220
|
if (hint)
|
|
472
221
|
process.stderr.write(hint + "\n");
|
|
473
222
|
if (hint && request.wait) {
|
|
474
|
-
process.stderr.write("Waiting for approval; this command
|
|
475
|
-
result = await
|
|
223
|
+
process.stderr.write("Waiting for approval; this command runs the call once, by itself, as soon as the owner approves (up to 10 minutes).\n");
|
|
224
|
+
result = await rerunAfterApproval(result, call, request.input, (ref, timeoutMs) => waitForApproval(controller, ref, timeoutMs));
|
|
476
225
|
}
|
|
477
226
|
return { value: result, failed: result.isError === true };
|
|
478
227
|
}
|
|
@@ -486,9 +235,9 @@ async function runApiViaController(request) {
|
|
|
486
235
|
* server's error code. Writes are never retried.
|
|
487
236
|
*/
|
|
488
237
|
export async function callCloudTool(name, input) {
|
|
489
|
-
const
|
|
238
|
+
const controller = await openController({ interactive: isInteractiveTerminal() });
|
|
490
239
|
try {
|
|
491
|
-
const result = await
|
|
240
|
+
const result = await controller.call("frely_call", { tool: name, arguments: input });
|
|
492
241
|
const hint = permissionHint(result);
|
|
493
242
|
if (hint)
|
|
494
243
|
process.stderr.write(hint + "\n");
|
|
@@ -509,7 +258,7 @@ export async function callCloudTool(name, input) {
|
|
|
509
258
|
return value;
|
|
510
259
|
}
|
|
511
260
|
finally {
|
|
512
|
-
await
|
|
261
|
+
await controller.close().catch(() => undefined);
|
|
513
262
|
}
|
|
514
263
|
}
|
|
515
264
|
//# sourceMappingURL=cloud.js.map
|