@sequenceholdings/studio-cli 0.5.3 → 0.5.5
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 +220 -12
- package/dist/agents/bundle.d.ts +8 -0
- package/dist/agents/bundle.js +38 -0
- package/dist/agents/commands.d.ts +6 -1
- package/dist/agents/commands.js +17 -20
- package/dist/agents/selection.d.ts +3 -0
- package/dist/agents/selection.js +17 -0
- package/dist/agents/source.js +2 -1
- package/dist/app/adapters.js +2 -1
- package/dist/app/application-registration.d.ts +1 -1
- package/dist/app/application-registration.js +6 -2
- package/dist/app/commands.d.ts +6 -0
- package/dist/app/commands.js +13 -4
- package/dist/app/primitive-scaffold.js +8 -1
- package/dist/app/readme.js +1 -1
- package/dist/app/scaffold.js +1 -1
- package/dist/artifact/delegate.js +16 -4
- package/dist/atlas-client.js +5 -1
- package/dist/auth-cmds/commands.d.ts +1 -1
- package/dist/auth-cmds/commands.js +3 -0
- package/dist/auth.d.ts +2 -1
- package/dist/auth.js +16 -0
- package/dist/command-contract.d.ts +9 -9
- package/dist/command-contract.js +7 -7
- package/dist/command-help.d.ts +3 -2
- package/dist/command-help.js +31 -3
- package/dist/command-input.js +2 -2
- package/dist/config.d.ts +5 -0
- package/dist/config.js +14 -1
- package/dist/env-flags.d.ts +6 -0
- package/dist/env-flags.js +9 -0
- package/dist/functions/commands.d.ts +5 -2
- package/dist/functions/commands.js +36 -10
- package/dist/functions/deploy-preflight.js +2 -2
- package/dist/functions/manifest.d.ts +43 -29
- package/dist/functions/manifest.js +37 -74
- package/dist/main.js +43 -3
- package/dist/orm/delegate.js +25 -4
- package/dist/orm/read.d.ts +54 -0
- package/dist/orm/read.js +308 -0
- package/dist/pipeline/commands.js +10 -0
- package/dist/pipeline/discovery.js +3 -16
- package/dist/pipeline/retirement.d.ts +3 -0
- package/dist/pipeline/retirement.js +34 -0
- package/dist/process/build.js +4 -0
- package/dist/process/codegen.js +2 -0
- package/dist/process/commands.js +66 -25
- package/dist/process/plan-diff.js +1 -0
- package/dist/process/runs.d.ts +14 -0
- package/dist/process/runs.js +238 -0
- package/dist/repos/ci-status.js +28 -0
- package/dist/repos/commands.d.ts +2 -2
- package/dist/repos/commands.js +11 -4
- package/dist/repos/git-credential.d.ts +3 -2
- package/dist/repos/git-credential.js +52 -3
- package/dist/repos/pulls.d.ts +7 -1
- package/dist/repos/pulls.js +162 -22
- package/dist/sandbox-auth.d.ts +52 -0
- package/dist/sandbox-auth.js +105 -0
- package/dist/storage/commands.js +6 -5
- package/dist/text-table.d.ts +7 -0
- package/dist/text-table.js +16 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -32,6 +32,8 @@ verifies and copies the selected release into a new or empty directory.
|
|
|
32
32
|
> `agents validate`, offline `agents plan`, `pipeline init`, `pipeline validate`) work.
|
|
33
33
|
> Repo and function command help is also available without an account; for
|
|
34
34
|
> example, `seq-studio repos create --help` and `seq-studio functions invoke --help`.
|
|
35
|
+
> An unknown subcommand, including one followed by `--help`, exits nonzero and
|
|
36
|
+
> points to the namespace help; check command spelling before retrying.
|
|
35
37
|
> Sequence-internal contributors: see `INTERNAL.md` in the monorepo for
|
|
36
38
|
> rollout SOPs, preview environments, and publishing docs.
|
|
37
39
|
|
|
@@ -129,6 +131,40 @@ user-scoped/private resources.
|
|
|
129
131
|
Artifact commands do not accept bearer tokens through argv or environment.
|
|
130
132
|
Use interactive login or the realm-specific M2M secret above.
|
|
131
133
|
|
|
134
|
+
### Sandbox token mode (agent sandboxes)
|
|
135
|
+
|
|
136
|
+
An agent sandbox provisioned by Atlas has no browser and can reach only its
|
|
137
|
+
Atlas origin. Atlas writes a short-lived token scoped to the calling user into
|
|
138
|
+
a file and exports two variables:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
export SEQ_STUDIO_BASE_URL=https://<your-atlas-origin>
|
|
142
|
+
export SEQ_STUDIO_TOKEN_FILE=/run/seq/token
|
|
143
|
+
seq-studio auth whoami # authMode: sandbox
|
|
144
|
+
seq-studio orm read lending loans --limit 5 --json
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
With both set, every command targets `SEQ_STUDIO_BASE_URL` with the token from
|
|
148
|
+
`SEQ_STUDIO_TOKEN_FILE`. There is no login, token cache, or environment
|
|
149
|
+
registry lookup, and `-e` is optional (any value is ignored). The file is read
|
|
150
|
+
again for every request, so a token Atlas rotates mid-command is picked up.
|
|
151
|
+
Setting only one of the two variables is an error rather than a fallback to a
|
|
152
|
+
cached login. `seq-studio doctor` reports the mode.
|
|
153
|
+
|
|
154
|
+
Git uses the same token: `repos clone` installs the usual helper, and the helper
|
|
155
|
+
answers only for git-service repositories on `SEQ_STUDIO_BASE_URL`. To use plain
|
|
156
|
+
`git` against that host, configure the helper once:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
git config --global credential."$SEQ_STUDIO_BASE_URL".helper '!seq-studio auth git-credential'
|
|
160
|
+
git config --global credential."$SEQ_STUDIO_BASE_URL".useHttpPath true
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Repository sources for `--repo` builds are materialized through the JSON API,
|
|
164
|
+
like other headless callers; public `--git-url` sources are refused. Artifact
|
|
165
|
+
commands are not available in sandbox token mode: like `--token`, Artifact Studio
|
|
166
|
+
accepts only credentials the CLI obtained itself.
|
|
167
|
+
|
|
132
168
|
## Environments
|
|
133
169
|
|
|
134
170
|
The CLI ships with a single built-in environment, `local`
|
|
@@ -194,8 +230,9 @@ locations, dependencies, and deployment selection.
|
|
|
194
230
|
|
|
195
231
|
`init` accepts `orm`, `workspace`, `function`, `agent`, `process`, `pipeline`, and `artifact` as
|
|
196
232
|
a comma-separated `--with` list or boolean flags (`--agent --process`). With no
|
|
197
|
-
kind flags it scaffolds `orm,function,process,artifact
|
|
198
|
-
|
|
233
|
+
kind flags it scaffolds `orm,function,process,artifact`. Repository CI/CD
|
|
234
|
+
creates and deploys those, workspaces, pipelines and agents on merge (see
|
|
235
|
+
[What a merge deploys](#what-a-merge-deploys)). `--skip-install` skips the install and
|
|
199
236
|
migration step (offline). The first
|
|
200
237
|
function defaults to `hello` (`--function-name` changes it). Agent, process, and
|
|
201
238
|
pipeline folders use the app name. Pipelines default to transformation stages;
|
|
@@ -585,18 +622,20 @@ bundle; it never implicitly deletes agents.
|
|
|
585
622
|
|---------|--------------|
|
|
586
623
|
| `seq-studio agents init <dir>` | Scaffold a standalone typed agent repository |
|
|
587
624
|
| `seq-studio agents validate [--dir <dir>] [--target <APP_ENV>] [--only <id1,id2>]` | Compile and validate locally, without API access |
|
|
625
|
+
| `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
626
|
| `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]` |
|
|
627
|
+
| `seq-studio agents plan [--dir <dir>] -e <env> [--target <APP_ENV>] [--only <id1,id2>] [--managed]` | Diff creates, updates, and unchanged definitions against an environment |
|
|
628
|
+
| `seq-studio agents apply [--dir <dir>] -e <env> [--target <APP_ENV>] [--only <id1,id2>] [--yes] [--managed]` | Deploy agent configuration after showing the plan |
|
|
591
629
|
| `seq-studio agents list -e <env>` | List visible runtime agents |
|
|
592
630
|
| `seq-studio agents show <id> -e <env>` | Show one runtime agent |
|
|
593
631
|
|
|
594
|
-
For `validate`, `plan`, and `apply`, `--only` accepts a comma-separated list of
|
|
632
|
+
For `validate`, `bundle`, `plan`, and `apply`, `--only` accepts a comma-separated list of
|
|
595
633
|
agent IDs after deployment-environment selection; every requested ID must be
|
|
596
634
|
selected.
|
|
597
635
|
|
|
598
|
-
**Access is managed in Atlas, not in code.** `seq-studio
|
|
599
|
-
|
|
636
|
+
**Access is managed in Atlas, not in code.** `seq-studio agents plan`/`apply`
|
|
637
|
+
and `seq-studio deploy` deploy agents config-only, as you, with the same rules
|
|
638
|
+
as an Agent Builder save:
|
|
600
639
|
|
|
601
640
|
- A new agent needs **Can create** on Agent Builder; you become its owner and
|
|
602
641
|
it starts unshared.
|
|
@@ -607,8 +646,12 @@ app's agents config-only, as you, with the same rules as an Agent Builder save:
|
|
|
607
646
|
or through the API. A definition that sets `permissions`, `isPublic` or
|
|
608
647
|
`publicOutputs` is refused.
|
|
609
648
|
|
|
610
|
-
|
|
611
|
-
|
|
649
|
+
A merge deploys an agent the same way, as the person who merged, when its
|
|
650
|
+
`sequence.app.yml` entry names exactly one agent with `only: [<agent id>]`
|
|
651
|
+
(`seq-studio add agent` writes it). See [What a merge deploys](#what-a-merge-deploys).
|
|
652
|
+
|
|
653
|
+
`--managed` selects the Sequence-staff path for Sequence's own code-managed
|
|
654
|
+
agents, whose definitions own their access as well.
|
|
612
655
|
|
|
613
656
|
An optional `deploy-manifest.json` targets definitions by deployment identity:
|
|
614
657
|
|
|
@@ -625,7 +668,7 @@ An optional `deploy-manifest.json` targets definitions by deployment identity:
|
|
|
625
668
|
}
|
|
626
669
|
```
|
|
627
670
|
|
|
628
|
-
|
|
671
|
+
Standalone workflow:
|
|
629
672
|
|
|
630
673
|
```bash
|
|
631
674
|
pnpm dlx @sequenceholdings/studio-cli agents init support-agent
|
|
@@ -639,6 +682,9 @@ pnpm exec seq-studio agents plan -e <env>
|
|
|
639
682
|
pnpm exec seq-studio agents apply -e <env>
|
|
640
683
|
```
|
|
641
684
|
|
|
685
|
+
Sequence staff deploying Sequence's own code-managed agents add `--managed` to
|
|
686
|
+
`plan` and `apply`.
|
|
687
|
+
|
|
642
688
|
Use `--repo agents/<name> [--ref <ref>]` or `--git-url <url>` instead of
|
|
643
689
|
`--dir` to materialize reviewed source from the platform git service.
|
|
644
690
|
|
|
@@ -776,6 +822,8 @@ compiled to canonical SQL before registration.
|
|
|
776
822
|
| `seq-studio orm diff [dir] [--check]` | Author the next committed migration, or verify the migration/snapshot chain offline for CI. |
|
|
777
823
|
| `seq-studio orm apply [dir] -e <env>` | Author a migration if needed, register/apply the namespace, activate its operation set, publish roles/capabilities, and refresh generated outputs. |
|
|
778
824
|
| `seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>` | Execute one named persisted operation from `operations.manifest.json` with variables from a JSON object file, as the signed-in caller. |
|
|
825
|
+
| `seq-studio orm read <namespace> <table> -e <env> [--where …] [--select …] [--order …] [--limit N] [--offset N] [--json\|--jsonl]` | Read rows of a deployed v2 namespace's table as the caller. |
|
|
826
|
+
| `seq-studio orm sql <namespace> --query <sql> \| --file <path> -e <env> [--param …] [--json\|--jsonl]` | Run read-only SQL against a deployed v2 namespace as the caller. |
|
|
779
827
|
| `seq-studio orm migrate-from-yaml <dir>` | Convert a legacy YAML namespace to TypeScript authoring while preserving its committed migrations. |
|
|
780
828
|
| `seq-studio orm import [dir] --spec <file>` | Plan a batched copy from an existing Postgres relation (a synced warehouse table) into an owned ORM table. Writes a SQL script; it does not connect or apply row policies. |
|
|
781
829
|
|
|
@@ -814,6 +862,44 @@ starting another rehearsal.
|
|
|
814
862
|
> depends on `@sequenceholdings/orm@^2.0.0`; use the matching published major
|
|
815
863
|
> version and keep generated manifests and migrations committed with source.
|
|
816
864
|
|
|
865
|
+
### Ad-hoc reads (`orm read`, `orm sql`)
|
|
866
|
+
|
|
867
|
+
`read` and `sql` query a deployed ORM v2 namespace without authoring an
|
|
868
|
+
operation. Both run the namespace's built-in read-only SQL operation (the same
|
|
869
|
+
one `orm.sql()` uses in apps and functions) as you: grants and row-level
|
|
870
|
+
security apply, the server accepts only its read-only SQL grammar, and a result
|
|
871
|
+
is bounded to 1,000 rows, 8 MiB, and a 10-second statement timeout. Legacy v1
|
|
872
|
+
YAML namespaces are not supported; convert them with `orm migrate-from-yaml`.
|
|
873
|
+
|
|
874
|
+
```bash
|
|
875
|
+
seq-studio orm read lending loans -e <env> \
|
|
876
|
+
--where status=eq.open --where balance=gte.1000 \
|
|
877
|
+
--select id,officer,balance --order balance.desc --limit 50 --json
|
|
878
|
+
|
|
879
|
+
seq-studio orm sql lending -e <env> \
|
|
880
|
+
--query 'SELECT officer, sum(balance) AS total FROM lending.loans WHERE status = :status GROUP BY officer' \
|
|
881
|
+
--param status=open --jsonl | jq -r '.officer'
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
- `read` filters with repeatable `--where <column>=<op>.<value>`. Operators: `eq`, `ne`,
|
|
885
|
+
`gt`, `gte`, `lt`, `lte`, `in` (`id=in.(a,b,c)`), and `is` (`closed_at=is.null`,
|
|
886
|
+
`active=is.true`). Values bind as parameters typed like their columns, which `read`
|
|
887
|
+
looks up with one extra request. `--order <column>[.asc|.desc]` is repeatable or
|
|
888
|
+
comma-separated.
|
|
889
|
+
- `sql` takes the statement from `--query` or `--file` and binds `:name` placeholders.
|
|
890
|
+
`--param <name>[:<type>]=<value>` is repeatable; the type defaults to `text` and may be
|
|
891
|
+
`uuid`, `date`, `timestamptz`, `numeric`, `bigint`, `integer`, `double`, or `boolean`.
|
|
892
|
+
`--params '{"closed": {"type": "timestamptz", "value": null}}'` passes the wire shape,
|
|
893
|
+
including null values.
|
|
894
|
+
- `sql` must reference every table as `<namespace>.<table>` (`FROM lending.loans`, not
|
|
895
|
+
`FROM loans`); unqualified names and queries without a table (`SELECT 1`) are rejected.
|
|
896
|
+
The grammar is read-only `SELECT` with joins, CTEs, `UNION`, aggregates, and comparison
|
|
897
|
+
operators; it has no `LIKE` or `IN`. When the server rejects a statement it says only
|
|
898
|
+
"SQL query is invalid or unsupported", so the CLI adds a hint with these rules.
|
|
899
|
+
- `--json` prints a JSON array of row objects (`pandas.read_json`), `--jsonl` one
|
|
900
|
+
object per line (`pandas.read_json(lines=True)`, `jq`). Without either, rows print
|
|
901
|
+
as a table. Counts, truncation, and next-page hints (`--offset`) go to stderr.
|
|
902
|
+
|
|
817
903
|
### Registered SQL operations in development builds
|
|
818
904
|
|
|
819
905
|
The planned Studio CLI 0.5.0 package chain also carries default namespace SQL:
|
|
@@ -871,12 +957,36 @@ datasets before adopting this path for latency-sensitive reads.
|
|
|
871
957
|
| `seq-studio process bundle inspect <bundle.json>` | Show a saved bundle's summary |
|
|
872
958
|
| `seq-studio process bundle list [-e <env>] [--limit N] [--cursor <hash>]` | List registered bundles (paginated; CLI auto-fetches all pages) |
|
|
873
959
|
| `seq-studio process bundle publish <hash or bundle.json> [-e <env>]` | Register a local bundle (no promote) |
|
|
960
|
+
| `seq-studio process runs start <process-id> -e <env> [--version <v>] [--run-id <id>] [--metadata-file <file>]` | Start a run as you (needs `invoker` on the process) |
|
|
961
|
+
| `seq-studio process runs list -e <env> [--process <id>] [--status <s>] [--limit N]` | List runs you can view, newest first |
|
|
962
|
+
| `seq-studio process runs show <run-id> -e <env> [--wait]` | Show a run's status and steps; `--wait` polls until it finishes |
|
|
963
|
+
| `seq-studio process runs cancel <run-id> -e <env>` | Cancel a run (needs `invoker` on the process) |
|
|
874
964
|
|
|
875
965
|
Use `lint --offline` for checks without live registry lookups. `test --offline`
|
|
876
966
|
also skips agent-schema lookup and permits skipping the active-version diff when
|
|
877
967
|
environment/auth is unavailable, but it still attempts that live diff and resolves
|
|
878
968
|
subprocess versions when needed. It is not a guarantee of network-free execution.
|
|
879
969
|
|
|
970
|
+
### Runs
|
|
971
|
+
|
|
972
|
+
```bash
|
|
973
|
+
seq-studio process runs start credit-memo -e <env> \
|
|
974
|
+
--run-id memo-loan-1042 --metadata-file run.json --json
|
|
975
|
+
seq-studio process runs show memo-loan-1042 -e <env> --wait --json
|
|
976
|
+
seq-studio process runs list -e <env> --process credit-memo --status failed --limit 20
|
|
977
|
+
```
|
|
978
|
+
|
|
979
|
+
`--version` pins a published version; without it the active version runs.
|
|
980
|
+
`--run-id` makes `start` idempotent: repeating it for the same process returns
|
|
981
|
+
the existing run (`idempotent_replay: true`) rather than starting another, and
|
|
982
|
+
reusing it for a different process is refused. `--metadata-file` must hold a
|
|
983
|
+
JSON object. `list` filters by `--process`, `--status` (`pending`, `running`,
|
|
984
|
+
`completed`, `failed`, `cancelled`, `timed_out`), `--entity-type`/`--entity-id`,
|
|
985
|
+
and `--archived`; it returns the newest runs up to `--limit` (default 50,
|
|
986
|
+
maximum 500). The run API has no cursor, so narrow the filters to reach older
|
|
987
|
+
runs. `show --wait` stops waiting after `--timeout` seconds (default 600); the
|
|
988
|
+
run itself continues. `--json` prints the API response on every command.
|
|
989
|
+
|
|
880
990
|
### JSONata mapper contracts
|
|
881
991
|
|
|
882
992
|
`jsonata('…')` expressions are serialized as `*_expr` data and run in a
|
|
@@ -956,6 +1066,16 @@ seq-studio process lint --dir my-processes --offline # finds both processes
|
|
|
956
1066
|
Add `--help` to a function command to read its usage offline, without an
|
|
957
1067
|
environment, credentials, or `managed-function.yml`.
|
|
958
1068
|
|
|
1069
|
+
For a function whose source must remain pinned, declare
|
|
1070
|
+
`function.immutable_release: true` before its first deployment using CLI **0.5.5**
|
|
1071
|
+
and a platform that advertises immutable releases. The first successful activation
|
|
1072
|
+
permanently freezes deployment of that function identity, including promote,
|
|
1073
|
+
rollback, and secret-version redeploys. Create a new `function.id` for the next
|
|
1074
|
+
release and retain previous functions while their callers still need them.
|
|
1075
|
+
Removing the flag cannot unfreeze the runtime, and already active mutable
|
|
1076
|
+
functions cannot opt in retroactively. The default remains mutable. See the
|
|
1077
|
+
[Managed Functions SDK guide](../managed-functions/README.md#immutable-function-releases).
|
|
1078
|
+
|
|
959
1079
|
| Command | What it does |
|
|
960
1080
|
|---------|--------------|
|
|
961
1081
|
| `seq-studio functions init <dir>` | Scaffold one standalone TypeScript managed function |
|
|
@@ -967,6 +1087,16 @@ environment, credentials, or `managed-function.yml`.
|
|
|
967
1087
|
| `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 |
|
|
968
1088
|
| `seq-studio functions invoke --fn <slug> -e <env> [--data <json> \| --data @<file> \| --stdin]` | Invoke a deployed function and print its response body |
|
|
969
1089
|
|
|
1090
|
+
`functions deploy` picks the next `vN` after the highest numbered version of
|
|
1091
|
+
that function. Versions named by repository CI, such as `ci-abc`, do not reset
|
|
1092
|
+
the sequence. A function with no numbered versions starts at `v1`.
|
|
1093
|
+
|
|
1094
|
+
Set `runtime: nodejs24` in `managed-function.yml` to use Node.js 24 on a hosted
|
|
1095
|
+
deployment. Node.js 20 (`nodejs20`) remains the default when `runtime` is omitted.
|
|
1096
|
+
These are the supported manifest values; other runtimes are rejected. Keep
|
|
1097
|
+
`package.json`'s `engines.node` compatible with the selected runtime, for example
|
|
1098
|
+
`"24.x"` for Node.js 24. Local development uses the installed Node version.
|
|
1099
|
+
|
|
970
1100
|
A normal function repo keeps `managed-function.yml` at its root and omits
|
|
971
1101
|
`--path`. A repo may also contain related, independently deployed functions:
|
|
972
1102
|
|
|
@@ -1257,6 +1387,21 @@ A successful direct `seq-studio orm execute` call does not test a function's
|
|
|
1257
1387
|
delegated scope. If the same read fails through the function with a 403, check
|
|
1258
1388
|
the deployed `tables` declaration before requesting broader user grants.
|
|
1259
1389
|
|
|
1390
|
+
### Trusted Lattice context
|
|
1391
|
+
|
|
1392
|
+
Declare `capabilities.lattice.context: true` and attach a top-level
|
|
1393
|
+
`service_account` for functions that read their verified Lattice execution or
|
|
1394
|
+
selected human-action receipts. This requires CLI `0.5.5`, Managed Functions SDK
|
|
1395
|
+
`0.4.2`, and deployed `lattice_context` support; preflight fails before upload
|
|
1396
|
+
when a declaration, attachment or release prerequisite is missing.
|
|
1397
|
+
|
|
1398
|
+
The reviewed process node must explicitly map any context data it exposes as
|
|
1399
|
+
`input.context`. The SDK returns the actual mapped input and platform-owned
|
|
1400
|
+
execution identity. It does not grant arbitrary run reads or treat a run
|
|
1401
|
+
starter, caller-authored actor or service attribution as a human approval.
|
|
1402
|
+
See the [Managed Functions SDK](../managed-functions/README.md#trusted-lattice-execution-and-human-actions)
|
|
1403
|
+
for invocation-scoped context and receipt APIs.
|
|
1404
|
+
|
|
1260
1405
|
## Managed Secret commands
|
|
1261
1406
|
|
|
1262
1407
|
| Command | What it does |
|
|
@@ -1601,6 +1746,10 @@ Deploy login-capable server support before upgrading the CLI; this CLI cannot
|
|
|
1601
1746
|
authenticate Git against older PAT-only servers. `clone` no longer silently downloads a files-only tree.
|
|
1602
1747
|
Use `seq-studio repos pull` or `repos clone --transport json` explicitly when you want files without `.git`.
|
|
1603
1748
|
|
|
1749
|
+
In sandbox token mode the helper answers with the sandbox token instead of a
|
|
1750
|
+
login, for git-service repositories on `SEQ_STUDIO_BASE_URL` only; see
|
|
1751
|
+
[Sandbox token mode](#sandbox-token-mode-agent-sandboxes).
|
|
1752
|
+
|
|
1604
1753
|
### Retired personal access tokens
|
|
1605
1754
|
|
|
1606
1755
|
Git authentication requires a human `seq-studio login --env <env>` session.
|
|
@@ -1645,8 +1794,8 @@ JSON API — the same repos `--repo <ns>/<name>` sources build from.
|
|
|
1645
1794
|
| `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` |
|
|
1646
1795
|
| `seq-studio repos delete <ns>/<name> -e <env> [--yes]` | delete a repo — interactive confirm unless `--yes` |
|
|
1647
1796
|
| `seq-studio repos ci init [--dir <repository>]` | create `.seq/pipeline.yml` with native defaults; offline, preserves existing configuration |
|
|
1648
|
-
| `seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json]` | inspect the server's discovered pipeline, exact plan and
|
|
1649
|
-
| `seq-studio repos ci show <ns>/<name> -e <env> [--ref <r>]` | preview
|
|
1797
|
+
| `seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json]` | inspect the server's discovered pipeline, exact plan, recent runs, and deployment intents (state, target progress, errors, and live app URL). Text output shows at most five intents and ten targets per intent; `--json` retains the complete status response. |
|
|
1798
|
+
| `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. |
|
|
1650
1799
|
| `seq-studio repos ci require <ns>/<name> --check <name> -e <env>` | disabled legacy required-check control; use native pipeline discovery |
|
|
1651
1800
|
| `seq-studio repos ci import <ns>/<name> -e <env> [--ref <r>]` | disabled legacy required-check control; use native pipeline discovery |
|
|
1652
1801
|
|
|
@@ -1704,6 +1853,50 @@ the old file in one commit. Both files together, invalid syntax and duplicate
|
|
|
1704
1853
|
YAML keys fail planning. Empty native `targets` means use discovered inventory
|
|
1705
1854
|
defaults; it does not disable required checks.
|
|
1706
1855
|
|
|
1856
|
+
### What a merge deploys
|
|
1857
|
+
|
|
1858
|
+
On a branch with deploy-on-merge, merging creates what the manifest declares
|
|
1859
|
+
and updates what exists, as the person who merged. Creating needs **Can create**
|
|
1860
|
+
on that primitive's app, and its creator becomes owner. Updating needs the
|
|
1861
|
+
primitive's deploy tier, editor or writer. A merge only creates brand-new
|
|
1862
|
+
names. An existing resource the repository doesn't control yet stays a
|
|
1863
|
+
repository admin's binding in Settings → CI.
|
|
1864
|
+
|
|
1865
|
+
| Kind | Created on merge with | Updated on merge with | Notes |
|
|
1866
|
+
| --- | --- | --- | --- |
|
|
1867
|
+
| ORM namespace | Can create on ORM | writer | Destructive migrations stop for a person |
|
|
1868
|
+
| Function | Can create on Managed Functions | editor | |
|
|
1869
|
+
| Artifact (static or Next.js) | Can create on Artifact Studio | writer | |
|
|
1870
|
+
| Lattice process | Lattice authoring | editor | One process per primitive (`only: [<id>]`) |
|
|
1871
|
+
| Workspace | Can create on Workspaces V2 | editor | Only its name and description; access stays its own sharing |
|
|
1872
|
+
| Managed pipeline | Can create on Pipelines and Writer on the repository | editor | Plans then deploys the merge commit; destructive plans stop for a person |
|
|
1873
|
+
| Agent | Can create on Agent Builder | editor | Configuration only, one agent per entry (`only: [<id>]`); access stays in Agent Builder |
|
|
1874
|
+
|
|
1875
|
+
A workspace has no code, so its only check validates `workspace.yml`. Its
|
|
1876
|
+
Application lists it as a member, but no Application role can include it.
|
|
1877
|
+
|
|
1878
|
+
A pipeline's checks run `seq-studio pipeline validate`. A merge then plans the
|
|
1879
|
+
merge commit and deploys that plan as the merger. On production and BankSouth
|
|
1880
|
+
the merge counts as the deploy approval. A plan that deletes or recreates
|
|
1881
|
+
resources stops there: a Sequence user reviews and deploys it in Pipelines,
|
|
1882
|
+
then retries the merge's deployment. The pipeline is released under this
|
|
1883
|
+
repository: `<namespace>/<name>@<path>`, or the bare name for a `pipelines/*`
|
|
1884
|
+
repository holding it at its root. A pipeline whose `repo:` names another
|
|
1885
|
+
repository is deployed by that repository's CI. Pipelines bound to the
|
|
1886
|
+
Relationships namespace need a signed-in session, so they still deploy with
|
|
1887
|
+
`seq-studio pipeline deploy`.
|
|
1888
|
+
|
|
1889
|
+
An agent's build runs `seq-studio agents bundle` for exactly the agent its
|
|
1890
|
+
entry names, compiled for the destination environment; Atlas then runs the
|
|
1891
|
+
same config deploy as `seq-studio deploy`, with Agent Builder's save checks.
|
|
1892
|
+
It never changes who can use the agent, and refuses `permissions`, `isPublic`
|
|
1893
|
+
or `publicOutputs` in code. The repository binds that agent id on its first
|
|
1894
|
+
merge, so no other repository's merge can write it. An agent entry that names
|
|
1895
|
+
no single agent still deploys with `seq-studio deploy`.
|
|
1896
|
+
|
|
1897
|
+
Secrets and service accounts are created through their own commands, never by
|
|
1898
|
+
a merge.
|
|
1899
|
+
|
|
1707
1900
|
In a multi-application repository, scope CI with `.seq/repository.yml`: list the
|
|
1708
1901
|
checked `applications:` and put every other deployable path under `ignore:`.
|
|
1709
1902
|
Repository CI never checks or deploys ignored paths, and they may not overlap a
|
|
@@ -1766,6 +1959,7 @@ Creating a release unit requires both **Can create** on Pipelines and Git Servic
|
|
|
1766
1959
|
| `seq-studio pipeline status --deployment-id <id> -e <env> [--json]` | Fetch the current remote deployment status without changing it. Use this public command to continue monitoring after local polling stops |
|
|
1767
1960
|
| `seq-studio pipeline adopt --stage <slug> --ref <sha\|branch> [--root <directory>] -e <env> [--target <id>] --native-id <id> --approved-by <you> [--resource-key <key>] [--kind job\|dlt_pipeline] [--old-source-removal-pr <url>] [--repo <namespace>/<slug>]` | Bind a live Databricks job/pipeline into the stage without recreation (`bundle deployment bind` on Trigger). Always requires `--approved-by` naming the caller. When the key is still in the monorepo DAB, pass `--old-source-removal-pr` and follow the returned cutover checklist: unbind the old bundle state without deleting the remote, then remove its DAB declaration and add the target-specific adopted-resource entry in the same PR before redeploying. |
|
|
1768
1961
|
| `seq-studio pipeline unbind --stage <slug> --ref <sha\|branch> [--root <directory>] -e <env> [--target <id>] --approved-by <you> [--resource-key <key>] [--repo <namespace>/<slug>]` | Release an adopted binding on Trigger; the remote object stays live (never deleted) |
|
|
1962
|
+
| `seq-studio pipeline retire --repo <release-unit> -e <env> [--target <id>] [--json]` | Preview the exact whole-pipeline inventory. Approve with `--plan-hash <hash> --yes`. Inspect with `--retirement-id <id>`; explicitly resume a stopped failure with `--retirement-id <id> --resume --yes`. Requires a human pipeline administrator and the existing staff destructive-operation gate. Deletes supported execution resources, releases bindings, and archives stages; retains data objects, source repositories, permissions and historical records. |
|
|
1769
1963
|
| `seq-studio pipeline run-now --stage <slug> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]` | Run the stage's active job or DLT pipeline immediately and print its Databricks run URL |
|
|
1770
1964
|
| `seq-studio pipeline promote --stage <slug> --version <v> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--approved-by <you>] [--wait-timeout <duration>] [--no-wait] [--json]` | Promote a validated version to another target. Targets that require approval need `--approved-by`; `--repo` disambiguates a slug that exists in multiple Pipelines |
|
|
1771
1965
|
| `seq-studio pipeline rollback --stage <slug> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--approved-by <you>] [--wait-timeout <duration>] [--no-wait] [--json]` | Redeploy the previously retired deployment's version. Targets that require approval need `--approved-by`. |
|
|
@@ -2328,6 +2522,11 @@ seq-studio repos pulls list <namespace/name> --state open -e <env>
|
|
|
2328
2522
|
seq-studio repos pulls show <namespace/name> <number> -e <env>
|
|
2329
2523
|
seq-studio repos pulls diff <namespace/name> <number> -e <env>
|
|
2330
2524
|
seq-studio repos pulls merge <namespace/name> <number> --method squash -e <env>
|
|
2525
|
+
seq-studio repos pulls comment <namespace/name> <number> --body "Looks good" -e <env>
|
|
2526
|
+
seq-studio repos pulls comment <namespace/name> <number> --path src/memo.ts --line 42 --body-file note.md -e <env>
|
|
2527
|
+
seq-studio repos pulls review <namespace/name> <number> --request-changes --body-file review.md -e <env>
|
|
2528
|
+
seq-studio repos pulls checks <namespace/name> <number> -e <env>
|
|
2529
|
+
seq-studio repos pulls close <namespace/name> <number> -e <env>
|
|
2331
2530
|
```
|
|
2332
2531
|
|
|
2333
2532
|
All results are JSON (`--json` is accepted). Listing returns one page and `nextCursor`;
|
|
@@ -2335,4 +2534,13 @@ use `--cursor` to continue. Diff accepts `--max-files` (maximum 500) and reports
|
|
|
2335
2534
|
Merge requires merge/admin authority, confirmation (or approved automation's `--yes`),
|
|
2336
2535
|
and the existing server review/check policy. It merges the current branch head; a
|
|
2337
2536
|
displayed SHA is not a head-lock or policy bypass. Complete reviews before merging.
|
|
2537
|
+
`comments` and `reviews` list a Pull's comments and reviews (paginated like `list`).
|
|
2538
|
+
`comment` adds a comment; `--path` with `--line` anchors it to a diff line on the
|
|
2539
|
+
new side (`--side LEFT` for the old side) at the commit the Pull's branch points at
|
|
2540
|
+
now (`--commit <sha>` to pin another), and `--reply-to <comment-id>` answers a thread.
|
|
2541
|
+
`review` takes exactly one of `--approve`, `--request-changes`, or `--comment`, an
|
|
2542
|
+
optional `--body`/`--body-file`, and records the review against the commit the Pull's
|
|
2543
|
+
branch points at now unless `--commit` names another. `checks` returns one object with the Pull's check
|
|
2544
|
+
runs, CI plan and runs, and merge gates (mergeability, review, code-owner, and check
|
|
2545
|
+
gates). `close` needs authorship or repository write and is idempotent.
|
|
2338
2546
|
`repos pull` remains the singular source-snapshot command.
|
|
@@ -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
|
+
}
|
|
@@ -9,11 +9,16 @@ export { agentsInitCommand };
|
|
|
9
9
|
*/
|
|
10
10
|
export type AgentDeployMode = 'managed' | 'config';
|
|
11
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[]>;
|
|
12
17
|
export declare function agentsPlanCommand(args: ParsedArgs): Promise<number>;
|
|
13
18
|
export declare function agentsApplyCommand(args: ParsedArgs, { mode }?: {
|
|
14
19
|
mode?: AgentDeployMode;
|
|
15
20
|
}): Promise<number>;
|
|
16
21
|
export declare function agentsListCommand(args: ParsedArgs): Promise<number>;
|
|
17
22
|
export declare function agentsShowCommand(args: ParsedArgs): Promise<number>;
|
|
18
|
-
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";
|
|
19
24
|
export declare function runAgentsCommand(sub: string | undefined, args: ParsedArgs): Promise<number>;
|
package/dist/agents/commands.js
CHANGED
|
@@ -6,27 +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
12
|
const DEPLOY_ROUTES = {
|
|
12
13
|
managed: { plan: '/api/agents/deploy/plan', apply: '/api/agents/deploy/apply' },
|
|
13
14
|
config: { plan: '/api/agents/deploy/config/plan', apply: '/api/agents/deploy/config/apply' },
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return undefined;
|
|
19
|
-
if (typeof only !== 'string') {
|
|
20
|
-
throw new Error('--only must be a comma-separated list of agent IDs');
|
|
21
|
-
}
|
|
22
|
-
const ids = only
|
|
23
|
-
.split(',')
|
|
24
|
-
.map((id) => id.trim())
|
|
25
|
-
.filter(Boolean);
|
|
26
|
-
if (ids.length === 0) {
|
|
27
|
-
throw new Error('--only must include at least one agent ID');
|
|
28
|
-
}
|
|
29
|
-
return [...new Set(ids)];
|
|
16
|
+
/** Config deploys by default; `--managed` selects Sequence's code-managed path. */
|
|
17
|
+
function requestedDeployMode(args) {
|
|
18
|
+
return flagBool(args.flags, 'managed') ? 'managed' : 'config';
|
|
30
19
|
}
|
|
31
20
|
export async function agentsValidateCommand(args) {
|
|
32
21
|
const { source } = await materialize({ args, requireEnvironment: false });
|
|
@@ -63,7 +52,7 @@ async function deploymentBundle({ args, source, context, }) {
|
|
|
63
52
|
* Names the CLI can actually deploy to. A target outside both this set and the
|
|
64
53
|
* manifest's own vocabulary is a typo, not a selection.
|
|
65
54
|
*/
|
|
66
|
-
async function deployEnvironmentNames() {
|
|
55
|
+
export async function deployEnvironmentNames() {
|
|
67
56
|
try {
|
|
68
57
|
return Object.keys((await readConfig()).envs);
|
|
69
58
|
}
|
|
@@ -118,7 +107,7 @@ export async function agentsPlanCommand(args) {
|
|
|
118
107
|
const bundle = await deploymentBundle({ args, source, context });
|
|
119
108
|
const plan = await postJson({
|
|
120
109
|
...clientOptions(context),
|
|
121
|
-
path:
|
|
110
|
+
path: DEPLOY_ROUTES[requestedDeployMode(args)].plan,
|
|
122
111
|
body: {
|
|
123
112
|
definitions: bundle.definitions,
|
|
124
113
|
bundleHash: bundle.hash,
|
|
@@ -132,7 +121,7 @@ export async function agentsPlanCommand(args) {
|
|
|
132
121
|
await source.cleanup();
|
|
133
122
|
}
|
|
134
123
|
}
|
|
135
|
-
export async function agentsApplyCommand(args, { mode =
|
|
124
|
+
export async function agentsApplyCommand(args, { mode = requestedDeployMode(args) } = {}) {
|
|
136
125
|
const routes = DEPLOY_ROUTES[mode];
|
|
137
126
|
const { source, context } = await materialize({
|
|
138
127
|
args,
|
|
@@ -205,12 +194,18 @@ export async function agentsShowCommand(args) {
|
|
|
205
194
|
export const AGENTS_USAGE = `usage:
|
|
206
195
|
seq-studio agents init <dir> scaffold a typed agent
|
|
207
196
|
seq-studio agents validate [--dir d] [--target app] [--only ids] offline compile + validation
|
|
208
|
-
seq-studio agents
|
|
209
|
-
seq-studio agents
|
|
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
|
|
210
200
|
seq-studio agents list -e <env> list visible agents
|
|
211
201
|
seq-studio agents show <id> -e <env> show one agent
|
|
212
202
|
seq-studio agents voice help internal Voice authoring/publication
|
|
213
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
|
+
|
|
214
209
|
Source: local --dir (default .), --repo agents/<name>, or --git-url <url>.
|
|
215
210
|
Use --ref for remote sources. --target selects the deployment APP_ENV when it
|
|
216
211
|
differs from the CLI environment alias (notably OpCo registrations). --only
|
|
@@ -233,6 +228,8 @@ export async function runAgentsCommand(sub, args) {
|
|
|
233
228
|
return await agentsInitCommand(args);
|
|
234
229
|
case 'validate':
|
|
235
230
|
return await agentsValidateCommand(args);
|
|
231
|
+
case 'bundle':
|
|
232
|
+
return await (await import('./bundle.js')).agentsBundleCommand(args);
|
|
236
233
|
case 'plan':
|
|
237
234
|
return await agentsPlanCommand(args);
|
|
238
235
|
case 'apply':
|
|
@@ -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
|
+
}
|
package/dist/agents/source.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
+
import { sourceAuthMode } from '../sandbox-auth.js';
|
|
4
5
|
import { hashAgentBundle, } from '@sequenceholdings/agent-spec';
|
|
5
6
|
import { agentDeployManifestSchema, assertKnownTargetEnvironment, compileAgentDirectory, selectAgentEntries, selectionStats, } from '@sequenceholdings/agent-spec/compiler';
|
|
6
7
|
import { parseSourceSpec, resolveArtifactSource, } from '@sequenceholdings/artifact-studio/source-resolver';
|
|
@@ -19,7 +20,7 @@ function sourceSpec(args) {
|
|
|
19
20
|
}
|
|
20
21
|
function sourceOptions(context) {
|
|
21
22
|
return {
|
|
22
|
-
...(context.authMode ? { authMode: context.authMode } : {}),
|
|
23
|
+
...(context.authMode ? { authMode: sourceAuthMode(context.authMode) } : {}),
|
|
23
24
|
...clientOptions(context),
|
|
24
25
|
};
|
|
25
26
|
}
|
package/dist/app/adapters.js
CHANGED
|
@@ -5,6 +5,7 @@ import { join } from 'node:path';
|
|
|
5
5
|
import { load as loadYaml } from 'js-yaml';
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { resolveArtifactSource } from '@sequenceholdings/artifact-studio/source-resolver';
|
|
8
|
+
import { sourceAuthMode } from '../sandbox-auth.js';
|
|
8
9
|
import { checkOfficialArtifactSource } from './official-source.js';
|
|
9
10
|
const functionIdentitySchema = z.object({ function: z.object({ id: z.string() }) });
|
|
10
11
|
const artifactIdentitySchema = z.object({ artifact: z.object({ project_id: z.string() }) });
|
|
@@ -88,7 +89,7 @@ async function validatePipelineSource(args) {
|
|
|
88
89
|
if (!namespace || !name || repo.split('/').length !== 2) {
|
|
89
90
|
throw new Error(`Pipeline "${args.entry.id}" requires a <namespace>/<name> repository.`);
|
|
90
91
|
}
|
|
91
|
-
const source = await resolveArtifactSource({ kind: 'git-service', namespace, name, ref }, { ...clientOptions(context), ...(context.authMode ? { authMode: context.authMode } : {}) });
|
|
92
|
+
const source = await resolveArtifactSource({ kind: 'git-service', namespace, name, ref }, { ...clientOptions(context), ...(context.authMode ? { authMode: sourceAuthMode(context.authMode) } : {}) });
|
|
92
93
|
try {
|
|
93
94
|
const commit = source.provenance.gitCommit;
|
|
94
95
|
if (!commit || !/^[0-9a-f]{40}$/i.test(commit)) {
|
|
@@ -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) {
|