@sequenceholdings/studio-cli 0.6.0 → 0.6.3
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 +186 -21
- package/dist/app/commands.d.ts +1 -1
- package/dist/app/commands.js +8 -4
- package/dist/app/deploy.js +4 -3
- package/dist/app/env-bindings.d.ts +3 -4
- package/dist/app/env-bindings.js +14 -77
- package/dist/app/readme.js +2 -2
- package/dist/app/repository-admission.d.ts +5 -0
- package/dist/app/repository-admission.js +32 -0
- package/dist/app/scaffold-files.js +8 -1
- package/dist/artifact/delegate.d.ts +4 -0
- package/dist/artifact/delegate.js +18 -8
- package/dist/artifact/sandbox.d.ts +29 -0
- package/dist/artifact/sandbox.js +109 -0
- package/dist/atlas-client.d.ts +1 -0
- package/dist/atlas-client.js +11 -2
- package/dist/command-contract.d.ts +8 -2
- package/dist/command-contract.js +3 -2
- package/dist/command-help.d.ts +7 -4
- package/dist/command-help.js +43 -3
- package/dist/feedback/commands.d.ts +3 -0
- package/dist/feedback/commands.js +108 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +8 -13
- package/dist/orm/delegate.js +30 -11
- package/dist/orm/discover-schema.d.ts +196 -0
- package/dist/orm/discover-schema.js +84 -0
- package/dist/orm/discover.d.ts +13 -0
- package/dist/orm/discover.js +289 -0
- package/dist/pipeline/source.js +3 -0
- package/dist/repos/commands.js +9 -0
- package/dist/repos/identity-file.d.ts +17 -0
- package/dist/repos/identity-file.js +39 -0
- package/dist/repos/identity.d.ts +2 -0
- package/dist/repos/identity.js +69 -0
- package/dist/update-check.d.ts +3 -1
- package/dist/update-check.js +38 -12
- package/package.json +7 -7
|
@@ -10,11 +10,18 @@
|
|
|
10
10
|
* 3. Install an internal token provider so auth is shared with the rest of
|
|
11
11
|
* `seq-studio` without exposing the bearer in argv or environment.
|
|
12
12
|
* 4. Forward all remaining argv to `runCli`.
|
|
13
|
+
*
|
|
14
|
+
* In sandbox token mode (see sandbox-auth.ts) the deployment and bearer come
|
|
15
|
+
* from Atlas instead, and only commands that need neither a local login nor a
|
|
16
|
+
* package registry run: an agent sandbox reaches its Atlas origin and nothing else.
|
|
13
17
|
*/
|
|
14
18
|
import { getAccessTokenWithMode, tryGetAccessTokenWithMode } from '../auth.js';
|
|
19
|
+
import { ARTIFACT_SANDBOX_HELP } from '../command-help.js';
|
|
15
20
|
import { readConfig, resolveConfiguredEnv } from '../config.js';
|
|
16
21
|
import { normalizeShortEnvFlag, readEnvFromArgv } from '../env-flags.js';
|
|
17
22
|
import { PREVIEW_DOMAIN, PREVIEW_PROJECT, resolvePreviewByPr } from '../preview.js';
|
|
23
|
+
import { sandboxTarget } from '../sandbox-auth.js';
|
|
24
|
+
import { runSandboxArtifactCommand } from './sandbox.js';
|
|
18
25
|
const ARTIFACT_USAGE = `usage:
|
|
19
26
|
seq-studio artifact init <dir> [--template react-vite|nextjs]
|
|
20
27
|
seq-studio artifact validate [dir]
|
|
@@ -58,9 +65,9 @@ const ARTIFACT_USAGE = `usage:
|
|
|
58
65
|
with a Git Service origin on the selected source environment also works.
|
|
59
66
|
Use pnpm build for a local production-build check. --once is static-only;
|
|
60
67
|
--port selects the local Next loopback port.
|
|
61
|
-
Deploy
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
Deploy validates the selected targets.<environment>.url and declared storage
|
|
69
|
+
capability workspace IDs against -e. It does not scan source text or arbitrary
|
|
70
|
+
config values for URLs or UUIDs. Repository identity checks still apply.
|
|
64
71
|
|
|
65
72
|
Per-PR preview environments (https://studio-atlas-git-<slug>.preview.seqholdings.com):
|
|
66
73
|
-e preview:<branch-or-slug> compute the preview host from a branch name
|
|
@@ -71,7 +78,8 @@ const ARTIFACT_USAGE = `usage:
|
|
|
71
78
|
set PREVIEW_ACCESS_HEADER=<secret> and the CLI sends it as x-preview-access.
|
|
72
79
|
|
|
73
80
|
Authenticate with: seq-studio login
|
|
74
|
-
|
|
81
|
+
|
|
82
|
+
${ARTIFACT_SANDBOX_HELP}`;
|
|
75
83
|
export async function runArtifactCommand(sub, rest) {
|
|
76
84
|
if (rest.some((arg) => arg === '--token' || arg.startsWith('--token='))) {
|
|
77
85
|
console.error('seq-studio artifact does not accept bearer tokens via --token. ' +
|
|
@@ -87,6 +95,9 @@ export async function runArtifactCommand(sub, rest) {
|
|
|
87
95
|
}
|
|
88
96
|
// Never pass a legacy bearer environment variable into the embedded package.
|
|
89
97
|
delete process.env['ARTIFACT_STUDIO_TOKEN'];
|
|
98
|
+
const sandbox = sandboxTarget();
|
|
99
|
+
if (sandbox)
|
|
100
|
+
return runSandboxArtifactCommand({ sandbox, sub, rest });
|
|
90
101
|
// Older artifact-studio versions exposed nested login/logout commands backed
|
|
91
102
|
// by a separate token file. Keep those commands working, but route them to
|
|
92
103
|
// seq-studio's shared token so every namespace uses the same identity.
|
|
@@ -173,15 +184,14 @@ export async function runArtifactCommand(sub, rest) {
|
|
|
173
184
|
return runArtifactStudio([sub, ...argvForCli]);
|
|
174
185
|
}
|
|
175
186
|
/**
|
|
176
|
-
* Artifact Studio uses only credentials the CLI obtained itself
|
|
177
|
-
*
|
|
178
|
-
* keeps the rule if the delegate is ever called directly.
|
|
187
|
+
* Artifact Studio uses only credentials the CLI obtained itself, never a bearer
|
|
188
|
+
* from argv or the environment. Sandbox tokens take the sandbox.ts path instead.
|
|
179
189
|
*/
|
|
180
190
|
function artifactCredential(auth) {
|
|
181
191
|
if (!auth)
|
|
182
192
|
return null;
|
|
183
193
|
if (auth.authMode === 'sandbox')
|
|
184
|
-
throw new Error('Artifact Studio
|
|
194
|
+
throw new Error('Sandbox tokens reach Artifact Studio only in sandbox token mode.');
|
|
185
195
|
return { authMode: auth.authMode, token: auth.token };
|
|
186
196
|
}
|
|
187
197
|
/**
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `seq-studio artifact` in sandbox token mode (see ../sandbox-auth.ts).
|
|
3
|
+
*
|
|
4
|
+
* An agent sandbox reaches its Atlas origin and nothing else: no package
|
|
5
|
+
* registry, no other deployment, no browser login. Commands run against that
|
|
6
|
+
* origin with the Atlas-written bearer when they need none of those; builds
|
|
7
|
+
* come from a Git Service repository, where Atlas builds Next.js applications
|
|
8
|
+
* and static applications bundle without a package install.
|
|
9
|
+
*/
|
|
10
|
+
import { type SandboxTarget } from '../sandbox-auth.js';
|
|
11
|
+
/**
|
|
12
|
+
* Why a command cannot run in an agent sandbox, or null when it can. Builds
|
|
13
|
+
* must come from a Git Service repository: the sandbox reaches only its Atlas
|
|
14
|
+
* origin, and an official deploy needs a reviewed revision anyway.
|
|
15
|
+
*/
|
|
16
|
+
export declare function sandboxRefusal({ sub, rest }: {
|
|
17
|
+
sub: string;
|
|
18
|
+
rest: readonly string[];
|
|
19
|
+
}): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Refuse what a sandbox cannot do, else run the command against the sandbox
|
|
22
|
+
* origin with the sandbox bearer. `-e` is ignored, as everywhere in sandbox
|
|
23
|
+
* mode, and no config file, preview header, or other credential is consulted.
|
|
24
|
+
*/
|
|
25
|
+
export declare function runSandboxArtifactCommand({ sandbox, sub, rest }: {
|
|
26
|
+
sandbox: SandboxTarget;
|
|
27
|
+
sub: string;
|
|
28
|
+
rest: readonly string[];
|
|
29
|
+
}): Promise<number>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `seq-studio artifact` in sandbox token mode (see ../sandbox-auth.ts).
|
|
3
|
+
*
|
|
4
|
+
* An agent sandbox reaches its Atlas origin and nothing else: no package
|
|
5
|
+
* registry, no other deployment, no browser login. Commands run against that
|
|
6
|
+
* origin with the Atlas-written bearer when they need none of those; builds
|
|
7
|
+
* come from a Git Service repository, where Atlas builds Next.js applications
|
|
8
|
+
* and static applications bundle without a package install.
|
|
9
|
+
*/
|
|
10
|
+
import { getAccessTokenWithMode } from '../auth.js';
|
|
11
|
+
import { normalizeShortEnvFlag } from '../env-flags.js';
|
|
12
|
+
import { SANDBOX_ENV_NAME, sourceAuthMode } from '../sandbox-auth.js';
|
|
13
|
+
/** How an agent gets an app deployed when a sandbox refuses the local path. */
|
|
14
|
+
const SANDBOX_DEPLOY_GUIDANCE = 'Push the app to a Git Service repository and deploy from it: `seq-studio repos create <ns>/<name>`, ' +
|
|
15
|
+
'`seq-studio repos clone <ns>/<name>`, commit and `git push` the app on main, then ' +
|
|
16
|
+
'`seq-studio artifact deploy --repo <ns>/<name>`.';
|
|
17
|
+
/** Shown when a static build would need `pnpm install`, which a sandbox cannot run. */
|
|
18
|
+
const SANDBOX_INSTALL_GUIDANCE = 'An agent sandbox cannot reach a package registry. Remove the package.json dependencies and optionalDependencies ' +
|
|
19
|
+
'(scaffold imports such as React, atlas-ui and the Artifact Studio SDK need none), ' +
|
|
20
|
+
'or deploy from a signed-in seq-studio session outside the sandbox.';
|
|
21
|
+
/** Commands that need a local login or a local development server, which a sandbox has neither of. */
|
|
22
|
+
const SANDBOX_REFUSED_COMMANDS = {
|
|
23
|
+
dev: '`artifact dev` runs a local development server under a user login.',
|
|
24
|
+
login: 'Atlas supplies the sandbox token, so there is no login.',
|
|
25
|
+
logout: 'Atlas supplies the sandbox token, so there is no login.',
|
|
26
|
+
};
|
|
27
|
+
/** Flags that reach a source or deployment other than the sandbox's one Atlas origin. */
|
|
28
|
+
const SANDBOX_REFUSED_FLAGS = ['--git-url', '--source-env', '--pr', '--env-url'];
|
|
29
|
+
/** Commands whose source is a build; in a sandbox it must come from a Git Service repository. */
|
|
30
|
+
const SANDBOX_REPOSITORY_COMMANDS = new Set(['build', 'plan', 'deploy']);
|
|
31
|
+
/** Commands that take no --env, so the sandbox environment is not added to their argv. */
|
|
32
|
+
const ENVLESS_COMMANDS = new Set(['init', 'validate', 'env']);
|
|
33
|
+
/**
|
|
34
|
+
* Why a command cannot run in an agent sandbox, or null when it can. Builds
|
|
35
|
+
* must come from a Git Service repository: the sandbox reaches only its Atlas
|
|
36
|
+
* origin, and an official deploy needs a reviewed revision anyway.
|
|
37
|
+
*/
|
|
38
|
+
export function sandboxRefusal({ sub, rest }) {
|
|
39
|
+
const prefix = 'Not available in an agent sandbox:';
|
|
40
|
+
const refusedCommand = SANDBOX_REFUSED_COMMANDS[sub];
|
|
41
|
+
if (refusedCommand)
|
|
42
|
+
return `${prefix} ${refusedCommand} ${SANDBOX_DEPLOY_GUIDANCE}`;
|
|
43
|
+
const refusedFlag = SANDBOX_REFUSED_FLAGS.find((flag) => rest.some((arg) => arg === flag || arg.startsWith(`${flag}=`)));
|
|
44
|
+
if (refusedFlag) {
|
|
45
|
+
return `${prefix} ${refusedFlag}. The sandbox reaches only its own Atlas deployment. ${SANDBOX_DEPLOY_GUIDANCE}`;
|
|
46
|
+
}
|
|
47
|
+
if (SANDBOX_REPOSITORY_COMMANDS.has(sub) && !rest.some((arg) => arg === '--repo' || arg.startsWith('--repo='))) {
|
|
48
|
+
return `${prefix} \`artifact ${sub}\` from a local directory. ${SANDBOX_DEPLOY_GUIDANCE}`;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Refuse what a sandbox cannot do, else run the command against the sandbox
|
|
54
|
+
* origin with the sandbox bearer. `-e` is ignored, as everywhere in sandbox
|
|
55
|
+
* mode, and no config file, preview header, or other credential is consulted.
|
|
56
|
+
*/
|
|
57
|
+
export async function runSandboxArtifactCommand({ sandbox, sub, rest }) {
|
|
58
|
+
const refusal = sandboxRefusal({ sub, rest });
|
|
59
|
+
if (refusal) {
|
|
60
|
+
console.error(refusal);
|
|
61
|
+
return 1;
|
|
62
|
+
}
|
|
63
|
+
// artifact-studio's parser knows only --env.
|
|
64
|
+
const argv = normalizeShortEnvFlag(rest);
|
|
65
|
+
process.env['ARTIFACT_STUDIO_BASE_URL'] = sandbox.baseUrl;
|
|
66
|
+
process.env['ARTIFACT_STUDIO_ENV_URLS'] = JSON.stringify({ [SANDBOX_ENV_NAME]: sandbox.baseUrl });
|
|
67
|
+
delete process.env['ARTIFACT_STUDIO_EXTRA_HEADERS'];
|
|
68
|
+
const { runCli: runArtifactStudio, setPackageInstallUnavailable, setTokenProvider } = await import('@sequenceholdings/artifact-studio/cli');
|
|
69
|
+
setPackageInstallUnavailable(SANDBOX_INSTALL_GUIDANCE);
|
|
70
|
+
setTokenProvider(async ({ sourceEnvironment }) => {
|
|
71
|
+
if (sourceEnvironment)
|
|
72
|
+
throw new Error('--source-env is not available in an agent sandbox.');
|
|
73
|
+
// The token comes from the Atlas-written file and goes only to its origin.
|
|
74
|
+
// It resolves --repo sources like a headless caller: JSON materialize,
|
|
75
|
+
// platform repositories only.
|
|
76
|
+
const auth = await getAccessTokenWithMode({ env: SANDBOX_ENV_NAME, targetUrl: sandbox.baseUrl });
|
|
77
|
+
return { authMode: sourceAuthMode(auth.authMode), token: auth.token };
|
|
78
|
+
});
|
|
79
|
+
const status = await runArtifactStudio([sub, ...(ENVLESS_COMMANDS.has(sub) ? argv : withEnvFlag(argv, SANDBOX_ENV_NAME))]);
|
|
80
|
+
// init's own next step (login, then dev) does not apply here.
|
|
81
|
+
if (status === 0 && sub === 'init')
|
|
82
|
+
console.log(sandboxInitNextStep(argv));
|
|
83
|
+
return status;
|
|
84
|
+
}
|
|
85
|
+
function sandboxInitNextStep(argv) {
|
|
86
|
+
const nextjs = argv.some((arg, i) => arg === '--template=nextjs' || (arg === '--template' && argv[i + 1] === 'nextjs'));
|
|
87
|
+
return nextjs
|
|
88
|
+
? 'In this agent sandbox: Atlas builds Next.js applications only from a committed pnpm-lock.yaml, ' +
|
|
89
|
+
'which the sandbox cannot generate without a package registry. Use the default static template, ' +
|
|
90
|
+
'or a repository that already carries its lockfile.'
|
|
91
|
+
: `In this agent sandbox: keep package.json dependencies and optionalDependencies empty. ${SANDBOX_DEPLOY_GUIDANCE}`;
|
|
92
|
+
}
|
|
93
|
+
/** Drop every `--env <value>` / `--env=<value>` and select `name` instead. */
|
|
94
|
+
function withEnvFlag(argv, name) {
|
|
95
|
+
const out = [];
|
|
96
|
+
for (let i = 0; i < argv.length; i++) {
|
|
97
|
+
const arg = argv[i];
|
|
98
|
+
if (arg === undefined || arg.startsWith('--env='))
|
|
99
|
+
continue;
|
|
100
|
+
if (arg === '--env') {
|
|
101
|
+
const next = argv[i + 1];
|
|
102
|
+
if (next !== undefined && !next.startsWith('-'))
|
|
103
|
+
i += 1;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
out.push(arg);
|
|
107
|
+
}
|
|
108
|
+
return [...out, '--env', name];
|
|
109
|
+
}
|
package/dist/atlas-client.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare class AtlasApiError extends Error {
|
|
|
20
20
|
readonly statusText: string;
|
|
21
21
|
readonly body: unknown;
|
|
22
22
|
readonly name = "AtlasApiError";
|
|
23
|
+
retryAfterSeconds: number | null;
|
|
23
24
|
constructor(status: number, message: string, path: string, statusText?: string, body?: unknown);
|
|
24
25
|
}
|
|
25
26
|
/** Bounded single attempt for commands whose uncertain result must be reconciled by the caller. */
|
package/dist/atlas-client.js
CHANGED
|
@@ -18,6 +18,7 @@ export class AtlasApiError extends Error {
|
|
|
18
18
|
statusText;
|
|
19
19
|
body;
|
|
20
20
|
name = 'AtlasApiError';
|
|
21
|
+
retryAfterSeconds = null;
|
|
21
22
|
constructor(status, message, path, statusText = '', body = null) {
|
|
22
23
|
super(message);
|
|
23
24
|
this.status = status;
|
|
@@ -83,10 +84,18 @@ export async function requestJsonOnce({ baseUrl, token, path, method, body, }) {
|
|
|
83
84
|
}
|
|
84
85
|
const raw = Buffer.concat(chunks).toString('utf8');
|
|
85
86
|
const parsed = parseErrorBody(raw, response.headers.get('content-type') ?? '');
|
|
86
|
-
if (!response.ok)
|
|
87
|
-
|
|
87
|
+
if (!response.ok) {
|
|
88
|
+
const error = new AtlasApiError(response.status, messageFromBody(parsed, response.status, response.statusText), path, response.statusText, parsed);
|
|
89
|
+
error.retryAfterSeconds = response.status === 429 ? parseRetryAfter(response.headers.get('Retry-After')) : null;
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
88
92
|
return parsed;
|
|
89
93
|
}
|
|
94
|
+
function parseRetryAfter(value) {
|
|
95
|
+
if (!value || !/^[1-9][0-9]{0,5}$/.test(value))
|
|
96
|
+
return null;
|
|
97
|
+
return Number(value);
|
|
98
|
+
}
|
|
90
99
|
function previewAccessHeaders(baseUrl) {
|
|
91
100
|
const secret = process.env.PREVIEW_ACCESS_HEADER?.trim();
|
|
92
101
|
if (!secret)
|
|
@@ -52,7 +52,7 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
52
52
|
readonly description: "Manage repositories and native CI; ci init is offline";
|
|
53
53
|
readonly lifecycle: "stable";
|
|
54
54
|
readonly access: "mixed";
|
|
55
|
-
readonly subcommands: readonly ["list", "namespaces", "show", "create", "clone", "pull", "pulls", "delete", "ci"];
|
|
55
|
+
readonly subcommands: readonly ["list", "namespaces", "show", "identity", "create", "clone", "pull", "pulls", "delete", "ci"];
|
|
56
56
|
}, {
|
|
57
57
|
readonly name: "templates";
|
|
58
58
|
readonly description: "Publish, synchronize, and list repository templates";
|
|
@@ -65,6 +65,12 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
65
65
|
readonly lifecycle: "preview";
|
|
66
66
|
readonly access: "staff";
|
|
67
67
|
readonly subcommands: readonly ["list", "assets", "search", "describe", "schema", "sample", "query", "init", "validate", "plan", "deploy", "status", "migrate", "adopt", "unbind", "run-now", "promote", "rollback"];
|
|
68
|
+
}, {
|
|
69
|
+
readonly name: "feedback";
|
|
70
|
+
readonly description: "Submit agent feedback";
|
|
71
|
+
readonly lifecycle: "preview";
|
|
72
|
+
readonly access: "authenticated";
|
|
73
|
+
readonly subcommands: readonly ["submit"];
|
|
68
74
|
}, {
|
|
69
75
|
readonly name: "auth";
|
|
70
76
|
readonly description: "Manage Git authentication";
|
|
@@ -76,7 +82,7 @@ export declare const COMMAND_CONTRACT: readonly [{
|
|
|
76
82
|
readonly description: "Author and operate ORM namespaces";
|
|
77
83
|
readonly lifecycle: "preview";
|
|
78
84
|
readonly access: "mixed";
|
|
79
|
-
readonly subcommands: readonly ["init", "generate", "validate", "plan", "apply", "execute", "read", "sql", "diff", "migrate-from-yaml", "import"];
|
|
85
|
+
readonly subcommands: readonly ["init", "generate", "validate", "plan", "apply", "execute", "namespaces", "describe", "read", "sql", "diff", "migrate-from-yaml", "import"];
|
|
80
86
|
}, {
|
|
81
87
|
readonly name: "envs";
|
|
82
88
|
readonly description: "Manage CLI environments";
|
package/dist/command-contract.js
CHANGED
|
@@ -8,11 +8,12 @@ export const COMMAND_CONTRACT = [
|
|
|
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
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
|
-
{ 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'] },
|
|
11
|
+
{ name: 'repos', description: 'Manage repositories and native CI; ci init is offline', lifecycle: 'stable', access: 'mixed', subcommands: ['list', 'namespaces', 'show', 'identity', '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'] },
|
|
13
13
|
{ name: 'pipeline', description: 'Discover and operate Data Pipelines', lifecycle: 'preview', access: 'staff', subcommands: ['list', 'assets', 'search', 'describe', 'schema', 'sample', 'query', 'init', 'validate', 'plan', 'deploy', 'status', 'migrate', 'adopt', 'unbind', 'run-now', 'promote', 'rollback'] },
|
|
14
|
+
{ name: 'feedback', description: 'Submit agent feedback', lifecycle: 'preview', access: 'authenticated', subcommands: ['submit'] },
|
|
14
15
|
{ name: 'auth', description: 'Manage Git authentication', lifecycle: 'stable', access: 'authenticated', subcommands: ['whoami', 'git-credential', 'pat'] },
|
|
15
|
-
{ name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'execute', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import'] },
|
|
16
|
+
{ name: 'orm', description: 'Author and operate ORM namespaces', lifecycle: 'preview', access: 'mixed', subcommands: ['init', 'generate', 'validate', 'plan', 'apply', 'execute', 'namespaces', 'describe', 'read', 'sql', 'diff', 'migrate-from-yaml', 'import'] },
|
|
16
17
|
{ name: 'envs', description: 'Manage CLI environments', lifecycle: 'stable', access: 'mixed', subcommands: ['add', 'list'] },
|
|
17
18
|
{ name: 'login', description: 'Authenticate with Sequence', lifecycle: 'stable', access: 'public', subcommands: [] },
|
|
18
19
|
{ name: 'logout', description: 'Remove cached user tokens', lifecycle: 'stable', access: 'public', subcommands: [] },
|
package/dist/command-help.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/** Help text reachable before command implementations, auth, optional SDKs, or Atlas clients load. */
|
|
2
|
-
export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env>\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]\n seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]\n seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]\n seq-studio orm migrate-from-yaml <dir>\n seq-studio orm import [dir] --spec <file> | --table <table> --from <schema.table> --map <target=source,...>\n\n -e/--env is required for commands that contact Atlas. Use seq-studio envs list\n to discover environments and seq-studio login to authenticate.\n read and sql query a v2 namespace as you through its built-in read-only SQL.\n sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).\n Run seq-studio orm read --help for the filter grammar, parameters, and output formats.\n";
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
2
|
+
export declare const ORM_HELP = "usage:\n seq-studio orm init <dir>\n seq-studio orm generate [dir] [--migration-export] [--check]\n seq-studio orm validate [dir]\n seq-studio orm plan [dir] -e <env>\n seq-studio orm apply [dir] -e <env>\n seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n seq-studio orm describe <namespace> [<table>] -e <env> [--json]\n seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]\n seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]\n seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]\n seq-studio orm migrate-from-yaml <dir>\n seq-studio orm import [dir] --spec <file> | --table <table> --from <schema.table> --map <target=source,...>\n\n -e/--env is required for commands that contact Atlas. Use seq-studio envs list\n to discover environments and seq-studio login to authenticate.\n namespaces lists what you can read; describe shows its tables and operations.\n Run seq-studio orm describe --help for the output.\n read and sql query a v2 namespace as you through its built-in read-only SQL.\n sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).\n Run seq-studio orm read --help for the filter grammar, parameters, and output formats.\n";
|
|
3
|
+
/** Artifact commands in sandbox token mode; shared by the offline and delegate usage. */
|
|
4
|
+
export declare const ARTIFACT_SANDBOX_HELP = " In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan\n and deploy take --repo: push the app to a Git Service repository and deploy\n from it. Atlas builds Next.js applications; static applications are bundled\n from the repository and must declare no package.json dependencies or\n optionalDependencies, because the sandbox cannot reach a package registry.\n dev, login, logout, --git-url, --source-env, --pr and --env-url are\n unavailable there, and -e is ignored.\n";
|
|
5
|
+
export declare const ARTIFACT_HELP = "usage:\n seq-studio artifact init <dir> [--template react-vite|nextjs]\n seq-studio artifact whoami -e <env>\n seq-studio artifact link [dir] -e <env> [--project <id>]\n seq-studio artifact env list|use <env>\n seq-studio artifact status [-e <env>]\n seq-studio artifact list -e <env> [--json]\n seq-studio artifact show <slug-or-id> -e <env> [--json]\n seq-studio artifact validate [dir]\n seq-studio artifact build|plan|deploy [dir | --repo <namespace>/<name> | --git-url <url>] [--ref <ref>] -e <env>\n seq-studio artifact dev [dir] -e <env> [--once] [--key <name>] [--link <package-dir>] [--port <port>]\n seq-studio artifact pull <project-id> -e <env> --out <dir>\n seq-studio artifact promote|rollback <deployment-id> -e <env>\n\n Help is available offline. Authenticate with seq-studio login. Build and deploy\n sources may be local, a platform git-service repo, or a public HTTPS Git URL;\n deployments target a named environment with -e. Local, preview, and official\n deployment workflows have different source and approval rules; see the public\n CLI README.\n\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan\n and deploy take --repo: push the app to a Git Service repository and deploy\n from it. Atlas builds Next.js applications; static applications are bundled\n from the repository and must declare no package.json dependencies or\n optionalDependencies, because the sandbox cannot reach a package registry.\n dev, login, logout, --git-url, --source-env, --pr and --env-url are\n unavailable there, and -e is ignored.\n";
|
|
6
|
+
export declare const PIPELINE_HELP = "usage:\n seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]\n list pipeline repository rollups (not assets)\n seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]\n list asset declarations, including assets that may not be deployed\n seq-studio pipeline search <query> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit N] [--offset N] [--json]\n seq-studio pipeline describe <asset-id> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]\n seq-studio pipeline schema|sample <asset-id> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline query <asset-id> --sql <read-only-sql> -e <env> [--target <id>] [--limit N] [--json]\n seq-studio pipeline init|validate|plan|deploy|status|migrate|adopt|unbind|run-now|promote|rollback ...\n seq-studio pipeline plan|deploy --repo <namespace>/<slug> --ref <sha|branch>\n [--root <directory>] [--source-env <first-party-env>] -e <env> [--target <id>]\n For an existing target release unit, source-env selects a separately\n authenticated canonical repository from banksouth, staging, or production.\n Source identity must be adopted and belong to the destination tenant.\n Registered OpCo source origins are not supported yet. The target verifies\n and snapshots source before planning; no target repository is created.\n Not compatible with --dir, existing IDs, or coordinated migrations.\n Rollback uses retained snapshots; historical source commits can be re-planned\n explicitly with deploy --ref <sha> --source-env <env>.\n seq-studio pipeline plan --plan-request-id <id> -e <env> [--json]\n poll an existing durable plan without enqueueing or attaching credentials\n Lifecycle --json results use stdout; progress uses stderr. Deploy --run-now\n executes producers in the managed worker; local polling may disconnect.\n\n Discovery requires staff access. Use list for pipeline repositories, assets\n for declared assets, and search/describe for active deployment metadata;\n use schema to verify physical columns. -e chooses the environment and\n --target chooses a logical target when the environment has more than one.\n Help is available offline.\n";
|
|
5
7
|
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest, TypeScript handler, and docs pointers\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, SDK timeout cap)\n seq-studio functions register -e <env> [--dir d] register a function shell without deploying\n seq-studio functions deploy -e <env> [-m msg] preflight, upload, then show version and lifecycle progress\n seq-studio functions list -e <env> [--match-local] functions visible on the environment\n seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)\n seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy\n [--fn slug] also show effective runtime limits (requires -e)\n seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context\n seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]\n invoke a function and print its response\n seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)\n seq-studio functions promote <version> -e <env> make a version live\n seq-studio functions rollback [<version>] -e <env> redeploy a prior version\n seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime\n (version history is retained)\n\n Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) \u00B7 --fn <slug> \u00B7 --dir <path>\n --path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo\n --from-env-file <path> (default: .env) source file for secret values\n --no-wait \u00B7 --yes\n --no-provision (deploy) update-only: error instead of registering a new\n shell, writing secret values, or attaching secrets (CI sweep)\n\n Local Atlas builds and runs deployed functions on this computer, including teardown.\n \"functions dev\" runs a standalone handler without Atlas registration.\n\n Configure per-function CPU and concurrency in managed-function.yml under limits.\n Run \"functions limits\" for valid settings; redeploy to apply manifest changes.\n Invocation rates are shared across Atlas replicas; 429 includes Retry-After.\n If the shared rate limiter is unavailable, invocation fails closed with 503.\n\n Source for build/deploy: a local --dir (default .), a platform git-service\n repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects\n a function directory within a remote repo; omit it for the existing root-manifest\n layout. --ref selects a branch/tag/commit (default: the repo's default branch).\n Remote sources record the pinned commit as provenance (never dirty) and NEVER\n read a repo-committed .env for secret values \u2014 provision secrets server-side\n or pass a local --from-env-file (resolved against your cwd).\n\n Interactive --repo builds clone over smart-HTTP using your seq-studio login\n and repository read access. No PAT is needed. Headless M2M builds use JSON\n materialize and accept only platform-managed --repo sources. Use --env to\n select the same environment for source and deployment.\n";
|
|
6
|
-
export declare const REPOS_USAGE = "usage:\n seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment\n seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces\n seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)\n seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n real Git clone using seq-studio login;\n configures login for subsequent git pull/push\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|review|reviews|checks> [args]\n review requests (see pulls --help)\n seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults\n seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone uses your login token (never written into the remote URL or Git config).\n A repository-local credential helper reads your current login for git pull/push.\n After expiry, run seq-studio login --env <env> again.\n --transport auto (default) and git both create a real Git checkout.\n Personal access tokens are retired; ATLAS_GIT_PAT is ignored.\n --transport json downloads files without .git; requires\n <ns>/<name>. repos pull also provides this files-only workflow.\n --ref accepts a branch, tag, or commit SHA (SHA \u2192 full clone, then checkout).\n Branch and tag clones are shallow (--depth 1). Pass --full for history.\n --output selects the clone directory (--out remains an alias).\n\n Authenticate JSON API calls with: seq-studio login\n Authenticate git clone/push with: seq-studio login --env <env>\n";
|
|
8
|
+
export declare const REPOS_USAGE = "usage:\n seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment\n seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces\n seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)\n seq-studio repos identity <ns>/<name> -e <env> [--write --dir .] show/install the server-issued identity receipt\n --adopt --write --yes admin-only legacy binding; commit the receipt via PR\n seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]\n create a repo seeded with a README; --git-backend\n walgit creates it empty (for pushing existing\n history); needs namespace write\n seq-studio repos clone <ns>/<name> -e <env> [--ref r] [--output dir] [--force] [--full] [--transport auto|git|json]\n seq-studio repos clone --url <https://\u2026/repos/<id>/git> -e <env> [--ref r] [--output dir] [--full]\n seq-studio repos clone --id <uuid> -e <env> [--ref r] [--output dir] [--full]\n real Git clone using seq-studio login;\n configures login for subsequent git pull/push\n seq-studio repos pull <ns>/<name> -e <env> [--ref r] [--out dir] [--force]\n materialize the tree at a ref (JSON API)\n seq-studio repos pulls <list|show|create|diff|merge|close|comment|comments|review|reviews|checks> [args]\n review requests (see pulls --help)\n seq-studio repos delete <ns>/<name> -e <env> [--yes] delete a repo (confirm prompt)\n seq-studio repos ci init [--dir <repository>] create a native pipeline using platform defaults\n seq-studio repos ci show <ns>/<name> -e <env> --pr <number> [--json] inspect the server CI plan and runs\n seq-studio repos ci show <ns>/<name> -e <env> [--ref r] preview pipeline discovery or legacy checks\n seq-studio repos ci require <ns>/<name> --check <name> -e <env> disabled legacy control\n seq-studio repos ci import <ns>/<name> -e <env> [--ref r] disabled legacy control\n\n Flags: -e/--env <env> (required; see: seq-studio envs list)\n\n clone uses your login token (never written into the remote URL or Git config).\n A repository-local credential helper reads your current login for git pull/push.\n After expiry, run seq-studio login --env <env> again.\n --transport auto (default) and git both create a real Git checkout.\n Personal access tokens are retired; ATLAS_GIT_PAT is ignored.\n --transport json downloads files without .git; requires\n <ns>/<name>. repos pull also provides this files-only workflow.\n --ref accepts a branch, tag, or commit SHA (SHA \u2192 full clone, then checkout).\n Branch and tag clones are shallow (--depth 1). Pass --full for history.\n --output selects the clone directory (--out remains an alias).\n\n Authenticate JSON API calls with: seq-studio login\n Authenticate git clone/push with: seq-studio login --env <env>\n";
|
|
7
9
|
export declare const PROCESS_RUNS_USAGE = "usage:\n seq-studio process runs start <process-id> -e <env> [--version <v>] [--run-id <id>]\n [--metadata-file <file.json>] [--title <text>] [--entity <type>:<id>] [--json]\n seq-studio process runs list -e <env> [--process <id>] [--status <status>]\n [--entity-type <type>] [--entity-id <id>] [--archived] [--limit 1..500] [--json]\n seq-studio process runs show <run-id> -e <env> [--wait [--timeout <seconds>]] [--json]\n seq-studio process runs cancel <run-id> -e <env> [--json]\n\n Runs start and are read as you: start needs invoker on the process, show and\n list return only runs you can view, and cancel needs invoker on the process.\n --version pins a published process version; omitted, the active version runs.\n --run-id makes start idempotent: repeating it for the same process returns the\n existing run instead of starting another. --metadata-file is a JSON object\n stored on the run.\n list returns the newest runs first, up to --limit (default 50, max 500); the run\n API has no cursor, so narrow with filters to reach older runs.\n --status: pending, running, completed, failed, cancelled, timed_out.\n show --wait polls until the run finishes (default timeout 600s); the run keeps\n going if the wait times out.\n";
|
|
10
|
+
export declare const ORM_DISCOVER_HELP = "usage:\n seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]\n seq-studio orm describe <namespace> [<table>] -e <env> [--json]\n\n Find the ORM data you can read, then query it with orm read or orm sql.\n namespaces lists only namespaces you can read, ordered by name: format (v2 or\n v1), table and persisted-operation counts. It pages with --limit (default 50)\n and --offset; the total and the next page go to stderr.\n describe <namespace> lists its tables and views and the persisted operations\n it serves, with what each requires. describe <namespace> <table> lists the\n table's columns (types, nullability, keys), enum values, links, actions, and\n the persisted operations that write it. Column names are the ones orm read and\n orm sql accept.\n A namespace you cannot read reports not found, the same as a missing one.\n --json prints the full description (describe omits the generated GraphQL SDL).\n In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.\n";
|
|
8
11
|
export declare function staticHelp({ namespace, sub }: {
|
|
9
12
|
namespace: string;
|
|
10
13
|
sub?: string;
|
package/dist/command-help.js
CHANGED
|
@@ -6,6 +6,8 @@ export const ORM_HELP = `usage:
|
|
|
6
6
|
seq-studio orm plan [dir] -e <env>
|
|
7
7
|
seq-studio orm apply [dir] -e <env>
|
|
8
8
|
seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>
|
|
9
|
+
seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
|
|
10
|
+
seq-studio orm describe <namespace> [<table>] -e <env> [--json]
|
|
9
11
|
seq-studio orm read <namespace> <table> -e <env> [--where <column>=<op>.<value>]... [--select <cols>] [--order <col>[.desc]] [--limit N] [--offset N] [--json|--jsonl]
|
|
10
12
|
seq-studio orm sql <namespace> --query <sql> | --file <path> -e <env> [--param <name>[:<type>]=<value>]... | [--params <json-object>] [--json|--jsonl]
|
|
11
13
|
seq-studio orm diff [dir] [--check] [--allow-destructive] [--rebase]
|
|
@@ -14,10 +16,21 @@ export const ORM_HELP = `usage:
|
|
|
14
16
|
|
|
15
17
|
-e/--env is required for commands that contact Atlas. Use seq-studio envs list
|
|
16
18
|
to discover environments and seq-studio login to authenticate.
|
|
19
|
+
namespaces lists what you can read; describe shows its tables and operations.
|
|
20
|
+
Run seq-studio orm describe --help for the output.
|
|
17
21
|
read and sql query a v2 namespace as you through its built-in read-only SQL.
|
|
18
22
|
sql must name tables as <namespace>.<table> (FROM lending.loans, not FROM loans).
|
|
19
23
|
Run seq-studio orm read --help for the filter grammar, parameters, and output formats.
|
|
20
24
|
`;
|
|
25
|
+
/** Artifact commands in sandbox token mode; shared by the offline and delegate usage. */
|
|
26
|
+
export const ARTIFACT_SANDBOX_HELP = ` In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), build, plan
|
|
27
|
+
and deploy take --repo: push the app to a Git Service repository and deploy
|
|
28
|
+
from it. Atlas builds Next.js applications; static applications are bundled
|
|
29
|
+
from the repository and must declare no package.json dependencies or
|
|
30
|
+
optionalDependencies, because the sandbox cannot reach a package registry.
|
|
31
|
+
dev, login, logout, --git-url, --source-env, --pr and --env-url are
|
|
32
|
+
unavailable there, and -e is ignored.
|
|
33
|
+
`;
|
|
21
34
|
export const ARTIFACT_HELP = `usage:
|
|
22
35
|
seq-studio artifact init <dir> [--template react-vite|nextjs]
|
|
23
36
|
seq-studio artifact whoami -e <env>
|
|
@@ -37,7 +50,8 @@ export const ARTIFACT_HELP = `usage:
|
|
|
37
50
|
deployments target a named environment with -e. Local, preview, and official
|
|
38
51
|
deployment workflows have different source and approval rules; see the public
|
|
39
52
|
CLI README.
|
|
40
|
-
|
|
53
|
+
|
|
54
|
+
${ARTIFACT_SANDBOX_HELP}`;
|
|
41
55
|
export const PIPELINE_HELP = `usage:
|
|
42
56
|
seq-studio pipeline list -e <env> [--limit 1..200] [--offset N] [--json]
|
|
43
57
|
list pipeline repository rollups (not assets)
|
|
@@ -52,6 +66,7 @@ export const PIPELINE_HELP = `usage:
|
|
|
52
66
|
[--root <directory>] [--source-env <first-party-env>] -e <env> [--target <id>]
|
|
53
67
|
For an existing target release unit, source-env selects a separately
|
|
54
68
|
authenticated canonical repository from banksouth, staging, or production.
|
|
69
|
+
Source identity must be adopted and belong to the destination tenant.
|
|
55
70
|
Registered OpCo source origins are not supported yet. The target verifies
|
|
56
71
|
and snapshots source before planning; no target repository is created.
|
|
57
72
|
Not compatible with --dir, existing IDs, or coordinated migrations.
|
|
@@ -118,6 +133,8 @@ export const REPOS_USAGE = `usage:
|
|
|
118
133
|
seq-studio repos list -e <env> [--namespace <slug>] [--mine] repos visible on the environment
|
|
119
134
|
seq-studio repos namespaces [create <slug>] -e <env> list or create namespaces
|
|
120
135
|
seq-studio repos show <ns>/<name> -e <env> repo detail (branches, clone URL)
|
|
136
|
+
seq-studio repos identity <ns>/<name> -e <env> [--write --dir .] show/install the server-issued identity receipt
|
|
137
|
+
--adopt --write --yes admin-only legacy binding; commit the receipt via PR
|
|
121
138
|
seq-studio repos create <ns>/<name> -e <env> [--default-branch b] [--git-backend walgit]
|
|
122
139
|
create a repo seeded with a README; --git-backend
|
|
123
140
|
walgit creates it empty (for pushing existing
|
|
@@ -174,11 +191,34 @@ export const PROCESS_RUNS_USAGE = `usage:
|
|
|
174
191
|
show --wait polls until the run finishes (default timeout 600s); the run keeps
|
|
175
192
|
going if the wait times out.
|
|
176
193
|
`;
|
|
194
|
+
export const ORM_DISCOVER_HELP = `usage:
|
|
195
|
+
seq-studio orm namespaces -e <env> [--limit N] [--offset N] [--json]
|
|
196
|
+
seq-studio orm describe <namespace> [<table>] -e <env> [--json]
|
|
197
|
+
|
|
198
|
+
Find the ORM data you can read, then query it with orm read or orm sql.
|
|
199
|
+
namespaces lists only namespaces you can read, ordered by name: format (v2 or
|
|
200
|
+
v1), table and persisted-operation counts. It pages with --limit (default 50)
|
|
201
|
+
and --offset; the total and the next page go to stderr.
|
|
202
|
+
describe <namespace> lists its tables and views and the persisted operations
|
|
203
|
+
it serves, with what each requires. describe <namespace> <table> lists the
|
|
204
|
+
table's columns (types, nullability, keys), enum values, links, actions, and
|
|
205
|
+
the persisted operations that write it. Column names are the ones orm read and
|
|
206
|
+
orm sql accept.
|
|
207
|
+
A namespace you cannot read reports not found, the same as a missing one.
|
|
208
|
+
--json prints the full description (describe omits the generated GraphQL SDL).
|
|
209
|
+
In an agent sandbox (SEQ_STUDIO_BASE_URL + SEQ_STUDIO_TOKEN_FILE), -e is not needed.
|
|
210
|
+
`;
|
|
211
|
+
/** read and sql print their own grammar help from the delegate. */
|
|
212
|
+
function ormHelp(sub) {
|
|
213
|
+
if (sub === 'namespaces' || sub === 'describe')
|
|
214
|
+
return ORM_DISCOVER_HELP;
|
|
215
|
+
return sub === 'read' || sub === 'sql' ? undefined : ORM_HELP;
|
|
216
|
+
}
|
|
177
217
|
export function staticHelp({ namespace, sub }) {
|
|
178
218
|
if (namespace === 'artifact')
|
|
179
219
|
return ARTIFACT_HELP;
|
|
180
|
-
if (namespace === 'orm'
|
|
181
|
-
return
|
|
220
|
+
if (namespace === 'orm')
|
|
221
|
+
return ormHelp(sub);
|
|
182
222
|
if (namespace === 'pipeline')
|
|
183
223
|
return PIPELINE_HELP;
|
|
184
224
|
if (namespace === 'functions')
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type ParsedArgs } from '../argv.js';
|
|
2
|
+
export declare const FEEDBACK_HELP = "usage: seq-studio feedback submit --file report.json [-e <env>] [--json]\n\nSubmit a short, sanitized report using your normal Sequence credentials. Example:\n {\"title\":\"Deploy command retried unexpectedly\",\"observedBehavior\":\"The command returned 503 before validation\",\"agent\":{\"application\":\"Codex\",\"provider\":\"OpenAI\",\"modelId\":\"unknown\"}}\n\nInclude errors, confusing behavior, missing docs or capabilities, repeated retries, and\nsuccessful workarounds even when the cause is uncertain. Do not search for duplicates\nbefore submitting. Report each independent occurrence, including known issues; group\nrepeated symptoms within one incident. Do not suppress independent tasks or reporters.\nDo not attach transcripts, customer records, secrets, or raw logs. Receipt confirms\nLinear creation; otherwise keep your draft and submission evidence. Do not blindly\nresubmit an uncertain write. submissionId is correlation, not idempotency.\nAgent and model fields are client-reported.\n";
|
|
3
|
+
export declare function runFeedbackCommand(sub: string | undefined, args: ParsedArgs): Promise<number>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { open } from 'node:fs/promises';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { AtlasApiError, requestJsonOnce } from '../atlas-client.js';
|
|
4
|
+
const reportSchema = z.strictObject({
|
|
5
|
+
title: z.string().trim().min(1).max(160),
|
|
6
|
+
observedBehavior: z.string().trim().min(1).max(3000),
|
|
7
|
+
intent: z.string().max(1000).optional(), expectedBehavior: z.string().max(1000).optional(),
|
|
8
|
+
suggestion: z.string().max(1000).optional(), commandOrEndpoint: z.string().max(500).optional(),
|
|
9
|
+
sanitizedError: z.string().max(1000).optional(), workaround: z.string().max(1000).optional(),
|
|
10
|
+
impact: z.string().max(500).optional(), evidence: z.string().max(1000).optional(),
|
|
11
|
+
clientVersion: z.string().max(100).optional(), submissionId: z.uuid().optional(),
|
|
12
|
+
agent: z.strictObject({ application: z.string().max(100).optional(), provider: z.string().max(100).optional(),
|
|
13
|
+
modelId: z.string().max(200).optional(), version: z.string().max(100).optional() }).optional(),
|
|
14
|
+
});
|
|
15
|
+
const receiptSchema = z.object({ status: z.literal('recorded'), receiptId: z.string(),
|
|
16
|
+
ticketUrl: z.url(), message: z.string() });
|
|
17
|
+
export const FEEDBACK_HELP = `usage: seq-studio feedback submit --file report.json [-e <env>] [--json]
|
|
18
|
+
|
|
19
|
+
Submit a short, sanitized report using your normal Sequence credentials. Example:
|
|
20
|
+
{"title":"Deploy command retried unexpectedly","observedBehavior":"The command returned 503 before validation","agent":{"application":"Codex","provider":"OpenAI","modelId":"unknown"}}
|
|
21
|
+
|
|
22
|
+
Include errors, confusing behavior, missing docs or capabilities, repeated retries, and
|
|
23
|
+
successful workarounds even when the cause is uncertain. Do not search for duplicates
|
|
24
|
+
before submitting. Report each independent occurrence, including known issues; group
|
|
25
|
+
repeated symptoms within one incident. Do not suppress independent tasks or reporters.
|
|
26
|
+
Do not attach transcripts, customer records, secrets, or raw logs. Receipt confirms
|
|
27
|
+
Linear creation; otherwise keep your draft and submission evidence. Do not blindly
|
|
28
|
+
resubmit an uncertain write. submissionId is correlation, not idempotency.
|
|
29
|
+
Agent and model fields are client-reported.
|
|
30
|
+
`;
|
|
31
|
+
async function readReport(path) {
|
|
32
|
+
const file = await open(path, 'r').catch(() => {
|
|
33
|
+
throw new Error('Report file cannot be read. Check --file path and permissions; no request was sent.');
|
|
34
|
+
});
|
|
35
|
+
try {
|
|
36
|
+
const buffer = Buffer.alloc(12_289);
|
|
37
|
+
let size = 0;
|
|
38
|
+
for (;;) {
|
|
39
|
+
const chunk = await file.read(buffer, size, buffer.length - size, null);
|
|
40
|
+
size += chunk.bytesRead;
|
|
41
|
+
if (size > 12_288)
|
|
42
|
+
throw new Error('Report exceeds 12 KiB. Shorten and sanitize the draft.');
|
|
43
|
+
if (!chunk.bytesRead)
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
return JSON.parse(buffer.subarray(0, size).toString('utf8'));
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
throw new Error('Report file must be valid JSON. Correct it and make one new attempt.');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
await file.close();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export async function runFeedbackCommand(sub, args) {
|
|
58
|
+
if (!sub || args.flags.help === true) {
|
|
59
|
+
console.log(FEEDBACK_HELP);
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
if (sub !== 'submit' || args.positional.length || typeof args.flags.file !== 'string' ||
|
|
63
|
+
Object.keys(args.flags).some(key => !['file', 'json', 'env', 'e'].includes(key))) {
|
|
64
|
+
console.error(FEEDBACK_HELP);
|
|
65
|
+
return 1;
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const raw = await readReport(args.flags.file);
|
|
69
|
+
const parsed = reportSchema.safeParse(raw);
|
|
70
|
+
if (!parsed.success)
|
|
71
|
+
throw new Error(`Invalid report: ${parsed.error.issues.map(i => `${i.path.join('.') || 'body'}: ${i.message}`).join('; ')}. Correct the file and make one new attempt.`);
|
|
72
|
+
const { buildContext, clientOptions } = await import('../functions/commands.js');
|
|
73
|
+
let context;
|
|
74
|
+
try {
|
|
75
|
+
context = await buildContext(args);
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
throw new Error(`Feedback was not submitted: ${error instanceof Error ? error.message : 'Check the selected environment and credentials.'}`);
|
|
79
|
+
}
|
|
80
|
+
// Intentionally one write attempt. Timeout or 503 after dispatch can mean Linear created an issue.
|
|
81
|
+
const receipt = receiptSchema.parse(await requestJsonOnce({ ...clientOptions(context),
|
|
82
|
+
path: '/api/platform/agent-feedback', method: 'POST', body: parsed.data }));
|
|
83
|
+
console.log(args.flags.json ? JSON.stringify(receipt) : `${receipt.receiptId}: ${receipt.ticketUrl}\n${receipt.message}`);
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
console.error(feedbackErrorMessage(error));
|
|
88
|
+
return 1;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function feedbackErrorMessage(error) {
|
|
92
|
+
if (error instanceof AtlasApiError && error.status === 400) {
|
|
93
|
+
return `${error.message}. Correct the file and make one new attempt. Draft was not recorded.`;
|
|
94
|
+
}
|
|
95
|
+
if (error instanceof AtlasApiError && (error.status === 401 || error.status === 403)) {
|
|
96
|
+
return 'Authentication or permission failed. Check seq-studio login for this environment. Keep the draft.';
|
|
97
|
+
}
|
|
98
|
+
if (error instanceof AtlasApiError && error.status === 429) {
|
|
99
|
+
return `Intake rate limited before submission. Keep the draft and retry after ${error.retryAfterSeconds ?? 'the server Retry-After period'}${error.retryAfterSeconds ? ' seconds' : ''}, at most twice.`;
|
|
100
|
+
}
|
|
101
|
+
if (error instanceof Error && error.message.startsWith('Feedback was not submitted:'))
|
|
102
|
+
return error.message;
|
|
103
|
+
if (error instanceof Error && !(error instanceof AtlasApiError) &&
|
|
104
|
+
(error.message.startsWith('Invalid report:') || error.message.startsWith('Report ') || error.message.startsWith('Report file'))) {
|
|
105
|
+
return error.message;
|
|
106
|
+
}
|
|
107
|
+
return 'No confirmed receipt. Keep the sanitized draft; do not blindly resubmit after an uncertain write.';
|
|
108
|
+
}
|
package/dist/main.d.ts
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 feedback submit submit agent feedback
|
|
17
18
|
* seq-studio service-accounts <sub> provision runtime identities
|
|
18
19
|
* seq-studio access <sub> manage runtime resource access
|
|
19
20
|
* seq-studio envs <sub> add/list environments
|