@sequenceholdings/studio-cli 0.9.3 → 0.9.4

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 CHANGED
@@ -1022,6 +1022,12 @@ seq-studio orm execute lending ListLoans -e <env> --var officer=<uuid> --var lim
1022
1022
  seq-studio orm execute lending ListLoans -e <env> --variables-file variables.json
1023
1023
  ```
1024
1024
 
1025
+ Both execute forms accept `--variables-file -` (or `/dev/stdin`) for piped JSON.
1026
+ Input is read as UTF-8 until EOF and must be a JSON object. Reading or parsing
1027
+ failures do not submit the operation; this does not add mutation retries or
1028
+ write the variables to a temporary file. The checkout form requires an installed
1029
+ ORM package with stdin support; upgrade that package alongside the CLI.
1030
+
1025
1031
  The by-name form looks the operation up in the namespace's deployed version and
1026
1032
  runs it as you, so it needs no checkout and runs what is deployed even when a
1027
1033
  local clone is behind. `--var <name>=<value>` (repeatable) sets one variable
package/dist/argv.js CHANGED
@@ -22,7 +22,7 @@ export function parseArgs(rest) {
22
22
  continue;
23
23
  }
24
24
  const next = rest[i + 1];
25
- if (next && !next.startsWith('-')) {
25
+ if (next && (next === '-' || !next.startsWith('-'))) {
26
26
  setFlag(body, next);
27
27
  i += 1;
28
28
  }
@@ -42,7 +42,7 @@ export function parseArgs(rest) {
42
42
  continue;
43
43
  }
44
44
  const next = rest[i + 1];
45
- if (next && !next.startsWith('-')) {
45
+ if (next && (next === '-' || !next.startsWith('-'))) {
46
46
  setFlag(longName, next);
47
47
  i += 1;
48
48
  }
@@ -10,7 +10,7 @@ export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir
10
10
  export declare const REPOS_USAGE = "usage:\n seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment\n seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces\n seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)\n seq-studio repos identity <ns>/<name> -e <env> [--write --dir .] show/install the server-issued identity receipt\n --adopt --write --yes admin-only legacy binding; commit the receipt via PR\n seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write. Returns once\n the repo resolves by name, so clone can follow\n at once. The init commands take --repo\n <ns>/<name> to create, clone, and scaffold\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n real Git clone using seq-studio login;\n configures login for subsequent git pull/push\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|resolve|unresolve|review|reviews|checks> [args]\n review requests (see pulls --help)\n seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults\n seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone uses your login token (never written into the remote URL or Git config).\n A repository-local credential helper reads your current login for git pull/push.\n After expiry, run seq-studio login --env <env> again.\n --transport auto (default) and git both create a real Git checkout.\n Personal access tokens are retired; ATLAS_GIT_PAT is ignored.\n --transport json downloads files without .git; requires\n <ns>/<name>. repos pull also provides this files-only workflow.\n --ref accepts a branch, tag, or commit SHA (SHA \u2192 full clone, then checkout).\n Branch and tag clones are shallow (--depth 1). Pass --full for history.\n --output selects the clone directory (--out remains an alias).\n\n Authenticate JSON API calls with: seq-studio login\n Authenticate git clone/push with: seq-studio login --env <env>\n";
11
11
  export declare const PROCESS_RUNS_USAGE = "usage:\n seq-studio process runs start <process-id> -e <env> [--version <v>] [--run-id <id>]\n [--metadata-file <file.json>] [--title <text>] [--entity <type>:<id>] [--json]\n seq-studio process runs retry <run-id> -e <env> [--run-id <new-id>] [--json]\n seq-studio process runs list -e <env> [--process <id>] [--status <status>]\n [--entity-type <type>] [--entity-id <id>] [--archived] [--limit 1..500] [--json]\n seq-studio process runs show <run-id> -e <env> [--wait [--timeout <seconds>]]\n [--steps [--node <node-id>] [--full]] [--json]\n seq-studio process runs cancel <run-id> -e <env> [--json]\n\n Runs start and are read as you: start and retry need invoker on the process,\n show and list return only runs you can view, and cancel needs invoker on the\n process.\n start prints the new run's id. Omit --run-id for a fresh id on every start.\n --run-id names exactly one run: repeating it for the same process returns that\n run, whatever its status, instead of starting another. To run a failed run\n again, retry it rather than inventing a new id.\n --version pins a published process version; omitted, the active version runs.\n --metadata-file is a JSON object stored on the run.\n retry (CLI 0.9.0+) starts a new run of a failed, cancelled or timed_out run's\n process version with the same metadata, entity and title, linked to the\n original in its lineage, and prints the new id. Other statuses are refused.\n Like start, a retry waits queued while the process is at its concurrent-run\n limit.\n --run-id on retry names the new run, so repeating the retry returns it.\n list returns the newest runs first, up to --limit (default 50, max 500); the run\n API has no cursor, so narrow with filters to reach older runs.\n --status: pending, running, completed, failed, cancelled, timed_out.\n show --wait polls until the run finishes (default timeout 600s); the run keeps\n going if the wait times out. show prints the run's error when it failed.\n show --steps (CLI 0.9.1+) prints each step's status, edge, error, input and\n output, with the same viewer permission as show. Inputs, outputs and errors\n over 2000 characters are cut to a preview; --full prints them whole.\n --node narrows to one node. With --json, --steps returns { run, steps } with\n the same bounds; each step's truncated map names its cut fields and their full\n length. A failure in a node's input mapper happens before its step\n starts, so it shows only as the run's error.\n";
12
12
  export declare const ORM_DISCOVER_HELP = "usage:\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n seq-studio orm describe <namespace> [<table> | --operations] -e <env> [--json]\n seq-studio orm operation show <namespace> <name> -e <env> [--json]\n\n Find the ORM data you can read, then query it with orm read or orm sql.\n namespaces lists only namespaces you can read, ordered by name: format (v2 or\n v1), table and persisted-operation counts. It pages with --limit (default 50)\n and --offset; the total and the next page go to stderr.\n describe <namespace> lists its tables and views and the persisted operations\n it serves, with what each requires and the variables it declares (name: type,\n ! when required). --operations prints only the operations, ready for\n orm execute <namespace> <operation>. describe <namespace> <table> lists the\n table's columns (types, nullability, keys), enum values, links, actions, and\n the persisted operations that write it. Column names are the ones orm read and\n orm sql accept.\n A namespace you cannot read reports not found, the same as a missing one.\n --json prints the full description (describe omits the generated GraphQL SDL).\n operation show prints one active persisted operation's registered GraphQL\n document; --json includes its hash, declared variables, and requirements.\n Missing and unreadable operations both report not found.\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.\n";
13
- export declare const ORM_EXECUTE_HELP = "usage:\n seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n\n Run one persisted operation as you. The server applies the operation's\n required capability or role and the namespace's row policies.\n By name: execute <namespace> <operation> looks the operation up in the\n namespace's deployed version and runs it. No checkout is needed, so it runs\n what is deployed even when a local clone is behind. List what you can run:\n seq-studio orm describe <namespace> --operations\n From a checkout: execute <operation> [dir] delegates to the installed ORM\n package using the directory's operations.manifest.json (default dir: .).\n Updated ORM packages validate the name and kind, then call the active named\n operation. Older packages may still select the manifest hash. Confirm the\n installed package and platform support name selection before upgrading.\n The form is chosen by the second argument: an existing directory means a\n checkout; otherwise it is <namespace> <operation>.\n --variables-file takes a JSON object. --var <name>=<value> (repeatable, by\n name only) sets one variable and wins over the file: numbers and booleans\n parse by the declared type, lists, filter inputs and jsonb take JSON, and other\n types take the text as is. Use the file for null.\n Output is the JSON response: {\"data\": ...}.\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.\n";
13
+ export declare const ORM_EXECUTE_HELP = "usage:\n seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n\n Run one persisted operation as you. The server applies the operation's\n required capability or role and the namespace's row policies.\n By name: execute <namespace> <operation> looks the operation up in the\n namespace's deployed version and runs it. No checkout is needed, so it runs\n what is deployed even when a local clone is behind. List what you can run:\n seq-studio orm describe <namespace> --operations\n From a checkout: execute <operation> [dir] delegates to the installed ORM\n package using the directory's operations.manifest.json (default dir: .).\n Updated ORM packages validate the name and kind, then call the active named\n operation. Older packages may still select the manifest hash. Confirm the\n installed package and platform support name selection before upgrading.\n The form is chosen by the second argument: an existing directory means a\n checkout; otherwise it is <namespace> <operation>.\n --variables-file takes a JSON object; - or /dev/stdin reads UTF-8 stdin until EOF\n (the checkout form requires an ORM package with stdin support).\n --var <name>=<value> (repeatable, by\n name only) sets one variable and wins over the file: numbers and booleans\n parse by the declared type, lists, filter inputs and jsonb take JSON, and other\n types take the text as is. Use the file for null.\n Output is the JSON response: {\"data\": ...}.\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.\n";
14
14
  export declare function staticHelp({ namespace, sub }: {
15
15
  namespace: string;
16
16
  sub?: string;
@@ -287,7 +287,9 @@ export const ORM_EXECUTE_HELP = `usage:
287
287
  installed package and platform support name selection before upgrading.
