@sequenceholdings/studio-cli 0.6.3 → 0.7.0
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 +31 -0
- package/dist/app/commands.js +3 -2
- package/dist/artifact/delegate.js +1 -0
- package/dist/auth-cmds/commands.js +3 -0
- package/dist/command-help.d.ts +1 -1
- package/dist/command-help.js +1 -1
- package/dist/env-flags.d.ts +6 -0
- package/dist/env-flags.js +23 -1
- package/dist/envs/commands.js +30 -4
- package/dist/functions/commands.d.ts +2 -1
- package/dist/functions/commands.js +24 -4
- package/dist/functions/manifest.d.ts +2 -0
- package/dist/main.js +6 -3
- package/dist/pipeline/lifecycle.js +2 -1
- package/dist/pipeline/repin-orm.js +8 -1
- package/dist/process/build.d.ts +0 -4
- package/dist/process/build.js +3 -0
- package/dist/process/node-metadata.d.ts +2 -0
- package/dist/process/node-metadata.js +6 -0
- package/dist/sandbox-auth.d.ts +11 -0
- package/dist/sandbox-auth.js +22 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -946,6 +946,8 @@ seq-studio orm sql lending -e <env> \
|
|
|
946
946
|
`uuid`, `date`, `timestamptz`, `numeric`, `bigint`, `integer`, `double`, or `boolean`.
|
|
947
947
|
`--params '{"closed": {"type": "timestamptz", "value": null}}'` passes the wire shape,
|
|
948
948
|
including null values.
|
|
949
|
+
- Declared JSONB properties can be selected as JSON results. JSONB is not a supported
|
|
950
|
+
parameter type; the listed `--param` types remain unchanged.
|
|
949
951
|
- `sql` must reference every table as `<namespace>.<table>` (`FROM lending.loans`, not
|
|
950
952
|
`FROM loans`); unqualified names and queries without a table (`SELECT 1`) are rejected.
|
|
951
953
|
The grammar is read-only `SELECT` with joins, CTEs, `UNION`, aggregates, and comparison
|
|
@@ -1136,6 +1138,7 @@ functions cannot opt in retroactively. The default remains mutable. See the
|
|
|
1136
1138
|
| `seq-studio functions init <dir>` | Scaffold one standalone TypeScript managed function |
|
|
1137
1139
|
| `seq-studio functions dev [--dir <dir>] [--port <port>]` | Run a local HTTP server with Managed Function cache context |
|
|
1138
1140
|
| `seq-studio functions build [--dir <dir>]` | Validate a local manifest, bundle, lockfile, and size |
|
|
1141
|
+
| `seq-studio functions register [--dir <dir>] -e <env>` | Register an undeployed shell and its initial secret names/mappings without uploading or activating code |
|
|
1139
1142
|
| `seq-studio functions deploy --dir <dir> -e <env>` | Preview secrets and deploy a local function |
|
|
1140
1143
|
| `seq-studio functions build --repo managed-functions/<name> [--path <dir>] -e <env>` | Materialize and validate a function from the platform Git Service |
|
|
1141
1144
|
| `seq-studio functions deploy --repo managed-functions/<name> [--path <dir>] -e <env>` | Materialize and deploy a function from the platform Git Service |
|
|
@@ -1145,6 +1148,29 @@ functions cannot opt in retroactively. The default remains mutable. See the
|
|
|
1145
1148
|
`functions deploy` picks the next `vN` after the highest numbered version of
|
|
1146
1149
|
that function. Versions named by repository CI, such as `ci-abc`, do not reset
|
|
1147
1150
|
the sequence. A function with no numbered versions starts at `v1`.
|
|
1151
|
+
|
|
1152
|
+
To select an existing secret version before the first deployment, declare its
|
|
1153
|
+
name in `managed-function.yml`, then register and pin before uploading code:
|
|
1154
|
+
|
|
1155
|
+
```bash
|
|
1156
|
+
seq-studio functions register --dir my-function -e <env>
|
|
1157
|
+
seq-studio secrets pin API_KEY --fn my-function 1 -e <env> --yes --no-redeploy
|
|
1158
|
+
seq-studio functions show --fn my-function -e <env>
|
|
1159
|
+
seq-studio functions deploy --dir my-function -e <env> --yes
|
|
1160
|
+
```
|
|
1161
|
+
|
|
1162
|
+
Registration saves only secret names and set-entry mappings. It does not read
|
|
1163
|
+
values, change shared defaults, upload a version, or install active policy.
|
|
1164
|
+
Pinning still requires Editor access on both the function and same-organization
|
|
1165
|
+
secret. `show` reports prepared names and pinned versions without values. The
|
|
1166
|
+
preparation is idempotent; changing it requires a new function ID. An existing
|
|
1167
|
+
shell can be prepared only before any version is uploaded. Registering an
|
|
1168
|
+
already active function leaves its bindings unchanged. This ordering also works
|
|
1169
|
+
when the first activation permanently freezes an immutable function release.
|
|
1170
|
+
Once any version is uploaded, preactivation attachment, pin, unpin and detach
|
|
1171
|
+
changes are refused so a prepared deployment cannot mount an earlier plan after
|
|
1172
|
+
reporting a later configuration change. Use a new function ID to correct that
|
|
1173
|
+
initial secret configuration.
|
|
1148
1174
|
While waiting for a building version, deploy, promote, and rollback print the
|
|
1149
1175
|
current lifecycle stage when Atlas confirms it belongs to that version. A failed
|
|
1150
1176
|
stage with recovery still running is labeled as recovery in progress; only the
|
|
@@ -2778,3 +2804,8 @@ evidence if no receipt is confirmed; do not blindly resubmit an uncertain write.
|
|
|
2778
2804
|
See `<environment-url>/docs/raw/seq-studio/feedback.md` for the direct API
|
|
2779
2805
|
contract and retry guidance. Agents only see this guidance when their instructions
|
|
2780
2806
|
load the page or the installed feedback skill.
|
|
2807
|
+
|
|
2808
|
+
|
|
2809
|
+
### Planned verified service policy support
|
|
2810
|
+
|
|
2811
|
+
The unpublished Studio CLI 0.7.0 release chain carries ORM 2.7.0. Namespace policies using `servicePrincipal()` require the matching deployed IR v6 runtime. Before registration, `orm apply` checks authenticated target protocol support and refuses an unavailable or older runtime. The chain uses Artifact Studio 0.10.0, Managed Functions 0.4.4 and Pipeline Spec 0.3.0. Pipeline Spec 0.3.0 and Studio CLI 0.7.0 remain awaiting publication; package versions alone do not prove rollout. The existing `workspace:*` consumer dependencies resolve to ORM 2.7.0 when the reviewed chain is packed.
|
package/dist/app/commands.js
CHANGED
|
@@ -181,8 +181,9 @@ export async function runAppInitCommand(args) {
|
|
|
181
181
|
try {
|
|
182
182
|
if (args.flags.template === true)
|
|
183
183
|
throw new Error('--template requires <name>@<version>.');
|
|
184
|
-
const
|
|
185
|
-
|
|
184
|
+
const requested = args.flags.env ?? args.flags.e;
|
|
185
|
+
const env = explicitOrSandboxEnv(typeof requested === 'string' ? requested : undefined);
|
|
186
|
+
if (!env)
|
|
186
187
|
throw new Error('--template requires -e <deployment>.');
|
|
187
188
|
if (kinds.length > 0)
|
|
188
189
|
throw new Error('Use either --template or --with/primitive flags.');
|
|
@@ -32,6 +32,7 @@ const ARTIFACT_USAGE = `usage:
|
|
|
32
32
|
seq-studio artifact pull <project-id> -e <env> --out <dir>
|
|
33
33
|
seq-studio artifact promote <deployment-id> -e <env>
|
|
34
34
|
seq-studio artifact rollback <deployment-id> -e <env>
|
|
35
|
+
seq-studio artifact content-readers show|apply --project <id> -e <env> [--file bindings.json]
|
|
35
36
|
seq-studio artifact list -e <env>
|
|
36
37
|
seq-studio artifact show <slug-or-id> -e <env>
|
|
37
38
|
seq-studio artifact status [-e <env>]
|
|
@@ -2,6 +2,7 @@ import { validateCommandInput, wantsHelp } from '../command-input.js';
|
|
|
2
2
|
import { getJson } from '../atlas-client.js';
|
|
3
3
|
import { printCliError } from '../cli-errors.js';
|
|
4
4
|
import { buildContext, clientOptions } from '../functions/commands.js';
|
|
5
|
+
import { describeSandboxTarget, sandboxTarget } from '../sandbox-auth.js';
|
|
5
6
|
export const AUTH_USAGE = `usage:
|
|
6
7
|
seq-studio auth whoami -e <env> [--json]
|
|
7
8
|
seq-studio auth git-credential --env <env> --url <clone-url> <get|store|erase>
|
|
@@ -25,8 +26,10 @@ export async function runAuthCommand(sub, args) {
|
|
|
25
26
|
validateCommandInput({ args, flags: {}, positional: 0 });
|
|
26
27
|
const ctx = await buildContext(args);
|
|
27
28
|
const { sub: subject, email, name, tenantSlug, roles, permissions } = await getJson({ ...clientOptions(ctx), path: '/api/me' });
|
|
29
|
+
const sandbox = ctx.authMode === 'sandbox' ? sandboxTarget() : null;
|
|
28
30
|
console.log(JSON.stringify({
|
|
29
31
|
environment: ctx.env.name, url: ctx.env.url, authMode: ctx.authMode,
|
|
32
|
+
...(sandbox ? { host: new URL(sandbox.baseUrl).host, note: describeSandboxTarget(sandbox) } : {}),
|
|
30
33
|
identity: { sub: subject, email, name, tenantSlug, roles, permissions },
|
|
31
34
|
}, null, 2));
|
|
32
35
|
return 0;
|
package/dist/command-help.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-stud
|
|
|
4
4
|
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";
|
|
5
5
|
export declare const ARTIFACT_HELP = "usage:\n seq-studio artifact init <dir> [--template react-vite|nextjs]\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>]\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 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";
|
|
6
6
|
export declare const PIPELINE_HELP = "usage:\n seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repository rollups (not assets)\n seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]\n list asset declarations, including assets that may not be deployed\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit N] [--offset N] [--json]\n seq-studio pipeline describe <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]\n seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...\n seq-studio pipeline plan|deploy --repo <namespace>/<slug> --ref <sha|branch>\n [--root <directory>] [--source-env <first-party-env>] -e <env> [--target <id>]\n For an existing target release unit, source-env selects a separately\n authenticated canonical repository from banksouth, staging, or production.\n Source identity must be adopted and belong to the destination tenant.\n Registered OpCo source origins are not supported yet. The target verifies\n and snapshots source before planning; no target repository is created.\n Not compatible with --dir, existing IDs, or coordinated migrations.\n Rollback uses retained snapshots; historical source commits can be re-planned\n explicitly with deploy --ref <sha> --source-env <env>.\n seq-studio pipeline plan --plan-request-id <id> -e <env> [--json]\n poll an existing durable plan without enqueueing or attaching credentials\n Lifecycle --json results use stdout; progress uses stderr. Deploy --run-now\n executes producers in the managed worker; local polling may disconnect.\n\n Discovery requires staff access. Use list for pipeline repositories, assets\n for declared assets, and search/describe for active deployment metadata;\n use schema to verify physical columns. -e chooses the environment and\n --target chooses a logical target when the environment has more than one.\n Help is available offline.\n";
|
|
7
|
-
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers\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
|
|
7
|
+
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers\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 (versions, secrets)\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> make a version live\n seq-studio functions rollback [<version>] -e <env> redeploy a prior version\n seq-studio functions delete -e <env> [--yes] 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 --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\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";
|
|
8
8
|
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\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";
|
|
9
9
|
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 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>]] [--json]\n seq-studio process runs cancel <run-id> -e <env> [--json]\n\n Runs start and are read as you: start needs invoker on the process, show and\n list return only runs you can view, and cancel needs invoker on the process.\n --version pins a published process version; omitted, the active version runs.\n --run-id makes start idempotent: repeating it for the same process returns the\n existing run instead of starting another. --metadata-file is a JSON object\n stored on the run.\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.\n";
|
|
10
10
|
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>] -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. 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 In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.\n";
|
package/dist/command-help.js
CHANGED
|
@@ -86,7 +86,7 @@ export const PIPELINE_HELP = `usage:
|
|
|
86
86
|
export const FUNCTIONS_USAGE = `usage:
|
|
87
87
|
seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers
|
|
88
88
|
seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)
|
|
89
|
-
seq-studio functions register -e <env> [--dir d] register a
|
|
89
|
+
seq-studio functions register -e <env> [--dir d] register a shell + initial secret declarations; no deploy
|
|
90
90
|
seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress
|
|
91
91
|
seq-studio functions list -e <env> [--match-local] functions visible on the environment
|
|
92
92
|
seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)
|
package/dist/env-flags.d.ts
CHANGED
|
@@ -14,3 +14,9 @@ export declare function readEnvFromArgv(rest: readonly string[]): string | undef
|
|
|
14
14
|
* deployment and `-e` is optional (and ignored).
|
|
15
15
|
*/
|
|
16
16
|
export declare function explicitOrSandboxEnv(requested: string | undefined): string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* In sandbox token mode, a notice that the `-e` value in `argv` is ignored and
|
|
19
|
+
* where the command goes instead; null when nothing is ignored. An agent that
|
|
20
|
+
* passed `-e production` otherwise has no sign its request went elsewhere.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ignoredSandboxEnvNotice(argv: readonly string[]): string | null;
|
package/dist/env-flags.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* CLIs only recognize the two-token `--env <value>` form, so every `-e value`
|
|
4
4
|
* / `-e=value` / `--env=value` spelling is rewritten before forwarding.
|
|
5
5
|
*/
|
|
6
|
-
import { SANDBOX_ENV_NAME, isSandboxTokenMode } from './sandbox-auth.js';
|
|
6
|
+
import { SANDBOX_BASE_URL_ENV, SANDBOX_ENV_NAME, isSandboxTokenMode, sandboxTarget } from './sandbox-auth.js';
|
|
7
7
|
/** Shared copy for network commands that must not silently fall back to `local`. */
|
|
8
8
|
export const REQUIRE_EXPLICIT_ENV_MESSAGE = 'You must specify an environment you have access to with `-e <env>`. Run `seq-studio envs list` to see available environments.';
|
|
9
9
|
export function normalizeShortEnvFlag(argv) {
|
|
@@ -56,3 +56,25 @@ export function readEnvFromArgv(rest) {
|
|
|
56
56
|
export function explicitOrSandboxEnv(requested) {
|
|
57
57
|
return isSandboxTokenMode() ? SANDBOX_ENV_NAME : requested;
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* In sandbox token mode, a notice that the `-e` value in `argv` is ignored and
|
|
61
|
+
* where the command goes instead; null when nothing is ignored. An agent that
|
|
62
|
+
* passed `-e production` otherwise has no sign its request went elsewhere.
|
|
63
|
+
*/
|
|
64
|
+
export function ignoredSandboxEnvNotice(argv) {
|
|
65
|
+
let target;
|
|
66
|
+
try {
|
|
67
|
+
target = sandboxTarget();
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// A half-configured sandbox: the command itself fails with that error.
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
if (!target)
|
|
74
|
+
return null;
|
|
75
|
+
const requested = readEnvFromArgv(normalizeShortEnvFlag(argv));
|
|
76
|
+
if (!requested || requested === SANDBOX_ENV_NAME)
|
|
77
|
+
return null;
|
|
78
|
+
return (`[seq-studio] Sandbox token mode ignores -e ${requested}: this command targets ` +
|
|
79
|
+
`${target.baseUrl} (${SANDBOX_BASE_URL_ENV}).`);
|
|
80
|
+
}
|
package/dist/envs/commands.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { addSharedLoginEnvironment, readConfig, configPath, manualEnvConfigHint } from '../config.js';
|
|
2
2
|
import { isSharedLoginDeploymentName } from '../auth.js';
|
|
3
3
|
import { readRegisteredEnvironmentUrls, registerEnvironment, } from '../env-registry.js';
|
|
4
|
+
import { describeSandboxTarget, SANDBOX_ENV_NAME, sandboxTarget, sandboxUsageFooter, } from '../sandbox-auth.js';
|
|
4
5
|
const ENVS_USAGE = `usage:
|
|
5
6
|
seq-studio envs list show the configured environments
|
|
6
7
|
seq-studio envs add <name> <url>
|
|
@@ -21,14 +22,24 @@ const ENVS_USAGE = `usage:
|
|
|
21
22
|
export async function runEnvsCommand(sub, rest) {
|
|
22
23
|
switch (sub) {
|
|
23
24
|
case 'add':
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
case 'list': {
|
|
26
|
+
let sandbox;
|
|
27
|
+
try {
|
|
28
|
+
sandbox = sandboxTarget();
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
console.error(`envs ${sub}: FAIL — ${error instanceof Error ? error.message : String(error)}`);
|
|
32
|
+
return 1;
|
|
33
|
+
}
|
|
34
|
+
if (sandbox)
|
|
35
|
+
return sub === 'add' ? refuseSandboxAdd(sandbox) : listSandbox(sandbox);
|
|
36
|
+
return sub === 'add' ? addCommand(rest) : listCommand();
|
|
37
|
+
}
|
|
27
38
|
case undefined:
|
|
28
39
|
case 'help':
|
|
29
40
|
case '--help':
|
|
30
41
|
case '-h':
|
|
31
|
-
console.log(ENVS_USAGE);
|
|
42
|
+
console.log(`${ENVS_USAGE}${sandboxUsageFooter()}`);
|
|
32
43
|
return sub ? 0 : 1;
|
|
33
44
|
default:
|
|
34
45
|
console.error(`unknown envs command: ${sub}`);
|
|
@@ -36,6 +47,21 @@ export async function runEnvsCommand(sub, rest) {
|
|
|
36
47
|
return 1;
|
|
37
48
|
}
|
|
38
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* A sandbox reads no config or registry and its token is accepted only by its
|
|
52
|
+
* own deployment, so a registered environment could never be used.
|
|
53
|
+
*/
|
|
54
|
+
function refuseSandboxAdd(sandbox) {
|
|
55
|
+
console.error(`envs add: refused in sandbox token mode — no environment you add can be reached from here. ` +
|
|
56
|
+
describeSandboxTarget(sandbox));
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
function listSandbox(sandbox) {
|
|
60
|
+
console.log(`* ${SANDBOX_ENV_NAME} ${sandbox.baseUrl} (active default, SEQ_STUDIO_BASE_URL)`);
|
|
61
|
+
console.log('');
|
|
62
|
+
console.log(describeSandboxTarget(sandbox));
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
39
65
|
async function addCommand(rest) {
|
|
40
66
|
const [name, baseUrl, ...extra] = rest;
|
|
41
67
|
if (!name || !baseUrl || extra.length > 0) {
|
|
@@ -53,11 +53,12 @@ export declare function clientOptions(ctx: CommandContext): {
|
|
|
53
53
|
};
|
|
54
54
|
export declare function readManifestOptional(dir: string): Promise<ManagedFunctionManifest | null>;
|
|
55
55
|
export declare function workDir(args: ParsedArgs): string;
|
|
56
|
-
export declare function resolveOrRegisterFunction({ ctx, slug, title, description, }: {
|
|
56
|
+
export declare function resolveOrRegisterFunction({ ctx, slug, title, description, initialSecretBindings, }: {
|
|
57
57
|
ctx: CommandContext;
|
|
58
58
|
slug: string;
|
|
59
59
|
title: string;
|
|
60
60
|
description?: string | null;
|
|
61
|
+
initialSecretBindings?: ManagedFunctionManifest['secrets'];
|
|
61
62
|
}): Promise<{
|
|
62
63
|
fn: FunctionSummary;
|
|
63
64
|
created: boolean;
|
|
@@ -6,12 +6,13 @@ import { basename, isAbsolute, join, resolve } from 'node:path';
|
|
|
6
6
|
import { promisify } from 'node:util';
|
|
7
7
|
import { createInterface } from 'node:readline';
|
|
8
8
|
import { Writable } from 'node:stream';
|
|
9
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
9
10
|
import { load as parseYaml } from 'js-yaml';
|
|
10
11
|
import { MANAGED_FUNCTION_LIMITS, MF_LIMITS_DEFAULTS } from '@sequenceholdings/managed-functions/config';
|
|
11
12
|
import { getAccessTokenWithMode, tryGetAccessTokenWithMode } from '../auth.js';
|
|
12
13
|
import { sourceAuthMode } from '../sandbox-auth.js';
|
|
13
14
|
import { resolveConfiguredEnv } from '../config.js';
|
|
14
|
-
import { AtlasApiError, deleteJson, getJson, postJson, postJsonResponse, } from '../atlas-client.js';
|
|
15
|
+
import { AtlasApiError, deleteJson, getJson, postJson, postJsonResponse, patchJson, } from '../atlas-client.js';
|
|
15
16
|
import { clarifyApplyFailureReason, printCliError } from '../cli-errors.js';
|
|
16
17
|
import { currentVersion } from '../update-check.js';
|
|
17
18
|
import { localSdkPreflight, preflightBeforeUpload, reportPreflight } from './deploy-preflight.js';
|
|
@@ -141,14 +142,18 @@ async function resolveFunction({ ctx, args, required = true, }) {
|
|
|
141
142
|
}
|
|
142
143
|
return fn;
|
|
143
144
|
}
|
|
144
|
-
export async function resolveOrRegisterFunction({ ctx, slug, title, description, }) {
|
|
145
|
+
export async function resolveOrRegisterFunction({ ctx, slug, title, description, initialSecretBindings, }) {
|
|
145
146
|
const { functions } = await getJson({
|
|
146
147
|
...clientOptions(ctx),
|
|
147
148
|
path: `/api/managed-functions?slug=${encodeURIComponent(slug)}`,
|
|
148
149
|
});
|
|
149
150
|
const existing = functions.find((f) => f.slug === slug);
|
|
150
|
-
if (existing)
|
|
151
|
+
if (existing) {
|
|
152
|
+
if (initialSecretBindings !== undefined && !existing.activeVersionId && !existing.deployed) {
|
|
153
|
+
await patchJson({ ...clientOptions(ctx), path: `/api/managed-functions/${existing.id}`, body: { initialSecretBindings } });
|
|
154
|
+
}
|
|
151
155
|
return { fn: existing, created: false };
|
|
156
|
+
}
|
|
152
157
|
const created = await postJson({
|
|
153
158
|
...clientOptions(ctx),
|
|
154
159
|
path: '/api/managed-functions',
|
|
@@ -156,6 +161,7 @@ export async function resolveOrRegisterFunction({ ctx, slug, title, description,
|
|
|
156
161
|
slug,
|
|
157
162
|
title,
|
|
158
163
|
description: description ?? null,
|
|
164
|
+
...(initialSecretBindings === undefined ? {} : { initialSecretBindings }),
|
|
159
165
|
},
|
|
160
166
|
});
|
|
161
167
|
return { fn: created.function, created: true };
|
|
@@ -169,7 +175,18 @@ export async function functionsRegisterCommand(args) {
|
|
|
169
175
|
slug: manifest.function.id,
|
|
170
176
|
title: manifest.function.title,
|
|
171
177
|
description: manifest.function.description ?? null,
|
|
178
|
+
initialSecretBindings: manifest.secrets,
|
|
172
179
|
});
|
|
180
|
+
if (!fn.activeVersionId && !fn.deployed) {
|
|
181
|
+
const detail = await getFunctionDetail(ctx, fn.id);
|
|
182
|
+
const normalized = (entries) => entries.map(entry => typeof entry === 'string'
|
|
183
|
+
? { secret: entry, entries: null } : { secret: entry.secret, entries: entry.entries })
|
|
184
|
+
.sort((a, b) => a.secret.localeCompare(b.secret));
|
|
185
|
+
if (!detail?.initialSecretBindings || !isDeepStrictEqual(normalized(detail.initialSecretBindings), normalized(manifest.secrets))) {
|
|
186
|
+
console.error(`${LOG} initial secret preparation was not confirmed by this environment. Do not deploy an immutable release until the environment supports registration declarations and functions show confirms its pins.`);
|
|
187
|
+
return 1;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
173
190
|
console.log(`${LOG} ${created ? 'registered' : 'found'} managed function "${manifest.function.id}" (${fn.id}) on ${ctx.env.name}`);
|
|
174
191
|
return 0;
|
|
175
192
|
}
|
|
@@ -920,11 +937,14 @@ async function printFunctionShowDetails({ ctx, fn, }) {
|
|
|
920
937
|
}
|
|
921
938
|
}
|
|
922
939
|
const detail = await getFunctionDetail(ctx, fn.id);
|
|
940
|
+
if (detail?.initialSecretBindings) {
|
|
941
|
+
console.log(`${LOG} initial secret declarations: ${manifestSecretNames({ secrets: detail.initialSecretBindings }).join(', ') || '(none)'}`);
|
|
942
|
+
}
|
|
923
943
|
if (detail && detail.attachments.length > 0) {
|
|
924
944
|
console.log(`${LOG} attached secrets:`);
|
|
925
945
|
for (const row of detail.attachments) {
|
|
926
946
|
const mounted = row.deployed ? 'mounted' : 'pending redeploy';
|
|
927
|
-
console.log(` ${row.envVarName} [${mounted}]`);
|
|
947
|
+
console.log(` ${row.envVarName} [${mounted}]${row.pinnedGcpVersion ? ` pinned v${row.pinnedGcpVersion}` : ''}`);
|
|
928
948
|
}
|
|
929
949
|
}
|
|
930
950
|
printFunctionEgressHosts({
|
|
@@ -147,11 +147,13 @@ export declare const managedFunctionManifestSchema: z.ZodObject<{
|
|
|
147
147
|
context: z.ZodLiteral<true>;
|
|
148
148
|
}, z.core.$strict>>;
|
|
149
149
|
directory: z.ZodOptional<z.ZodObject<{
|
|
150
|
+
rosters: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
150
151
|
groups: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
151
152
|
resolve: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
152
153
|
}, z.core.$strict>>;
|
|
153
154
|
invocation: z.ZodOptional<z.ZodObject<{
|
|
154
155
|
identity: z.ZodLiteral<true>;
|
|
156
|
+
caller_capabilities: z.ZodOptional<z.ZodLiteral<true>>;
|
|
155
157
|
}, z.core.$strict>>;
|
|
156
158
|
roles: z.ZodOptional<z.ZodObject<{
|
|
157
159
|
definitions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
package/dist/main.js
CHANGED
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
import { parseArgs } from './argv.js';
|
|
27
27
|
import { renderCapabilities } from './command-contract.js';
|
|
28
28
|
import { staticHelp } from './command-help.js';
|
|
29
|
+
import { ignoredSandboxEnvNotice } from './env-flags.js';
|
|
30
|
+
import { sandboxUsageFooter } from './sandbox-auth.js';
|
|
29
31
|
// Lazy-load artifact delegate: published @sequenceholdings/artifact-studio/cli
|
|
30
32
|
// still auto-runs runCli() at module load; importing it here breaks doctor/process.
|
|
31
33
|
const TOP_LEVEL_USAGE = `usage:
|
|
@@ -63,8 +65,6 @@ const TOP_LEVEL_USAGE = `usage:
|
|
|
63
65
|
If this CLI cannot complete a documented step, read that environment's docs
|
|
64
66
|
before trying another tool. \`seq-studio envs list\` prints each environment URL.
|
|
65
67
|
Docs: <url>/docs. Feedback guide: <url>/docs/raw/seq-studio/feedback.md.
|
|
66
|
-
Sequence: https://sequence.seqholdings.com/docs
|
|
67
|
-
and https://sequence.seqholdings.com/docs/raw/seq-studio/feedback.md.
|
|
68
68
|
`;
|
|
69
69
|
const PROCESS_USAGE = `usage:
|
|
70
70
|
seq-studio process init <dir>
|
|
@@ -107,7 +107,7 @@ const SUBCOMMANDS = {
|
|
|
107
107
|
export async function run(argv = process.argv.slice(2)) {
|
|
108
108
|
const [namespace, sub, ...rest] = argv;
|
|
109
109
|
if (!namespace || namespace === 'help' || namespace === '--help' || namespace === '-h') {
|
|
110
|
-
console.log(TOP_LEVEL_USAGE);
|
|
110
|
+
console.log(`${TOP_LEVEL_USAGE}${sandboxUsageFooter()}`);
|
|
111
111
|
return namespace ? 0 : 1;
|
|
112
112
|
}
|
|
113
113
|
if (namespace === 'capabilities' && hasHelpFlag(sub, rest)) {
|
|
@@ -130,6 +130,9 @@ export async function run(argv = process.argv.slice(2)) {
|
|
|
130
130
|
return 0;
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
+
const ignoredEnv = ignoredSandboxEnvNotice([sub, ...rest].filter((a) => Boolean(a)));
|
|
134
|
+
if (ignoredEnv)
|
|
135
|
+
console.error(ignoredEnv);
|
|
133
136
|
switch (namespace) {
|
|
134
137
|
case 'init': {
|
|
135
138
|
const { runAppInitCommand } = await import('./app/commands.js');
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { getAccessToken, getAccessTokenWithMode, NotLoggedInError } from '../auth.js';
|
|
6
6
|
import { AtlasApiError, getJson, postJson } from '../atlas-client.js';
|
|
7
7
|
import { resolveConfiguredEnv } from '../config.js';
|
|
8
|
+
import { explicitOrSandboxEnv } from '../env-flags.js';
|
|
8
9
|
import { parseDurationMs } from '@sequenceholdings/lattice';
|
|
9
10
|
import { assertCloneDeployAllowed, publishCloneForDeploy } from './clone-deploy.js';
|
|
10
11
|
import { printReconcileResult, reconcileStageCredentials } from './stage-secrets.js';
|
|
@@ -53,7 +54,7 @@ function deploymentStatusLabel(detail) {
|
|
|
53
54
|
return detail.status;
|
|
54
55
|
}
|
|
55
56
|
export async function envAndToken(args, options = {}) {
|
|
56
|
-
const requested = typeof args.flags.e === 'string' ? args.flags.e : typeof args.flags.env === 'string' ? args.flags.env : undefined;
|
|
57
|
+
const requested = explicitOrSandboxEnv(typeof args.flags.e === 'string' ? args.flags.e : typeof args.flags.env === 'string' ? args.flags.env : undefined);
|
|
57
58
|
if (!requested) {
|
|
58
59
|
throw new Error('missing -e/--env <environment>');
|
|
59
60
|
}
|
|
@@ -3,6 +3,8 @@ import { join, resolve } from 'node:path';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { getAccessToken } from '../auth.js';
|
|
5
5
|
import { resolveConfiguredEnv } from '../config.js';
|
|
6
|
+
import { explicitOrSandboxEnv } from '../env-flags.js';
|
|
7
|
+
import { isSandboxTokenMode } from '../sandbox-auth.js';
|
|
6
8
|
import { loadActiveOrmContracts } from './active-orm-contracts.js';
|
|
7
9
|
import { commitFileWrites } from './atomic-file-writes.js';
|
|
8
10
|
import { resolvePipelineTarget } from './lifecycle.js';
|
|
@@ -16,7 +18,7 @@ async function loadModules() {
|
|
|
16
18
|
}
|
|
17
19
|
function requestedEnvironment(args) {
|
|
18
20
|
const value = args.flags.e ?? args.flags.env;
|
|
19
|
-
return typeof value === 'string' ? value : undefined;
|
|
21
|
+
return explicitOrSandboxEnv(typeof value === 'string' ? value : undefined);
|
|
20
22
|
}
|
|
21
23
|
function hasOrmPin(stage) {
|
|
22
24
|
return stage.type === 'serving' && stage.satisfies !== undefined;
|
|
@@ -63,6 +65,11 @@ async function assertSharedStageContractsAgree({ contracts, orm, stages, target,
|
|
|
63
65
|
throw new Error(`cannot verify shared ORM pins for target '${otherTarget}'; ` +
|
|
64
66
|
'split multi-target stages or use environment-specific pins');
|
|
65
67
|
}
|
|
68
|
+
if (isSandboxTokenMode()) {
|
|
69
|
+
// Every name resolves to the sandbox deployment, which is not this target's.
|
|
70
|
+
throw new Error(`cannot verify shared ORM pins for target '${otherTarget}' from an agent sandbox; ` +
|
|
71
|
+
'it reaches only its own deployment');
|
|
72
|
+
}
|
|
66
73
|
const otherEnv = await resolveConfiguredEnv({ requested: environmentName });
|
|
67
74
|
const otherToken = await getAccessToken({ env: otherEnv.name, targetUrl: otherEnv.url });
|
|
68
75
|
const sharedStages = stages.filter((stage) => stage.environments.includes(otherTarget));
|
package/dist/process/build.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bundle builder. Produces the canonical `bundle_hash` for a process
|
|
3
|
-
* source tree.
|
|
4
|
-
*/
|
|
5
1
|
import { type LatticeBundle, type LatticeBundleSummary } from '@sequenceholdings/lattice/bundle';
|
|
6
2
|
import type { LoadedProcess } from './discover.js';
|
|
7
3
|
export type ResolveProcessPin = (processId: string, version?: string) => Promise<{
|
package/dist/process/build.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { authoredNodeMetadata } from './node-metadata.js';
|
|
1
2
|
/**
|
|
2
3
|
* Bundle builder. Produces the canonical `bundle_hash` for a process
|
|
3
4
|
* source tree.
|
|
@@ -165,6 +166,7 @@ function serializeNodeMetadata(node) {
|
|
|
165
166
|
// their code lives in the Atlas image and is never serialized here.
|
|
166
167
|
const native = node;
|
|
167
168
|
const meta = {
|
|
169
|
+
...authoredNodeMetadata(native.id, native.metadata),
|
|
168
170
|
registered_function_id: native.registered_function_id,
|
|
169
171
|
execution: 'native',
|
|
170
172
|
};
|
|
@@ -373,6 +375,7 @@ function serializeNodeMetadata(node) {
|
|
|
373
375
|
case 'managed_function': {
|
|
374
376
|
const mf = node;
|
|
375
377
|
const meta = {
|
|
378
|
+
...authoredNodeMetadata(mf.id, mf.metadata),
|
|
376
379
|
function_id: mf.function,
|
|
377
380
|
};
|
|
378
381
|
if (mf.version)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { validateAuthoredNodeMetadata } from '@sequenceholdings/lattice/define';
|
|
2
|
+
/** Validate raw definitions too: callers need not use an SDK builder. */
|
|
3
|
+
export function authoredNodeMetadata(nodeId, metadata) {
|
|
4
|
+
validateAuthoredNodeMetadata(nodeId, metadata);
|
|
5
|
+
return metadata === undefined ? {} : { ...metadata };
|
|
6
|
+
}
|
package/dist/sandbox-auth.d.ts
CHANGED
|
@@ -38,6 +38,17 @@ export declare class SandboxAuthError extends Error {
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function sandboxTarget(env?: NodeJS.ProcessEnv): SandboxTarget | null;
|
|
40
40
|
export declare function isSandboxTokenMode(env?: NodeJS.ProcessEnv): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* One line naming the deployment a sandbox is pinned to, for help, envs and
|
|
43
|
+
* whoami. An agent reads it to learn where its commands go and that `-e` and
|
|
44
|
+
* `envs add` cannot point them anywhere else.
|
|
45
|
+
*/
|
|
46
|
+
export declare function describeSandboxTarget(target: SandboxTarget): string;
|
|
47
|
+
/**
|
|
48
|
+
* Lines appended to top-level help: the pinned deployment in sandbox token
|
|
49
|
+
* mode, the misconfiguration when only one variable is set, else nothing.
|
|
50
|
+
*/
|
|
51
|
+
export declare function sandboxUsageFooter(): string;
|
|
41
52
|
/** Read the current bearer. Never cached: Atlas rotates the file between requests. */
|
|
42
53
|
export declare function readSandboxToken(target: SandboxTarget): Promise<string>;
|
|
43
54
|
export declare function isSandboxOrigin({ target, url }: {
|
package/dist/sandbox-auth.js
CHANGED
|
@@ -59,6 +59,28 @@ export function sandboxTarget(env = process.env) {
|
|
|
59
59
|
export function isSandboxTokenMode(env = process.env) {
|
|
60
60
|
return sandboxTarget(env) !== null;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* One line naming the deployment a sandbox is pinned to, for help, envs and
|
|
64
|
+
* whoami. An agent reads it to learn where its commands go and that `-e` and
|
|
65
|
+
* `envs add` cannot point them anywhere else.
|
|
66
|
+
*/
|
|
67
|
+
export function describeSandboxTarget(target) {
|
|
68
|
+
return (`Sandbox token mode: ${SANDBOX_BASE_URL_ENV} and ${SANDBOX_TOKEN_FILE_ENV} pin every command to ` +
|
|
69
|
+
`${target.baseUrl} (environment "${SANDBOX_ENV_NAME}"). -e is optional; any value resolves to this deployment.`);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Lines appended to top-level help: the pinned deployment in sandbox token
|
|
73
|
+
* mode, the misconfiguration when only one variable is set, else nothing.
|
|
74
|
+
*/
|
|
75
|
+
export function sandboxUsageFooter() {
|
|
76
|
+
try {
|
|
77
|
+
const target = sandboxTarget();
|
|
78
|
+
return target ? `\n ${describeSandboxTarget(target)}\n` : '';
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
return `\n ${error instanceof Error ? error.message : String(error)}\n`;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
62
84
|
/** Read the current bearer. Never cached: Atlas rotates the file between requests. */
|
|
63
85
|
export async function readSandboxToken(target) {
|
|
64
86
|
let text;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequenceholdings/studio-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
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": {
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"tsx": "^4.20.3",
|
|
43
43
|
"zod": "^4.1.13",
|
|
44
44
|
"yaml": "^2.8.4",
|
|
45
|
-
"@sequenceholdings/
|
|
46
|
-
"@sequenceholdings/
|
|
45
|
+
"@sequenceholdings/managed-functions": "0.4.5",
|
|
46
|
+
"@sequenceholdings/storage": "0.1.2",
|
|
47
47
|
"@sequenceholdings/agent-spec": "0.1.4",
|
|
48
|
-
"@sequenceholdings/artifact-studio": "0.
|
|
49
|
-
"@sequenceholdings/
|
|
48
|
+
"@sequenceholdings/artifact-studio": "0.10.1",
|
|
49
|
+
"@sequenceholdings/lattice": "0.1.7"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@sequenceholdings/orm": "2.
|
|
53
|
-
"@sequenceholdings/pipeline-spec": "0.
|
|
52
|
+
"@sequenceholdings/orm": "2.7.1",
|
|
53
|
+
"@sequenceholdings/pipeline-spec": "0.3.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependenciesMeta": {
|
|
56
56
|
"@sequenceholdings/orm": {
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"@types/node": "^22.0.0",
|
|
66
66
|
"typescript": "^5.6.0",
|
|
67
67
|
"vitest": "^4.1.11",
|
|
68
|
-
"@sequenceholdings/orm": "2.
|
|
69
|
-
"@sequenceholdings/pipeline-spec": "0.
|
|
68
|
+
"@sequenceholdings/orm": "2.7.1",
|
|
69
|
+
"@sequenceholdings/pipeline-spec": "0.3.0"
|
|
70
70
|
},
|
|
71
71
|
"engines": {
|
|
72
72
|
"node": ">=20"
|