@fargowealth/fargo-ai-cli 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -9
- package/README.md +49 -20
- package/node_modules/@fargowealth/website-connector-runtime/README.md +8 -0
- package/node_modules/@fargowealth/website-connector-runtime/package.json +24 -0
- package/node_modules/@fargowealth/website-connector-runtime/src/index.d.mts +116 -0
- package/node_modules/@fargowealth/website-connector-runtime/src/index.mjs +614 -0
- package/package.json +5 -1
- package/src/cli.mjs +9 -9
- package/src/constants.mjs +1 -1
- package/src/website-browser-profile.mjs +377 -0
- package/src/website-cli.mjs +364 -0
- package/src/website-connector-definition.d.mts +1 -0
- package/src/website-connector-definition.mjs +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
## 1.4.0
|
|
4
|
+
|
|
5
|
+
- Allow Website Connector operations to select an explicit text response mode
|
|
6
|
+
for upstream endpoints whose Content-Type does not match their response body.
|
|
7
|
+
- Capture allowlisted localStorage from single-page apps once their DOM is
|
|
8
|
+
interactive, without waiting indefinitely for `document.readyState=complete`.
|
|
9
|
+
- Add `fargo website runtime` and a local execution mode for Connector
|
|
10
|
+
development with `fargo website call --mode local --file <definition>`.
|
|
11
|
+
- Use the same versioned `@fargowealth/website-connector-runtime` implementation
|
|
12
|
+
in Fargo CLI and Browser Gateway, including required-capability negotiation.
|
|
13
|
+
|
|
14
|
+
## 1.3.0
|
|
15
|
+
|
|
16
|
+
- Add `fargo website connect` and `fargo website sync` with an isolated local
|
|
17
|
+
Chrome Profile and allowlisted CDP capture.
|
|
18
|
+
- Negotiate one-time Profile import capabilities through Website Bridge MCP,
|
|
19
|
+
then upload browser state directly to the Website Bridge data endpoint.
|
|
20
|
+
- Keep raw Cookie/localStorage and upload secrets out of MCP parameters,
|
|
21
|
+
command output, and the Fargo credential store.
|
|
12
22
|
|
|
13
23
|
## 1.2.0
|
|
14
24
|
|
package/README.md
CHANGED
|
@@ -47,6 +47,53 @@ fargo mcp call lego_app_read --args '{"action":"get","appId":"app_xxx"}'
|
|
|
47
47
|
fargo mcp call lego_app_read --args-file ./arguments.json
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
## Website Connectors
|
|
51
|
+
|
|
52
|
+
`fargo website` is the authoring and control surface for cloud-hosted Website
|
|
53
|
+
Connectors. Connector definitions and immutable releases are stored by Fargo
|
|
54
|
+
Website Bridge; per-user Cookie/localStorage remains encrypted in BrowserGateway
|
|
55
|
+
and is never written to the CLI credential store or emitted as a JSON file. The
|
|
56
|
+
CLI keeps a dedicated local Chrome Profile so the user can log in locally and
|
|
57
|
+
synchronize later; that Profile is isolated from the user's normal Chrome data.
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
fargo website validate --file connector.json
|
|
61
|
+
fargo website runtime
|
|
62
|
+
fargo website release --file connector.json --expected-revision 0 --confirm
|
|
63
|
+
fargo website list
|
|
64
|
+
fargo website operations --connector earningshub
|
|
65
|
+
fargo website connect --connector earningshub
|
|
66
|
+
fargo website sync --connector earningshub
|
|
67
|
+
fargo website sync --connector earningshub --no-prompt --settle-ms 5000
|
|
68
|
+
fargo website connection-status --connector earningshub
|
|
69
|
+
fargo website call --connector earningshub --operation get_symbol --args '{"symbol":"AMZN"}'
|
|
70
|
+
fargo website call --mode local --file connector.json --operation get_symbol --args '{"symbol":"AMZN"}'
|
|
71
|
+
fargo website binding
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`connect` opens the Connector login URL in a Fargo-owned local Chrome Profile.
|
|
75
|
+
After login, the CLI captures only the Connector-declared Cookie and
|
|
76
|
+
localStorage selectors. MCP negotiates a five-minute, single-use upload
|
|
77
|
+
capability using SHA-256 digests; the Profile body then goes directly to
|
|
78
|
+
`https://website-bridge.fargowealth.app` and never crosses the central MCP.
|
|
79
|
+
`sync` reopens the same local Profile and uses optimistic Profile-version
|
|
80
|
+
protection before replacing the encrypted cloud state. `--no-prompt` is for a
|
|
81
|
+
Profile that is already authenticated.
|
|
82
|
+
|
|
83
|
+
Connector operations remain brokered through App MCP `website-bridge`, so the
|
|
84
|
+
same operations are available to Codex, WorkBuddy, other Agents, and Teammates.
|
|
85
|
+
V1 releases are owner-private. A Teammate binding delegates the invoking user's
|
|
86
|
+
identity and contains neither a `connectionId` nor website credentials. The old
|
|
87
|
+
`authorize` / `authorize-complete` Cloud Live View commands remain an optional
|
|
88
|
+
fallback, not the primary connection path.
|
|
89
|
+
|
|
90
|
+
For V3 development, `--mode local` opens the isolated local Profile and executes
|
|
91
|
+
the definition with the same `@fargowealth/website-connector-runtime` package
|
|
92
|
+
used by Browser Gateway. Local mode never uploads its captured Profile. Remote
|
|
93
|
+
mode remains the default and authoritative path for production Agents and
|
|
94
|
+
Teammates. `fargo website runtime` prints the local Runtime version and supported
|
|
95
|
+
capabilities so Connector requirements can be checked before execution.
|
|
96
|
+
|
|
50
97
|
## LEGO source snapshots
|
|
51
98
|
|
|
52
99
|
```sh
|
|
@@ -78,7 +125,7 @@ fargo lego deploy \
|
|
|
78
125
|
--entrypoint index.html \
|
|
79
126
|
--version 1.4.0 \
|
|
80
127
|
--name "Navigation refresh" \
|
|
81
|
-
--notes-file
|
|
128
|
+
--notes-file CHANGELOG.md
|
|
82
129
|
```
|
|
83
130
|
|
|
84
131
|
For Workers use `--target worker`; the default entrypoint becomes `index.js`.
|
|
@@ -104,15 +151,9 @@ fargo lego deploy \
|
|
|
104
151
|
--login-required yes \
|
|
105
152
|
--version 1.4.0 \
|
|
106
153
|
--name "Full-stack release" \
|
|
107
|
-
--notes-file
|
|
154
|
+
--notes-file CHANGELOG.md
|
|
108
155
|
```
|
|
109
156
|
|
|
110
|
-
Release notes are limited to 4,000 characters by both the CLI and hosted
|
|
111
|
-
deployment service. Pass concise notes for one version with `--notes`, or keep
|
|
112
|
-
them in a per-release file such as `RELEASE_NOTES.md`. Do not pass an entire
|
|
113
|
-
multi-version changelog unless it is within the limit and intentionally belongs
|
|
114
|
-
to the new release.
|
|
115
|
-
|
|
116
157
|
Use repeated `--assets-run-worker-first-route <glob>` options instead of the
|
|
117
158
|
boolean flag when only selected routes should invoke the Worker first. The
|
|
118
159
|
hosted LEGO publisher uploads the assets and attaches the binding; Cloudflare
|
|
@@ -152,18 +193,6 @@ MCP deployment contract. The result is `ready`, never automatically published.
|
|
|
152
193
|
Use `--dry-run` to validate both local packages without authentication or
|
|
153
194
|
network writes.
|
|
154
195
|
|
|
155
|
-
After reviewing the returned deployment and receiving explicit approval,
|
|
156
|
-
publish that exact deployment through Fargo Pass MCP:
|
|
157
|
-
|
|
158
|
-
```sh
|
|
159
|
-
fargo mcp call lego_deployment_release --args \
|
|
160
|
-
'{"action":"publish","appId":"app_xxx","deploymentId":"dep_xxx"}'
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
Publication is a separate production write. The prepared deployment already
|
|
164
|
-
contains its security-checked access policy, so callers normally do not need to
|
|
165
|
-
repeat `visibility`, `loginRequired`, or `accessTargets` at publish time.
|
|
166
|
-
|
|
167
196
|
Deployment artifacts preserve binary bytes and include
|
|
168
197
|
`.fargo-deploy/manifest.json`. Default limits are 1,000 files, 25 MB total,
|
|
169
198
|
20 MB per file, and a 25 MB ZIP.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Fargo Website Connector Runtime
|
|
2
|
+
|
|
3
|
+
The shared, declarative Website Connector compiler and execution runtime used
|
|
4
|
+
by both Fargo CLI local debugging and the Fargo Browser Gateway.
|
|
5
|
+
|
|
6
|
+
Connector definitions contain data only. They cannot ship executable code.
|
|
7
|
+
Callers provide browser storage at execution time; the runtime never persists
|
|
8
|
+
cookies or localStorage.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fargowealth/website-connector-runtime",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Shared declarative Website Connector runtime for Fargo AI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./src/index.d.mts",
|
|
9
|
+
"import": "./src/index.mjs"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"src",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=20.19.0"
|
|
18
|
+
},
|
|
19
|
+
"private": true,
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "node --test test/*.test.mjs"
|
|
22
|
+
},
|
|
23
|
+
"license": "UNLICENSED"
|
|
24
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export type WebsiteConnectorInputSchema = {
|
|
2
|
+
additionalProperties: false;
|
|
3
|
+
properties: Record<string, {
|
|
4
|
+
enum?: Array<string | number | boolean>;
|
|
5
|
+
maxLength?: number;
|
|
6
|
+
type: "string" | "number" | "integer" | "boolean";
|
|
7
|
+
}>;
|
|
8
|
+
required: string[];
|
|
9
|
+
type: "object";
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type WebsiteConnectorAuth =
|
|
13
|
+
| { kind: "none" }
|
|
14
|
+
| {
|
|
15
|
+
kind: "browser_storage";
|
|
16
|
+
sendCookies: boolean;
|
|
17
|
+
headerSources: Array<{ keySuffix: string; name: string; origin: string; prefix?: string }>;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type WebsiteConnectorOperation = {
|
|
21
|
+
operationId: string;
|
|
22
|
+
description: string;
|
|
23
|
+
readOnly: boolean;
|
|
24
|
+
requiresConnection: boolean;
|
|
25
|
+
riskLevel: "low" | "medium" | "high" | "critical";
|
|
26
|
+
inputSchema: WebsiteConnectorInputSchema;
|
|
27
|
+
request: {
|
|
28
|
+
origin: string;
|
|
29
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
30
|
+
path: string;
|
|
31
|
+
query: Record<string, string>;
|
|
32
|
+
headers: Record<string, string>;
|
|
33
|
+
responseMode: "auto" | "json" | "text";
|
|
34
|
+
body?: unknown;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type WebsiteConnectorDefinition = {
|
|
39
|
+
schemaVersion: "fargo.website-connector/v1";
|
|
40
|
+
connectorId: string;
|
|
41
|
+
displayName: string;
|
|
42
|
+
allowedOrigins: string[];
|
|
43
|
+
loginUrl?: string;
|
|
44
|
+
runtime?: {
|
|
45
|
+
minimumVersion: string;
|
|
46
|
+
requiredCapabilities: string[];
|
|
47
|
+
};
|
|
48
|
+
auth: WebsiteConnectorAuth;
|
|
49
|
+
operations: WebsiteConnectorOperation[];
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type WebsiteConnectorBrowserStorageState = {
|
|
53
|
+
cookies: Array<{
|
|
54
|
+
domain: string;
|
|
55
|
+
expires?: number;
|
|
56
|
+
httpOnly?: boolean;
|
|
57
|
+
name: string;
|
|
58
|
+
path: string;
|
|
59
|
+
sameSite?: "Strict" | "Lax" | "None";
|
|
60
|
+
secure?: boolean;
|
|
61
|
+
value: string;
|
|
62
|
+
}>;
|
|
63
|
+
origins: Array<{
|
|
64
|
+
localStorage: Array<{ name: string; value: string }>;
|
|
65
|
+
origin: string;
|
|
66
|
+
}>;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export type WebsiteConnectorRuntimeDescriptor = {
|
|
70
|
+
capabilities: string[];
|
|
71
|
+
runtimeVersion: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const WEBSITE_CONNECTOR_SCHEMA_VERSION: "fargo.website-connector/v1";
|
|
75
|
+
export const WEBSITE_CONNECTOR_RUNTIME_VERSION: "1.0.0";
|
|
76
|
+
export const WEBSITE_CONNECTOR_RUNTIME_CAPABILITIES: readonly string[];
|
|
77
|
+
export class WebsiteConnectorDefinitionError extends Error {
|
|
78
|
+
code: string;
|
|
79
|
+
path: string;
|
|
80
|
+
}
|
|
81
|
+
export class WebsiteConnectorRuntimeError extends Error {
|
|
82
|
+
code: string;
|
|
83
|
+
details?: Record<string, unknown>;
|
|
84
|
+
status: number;
|
|
85
|
+
}
|
|
86
|
+
export function parseWebsiteConnectorDefinition(value: unknown): WebsiteConnectorDefinition;
|
|
87
|
+
export function connectorToolName(connectorId: string, operationId: string): string;
|
|
88
|
+
export function renderWebsiteOperation(definition: unknown, operationId: string, rawArguments: unknown): {
|
|
89
|
+
definition: WebsiteConnectorDefinition;
|
|
90
|
+
operation: WebsiteConnectorOperation;
|
|
91
|
+
request: { body?: unknown; headers: Record<string, string>; method: string; responseMode: "auto" | "json" | "text"; url: string };
|
|
92
|
+
};
|
|
93
|
+
export function websiteConnectorRuntimeDescriptor(): WebsiteConnectorRuntimeDescriptor;
|
|
94
|
+
export function requiredWebsiteConnectorCapabilities(definition: unknown): string[];
|
|
95
|
+
export function assertWebsiteConnectorRuntimeCompatibility(
|
|
96
|
+
definition: unknown,
|
|
97
|
+
descriptor?: WebsiteConnectorRuntimeDescriptor
|
|
98
|
+
): { definition: WebsiteConnectorDefinition; descriptor: WebsiteConnectorRuntimeDescriptor };
|
|
99
|
+
export function executeWebsiteConnectorOperation(
|
|
100
|
+
definition: unknown,
|
|
101
|
+
operationId: string,
|
|
102
|
+
args: unknown,
|
|
103
|
+
options?: {
|
|
104
|
+
fetchImpl?: typeof fetch;
|
|
105
|
+
readOnlyOnly?: boolean;
|
|
106
|
+
runtimeDescriptor?: WebsiteConnectorRuntimeDescriptor;
|
|
107
|
+
storageState?: WebsiteConnectorBrowserStorageState;
|
|
108
|
+
timeoutMs?: number;
|
|
109
|
+
}
|
|
110
|
+
): Promise<unknown>;
|
|
111
|
+
export function browserStorageAuthenticated(
|
|
112
|
+
state: WebsiteConnectorBrowserStorageState,
|
|
113
|
+
auth: WebsiteConnectorAuth,
|
|
114
|
+
now?: number
|
|
115
|
+
): boolean;
|
|
116
|
+
export function sanitizeWebsiteConnectorOutput(value: unknown, storageState: WebsiteConnectorBrowserStorageState): unknown;
|