@sequenceholdings/studio-cli 0.6.4 → 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 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.
@@ -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>]
@@ -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 function shell without deploying\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";
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";
@@ -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 function shell without deploying
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)
@@ -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<{
@@ -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<{
@@ -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,2 @@
1
+ /** Validate raw definitions too: callers need not use an SDK builder. */
2
+ export declare function authoredNodeMetadata(nodeId: string, metadata: unknown): Record<string, unknown>;
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenceholdings/studio-cli",
3
- "version": "0.6.4",
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/managed-functions": "0.4.5",
46
+ "@sequenceholdings/storage": "0.1.2",
45
47
  "@sequenceholdings/agent-spec": "0.1.4",
46
- "@sequenceholdings/artifact-studio": "0.9.2",
47
- "@sequenceholdings/lattice": "0.1.6",
48
- "@sequenceholdings/managed-functions": "0.4.3",
49
- "@sequenceholdings/storage": "0.1.2"
48
+ "@sequenceholdings/artifact-studio": "0.10.1",
49
+ "@sequenceholdings/lattice": "0.1.7"
50
50
  },
51
51
  "peerDependencies": {
52
- "@sequenceholdings/orm": "2.6.2",
53
- "@sequenceholdings/pipeline-spec": "0.2.6"
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.6.2",
69
- "@sequenceholdings/pipeline-spec": "0.2.6"
68
+ "@sequenceholdings/orm": "2.7.1",
69
+ "@sequenceholdings/pipeline-spec": "0.3.0"
70
70
  },
71
71
  "engines": {
72
72
  "node": ">=20"