@sequenceholdings/studio-cli 0.5.2 → 0.5.4

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
@@ -194,8 +194,9 @@ locations, dependencies, and deployment selection.
194
194
 
195
195
  `init` accepts `orm`, `workspace`, `function`, `agent`, `process`, `pipeline`, and `artifact` as
196
196
  a comma-separated `--with` list or boolean flags (`--agent --process`). With no
197
- kind flags it scaffolds `orm,function,process,artifact`, the kinds repository
198
- CI/CD creates and deploys on merge. `--skip-install` skips the install and
197
+ kind flags it scaffolds `orm,function,process,artifact`. Repository CI/CD
198
+ creates and deploys those, workspaces, pipelines and agents on merge (see
199
+ [What a merge deploys](#what-a-merge-deploys)). `--skip-install` skips the install and
199
200
  migration step (offline). The first
200
201
  function defaults to `hello` (`--function-name` changes it). Agent, process, and
201
202
  pipeline folders use the app name. Pipelines default to transformation stages;
@@ -585,16 +586,37 @@ bundle; it never implicitly deletes agents.
585
586
  |---------|--------------|
586
587
  | `seq-studio agents init <dir>` | Scaffold a standalone typed agent repository |
587
588
  | `seq-studio agents validate [--dir <dir>] [--target <APP_ENV>] [--only <id1,id2>]` | Compile and validate locally, without API access |
589
+ | `seq-studio agents bundle --out <file> [--dir <dir>] [--target <APP_ENV>] [--only <id1,id2>]` | Write the config deploy body, `{ definitions, bundleHash }`, offline; repository CI's agent build |
588
590
  | `seq-studio agents plan [--dir <dir>] [--only <id1,id2>]` | Offline compile/hash plan |
589
- | `seq-studio agents plan [--dir <dir>] -e <env> [--target <APP_ENV>] [--only <id1,id2>]` | Diff creates, updates, and unchanged definitions against an environment |
590
- | `seq-studio agents apply [--dir <dir>] -e <env> [--target <APP_ENV>] [--only <id1,id2>] [--yes]` | Apply creates and updates after showing the plan |
591
+ | `seq-studio agents plan [--dir <dir>] -e <env> [--target <APP_ENV>] [--only <id1,id2>] [--managed]` | Diff creates, updates, and unchanged definitions against an environment |
592
+ | `seq-studio agents apply [--dir <dir>] -e <env> [--target <APP_ENV>] [--only <id1,id2>] [--yes] [--managed]` | Deploy agent configuration after showing the plan |
591
593
  | `seq-studio agents list -e <env>` | List visible runtime agents |
592
594
  | `seq-studio agents show <id> -e <env>` | Show one runtime agent |
593
595
 
594
- For `validate`, `plan`, and `apply`, `--only` accepts a comma-separated list of
596
+ For `validate`, `bundle`, `plan`, and `apply`, `--only` accepts a comma-separated list of
595
597
  agent IDs after deployment-environment selection; every requested ID must be
596
598
  selected.
597
599
 
600
+ **Access is managed in Atlas, not in code.** `seq-studio agents plan`/`apply`
601
+ and `seq-studio deploy` deploy agents config-only, as you, with the same rules
602
+ as an Agent Builder save:
603
+
604
+ - A new agent needs **Can create** on Agent Builder; you become its owner and
605
+ it starts unshared.
606
+ - An existing agent needs **editor** on it.
607
+ - The skills, MCP servers, Managed Functions and subagents it attaches must be
608
+ ones you may use, the same checks Agent Builder runs.
609
+ - The deploy never changes who can use the agent. Grant access in Agent Builder
610
+ or through the API. A definition that sets `permissions`, `isPublic` or
611
+ `publicOutputs` is refused.
612
+
613
+ A merge deploys an agent the same way, as the person who merged, when its
614
+ `sequence.app.yml` entry names exactly one agent with `only: [<agent id>]`
615
+ (`seq-studio add agent` writes it). See [What a merge deploys](#what-a-merge-deploys).
616
+
617
+ `--managed` selects the Sequence-staff path for Sequence's own code-managed
618
+ agents, whose definitions own their access as well.
619
+
598
620
  An optional `deploy-manifest.json` targets definitions by deployment identity:
599
621
 
600
622
  ```json
@@ -624,6 +646,9 @@ pnpm exec seq-studio agents plan -e <env>
624
646
  pnpm exec seq-studio agents apply -e <env>
625
647
  ```
626
648
 
649
+ Sequence staff deploying Sequence's own code-managed agents add `--managed` to
650
+ `plan` and `apply`.
651
+
627
652
  Use `--repo agents/<name> [--ref <ref>]` or `--git-url <url>` instead of
628
653
  `--dir` to materialize reviewed source from the platform git service.
629
654
 
@@ -952,6 +977,10 @@ environment, credentials, or `managed-function.yml`.
952
977
  | `seq-studio functions limits [-e <env>] [--json] [--fn <slug>]` | Inspect fleet, runtime, cache, and bundle defaults/caps; optionally inspect one function's effective runtime limits |
953
978
  | `seq-studio functions invoke --fn <slug> -e <env> [--data <json> \| --data @<file> \| --stdin]` | Invoke a deployed function and print its response body |
954
979
 
980
+ `functions deploy` picks the next `vN` after the highest numbered version of
981
+ that function. Versions named by repository CI, such as `ci-abc`, do not reset
982
+ the sequence. A function with no numbered versions starts at `v1`.
983
+
955
984
  A normal function repo keeps `managed-function.yml` at its root and omits
956
985
  `--path`. A repo may also contain related, independently deployed functions:
957
986
 
@@ -1631,7 +1660,7 @@ JSON API — the same repos `--repo <ns>/<name>` sources build from.
1631
1660
  | `seq-studio repos delete <ns>/<name> -e <env> [--yes]` | delete a repo — interactive confirm unless `--yes` |
1632
1661
  | `seq-studio repos ci init [--dir <repository>]` | create `.seq/pipeline.yml` with native defaults; offline, preserves existing configuration |
1633
1662
  | `seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json]` | inspect the server's discovered pipeline, exact plan and recent runs; JSON retains the complete status response |
1634
- | `seq-studio repos ci show <ns>/<name> -e <env> [--ref <r>]` | preview pipeline discovery or legacy checks at a ref |
1663
+ | `seq-studio repos ci show <ns>/<name> -e <env> [--ref <r>]` | preview legacy discovery at a ref; an empty result does not establish that the server plan has no targets, checks, or findings. Open or update a PR and use `--pr <number>` for the authoritative plan. |
1635
1664
  | `seq-studio repos ci require <ns>/<name> --check <name> -e <env>` | disabled legacy required-check control; use native pipeline discovery |
1636
1665
  | `seq-studio repos ci import <ns>/<name> -e <env> [--ref <r>]` | disabled legacy required-check control; use native pipeline discovery |
1637
1666
 
@@ -1689,6 +1718,50 @@ the old file in one commit. Both files together, invalid syntax and duplicate
1689
1718
  YAML keys fail planning. Empty native `targets` means use discovered inventory
1690
1719
  defaults; it does not disable required checks.
1691
1720
 
1721
+ ### What a merge deploys
1722
+
1723
+ On a branch with deploy-on-merge, merging creates what the manifest declares
1724
+ and updates what exists, as the person who merged. Creating needs **Can create**
1725
+ on that primitive's app, and its creator becomes owner. Updating needs the
1726
+ primitive's deploy tier, editor or writer. A merge only creates brand-new
1727
+ names. An existing resource the repository doesn't control yet stays a
1728
+ repository admin's binding in Settings → CI.
1729
+
1730
+ | Kind | Created on merge with | Updated on merge with | Notes |
1731
+ | --- | --- | --- | --- |
1732
+ | ORM namespace | Can create on ORM | writer | Destructive migrations stop for a person |
1733
+ | Function | Can create on Managed Functions | editor | |
1734
+ | Artifact (static or Next.js) | Can create on Artifact Studio | writer | |
1735
+ | Lattice process | Lattice authoring | editor | One process per primitive (`only: [<id>]`) |
1736
+ | Workspace | Can create on Workspaces V2 | editor | Only its name and description; access stays its own sharing |
1737
+ | Managed pipeline | Can create on Pipelines and Writer on the repository | editor | Plans then deploys the merge commit; destructive plans stop for a person |
1738
+ | Agent | Can create on Agent Builder | editor | Configuration only, one agent per entry (`only: [<id>]`); access stays in Agent Builder |
1739
+
1740
+ A workspace has no code, so its only check validates `workspace.yml`. Its
1741
+ Application lists it as a member, but no Application role can include it.
1742
+
1743
+ A pipeline's checks run `seq-studio pipeline validate`. A merge then plans the
1744
+ merge commit and deploys that plan as the merger. On production and BankSouth
1745
+ the merge counts as the deploy approval. A plan that deletes or recreates
1746
+ resources stops there: a Sequence user reviews and deploys it in Pipelines,
1747
+ then retries the merge's deployment. The pipeline is released under this
1748
+ repository: `<namespace>/<name>@<path>`, or the bare name for a `pipelines/*`
1749
+ repository holding it at its root. A pipeline whose `repo:` names another
1750
+ repository is deployed by that repository's CI. Pipelines bound to the
1751
+ Relationships namespace need a signed-in session, so they still deploy with
1752
+ `seq-studio pipeline deploy`.
1753
+
1754
+ An agent's build runs `seq-studio agents bundle` for exactly the agent its
1755
+ entry names, compiled for the destination environment; Atlas then runs the
1756
+ same config deploy as `seq-studio deploy`, with Agent Builder's save checks.
1757
+ It never changes who can use the agent, and refuses `permissions`, `isPublic`
1758
+ or `publicOutputs` in code. The repository binds that agent id on its first
1759
+ merge, so no other repository's merge can write it. An agent entry that names
1760
+ no single agent still deploys with `seq-studio deploy`.
1761
+
1762
+ Secrets and service accounts are created through their own commands, never by
1763
+ a merge.
1764
+
1692
1765
  In a multi-application repository, scope CI with `.seq/repository.yml`: list the
1693
1766
  checked `applications:` and put every other deployable path under `ignore:`.
1694
1767
  Repository CI never checks or deploys ignored paths, and they may not overlap a
@@ -6,8 +6,12 @@ export interface ApplySummary {
6
6
  unchanged: number;
7
7
  }
8
8
  /** Each chunk is hashed over its own definitions — the apply route validates the body it received. */
9
- export declare function applyInChunks({ context, definitions, source, }: {
9
+ export declare function applyInChunks({ context, definitions, source, path, chunkSize, }: {
10
10
  context: CommandContext;
11
11
  definitions: AgentDefinition[];
12
12
  source: string;
13
+ /** The apply route: code-managed or config-only. */
14
+ path: string;
15
+ /** Definitions per request. */
16
+ chunkSize?: number;
13
17
  }): Promise<ApplySummary>;
@@ -5,10 +5,10 @@ const LOG = '[seq-studio]';
5
5
  // Chunked to stay inside the HTTP client's timeout; each agent commits independently anyway.
6
6
  const APPLY_CHUNK_SIZE = 20;
7
7
  /** Each chunk is hashed over its own definitions — the apply route validates the body it received. */
8
- export async function applyInChunks({ context, definitions, source, }) {
8
+ export async function applyInChunks({ context, definitions, source, path, chunkSize = APPLY_CHUNK_SIZE, }) {
9
9
  const chunks = [];
10
- for (let i = 0; i < definitions.length; i += APPLY_CHUNK_SIZE) {
11
- chunks.push(definitions.slice(i, i + APPLY_CHUNK_SIZE));
10
+ for (let i = 0; i < definitions.length; i += chunkSize) {
11
+ chunks.push(definitions.slice(i, i + chunkSize));
12
12
  }
13
13
  const total = { created: 0, updated: 0, unchanged: 0 };
14
14
  let applied = 0;
@@ -16,7 +16,7 @@ export async function applyInChunks({ context, definitions, source, }) {
16
16
  try {
17
17
  const result = await postJson({
18
18
  ...clientOptions(context),
19
- path: '/api/agents/deploy/apply',
19
+ path,
20
20
  body: {
21
21
  definitions: chunk,
22
22
  bundleHash: hashAgentBundle({ definitions: chunk }),
@@ -0,0 +1,8 @@
1
+ import type { ParsedArgs } from '../process/commands.js';
2
+ /**
3
+ * Compile agent definitions, offline, into the body a config deploy accepts:
4
+ * `{ definitions, bundleHash }`. Repository CI runs this as an agent's build,
5
+ * then Atlas deploys exactly these bytes. Like validate, it parses agent.ts as
6
+ * data and never executes it.
7
+ */
8
+ export declare function agentsBundleCommand(args: ParsedArgs): Promise<number>;
@@ -0,0 +1,38 @@
1
+ import { writeFile } from 'node:fs/promises';
2
+ import { resolve } from 'node:path';
3
+ import { deployEnvironmentNames } from './commands.js';
4
+ import { requestedAgentIds } from './selection.js';
5
+ import { compileAgentSource, materializeAgentSource } from './source.js';
6
+ const LOG = '[seq-studio]';
7
+ /**
8
+ * Compile agent definitions, offline, into the body a config deploy accepts:
9
+ * `{ definitions, bundleHash }`. Repository CI runs this as an agent's build,
10
+ * then Atlas deploys exactly these bytes. Like validate, it parses agent.ts as
11
+ * data and never executes it.
12
+ */
13
+ export async function agentsBundleCommand(args) {
14
+ const out = typeof args.flags.out === 'string' ? args.flags.out : undefined;
15
+ if (!out) {
16
+ console.error(`${LOG} --out <file> is required`);
17
+ return 1;
18
+ }
19
+ const { source } = await materializeAgentSource({ args, requireEnvironment: false });
20
+ try {
21
+ const bundle = await compileAgentSource({
22
+ directory: source.dir,
23
+ targetEnvironment: typeof args.flags.target === 'string' ? args.flags.target : undefined,
24
+ deployEnvironments: await deployEnvironmentNames(),
25
+ onlyIds: requestedAgentIds(args),
26
+ });
27
+ if (bundle.definitions.length === 0) {
28
+ console.error(`${LOG} no named agent.ts definitions found`);
29
+ return 1;
30
+ }
31
+ await writeFile(resolve(out), `${JSON.stringify({ definitions: bundle.definitions, bundleHash: bundle.hash }, null, 2)}\n`);
32
+ console.log(`${LOG} bundled ${bundle.definitions.length} definition${bundle.definitions.length === 1 ? '' : 's'} to ${out}, bundle ${bundle.hash}`);
33
+ return 0;
34
+ }
35
+ finally {
36
+ await source.cleanup();
37
+ }
38
+ }
@@ -1,10 +1,24 @@
1
1
  import type { ParsedArgs } from '../process/commands.js';
2
2
  import { agentsInitCommand } from './scaffold.js';
3
3
  export { agentsInitCommand };
4
+ /**
5
+ * How a deploy treats an agent's access. `managed` is Sequence's code-managed
6
+ * path: the definition owns access, and only Sequence staff may use it.
7
+ * `config` deploys configuration only, as the caller, with the tiers Agent
8
+ * Builder uses; access stays whatever the UI or API set.
9
+ */
10
+ export type AgentDeployMode = 'managed' | 'config';
4
11
  export declare function agentsValidateCommand(args: ParsedArgs): Promise<number>;
12
+ /**
13
+ * Names the CLI can actually deploy to. A target outside both this set and the
14
+ * manifest's own vocabulary is a typo, not a selection.
15
+ */
16
+ export declare function deployEnvironmentNames(): Promise<string[]>;
5
17
  export declare function agentsPlanCommand(args: ParsedArgs): Promise<number>;
6
- export declare function agentsApplyCommand(args: ParsedArgs): Promise<number>;
18
+ export declare function agentsApplyCommand(args: ParsedArgs, { mode }?: {
19
+ mode?: AgentDeployMode;
20
+ }): Promise<number>;
7
21
  export declare function agentsListCommand(args: ParsedArgs): Promise<number>;
8
22
  export declare function agentsShowCommand(args: ParsedArgs): Promise<number>;
9
- export declare const AGENTS_USAGE = "usage:\n seq-studio agents init <dir> scaffold a typed agent\n seq-studio agents validate [--dir d] [--target app] [--only ids] offline compile + validation\n seq-studio agents plan [--dir d] [-e <env>] [--only ids] offline bundle plan or live diff\n seq-studio agents apply [--dir d] -e <env> [--only ids] [--yes] apply creates/updates; never deletes\n seq-studio agents list -e <env> list visible agents\n seq-studio agents show <id> -e <env> show one agent\n seq-studio agents voice help internal Voice authoring/publication\n\n Source: local --dir (default .), --repo agents/<name>, or --git-url <url>.\n Use --ref for remote sources. --target selects the deployment APP_ENV when it\n differs from the CLI environment alias (notably OpCo registrations). --only\n accepts a comma-separated list of agent IDs after environment selection.\n";
23
+ export declare const AGENTS_USAGE = "usage:\n seq-studio agents init <dir> scaffold a typed agent\n seq-studio agents validate [--dir d] [--target app] [--only ids] offline compile + validation\n seq-studio agents bundle --out <file> [--dir d] [--target app] [--only ids] offline deploy body { definitions, bundleHash }\n seq-studio agents plan [--dir d] [-e <env>] [--only ids] [--managed] offline bundle plan or live diff\n seq-studio agents apply [--dir d] -e <env> [--only ids] [--yes] [--managed] apply creates/updates; never deletes\n seq-studio agents list -e <env> list visible agents\n seq-studio agents show <id> -e <env> show one agent\n seq-studio agents voice help internal Voice authoring/publication\n\n plan and apply deploy configuration only, as you: a new agent needs Can\n create on Agent Builder, an existing one needs editor, and access stays\n whatever Agent Builder or the API set. --managed is Sequence's code-managed\n path, where the definition also owns access; it is limited to Sequence staff.\n\n Source: local --dir (default .), --repo agents/<name>, or --git-url <url>.\n Use --ref for remote sources. --target selects the deployment APP_ENV when it\n differs from the CLI environment alias (notably OpCo registrations). --only\n accepts a comma-separated list of agent IDs after environment selection.\n";
10
24
  export declare function runAgentsCommand(sub: string | undefined, args: ParsedArgs): Promise<number>;
@@ -6,23 +6,16 @@ import { confirmYes } from '../prompt.js';
6
6
  import { buildContext, clientOptions, flagBool, printError, requestedEnvironment, } from '../functions/commands.js';
7
7
  import { compileAgentSource as compileSource, materializeAgentSource as materialize, } from './source.js';
8
8
  import { agentsInitCommand } from './scaffold.js';
9
+ import { requestedAgentIds } from './selection.js';
9
10
  export { agentsInitCommand };
10
11
  const LOG = '[seq-studio]';
11
- function requestedAgentIds(args) {
12
- const only = args.flags.only;
13
- if (only === undefined)
14
- return undefined;
15
- if (typeof only !== 'string') {
16
- throw new Error('--only must be a comma-separated list of agent IDs');
17
- }
18
- const ids = only
19
- .split(',')
20
- .map((id) => id.trim())
21
- .filter(Boolean);
22
- if (ids.length === 0) {
23
- throw new Error('--only must include at least one agent ID');
24
- }
25
- return [...new Set(ids)];
12
+ const DEPLOY_ROUTES = {
13
+ managed: { plan: '/api/agents/deploy/plan', apply: '/api/agents/deploy/apply' },
14
+ config: { plan: '/api/agents/deploy/config/plan', apply: '/api/agents/deploy/config/apply' },
15
+ };
16
+ /** Config deploys by default; `--managed` selects Sequence's code-managed path. */
17
+ function requestedDeployMode(args) {
18
+ return flagBool(args.flags, 'managed') ? 'managed' : 'config';
26
19
  }
27
20
  export async function agentsValidateCommand(args) {
28
21
  const { source } = await materialize({ args, requireEnvironment: false });
@@ -59,7 +52,7 @@ async function deploymentBundle({ args, source, context, }) {
59
52
  * Names the CLI can actually deploy to. A target outside both this set and the
60
53
  * manifest's own vocabulary is a typo, not a selection.
61
54
  */
62
- async function deployEnvironmentNames() {
55
+ export async function deployEnvironmentNames() {
63
56
  try {
64
57
  return Object.keys((await readConfig()).envs);
65
58
  }
@@ -114,7 +107,7 @@ export async function agentsPlanCommand(args) {
114
107
  const bundle = await deploymentBundle({ args, source, context });
115
108
  const plan = await postJson({
116
109
  ...clientOptions(context),
117
- path: '/api/agents/deploy/plan',
110
+ path: DEPLOY_ROUTES[requestedDeployMode(args)].plan,
118
111
  body: {
119
112
  definitions: bundle.definitions,
120
113
  bundleHash: bundle.hash,
@@ -128,7 +121,8 @@ export async function agentsPlanCommand(args) {
128
121
  await source.cleanup();
129
122
  }
130
123
  }
131
- export async function agentsApplyCommand(args) {
124
+ export async function agentsApplyCommand(args, { mode = requestedDeployMode(args) } = {}) {
125
+ const routes = DEPLOY_ROUTES[mode];
132
126
  const { source, context } = await materialize({
133
127
  args,
134
128
  requireEnvironment: true,
@@ -139,7 +133,7 @@ export async function agentsApplyCommand(args) {
139
133
  const bundle = await deploymentBundle({ args, source, context });
140
134
  const plan = await postJson({
141
135
  ...clientOptions(context),
142
- path: '/api/agents/deploy/plan',
136
+ path: routes.plan,
143
137
  body: {
144
138
  definitions: bundle.definitions,
145
139
  bundleHash: bundle.hash,
@@ -151,6 +145,7 @@ export async function agentsApplyCommand(args) {
151
145
  `${LOG} apply ${bundle.definitions.length} agent definitions to ${context.env.name}`,
152
146
  `${LOG} bundle ${bundle.hash}`,
153
147
  `${LOG} no agents will be deleted`,
148
+ ...(mode === 'config' ? [`${LOG} access is managed in the UI or API; this deploy leaves it unchanged`] : []),
154
149
  ];
155
150
  if (!(await confirmYes({ preview, confirmed: flagBool(args.flags, 'yes') }))) {
156
151
  return 1;
@@ -159,6 +154,10 @@ export async function agentsApplyCommand(args) {
159
154
  context,
160
155
  definitions: bundle.definitions,
161
156
  source: source.provenance.gitCommit ?? 'local',
157
+ path: routes.apply,
158
+ // The server checks a config deploy as one bundle (agents it creates may
159
+ // name each other), so it must arrive whole, as plan saw it.
160
+ ...(mode === 'config' ? { chunkSize: Math.max(bundle.definitions.length, 1) } : {}),
162
161
  });
163
162
  console.log(`${LOG} applied: ${summary.created} created, ${summary.updated} updated, ${summary.unchanged} unchanged`);
164
163
  return 0;
@@ -195,12 +194,18 @@ export async function agentsShowCommand(args) {
195
194
  export const AGENTS_USAGE = `usage:
196
195
  seq-studio agents init <dir> scaffold a typed agent
197
196
  seq-studio agents validate [--dir d] [--target app] [--only ids] offline compile + validation
198
- seq-studio agents plan [--dir d] [-e <env>] [--only ids] offline bundle plan or live diff
199
- seq-studio agents apply [--dir d] -e <env> [--only ids] [--yes] apply creates/updates; never deletes
197
+ seq-studio agents bundle --out <file> [--dir d] [--target app] [--only ids] offline deploy body { definitions, bundleHash }
198
+ seq-studio agents plan [--dir d] [-e <env>] [--only ids] [--managed] offline bundle plan or live diff
199
+ seq-studio agents apply [--dir d] -e <env> [--only ids] [--yes] [--managed] apply creates/updates; never deletes
200
200
  seq-studio agents list -e <env> list visible agents
201
201
  seq-studio agents show <id> -e <env> show one agent
202
202
  seq-studio agents voice help internal Voice authoring/publication
203
203
 
204
+ plan and apply deploy configuration only, as you: a new agent needs Can
205
+ create on Agent Builder, an existing one needs editor, and access stays
206
+ whatever Agent Builder or the API set. --managed is Sequence's code-managed
207
+ path, where the definition also owns access; it is limited to Sequence staff.
208
+
204
209
  Source: local --dir (default .), --repo agents/<name>, or --git-url <url>.
205
210
  Use --ref for remote sources. --target selects the deployment APP_ENV when it
206
211
  differs from the CLI environment alias (notably OpCo registrations). --only
@@ -223,6 +228,8 @@ export async function runAgentsCommand(sub, args) {
223
228
  return await agentsInitCommand(args);
224
229
  case 'validate':
225
230
  return await agentsValidateCommand(args);
231
+ case 'bundle':
232
+ return await (await import('./bundle.js')).agentsBundleCommand(args);
226
233
  case 'plan':
227
234
  return await agentsPlanCommand(args);
228
235
  case 'apply':
@@ -0,0 +1,3 @@
1
+ import type { ParsedArgs } from '../process/commands.js';
2
+ /** The agent IDs `--only` selects, after deployment-environment selection; undefined selects every one. */
3
+ export declare function requestedAgentIds(args: ParsedArgs): string[] | undefined;
@@ -0,0 +1,17 @@
1
+ /** The agent IDs `--only` selects, after deployment-environment selection; undefined selects every one. */
2
+ export function requestedAgentIds(args) {
3
+ const only = args.flags.only;
4
+ if (only === undefined)
5
+ return undefined;
6
+ if (typeof only !== 'string') {
7
+ throw new Error('--only must be a comma-separated list of agent IDs');
8
+ }
9
+ const ids = only
10
+ .split(',')
11
+ .map((id) => id.trim())
12
+ .filter(Boolean);
13
+ if (ids.length === 0) {
14
+ throw new Error('--only must include at least one agent ID');
15
+ }
16
+ return [...new Set(ids)];
17
+ }
@@ -182,9 +182,11 @@ export async function createDefaultDeployers() {
182
182
  return functionsDeployCommand({ positional: [], flags: { dir: path, env, ...(yes ? { yes: true } : {}) } });
183
183
  },
184
184
  async agent(args) {
185
+ // An app's agents deploy their configuration only; access is managed in
186
+ // the UI or API, never overwritten from code.
185
187
  return agentsApplyCommand({ positional: [], flags: {
186
188
  dir: args.path, env: args.env, ...selectedFlags(args), ...(args.yes ? { yes: true } : {}),
187
- } });
189
+ } }, { mode: 'config' });
188
190
  },
189
191
  async process(args) {
190
192
  return applyCommand({ positional: [], flags: { dir: args.path, env: args.env, ...selectedFlags(args) } });
@@ -18,7 +18,7 @@
18
18
  import { type ClientOptions } from '../atlas-client.js';
19
19
  import { type ApplicationSuggestion, type SharedAgentEntry } from './application-suggestions.js';
20
20
  import { type AppManifest, type PrimitiveEntry } from './manifest.js';
21
- type MemberKind = 'artifact' | 'function' | 'orm' | 'lattice' | 'pipeline' | 'agent' | 'secret' | 'service_account';
21
+ type MemberKind = 'artifact' | 'function' | 'orm' | 'lattice' | 'pipeline' | 'agent' | 'secret' | 'service_account' | 'workspace';
22
22
  export interface ApplicationDeployMember {
23
23
  key: string;
24
24
  kind: MemberKind;
@@ -25,7 +25,8 @@ const LOG = '[seq-studio]';
25
25
  * The member ref Atlas resolves: project slug, function slug, namespace, a
26
26
  * pipeline's release unit, or — for a process entry that deploys exactly one
27
27
  * process — its process id, or — for an agent entry that deploys exactly one
28
- * agent — that agent's id here.
28
+ * agent — that agent's id here. A workspace is its name; it is a member no
29
+ * Application role can include.
29
30
  */
30
31
  function memberOf(entry, agentRefs) {
31
32
  const agentId = entry.kind === 'agent' ? agentRefs.get(entry.id) : undefined;
@@ -37,6 +38,8 @@ function memberOf(entry, agentRefs) {
37
38
  return { key: entry.id, kind: 'function', ref: entry.slug };
38
39
  if (entry.kind === 'orm' && entry.namespace)
39
40
  return { key: entry.id, kind: 'orm', ref: entry.namespace };
41
+ if (entry.kind === 'workspace' && entry.name)
42
+ return { key: entry.id, kind: 'workspace', ref: entry.name };
40
43
  const releaseUnit = entry.kind === 'pipeline' ? pipelineReleaseUnit(entry) : undefined;
41
44
  if (releaseUnit)
42
45
  return { key: entry.id, kind: 'pipeline', ref: releaseUnit };
@@ -123,7 +126,7 @@ function asRecord(value) {
123
126
  return value && typeof value === 'object' ? Object.fromEntries(Object.entries(value)) : {};
124
127
  }
125
128
  const isString = (value) => typeof value === 'string';
126
- const MEMBER_KINDS = ['artifact', 'function', 'orm', 'lattice', 'pipeline', 'agent', 'secret', 'service_account'];
129
+ const MEMBER_KINDS = ['artifact', 'function', 'orm', 'lattice', 'pipeline', 'agent', 'secret', 'service_account', 'workspace'];
127
130
  const isMemberKind = (value) => MEMBER_KINDS.some((kind) => kind === value);
128
131
  const MEMBER_KIND_LABEL = {
129
132
  artifact: 'artifact',
@@ -134,6 +137,7 @@ const MEMBER_KIND_LABEL = {
134
137
  agent: 'agent',
135
138
  secret: 'secret',
136
139
  service_account: 'service account',
140
+ workspace: 'workspace',
137
141
  };
138
142
  /** Server-side detail worth printing beyond the error message. */
139
143
  function errorDetailLines(error) {
@@ -7,7 +7,13 @@
7
7
  import type { ParsedArgs } from '../process/commands.js';
8
8
  export declare const APP_INIT_USAGE: string;
9
9
  export declare const APP_ADD_USAGE: string;
10
- export declare const APP_DEPLOY_USAGE = "usage:\n seq-studio deploy -e <env> [options]\n\n Deploy the app declared in sequence.app.yml. Versions 2 and 3 use\n depends_on prerequisites; deploy.order optionally orders ready primitives.\n Runs each kind's existing command:\n orm \u2192 seq-studio orm apply <path> -e <env>\n function \u2192 seq-studio functions deploy --dir <path> -e <env> [--yes]\n agent \u2192 seq-studio agents apply --dir <path> -e <env> [--yes]\n process \u2192 seq-studio process apply --dir <path> -e <env>\n pipeline \u2192 seq-studio pipeline deploy --repo <repo> --ref <ref> -e <env>\n artifact \u2192 seq-studio artifact deploy <path> -e <env>\n\n Options:\n -e, --env <name> target environment (required)\n --dir <path> app root (default: cwd; must contain sequence.app.yml)\n --only <id1,id2> deploy these ids and their prerequisites (v2)\n --yes non-interactive (forwarded to primitive commands)\n --dry-run validate/compile selected sources without deploying (v2)\n --approved-by <sub> recorded caller approval for protected pipeline targets\n --wait-timeout <d> pipeline polling timeout, e.g. 10m or 2h\n\n Examples:\n seq-studio deploy -e staging --yes\n seq-studio deploy -e local --only get-pokemon --yes\n seq-studio deploy --dir ./pokedex -e staging --dry-run\n\n Run from the app root (directory with sequence.app.yml), or pass --dir.\n Version 1 manifests keep their existing ordering and exact --only behavior.\n Pipelines require repo and ref in their manifest entry.\n ORM namespaces require generated code and a reviewed migration ledger:\n seq-studio orm generate <path> && seq-studio orm diff <path>\n Commit generated migrations before the first deployment and schema changes.\n Pipeline preflight reads the remote source and pins its commit; dry-run\n therefore needs network/auth for pipelines. Version 1 dry-run only lists.\n A dry-run never opens a browser login: without a session it skips the\n workspace-binding check and says so. It warns, rather than fails, when the\n artifact source is not committed and clean on main.\n Version 2 writes the result to .sequence/deployments/<environment>.json.\n";
10
+ export declare const APP_DEPLOY_USAGE = "usage:\n seq-studio deploy -e <env> [options]\n\n Deploy the app declared in sequence.app.yml. Versions 2 and 3 use\n depends_on prerequisites; deploy.order optionally orders ready primitives.\n Runs each kind's existing command:\n orm \u2192 seq-studio orm apply <path> -e <env>\n function \u2192 seq-studio functions deploy --dir <path> -e <env> [--yes]\n agent \u2192 seq-studio agents apply --dir <path> -e <env> [--yes], config-only (access stays in Atlas)\n process \u2192 seq-studio process apply --dir <path> -e <env>\n pipeline \u2192 seq-studio pipeline deploy --repo <repo> --ref <ref> -e <env>\n artifact \u2192 seq-studio artifact deploy <path> -e <env>\n\n Options:\n -e, --env <name> target environment (required)\n --dir <path> app root (default: cwd; must contain sequence.app.yml)\n --only <id1,id2> deploy these ids and their prerequisites (v2)\n --yes non-interactive (forwarded to primitive commands)\n --dry-run validate/compile selected sources without deploying (v2)\n --approved-by <sub> recorded caller approval for protected pipeline targets\n --wait-timeout <d> pipeline polling timeout, e.g. 10m or 2h\n\n Examples:\n seq-studio deploy -e staging --yes\n seq-studio deploy -e local --only get-pokemon --yes\n seq-studio deploy --dir ./pokedex -e staging --dry-run\n\n Run from the app root (directory with sequence.app.yml), or pass --dir.\n Version 1 manifests keep their existing ordering and exact --only behavior.\n Pipelines require repo and ref in their manifest entry.\n ORM namespaces require generated code and a reviewed migration ledger:\n seq-studio orm generate <path> && seq-studio orm diff <path>\n Commit generated migrations before the first deployment and schema changes.\n Pipeline preflight reads the remote source and pins its commit; dry-run\n therefore needs network/auth for pipelines. Version 1 dry-run only lists.\n A dry-run never opens a browser login: without a session it skips the\n workspace-binding check and says so. It warns, rather than fails, when the\n artifact source is not committed and clean on main.\n Version 2 writes the result to .sequence/deployments/<environment>.json.\n";
11
+ /**
12
+ * Hosted Next.js apps deploy only where the deployment runs the Next.js
13
+ * runtime, which not every deployment does yet; the server then refuses with
14
+ * "Next.js applications are not enabled".
15
+ */
16
+ export declare const NEXTJS_RUNTIME_NOTE: string;
11
17
  export declare function runAppInitCommand(args: ParsedArgs): Promise<number>;
12
18
  export declare function runAppAddCommand({ kindArg, args, }: {
13
19
  kindArg: string | undefined;
@@ -90,7 +90,7 @@ export const APP_DEPLOY_USAGE = `usage:
90
90
  Runs each kind's existing command:
91
91
  orm → seq-studio orm apply <path> -e <env>
92
92
  function → seq-studio functions deploy --dir <path> -e <env> [--yes]
93
- agent → seq-studio agents apply --dir <path> -e <env> [--yes]
93
+ agent → seq-studio agents apply --dir <path> -e <env> [--yes], config-only (access stays in Atlas)
94
94
  process → seq-studio process apply --dir <path> -e <env>
95
95
  pipeline → seq-studio pipeline deploy --repo <repo> --ref <ref> -e <env>
96
96
  artifact → seq-studio artifact deploy <path> -e <env>
@@ -138,8 +138,17 @@ function artifactTemplateFlag({ flags, kinds }) {
138
138
  throw new Error('--template requires react-vite or nextjs');
139
139
  if (!kinds.includes('artifact'))
140
140
  throw new Error('--template only applies when scaffolding an artifact');
141
+ if (value === 'nextjs')
142
+ console.warn(NEXTJS_RUNTIME_NOTE);
141
143
  return value;
142
144
  }
145
+ /**
146
+ * Hosted Next.js apps deploy only where the deployment runs the Next.js
147
+ * runtime, which not every deployment does yet; the server then refuses with
148
+ * "Next.js applications are not enabled".
149
+ */
150
+ export const NEXTJS_RUNTIME_NOTE = `${LOG} note: a Next.js app deploys only to a deployment with the Next.js runtime turned on. ` +
151
+ 'Check with your administrator before you build on it; react-vite (the default) deploys everywhere.';
143
152
  function printError(error) {
144
153
  const message = error instanceof Error ? error.message : String(error);
145
154
  console.error(`${LOG} ${message}`);
@@ -110,11 +110,18 @@ export async function scaffoldKind({ kind, appRoot, appId, name, pipelineType =
110
110
  await mkdir(absPath, { recursive: true });
111
111
  await scaffoldArtifact({ absPath, appId: name, template: artifactTemplate });
112
112
  break;
113
- case 'agent':
113
+ case 'agent': {
114
114
  if (await agentsInitCommand(parseArgs([absPath])) !== 0) {
115
115
  throw new Error(`agents init failed for ${absPath}`);
116
116
  }
117
+ // Name the scaffolded agent, as a process entry names its process: CI deploys
118
+ // exactly this agent, and the Application lists it as a member by its id.
119
+ const { compileAgentSource } = await import('../agents/source.js');
120
+ const [definition] = (await compileAgentSource({ directory: absPath })).definitions;
121
+ if (definition)
122
+ entry.only = [definition.id];
117
123
  break;
124
+ }
118
125
  case 'process':
119
126
  if (await processInitCommand(parseArgs([absPath])) !== 0) {
120
127
  throw new Error(`process init failed for ${absPath}`);
@@ -219,7 +219,7 @@ function renderImplementSection({ kinds, functionName, appId }) {
219
219
  if (kinds.has('process'))
220
220
  steps.push(`- **Lattice:** edit \`processes/${appId}/${appId}/process.ts\`; run \`seq-studio process lint --dir processes/${appId} --offline\`.`);
221
221
  if (kinds.has('pipeline'))
222
- steps.push(`- **Pipeline:** complete \`pipelines/${appId}/${appId}.stage.yml\` and its source; run \`seq-studio pipeline validate pipelines/${appId}\`. The template is a transformation stage by default; \`--pipeline-type\` selects ingestion or serving. Pipeline deployment uses a platform git-service release unit: set this primitive's \`repo: pipelines/<repository>\` and \`ref\` in \`sequence.app.yml\`, and commit/push its source to that repository before deployment. A serving template also requires a real producing stage.`);
222
+ steps.push(`- **Pipeline:** complete \`pipelines/${appId}/${appId}.stage.yml\` and its source; run \`seq-studio pipeline validate pipelines/${appId}\`. The template is a transformation stage by default; \`--pipeline-type\` selects ingestion or serving. Pipeline deployment uses a platform git-service release unit: set this primitive's \`repo\` (this app's repository, \`<namespace>/<repository>\`) and \`ref\` in \`sequence.app.yml\`, and commit/push its source to that repository before deployment. A serving template also requires a real producing stage.`);
223
223
  if (kinds.has('artifact'))
224
224
  steps.push(`- **UI:** implement \`artifact/src/App.tsx\` with \`@sequenceholdings/atlas-ui\`; declare capabilities and deployment \`targets\` in \`artifact.bundle.yml\`. Scaffolds are private; set sharing intentionally. Validate with \`seq-studio artifact validate artifact\`.`);
225
225
  return steps.join('\n');
@@ -209,7 +209,7 @@ export function printInitNextSteps({ appRoot, manifest, prepared, }) {
209
209
  printOrmPreparation({ primitives: manifest.primitives });
210
210
  }
211
211
  console.log(' Push a branch and open a PR; checks run automatically, and merging to main publishes the app.');
212
- console.log(` No repository yet? seq-studio repos create artifacts/${manifest.app.id} -e <env>, then push this app to it.`);
212
+ console.log(` No repository yet? seq-studio repos create <namespace>/${manifest.app.id} -e <env> (your team's namespace), then push this app to it.`);
213
213
  console.log(' # add another primitive later:');
214
214
  console.log(' seq-studio add function list-types');
215
215
  console.log(' seq-studio add package contracts');
@@ -40,7 +40,7 @@ export declare const COMMAND_CONTRACT: readonly [{
40
40
  readonly description: "Validate and deploy typed agent definitions";
41
41
  readonly lifecycle: "preview";
42
42
  readonly access: "mixed";
43
- readonly subcommands: readonly ["init", "validate", "plan", "apply", "list", "show"];
43
+ readonly subcommands: readonly ["init", "validate", "bundle", "plan", "apply", "list", "show"];
44
44
  }, {
45
45
  readonly name: "secrets";
46
46
  readonly description: "Manage organization-owned secrets";
@@ -6,7 +6,7 @@ export const COMMAND_CONTRACT = [
6
6
  { name: 'process', description: 'Build and operate Lattice processes', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'lint', 'plan', 'apply', 'test', 'simulate', 'bundle', 'promote', 'pull', 'safety-baseline'] },
7
7
  { name: 'artifact', description: 'Build and operate Artifact Studio apps', lifecycle: 'stable', access: 'mixed', subcommands: ['init', 'whoami', 'link', 'env', 'status', 'list', 'show', 'validate', 'build', 'plan', 'deploy', 'dev', 'promote', 'pull', 'rollback'] },
8
8
  { name: 'functions', description: 'Build and operate Managed Functions', lifecycle: 'stable', access: 'authenticated', subcommands: ['init', 'build', 'deploy', 'list', 'show', 'limits', 'invoke', 'logs', 'promote', 'rollback', 'delete'] },
9
- { name: 'agents', description: 'Validate and deploy typed agent definitions', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'validate', 'plan', 'apply', 'list', 'show'] },
9
+ { name: 'agents', description: 'Validate and deploy typed agent definitions', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'validate', 'bundle', 'plan', 'apply', 'list', 'show'] },
10
10
  { name: 'secrets', description: 'Manage organization-owned secrets', lifecycle: 'stable', access: 'authenticated', subcommands: ['create', 'set', 'list', 'attach', 'detach', 'apply'] },
11
11
  { name: 'repos', description: 'Manage repositories and native CI; ci init is offline', lifecycle: 'stable', access: 'mixed', subcommands: ['list', 'namespaces', 'show', 'create', 'clone', 'pull', 'pulls', 'delete', 'ci'] },
12
12
  { name: 'templates', description: 'Publish, synchronize, and list repository templates', lifecycle: 'internal', access: 'mixed', subcommands: ['publish', 'sync', 'list'] },
@@ -62,7 +62,7 @@ export declare function resolveOrRegisterFunction({ ctx, slug, title, descriptio
62
62
  created: boolean;
63
63
  }>;
64
64
  export declare function functionsRegisterCommand(args: ParsedArgs): Promise<number>;
65
- export declare function predictNextVersion(latest: string | undefined): string;
65
+ export declare function predictNextVersion(versions: readonly string[]): string;
66
66
  /** Prompt on the TTY with echo suppressed — secret values are never displayed. */
67
67
  export declare function promptHidden(question: string): Promise<string>;
68
68
  export declare function printError(error: unknown): void;
@@ -154,9 +154,14 @@ export async function functionsRegisterCommand(args) {
154
154
  console.log(`${LOG} ${created ? 'registered' : 'found'} managed function "${manifest.function.id}" (${fn.id}) on ${ctx.env.name}`);
155
155
  return 0;
156
156
  }
157
- export function predictNextVersion(latest) {
158
- const parsed = latest ? Number.parseInt(latest.replace(/^v/, ''), 10) : 0;
159
- return `v${(Number.isFinite(parsed) ? parsed : 0) + 1}`;
157
+ export function predictNextVersion(versions) {
158
+ const highest = versions.reduce((max, version) => {
159
+ if (!/^v\d+$/.test(version))
160
+ return max;
161
+ const number = Number(version.slice(1));
162
+ return Number.isSafeInteger(number + 1) ? Math.max(max, number) : max;
163
+ }, 0);
164
+ return `v${highest + 1}`;
160
165
  }
161
166
  async function gitMetadata(dir) {
162
167
  try {
@@ -552,8 +557,7 @@ async function deployFromResolvedSource({ args, spec, ctx: earlyCtx, source, })
552
557
  }
553
558
  }
554
559
  }
555
- const latestVersion = versions[0]?.version;
556
- const nextVersion = predictNextVersion(latestVersion);
560
+ const nextVersion = predictNextVersion(versions.map((version) => version.version));
557
561
  const deployMessage = (typeof args.flags.message === 'string' ? args.flags.message : undefined) ??
558
562
  (typeof args.flags.m === 'string' ? args.flags.m : undefined) ??
559
563
  null;
package/dist/main.js CHANGED
@@ -35,7 +35,7 @@ const TOP_LEVEL_USAGE = `usage:
35
35
  seq-studio artifact <sub> [args] init | whoami | link | env | status | list | show | validate | build | plan | deploy | dev | promote | pull | rollback
36
36
  seq-studio functions <sub> [args] init | build | deploy | list | show | limits | invoke | logs | promote | rollback | delete
37
37
  seq-studio storage <sub> [args] init | validate | apply | list | show | mkdir | upload | download | access | trash | restore | purge | operations | abort | delete
38
- seq-studio agents <sub> [args] init | validate | plan | apply | list | show | voice (internal)
38
+ seq-studio agents <sub> [args] init | validate | bundle | plan | apply | list | show | voice (internal)
39
39
  seq-studio secrets <sub> [args] create | set | list | attach | detach | apply
40
40
  seq-studio repos <sub> [args] list | namespaces | show | create | clone | pull | pulls | delete | ci
41
41
  seq-studio templates <sub> [args] publish | sync | list
@@ -56,6 +56,11 @@ const TOP_LEVEL_USAGE = `usage:
56
56
  Where supported, --json writes structured stdout; check exit status and pagination.
57
57
  Built-in env: local. Add your organization's deployment with
58
58
  \`seq-studio envs add <name> <url>\`; custom entries live in ~/.config/lattice/config.toml.
59
+ If this CLI cannot complete a documented step, read that environment's docs
60
+ before trying another tool. \`seq-studio envs list\` prints each environment URL.
61
+ Docs: <url>/docs. Feedback guide: <url>/docs/raw/seq-studio/feedback.md.
62
+ Sequence: https://sequence.seqholdings.com/docs
63
+ and https://sequence.seqholdings.com/docs/raw/seq-studio/feedback.md.
59
64
  `;
60
65
  const PROCESS_USAGE = `usage:
61
66
  seq-studio process init <dir>
@@ -1055,9 +1055,10 @@ export async function doctorCommand(args) {
1055
1055
  if (!offline && env && token) {
1056
1056
  // Hit a writer-gated endpoint with a fake hash so the request
1057
1057
  // either:
1058
- // - 404 NOT_FOUND → writer gate passed (we're a Sequence-org
1059
- // member, the hash just doesn't exist), OR
1060
- // - 403 FORBIDDEN → not a Sequence-org member.
1058
+ // - 404 NOT_FOUND → writer gate passed (this credential may author
1059
+ // Lattice processes; the hash just doesn't exist), OR
1060
+ // - 403 FORBIDDEN → this credential may not author (an untrusted
1061
+ // machine client, or a Sequence account whose membership isn't synced).
1061
1062
  // The GET /processes/:id endpoint uses plain `authenticate` so it
1062
1063
  // cannot distinguish these cases. GET /bundles/:hash is gated by
1063
1064
  // `authenticateLatticeWriter` and is the right probe.
@@ -1073,16 +1074,17 @@ export async function doctorCommand(args) {
1073
1074
  token,
1074
1075
  path: `/api/lattice/bundles/${PROBE_HASH}`,
1075
1076
  });
1076
- lines.push('writer gate: ok — Sequence-org member (probe via GET /bundles/<zeros>)');
1077
+ lines.push('writer gate: ok — this account can author Lattice processes (probe via GET /bundles/<zeros>)');
1077
1078
  }
1078
1079
  catch (err) {
1079
1080
  if (err instanceof AtlasApiError) {
1080
1081
  if (err.status === 404) {
1081
- lines.push('writer gate: ok — Sequence-org member (GET /bundles/<zeros> → 404 means we passed the writer gate, the probe hash is fake)');
1082
+ lines.push('writer gate: ok — this account can author Lattice processes (GET /bundles/<zeros> → 404 means we passed the writer gate, the probe hash is fake)');
1082
1083
  }
1083
1084
  else if (err.status === 403) {
1084
- lines.push('writer gate: FAIL — 403 from Atlas. You need to be a member of organization:sequence in OpenFGA. ' +
1085
- 'Log in to Atlas at least once to materialize the membership tuple.');
1085
+ lines.push('writer gate: FAIL — 403 from Atlas: this credential cannot author Lattice processes. ' +
1086
+ 'Sign in as yourself with `seq-studio login` (machine credentials must be on Sequence\'s trusted list); ' +
1087
+ 'a new Sequence account may need to sign in to Atlas once first.');
1086
1088
  ok = false;
1087
1089
  }
1088
1090
  else if (err.status === 401) {
@@ -91,8 +91,8 @@ export declare function loadRemoteCiSources({ ctx, repoId, ref, }: {
91
91
  error: string;
92
92
  }>;
93
93
  /**
94
- * Discover CI checks from a remote repo tip (pure preview — no Settings write).
95
- * Uses the same autodiscovery rules as the platform runner (PLA-378).
94
+ * Preview legacy CI checks from a remote repo tip (no Settings write).
95
+ * Native repository plans are authoritative only through the PR status path.
96
96
  */
97
97
  export declare function reposCiShowCommand(args: ParsedArgs): Promise<number>;
98
98
  /** Add a check-run name to Settings `requiredChecks` (merge-blocking). */
@@ -628,8 +628,8 @@ export async function loadRemoteCiSources({ ctx, repoId, ref, }) {
628
628
  return { ok: true, packageScripts };
629
629
  }
630
630
  /**
631
- * Discover CI checks from a remote repo tip (pure preview — no Settings write).
632
- * Uses the same autodiscovery rules as the platform runner (PLA-378).
631
+ * Preview legacy CI checks from a remote repo tip (no Settings write).
632
+ * Native repository plans are authoritative only through the PR status path.
633
633
  */
634
634
  export async function reposCiShowCommand(args) {
635
635
  const { namespace, name } = parseRepoPath(args.positional[0]);
@@ -667,7 +667,8 @@ export async function reposCiShowCommand(args) {
667
667
  return 0;
668
668
  }
669
669
  if (discovered.checks.length === 0) {
670
- console.log(' (no checks discovered)');
670
+ console.log(' No legacy checks discovered at this ref; this preview does not show the server repository plan, including its targets, checks, or findings.');
671
+ console.log(` Open or update a pull request, then inspect the authoritative plan with: seq-studio repos ci show ${namespace}/${name} -e ${ctx.env.name} --pr <number>`);
671
672
  return 0;
672
673
  }
673
674
  for (const check of discovered.checks) {
@@ -731,7 +732,7 @@ export async function reposCiCommand(args) {
731
732
  console.log(`usage:
732
733
  seq-studio repos ci init [--dir <repository>] create .seq/pipeline.yml; no login needed
733
734
  seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs
734
- seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks
735
+ seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview legacy discovery; use --pr for the server plan
735
736
  seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control; use native pipeline discovery
736
737
  seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control; use native pipeline discovery
737
738
 
@@ -1,26 +1,17 @@
1
- import {
2
- defineProcess,
3
- defineNativeAutomationNode,
4
- defineHumanNode,
5
- } from '@sequenceholdings/lattice'
6
-
7
- // Automation nodes run a function registered in the Atlas native-function
8
- // registry, referenced by id. `health-check` is the built-in reference handler;
9
- // swap in your own id once you register it under
10
- // atlas/src/server/lib/lattice/native-functions/functions/.
11
- const start = defineNativeAutomationNode({
12
- id: 'start',
13
- title: 'Start',
14
- outgoing_edges: [{ id: 'start-to-review', to: 'review' }] as const,
15
- function: 'health-check',
16
- })
1
+ import { defineProcess, defineHumanNode } from '@sequenceholdings/lattice'
17
2
 
3
+ // A starter process any author can publish: people-only steps, so it needs no
4
+ // service account. To automate a step, add a Managed Function or agent node
5
+ // (defineManagedFunctionNode / defineAgentNode) with
6
+ // `run_as: { service_account: '<account id>' }` — automation always runs as a
7
+ // service account you hold the Actor role on. `close` is the natural step to
8
+ // replace with a function that records the result.
18
9
  const review = defineHumanNode({
19
10
  id: 'review',
20
11
  title: 'Review',
21
12
  outgoing_edges: [
22
- { id: 'approve', to: 'done' },
23
- { id: 'reject', to: 'done' },
13
+ { id: 'approve', to: 'close' },
14
+ { id: 'reject', to: 'close' },
24
15
  ] as const,
25
16
  artifact_refs: [],
26
17
  metadata: {},
@@ -29,17 +20,20 @@ const review = defineHumanNode({
29
20
  on_timeout_edge_id: 'reject',
30
21
  })
31
22
 
32
- const done = defineNativeAutomationNode({
33
- id: 'done',
34
- title: 'Done',
23
+ // No outgoing edges: completing this step completes the run.
24
+ const close = defineHumanNode({
25
+ id: 'close',
26
+ title: 'Close',
35
27
  outgoing_edges: [] as const,
36
- function: 'health-check',
28
+ artifact_refs: [],
29
+ metadata: {},
30
+ completeLabel: 'Close',
37
31
  })
38
32
 
39
33
  export default defineProcess({
40
34
  id: '{{slug}}',
41
35
  name: '{{name}}',
42
36
  entity: { type: '{{slug}}' },
43
- start_node_id: 'start',
44
- nodes: [start, review, done],
37
+ start_node_id: 'review',
38
+ nodes: [review, close],
45
39
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenceholdings/studio-cli",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
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/artifact-studio": "0.8.0",
45
46
  "@sequenceholdings/agent-spec": "0.1.3",
46
- "@sequenceholdings/artifact-studio": "0.7.1",
47
47
  "@sequenceholdings/lattice": "0.1.5",
48
48
  "@sequenceholdings/managed-functions": "0.4.1",
49
49
  "@sequenceholdings/storage": "0.1.1"
50
50
  },
51
51
  "peerDependencies": {
52
- "@sequenceholdings/pipeline-spec": "0.2.5",
53
- "@sequenceholdings/orm": "2.6.1"
52
+ "@sequenceholdings/orm": "2.6.1",
53
+ "@sequenceholdings/pipeline-spec": "0.2.5"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
56
  "@sequenceholdings/orm": {
@@ -1,26 +1,17 @@
1
- import {
2
- defineProcess,
3
- defineNativeAutomationNode,
4
- defineHumanNode,
5
- } from '@sequenceholdings/lattice'
6
-
7
- // Automation nodes run a function registered in the Atlas native-function
8
- // registry, referenced by id. `health-check` is the built-in reference handler;
9
- // swap in your own id once you register it under
10
- // atlas/src/server/lib/lattice/native-functions/functions/.
11
- const start = defineNativeAutomationNode({
12
- id: 'start',
13
- title: 'Start',
14
- outgoing_edges: [{ id: 'start-to-review', to: 'review' }] as const,
15
- function: 'health-check',
16
- })
1
+ import { defineProcess, defineHumanNode } from '@sequenceholdings/lattice'
17
2
 
3
+ // A starter process any author can publish: people-only steps, so it needs no
4
+ // service account. To automate a step, add a Managed Function or agent node
5
+ // (defineManagedFunctionNode / defineAgentNode) with
6
+ // `run_as: { service_account: '<account id>' }` — automation always runs as a
7
+ // service account you hold the Actor role on. `close` is the natural step to
8
+ // replace with a function that records the result.
18
9
  const review = defineHumanNode({
19
10
  id: 'review',
20
11
  title: 'Review',
21
12
  outgoing_edges: [
22
- { id: 'approve', to: 'done' },
23
- { id: 'reject', to: 'done' },
13
+ { id: 'approve', to: 'close' },
14
+ { id: 'reject', to: 'close' },
24
15
  ] as const,
25
16
  artifact_refs: [],
26
17
  metadata: {},
@@ -29,17 +20,20 @@ const review = defineHumanNode({
29
20
  on_timeout_edge_id: 'reject',
30
21
  })
31
22
 
32
- const done = defineNativeAutomationNode({
33
- id: 'done',
34
- title: 'Done',
23
+ // No outgoing edges: completing this step completes the run.
24
+ const close = defineHumanNode({
25
+ id: 'close',
26
+ title: 'Close',
35
27
  outgoing_edges: [] as const,
36
- function: 'health-check',
28
+ artifact_refs: [],
29
+ metadata: {},
30
+ completeLabel: 'Close',
37
31
  })
38
32
 
39
33
  export default defineProcess({
40
34
  id: '{{slug}}',
41
35
  name: '{{name}}',
42
36
  entity: { type: '{{slug}}' },
43
- start_node_id: 'start',
44
- nodes: [start, review, done],
37
+ start_node_id: 'review',
38
+ nodes: [review, close],
45
39
  })