@fluidgrids/cli 2026.1113.5 → 2026.1113.6
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/README.md +2 -0
- package/dist/cli.js +36 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -347,6 +347,8 @@ fluidgrids workers tokens list | rotate <id> | delete <id>
|
|
|
347
347
|
fluidgrids workers tokens allow-connections <id> crm # workspace admins; each release is audited
|
|
348
348
|
fluidgrids workers list --queue gpu --stale
|
|
349
349
|
FLUIDGRIDS_WORKER_TOKEN=fgr_... fluidgrids worker run --queue gpu --activities activities/index.ts
|
|
350
|
+
fluidgrids workers tokens create staging --queue gpu@staging # bound: its workers only take staging tasks
|
|
351
|
+
fluidgrids worker run --queue gpu --environment staging # or --queue gpu@staging
|
|
350
352
|
fluidgrids dev # ephemeral queue + token + worker until Ctrl-C
|
|
351
353
|
fluidgrids runs start approvals --task-queue dev-1a2b3c4d
|
|
352
354
|
|
package/dist/cli.js
CHANGED
|
@@ -3723,6 +3723,8 @@ import { CliUserError as CliUserError20 } from "@burdenoff/cli-sdk/core";
|
|
|
3723
3723
|
function durableSummary(issues) {
|
|
3724
3724
|
if (issues.some((issue) => issue.code === "durable.phaseC"))
|
|
3725
3725
|
return "The project uses durable-function features that arrive in Phase C";
|
|
3726
|
+
if (issues.some((issue) => issue.code === LOCAL_ACTIVITY_FUNCTION))
|
|
3727
|
+
return "The project gives ctx.localActivity() a function; declare the activity with declareActivity(), implement it on a self-hosted worker and pass the declaration";
|
|
3726
3728
|
if (issues.length > 0 && issues.every((issue) => issue.code === USER_ACTIVITY_ON_MANAGED))
|
|
3727
3729
|
return "The project runs a user activity on the managed queue, which has no worker for user activities; declare each activity on a self-hosted task queue";
|
|
3728
3730
|
return "The project uses durable-function features this release refuses";
|
|
@@ -3975,7 +3977,7 @@ async function runPush(env, keys, options) {
|
|
|
3975
3977
|
}, details);
|
|
3976
3978
|
return result;
|
|
3977
3979
|
}
|
|
3978
|
-
var USER_ACTIVITY_ON_MANAGED = "taskQueue.userActivityOnManaged";
|
|
3980
|
+
var USER_ACTIVITY_ON_MANAGED = "taskQueue.userActivityOnManaged", LOCAL_ACTIVITY_FUNCTION = "durable.localActivityFunction";
|
|
3979
3981
|
var init_push = __esm(() => {
|
|
3980
3982
|
init_code_upload();
|
|
3981
3983
|
init_connections();
|
|
@@ -7878,6 +7880,33 @@ function checkQueueName(name) {
|
|
|
7878
7880
|
}
|
|
7879
7881
|
return value;
|
|
7880
7882
|
}
|
|
7883
|
+
function checkWorkerQueue(raw) {
|
|
7884
|
+
const value = raw.trim();
|
|
7885
|
+
const at = value.indexOf("@");
|
|
7886
|
+
if (at < 0)
|
|
7887
|
+
return checkQueueName(value);
|
|
7888
|
+
const name = checkQueueName(value.slice(0, at));
|
|
7889
|
+
const environment = value.slice(at + 1).toLowerCase();
|
|
7890
|
+
if (!ENVIRONMENTS2.some((allowed) => allowed.toLowerCase() === environment)) {
|
|
7891
|
+
throw new CliUserError38(`Invalid queue '${raw}': the environment after @ must be dev, staging or prod.`);
|
|
7892
|
+
}
|
|
7893
|
+
return `${name}@${environment}`;
|
|
7894
|
+
}
|
|
7895
|
+
function bindWorkerQueues(queues, raw) {
|
|
7896
|
+
const environment = parseEnvironment(raw)?.toLowerCase();
|
|
7897
|
+
if (environment === undefined)
|
|
7898
|
+
return [...new Set(queues)];
|
|
7899
|
+
const out = queues.map((queue) => {
|
|
7900
|
+
const at = queue.indexOf("@");
|
|
7901
|
+
if (at < 0)
|
|
7902
|
+
return `${queue}@${environment}`;
|
|
7903
|
+
if (queue.slice(at + 1) !== environment) {
|
|
7904
|
+
throw new CliUserError38(`Queue '${queue}' is bound to ${queue.slice(at + 1)}, but --environment is ${environment}.`);
|
|
7905
|
+
}
|
|
7906
|
+
return queue;
|
|
7907
|
+
});
|
|
7908
|
+
return [...new Set(out)];
|
|
7909
|
+
}
|
|
7881
7910
|
function queueLabel(queue) {
|
|
7882
7911
|
return queue.environment ? `${queue.name}@${queue.environment}` : queue.name;
|
|
7883
7912
|
}
|
|
@@ -8167,7 +8196,7 @@ async function workflowBundle(project, options, build) {
|
|
|
8167
8196
|
return path;
|
|
8168
8197
|
}
|
|
8169
8198
|
async function runWorkerRun(env, options) {
|
|
8170
|
-
const queues = parseList(options.queue).map(
|
|
8199
|
+
const queues = bindWorkerQueues(parseList(options.queue).map(checkWorkerQueue), options.environment);
|
|
8171
8200
|
if (queues.length === 0)
|
|
8172
8201
|
throw new CliUserError39("Name the task queue(s) to serve with --queue.");
|
|
8173
8202
|
const project = loadProject(options.project, env.cwd());
|
|
@@ -8834,7 +8863,7 @@ async function runWorkersList(env, options) {
|
|
|
8834
8863
|
throw new CliUserError42("Give --stale or --not-stale, not both.");
|
|
8835
8864
|
}
|
|
8836
8865
|
const filter = {
|
|
8837
|
-
...options.queue ? { taskQueue: options.queue } : {},
|
|
8866
|
+
...options.queue ? { taskQueue: checkWorkerQueue(options.queue) } : {},
|
|
8838
8867
|
...options.buildId ? { buildId: options.buildId } : {},
|
|
8839
8868
|
...options.stale ? { stale: true } : {},
|
|
8840
8869
|
...options.notStale ? { stale: false } : {},
|
|
@@ -8890,7 +8919,7 @@ async function runTokensCreate(env, name, options) {
|
|
|
8890
8919
|
const tokenName = name.trim();
|
|
8891
8920
|
if (tokenName === "")
|
|
8892
8921
|
throw new CliUserError42("A worker token needs a name.");
|
|
8893
|
-
const taskQueues = parseList(options.queue).map(
|
|
8922
|
+
const taskQueues = parseList(options.queue).map(checkWorkerQueue);
|
|
8894
8923
|
if (taskQueues.length === 0) {
|
|
8895
8924
|
throw new CliUserError42("A worker token needs at least one --queue.", {
|
|
8896
8925
|
hint: "Create the queue first with `fluidgrids queues create <name>`."
|
|
@@ -10853,7 +10882,7 @@ function registerQueues(program, make) {
|
|
|
10853
10882
|
}
|
|
10854
10883
|
function registerWorkers(program, make) {
|
|
10855
10884
|
const workers = program.command("workers").description("Self-hosted workers of the workspace and their worker tokens");
|
|
10856
|
-
workers.command("list").description("Connected (and recently ended) self-hosted workers (workflowWorkers)").option("--queue <name>", "Only workers serving this task queue").option("--build-id <id>", "Only workers serving this build").option("--stale", "Only stale workers (silent for 2 minutes)").option("--not-stale", "Only workers that are not stale").option("--include-ended", "Also workers that disconnected in the last 7 days").option(...OUTPUT_OPTION2).action(async (options, command) => {
|
|
10885
|
+
workers.command("list").description("Connected (and recently ended) self-hosted workers (workflowWorkers)").option("--queue <name>", "Only workers serving this task queue (name, or name@dev|staging|prod for one environment)").option("--build-id <id>", "Only workers serving this build").option("--stale", "Only stale workers (silent for 2 minutes)").option("--not-stale", "Only workers that are not stale").option("--include-ended", "Also workers that disconnected in the last 7 days").option(...OUTPUT_OPTION2).action(async (options, command) => {
|
|
10857
10886
|
await Promise.resolve().then(() => init_workers());
|
|
10858
10887
|
await runWorkersList(await make(), withGlobalFormat(options, command));
|
|
10859
10888
|
});
|
|
@@ -10862,7 +10891,7 @@ function registerWorkers(program, make) {
|
|
|
10862
10891
|
await Promise.resolve().then(() => init_workers());
|
|
10863
10892
|
await runTokensList(await make(), withGlobalFormat(options, command));
|
|
10864
10893
|
});
|
|
10865
|
-
tokens.command("create <name>").description("Issue a worker token for task queues; it is shown once").option("--queue <names>", "Self-hosted task queue (comma separated, repeatable)", collect2).option("--allow-connection <names>", "Connections user activities may resolve through it (workspace admins; repeatable)", collect2).option(...OUTPUT_OPTION2).action(async (name, options, command) => {
|
|
10894
|
+
tokens.command("create <name>").description("Issue a worker token for task queues; it is shown once").option("--queue <names>", "Self-hosted task queue, or name@dev|staging|prod to bind the token to one environment (comma separated, repeatable)", collect2).option("--allow-connection <names>", "Connections user activities may resolve through it (workspace admins; repeatable)", collect2).option(...OUTPUT_OPTION2).action(async (name, options, command) => {
|
|
10866
10895
|
await Promise.resolve().then(() => init_workers());
|
|
10867
10896
|
await runTokensCreate(await make(), name, withGlobalFormat(options, command));
|
|
10868
10897
|
});
|
|
@@ -10884,7 +10913,7 @@ function addWorkerOptions(command) {
|
|
|
10884
10913
|
}
|
|
10885
10914
|
function registerWorkerRun(program, make) {
|
|
10886
10915
|
const worker = program.command("worker").description("Run a self-hosted worker for the project");
|
|
10887
|
-
addWorkerOptions(worker.command("run").description("Serve the project's workflow bundle and activities on task queues (token from FLUIDGRIDS_WORKER_TOKEN)").option("--queue <names>", "Task queue to serve (comma separated, repeatable)", collect2).option("--build", "Build the bundle now instead of using the one `push` wrote").option("--token-env <VAR>", "Read the worker token from this variable")).action(async (options, command) => {
|
|
10916
|
+
addWorkerOptions(worker.command("run").description("Serve the project's workflow bundle and activities on task queues (token from FLUIDGRIDS_WORKER_TOKEN)").option("--queue <names>", "Task queue to serve, or name@dev|staging|prod for one environment (comma separated, repeatable)", collect2).option("--environment <env>", "Serve only this environment (dev, staging or prod) of every queue named without one").option("--build", "Build the bundle now instead of using the one `push` wrote").option("--token-env <VAR>", "Read the worker token from this variable")).action(async (options, command) => {
|
|
10888
10917
|
await Promise.resolve().then(() => init_worker_run());
|
|
10889
10918
|
await runWorkerRun(await make(), withGlobalFormat(options, command));
|
|
10890
10919
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidgrids/cli",
|
|
3
|
-
"version": "2026.1113.
|
|
3
|
+
"version": "2026.1113.6",
|
|
4
4
|
"description": "CLI tool for FluidGrids — workflow automation management (thin shell over @burdenoff/cli-sdk)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@burdenoff/cli-sdk": "2026.1109.1",
|
|
58
|
-
"@fluidgrids/workflows": "2026.1113.
|
|
58
|
+
"@fluidgrids/workflows": "2026.1113.5",
|
|
59
59
|
"@napi-rs/keyring": "2.1.1",
|
|
60
60
|
"commander": "^14.0.3",
|
|
61
61
|
"esbuild": "0.28.2",
|