@fargowealth/fargo-ai-cli 1.3.0 → 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 +11 -0
- package/README.md +9 -0
- 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/constants.mjs +1 -1
- package/src/website-browser-profile.mjs +34 -3
- package/src/website-cli.mjs +79 -5
- package/src/website-connector-definition.d.mts +1 -58
- package/src/website-connector-definition.mjs +1 -339
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
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
|
+
|
|
3
14
|
## 1.3.0
|
|
4
15
|
|
|
5
16
|
- 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
|
|
|
@@ -85,6 +87,13 @@ identity and contains neither a `connectionId` nor website credentials. The old
|
|
|
85
87
|
`authorize` / `authorize-complete` Cloud Live View commands remain an optional
|
|
86
88
|
fallback, not the primary connection path.
|
|
87
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
|
+
|
|
88
97
|
## LEGO source snapshots
|
|
89
98
|
|
|
90
99
|
```sh
|
|
@@ -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;
|