@sequenceholdings/studio-cli 0.1.35 → 0.2.1

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
@@ -376,7 +376,7 @@ compiled to canonical SQL before registration.
376
376
  Install the CLI and ORM package together:
377
377
 
378
378
  ```bash
379
- pnpm add -g @sequenceholdings/studio-cli@0.1.35 @sequenceholdings/orm@2.1.0
379
+ pnpm add -g @sequenceholdings/studio-cli@0.1.36 @sequenceholdings/orm@2.1.0
380
380
  ```
381
381
 
382
382
  The everyday loop is:
@@ -767,16 +767,16 @@ The API requires Managed Functions Admin on that org.
767
767
 
768
768
  `seq-studio artifact <sub>` is the entry point for Artifact Studio. It runs
769
769
  the `@sequenceholdings/artifact-studio` library (its `./cli` `runCli` export),
770
- routed through `~/.config/lattice/config.toml` and the shared seqapi token.
770
+ routed through `~/.config/lattice/config.toml` and the shared platform login.
771
771
 
772
772
  | Command | Underlying `runCli` verb |
773
773
  |---------|--------------------------|
774
- | `seq-studio artifact init <dir>` | `init <dir>` |
774
+ | `seq-studio artifact init <dir> [--template react-vite\|nextjs]` | `init <dir>` — defaults to the existing React/Vite scaffold |
775
775
  | `seq-studio artifact link [dir] -e <env> [--project <id>]` | `link [dir] --env <env>` |
776
- | `seq-studio artifact build [dir]` | `build [dir]` |
776
+ | `seq-studio artifact build [dir] [-e <env>]` | React/HTML: local bundle. Next.js: asynchronous hosted preview build on Atlas; use `pnpm build` for local compilation. |
777
777
  | `seq-studio artifact plan [dir] -e <env>` | `plan [dir] --env <env>` |
778
778
  | `seq-studio artifact deploy [dir] -e <env> [--skip-unchanged] [--no-create] [--project <id>]` | `deploy [dir] --env <env>` — `--skip-unchanged` no-ops (before building) when the remote active deployment's `sourceHash` **and** CLI/atlas-ui peer versions already match; `--no-create` errors instead of creating a missing project; `--project <id>` targets a project directly when duplicate slugs make the lookup ambiguous (slug must still match the manifest) |
779
- | `seq-studio artifact dev [dir] -e <env>` | `dev [dir] --env <env>` |
779
+ | `seq-studio artifact dev [dir] -e <env> [--link <pkgDir>[,<pkgDir>]] [--port <port>]` | React/HTML: rebuild preview on changes. Next.js: local development server and owner-only Atlas tunnel; `--port` selects its loopback port. |
780
780
  | `seq-studio artifact pull <project-id> -e <env> [--out <dir>]` | `pull <project-id> --env <env> [--out <dir>]` |
781
781
  | `seq-studio artifact list -e <env>` | `list --env <env>` — projects visible on the environment (slug, id, active version, visibility) |
782
782
  | `seq-studio artifact show <slug-or-id> -e <env>` | `show <slug-or-id> --env <env>` — one project's detail incl. active deployment, git provenance, and (for newer deployments) the building `artifact-studio` / force-aliased `atlas-ui` versions |
@@ -789,7 +789,7 @@ routed through `~/.config/lattice/config.toml` and the shared seqapi token.
789
789
  directory's `.artifact-studio/config.json` — run them from the linked artifact
790
790
  folder (or run `seq-studio artifact link` first).
791
791
 
792
- **Active (official) deploys to deployed environments require `main` with a
792
+ **React/HTML active (official) deploys to deployed environments require `main` with a
793
793
  resolved git commit and a clean artifact source directory** for both Git
794
794
  Service (`--repo`) and local sources. When a local source is nested in a larger
795
795
  checkout, dirty files outside that source directory are ignored with a warning.
@@ -800,12 +800,12 @@ deployed environments
800
800
  (`seq-studio artifact dev` / preview channel); promotion applies the same
801
801
  provenance check.
802
802
 
803
- **CLI atlas-ui stamp (DES-254):** builds force-alias `@sequenceholdings/atlas-ui`
803
+ **React/HTML CLI atlas-ui stamp (DES-254):** builds force-alias `@sequenceholdings/atlas-ui`
804
804
  to the CLI's copy — not the artifact's declared semver. Deployments record