288
288
  The form is chosen by the second argument: an existing directory means a
289
289
  checkout; otherwise it is <namespace> <operation>.
290
- --variables-file takes a JSON object. --var <name>=<value> (repeatable, by
290
+ --variables-file takes a JSON object; - or /dev/stdin reads UTF-8 stdin until EOF
291
+ (the checkout form requires an ORM package with stdin support).
292
+ --var <name>=<value> (repeatable, by
291
293
  name only) sets one variable and wins over the file: numbers and booleans
292
294
  parse by the declared type, lists, filter inputs and jsonb take JSON, and other
293
295
  types take the text as is. Use the file for null.
@@ -44,6 +44,7 @@ const ORM_USAGE = `usage:
44
44
  run the deployed version's persisted operation by name as the caller (no checkout)
45
45
  seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
46
46
  execute from the checkout manifest through the installed ORM package
47
+ both execute forms accept --variables-file - (or /dev/stdin) for JSON stdin until EOF
47
48
  seq-studio orm read <namespace> <table> -e <env> [--where c=op.v]... [--select c,...] [--order c.desc] [--limit N] [--offset N] [--json|--jsonl]
48
49
  read rows of a deployed v2 namespace as the caller (row-level security applies)
49
50
  seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param name[:type]=v]... | [--params <json-object>] [--json|--jsonl]
@@ -11,6 +11,7 @@
11
11
  */
12
12
  import { readFile, stat } from 'node:fs/promises';
13
13
  import { resolve } from 'node:path';
14
+ import { text } from 'node:stream/consumers';
14
15
  import { getJsonOr404, postJsonResponse } from '../atlas-client.js';
15
16
  import { printCliError } from '../cli-errors.js';
16
17
  import { validateCommandInput } from '../command-input.js';
@@ -104,7 +105,11 @@ async function readVariablesFile(args) {
104
105
  return {};
105
106
  let parsed;
106
107
  try {
107
- parsed = JSON.parse(await readFile(resolve(file), 'utf8'));
108
+ // Reopening a nonblocking stdin pipe with readFile can fail with EAGAIN.
109
+ const contents = file === '-' || file === '/dev/stdin'
110
+ ? await text(process.stdin)
111
+ : await readFile(resolve(file), 'utf8');
112
+ parsed = JSON.parse(contents);
108
113
  }
109
114
  catch (error) {
110
115
  throw new Error(`Could not read JSON variables from ${file}: ${error instanceof Error ? error.message : String(error)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenceholdings/studio-cli",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "Unified Sequence Studio CLI — `seq-studio init` / `add` / `deploy` (app monorepos), `seq-studio agents`, `seq-studio process` (Lattice), `seq-studio artifact`, `seq-studio functions` / `secrets`, `seq-studio repos`, and `seq-studio auth whoami`. Includes Auth0 browser login shared with seqapi.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -45,15 +45,15 @@
45
45
  "yaml": "^2.8.4",
46
46
  "zod": "^4.1.13",
47
47
  "@sequenceholdings/agent-spec": "0.1.5",
48
- "@sequenceholdings/artifact-studio": "0.11.3",
48
+ "@sequenceholdings/artifact-studio": "0.11.4",
49
49
  "@sequenceholdings/lattice": "0.1.8",
50
- "@sequenceholdings/managed-functions": "0.5.3",
50
+ "@sequenceholdings/managed-functions": "0.5.4",
51
51
  "@sequenceholdings/storage": "0.1.4",
52
52
  "@sequenceholdings/platform": "0.1.1"
53
53
  },
54
54
  "peerDependencies": {
55
- "@sequenceholdings/orm": "2.8.2",
56
- "@sequenceholdings/pipeline-spec": "0.3.2"
55
+ "@sequenceholdings/orm": "2.8.3",
56
+ "@sequenceholdings/pipeline-spec": "0.3.3"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "@sequenceholdings/orm": {
@@ -69,8 +69,8 @@
69
69
  "@types/semver": "^7.8.0",
70
70
  "typescript": "^5.6.0",
71
71
  "vitest": "^4.1.11",
72
- "@sequenceholdings/pipeline-spec": "0.3.2",
73
- "@sequenceholdings/orm": "2.8.2"
72
+ "@sequenceholdings/pipeline-spec": "0.3.3",
73
+ "@sequenceholdings/orm": "2.8.3"
74
74
  },
75
75
  "engines": {
76
76
  "node": ">=20"