@fargowealth/fargo-ai-cli 1.3.0 → 1.4.1
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 +22 -0
- package/README.md +17 -0
- package/node_modules/@fargowealth/website-connector-runtime/README.md +15 -0
- package/node_modules/@fargowealth/website-connector-runtime/package.json +24 -0
- package/node_modules/@fargowealth/website-connector-runtime/src/index.d.mts +136 -0
- package/node_modules/@fargowealth/website-connector-runtime/src/index.mjs +825 -0
- package/package.json +5 -1
- package/src/constants.mjs +1 -1
- package/src/website-browser-profile.mjs +50 -7
- package/src/website-cli.mjs +81 -6
- package/src/website-connector-definition.d.mts +1 -58
- package/src/website-connector-definition.mjs +1 -339
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.4.1
|
|
4
|
+
|
|
5
|
+
- Capture Connector-declared refresh-only localStorage values without exposing
|
|
6
|
+
them as website request headers or MCP arguments.
|
|
7
|
+
- Add the shared Runtime `auth.refresh.aws-cognito` capability so Browser
|
|
8
|
+
Gateway can refresh expiring ID/access tokens and persist token rotation
|
|
9
|
+
before continuing an operation.
|
|
10
|
+
- Keep rejected refresh credentials fail-closed as `needs_reauth`; transient
|
|
11
|
+
Cognito failures leave the encrypted Connection available for retry.
|
|
12
|
+
- Show Website command help before validating required execution options.
|
|
13
|
+
|
|
14
|
+
## 1.4.0
|
|
15
|
+
|
|
16
|
+
- Allow Website Connector operations to select an explicit text response mode
|
|
17
|
+
for upstream endpoints whose Content-Type does not match their response body.
|
|
18
|
+
- Capture allowlisted localStorage from single-page apps once their DOM is
|
|
19
|
+
interactive, without waiting indefinitely for `document.readyState=complete`.
|
|
20
|
+
- Add `fargo website runtime` and a local execution mode for Connector
|
|
21
|
+
development with `fargo website call --mode local --file <definition>`.
|
|
22
|
+
- Use the same versioned `@fargowealth/website-connector-runtime` implementation
|
|
23
|
+
in Fargo CLI and Browser Gateway, including required-capability negotiation.
|
|
24
|
+
|
|
3
25
|
## 1.3.0
|
|
4
26
|
|
|
5
27
|
- Add `fargo website connect` and `fargo website sync` with an isolated local
|
package/README.md
CHANGED
|
@@ -58,6 +58,7 @@ synchronize later; that Profile is isolated from the user's normal Chrome data.
|
|
|
58
58
|
|
|
59
59
|
```sh
|
|
60
60
|
fargo website validate --file connector.json
|
|
61
|
+
fargo website runtime
|
|
61
62
|
fargo website release --file connector.json --expected-revision 0 --confirm
|
|
62
63
|
fargo website list
|
|
63
64
|
fargo website operations --connector earningshub
|
|
@@ -66,6 +67,7 @@ fargo website sync --connector earningshub
|
|
|
66
67
|
fargo website sync --connector earningshub --no-prompt --settle-ms 5000
|
|
67
68
|
fargo website connection-status --connector earningshub
|
|
68
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"}'
|
|
69
71
|
fargo website binding
|
|
70
72
|
```
|
|
71
73
|
|
|
@@ -78,6 +80,14 @@ capability using SHA-256 digests; the Profile body then goes directly to
|
|
|
78
80
|
protection before replacing the encrypted cloud state. `--no-prompt` is for a
|
|
79
81
|
Profile that is already authenticated.
|
|
80
82
|
|
|
83
|
+
Connectors can declare refresh-only storage selectors separately from request
|
|
84
|
+
headers. For AWS Cognito, Browser Gateway exchanges the encrypted Refresh Token
|
|
85
|
+
for new ID/access tokens before expiry, saves any rotated Refresh Token inside
|
|
86
|
+
the same connection-scoped Durable Object, and only then continues the website
|
|
87
|
+
operation. Refresh Tokens never enter MCP arguments, command output, or normal
|
|
88
|
+
website requests. `sync` is required again only after Cognito rejects or revokes
|
|
89
|
+
the Refresh Token.
|
|
90
|
+
|
|
81
91
|
Connector operations remain brokered through App MCP `website-bridge`, so the
|
|
82
92
|
same operations are available to Codex, WorkBuddy, other Agents, and Teammates.
|
|
83
93
|
V1 releases are owner-private. A Teammate binding delegates the invoking user's
|
|
@@ -85,6 +95,13 @@ identity and contains neither a `connectionId` nor website credentials. The old
|
|
|
85
95
|
`authorize` / `authorize-complete` Cloud Live View commands remain an optional
|
|
86
96
|
fallback, not the primary connection path.
|
|
87
97
|
|
|
98
|
+
For V3 development, `--mode local` opens the isolated local Profile and executes
|
|
99
|
+
the definition with the same `@fargowealth/website-connector-runtime` package
|
|
100
|
+
used by Browser Gateway. Local mode never uploads its captured Profile. Remote
|
|
101
|
+
mode remains the default and authoritative path for production Agents and
|
|
102
|
+
Teammates. `fargo website runtime` prints the local Runtime version and supported
|
|
103
|
+
capabilities so Connector requirements can be checked before execution.
|
|
104
|
+
|
|
88
105
|
## LEGO source snapshots
|
|
89
106
|
|
|
90
107
|
```sh
|
|
@@ -0,0 +1,15 @@
|
|
|
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.
|
|
9
|
+
|
|
10
|
+
Runtime `1.1.0` adds declarative AWS Cognito token refresh. `secretSources`
|
|
11
|
+
select refresh-only browser values, while `headerSources` remains the complete
|
|
12
|
+
set of values allowed in business requests. The runtime can exchange an
|
|
13
|
+
expiring session through Cognito's `GetTokensFromRefreshToken` API and returns a
|
|
14
|
+
new in-memory storage state; the hosting BrowserConnectionSession Durable Object
|
|
15
|
+
is responsible for encrypting and persisting that state before use.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fargowealth/website-connector-runtime",
|
|
3
|
+
"version": "1.1.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,136 @@
|
|
|
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
|
+
secretSources: Array<{ id: string; keySuffix: string; origin: string }>;
|
|
19
|
+
refresh?: {
|
|
20
|
+
kind: "aws_cognito";
|
|
21
|
+
accessTokenSource: { keySuffix: string; origin: string };
|
|
22
|
+
clientId: string;
|
|
23
|
+
idTokenSource: { keySuffix: string; origin: string };
|
|
24
|
+
leewaySeconds: number;
|
|
25
|
+
refreshTokenSource: string;
|
|
26
|
+
region: string;
|
|
27
|
+
userPoolId: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type WebsiteConnectorOperation = {
|
|
32
|
+
operationId: string;
|
|
33
|
+
description: string;
|
|
34
|
+
readOnly: boolean;
|
|
35
|
+
requiresConnection: boolean;
|
|
36
|
+
riskLevel: "low" | "medium" | "high" | "critical";
|
|
37
|
+
inputSchema: WebsiteConnectorInputSchema;
|
|
38
|
+
request: {
|
|
39
|
+
origin: string;
|
|
40
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
41
|
+
path: string;
|
|
42
|
+
query: Record<string, string>;
|
|
43
|
+
headers: Record<string, string>;
|
|
44
|
+
responseMode: "auto" | "json" | "text";
|
|
45
|
+
body?: unknown;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type WebsiteConnectorDefinition = {
|
|
50
|
+
schemaVersion: "fargo.website-connector/v1";
|
|
51
|
+
connectorId: string;
|
|
52
|
+
displayName: string;
|
|
53
|
+
allowedOrigins: string[];
|
|
54
|
+
loginUrl?: string;
|
|
55
|
+
runtime?: {
|
|
56
|
+
minimumVersion: string;
|
|
57
|
+
requiredCapabilities: string[];
|
|
58
|
+
};
|
|
59
|
+
auth: WebsiteConnectorAuth;
|
|
60
|
+
operations: WebsiteConnectorOperation[];
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type WebsiteConnectorBrowserStorageState = {
|
|
64
|
+
cookies: Array<{
|
|
65
|
+
domain: string;
|
|
66
|
+
expires?: number;
|
|
67
|
+
httpOnly?: boolean;
|
|
68
|
+
name: string;
|
|
69
|
+
path: string;
|
|
70
|
+
sameSite?: "Strict" | "Lax" | "None";
|
|
71
|
+
secure?: boolean;
|
|
72
|
+
value: string;
|
|
73
|
+
}>;
|
|
74
|
+
origins: Array<{
|
|
75
|
+
localStorage: Array<{ name: string; value: string }>;
|
|
76
|
+
origin: string;
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type WebsiteConnectorRuntimeDescriptor = {
|
|
81
|
+
capabilities: string[];
|
|
82
|
+
runtimeVersion: string;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const WEBSITE_CONNECTOR_SCHEMA_VERSION: "fargo.website-connector/v1";
|
|
86
|
+
export const WEBSITE_CONNECTOR_RUNTIME_VERSION: "1.1.0";
|
|
87
|
+
export const WEBSITE_CONNECTOR_RUNTIME_CAPABILITIES: readonly string[];
|
|
88
|
+
export class WebsiteConnectorDefinitionError extends Error {
|
|
89
|
+
code: string;
|
|
90
|
+
path: string;
|
|
91
|
+
}
|
|
92
|
+
export class WebsiteConnectorRuntimeError extends Error {
|
|
93
|
+
code: string;
|
|
94
|
+
details?: Record<string, unknown>;
|
|
95
|
+
status: number;
|
|
96
|
+
}
|
|
97
|
+
export function parseWebsiteConnectorDefinition(value: unknown): WebsiteConnectorDefinition;
|
|
98
|
+
export function connectorToolName(connectorId: string, operationId: string): string;
|
|
99
|
+
export function renderWebsiteOperation(definition: unknown, operationId: string, rawArguments: unknown): {
|
|
100
|
+
definition: WebsiteConnectorDefinition;
|
|
101
|
+
operation: WebsiteConnectorOperation;
|
|
102
|
+
request: { body?: unknown; headers: Record<string, string>; method: string; responseMode: "auto" | "json" | "text"; url: string };
|
|
103
|
+
};
|
|
104
|
+
export function websiteConnectorRuntimeDescriptor(): WebsiteConnectorRuntimeDescriptor;
|
|
105
|
+
export function requiredWebsiteConnectorCapabilities(definition: unknown): string[];
|
|
106
|
+
export function assertWebsiteConnectorRuntimeCompatibility(
|
|
107
|
+
definition: unknown,
|
|
108
|
+
descriptor?: WebsiteConnectorRuntimeDescriptor
|
|
109
|
+
): { definition: WebsiteConnectorDefinition; descriptor: WebsiteConnectorRuntimeDescriptor };
|
|
110
|
+
export function executeWebsiteConnectorOperation(
|
|
111
|
+
definition: unknown,
|
|
112
|
+
operationId: string,
|
|
113
|
+
args: unknown,
|
|
114
|
+
options?: {
|
|
115
|
+
fetchImpl?: typeof fetch;
|
|
116
|
+
readOnlyOnly?: boolean;
|
|
117
|
+
runtimeDescriptor?: WebsiteConnectorRuntimeDescriptor;
|
|
118
|
+
storageState?: WebsiteConnectorBrowserStorageState;
|
|
119
|
+
timeoutMs?: number;
|
|
120
|
+
}
|
|
121
|
+
): Promise<unknown>;
|
|
122
|
+
export function refreshWebsiteConnectorAuthentication(
|
|
123
|
+
definition: unknown,
|
|
124
|
+
storageState: WebsiteConnectorBrowserStorageState,
|
|
125
|
+
options?: {
|
|
126
|
+
fetchImpl?: typeof fetch;
|
|
127
|
+
now?: () => number;
|
|
128
|
+
timeoutMs?: number;
|
|
129
|
+
}
|
|
130
|
+
): Promise<{ refreshed: boolean; storageState: WebsiteConnectorBrowserStorageState }>;
|
|
131
|
+
export function browserStorageAuthenticated(
|
|
132
|
+
state: WebsiteConnectorBrowserStorageState,
|
|
133
|
+
auth: WebsiteConnectorAuth,
|
|
134
|
+
now?: number
|
|
135
|
+
): boolean;
|
|
136
|
+
export function sanitizeWebsiteConnectorOutput(value: unknown, storageState: WebsiteConnectorBrowserStorageState): unknown;
|