805
805
  `cliVersion` + `atlasUiVersion`. Contract:
806
806
  `@sequenceholdings/artifact-studio` → `VERSION-PIN.md`.
807
807
 
808
- Studio CLI 0.1.31 carries Artifact Studio 0.2.5 with Atlas UI 3.1.2 pinned
808
+ Studio CLI 0.1.36 carries Artifact Studio 0.2.7 with Atlas UI 3.3.0 pinned
809
809
  exactly. Ordinary builds use canonical, mode-aware `tokens.css`; new projects
810
810
  use matching editor dependencies. Before rebuilding an older artifact, migrate
811
811
  numbered black/white opacity utilities to semantic roles and check a preview in
@@ -813,10 +813,110 @@ light and dark mode. Legacy stylesheet entry points remain temporary aliases;
813
813
  they do not restore retired utilities. Existing deployed bundles change only
814
814
  when rebuilt and activated.
815
815
 
816
+ ### Next.js applications (prerelease, opt-in Preview)
817
+
818
+ This implementation is not generally enabled; use only a reviewed prerelease
819
+ provided for an explicitly enabled pilot. Package publication and environment
820
+ rollout are separate release gates.
821
+
822
+ Next.js support requires a CLI/SDK release containing the Next.js scaffold and
823
+ an environment whose platform team has enabled the runtime and completed its
824
+ gateway/build/hosting setup. It is not enabled merely by upgrading the CLI.
825
+ Application developers need Atlas access, Node 24, pnpm and Git; no GCP account,
826
+ provider credentials or cloud devbox is required. Existing React/HTML projects
827
+ keep their current runtime unless their authors explicitly migrate them.
828
+
829
+ ```bash
830
+ seq-studio artifact init example-next-app --template nextjs
831
+ cd example-next-app
832
+ pnpm install
833
+ seq-studio artifact validate
834
+ pnpm type-check
835
+ pnpm build
836
+ ```
837
+
838
+ The scaffold pins approved Next.js 16.3 and React 19 versions and uses schema-v2
839
+ `artifact.bundle.yml`. It owns its React/Next dependencies; the React/Vite
840
+ platform aliases do not apply. Commit the generated `pnpm-lock.yaml`. `pnpm dev`
841
+ provides a standalone loopback UI check; SDK access to Atlas requires the
842
+ authorized development session below.
843
+
844
+ ```bash
845
+ seq-studio envs list
846
+ seq-studio login --env <environment>
847
+ seq-studio artifact link --env <environment>
848
+ seq-studio artifact dev --env <environment>
849
+ ```
850
+
851
+ The CLI starts Next.js with the supported Webpack development server on loopback and connects an authenticated outbound tunnel
852
+ to Atlas. It prints the owner-only preview URL and opens it in an interactive
853
+ terminal. Source stays on your computer. Fast Refresh handles compatible UI
854
+ edits; Next.js also reloads server code and reports compiler errors. Ctrl+C
855
+ stops the child process and revokes the session. A disconnected laptop has no
856
+ live preview; use a hosted preview when someone else needs to review the app.
857
+
858
+ Development recovery behavior:
859
+
860
+ - Manifest/capability changes stop the session with a restart instruction so
861
+ Atlas can authorize the new policy.
862
+ - Package/lockfile changes restart Next.js. Install changed dependencies with
863
+ `pnpm install`; the CLI does not silently install them.
864
+ - `--link <package-directory>` (comma-separate several) rebuilds the linked package, refreshes its built
865
+ output and restarts Next.js. Native Fast Refresh remains active for application
866
+ edits; a package restart can reset state.
867
+ - Network reconnect obtains a fresh tunnel lease and does not replay requests.
868
+ Unexpected local process crashes receive up to three consecutive restart
869
+ attempts, then exit with an actionable error.
870
+
871
+ Configure explicit nonproduction resource bindings in Atlas before making SDK
872
+ calls. Missing or revoked bindings fail rather than selecting production.
873
+ Managed secrets stay in hosted runtimes: use mocks, your own test credentials
874
+ or an existing governed function locally, and a hosted preview for secret-backed
875
+ application code. Browser capabilities and server capabilities are separate
876
+ manifest declarations. Never put a secret in `build.public_env` or `NEXT_PUBLIC_*`.
877
+ Local execution runs as your OS user; Atlas does not sandbox your laptop's
878
+ filesystem or arbitrary outbound connections.
879
+
880
+ For an immutable hosted preview, commit the source and connect its Git Service
881
+ repository, then run:
882
+
883
+ ```bash
884
+ seq-studio artifact build --repo <namespace>/<repository> --ref <branch> --env <environment>
885
+ ```
886
+
887
+ `artifact build . --env <environment>` also accepts a committed local project
888
+ with repository provenance for a hosted preview. It is not an offline build.
889
+ The CLI waits for Atlas's operation and prints the deployment link. `--out`
890
+ writes the completed operation/deployment receipt, not a JavaScript bundle.
891
+ Ctrl+C stops waiting but does not cancel the remote build. Next.js does not
892
+ support `artifact dev --once`; use the hosted build command instead.
893
+
894
+ Official releases fetch and verify source from the Git Service in the target
895
+ Atlas environment. Push the reviewed clean `main` revision before deploying:
896
+
897
+ ```bash
898
+ seq-studio artifact plan --repo <namespace>/<repository> --ref main --env <environment>
899
+ seq-studio artifact deploy --repo <namespace>/<repository> --ref main --env <environment>
900
+ ```
901
+
902
+ The Next.js `plan` command validates local source/toolchain inputs and prints the
903
+ proposed build; it does not currently perform a remote policy diff. Atlas checks
904
+ permissions, bindings and policy when the build is submitted. A local image or
905
+ an arbitrary remote repository is not accepted as official release evidence.
906
+ `--skip-unchanged` does not apply static-bundle skip logic to Next.js builds.
907
+
908
+ Atlas builds the production server and browser assets, checks the candidate and
909
+ activates the deployment. Review hosted behavior and configuration in Artifact
910
+ Studio before release. The hosted application runs independently of your
911
+ computer. Framework support is App Router on the approved Node profile; custom
912
+ Next servers, Pages Router, Edge runtime and production WebSocket services are
913
+ outside this Preview workflow.
914
+
816
915
  ### Source for `build` / `plan` / `deploy`
