@sequenceholdings/studio-cli 0.9.1 → 0.9.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/README.md CHANGED
@@ -360,6 +360,11 @@ code. Put shared runtime business logic in a managed function and reference
360
360
  that primitive from the workflow. For reuse between app repositories, publish
361
361
  versioned packages and depend on registry versions.
362
362
 
363
+ Scaffolds write no `.npmrc` (CLI **0.9.2**+ also drops the `functions init`
364
+ one), so `pnpm install` resolves from the registry your user configuration
365
+ selects, `@sequenceholdings` packages included. Commit `pnpm-lock.yaml`:
366
+ repository CI installs from the registry the lockfile was resolved against.
367
+
363
368
  Workspace deployments outside `local` require the root lockfile. Staging keeps
364
369
  its registry resolutions and overrides; the existing Managed Functions registry
365
370
  policy still applies. A lockfile from an unsupported registry is reported and
@@ -907,7 +912,7 @@ compiled to canonical SQL before registration.
907
912
  | `seq-studio orm diff [dir] [--check]` | Author the next committed migration, or verify the migration/snapshot chain offline for CI. |
908
913
  | `seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]` | Author a migration if needed, register/apply the namespace, activate its operation set, publish its declared capabilities, and refresh generated outputs. Waits until the new version is live (prints `live:`; default up to 20m); `--no-wait` returns once queued. |
909
914
  | `seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...` | Execute the deployed version's persisted operation by name, as the signed-in caller. Needs no checkout. |
910
- | `seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>` | Execute one named persisted operation as hashed in this checkout's `operations.manifest.json`, with variables from a JSON object file, as the signed-in caller. |
915
+ | `seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>` | Execute an operation from the checkout's manifest through the installed ORM package, with variables from a JSON object file, as the signed-in caller. |
911
916
  | `seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]` | List the namespaces you can read. |
912
917
  | `seq-studio orm describe <namespace> [<table> \| --operations] -e <env> [--json]` | Show a namespace's tables, views, and persisted operations (with their variables), only its operations, or one table's columns, actions, and the operations that write it. |
913
918
  | `seq-studio orm operation show <namespace> <name> -e <env> [--json]` | Show the active persisted operation's registered GraphQL document; JSON also includes its hash and declared variables. Requires namespace read access. |
@@ -1025,11 +1030,12 @@ inputs, and `jsonb` take JSON, and other types take the text as is. Use the file
1025
1030
  for `null`. An unknown name lists the deployed operations, and an input error
1026
1031
  lists the operation's variables.
1027
1032
 
1028
- The checkout form, `orm execute <operation> [dir]`, sends the hash from that
1029
- directory's `operations.manifest.json`. When the deployed version hashes the
1030
- operation differently, it prints the local hash, the deployed hash, the deployed
1031
- version, and the by-name command to run instead. The second argument picks the
1032
- form: an existing directory means a checkout.
1033
+ The updated checkout form, `orm execute <operation> [dir]`, validates the name
1034
+ and kind from that directory's `operations.manifest.json`, then selects the
1035
+ active registered operation by name. Namespace-wide rehashes no longer strand
1036
+ the checkout. The second argument still picks the form: an existing directory
1037
+ means a checkout. Deploy matching Atlas runtime/broker support before publishing
1038
+ and using the updated CLI/SDKs.
1033
1039
  - A namespace you cannot read reports not found, the same as one that does not
1034
1040
  exist. `--json` prints the full description, including read and write
1035
1041
  policies, but not the generated GraphQL SDL.
