@fargowealth/fargo-ai-cli 1.4.1 → 1.4.2

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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.2
4
+
5
+ - Add generic large-file upload to Media and R2 resources with resumable TUS and optional local FFmpeg compression.
6
+ - Remove the obsolete Website Connector commands and bundled runtime.
7
+
3
8
  ## 1.4.1
4
9
 
5
10
  - Capture Connector-declared refresh-only localStorage values without exposing
package/README.md CHANGED
@@ -47,60 +47,23 @@ 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
50
+ ## Large-file transfer
51
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.
52
+ `fargo upload` transfers a local file using an upload descriptor supplied by
53
+ the target Media or R2 resource. The descriptor contains the resource's
54
+ upload URL and, when needed, preparation and completion actions. Keep it
55
+ private because it may contain short-lived upload credentials.
58
56
 
59
57
  ```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
58
+ fargo upload --file ./video.mov --request-file ./upload-request.json
59
+ fargo upload --file ./video.mov --request-file ./upload-request.json --compress
60
+ fargo upload --resume /path/to/checkpoint.json
72
61
  ```
73
62
 
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
- 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
-
91
- Connector operations remain brokered through App MCP `website-bridge`, so the
92
- same operations are available to Codex, WorkBuddy, other Agents, and Teammates.
93
- V1 releases are owner-private. A Teammate binding delegates the invoking user's
94
- identity and contains neither a `connectionId` nor website credentials. The old
95
- `authorize` / `authorize-complete` Cloud Live View commands remain an optional
96
- fallback, not the primary connection path.
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.
63
+ Media uploads support resumable TUS or direct multipart transfer; R2 uploads
64
+ use a signed PUT URL. `--compress` uses a locally installed FFmpeg. For a TUS
65
+ transfer, the CLI prints a private checkpoint path that can resume an interrupted
66
+ upload. Run `fargo upload --help` for the complete options.
104
67
 
105
68
  ## LEGO source snapshots
106
69
 
@@ -133,7 +96,7 @@ fargo lego deploy \
133
96
  --entrypoint index.html \
134
97
  --version 1.4.0 \
135
98
  --name "Navigation refresh" \
136
- --notes-file CHANGELOG.md
99
+ --notes-file RELEASE_NOTES.md
137
100
  ```
138
101
 
139
102
  For Workers use `--target worker`; the default entrypoint becomes `index.js`.
@@ -159,9 +122,15 @@ fargo lego deploy \
159
122
  --login-required yes \
160
123
  --version 1.4.0 \
161
124
  --name "Full-stack release" \
162
- --notes-file CHANGELOG.md
125
+ --notes-file RELEASE_NOTES.md
163
126
  ```
164
127
 
128
+ Release notes are limited to 4,000 characters by both the CLI and hosted
129
+ deployment service. Pass concise notes for one version with `--notes`, or keep
130
+ them in a per-release file such as `RELEASE_NOTES.md`. Do not pass an entire
131
+ multi-version changelog unless it is within the limit and intentionally belongs
132
+ to the new release.
133
+
165
134
  Use repeated `--assets-run-worker-first-route <glob>` options instead of the
166
135
  boolean flag when only selected routes should invoke the Worker first. The
167
136
  hosted LEGO publisher uploads the assets and attaches the binding; Cloudflare
@@ -201,6 +170,18 @@ MCP deployment contract. The result is `ready`, never automatically published.
201
170
  Use `--dry-run` to validate both local packages without authentication or
202
171
  network writes.
203
172
 
173
+ After reviewing the returned deployment and receiving explicit approval,
174
+ publish that exact deployment through Fargo Pass MCP:
175
+
176
+ ```sh
177
+ fargo mcp call lego_deployment_release --args \
178
+ '{"action":"publish","appId":"app_xxx","deploymentId":"dep_xxx"}'
179
+ ```
180
+
181
+ Publication is a separate production write. The prepared deployment already
182
+ contains its security-checked access policy, so callers normally do not need to
183
+ repeat `visibility`, `loginRequired`, or `accessTargets` at publish time.
184
+
204
185
  Deployment artifacts preserve binary bytes and include
205
186
  `.fargo-deploy/manifest.json`. Default limits are 1,000 files, 25 MB total,
