@fargowealth/fargo-ai-cli 1.0.0 → 1.1.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 +14 -0
- package/package.json +1 -1
- package/src/cli.mjs +45 -0
- package/src/constants.mjs +1 -1
- package/src/lego-deploy.mjs +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
- Fixed the runtime and OAuth `User-Agent` version so the published CLI reports
|
|
6
|
+
the same version as its npm package metadata and passes Fargo Pass 1.1 compatibility checks.
|
|
7
|
+
- Added a release gate that prevents the executable version constant from drifting
|
|
8
|
+
behind the package version again.
|
|
9
|
+
|
|
10
|
+
## 1.1.0
|
|
11
|
+
|
|
12
|
+
- Added Worker Cron Trigger and Queue Consumer deployment options, including
|
|
13
|
+
bounded batch, retry, delay, timeout, and concurrency settings.
|
|
14
|
+
- Deployment preparation now persists runtime topology so Cron and Queue
|
|
15
|
+
changes are applied only when the prepared Worker version is published.
|
|
16
|
+
|
|
3
17
|
## 0.8.0
|
|
4
18
|
|
|
5
19
|
- Replaced regex-based D1 migration checks with token-structured parsing that
|
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -75,6 +75,7 @@ export async function runCli(args, options = {}) {
|
|
|
75
75
|
const versionName = requiredTextOption(args, "--name", 160);
|
|
76
76
|
const releaseNotes = await requiredNotesOption(args);
|
|
77
77
|
const workerFirstRoutes = optionValues(args, "--assets-run-worker-first-route").filter(Boolean);
|
|
78
|
+
const queueConsumer = queueConsumerOption(args);
|
|
78
79
|
const result = await deployLocalLegoApp(store, {
|
|
79
80
|
appId,
|
|
80
81
|
assetsBinding: optionValue(args, "--assets-binding"),
|
|
@@ -82,10 +83,12 @@ export async function runCli(args, options = {}) {
|
|
|
82
83
|
assetsHtmlHandling: optionValue(args, "--assets-html-handling"),
|
|
83
84
|
assetsNotFoundHandling: optionValue(args, "--assets-not-found-handling"),
|
|
84
85
|
assetsRunWorkerFirst: workerFirstRoutes.length > 0 ? workerFirstRoutes : args.includes("--assets-run-worker-first"),
|
|
86
|
+
cronSchedules: optionValues(args, "--cron").filter(Boolean),
|
|
85
87
|
deployDir,
|
|
86
88
|
dryRun: args.includes("--dry-run"),
|
|
87
89
|
entrypoint: optionValue(args, "--entrypoint"),
|
|
88
90
|
releaseNotes,
|
|
91
|
+
queueConsumer,
|
|
89
92
|
skipSource: args.includes("--skip-source"),
|
|
90
93
|
source: optionValue(args, "--source") ?? ".",
|
|
91
94
|
sourceExcludes: optionValues(args, "--source-exclude"),
|
|
@@ -173,6 +176,15 @@ Worker Static Assets:
|
|
|
173
176
|
--assets-run-worker-first-route <glob>
|
|
174
177
|
Repeatable Worker-first route
|
|
175
178
|
|
|
179
|
+
Worker Runtime Topology:
|
|
180
|
+
--cron <expression> Repeatable Cron trigger; requires cron_trigger
|
|
181
|
+
--queue-consumer <binding> Configure this App Queue binding as a consumer
|
|
182
|
+
--queue-max-batch-size <n> Default: 10; range: 1-100
|
|
183
|
+
--queue-max-batch-timeout <s> Default: 5; range: 0-60 seconds
|
|
184
|
+
--queue-max-retries <n> Default: 3; range: 0-100
|
|
185
|
+
--queue-max-concurrency <n> Optional maximum concurrent consumers
|
|
186
|
+
--queue-retry-delay <s> Optional retry delay in seconds
|
|
187
|
+
|
|
176
188
|
Example:
|
|
177
189
|
fargo lego deploy --app app_xxx --source . \\
|
|
178
190
|
--deploy-dir .build/worker --target worker --entrypoint index.js \\
|
|
@@ -220,6 +232,39 @@ function assertAssetsDirectoryProvided(args, assetsDirectory) {
|
|
|
220
232
|
}
|
|
221
233
|
}
|
|
222
234
|
|
|
235
|
+
function queueConsumerOption(args) {
|
|
236
|
+
const bindingName = optionValue(args, "--queue-consumer")?.trim();
|
|
237
|
+
const settingNames = [
|
|
238
|
+
"--queue-max-batch-size",
|
|
239
|
+
"--queue-max-batch-timeout",
|
|
240
|
+
"--queue-max-retries",
|
|
241
|
+
"--queue-max-concurrency",
|
|
242
|
+
"--queue-retry-delay"
|
|
243
|
+
];
|
|
244
|
+
if (!bindingName) {
|
|
245
|
+
if (settingNames.some((name) => hasOption(args, name))) {
|
|
246
|
+
throw new Error("Queue consumer settings require --queue-consumer <binding>");
|
|
247
|
+
}
|
|
248
|
+
return undefined;
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
bindingName,
|
|
252
|
+
...integerOption(args, "--queue-max-batch-size", "maxBatchSize"),
|
|
253
|
+
...integerOption(args, "--queue-max-batch-timeout", "maxBatchTimeout"),
|
|
254
|
+
...integerOption(args, "--queue-max-retries", "maxRetries"),
|
|
255
|
+
...integerOption(args, "--queue-max-concurrency", "maxConcurrency"),
|
|
256
|
+
...integerOption(args, "--queue-retry-delay", "retryDelay")
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function integerOption(args, optionName, propertyName) {
|
|
261
|
+
const value = optionValue(args, optionName);
|
|
262
|
+
if (value === undefined) return {};
|
|
263
|
+
const parsed = Number(value);
|
|
264
|
+
if (!Number.isInteger(parsed)) throw new Error(`${optionName} must be an integer`);
|
|
265
|
+
return { [propertyName]: parsed };
|
|
266
|
+
}
|
|
267
|
+
|
|
223
268
|
function hasOption(args, name) {
|
|
224
269
|
return args.some((value) => value === name || value.startsWith(`${name}=`));
|
|
225
270
|
}
|
package/src/constants.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const CLI_VERSION = "1.
|
|
1
|
+
export const CLI_VERSION = "1.1.1";
|
|
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";
|
package/src/lego-deploy.mjs
CHANGED
|
@@ -7,6 +7,9 @@ import { createSourceSnapshot } from "./source-snapshot.mjs";
|
|
|
7
7
|
|
|
8
8
|
export async function deployLocalLegoApp(store, input, options = {}) {
|
|
9
9
|
const target = requiredTarget(input.target);
|
|
10
|
+
if (target !== "worker" && (input.cronSchedules?.length || input.queueConsumer)) {
|
|
11
|
+
throw new Error("Cron and Queue consumer topology is supported only for Worker deployments");
|
|
12
|
+
}
|
|
10
13
|
const entrypoint = input.entrypoint || (target === "pages" ? "index.html" : "index.js");
|
|
11
14
|
const [snapshot, artifact] = await Promise.all([
|
|
12
15
|
input.skipSource ? Promise.resolve(undefined) : createSourceSnapshot(input.source || ".", {
|
|
@@ -63,9 +66,11 @@ export async function deployLocalLegoApp(store, input, options = {}) {
|
|
|
63
66
|
const deploymentInput = {
|
|
64
67
|
action: target,
|
|
65
68
|
appId: input.appId,
|
|
69
|
+
...(input.cronSchedules?.length ? { cronSchedules: input.cronSchedules } : {}),
|
|
66
70
|
deployArtifactId,
|
|
67
71
|
entrypoint: artifact.entrypoint,
|
|
68
72
|
releaseNotes: input.releaseNotes,
|
|
73
|
+
...(input.queueConsumer ? { queueConsumer: input.queueConsumer } : {}),
|
|
69
74
|
version: input.version,
|
|
70
75
|
versionName: input.versionName,
|
|
71
76
|
...(sourceSnapshotId ? { sourceSnapshotId } : {})
|