@@ -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|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] runs the operation as hashed in the\n namespace directory's operations.manifest.json (default dir: .). If the\n deployed version hashes it differently, execute prints both hashes and the\n by-name command instead of a bare 404.\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. --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;
@@ -280,10 +280,11 @@ export const ORM_EXECUTE_HELP = `usage:
280
280
  namespace's deployed version and runs it. No checkout is needed, so it runs
281
281
  what is deployed even when a local clone is behind. List what you can run:
282
282
  seq-studio orm describe <namespace> --operations
283
- From a checkout: execute <operation> [dir] runs the operation as hashed in the
284
- namespace directory's operations.manifest.json (default dir: .). If the
285
- deployed version hashes it differently, execute prints both hashes and the
286
- by-name command instead of a bare 404.
283
+ From a checkout: execute <operation> [dir] delegates to the installed ORM
284
+ package using the directory's operations.manifest.json (default dir: .).
285
+ Updated ORM packages validate the name and kind, then call the active named
286
+ operation. Older packages may still select the manifest hash. Confirm the
287
+ installed package and platform support name selection before upgrading.
287
288
  The form is chosen by the second argument: an existing directory means a
288
289
  checkout; otherwise it is <namespace> <operation>.
289
290
  --variables-file takes a JSON object. --var <name>=<value> (repeatable, by
@@ -378,28 +378,6 @@ dist/
378
378
  .env.*
379
379
  *.log
380
380
  `;
