@sequenceholdings/studio-cli 0.9.20 → 0.9.21
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 +131 -11
- package/dist/app/commands.js +2 -0
- package/dist/app/deploy.js +2 -0
- package/dist/app/lockfile-preflight.d.ts +31 -0
- package/dist/app/lockfile-preflight.js +47 -0
- package/dist/app/repository-index.d.ts +5 -1
- package/dist/app/repository-index.js +9 -3
- package/dist/auth.d.ts +13 -9
- package/dist/auth.js +98 -20
- package/dist/cli-errors.js +6 -1
- package/dist/command-contract.d.ts +13 -1
- package/dist/command-contract.js +3 -1
- package/dist/command-help.d.ts +1 -1
- package/dist/command-help.js +8 -1
- package/dist/config.d.ts +14 -0
- package/dist/config.js +29 -3
- package/dist/docs/commands.d.ts +16 -0
- package/dist/docs/commands.js +168 -0
- package/dist/docs/help.d.ts +2 -0
- package/dist/docs/help.js +12 -0
- package/dist/envs/commands.js +10 -2
- package/dist/host-token.d.ts +19 -4
- package/dist/host-token.js +50 -10
- package/dist/main.d.ts +1 -0
- package/dist/main.js +20 -2
- package/dist/orm/discover-operations.d.ts +1 -1
- package/dist/orm/discover-operations.js +3 -3
- package/dist/orm/discover-schema.d.ts +0 -5
- package/dist/orm/discover-schema.js +0 -3
- package/dist/pipeline/commands.d.ts +0 -7
- package/dist/pipeline/commands.js +16 -67
- package/dist/pipeline/discovery.d.ts +1 -1
- package/dist/pipeline/discovery.js +6 -6
- package/dist/process/build.d.ts +2 -5
- package/dist/process/build.js +4 -49
- package/dist/repos/commands.d.ts +11 -1
- package/dist/repos/commands.js +78 -11
- package/dist/repos/git-credential.d.ts +12 -5
- package/dist/repos/git-credential.js +63 -36
- package/dist/repos/github-connect-command.d.ts +35 -0
- package/dist/repos/github-connect-command.js +250 -0
- package/dist/repos/github-init-command.d.ts +5 -0
- package/dist/repos/github-init-command.js +106 -0
- package/dist/repos/github-init.d.ts +133 -0
- package/dist/repos/github-init.js +265 -0
- package/dist/scaffold-guidance.d.ts +10 -2
- package/dist/scaffold-guidance.js +27 -2
- package/dist/templates/guidance/AGENTS.md +15 -8
- package/package.json +7 -7
- package/release-summary.json +2 -1
- package/templates/guidance/AGENTS.md +15 -8
- package/dist/pipeline/active-orm-contracts.d.ts +0 -16
- package/dist/pipeline/active-orm-contracts.js +0 -36
- package/dist/pipeline/repin-orm.d.ts +0 -2
- package/dist/pipeline/repin-orm.js +0 -207
package/dist/main.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* seq-studio templates <sub> publish and synchronize Git-backed templates
|
|
15
15
|
* seq-studio pipeline <sub> discover, query, author and operate Data Pipelines
|
|
16
16
|
* seq-studio auth <sub> manage Git authentication
|
|
17
|
+
* seq-studio docs <sub> search and read the environment's developer docs
|
|
17
18
|
* seq-studio feedback submit submit agent feedback
|
|
18
19
|
* seq-studio service-accounts <sub> provision runtime identities
|
|
19
20
|
* seq-studio access <sub> manage resource access on every primitive
|
|
@@ -43,10 +44,12 @@ const TOP_LEVEL_USAGE = `usage:
|
|
|
43
44
|
seq-studio storage <sub> [args] init | validate | apply | list | show | mkdir | upload | download | access | trash | restore | purge | operations | abort | delete
|
|
44
45
|
seq-studio agents <sub> [args] init | validate | bundle | plan | apply | list | show | voice (internal)
|
|
45
46
|
seq-studio secrets <sub> [args] create | set | list | attach | detach | apply
|
|
47
|
+
seq-studio repo init [--check] set up a GitHub checkout: workflows, Renovate, agent skill, branch rules
|
|
46
48
|
seq-studio repos <sub> [args] list | namespaces | show | identity | create | clone | pull | pulls | delete | ci
|
|
47
49
|
seq-studio templates <sub> [args] publish | sync | list
|
|
48
50
|
seq-studio pipeline <sub> [args] list | assets | search | describe | schema | sample | query | init | validate | repin-orm | codegen | plan | adopt | unbind | retire | deploy | status | migrate | promote | rollback | run-now
|
|
49
51
|
seq-studio auth <sub> [args] whoami | git-credential
|
|
52
|
+
seq-studio docs <sub> -e <env> search <query> | read <slug> | list (read before guessing commands)
|
|
50
53
|
seq-studio feedback submit --file report.json [-e <env>] [--json]
|
|
51
54
|
seq-studio orm <sub> [args] init | generate | validate | plan | apply | deployment-policy | execute | read | sql | diff | migrate-from-yaml | import
|
|
52
55
|
seq-studio service-accounts <sub> list | show | create (requires provisioning authority)
|
|
@@ -73,7 +76,7 @@ const TOP_LEVEL_USAGE = `usage:
|
|
|
73
76
|
\`seq-studio envs add <name> <url>\`; custom entries live in ~/.config/lattice/config.toml.
|
|
74
77
|
If this CLI cannot complete a documented step, read that environment's docs
|
|
75
78
|
before trying another tool. \`seq-studio envs list\` prints each environment URL.
|
|
76
|
-
Docs: <url>/docs. Feedback guide: <url>/docs/raw/seq-studio/feedback.md.
|
|
79
|
+
Docs: seq-studio docs search <query> -e <env>, or <url>/docs. Feedback guide: <url>/docs/raw/seq-studio/feedback.md.
|
|
77
80
|
`;
|
|
78
81
|
const PROCESS_USAGE = `usage:
|
|
79
82
|
seq-studio process init <dir>
|
|
@@ -103,13 +106,14 @@ const SUBCOMMANDS = {
|
|
|
103
106
|
storage: new Set(['init', 'validate', 'apply', 'list', 'show', 'mkdir', 'upload', 'import', 'uploads', 'reconcile', 'download', 'access', 'trash', 'restore', 'purge', 'operations', 'abort', 'delete']),
|
|
104
107
|
agents: new Set(['init', 'validate', 'bundle', 'plan', 'apply', 'list', 'show', 'voice']),
|
|
105
108
|
secrets: new Set(['create', 'set', 'list', 'attach', 'detach', 'apply', 'versions', 'set-default', 'pin']),
|
|
106
|
-
repos: new Set(['list', 'namespaces', 'show', 'identity', 'create', 'clone', 'pull', 'pulls', 'delete', 'ci']),
|
|
109
|
+
repos: new Set(['list', 'namespaces', 'show', 'identity', 'create', 'clone', 'attach-login', 'pull', 'pulls', 'delete', 'ci']),
|
|
107
110
|
templates: new Set(['publish', 'sync', 'list']),
|
|
108
111
|
'service-accounts': new Set(['list', 'show', 'create']),
|
|
109
112
|
access: new Set(['definitions', 'resolve', 'list', 'grant', 'revoke', 'roles']),
|
|
110
113
|
principals: new Set(['search', 'users', 'groups']),
|
|
111
114
|
auth: new Set(['whoami', 'git-credential', 'pat']),
|
|
112
115
|
feedback: new Set(['submit']),
|
|
116
|
+
docs: new Set(['search', 'read', 'list']),
|
|
113
117
|
orm: new Set(['init', 'generate', 'validate', 'plan', 'apply', 'history', 'deployment-policy', 'execute', 'namespaces', 'describe', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import']),
|
|
114
118
|
pipeline: new Set(['list', 'assets', 'search', 'describe', 'schema', 'sample', 'query', 'init', 'validate', 'repin-orm', 'codegen', 'adopt', 'unbind', 'retire', 'plan', 'deploy', 'status', 'migrate', 'promote', 'rollback', 'run-now']),
|
|
115
119
|
envs: new Set(['add', 'list']),
|
|
@@ -229,6 +233,18 @@ async function dispatch(argv) {
|
|
|
229
233
|
const { runSecretsCommand } = await import('./secrets/commands.js');
|
|
230
234
|
return runSecretsCommand(sub, parseArgs(rest));
|
|
231
235
|
}
|
|
236
|
+
case 'repo': {
|
|
237
|
+
if (sub === 'connect' || sub === 'disconnect' || sub === 'status' || sub === 'bind') {
|
|
238
|
+
const { runRepoConnectCommand } = await import('./repos/github-connect-command.js');
|
|
239
|
+
return runRepoConnectCommand(sub, parseArgs(rest));
|
|
240
|
+
}
|
|
241
|
+
if (sub !== 'init') {
|
|
242
|
+
console.error('usage: seq-studio repo init|connect|bind|disconnect|status (see seq-studio repo <command> --help)');
|
|
243
|
+
return 2;
|
|
244
|
+
}
|
|
245
|
+
const { runRepoInitCommand } = await import('./repos/github-init-command.js');
|
|
246
|
+
return runRepoInitCommand(parseArgs(rest));
|
|
247
|
+
}
|
|
232
248
|
case 'repos': {
|
|
233
249
|
const { runReposCommand } = await import('./repos/commands.js');
|
|
234
250
|
return runReposCommand(sub, parseArgs(rest));
|
|
@@ -251,6 +267,8 @@ async function dispatch(argv) {
|
|
|
251
267
|
}
|
|
252
268
|
case 'feedback':
|
|
253
269
|
return (await import('./feedback/commands.js')).runFeedbackCommand(sub, parseArgs(rest));
|
|
270
|
+
case 'docs':
|
|
271
|
+
return (await import('./docs/commands.js')).runDocsCommand(sub, parseArgs(rest));
|
|
254
272
|
case 'auth': {
|
|
255
273
|
const { runAuthCommand } = await import('./auth-cmds/commands.js');
|
|
256
274
|
return runAuthCommand(sub, parseArgs(rest));
|
|
@@ -7,7 +7,7 @@ export declare function getNamespaceJson({ options, namespace, path }: {
|
|
|
7
7
|
namespace: string;
|
|
8
8
|
path: string;
|
|
9
9
|
}): Promise<unknown>;
|
|
10
|
-
export type OperationListing = Pick<OperationsPage, 'operation_set_id' | 'schema_version_id'
|
|
10
|
+
export type OperationListing = Pick<OperationsPage, 'operation_set_id' | 'schema_version_id'> & {
|
|
11
11
|
operations: Operation[];
|
|
12
12
|
};
|
|
13
13
|
export declare function listAllOperations({ options, namespace }: {
|
|
@@ -35,14 +35,14 @@ export async function listAllOperations({ options, namespace }) {
|
|
|
35
35
|
}
|
|
36
36
|
if (first) {
|
|
37
37
|
if (page.operation_set_id !== first.operation_set_id || page.schema_version_id !== first.schema_version_id ||
|
|
38
|
-
page.
|
|
38
|
+
page.total !== first.total) {
|
|
39
39
|
throw new Error(`The active operation set changed while reading '${namespace}'. Retry orm describe ${namespace}.`);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
else
|
|
43
43
|
first = page;
|
|
44
44
|
if (page.operation_set_id === null && (page.operations.length !== 0 || page.total !== 0 ||
|
|
45
|
-
page.schema_version_id != null
|
|
45
|
+
page.schema_version_id != null)) {
|
|
46
46
|
throw new Error(`Invalid empty active operation set for '${namespace}'. Retry orm describe ${namespace}.`);
|
|
47
47
|
}
|
|
48
48
|
if (page.operations.length === 0 && operations.length < page.total) {
|
|
@@ -54,7 +54,7 @@ export async function listAllOperations({ options, namespace }) {
|
|
|
54
54
|
}
|
|
55
55
|
if (operations.length === page.total) {
|
|
56
56
|
return { operations, operation_set_id: first.operation_set_id,
|
|
57
|
-
schema_version_id: first.schema_version_id
|
|
57
|
+
schema_version_id: first.schema_version_id };
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -166,7 +166,6 @@ declare const variableSchema: z.ZodObject<{
|
|
|
166
166
|
}, z.core.$loose>;
|
|
167
167
|
declare const operationSchema: z.ZodObject<{
|
|
168
168
|
name: z.ZodString;
|
|
169
|
-
op_hash: z.ZodString;
|
|
170
169
|
kind: z.ZodString;
|
|
171
170
|
requires: z.ZodNullable<z.ZodObject<{
|
|
172
171
|
capability: z.ZodOptional<z.ZodString>;
|
|
@@ -194,7 +193,6 @@ declare const operationSchema: z.ZodObject<{
|
|
|
194
193
|
export declare const operationsPageSchema: z.ZodObject<{
|
|
195
194
|
operations: z.ZodArray<z.ZodObject<{
|
|
196
195
|
name: z.ZodString;
|
|
197
|
-
op_hash: z.ZodString;
|
|
198
196
|
kind: z.ZodString;
|
|
199
197
|
requires: z.ZodNullable<z.ZodObject<{
|
|
200
198
|
capability: z.ZodOptional<z.ZodString>;
|
|
@@ -223,13 +221,11 @@ export declare const operationsPageSchema: z.ZodObject<{
|
|
|
223
221
|
namespace: z.ZodOptional<z.ZodString>;
|
|
224
222
|
operation_set_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
225
223
|
schema_version_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
|
-
ops_hash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
227
224
|
offset: z.ZodOptional<z.ZodNumber>;
|
|
228
225
|
}, z.core.$loose>;
|
|
229
226
|
/** `GET /api/orm/namespaces/<ns>/operations/<name>`: one operation of the active set. */
|
|
230
227
|
export declare const operationDetailSchema: z.ZodObject<{
|
|
231
228
|
name: z.ZodString;
|
|
232
|
-
op_hash: z.ZodString;
|
|
233
229
|
kind: z.ZodString;
|
|
234
230
|
requires: z.ZodNullable<z.ZodObject<{
|
|
235
231
|
capability: z.ZodOptional<z.ZodString>;
|
|
@@ -253,7 +249,6 @@ export declare const operationDetailSchema: z.ZodObject<{
|
|
|
253
249
|
/** The reader-gated active operation detail also includes its registered document. */
|
|
254
250
|
export declare const operationInspectionSchema: z.ZodObject<{
|
|
255
251
|
name: z.ZodString;
|
|
256
|
-
op_hash: z.ZodString;
|
|
257
252
|
kind: z.ZodString;
|
|
258
253
|
requires: z.ZodNullable<z.ZodObject<{
|
|
259
254
|
capability: z.ZodOptional<z.ZodString>;
|
|
@@ -82,7 +82,6 @@ const variableSchema = z.looseObject({
|
|
|
82
82
|
});
|
|
83
83
|
const operationSchema = z.looseObject({
|
|
84
84
|
name: z.string(),
|
|
85
|
-
op_hash: z.string(),
|
|
86
85
|
kind: z.string(),
|
|
87
86
|
requires: requiresSchema,
|
|
88
87
|
mutation_roots: z.array(z.looseObject({ table: z.string(), op: z.string() })).default([]),
|
|
@@ -95,13 +94,11 @@ export const operationsPageSchema = z.looseObject({
|
|
|
95
94
|
namespace: z.string().optional(),
|
|
96
95
|
operation_set_id: z.string().nullable().optional(),
|
|
97
96
|
schema_version_id: z.string().nullable().optional(),
|
|
98
|
-
ops_hash: z.string().nullable().optional(),
|
|
99
97
|
offset: z.number().int().nonnegative().optional(),
|
|
100
98
|
});
|
|
101
99
|
/** `GET /api/orm/namespaces/<ns>/operations/<name>`: one operation of the active set. */
|
|
102
100
|
export const operationDetailSchema = z.looseObject({
|
|
103
101
|
name: z.string(),
|
|
104
|
-
op_hash: z.string(),
|
|
105
102
|
kind: z.string(),
|
|
106
103
|
requires: requiresSchema,
|
|
107
104
|
variables: z.array(variableSchema),
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
* the CLI without the package get a clear install hint instead of a crash.
|
|
13
13
|
*/
|
|
14
14
|
import type { ParsedArgs } from '../process/commands.js';
|
|
15
|
-
/** Conventional ORM contract catalog filename beside stage specs (CI auto-loads this). */
|
|
16
|
-
export declare const ORM_CONTRACTS_FILENAME = "orm-contracts.json";
|
|
17
15
|
/**
|
|
18
16
|
* Same classification as the orm delegate: is the pipeline-spec package
|
|
19
17
|
* itself absent (installable) or did one of its dependencies fail to load?
|
|
@@ -56,11 +54,6 @@ export declare function buildExternalAssetsRequest({ source, knownOrigins, token
|
|
|
56
54
|
export declare function configuredEnvOrigins(envs: Readonly<Record<string, {
|
|
57
55
|
url: string;
|
|
58
56
|
}>>): string[];
|
|
59
|
-
/** Resolve ORM contracts from --orm-contracts or conventional orm-contracts.json. */
|
|
60
|
-
export declare function resolveOrmContractsPath({ dir, flag, }: {
|
|
61
|
-
dir: string;
|
|
62
|
-
flag: unknown;
|
|
63
|
-
}): string | undefined;
|
|
64
57
|
export declare function pipelineValidateCommand(args: ParsedArgs): Promise<number>;
|
|
65
58
|
export declare function runPipelineCommand(sub: string | undefined, args: ParsedArgs): Promise<number>;
|
|
66
59
|
export {};
|
|
@@ -23,31 +23,23 @@ import { writeScaffoldGuidance } from '../scaffold-guidance.js';
|
|
|
23
23
|
import { PIPELINE_DISCOVERY_USAGE, runPipelineDiscoveryCommand } from './discovery.js';
|
|
24
24
|
import { renderEntrypointStub, renderStageTemplate, STAGE_TYPES, } from './templates.js';
|
|
25
25
|
const LOG = '[seq-studio]';
|
|
26
|
-
/** Conventional ORM contract catalog filename beside stage specs (CI auto-loads this). */
|
|
27
|
-
export const ORM_CONTRACTS_FILENAME = 'orm-contracts.json';
|
|
28
26
|
const PIPELINE_USAGE = `usage:
|
|
29
27
|
${PIPELINE_DISCOVERY_USAGE}
|
|
30
28
|
seq-studio pipeline init --type ingestion|transformation|serving <name> [--dir <dir>]
|
|
31
29
|
scaffold <name>.stage.yml in the first configured stage directory (or
|
|
32
30
|
package root without config) + package-root-relative src/ entrypoint stub
|
|
33
31
|
|
|
34
|
-
seq-studio pipeline validate [dir] [--assets <file|url>] [--
|
|
32
|
+
seq-studio pipeline validate [dir] [--assets <file|url>] [--json]
|
|
35
33
|
run the offline spec gate: envelope + body validation, schema_ref
|
|
36
34
|
resolution, and repo-level graph validation (references, single-writer,
|
|
37
35
|
cycles, column subsets). --assets supplies a registry asset export for
|
|
38
|
-
cross-Pipeline references
|
|
39
|
-
|
|
40
|
-
any error-severity finding. Also validates optional pipeline.yml native
|
|
36
|
+
cross-Pipeline references. external-assets.json is a package-local default.
|
|
37
|
+
Exits 1 on any error-severity finding. Also validates optional pipeline.yml native
|
|
41
38
|
workflow dependencies and manual stage membership.
|
|
42
39
|
From the pipeline tooling/app directory, install both CLI and spec:
|
|
43
40
|
pnpm add --save-dev @sequenceholdings/studio-cli @sequenceholdings/pipeline-spec
|
|
44
41
|
pnpm exec seq-studio pipeline validate .
|
|
45
42
|
|
|
46
|
-
seq-studio pipeline repin-orm [dir] -e <env> [--target <id>] [--dry-run]
|
|
47
|
-
fetch active ORM synced-table contracts, verify serving compatibility,
|
|
48
|
-
then update orm-contracts.json and every matching satisfies.content_hash;
|
|
49
|
-
target is inferred when the environment exposes exactly one
|
|
50
|
-
|
|
51
43
|
seq-studio pipeline retire --repo <release-unit> -e <env> [--stages <slugs>] [--target <id>] [--json]
|
|
52
44
|
preview retirement of the whole pipeline or selected omitted stages; retain data and history
|
|
53
45
|
approve the exact inventory with --plan-hash <hash> --yes
|
|
@@ -317,34 +309,6 @@ async function loadExternalAssets(spec, source) {
|
|
|
317
309
|
}
|
|
318
310
|
return spec.externalAssetsExportSchema.parse(JSON.parse(raw));
|
|
319
311
|
}
|
|
320
|
-
async function loadOrmContracts(spec, source) {
|
|
321
|
-
let raw;
|
|
322
|
-
if (/^https?:\/\//.test(source)) {
|
|
323
|
-
const config = await readConfig();
|
|
324
|
-
const token = await tryGetAccessToken();
|
|
325
|
-
const request = buildExternalAssetsRequest({
|
|
326
|
-
source,
|
|
327
|
-
knownOrigins: configuredEnvOrigins(config.envs),
|
|
328
|
-
token,
|
|
329
|
-
});
|
|
330
|
-
const response = await fetch(request.url, request.init);
|
|
331
|
-
if (!response.ok) {
|
|
332
|
-
throw new Error(`fetching ORM contracts catalog failed: ${response.status} ${response.statusText}`);
|
|
333
|
-
}
|
|
334
|
-
raw = await response.text();
|
|
335
|
-
}
|
|
336
|
-
else {
|
|
337
|
-
raw = await readFile(resolve(source), 'utf8');
|
|
338
|
-
}
|
|
339
|
-
return spec.ormContractCatalogSchema.parse(JSON.parse(raw));
|
|
340
|
-
}
|
|
341
|
-
/** Resolve ORM contracts from --orm-contracts or conventional orm-contracts.json. */
|
|
342
|
-
export function resolveOrmContractsPath({ dir, flag, }) {
|
|
343
|
-
if (typeof flag === 'string')
|
|
344
|
-
return flag;
|
|
345
|
-
const conventional = join(dir, ORM_CONTRACTS_FILENAME);
|
|
346
|
-
return existsSync(conventional) ? conventional : undefined;
|
|
347
|
-
}
|
|
348
312
|
function printHumanReport(report) {
|
|
349
313
|
for (const finding of report.findings) {
|
|
350
314
|
const prefix = finding.severity === 'error' ? 'error' : 'warning';
|
|
@@ -373,6 +337,12 @@ export async function pipelineValidateCommand(args) {
|
|
|
373
337
|
}
|
|
374
338
|
return report.ok ? 0 : 1;
|
|
375
339
|
};
|
|
340
|
+
if ('orm-contracts' in args.flags || 'scoped-orm-contracts' in args.flags) {
|
|
341
|
+
return emit({ ok: false, dir: dirArg, stages: [], findings: [{ severity: 'error',
|
|
342
|
+
code: 'unsupported_orm_contract_option',
|
|
343
|
+
message: 'Pipeline validation is independent of ORM contracts. Remove --orm-contracts and --scoped-orm-contracts.',
|
|
344
|
+
}] });
|
|
345
|
+
}
|
|
376
346
|
let pipeline;
|
|
377
347
|
try {
|
|
378
348
|
pipeline = await spec.loadSpecDirectory(dir);
|
|
@@ -400,9 +370,13 @@ export async function pipelineValidateCommand(args) {
|
|
|
400
370
|
throw error;
|
|
401
371
|
}
|
|
402
372
|
let externalAssets;
|
|
403
|
-
|
|
373
|
+
const conventionalAssetsPath = join(dir, 'external-assets.json');
|
|
374
|
+
const assetsPath = typeof args.flags.assets === 'string'
|
|
375
|
+
? args.flags.assets
|
|
376
|
+
: existsSync(conventionalAssetsPath) ? conventionalAssetsPath : undefined;
|
|
377
|
+
if (assetsPath) {
|
|
404
378
|
try {
|
|
405
|
-
externalAssets = await loadExternalAssets(spec,
|
|
379
|
+
externalAssets = await loadExternalAssets(spec, assetsPath);
|
|
406
380
|
}
|
|
407
381
|
catch (error) {
|
|
408
382
|
return emit({
|
|
@@ -419,28 +393,7 @@ export async function pipelineValidateCommand(args) {
|
|
|
419
393
|
});
|
|
420
394
|
}
|
|
421
395
|
}
|
|
422
|
-
|
|
423
|
-
const ormContractsPath = resolveOrmContractsPath({ dir, flag: args.flags['orm-contracts'] });
|
|
424
|
-
if (ormContractsPath) {
|
|
425
|
-
try {
|
|
426
|
-
ormContracts = await loadOrmContracts(spec, ormContractsPath);
|
|
427
|
-
}
|
|
428
|
-
catch (error) {
|
|
429
|
-
return emit({
|
|
430
|
-
ok: false,
|
|
431
|
-
dir: dirArg,
|
|
432
|
-
stages: pipeline.stages.map((stage) => stage.stage),
|
|
433
|
-
findings: [
|
|
434
|
-
{
|
|
435
|
-
severity: 'error',
|
|
436
|
-
code: 'orm_contracts_unreadable',
|
|
437
|
-
message: error instanceof Error ? error.message : String(error),
|
|
438
|
-
},
|
|
439
|
-
],
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
const result = spec.validateSpecGraph(pipeline.stages, externalAssets, ormContracts !== undefined ? { ormContracts } : undefined);
|
|
396
|
+
const result = spec.validateReleaseContracts(pipeline.stages, externalAssets);
|
|
444
397
|
return emit({
|
|
445
398
|
ok: result.ok,
|
|
446
399
|
dir: dirArg,
|
|
@@ -468,10 +421,6 @@ export async function runPipelineCommand(sub, args) {
|
|
|
468
421
|
return pipelineInitCommand(args);
|
|
469
422
|
case 'validate':
|
|
470
423
|
return pipelineValidateCommand(args);
|
|
471
|
-
case 'repin-orm': {
|
|
472
|
-
const { pipelineRepinOrmCommand } = await import('./repin-orm.js');
|
|
473
|
-
return pipelineRepinOrmCommand(args);
|
|
474
|
-
}
|
|
475
424
|
case 'codegen': {
|
|
476
425
|
const codegenSub = args.positional[0];
|
|
477
426
|
if (codegenSub === 'tables') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ParsedArgs } from '../process/commands.js';
|
|
2
2
|
type DiscoveryCommand = 'list' | 'assets' | 'search' | 'describe' | 'schema' | 'sample' | 'query';
|
|
3
|
-
export declare const PIPELINE_DISCOVERY_USAGE = " seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repositories (default 50 per page), health and descriptions\n\n seq-studio pipeline assets -e <env> [--repo <namespace>/<name>] [--json]\n discover exact asset IDs from the latest declared specs; --repo filters\n both assets and the SDK export. Declarations may not be deployed yet.\n\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<name>]\n [--limit 1..100] [--offset N] [--json]\n search active asset/column names and descriptions without contacting Databricks\n Case-insensitive literal text (1..200 characters); default 20 assets per page.\n\n seq-studio pipeline describe <asset> -e <env> [--target <id>] [--repo <namespace>/<name>] [--json]\n read active deployed descriptions and declared columns without contacting Databricks\n Includes deployment/source provenance; physical schema is not verified.\n\n seq-studio pipeline schema <asset> -e <env> [--target <id>] [--json]\n read observed columns, types and available descriptions from the active deployment\n\n seq-studio pipeline sample <asset> -e <env> [--target <id>] [--limit 1..100] [--json]\n preview rows (default 25); output reports deployment and truncation\n\n seq-studio pipeline query <asset> --sql <sql> -e <env> [--target <id>] [--limit 1..1000] [--json]\n run read-only SQL against the virtual relation asset (default limit 1000)\n Example: --sql 'SELECT * FROM asset LIMIT 5'. Cross-asset joins are unsupported.\n\n Discovery requires staff access. Search, then describe a relevant asset; use\n schema to verify physical columns, then sample and query values before authoring.\n Metadata reflects active deployments, not unactivated edits. Descriptions do not prove keys\n or relationships. Use --json for the full response, including deployment context.\n -e selects the connection; --target selects its logical deployment target when needed.\n";
|
|
3
|
+
export declare const PIPELINE_DISCOVERY_USAGE = " seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repositories (default 50 per page), health and descriptions\n\n seq-studio pipeline assets -e <env> [--repo <namespace>/<name>] [--json]\n discover exact asset IDs from the latest declared specs; --repo filters\n both assets and the SDK export. Declarations may not be deployed yet.\n\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<name>]\n [--limit 1..100] [--offset N] [--json]\n search active asset/column names and descriptions without contacting Databricks\n Case-insensitive literal text (1..200 characters); default 20 assets per page.\n\n seq-studio pipeline describe <asset> -e <env> [--target <id>] [--repo <namespace>/<name>] [--json]\n read active deployed descriptions and declared columns without contacting Databricks\n Includes deployment/source provenance; physical schema is not verified.\n\n seq-studio pipeline schema <asset> -e <env> [--target <id>] [--repo <namespace>/<name>] [--json]\n read observed columns, types and available descriptions from the active deployment\n\n seq-studio pipeline sample <asset> -e <env> [--target <id>] [--repo <namespace>/<name>] [--limit 1..100] [--json]\n preview rows (default 25); output reports deployment and truncation\n\n seq-studio pipeline query <asset> --sql <sql> -e <env> [--target <id>] [--repo <namespace>/<name>] [--limit 1..1000] [--json]\n run read-only SQL against the virtual relation asset (default limit 1000)\n Example: --sql 'SELECT * FROM asset LIMIT 5'. Cross-asset joins are unsupported.\n\n Discovery requires staff access. Search, then describe a relevant asset; use\n schema to verify physical columns, then sample and query values before authoring.\n Metadata reflects active deployments, not unactivated edits. Descriptions do not prove keys\n or relationships. Use --json for the full response, including deployment context.\n -e selects the connection; --target selects its logical deployment target when needed.\n";
|
|
4
4
|
export declare function runPipelineDiscoveryCommand({ sub, args }: {
|
|
5
5
|
sub: DiscoveryCommand;
|
|
6
6
|
args: ParsedArgs;
|
|
@@ -21,13 +21,13 @@ export const PIPELINE_DISCOVERY_USAGE = ` seq-studio pipeline list -e <env> [--
|
|
|
21
21
|
read active deployed descriptions and declared columns without contacting Databricks
|
|
22
22
|
Includes deployment/source provenance; physical schema is not verified.
|
|
23
23
|
|
|
24
|
-
seq-studio pipeline schema <asset> -e <env> [--target <id>] [--json]
|
|
24
|
+
seq-studio pipeline schema <asset> -e <env> [--target <id>] [--repo <namespace>/<name>] [--json]
|
|
25
25
|
read observed columns, types and available descriptions from the active deployment
|
|
26
26
|
|
|
27
|
-
seq-studio pipeline sample <asset> -e <env> [--target <id>] [--limit 1..100] [--json]
|
|
27
|
+
seq-studio pipeline sample <asset> -e <env> [--target <id>] [--repo <namespace>/<name>] [--limit 1..100] [--json]
|
|
28
28
|
preview rows (default 25); output reports deployment and truncation
|
|
29
29
|
|
|
30
|
-
seq-studio pipeline query <asset> --sql <sql> -e <env> [--target <id>] [--limit 1..1000] [--json]
|
|
30
|
+
seq-studio pipeline query <asset> --sql <sql> -e <env> [--target <id>] [--repo <namespace>/<name>] [--limit 1..1000] [--json]
|
|
31
31
|
run read-only SQL against the virtual relation asset (default limit 1000)
|
|
32
32
|
Example: --sql 'SELECT * FROM asset LIMIT 5'. Cross-asset joins are unsupported.
|
|
33
33
|
|
|
@@ -68,9 +68,9 @@ function validateDiscoveryArguments({ sub, args }) {
|
|
|
68
68
|
const readsAsset = sub === 'describe' || sub === 'schema' || sub === 'sample' || sub === 'query';
|
|
69
69
|
const readsPositional = readsAsset || sub === 'search';
|
|
70
70
|
const options = {
|
|
71
|
-
list: ['limit', 'offset'], assets: ['repo'], schema: ['target'],
|
|
71
|
+
list: ['limit', 'offset'], assets: ['repo'], schema: ['target', 'repo'],
|
|
72
72
|
search: ['target', 'repo', 'limit', 'offset'], describe: ['target', 'repo'],
|
|
73
|
-
sample: ['target', 'limit'], query: ['target', 'limit', 'sql'],
|
|
73
|
+
sample: ['target', 'repo', 'limit'], query: ['target', 'repo', 'limit', 'sql'],
|
|
74
74
|
};
|
|
75
75
|
const allowed = new Set(['e', 'env', 'json', ...options[sub]]);
|
|
76
76
|
for (const flag of Object.keys(args.flags)) {
|
|
@@ -220,7 +220,7 @@ export async function runPipelineDiscoveryCommand({ sub, args }) {
|
|
|
220
220
|
const target = await resolvePipelineTarget({ args, env, token });
|
|
221
221
|
const result = await postJson({
|
|
222
222
|
...client, path: '/api/data-pipelines/assets/query',
|
|
223
|
-
body: { assetId: args.positional[0], environment: target.id, mode: sub, ...(options.sql !== undefined ? { sql: options.sql } : {}), ...(options.limit !== undefined ? { limit: options.limit } : {}) },
|
|
223
|
+
body: { assetId: args.positional[0], environment: target.id, mode: sub, ...(options.repo !== undefined ? { repo: options.repo } : {}), ...(options.sql !== undefined ? { sql: options.sql } : {}), ...(options.limit !== undefined ? { limit: options.limit } : {}) },
|
|
224
224
|
});
|
|
225
225
|
if (options.json)
|
|
226
226
|
console.log(JSON.stringify(result, null, 2));
|
package/dist/process/build.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { type LatticeBundle, type LatticeBundleSummary } from '@sequenceholdings/lattice/bundle';
|
|
1
|
+
import { type ResolveProcessPin, type LatticeBundle, type LatticeBundleSummary } from '@sequenceholdings/lattice/bundle';
|
|
2
2
|
import type { LoadedProcess } from './discover.js';
|
|
3
|
-
export type ResolveProcessPin
|
|
4
|
-
version: string;
|
|
5
|
-
bundleHash: string;
|
|
6
|
-
} | null>;
|
|
3
|
+
export type { ResolveProcessPin };
|
|
7
4
|
export interface BuildBundleOptions {
|
|
8
5
|
resolveProcessPin?: ResolveProcessPin;
|
|
9
6
|
/** Override git provenance instead of reading from the local working tree. */
|
package/dist/process/build.js
CHANGED
|
@@ -4,22 +4,16 @@ import { authoredNodeMetadata } from './node-metadata.js';
|
|
|
4
4
|
* source tree.
|
|
5
5
|
*/
|
|
6
6
|
import { execSync } from 'node:child_process';
|
|
7
|
-
import { finalizeBundleIdentity,
|
|
7
|
+
import { finalizeBundleIdentity, pinBundleSubprocessRefs, pinExternalSubprocessRefs, } from '@sequenceholdings/lattice/bundle';
|
|
8
8
|
import { isJsonataExpr, parseDurationMs, serializeRetryConfig, } from '@sequenceholdings/lattice/define';
|
|
9
9
|
export async function buildBundleFromProcesses(defs, options) {
|
|
10
10
|
if (defs.length === 0) {
|
|
11
11
|
throw new Error('no lattice process definitions found in configured roots');
|
|
12
12
|
}
|
|
13
13
|
const processes = defs.map((d) => serializeProcess({ process: d.process }));
|
|
14
|
-
const localProcessIds = new Set(processes.map((p) => p.id));
|
|
15
14
|
if (options?.resolveProcessPin) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
// finalizeBundleIdentity to this bundle's own version/hash.
|
|
19
|
-
if (!version && localProcessIds.has(processId))
|
|
20
|
-
return null;
|
|
21
|
-
return options.resolveProcessPin(processId, version);
|
|
22
|
-
});
|
|
15
|
+
// Children from other roots that the resolver cannot find stay unpinned; registration refuses them.
|
|
16
|
+
await pinExternalSubprocessRefs(processes, options.resolveProcessPin);
|
|
23
17
|
}
|
|
24
18
|
const metadata = options?.provenance
|
|
25
19
|
? collectGitMetadataWithOverrides(options.provenance)
|
|
@@ -29,46 +23,7 @@ export async function buildBundleFromProcesses(defs, options) {
|
|
|
29
23
|
return finalizeBundleIdentity({ processes, metadata });
|
|
30
24
|
}
|
|
31
25
|
export async function finalizeCompiledBundle({ bundle, resolveProcessPin, }) {
|
|
32
|
-
|
|
33
|
-
const localProcessIds = new Set(processes.map((process) => process.id));
|
|
34
|
-
await resolveSubprocessPinsInProcesses(processes, async (processId, version) => {
|
|
35
|
-
if (!version && localProcessIds.has(processId))
|
|
36
|
-
return null;
|
|
37
|
-
return resolveProcessPin(processId, version);
|
|
38
|
-
});
|
|
39
|
-
return finalizeBundleIdentity({ processes, metadata: bundle.metadata });
|
|
40
|
-
}
|
|
41
|
-
async function resolveSubprocessPinsInProcesses(processes, resolve) {
|
|
42
|
-
const pins = [];
|
|
43
|
-
for (const proc of processes) {
|
|
44
|
-
forEachSerializedNode(proc.nodes, (node) => {
|
|
45
|
-
if (node.kind !== 'subprocess')
|
|
46
|
-
return;
|
|
47
|
-
pins.push(pinSubprocessNode(proc.id, node, resolve, { allowUnresolved: true }));
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
await Promise.all(pins);
|
|
51
|
-
}
|
|
52
|
-
async function pinSubprocessNode(processId, node, resolve, options) {
|
|
53
|
-
const meta = node.metadata;
|
|
54
|
-
const spec = meta.subprocess;
|
|
55
|
-
if (!spec?.process_id) {
|
|
56
|
-
throw new Error(`process "${processId}": subprocess node "${node.id}" is missing subprocess metadata`);
|
|
57
|
-
}
|
|
58
|
-
if (spec.bundle_hash && spec.version)
|
|
59
|
-
return;
|
|
60
|
-
const resolved = await resolve(spec.process_id, spec.version);
|
|
61
|
-
if (!resolved) {
|
|
62
|
-
if (options?.allowUnresolved)
|
|
63
|
-
return;
|
|
64
|
-
throw new Error(`process "${processId}": subprocess node "${node.id}" references unknown process ` +
|
|
65
|
-
`"${spec.process_id}"${spec.version ? ` version "${spec.version}"` : ''}`);
|
|
66
|
-
}
|
|
67
|
-
meta.subprocess = {
|
|
68
|
-
...spec,
|
|
69
|
-
version: resolved.version,
|
|
70
|
-
bundle_hash: resolved.bundleHash,
|
|
71
|
-
};
|
|
26
|
+
return (await pinBundleSubprocessRefs({ bundle, resolveProcessPin })).bundle;
|
|
72
27
|
}
|
|
73
28
|
function serializeProcess(input) {
|
|
74
29
|
const nodes = input.process.nodes.map((node) => serializeNode(node));
|
package/dist/repos/commands.d.ts
CHANGED
|
@@ -97,21 +97,31 @@ export declare function assertGitCheckoutAuth(ctx: CommandContext): void;
|
|
|
97
97
|
* Clone a resolved repository's default branch (shallow, like `repos clone`)
|
|
98
98
|
* into an absent or empty `destDir`. Returns the origin URL it configured.
|
|
99
99
|
*/
|
|
100
|
-
export declare function cloneRepoById({ ctx, repoId, destDir, gitClone, }: {
|
|
100
|
+
export declare function cloneRepoById({ ctx, repoId, destDir, gitClone, resolveLauncher, }: {
|
|
101
101
|
ctx: CommandContext;
|
|
102
102
|
repoId: string;
|
|
103
103
|
destDir: string;
|
|
104
104
|
gitClone?: RunGitClone;
|
|
105
|
+
resolveLauncher?: () => Promise<string[]>;
|
|
105
106
|
}): Promise<string>;
|
|
106
107
|
/** Git clone always uses the selected human login, never an ambient PAT. */
|
|
107
108
|
export declare function reposCloneCommand(args: ParsedArgs, deps?: {
|
|
108
109
|
gitClone?: RunGitClone;
|
|
110
|
+
resolveLauncher?: () => Promise<string[]>;
|
|
109
111
|
}): Promise<number>;
|
|
110
112
|
/**
|
|
111
113
|
* Validate clone URL shape and that the origin matches the resolved Atlas env
|
|
112
114
|
* so askpass never sends a login token to an attacker-controlled host.
|
|
113
115
|
*/
|
|
114
116
|
export declare function normalizeCloneUrl(raw: string, env: ResolvedEnv): string;
|
|
117
|
+
/**
|
|
118
|
+
* Bind the credential helper to an existing checkout of a git-service
|
|
119
|
+
* repository: one cloned by plain `git clone`, by an older CLI whose clone
|
|
120
|
+
* stopped before configuring login, or whose launcher moved in an upgrade.
|
|
121
|
+
*/
|
|
122
|
+
export declare function reposAttachLoginCommand(args: ParsedArgs, deps?: {
|
|
123
|
+
resolveLauncher?: () => Promise<string[]>;
|
|
124
|
+
}): Promise<number>;
|
|
115
125
|
type DiscoveredCliCheck = {
|
|
116
126
|
name: string;
|
|
117
127
|
script?: string;
|