817
916
 
818
- These three commands read their source tree from one of three places — the rest
819
- of the pipeline (build → upload) is identical regardless of origin:
917
+ These commands can inspect source from three locations. React/HTML builds use
918
+ the local build/upload pipeline; Next.js uses the hosted workflow above, with
919
+ Git Service verification required for an official release:
820
920
 
821
921
  | Flag | Source |
822
922
  |------|--------|
@@ -824,7 +924,7 @@ of the pipeline (build → upload) is identical regardless of origin:
824
924
  | `--repo <ns>/<name>` | a repo in the platform Git Service, e.g. `--repo artifacts/accounts` |
825
925
  | `--git-url <url>` | a public, credential-free HTTPS git URL (cloned to a temp dir) |
826
926
 
827
- `--ref <branch\|tag\|commit>` selects the revision for `build` and `plan`
927
+ For React/HTML, `--ref <branch\|tag\|commit>` selects the revision for `build` and `plan`
828
928
  (default: the repo's default branch). Active deploys to deployed environments
829
929
  require `main`; local active deploys scope dirty-file checks to the source
830
930
  directory and warn about unrelated changes elsewhere in the checkout.
@@ -856,7 +956,7 @@ These three look similar but fetch different things:
856
956
  |---------|--------------|
857
957
  | `seq-studio artifact pull <project-id>` | Active **deployment** source files for an Artifact Studio project (built bundle inputs), keyed by project UUID — **not** git history |
858
958
  | `seq-studio repos clone <ns>/<name>` | Repo source tree. With `ATLAS_GIT_PAT`, a real `git clone` via smart-HTTP; otherwise JSON-API materialize (no `.git` dir) |
859
- | `seq-studio artifact deploy --repo <ns>/<name>` | Build + deploy an artifact whose source lives in the platform git service (materializes, builds, uploads) |
959
+ | `seq-studio artifact deploy --repo <ns>/<name>` | Build and deploy repository source; React/HTML builds locally, while Next.js uses Atlas's verified hosted build. |
860
960
 
861
961
  ## Auth (git-service PATs)
862
962
 
@@ -908,7 +1008,7 @@ JSON API — the same repos `--repo <ns>/<name>` sources build from.
908
1008
  | `seq-studio repos namespaces [create <slug>] -e <env>` | list namespaces, or create one (creator becomes owner) |
909
1009
  | `seq-studio repos show <ns>/<name> -e <env>` | detail: id, branches, clone URL; artifact project id when slug matches |
910
1010
  | `seq-studio repos create <ns>/<name> -e <env> [--default-branch <b>] [--git-backend gcs_isomorphic\|walgit]` | create a repo (GCS default + seed README; `walgit` starts empty on `main`; needs namespace write) |
911
- | `seq-studio repos clone <ns>/<name> \| --url <clone-url> \| --id <uuid> -e <env> [--ref <r>] [--output <dir>] [--force]` | smart-HTTP `git clone` when `ATLAS_GIT_PAT` is set (`--url`/`--id` need no seqapi); otherwise JSON materialize + PAT hint. `--out` remains an alias for `--output`. |
1011
+ | `seq-studio repos clone <ns>/<name> \| --url <clone-url> \| --id <uuid> -e <env> [--ref <r>] [--output <dir>] [--force] [--full]` | smart-HTTP `git clone --depth 1` when `ATLAS_GIT_PAT` is set (`--full` fetches history; a commit SHA stays full). `--url`/`--id` need no seqapi. Otherwise JSON materialize + PAT hint. `--out` remains an alias for `--output`. |
912
1012
  | `seq-studio repos pull <ns>/<name> -e <env> [--ref <r>] [--out <dir>] [--force]` | always materialize via JSON API (no `.git` dir); refuses a non-empty destination unless `--force` |
913
1013
  | `seq-studio repos delete <ns>/<name> -e <env> [--yes]` | delete a repo — interactive confirm unless `--yes` |
914
1014
  | `seq-studio repos ci show <ns>/<name> -e <env> [--ref <r>]` | preview CI checks discovered from the ref |
@@ -17,12 +17,12 @@ import { fetchCatalog, readCachedCatalog } from '../env-catalog.js';
17
17
  import { normalizeShortEnvFlag, readEnvFromArgv } from '../env-flags.js';
18
18
  import { PREVIEW_DOMAIN, PREVIEW_PROJECT, resolvePreviewByPr } from '../preview.js';
19
19
  const ARTIFACT_USAGE = `usage:
20
- seq-studio artifact init <dir>
20
+ seq-studio artifact init <dir> [--template react-vite|nextjs]
21
21
  seq-studio artifact validate [dir]
22
22
  seq-studio artifact build [dir | --repo <ns>/<name> | --git-url <url>] [--ref <ref>] [--out file.json]
23
23
  seq-studio artifact plan [dir | --repo <ns>/<name> | --git-url <url>] [--ref <ref>] -e <env>
24
24
  seq-studio artifact deploy [dir | --repo <ns>/<name> | --git-url <url>] [--ref <ref>] -e <env> [--skip-unchanged] [--no-create] [--project <id>]
25
- seq-studio artifact dev [dir] -e <env> [--once] [--key default]
25
+ seq-studio artifact dev [dir] -e <env> [--once] [--key default] [--link <pkgDir>[,<pkgDir>]] [--port <port>]
26
26
  seq-studio artifact pull <project-id> -e <env> --out <dir>
27
27
  seq-studio artifact promote <deployment-id> -e <env>
28
28
  seq-studio artifact rollback <deployment-id> -e <env>
@@ -44,6 +44,15 @@ const ARTIFACT_USAGE = `usage:
44
44
  Headless M2M builds use JSON materialize and accept only platform-managed
45
45
  --repo sources.
46
46
 
47
+ Next.js applications require Node.js 24 and application-local dependencies
48
+ (pnpm install). dev runs Next locally with native Fast Refresh through an
49
+ owner-only Atlas tunnel; no GCP access is required. build -e <env> requests a
50
+ hosted preview. Official deploys use a reviewed Git Service revision:
51
+ deploy --repo <namespace>/<name> --ref main -e <env>. A clean local checkout
52
+ with a Git Service origin on the target Atlas environment also works.
53
+ Use pnpm build for a local production-build check. --once is static-only;
54
+ --port selects the local Next loopback port.
55
+
47
56
  Per-PR preview environments (https://studio-atlas-git-<slug>.preview.seqholdings.com):
48
57
  -e preview:<branch-or-slug> compute the preview host from a branch name
49
58
  --pr <number> resolve the preview host from a PR (handles long slugs)
@@ -191,6 +191,10 @@ function serializeNodeMetadata(node) {
191
191
  }
192
192
  if (agent.timeout !== undefined)
193
193
  meta.timeout = agent.timeout;
194
+ if (agent.allowedTools !== undefined)
195
+ meta.allowed_tools = [...agent.allowedTools];
196
+ if (agent.outputMode !== undefined)
197
+ meta.output_mode = agent.outputMode;
194
198
  if (agent.workflowId !== undefined)
195
199
  meta.workflow_id = agent.workflowId;
196
200
  if (agent.on_reset_edge_id)
@@ -102,6 +102,8 @@ function emitNode(node, ctx) {
102
102
  ` agent: { id: ${lit(String(m.agent_id))}${m.agent_version !== undefined
103
103
  ? `, version: ${value(m.agent_version)}`
104
104
  : ''} },`,
105
+ m.allowed_tools !== undefined ? ` allowedTools: ${JSON.stringify(m.allowed_tools)},` : null,
106
+ m.output_mode !== undefined ? ` outputMode: ${value(m.output_mode)},` : null,
105
107
  m.workflow_id != null ? ` workflowId: ${lit(String(m.workflow_id))},` : null,
106
108
  m.on_reset_edge_id != null ? ` on_reset_edge_id: ${lit(String(m.on_reset_edge_id))},` : null,
107
109
  m.timeout !== undefined ? ` timeout: ${value(m.timeout)},` : null,
@@ -500,6 +500,9 @@ function serializedAgentContract(node) {
500
500
  const onResetEdgeId = node.metadata.on_reset_edge_id;
501
501
  return {
502
502
  agentId,
503
+ workflowId: node.metadata.workflow_id,
504
+ outputMode: node.metadata.output_mode,
505
+ allowedTools: node.metadata.allowed_tools,
503
506
  ...(typeof agentVersion === 'number' ? { agentVersion } : {}),
504
507
  allEdgeIds: node.outgoing_edges.map((edge) => edge.id),
505
508
  ...(typeof onResetEdgeId === 'string' ? { onResetEdgeId } : {}),
@@ -514,6 +517,9 @@ async function lintAgent(processId, node, errors, warnings, loadAgentSchemaEdgeI
514
517
  nodeId: node.id,
515
518
  agentId: node.agent.id,
516
519
  agentVersion: node.agent.version,
520
+ workflowId: node.workflowId,
521
+ outputMode: node.outputMode,
522
+ allowedTools: node.allowedTools,
517
523
  allEdgeIds: node.outgoing_edges.map((edge) => edge.id),
518
524
  onResetEdgeId: node.on_reset_edge_id,
519
525
  errors,
@@ -523,7 +529,7 @@ async function lintAgent(processId, node, errors, warnings, loadAgentSchemaEdgeI
523
529
  includeStaticValidation: true,
524
530
  });
525
531
  }
526
- async function lintAgentContract({ processId, nodeId, agentId, agentVersion, allEdgeIds, onResetEdgeId, errors, warnings, loadAgentSchemaEdgeIdEnum, suppressUnavailableAgentWarnings, includeStaticValidation, }) {
532
+ async function lintAgentContract({ processId, nodeId, agentId, agentVersion, workflowId, outputMode, allowedTools, allEdgeIds, onResetEdgeId, errors, warnings, loadAgentSchemaEdgeIdEnum, suppressUnavailableAgentWarnings, includeStaticValidation, }) {
527
533
  if (includeStaticValidation && onResetEdgeId && !allEdgeIds.includes(onResetEdgeId)) {
528
534
  errors.push({
529
535
  process_id: processId,
@@ -531,9 +537,38 @@ async function lintAgentContract({ processId, nodeId, agentId, agentVersion, all
531
537
  message: `on_reset_edge_id "${onResetEdgeId}" is not in outgoing_edges`,
532
538
  });
533
539
  }
540
+ if (workflowId !== undefined && (allowedTools !== undefined || outputMode !== undefined)) {
541
+ errors.push({
542
+ process_id: processId,
543
+ node_id: nodeId,
544
+ message: 'allowedTools and outputMode cannot be used with workflowId',
545
+ });
546
+ }
534
547
  const outgoingIds = allEdgeIds.filter((id) => id !== onResetEdgeId);
548
+ if (allowedTools !== undefined && (!Array.isArray(allowedTools) || allowedTools.length === 0 ||
549
+ allowedTools.some((tool) => typeof tool !== 'string' || tool.trim().length === 0))) {
550
+ errors.push({
551
+ process_id: processId,
552
+ node_id: nodeId,
553
+ message: 'allowedTools must be a nonempty array of nonempty strings',
554
+ });
555
+ }
556
+ if (outputMode !== undefined && outputMode !== 'payload') {
557
+ errors.push({
558
+ process_id: processId,
559
+ node_id: nodeId,
560
+ message: 'unsupported agent outputMode',
561
+ });
562
+ }
563
+ if (outputMode === 'payload' && outgoingIds.length > 1) {
564
+ errors.push({
565
+ process_id: processId,
566
+ node_id: nodeId,
567
+ message: 'payload mode permits at most one normal outgoing edge',
568
+ });
569
+ }
535
570
  if (agentVersion !== undefined) {
536
- if (outgoingIds.length > 1) {
571
+ if (outputMode !== 'payload' && outgoingIds.length > 1) {
537
572
  warnings.push({
538
573
  process_id: processId,
539
574
  node_id: nodeId,
@@ -543,7 +578,7 @@ async function lintAgentContract({ processId, nodeId, agentId, agentVersion, all
543
578
  return;
544
579
  }
545
580
  if (!loadAgentSchemaEdgeIdEnum) {
546
- if (outgoingIds.length > 1 && !suppressUnavailableAgentWarnings) {
581
+ if (outputMode !== 'payload' && outgoingIds.length > 1 && !suppressUnavailableAgentWarnings) {
547
582
  warnings.push({
548
583
  process_id: processId,
549
584
  node_id: nodeId,
@@ -572,7 +607,7 @@ async function lintAgentContract({ processId, nodeId, agentId, agentVersion, all
572
607
  });
573
608
  return;
574
609
  }
575
- if (outgoingIds.length === 0)
610
+ if (outputMode === 'payload' || outgoingIds.length === 0)
576
611
  return;
577
612
  if (enumValues === null) {
578
613
  // No edge_id enum is the generic-agent contract: one agent serving nodes
@@ -173,6 +173,8 @@ const BEHAVIORAL_METADATA_FIELDS = {
173
173
  ],
174
174
  agent: [
175
175
  'agent_version',
176
+ 'allowed_tools',
177
+ 'output_mode',
176
178
  'input_mapper_source',
177
179
  'input_mapper_expr',
178
180
  'timeout',
@@ -13,6 +13,16 @@ export declare function parseRepoPath(input: string | undefined): {
13
13
  * list, or `pull --ref --out x` fetching the default branch). Error instead.
14
14
  */
15
15
  export declare function stringFlag(flags: ParsedArgs['flags'], key: string): string | undefined;
16
+ /**
17
+ * Branch and tag clones fetch one commit. A full history walk reads every
18
+ * object out of git-service storage before the pack starts. Commit SHAs
19
+ * stay full so the following checkout can see that object. `--full` opts
20
+ * back into history.
21
+ */
22
+ export declare function smartHttpCloneDepth({ ref, full, }: {
23
+ ref?: string;
24
+ full: boolean;
25
+ }): number | undefined;
16
26
  /** Smart-HTTP clone base (aligned with PLA-83: `…/repos/<id>/git`). */
17
27
  export declare function cloneUrl(ctx: CommandContext, repoId: string): string;
18
28
  /**
@@ -96,6 +106,6 @@ export declare function reposCiRequireCommand(args: ParsedArgs): Promise<number>
96
106
  export declare function reposCiImportCommand(args: ParsedArgs): Promise<number>;
97
107
  export declare function reposCiCommand(args: ParsedArgs): Promise<number>;
98
108
  export declare function reposDeleteCommand(args: ParsedArgs): Promise<number>;
99
- 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 create <ns>/<name> -e <env> [--default-branch b] [--git-backend gcs_isomorphic|walgit]\n create a repo (GCS default, seed README;\n walgit starts empty on main; needs namespace write)\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir]\n smart-HTTP when ATLAS_GIT_PAT is set;\n otherwise JSON materialize (<ns>/<name>)\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 delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview discovered CI checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> reserved (refuses write until sandboxed runner)\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] reserved (refuses write until sandboxed runner)\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone prefers real git clone (PAT via askpass \u2014 never written into the remote\n URL). Without ATLAS_GIT_PAT, <ns>/<name> falls back to the JSON API and prints\n how to get a PAT (seq-studio or Atlas UI /settings/tokens).\n PAT without Auth0 login: use --id from Repositories \u2192 Clone\n (or --url with the environment's canonical HTTPS origin).\n --ref accepts a branch, tag, or commit SHA (SHA \u2192 clone then checkout).\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: ATLAS_GIT_PAT (from Atlas Settings \u2192 Tokens)\n";
109
+ 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 create <ns>/<name> -e <env> [--default-branch b] [--git-backend gcs_isomorphic|walgit]\n create a repo (GCS default, seed README;\n walgit starts empty on main; needs namespace write)\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full]\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 smart-HTTP when ATLAS_GIT_PAT is set;\n otherwise JSON materialize (<ns>/<name>)\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 delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview discovered CI checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> reserved (refuses write until sandboxed runner)\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] reserved (refuses write until sandboxed runner)\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone prefers real git clone (PAT via askpass \u2014 never written into the remote\n URL). Without ATLAS_GIT_PAT, <ns>/<name> falls back to the JSON API and prints\n how to get a PAT (seq-studio or Atlas UI /settings/tokens).\n PAT without Auth0 login: use --id from Repositories \u2192 Clone\n (or --url with the environment's canonical HTTPS origin).\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: ATLAS_GIT_PAT (from Atlas Settings \u2192 Tokens)\n";
100
110
  export declare function runReposCommand(sub: string | undefined, args: ParsedArgs): Promise<number>;
101
111
  export {};
@@ -22,7 +22,7 @@ import { printCliError } from '../cli-errors.js';
22
22
  import { PREVIEW_DOMAIN } from '../preview.js';
23
23
  import { confirmYes } from '../prompt.js';
24
24
  import { buildContext, clientOptions, flagBool, LOG, } from '../functions/commands.js';
25
- import { resolveGitPatFromEnv, runGitClone, } from './git-clone.js';
25
+ import { looksLikeCommitSha, resolveGitPatFromEnv, runGitClone, } from './git-clone.js';
26
26
  import { formatPatSetupHint } from '../pat-hints.js';
27
27
  import { tryGetAccessToken } from '../auth.js';
28
28
  import { resolveEnvWithDiscovery } from '../config.js';
@@ -52,6 +52,19 @@ export function stringFlag(flags, key) {
52
52
  throw new Error(`--${key} requires a value.`);
53
53
  return value;
54
54
  }
55
+ /**
56
+ * Branch and tag clones fetch one commit. A full history walk reads every
57
+ * object out of git-service storage before the pack starts. Commit SHAs
58
+ * stay full so the following checkout can see that object. `--full` opts
59
+ * back into history.
60
+ */
61
+ export function smartHttpCloneDepth({ ref, full, }) {
62
+ if (full)
63
+ return undefined;
64
+ if (ref != null && looksLikeCommitSha(ref))
65
+ return undefined;
66
+ return 1;
67
+ }
55
68
  /**
56
69
  * buildContext for repos commands: rejects a valueless -e/--env (which would
57
70
  * silently fall back to the default environment — dangerous with `delete
@@ -341,7 +354,9 @@ export async function reposPullCommand(args) {
341
354
  */
342
355
  export async function reposCloneCommand(args, deps = {}) {
343
356
  const force = flagBool(args.flags, 'force');
357
+ const full = flagBool(args.flags, 'full');
344
358
  const ref = stringFlag(args.flags, 'ref');
359
+ const depth = smartHttpCloneDepth({ ref, full });
345
360
  const outputFlag = stringFlag(args.flags, 'output');
346
361
  const outFlag = stringFlag(args.flags, 'out');
347
362
  if (outputFlag !== undefined && outFlag !== undefined) {
@@ -381,16 +396,17 @@ export async function reposCloneCommand(args, deps = {}) {
381
396
  destDir,
382
397
  pat,
383
398
  ...(ref ? { ref } : {}),
399
+ ...(depth != null ? { depth } : {}),
384
400
  });
385
401
  console.log(`${LOG} cloned ${targetUrl} → ${destDir}` +
386
402
  (ref ? ` (ref ${ref})` : '') +
387
- ` via smart-HTTP`);
403
+ ` via smart-HTTP${depth != null ? ` (depth ${depth})` : ''}`);
388
404
  return 0;
389
405
  }
390
406
  // <ns>/<name> path — needs Auth0 for resolveRepo (JSON API) whether or not
391
407
  // we then use smart-HTTP. Without Auth0, point users at --url from the UI.
392
408
  if (!positional) {
393
- console.error('usage: seq-studio repos clone <ns>/<name> | --url <clone-url> | --id <uuid> -e <env> [--ref r] [--output dir]');
409
+ console.error('usage: seq-studio repos clone <ns>/<name> | --url <clone-url> | --id <uuid> -e <env> [--ref r] [--output dir] [--full]');
394
410
  return 1;
395
411
  }
396
412
  const { namespace, name } = parseRepoPath(positional);
@@ -423,10 +439,11 @@ export async function reposCloneCommand(args, deps = {}) {
423
439
  destDir,
424
440
  pat,
425
441
  ...(ref ? { ref } : {}),
442
+ ...(depth != null ? { depth } : {}),
426
443
  });
427
444
  console.log(`${LOG} cloned ${namespace}/${name} → ${destDir}` +
428
445
  (ref ? ` (ref ${ref})` : '') +
429
- ` via smart-HTTP`);
446
+ ` via smart-HTTP${depth != null ? ` (depth ${depth})` : ''}`);
430
447
  return 0;
431
448
  }
432
449
  assertDestWritable({ destDir, force });
@@ -781,9 +798,9 @@ export const REPOS_USAGE = `usage:
781
798
  seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend gcs_isomorphic|walgit]
782
799
  create a repo (GCS default, seed README;
783
800
  walgit starts empty on main; needs namespace write)
784
- seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force]
785
- seq-studio repos clone --url <https://…/repos/<id>/git> -e <env> [--ref r] [--output dir]
786
- seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir]
801
+ seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full]
802
+ seq-studio repos clone --url <https://…/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]
803
+ seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]
787
804
  smart-HTTP when ATLAS_GIT_PAT is set;
788
805
  otherwise JSON materialize (<ns>/<name>)
789
806
  seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]
@@ -800,7 +817,8 @@ export const REPOS_USAGE = `usage:
800
817
  how to get a PAT (seq-studio or Atlas UI /settings/tokens).
801
818
  PAT without Auth0 login: use --id from Repositories → Clone
802
819
  (or --url with the environment's canonical HTTPS origin).
803
- --ref accepts a branch, tag, or commit SHA (SHA → clone then checkout).
820
+ --ref accepts a branch, tag, or commit SHA (SHA → full clone, then checkout).
821
+ Branch and tag clones are shallow (--depth 1). Pass --full for history.
804
822
  --output selects the clone directory (--out remains an alias).
805
823
 
806
824
  Authenticate JSON API calls with: seq-studio login
@@ -19,5 +19,6 @@ minimumReleaseAgeExclude:
19
19
  - '@sequenceholdings/storage'
20
20
  - '@sequenceholdings/artifact-studio'
21
21
  - '@sequenceholdings/lattice'
22
+ - '@sequenceholdings/orm'
22
23
  - '@sequenceholdings/managed-functions'
23
24
  - '@sequenceholdings/studio-cli'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenceholdings/studio-cli",
3
- "version": "0.1.35",
3
+ "version": "0.2.1",
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 pat`. Includes Auth0 browser login shared with seqapi.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -42,14 +42,14 @@
42
42
  "tsx": "^4.20.3",
43
43
  "zod": "^4.1.13",
44
44
  "@sequenceholdings/agent-spec": "0.1.2",
45
- "@sequenceholdings/artifact-studio": "0.2.6",
46
- "@sequenceholdings/lattice": "0.1.3",
45
+ "@sequenceholdings/artifact-studio": "0.3.0",
46
+ "@sequenceholdings/lattice": "0.1.4",
47
47
  "@sequenceholdings/managed-functions": "0.1.1",
48
48
  "@sequenceholdings/storage": "0.1.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "@sequenceholdings/pipeline-spec": "0.1.0",
52
- "@sequenceholdings/orm": "2.1.0"
51
+ "@sequenceholdings/orm": "2.1.0",
52
+ "@sequenceholdings/pipeline-spec": "0.1.0"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@sequenceholdings/orm": {
@@ -19,5 +19,6 @@ minimumReleaseAgeExclude:
19
19
  - '@sequenceholdings/storage'
20
20
  - '@sequenceholdings/artifact-studio'
21
21
  - '@sequenceholdings/lattice'
22
+ - '@sequenceholdings/orm'
22
23
  - '@sequenceholdings/managed-functions'
23
24
  - '@sequenceholdings/studio-cli'