@sequenceholdings/studio-cli 0.9.10 → 0.9.12
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 +78 -9
- package/dist/atlas-client.js +6 -57
- package/dist/auth.d.ts +0 -1
- package/dist/auth.js +9 -1
- package/dist/bin.js +7 -2
- package/dist/cli-attribution.d.ts +3 -0
- package/dist/cli-attribution.js +24 -0
- package/dist/command-contract.d.ts +8 -2
- package/dist/command-contract.js +3 -2
- package/dist/command-help.d.ts +2 -1
- package/dist/command-help.js +19 -3
- package/dist/command-telemetry.d.ts +11 -0
- package/dist/command-telemetry.js +97 -0
- package/dist/edge-auth-headers.d.ts +1 -0
- package/dist/edge-auth-headers.js +40 -0
- package/dist/functions/commands.js +1 -1
- package/dist/functions/manifest.js +2 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.js +49 -2
- package/dist/orm/apply-source.d.ts +53 -0
- package/dist/orm/apply-source.js +86 -0
- package/dist/orm/delegate.js +18 -2
- package/dist/orm/help.d.ts +1 -1
- package/dist/orm/help.js +2 -0
- package/dist/orm/history.d.ts +23 -0
- package/dist/orm/history.js +58 -0
- package/dist/orm/read.d.ts +1 -1
- package/dist/orm/read.js +4 -2
- package/dist/pipeline/commands.js +2 -1
- package/dist/pipeline/templates.js +5 -2
- package/dist/principals/commands.d.ts +1 -1
- package/dist/principals/commands.js +50 -2
- package/dist/process/commands.js +5 -2
- package/dist/repos/git-credential.d.ts +8 -1
- package/dist/repos/git-credential.js +50 -4
- package/dist/templates/guidance/AGENTS.md +5 -0
- package/package.json +8 -8
- package/templates/guidance/AGENTS.md +5 -0
package/README.md
CHANGED
|
@@ -41,6 +41,13 @@ verifies and copies the selected release into a new or empty directory.
|
|
|
41
41
|
`--json` for automation. It reports this CLI's command groups and does not imply
|
|
42
42
|
that the underlying platform HTTP routes are public contracts.
|
|
43
43
|
|
|
44
|
+
Authenticated commands send a best-effort completion event to the Atlas
|
|
45
|
+
environment they use, recording command name, outcome, duration, and CLI version
|
|
46
|
+
without arguments or error messages. Command telemetry is on by default. Use
|
|
47
|
+
`seq-studio telemetry disable|enable|status` to control it, or set
|
|
48
|
+
`SEQ_STUDIO_TELEMETRY=off` for one process. This setting affects command events;
|
|
49
|
+
Atlas still records authenticated API activity for version adoption.
|
|
50
|
+
|
|
44
51
|
### Piped output
|
|
45
52
|
|
|
46
53
|
Commands with `--json` (or `--jsonl`) write only their structured result to
|
|
@@ -911,6 +918,7 @@ compiled to canonical SQL before registration.
|
|
|
911
918
|
| `seq-studio orm plan [dir] -e <env>` | Compare the compiled namespace with registry state without applying database changes. |
|
|
912
919
|
| `seq-studio orm diff [dir] [--check]` | Author the next committed migration, or verify the migration/snapshot chain offline for CI. |
|
|
913
920
|
| `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. |
|
|
921
|
+
| `seq-studio orm history <namespace> -e <env> [--limit N] [--json]` | List every change to the namespace's live schema and operations, newest first, with the actor and the Git Service source. `apply` from a clone of the target environment's Git Service (or `--repo`) sends its commit and package path; Atlas checks it and records `verified`, `ci` or `reported`. Recording never refuses an apply. |
|
|
914
922
|
| `seq-studio orm deployment-policy <namespace> -e <env> [--json]` | Inspect whether a namespace permits manual deployment or requires its enrolled repository's verified CI deployment. |
|
|
915
923
|
| `seq-studio orm deployment-policy <namespace> -e <env> --mode ci --repo <ns>/<name> --branch <branch> --target <target-key>` | Explicitly enroll an existing namespace. Requires namespace Admin, repository Admin, and an automatic branch policy already bound to this exact namespace. |
|
|
916
924
|
| `seq-studio orm deployment-policy <namespace> -e <env> --mode manual` | Restore direct, permission-checked deployment; requires namespace Admin. |
|
|
@@ -1096,6 +1104,8 @@ seq-studio orm sql lending -e <env> \
|
|
|
1096
1104
|
parameter type; the listed `--param` types remain unchanged.
|
|
1097
1105
|
- `sql` must reference every table as `<namespace>.<table>` (`FROM lending.loans`, not
|
|
1098
1106
|
`FROM loans`); unqualified names and queries without a table (`SELECT 1`) are rejected.
|
|
1107
|
+
Double-quote mixed-case column names, for example `SELECT "loanNumber" FROM lending.loans`;
|
|
1108
|
+
unquoted SQL identifiers are folded to lowercase.
|
|
1099
1109
|
The grammar is read-only `SELECT` with joins, CTEs, `UNION`, aggregates, and comparison
|
|
1100
1110
|
operators; it has no `LIKE` or `IN`. When the server rejects a statement it says only
|
|
1101
1111
|
"SQL query is invalid or unsupported", so the CLI adds a hint with these rules.
|
|
@@ -1395,11 +1405,13 @@ version's final status determines whether the command succeeds or fails. If
|
|
|
1395
1405
|
lifecycle status is unavailable, the command continues to report version status.
|
|
1396
1406
|
Use `functions logs` for sanitized readiness connection diagnostics.
|
|
1397
1407
|
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1408
|
+
`runtime` in `managed-function.yml` selects the hosted Node.js version:
|
|
1409
|
+
`nodejs24` (the default when `runtime` is omitted) or `nodejs20`. Other runtimes
|
|
1410
|
+
are rejected. Node.js 20 is end of life upstream, so keep it only for a function
|
|
1411
|
+
not yet verified on Node.js 24. Each deployed version keeps the runtime it was
|
|
1412
|
+
deployed with, so promote and rollback never change it; a new deploy uses the
|
|
1413
|
+
manifest's value. Keep `package.json`'s `engines.node` compatible with the
|
|
1414
|
+
selected runtime, for example `"24.x"` for Node.js 24. Local development uses the installed Node version.
|
|
1403
1415
|
|
|
1404
1416
|
A normal function repo keeps `managed-function.yml` at its root and omits
|
|
1405
1417
|
`--path`. A repo may also contain related, independently deployed functions:
|
|
@@ -1473,6 +1485,18 @@ the supporting Atlas build and packages before adding the declaration to a
|
|
|
1473
1485
|
consumer; declaring it does not create groups, grant access, or bypass action
|
|
1474
1486
|
permissions. See the SDK README for client usage and security boundaries.
|
|
1475
1487
|
|
|
1488
|
+
### Selecting a deployed function without its source
|
|
1489
|
+
|
|
1490
|
+
To delete a deployed function when its source directory is unavailable, select
|
|
1491
|
+
it by slug instead of reading a local manifest:
|
|
1492
|
+
|
|
1493
|
+
```bash
|
|
1494
|
+
seq-studio functions delete -e staging --fn my-function --yes
|
|
1495
|
+
```
|
|
1496
|
+
|
|
1497
|
+
`--fn <slug>` also selects a function for `promote` and `rollback`; without it,
|
|
1498
|
+
these commands use the manifest in the current directory (or `--dir`).
|
|
1499
|
+
|
|
1476
1500
|
### Deploying to local Atlas
|
|
1477
1501
|
|
|
1478
1502
|
Start local Atlas, then use the same deployment workflow:
|
|
@@ -2525,6 +2549,13 @@ root, stage identities, deployment admission or rollback provenance.
|
|
|
2525
2549
|
|
|
2526
2550
|
Creating a release unit requires both **Can create** on Pipelines and Git Service **Writer** on the named repository. Once the release unit exists, further changes require its Pipeline `editor` tier.
|
|
2527
2551
|
|
|
2552
|
+
Changing or explicitly resuming a paused native job schedule is a non-overridable
|
|
2553
|
+
schedule-drift blocker. Converting the job to manual-only (no compiled `schedule`,
|
|
2554
|
+
`continuous`, or `trigger`) is an ordinary update: the plan still shows the cron
|
|
2555
|
+
and timezone being removed. The job and its native ID remain; removing its
|
|
2556
|
+
schedule does not cancel an already-running execution. After deployment, verify
|
|
2557
|
+
the native job has no schedule before treating scheduled ingestion as retired.
|
|
2558
|
+
|
|
2528
2559
|
For an existing pipeline release unit in the target, use
|
|
2529
2560
|
`--source-env <first-party-env>` with `pipeline plan` or repository-based
|
|
2530
2561
|
`pipeline deploy` to read canonical source from another environment. `-e` still
|
|
@@ -2791,9 +2822,10 @@ unsupported dependencies are reported explicitly. This report is advisory;
|
|
|
2791
2822
|
ordinary deployment behavior remains unchanged.
|
|
2792
2823
|
|
|
2793
2824
|
Commit a versioned `migrations/<id>.yml` manifest, then add `--migration <id>` to
|
|
2794
|
-
`pipeline plan` to prepare its execution plan. The manifest declares
|
|
2795
|
-
column additions
|
|
2796
|
-
|
|
2825
|
+
`pipeline plan` to prepare its execution plan. The manifest declares
|
|
2826
|
+
participating pipeline repositories, column additions, type changes, nullable
|
|
2827
|
+
relaxations, stages that rebuild their complete writer scopes, and acceptance
|
|
2828
|
+
checks. Every participant ref resolves to an immutable commit.
|
|
2797
2829
|
The assessment validates all proposed shared writers together.
|
|
2798
2830
|
|
|
2799
2831
|
For example, after changing both writers' Spark code and output declarations to
|
|
@@ -2881,7 +2913,8 @@ schedules. After publication, it retains reservations and backups for forward
|
|
|
2881
2913
|
recovery; it does not promise automatic rollback. Resume first reconciles the
|
|
2882
2914
|
recorded native operations so a lost response does not duplicate completed work.
|
|
2883
2915
|
|
|
2884
|
-
V1 supports managed batch Spark writers, declared column additions/type changes
|
|
2916
|
+
V1 supports managed batch Spark writers, declared column additions/type changes
|
|
2917
|
+
and explicit `relax_column_nullability` transitions for non-key columns,
|
|
2885
2918
|
Snapshot copies, supported SQL views and ORM v2 exports. Primary-key changes,
|
|
2886
2919
|
stateful DLT/CDF migrations, unknown dependencies and unmodeled resources block
|
|
2887
2920
|
planning. Spark packages must use the migration runtime bindings and remain
|
|
@@ -2899,6 +2932,9 @@ checks does not prove that the authored Spark code uses the supplied
|
|
|
2899
2932
|
`input_*` and `output_*` table parameters: producers that construct table names
|
|
2900
2933
|
themselves must be adapted and tested before migration. Declare every history
|
|
2901
2934
|
dependency explicitly; migration planning does not infer reads from Python code.
|
|
2935
|
+
Nullable relaxations retain the same physical type, require a full writer rebuild,
|
|
2936
|
+
and cannot remove physical Delta or Lakebase `NOT NULL` constraints. Those
|
|
2937
|
+
constraints need a separately supported transition before this migration can run.
|
|
2902
2938
|
Column declarations must preserve physical precision, for example
|
|
2903
2939
|
`decimal(18,2)` rather than the generic `numeric` alias. ORM-bound serving
|
|
2904
2940
|
projections can retain that declaration while the ORM consumes it as numeric.
|
|
@@ -3257,6 +3293,9 @@ seq-studio principals search <query> -e <env> [--types user,group,service-accoun
|
|
|
3257
3293
|
seq-studio principals users search <query> -e <env>
|
|
3258
3294
|
seq-studio principals groups list -e <env> [--search <query>] [--limit <n>] [--page <n>]
|
|
3259
3295
|
seq-studio principals groups show <group-id> -e <env> [--limit <n>] [--offset <n>]
|
|
3296
|
+
seq-studio principals groups create "Brokerage Team" -e <env> [--description <text>] [--request-id <uuid>]
|
|
3297
|
+
seq-studio principals groups members add <group-id> -e <env> --principal-id '<user-sub>' [--principal-id '<user-sub>' ...]
|
|
3298
|
+
seq-studio principals groups members remove <group-id> -e <env> --principal-id '<user-sub>'
|
|
3260
3299
|
```
|
|
3261
3300
|
|
|
3262
3301
|
Results are JSON, and each principal carries
|
|
@@ -3269,6 +3308,17 @@ members (50 per page) and reports a group you can't see as not found. An agent s
|
|
|
3269
3308
|
token sees exactly its caller's view. Requires CLI 0.8.0+ and an Atlas release with
|
|
3270
3309
|
the caller mode of `/api/authz/principals/search`.
|
|
3271
3310
|
|
|
3311
|
+
`groups create` creates a local group and makes the caller its admin. It prints a
|
|
3312
|
+
request UUID to stderr before sending; if the result is uncertain, repeat the
|
|
3313
|
+
same command with `--request-id` to get the same group, not a duplicate.
|
|
3314
|
+
`members add` accepts up to 50 distinct authenticated user subjects from
|
|
3315
|
+
`principals users search`. It leaves existing roles unchanged and rejects
|
|
3316
|
+
disabled or out-of-tenant users. `members remove` accepts one subject and
|
|
3317
|
+
revokes that membership; the last group admin cannot be removed. Both commands
|
|
3318
|
+
require permission to administer a CLI-created group in your tenant. A member
|
|
3319
|
+
may also remove themself. JSON receipts
|
|
3320
|
+
show created versus existing groups and newly added versus existing members.
|
|
3321
|
+
|
|
3272
3322
|
**Capabilities are code, roles are data.** A resource's source declares the
|
|
3273
3323
|
capabilities its code checks; the roles that bundle them are created and edited
|
|
3274
3324
|
in Atlas:
|
|
@@ -3445,3 +3495,22 @@ OpCo environments, staging and production can share a Databricks workspace while
|
|
|
3445
3495
|
remaining separate catalog/binding identities. Sync refuses foreign-workspace and
|
|
3446
3496
|
foreign-environment destination bindings. It does not switch profiles or make local
|
|
3447
3497
|
Atlas mirror another tenant automatically.
|
|
3498
|
+
|
|
3499
|
+
### API usage and version attribution
|
|
3500
|
+
|
|
3501
|
+
Native authenticated Atlas requests send `x-sequence-client: seq-studio` and
|
|
3502
|
+
`x-sequence-client-version` with this installed CLI package's version. Atlas can
|
|
3503
|
+
record a daily active-version observation for the verified principal. This
|
|
3504
|
+
contains the deployment, UTC day, principal ID/kind, and version; it does not
|
|
3505
|
+
include email, command arguments, request bodies, or URLs. Machine credentials
|
|
3506
|
+
and delegated agent sessions are separate from human users. These are API
|
|
3507
|
+
activity observations, **not command counts**.
|
|
3508
|
+
|
|
3509
|
+
Coverage includes the native Atlas client, its operator SDK adapter, and
|
|
3510
|
+
pipeline assets/contracts fetches to authenticated configured Atlas origins.
|
|
3511
|
+
Delegated Artifact Studio and ORM CLI transports, Git subprocess traffic,
|
|
3512
|
+
third-party storage transfers, login/discovery, and offline commands are not
|
|
3513
|
+
instrumented by this change. The Artifact Studio deployment `cliVersion` field
|
|
3514
|
+
continues to identify that SDK, not seq-studio. Versions released before this
|
|
3515
|
+
instrumentation cannot be identified retroactively. A claimed client/version
|
|
3516
|
+
is descriptive telemetry, never proof of which software made a request.
|
package/dist/atlas-client.js
CHANGED
|
@@ -7,13 +7,13 @@ import { createPlatformTransport, createOperatorPlatformClient, } from "@sequenc
|
|
|
7
7
|
* the caller — this file knows nothing about token files or config TOMLs.
|
|
8
8
|
*/
|
|
9
9
|
import { validationDetail } from "./validation-detail.js";
|
|
10
|
-
import {
|
|
10
|
+
import { edgeAuthHeaders } from "./edge-auth-headers.js";
|
|
11
11
|
import { sandboxBearerFor } from "./sandbox-auth.js";
|
|
12
12
|
import { errorCode, isTransient503 } from "./transient-503.js";
|
|
13
|
+
import { fetchWithCliAttribution } from "./cli-attribution.js";
|
|
13
14
|
const MAX_503_RETRIES = 5;
|
|
14
15
|
const DEFAULT_RETRY_AFTER_SECONDS = 2;
|
|
15
16
|
const LOG_PREFIX = "[seq-studio]";
|
|
16
|
-
const CF_ACCESS_DOMAIN = "seqholdings.com";
|
|
17
17
|
export class AtlasApiError extends Error {
|
|
18
18
|
status;
|
|
19
19
|
path;
|
|
@@ -52,16 +52,14 @@ async function fetchWith503Retry(send) {
|
|
|
52
52
|
async function authenticatedFetch({ baseUrl, init = {}, path, token, retry503 = true, timeoutMs, }) {
|
|
53
53
|
authenticatedRequestUrl({ baseUrl, path });
|
|
54
54
|
const transport = createPlatformTransport({
|
|
55
|
+
fetchImpl: fetchWithCliAttribution,
|
|
55
56
|
baseUrl,
|
|
56
57
|
timeoutMs,
|
|
57
58
|
auth: {
|
|
58
59
|
kind: "operator",
|
|
59
60
|
bearer: async () => (await sandboxBearerFor(baseUrl)) ?? token,
|
|
60
61
|
},
|
|
61
|
-
edgeHeaders: () => (
|
|
62
|
-
...previewAccessHeaders(baseUrl),
|
|
63
|
-
...cfAccessHeaders(baseUrl),
|
|
64
|
-
}),
|
|
62
|
+
edgeHeaders: () => edgeAuthHeaders(baseUrl),
|
|
65
63
|
});
|
|
66
64
|
const send = async () => {
|
|
67
65
|
const method = (init.method ?? "GET").toUpperCase();
|
|
@@ -134,53 +132,6 @@ function parseRetryAfter(value) {
|
|
|
134
132
|
return null;
|
|
135
133
|
return Number(value);
|
|
136
134
|
}
|
|
137
|
-
function previewAccessHeaders(baseUrl) {
|
|
138
|
-
const secret = process.env.PREVIEW_ACCESS_HEADER?.trim();
|
|
139
|
-
if (!secret)
|
|
140
|
-
return {};
|
|
141
|
-
try {
|
|
142
|
-
const parsed = new URL(baseUrl);
|
|
143
|
-
if (parsed.protocol !== "https:")
|
|
144
|
-
return {};
|
|
145
|
-
if (!parsed.hostname.toLowerCase().endsWith(`.${PREVIEW_DOMAIN}`))
|
|
146
|
-
return {};
|
|
147
|
-
return { "x-preview-access": secret };
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
return {};
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Cloudflare Access fronts *.seqholdings.com and only bypasses the company
|
|
155
|
-
* network, so a CI runner is turned away at the edge with an HTML "Access
|
|
156
|
-
* Restricted" page before Atlas ever sees the bearer token. A service token
|
|
157
|
-
* gets through the edge; the bearer still authenticates at the app.
|
|
158
|
-
*
|
|
159
|
-
* Scoped to seqholdings.com so the token is never sent to localhost, a tenant
|
|
160
|
-
* domain, or any other host the CLI can be pointed at.
|
|
161
|
-
*/
|
|
162
|
-
function cfAccessHeaders(baseUrl) {
|
|
163
|
-
const clientId = process.env.CF_ACCESS_CLIENT_ID?.trim();
|
|
164
|
-
const clientSecret = process.env.CF_ACCESS_CLIENT_SECRET?.trim();
|
|
165
|
-
if (!clientId || !clientSecret)
|
|
166
|
-
return {};
|
|
167
|
-
try {
|
|
168
|
-
const parsed = new URL(baseUrl);
|
|
169
|
-
if (parsed.protocol !== "https:")
|
|
170
|
-
return {};
|
|
171
|
-
const hostname = parsed.hostname.toLowerCase();
|
|
172
|
-
if (hostname !== CF_ACCESS_DOMAIN &&
|
|
173
|
-
!hostname.endsWith(`.${CF_ACCESS_DOMAIN}`))
|
|
174
|
-
return {};
|
|
175
|
-
return {
|
|
176
|
-
"CF-Access-Client-Id": clientId,
|
|
177
|
-
"CF-Access-Client-Secret": clientSecret,
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
catch {
|
|
181
|
-
return {};
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
135
|
/**
|
|
185
136
|
* Structured `violations[]` from the Lattice contract routes (authoring
|
|
186
137
|
* policy, static graph limits, …). The server already bounds the array; the
|
|
@@ -389,11 +340,9 @@ export async function deleteNoContent({ baseUrl, token, path, }) {
|
|
|
389
340
|
export function operatorPlatformClient({ baseUrl, token, }) {
|
|
390
341
|
authenticatedRequestUrl({ baseUrl, path: "/api/auth/cli-config" });
|
|
391
342
|
return createOperatorPlatformClient({
|
|
343
|
+
fetchImpl: fetchWithCliAttribution,
|
|
392
344
|
baseUrl,
|
|
393
345
|
bearer: async () => (await sandboxBearerFor(baseUrl)) ?? token,
|
|
394
|
-
edgeHeaders: () => (
|
|
395
|
-
...previewAccessHeaders(baseUrl),
|
|
396
|
-
...cfAccessHeaders(baseUrl),
|
|
397
|
-
}),
|
|
346
|
+
edgeHeaders: () => edgeAuthHeaders(baseUrl),
|
|
398
347
|
});
|
|
399
348
|
}
|
package/dist/auth.d.ts
CHANGED
|
@@ -127,7 +127,6 @@ export interface ResolvedAccessToken {
|
|
|
127
127
|
token: string;
|
|
128
128
|
}
|
|
129
129
|
export declare function getAccessTokenWithMode(options?: {
|
|
130
|
-
/** Disable browser PKCE fallback for probe-only and other non-interactive callers. */
|
|
131
130
|
allowInteractiveLogin?: boolean;
|
|
132
131
|
env?: string;
|
|
133
132
|
targetUrl?: string;
|
package/dist/auth.js
CHANGED
|
@@ -485,7 +485,7 @@ async function sandboxAccessToken(targetUrl) {
|
|
|
485
485
|
}
|
|
486
486
|
return { authMode: 'sandbox', token: await readSandboxToken(sandbox) };
|
|
487
487
|
}
|
|
488
|
-
|
|
488
|
+
async function resolveAccessTokenWithMode(options) {
|
|
489
489
|
// Sandbox token mode replaces every other source, before any realm lookup.
|
|
490
490
|
const sandbox = await sandboxAccessToken(options?.targetUrl);
|
|
491
491
|
if (sandbox)
|
|
@@ -532,6 +532,14 @@ export async function getAccessTokenWithMode(options) {
|
|
|
532
532
|
}),
|
|
533
533
|
};
|
|
534
534
|
}
|
|
535
|
+
export async function getAccessTokenWithMode(options) {
|
|
536
|
+
const resolved = await resolveAccessTokenWithMode(options);
|
|
537
|
+
if (options?.targetUrl) {
|
|
538
|
+
const { recordAuthenticatedCliTarget } = await import('./command-telemetry.js');
|
|
539
|
+
recordAuthenticatedCliTarget(options.targetUrl, resolved.token);
|
|
540
|
+
}
|
|
541
|
+
return resolved;
|
|
542
|
+
}
|
|
535
543
|
export async function getAccessToken(options) {
|
|
536
544
|
return (await getAccessTokenWithMode(options)).token;
|
|
537
545
|
}
|
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { run } from './main.js';
|
|
2
|
+
import { commandTelemetryName, run } from './main.js';
|
|
3
3
|
import { parseArgs } from './argv.js';
|
|
4
|
+
import { beginCommandTelemetry, finishCommandTelemetry } from './command-telemetry.js';
|
|
4
5
|
// A consumer may close stdout while a remote operation continues. Stop local
|
|
5
6
|
// output quietly; never cancel or retry the remote operation.
|
|
6
7
|
process.stdout.on('error', (error) => {
|
|
@@ -10,20 +11,24 @@ process.stdout.on('error', (error) => {
|
|
|
10
11
|
throw error;
|
|
11
12
|
});
|
|
12
13
|
const argv = process.argv.slice(2);
|
|
13
|
-
const isHelpOrDiscovery = argv.includes('--help') || argv.includes('-h') || argv[0] === 'help' || argv[0] === 'capabilities';
|
|
14
|
+
const isHelpOrDiscovery = argv.includes('--help') || argv.includes('-h') || argv[0] === 'help' || argv[0] === 'capabilities' || argv[0] === 'telemetry';
|
|
14
15
|
const doctorOffline = argv[0] === 'doctor' && (() => {
|
|
15
16
|
const value = parseArgs(argv.slice(1)).flags.offline;
|
|
16
17
|
return value === true || value === 'true';
|
|
17
18
|
})();
|
|
18
19
|
const isOfflineCommand = argv[0] === 'validate' || doctorOffline;
|
|
20
|
+
const startedAt = beginCommandTelemetry();
|
|
21
|
+
let commandError;
|
|
19
22
|
run(argv)
|
|
20
23
|
.catch((error) => {
|
|
24
|
+
commandError = error;
|
|
21
25
|
console.error(error instanceof Error ? error.message : error);
|
|
22
26
|
return 1;
|
|
23
27
|
})
|
|
24
28
|
// The update notice runs after the command so it never delays real output,
|
|
25
29
|
// and it is best-effort (never throws, never changes the exit code).
|
|
26
30
|
.then(async (code) => {
|
|
31
|
+
await finishCommandTelemetry({ command: commandTelemetryName(argv), startedAt, exitCode: code, error: commandError }).catch(() => undefined);
|
|
27
32
|
const isGitCredential = argv[0] === 'auth' && argv[1] === 'git-credential';
|
|
28
33
|
if (!isHelpOrDiscovery && !isOfflineCommand && !isGitCredential) {
|
|
29
34
|
const { maybeNotifyUpdate } = await import('./update-check.js');
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { currentVersion } from './update-check.js';
|
|
2
|
+
// Read this installed package, never the delegated Artifact Studio SDK version.
|
|
3
|
+
const version = currentVersion();
|
|
4
|
+
export function cliAttributionHeaders() {
|
|
5
|
+
return { 'x-sequence-client': 'seq-studio', 'x-sequence-client-version': version };
|
|
6
|
+
}
|
|
7
|
+
/** Inject only at the CLI-owned transport, after its origin/auth/redirect checks. */
|
|
8
|
+
export const fetchWithCliAttribution = (input, init) => {
|
|
9
|
+
const source = init?.headers ?? (input instanceof Request ? input.headers : undefined);
|
|
10
|
+
const identity = cliAttributionHeaders();
|
|
11
|
+
if (source && !(source instanceof Headers) && !Array.isArray(source)) {
|
|
12
|
+
// Keep the plain-object shape used by existing CLI transports and callers.
|
|
13
|
+
const headers = { ...source };
|
|
14
|
+
for (const name of Object.keys(headers)) {
|
|
15
|
+
if (name.toLowerCase() in identity)
|
|
16
|
+
delete headers[name];
|
|
17
|
+
}
|
|
18
|
+
return globalThis.fetch(input, { ...init, headers: { ...headers, ...identity } });
|
|
19
|
+
}
|
|
20
|
+
const headers = new Headers(source);
|
|
21
|
+
for (const [name, value] of Object.entries(identity))
|
|
22
|
+
headers.set(name, value);
|
|
23
|
+
return globalThis.fetch(input, { ...init, headers });
|
|
24
|
+
};
|
|
@@ -88,7 +88,7 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
88
88
|
readonly description: "Author and operate ORM namespaces";
|
|
89
89
|
readonly lifecycle: "preview";
|
|
90
90
|
readonly access: "mixed";
|
|
91
|
-
readonly subcommands: readonly ["init", "generate", "validate", "plan", "apply", "deployment-policy", "execute", "namespaces", "describe", "read", "sql", "diff", "migrate-from-yaml", "import"];
|
|
91
|
+
readonly subcommands: readonly ["init", "generate", "validate", "plan", "apply", "history", "deployment-policy", "execute", "namespaces", "describe", "read", "sql", "diff", "migrate-from-yaml", "import"];
|
|
92
92
|
}, {
|
|
93
93
|
readonly name: "envs";
|
|
94
94
|
readonly description: "Manage CLI environments";
|
|
@@ -113,6 +113,12 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
113
113
|
readonly lifecycle: "stable";
|
|
114
114
|
readonly access: "mixed";
|
|
115
115
|
readonly subcommands: readonly [];
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "telemetry";
|
|
118
|
+
readonly description: "Control authenticated command telemetry";
|
|
119
|
+
readonly lifecycle: "preview";
|
|
120
|
+
readonly access: "offline";
|
|
121
|
+
readonly subcommands: readonly ["enable", "disable", "status"];
|
|
116
122
|
}, {
|
|
117
123
|
readonly name: "version";
|
|
118
124
|
readonly description: "Print the installed CLI version";
|
|
@@ -139,7 +145,7 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
139
145
|
readonly subcommands: readonly ["definitions", "list", "grant", "revoke", "resolve"];
|
|
140
146
|
}, {
|
|
141
147
|
readonly name: "principals";
|
|
142
|
-
readonly description: "Find
|
|
148
|
+
readonly description: "Find principals and manage local groups";
|
|
143
149
|
readonly lifecycle: "preview";
|
|
144
150
|
readonly access: "authenticated";
|
|
145
151
|
readonly subcommands: readonly ["search", "users", "groups"];
|
package/dist/command-contract.js
CHANGED
|
@@ -14,16 +14,17 @@ export const COMMAND_CONTRACT = [
|
|
|
14
14
|
{ name: 'pipeline', description: 'Discover and operate Data Pipelines', lifecycle: 'preview', access: 'staff', subcommands: ['list', 'assets', 'search', 'describe', 'schema', 'sample', 'query', 'init', 'validate', 'plan', 'deploy', 'status', 'migrate', 'adopt', 'unbind', 'retire', 'run-now', 'promote', 'rollback'] },
|
|
15
15
|
{ name: 'feedback', description: 'Submit agent feedback', lifecycle: 'preview', access: 'authenticated', subcommands: ['submit'] },
|
|
16
16
|
{ name: 'auth', description: 'Manage Git authentication', lifecycle: 'stable', access: 'authenticated', subcommands: ['whoami', 'git-credential', 'pat'] },
|
|
17
|
-
{ name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'deployment-policy', 'execute', 'namespaces', 'describe', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import'] },
|
|
17
|
+
{ name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'history', 'deployment-policy', 'execute', 'namespaces', 'describe', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import'] },
|
|
18
18
|
{ name: 'envs', description: 'Manage CLI environments', lifecycle: 'stable', access: 'mixed', subcommands: ['add', 'list'] },
|
|
19
19
|
{ name: 'login', description: 'Authenticate with Sequence', lifecycle: 'stable', access: 'public', subcommands: [] },
|
|
20
20
|
{ name: 'logout', description: 'Remove cached user tokens', lifecycle: 'stable', access: 'public', subcommands: [] },
|
|
21
21
|
{ name: 'doctor', description: 'Diagnose CLI configuration and access', lifecycle: 'stable', access: 'mixed', subcommands: [] },
|
|
22
|
+
{ name: 'telemetry', description: 'Control authenticated command telemetry', lifecycle: 'preview', access: 'offline', subcommands: ['enable', 'disable', 'status'] },
|
|
22
23
|
{ name: 'version', description: 'Print the installed CLI version', lifecycle: 'stable', access: 'offline', subcommands: [] },
|
|
23
24
|
{ name: 'help', description: 'Show command help', lifecycle: 'stable', access: 'offline', subcommands: [] },
|
|
24
25
|
{ name: 'storage', description: 'Manage Workspaces V2 file storage', lifecycle: 'preview', access: 'authenticated', subcommands: ['init', 'validate', 'apply', 'list', 'show', 'mkdir', 'upload', 'import', 'uploads', 'reconcile', 'download', 'access', 'trash', 'restore', 'purge', 'operations', 'abort', 'delete'] },
|
|
25
26
|
{ name: 'access', description: 'Manage resource access on every primitive', lifecycle: 'preview', access: 'authenticated', subcommands: ['definitions', 'list', 'grant', 'revoke', 'resolve'] },
|
|
26
|
-
{ name: 'principals', description: 'Find
|
|
27
|
+
{ name: 'principals', description: 'Find principals and manage local groups', lifecycle: 'preview', access: 'authenticated', subcommands: ['search', 'users', 'groups'] },
|
|
27
28
|
{ name: 'service-accounts', description: 'Manage runtime service accounts', lifecycle: 'preview', access: 'authenticated', subcommands: ['list', 'show', 'create'] },
|
|
28
29
|
{ name: 'capabilities', description: 'Print the supported CLI command surface', lifecycle: 'blocked', access: 'offline', subcommands: [] },
|
|
29
30
|
];
|
package/dist/command-help.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export { PIPELINE_HELP } from './pipeline/help.js';
|
|
2
2
|
/** `--repo` on every init command; shared so the commands describe it identically. */
|
|
3
3
|
export declare const INIT_INTO_REPO_HELP = " Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
|
|
4
|
+
export declare const ORM_HISTORY_HELP = "usage:\n seq-studio orm history <namespace> -e <env> [--limit N] [--json]\n\n Lists every change to the namespace's live schema and operations, newest\n first: when, who, what moved, and the Git Service source. \"verified\" and \"ci\"\n sources were checked by Atlas against the repository; \"reported\" means Atlas\n could not tie the change to a pushed commit on a release branch, with the\n reason when one was claimed. * marks the live activation. History starts with\n the first apply after the environment recorded it.\n";
|
|
4
5
|
export declare const ORM_DEPLOYMENT_POLICY_HELP = "usage:\n seq-studio orm deployment-policy <namespace> -e <env> [--json]\n seq-studio orm deployment-policy <namespace> -e <env> --mode ci --repo <ns>/<name> --branch <branch> --target <target-key>\n seq-studio orm deployment-policy <namespace> -e <env> --mode manual\n\n Existing namespaces default to manual deployment. CI mode rejects direct ORM\n registration, schema apply, and operations-only activation on the server;\n only the enrolled repository's verified merge deployment may activate changes.\n Enabling CI mode requires namespace Admin, repository Admin, and an existing\n automatic branch binding to this namespace. Restoring manual mode requires\n namespace Admin. This changes deployment policy; it does not deploy source.\n";
|
|
5
6
|
export declare const ORM_HELP = "usage:\n seq-studio orm init <dir> [--repo <ns>/<name>]\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait]\n seq-studio orm deployment-policy <namespace> -e <env> [--mode manual|ci] [--repo <ns>/<name> --branch <branch> --target <target-key>] [--json]\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 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 seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]\n seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]\n seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]\n seq-studio orm migrate-from-yaml <dir>\n seq-studio orm import [dir] --spec <file> | --table <table> --from <schema.table> --map <target=source,...>\n\n -e/--env is required for commands that contact Atlas. Use seq-studio envs list\n to discover environments and seq-studio login to authenticate.\n Schema commands require the ORM loaded by seq-studio to satisfy the v2\n namespace's package.json @sequenceholdings/orm range before compiling.\n apply waits until the new version is live and serving (default up to 20m), then\n prints \"live:\"; --no-wait returns once the apply is queued.\n CI-managed namespaces reject direct apply; use the enrolled repository's merge\n workflow. deployment-policy reads or explicitly changes this namespace setting.\n namespaces lists what you can read; describe shows its tables and operations.\n Run seq-studio orm describe --help for the output.\n execute <namespace> <operation> runs the deployed version's persisted operation by\n name, with no checkout. Run seq-studio orm execute --help for both forms.\n read and sql query a v2 namespace as you through its built-in read-only SQL.\n sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).\n Run seq-studio orm read --help for the filter grammar, parameters, and output formats.\n\n Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
|
|
6
7
|
/** Artifact commands in sandbox token mode; shared by the offline and delegate usage. */
|
|
7
8
|
export declare const ARTIFACT_SANDBOX_HELP = " In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan\n and deploy take --repo: push the app to a Git Service repository and deploy\n from it. Atlas builds Next.js applications; static applications are bundled\n from the repository and must declare no package.json dependencies or\n optionalDependencies, because the sandbox cannot reach a package registry.\n dev, login, logout, --git-url, --source-env, --pr and --env-url are\n unavailable there, and -e is ignored.\n";
|
|
8
9
|
export declare const ARTIFACT_HELP = "usage:\n seq-studio artifact init <dir> [--template react-vite|nextjs] [--repo <namespace>/<name>]\n seq-studio artifact whoami -e <env>\n seq-studio artifact link [dir] -e <env> [--project <id>]\n seq-studio artifact env list|use <env>\n seq-studio artifact status [-e <env>]\n seq-studio artifact list -e <env> [--json]\n seq-studio artifact show <slug-or-id> -e <env> [--json]\n seq-studio artifact validate [dir]\n seq-studio artifact build|plan|deploy [dir | --repo <namespace>/<name> | --git-url <url>] [--ref <ref>] -e <env>\n seq-studio artifact dev [dir] -e <env> [--once] [--key <name>] [--link <package-dir>] [--port <port>] [--secret-source local|hosted|none] [--local-secrets <bindings.json>] [--bundler turbopack|webpack]\n seq-studio artifact pull <project-id> -e <env> --out <dir>\n seq-studio artifact promote|rollback <deployment-id> -e <env>\n\n Help is available offline. Authenticate with seq-studio login. Build and deploy\n sources may be local, a platform git-service repo, or a public HTTPS Git URL;\n deployments target a named environment with -e. Local, preview, and official\n deployment workflows have different source and approval rules; see the public\n CLI README.\n\n Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan\n and deploy take --repo: push the app to a Git Service repository and deploy\n from it. Atlas builds Next.js applications; static applications are bundled\n from the repository and must declare no package.json dependencies or\n optionalDependencies, because the sandbox cannot reach a package registry.\n dev, login, logout, --git-url, --source-env, --pr and --env-url are\n unavailable there, and -e is ignored.\n";
|
|
9
|
-
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> [--repo <ns>/<name>] scaffold manifest, TypeScript handler, and docs pointers;\n --repo scaffolds into a git-service repo (see Init into a repo)\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)\n seq-studio functions register -e <env> [--dir d] register a shell + initial secret declarations; no deploy\n seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress\n seq-studio functions list -e <env> [--match-local] functions visible on the environment\n seq-studio functions show -e <env> [--fn slug] detail for one function (input/output schemas, versions, secrets)\n [--schema] function identity plus input/output JSON Schemas, as JSON (any caller who can see it)\n [--json] [--version id|name] reader-gated release provenance\n seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy\n [--fn slug] also show effective runtime limits (requires -e)\n seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context\n seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]\n invoke a function and print its response\n seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)\n seq-studio functions promote <version> -e <env>
|
|
10
|
+
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> [--repo <ns>/<name>] scaffold manifest, TypeScript handler, and docs pointers;\n --repo scaffolds into a git-service repo (see Init into a repo)\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)\n seq-studio functions register -e <env> [--dir d] register a shell + initial secret declarations; no deploy\n seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress\n seq-studio functions list -e <env> [--match-local] functions visible on the environment\n seq-studio functions show -e <env> [--fn slug] detail for one function (input/output schemas, versions, secrets)\n [--schema] function identity plus input/output JSON Schemas, as JSON (any caller who can see it)\n [--json] [--version id|name] reader-gated release provenance\n seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy\n [--fn slug] also show effective runtime limits (requires -e)\n seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context\n seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]\n invoke a function and print its response\n seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)\n seq-studio functions promote <version> -e <env> [--fn <slug>]\n make a version live\n seq-studio functions rollback [<version>] -e <env> [--fn <slug>]\n redeploy a prior version\n seq-studio functions delete -e <env> [--fn <slug>] [--yes]\n archive function + tear down its runtime\n (version history is retained)\n\n Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) \u00B7 --fn <slug> \u00B7 --dir <path>\n --fn selects a deployed function without a local manifest; otherwise the manifest in --dir (default .) supplies its slug\n --path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo\n --from-env-file <path> (default: .env) source file for secret values\n --no-wait \u00B7 --yes\n --no-provision (deploy) update-only: error instead of registering a new\n shell, writing secret values, or attaching secrets (CI sweep)\n\n Local Atlas builds and runs deployed functions on this computer, including teardown.\n \"functions dev\" runs a standalone handler without Atlas registration.\n\n Configure per-function CPU and concurrency in managed-function.yml under limits.\n Run \"functions limits\" for valid settings; redeploy to apply manifest changes.\n Invocation rates are shared across Atlas replicas; 429 includes Retry-After.\n If the shared rate limiter is unavailable, invocation fails closed with 503.\n\n Source for build/deploy: a local --dir (default .), a platform git-service\n repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects\n a function directory within a remote repo; omit it for the existing root-manifest\n layout. --ref selects a branch/tag/commit (default: the repo's default branch).\n Remote sources record the pinned commit as provenance (never dirty) and NEVER\n read a repo-committed .env for secret values \u2014 provision secrets server-side\n or pass a local --from-env-file (resolved against your cwd).\n Local deploys record repository-wide gitDirty, including unignored files\n outside --dir. Check git status at the repository root before deploying.\n\n Workspace dependencies are compiled from packages declared in a containing\n sequence.app.yml, within the source repository. Only the selected function is\n deployed: no sibling primitives or Application registration. Shared Node packages\n can set package.json seqStudio.source to a root source entry for clean builds.\n Package build scripts are not run. Local secret paths remain relative to --dir.\n\n Interactive --repo builds clone over smart-HTTP using your seq-studio login\n and repository read access. No PAT is needed. Headless M2M builds use JSON\n materialize and accept only platform-managed --repo sources. Use --env to\n select the same environment for source and deployment.\n\n Init into a repo: --repo <ns>/<name> on an init command creates that platform\n git-service repo if missing (same name rules as repos create), then clones it\n into <dir> and scaffolds there, or, when <dir> is inside a Git checkout, sets\n it as that checkout's origin (a different existing origin is refused). It\n needs -e <env>, or an agent sandbox. Nothing is committed or pushed; the\n command prints the git add, commit, and push to run.\n In a git-service checkout (with or without --repo), orm init, functions init\n and artifact init also declare the scaffold under resources in\n .seq/repository.yml, so repository CI checks and deploys it. A scaffold inside\n a declared application is not declared; add it to that app with seq-studio add.\n";
|
|
10
11
|
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
12
|
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
13
|
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 omits SDL, adds active set/schema IDs and ops hash; retry on a mismatch.\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";
|
package/dist/command-help.js
CHANGED
|
@@ -13,6 +13,16 @@ export const INIT_INTO_REPO_HELP = ` Init into a repo: --repo <ns>/<name> on an
|
|
|
13
13
|
.seq/repository.yml, so repository CI checks and deploys it. A scaffold inside
|
|
14
14
|
a declared application is not declared; add it to that app with seq-studio add.
|
|
15
15
|
`;
|
|
16
|
+
export const ORM_HISTORY_HELP = `usage:
|
|
17
|
+
seq-studio orm history <namespace> -e <env> [--limit N] [--json]
|
|
18
|
+
|
|
19
|
+
Lists every change to the namespace's live schema and operations, newest
|
|
20
|
+
first: when, who, what moved, and the Git Service source. "verified" and "ci"
|
|
21
|
+
sources were checked by Atlas against the repository; "reported" means Atlas
|
|
22
|
+
could not tie the change to a pushed commit on a release branch, with the
|
|
23
|
+
reason when one was claimed. * marks the live activation. History starts with
|
|
24
|
+
the first apply after the environment recorded it.
|
|
25
|
+
`;
|
|
16
26
|
export const ORM_DEPLOYMENT_POLICY_HELP = `usage:
|
|
17
27
|
seq-studio orm deployment-policy <namespace> -e <env> [--json]
|
|
18
28
|
seq-studio orm deployment-policy <namespace> -e <env> --mode ci --repo <ns>/<name> --branch <branch> --target <target-key>
|
|
@@ -107,12 +117,16 @@ export const FUNCTIONS_USAGE = `usage:
|
|
|
107
117
|
seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]
|
|
108
118
|
invoke a function and print its response
|
|
109
119
|
seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)
|
|
110
|
-
seq-studio functions promote <version> -e <env>
|
|
111
|
-
|
|
112
|
-
seq-studio functions
|
|
120
|
+
seq-studio functions promote <version> -e <env> [--fn <slug>]
|
|
121
|
+
make a version live
|
|
122
|
+
seq-studio functions rollback [<version>] -e <env> [--fn <slug>]
|
|
123
|
+
redeploy a prior version
|
|
124
|
+
seq-studio functions delete -e <env> [--fn <slug>] [--yes]
|
|
125
|
+
archive function + tear down its runtime
|
|
113
126
|
(version history is retained)
|
|
114
127
|
|
|
115
128
|
Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) · --fn <slug> · --dir <path>
|
|
129
|
+
--fn selects a deployed function without a local manifest; otherwise the manifest in --dir (default .) supplies its slug
|
|
116
130
|
--path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo
|
|
117
131
|
--from-env-file <path> (default: .env) source file for secret values
|
|
118
132
|
--no-wait · --yes
|
|
@@ -283,6 +297,8 @@ export const ORM_EXECUTE_HELP = `usage:
|
|
|
283
297
|
`;
|
|
284
298
|
/** read and sql print their own grammar help from the delegate. */
|
|
285
299
|
function ormHelp(sub) {
|
|
300
|
+
if (sub === 'history')
|
|
301
|
+
return ORM_HISTORY_HELP;
|
|
286
302
|
if (sub === 'deployment-policy')
|
|
287
303
|
return ORM_DEPLOYMENT_POLICY_HELP;
|
|
288
304
|
if (sub === 'namespaces' || sub === 'describe')
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Called only after the existing auth path has verified the token and target. */
|
|
2
|
+
export declare function recordAuthenticatedCliTarget(baseUrl: string, token: string): void;
|
|
3
|
+
export declare function beginCommandTelemetry(): number;
|
|
4
|
+
export declare function telemetryEnabled(): Promise<boolean>;
|
|
5
|
+
export declare function setTelemetryEnabled(enabled: boolean): Promise<void>;
|
|
6
|
+
export declare function finishCommandTelemetry(input: {
|
|
7
|
+
command: string | null;
|
|
8
|
+
startedAt: number;
|
|
9
|
+
exitCode: number;
|
|
10
|
+
error?: unknown;
|
|
11
|
+
}): Promise<void>;
|