381
- // Local-only: makes `pnpm install` resolve against Chainguard so the lockfile
382
- // matches what the deploy worker installs from (the fast, version-pinned
383
- // path). Auth comes from your ~/.npmrc (scripts/chainguard-bootstrap). This
384
- // file is NEVER bundled — collectBundleFiles excludes it and the server
385
- // rejects it; the deploy worker pins the registry itself. Authors without
386
- // Chainguard credentials can delete it and install from public npm — see the
387
- // comment written into the scaffolded file.
388
- const TEMPLATE_NPMRC = `# Pins installs to Chainguard, Sequence's internal package registry, so your
389
- # lockfile matches what the deploy worker installs (fast, version-pinned
390
- # deploys). Requires Chainguard credentials in ~/.npmrc (Sequence engineers:
391
- # scripts/chainguard-bootstrap).
392
- #
393
- # No Chainguard credentials? \`pnpm install\` will fail with a 401 — DELETE THIS
394
- # FILE and install from public npm instead. That is safe: the deploy worker
395
- # always re-resolves dependencies against Chainguard server-side, and this
396
- # file is never included in the deployed bundle either way.
397
- registry=https://libraries.cgr.dev/javascript/
398
- # Sequence's own packages publish to public npm, as on the deploy worker.
399
- @sequenceholdings:registry=https://registry.npmjs.org/
400
- //libraries.cgr.dev/javascript/:always-auth=true
401
- //libraries.cgr.dev/javascript-upstream/:always-auth=true
402
- `;
403
381
  export async function functionsInitCommand(args) {
404
382
  const target = args.positional[0];
405
383
  if (!target) {
@@ -431,7 +409,6 @@ export async function functionsInitCommand(args) {
431
409
  await writeFile(join(dir, 'tsconfig.json'), TEMPLATE_TSCONFIG);
432
410
  await writeFile(join(dir, 'package.json'), TEMPLATE_PACKAGE_JSON(id));
433
411
  await writeFile(join(dir, '.gitignore'), TEMPLATE_GITIGNORE);
434
- await writeFile(join(dir, '.npmrc'), TEMPLATE_NPMRC);
435
412
  await writeScaffoldGuidance({ directory: dir });
436
413
  console.log(`${LOG} scaffolded managed function "${id}" (TypeScript) in ${dir}`);
437
414
  console.log(`${LOG} AGENTS.md points to your environment's live docs; CLAUDE.md imports it`);
@@ -43,7 +43,7 @@ const ORM_USAGE = `usage:
43
43
  seq-studio orm execute <namespace> <operation> -e <env> [--variables-file <file>] [--var <name>=<value>]...
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
- run a persisted operation as hashed in this checkout's operations.manifest.json
46
+ execute from the checkout manifest through the installed ORM package
47
47
  seq-studio orm read <namespace> <table> -e <env> [--where c=op.v]... [--select c,...] [--order c.desc] [--limit N] [--offset N] [--json|--jsonl]
48
48
  read rows of a deployed v2 namespace as the caller (row-level security applies)
49
49
  seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param name[:type]=v]... | [--params <json-object>] [--json|--jsonl]
@@ -171,7 +171,7 @@ function failureMessage({ namespace, operation, status, envelope }) {
171
171
  }
172
172
  }
173
173
  if (status === 404 && failure.details.cause === 'unknown_operation') {
174
- lines.push('The deployed operation changed between lookup and execution (the namespace was just redeployed). Retry.');
174
+ lines.push('The operation is unavailable after lookup. Retry; if it persists, update Atlas to support guarded operation names.');
175
175
  }
176
176
  else {
177
177
  const next = failureNextStep({ failure, namespace });
@@ -196,7 +196,7 @@ export async function ormExecuteDeployedCommand(args) {
196
196
  const response = await postJsonResponse({
197
197
  ...options,
198
198
  path: `/api/data/v2/${namespace}`,
199
- body: { op: operation.op_hash, variables },
199
+ body: { op: `${operation.kind}:${operationName}`, expectedKind: operation.kind, variables },
200
200
  });
201
201
  const envelope = parseEnvelope(response.body);
202
202
  const ok = response.status >= 200 && response.status < 300 && envelope !== null;
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Both run the namespace's built-in read-only SQL operation through the
6
6
  * published ORM client (`createOperationExecutorWithTransport(...).sql()`),
7
- * which owns the `{ op, variables }` wire format. Requests go through the CLI's
7
+ * which owns the `{ op, variables, expectedKind? }` wire format. Requests go through the CLI's
8
8
  * Atlas client so environment resolution, sandbox tokens, and edge headers
9
9
  * behave like every other command. The server compiles the SQL in its closed
10
10
  * read-only grammar and enforces grants, row-level security, and its row,
package/dist/orm/read.js CHANGED
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Both run the namespace's built-in read-only SQL operation through the
6
6
  * published ORM client (`createOperationExecutorWithTransport(...).sql()`),
7
- * which owns the `{ op, variables }` wire format. Requests go through the CLI's
7
+ * which owns the `{ op, variables, expectedKind? }` wire format. Requests go through the CLI's
8
8
  * Atlas client so environment resolution, sandbox tokens, and edge headers
9
9
  * behave like every other command. The server compiles the SQL in its closed
10
10
  * read-only grammar and enforces grants, row-level security, and its row,
@@ -191,9 +191,9 @@ export function buildReadSql({ plan, columnTypes }) {
191
191
  }
192
192
  /** The ORM client's operation transport, served by the CLI's Atlas client. */
193
193
  function atlasTransport({ baseUrl, token }) {
194
- return async ({ namespace, op, variables }) => {
194
+ return async ({ namespace, op, variables, expectedKind }) => {
195
195
  // The data endpoint `orm execute` uses; it shares the deployment gate of the /api/orm discovery routes.
196
- const response = await postJsonResponse({ baseUrl, token, path: `/api/data/v2/${namespace}`, body: { op, variables } });
196
+ const response = await postJsonResponse({ baseUrl, token, path: `/api/data/v2/${namespace}`, body: { op, variables, expectedKind } });
197
197
  let body = null;
198
198
  try {
199
199
  body = JSON.parse(response.body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenceholdings/studio-cli",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
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,11 +45,11 @@
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.1",
48
+ "@sequenceholdings/artifact-studio": "0.11.2",
49
49
  "@sequenceholdings/lattice": "0.1.8",
50
- "@sequenceholdings/managed-functions": "0.5.1",
51
- "@sequenceholdings/storage": "0.1.3",
52
- "@sequenceholdings/platform": "0.1.0"
50
+ "@sequenceholdings/managed-functions": "0.5.2",
51
+ "@sequenceholdings/storage": "0.1.4",
52
+ "@sequenceholdings/platform": "0.1.1"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@sequenceholdings/orm": "2.8.1",