206
187
  20 MB per file, and a 25 MB ZIP.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fargowealth/fargo-ai-cli",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Agent-neutral Fargo AI CLI, MCP client, and LEGO project tooling",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,13 +17,9 @@
17
17
  "node": ">=20.19.0"
18
18
  },
19
19
  "dependencies": {
20
- "@fargowealth/website-connector-runtime": "^1.1.0",
21
20
  "fflate": "^0.8.2",
22
21
  "ignore": "^7.0.6"
23
22
  },
24
- "bundleDependencies": [
25
- "@fargowealth/website-connector-runtime"
26
- ],
27
23
  "license": "UNLICENSED",
28
24
  "publishConfig": {
29
25
  "access": "public"
package/src/cli.mjs CHANGED
@@ -9,7 +9,7 @@ import { applyLegoMigrations, planLegoMigrations } from "./lego-migrations.mjs";
9
9
  import { callMcpTool, listMcpTools } from "./mcp-client.mjs";
10
10
  import { runMcpProxy } from "./mcp-proxy.mjs";
11
11
  import { installAgentMcp } from "./agent-install.mjs";
12
- import { runWebsiteCommand } from "./website-cli.mjs";
12
+ import { transferUpload } from "./upload-transfer.mjs";
13
13
 
14
14
  export async function runCli(args, options = {}) {
15
15
  const stdout = options.stdout ?? process.stdout;
@@ -24,6 +24,10 @@ export async function runCli(args, options = {}) {
24
24
  stdout.write(ROOT_HELP);
25
25
  return;
26
26
  }
27
+ if (args[0] === "upload" && isHelpOption(args)) {
28
+ stdout.write(UPLOAD_HELP);
29
+ return;
30
+ }
27
31
  if (args[0] === "version" || args[0] === "--version" || args[0] === "-v") {
28
32
  stdout.write(`fargo-cli version ${CLI_VERSION}\n`);
29
33
  return;
@@ -62,8 +66,23 @@ export async function runCli(args, options = {}) {
62
66
  stdout.write(`${JSON.stringify(await callMcpTool(store, toolName, toolArgs, options))}\n`);
63
67
  return;
64
68
  }
65
- if (args[0] === "website") {
66
- await runWebsiteCommand(args, stdout, store, options);
69
+ if (args[0] === "upload") {
70
+ const input = {
71
+ compress: args.includes("--compress"),
72
+ ffmpegBin: optionValue(args, "--ffmpeg-bin")?.trim(),
73
+ filePath: optionValue(args, "--file")?.trim(),
74
+ requestPath: optionValue(args, "--request-file")?.trim(),
75
+ resumePath: optionValue(args, "--resume")?.trim(),
76
+ };
77
+ if (input.resumePath) {
78
+ if (input.compress || input.ffmpegBin || input.requestPath) throw new Error("--resume cannot be combined with --compress, --ffmpeg-bin, or --request-file");
79
+ } else {
80
+ for (const [key, optionName] of [["filePath", "--file"], ["requestPath", "--request-file"]]) {
81
+ if (!input[key] || input[key].startsWith("--")) throw new Error(`Missing required option ${optionName}`);
82
+ }
83
+ if (input.ffmpegBin && !input.compress) throw new Error("--ffmpeg-bin requires --compress");
84
+ }
85
+ stdout.write(`${JSON.stringify(await transferUpload(input, { ...options, stderr, store }))}\n`);
67
86
  return;
68
87
  }
69
88
  if (args[0] === "lego" && args[1] === "snapshot") {
@@ -131,7 +150,7 @@ export async function runCli(args, options = {}) {
131
150
  await installAgentConnection(args, "workbuddy", stdout, store, options);
132
151
  return;
133
152
  }
134
- throw new Error("Usage: fargo auth login|device|status|logout | fargo agent install --agent <agent> | fargo mcp serve|tools|call | fargo website validate|release|list|operations|call|connect|sync|connection-status|authorize|authorize-complete|binding | fargo lego snapshot upload|list|download | fargo lego deploy | fargo lego d1 migrate plan|apply | fargo workbuddy install | fargo version");
153
+ throw new Error("Usage: fargo auth login|device|status|logout | fargo agent install --agent <agent> | fargo mcp serve|tools|call | fargo upload | fargo lego snapshot upload|list|download | fargo lego deploy | fargo lego d1 migrate plan|apply | fargo workbuddy install | fargo version");
135
154
  } catch (error) {
136
155
  stderr.write(`fargo: ${error instanceof Error ? error.message : "unknown error"}\n`);
137
156
  if (options.throwOnError) throw error;
@@ -145,7 +164,7 @@ Commands:
145
164
  auth login|device|status|logout
146
165
  agent install --agent <codex|claude-code|cursor|workbuddy>
147
166
  mcp serve|tools|call
148
- website validate|release|list|operations|call|connect|sync|connection-status|authorize|authorize-complete|binding
167
+ upload --file <path> --request-file <path>
149
168
  lego snapshot upload|list|download
150
169
  lego deploy
151
170
  lego d1 migrate plan|apply
@@ -155,6 +174,26 @@ Commands:
155
174
  Run "fargo lego deploy --help" for deployment options.
156
175
  `;
157
176
 
177
+ const UPLOAD_HELP = `Usage: fargo upload [options]
178
+
179
+ Required for a new upload:
180
+ --file <path> Local file to transfer
181
+ --request-file <path> JSON upload descriptor supplied by a resource
182
+
183
+ Optional:
184
+ --compress Transcode a video to H.264/AAC MP4 with local FFmpeg
185
+ --ffmpeg-bin <path> FFmpeg executable (default: FFMPEG_PATH or ffmpeg)
186
+ --resume <checkpoint.json> Resume an interrupted Media TUS upload
187
+
188
+ Supported resource providers:
189
+ media TUS for resumable uploads, or multipart direct upload
190
+ r2 Signed HTTP PUT upload
191
+
192
+ FFmpeg is optional and is never bundled with Fargo CLI. If --compress is selected
193
+ and FFmpeg is missing, Fargo prints install instructions for the current OS.
194
+ The resource prepares its upload descriptor using the final file size after compression.
195
+ `;
196
+
158
197
  const LEGO_DEPLOY_HELP = `Usage: fargo lego deploy [options]
159
198
 
160
199
  Required:
@@ -163,7 +202,8 @@ Required:
163
202
  --target <pages|worker> Deployment target
164
203
  --version <version> Release version
165
204
  --name <name> Release name
166
- --notes <text> Release notes (or --notes-file <path>)
205
+ --notes <text> One release's notes, maximum 4000 characters
206
+ --notes-file <path> Read one release's notes from a file; same limit
167
207
 
168
208
  Source and execution:
169
209
  --source <directory> Source snapshot root (default: .)
@@ -194,13 +234,18 @@ Worker Runtime Topology:
194
234
  --queue-max-concurrency <n> Optional maximum concurrent consumers
195
235
  --queue-retry-delay <s> Optional retry delay in seconds
196
236
 
237
+ Result and publication:
238
+ This command creates a ready, unpublished deployment. Production traffic is
239
+ unchanged. After review and explicit approval, publish the returned deployment
240
+ with Fargo Pass MCP lego_deployment_release(action=publish).
241
+
197
242
  Example:
198
243
  fargo lego deploy --app app_xxx --source . \\
199
244
  --deploy-dir .build/worker --target worker --entrypoint index.js \\
200
245
  --assets-dir dist --assets-binding ASSETS \\
201
246
  --assets-not-found-handling single-page-application \\
202
247
  --assets-run-worker-first --version 1.4.0 --name "Full-stack release" \\
203
- --notes-file CHANGELOG.md
248
+ --notes-file RELEASE_NOTES.md
204
249
 
205
250
  .fargo-assets/ is an internal archive directory reserved for Fargo CLI.
206
251
  Do not create or copy it manually; always pass browser output with --assets-dir.
package/src/constants.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export const CLI_VERSION = "1.4.1";
1
+ export const CLI_VERSION = "1.4.2";
2
2
  export const DEVICE_CODE_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:device_code";
3
3
  export const DEFAULT_AUTH_URL = "https://auth.fargowealth.app";
4
4
  export const DEFAULT_API_URL = "https://mcp.fargowealth.app";