@sequenceholdings/studio-cli 0.3.0 → 0.4.2
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 +506 -32
- package/dist/agents/commands.d.ts +1 -1
- package/dist/agents/commands.js +5 -0
- package/dist/agents/scaffold.js +5 -7
- package/dist/agents/voice-authoring.d.ts +5 -0
- package/dist/agents/voice-authoring.js +75 -0
- package/dist/agents/voice-publication.d.ts +5 -0
- package/dist/agents/voice-publication.js +63 -0
- package/dist/agents/voice-shared.d.ts +20 -0
- package/dist/agents/voice-shared.js +112 -0
- package/dist/agents/voice.d.ts +3 -0
- package/dist/agents/voice.js +57 -0
- package/dist/app/adapters.d.ts +6 -0
- package/dist/app/adapters.js +17 -2
- package/dist/app/agent-refs.d.ts +16 -0
- package/dist/app/agent-refs.js +36 -0
- package/dist/app/application-registration.d.ts +45 -8
- package/dist/app/application-registration.js +112 -22
- package/dist/app/commands.js +19 -2
- package/dist/app/deploy.d.ts +3 -0
- package/dist/app/deploy.js +18 -4
- package/dist/app/env-bindings.d.ts +21 -0
- package/dist/app/env-bindings.js +184 -0
- package/dist/app/manifest-validation.d.ts +8 -0
- package/dist/app/manifest-validation.js +97 -5
- package/dist/app/manifest.d.ts +45 -9
- package/dist/app/manifest.js +27 -1
- package/dist/app/primitive-scaffold.d.ts +4 -1
- package/dist/app/primitive-scaffold.js +4 -4
- package/dist/app/readme.js +11 -0
- package/dist/app/scaffold-files.js +1 -1
- package/dist/app/scaffold.d.ts +6 -4
- package/dist/app/scaffold.js +7 -4
- package/dist/app/workspace-scaffold.js +12 -7
- package/dist/argv.d.ts +7 -0
- package/dist/argv.js +56 -0
- package/dist/artifact/delegate.js +8 -4
- package/dist/atlas-client.d.ts +6 -0
- package/dist/atlas-client.js +39 -2
- package/dist/auth.d.ts +32 -0
- package/dist/auth.js +170 -33
- package/dist/bin.js +23 -4
- package/dist/command-contract.d.ts +137 -0
- package/dist/command-contract.js +43 -0
- package/dist/command-help.d.ts +8 -0
- package/dist/command-help.js +71 -0
- package/dist/functions/commands.d.ts +1 -1
- package/dist/functions/commands.js +19 -3
- package/dist/functions/deploy-preflight.d.ts +21 -0
- package/dist/functions/deploy-preflight.js +58 -0
- package/dist/functions/egress-postgres.d.ts +7 -0
- package/dist/functions/egress-postgres.js +36 -0
- package/dist/functions/manifest.d.ts +8 -0
- package/dist/functions/manifest.js +9 -0
- package/dist/functions/source-selection.js +4 -1
- package/dist/main.js +58 -20
- package/dist/orm/delegate.d.ts +16 -0
- package/dist/orm/delegate.js +140 -7
- package/dist/pipeline/clone-deploy.d.ts +37 -0
- package/dist/pipeline/clone-deploy.js +125 -0
- package/dist/pipeline/codegen.js +6 -2
- package/dist/pipeline/commands.js +21 -5
- package/dist/pipeline/lifecycle.d.ts +1 -0
- package/dist/pipeline/lifecycle.js +95 -44
- package/dist/pipeline/repin-orm.js +6 -2
- package/dist/pipeline/stage-secrets.js +1 -1
- package/dist/process/build.js +17 -0
- package/dist/process/codegen.js +16 -0
- package/dist/process/commands.d.ts +15 -7
- package/dist/process/commands.js +291 -99
- package/dist/process/lint.js +35 -0
- package/dist/process/plan-diff.js +9 -0
- package/dist/process/simulate.js +8 -0
- package/dist/release-age.d.ts +12 -0
- package/dist/release-age.js +24 -0
- package/dist/repos/commands.d.ts +1 -1
- package/dist/repos/commands.js +36 -7
- package/dist/scaffold-guidance.d.ts +4 -0
- package/dist/scaffold-guidance.js +15 -0
- package/dist/storage/commands.js +23 -1
- package/dist/storage/gcs-download.d.ts +13 -0
- package/dist/storage/gcs-download.js +41 -0
- package/dist/storage/import-cycle.d.ts +41 -0
- package/dist/storage/import-cycle.js +123 -0
- package/dist/storage/import-files.d.ts +30 -0
- package/dist/storage/import-files.js +133 -0
- package/dist/storage/import-gcloud.d.ts +12 -0
- package/dist/storage/import-gcloud.js +54 -0
- package/dist/storage/import-identity.d.ts +12 -0
- package/dist/storage/import-identity.js +15 -0
- package/dist/storage/import-plan.d.ts +120 -0
- package/dist/storage/import-plan.js +189 -0
- package/dist/storage/import-preflight.d.ts +36 -0
- package/dist/storage/import-preflight.js +62 -0
- package/dist/storage/import-progress-map.d.ts +5 -0
- package/dist/storage/import-progress-map.js +22 -0
- package/dist/storage/import-recover.d.ts +97 -0
- package/dist/storage/import-recover.js +186 -0
- package/dist/storage/import-run.d.ts +14 -0
- package/dist/storage/import-run.js +140 -0
- package/dist/templates/guidance/AGENTS.md +10 -0
- package/dist/templates/guidance/CLAUDE.md +1 -0
- package/dist/templates/process/package.json +2 -2
- package/dist/templates/process/pnpm-workspace.yaml +7 -4
- package/dist/validation-detail.d.ts +2 -0
- package/dist/validation-detail.js +20 -0
- package/package.json +10 -10
- package/templates/guidance/AGENTS.md +10 -0
- package/templates/guidance/CLAUDE.md +1 -0
- package/templates/process/package.json +2 -2
- package/templates/process/pnpm-workspace.yaml +7 -4
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { StorageApiError } from '@sequenceholdings/storage';
|
|
3
|
+
import { batchItem, saveProgress } from './import-files.js';
|
|
4
|
+
import { publishedIdentity } from './import-identity.js';
|
|
5
|
+
export function retryIdempotencyKey({ key, uploadId, }) {
|
|
6
|
+
const digest = createHash('sha256').update(`${key}\0${uploadId}\0retry`).digest('hex');
|
|
7
|
+
return `import:${digest}`;
|
|
8
|
+
}
|
|
9
|
+
export function inflightDisposition({ state, expiresAt, now, }) {
|
|
10
|
+
if (state === 'complete')
|
|
11
|
+
return 'done';
|
|
12
|
+
if (state === 'pending' && expiresAt !== undefined && Date.parse(expiresAt) > now)
|
|
13
|
+
return 'resume';
|
|
14
|
+
return 'replace';
|
|
15
|
+
}
|
|
16
|
+
/** Reserve this wave, after its idempotency keys are durable. */
|
|
17
|
+
export async function prepareWave({ workspace, progress, progressPath, resume, starts, wave, parentId, }) {
|
|
18
|
+
for (const item of starts)
|
|
19
|
+
rememberIntent(progress, item, item.input.fileId ?? '');
|
|
20
|
+
for (const item of wave)
|
|
21
|
+
rememberIntent(progress, item, '');
|
|
22
|
+
await saveProgress(progressPath, progress);
|
|
23
|
+
const inputs = [
|
|
24
|
+
...starts.map((item) => item.input),
|
|
25
|
+
...wave.map((item) => batchItem(item, parentId)),
|
|
26
|
+
];
|
|
27
|
+
const started = inputs.length ? await workspace.uploads.startBatch(inputs) : { items: [] };
|
|
28
|
+
const transfers = [
|
|
29
|
+
...resume.map((item) => ({ ...item, sessionId: item.uploadId })),
|
|
30
|
+
...starts.map((item, index) => ({
|
|
31
|
+
object: item.object,
|
|
32
|
+
destination: item.destination,
|
|
33
|
+
idempotencyKey: item.idempotencyKey,
|
|
34
|
+
sessionId: started.items[index]?.id ?? '',
|
|
35
|
+
fileId: started.items[index]?.fileId ?? item.input.fileId ?? '',
|
|
36
|
+
})),
|
|
37
|
+
...wave.map((item, index) => ({
|
|
38
|
+
...item,
|
|
39
|
+
sessionId: started.items[starts.length + index]?.id ?? '',
|
|
40
|
+
fileId: started.items[starts.length + index]?.fileId ?? '',
|
|
41
|
+
})),
|
|
42
|
+
];
|
|
43
|
+
for (const item of transfers) {
|
|
44
|
+
progress.inflight[item.object.relativePath] = {
|
|
45
|
+
fileId: item.fileId,
|
|
46
|
+
uploadId: item.sessionId,
|
|
47
|
+
size: item.object.size,
|
|
48
|
+
checksum: item.object.checksum,
|
|
49
|
+
idempotencyKey: item.idempotencyKey,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
await saveProgress(progressPath, progress);
|
|
53
|
+
return transfers;
|
|
54
|
+
}
|
|
55
|
+
export async function recoverResume({ workspace, resume, parentId, now = Date.now(), }) {
|
|
56
|
+
const stillPending = [];
|
|
57
|
+
const starts = [];
|
|
58
|
+
const done = [];
|
|
59
|
+
const conflicts = [];
|
|
60
|
+
for (const item of resume) {
|
|
61
|
+
const outcome = await recoverOne({ workspace, item, parentId, now });
|
|
62
|
+
if (outcome.kind === 'resume')
|
|
63
|
+
stillPending.push({ ...item, sessionId: outcome.sessionId });
|
|
64
|
+
else if (outcome.kind === 'done')
|
|
65
|
+
done.push({
|
|
66
|
+
relativePath: item.object.relativePath,
|
|
67
|
+
fileId: outcome.fileId,
|
|
68
|
+
uploadId: outcome.uploadId,
|
|
69
|
+
idempotencyKey: item.idempotencyKey,
|
|
70
|
+
});
|
|
71
|
+
else if (outcome.kind === 'conflict')
|
|
72
|
+
conflicts.push({ relativePath: item.object.relativePath, reason: outcome.reason });
|
|
73
|
+
else
|
|
74
|
+
starts.push(outcome.start);
|
|
75
|
+
}
|
|
76
|
+
return { resume: stillPending, starts, done, conflicts };
|
|
77
|
+
}
|
|
78
|
+
async function recoverOne({ workspace, item, parentId, now, }) {
|
|
79
|
+
if (!item.uploadId) {
|
|
80
|
+
const node = item.fileId ? await readNode(workspace, item.fileId) : null;
|
|
81
|
+
const input = node
|
|
82
|
+
? replacementInput({ item, node, idempotencyKey: item.idempotencyKey })
|
|
83
|
+
: batchItem({ ...item, idempotencyKey: item.idempotencyKey }, parentId);
|
|
84
|
+
return {
|
|
85
|
+
kind: 'start',
|
|
86
|
+
start: {
|
|
87
|
+
object: item.object,
|
|
88
|
+
destination: item.destination,
|
|
89
|
+
idempotencyKey: item.idempotencyKey,
|
|
90
|
+
replay: true,
|
|
91
|
+
input,
|
|
92
|
+
resumeItem: item,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const session = await readSession(workspace, item.uploadId);
|
|
97
|
+
const disposition = inflightDisposition({
|
|
98
|
+
state: session?.state ?? 'missing',
|
|
99
|
+
expiresAt: session?.expiresAt,
|
|
100
|
+
now,
|
|
101
|
+
});
|
|
102
|
+
if (disposition === 'done' && session)
|
|
103
|
+
return { kind: 'done', fileId: session.fileId, uploadId: session.id };
|
|
104
|
+
if (disposition === 'resume' && session)
|
|
105
|
+
return { kind: 'resume', sessionId: session.id };
|
|
106
|
+
const idempotencyKey = retryIdempotencyKey({
|
|
107
|
+
key: item.idempotencyKey,
|
|
108
|
+
uploadId: item.uploadId,
|
|
109
|
+
});
|
|
110
|
+
const fileId = session?.fileId || item.fileId;
|
|
111
|
+
const node = fileId ? await readNode(workspace, fileId) : null;
|
|
112
|
+
if (node?.currentVersionId && node.size === item.object.size) {
|
|
113
|
+
const identity = await publishedIdentity({
|
|
114
|
+
versions: workspace.versions,
|
|
115
|
+
fileId: node.id,
|
|
116
|
+
versionId: node.currentVersionId,
|
|
117
|
+
checksum: item.object.checksum,
|
|
118
|
+
});
|
|
119
|
+
if (identity === 'match')
|
|
120
|
+
return { kind: 'done', fileId: node.id, uploadId: item.uploadId };
|
|
121
|
+
return {
|
|
122
|
+
kind: 'conflict',
|
|
123
|
+
reason: identity === 'mismatch'
|
|
124
|
+
? 'published checksum does not match the source'
|
|
125
|
+
: 'published file cannot be matched to the source checksum',
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
const input = node
|
|
129
|
+
? replacementInput({ item, node, idempotencyKey })
|
|
130
|
+
: batchItem({ ...item, idempotencyKey }, parentId);
|
|
131
|
+
return {
|
|
132
|
+
kind: 'start',
|
|
133
|
+
start: {
|
|
134
|
+
object: item.object,
|
|
135
|
+
destination: item.destination,
|
|
136
|
+
idempotencyKey,
|
|
137
|
+
replay: false,
|
|
138
|
+
input,
|
|
139
|
+
resumeItem: item,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function rememberIntent(progress, item, fileId) {
|
|
144
|
+
progress.inflight[item.object.relativePath] = {
|
|
145
|
+
fileId,
|
|
146
|
+
uploadId: '',
|
|
147
|
+
size: item.object.size,
|
|
148
|
+
checksum: item.object.checksum,
|
|
149
|
+
idempotencyKey: item.idempotencyKey,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function replacementInput({ item, node, idempotencyKey, }) {
|
|
153
|
+
return {
|
|
154
|
+
path: node.name,
|
|
155
|
+
parentId: node.parentId,
|
|
156
|
+
fileId: node.id,
|
|
157
|
+
expectedRevision: node.revision,
|
|
158
|
+
size: item.object.size,
|
|
159
|
+
contentType: item.object.contentType,
|
|
160
|
+
idempotencyKey,
|
|
161
|
+
...(item.object.checksum ? { checksum: item.object.checksum } : {}),
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
async function readSession(workspace, id) {
|
|
165
|
+
try {
|
|
166
|
+
return await workspace.uploads.get(id);
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
if (isMissing(error))
|
|
170
|
+
return null;
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
async function readNode(workspace, id) {
|
|
175
|
+
try {
|
|
176
|
+
return await workspace.getNode(id);
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
if (isMissing(error))
|
|
180
|
+
return null;
|
|
181
|
+
throw error;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function isMissing(error) {
|
|
185
|
+
return error instanceof StorageApiError && error.status === 404;
|
|
186
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { StorageClient } from '@sequenceholdings/storage';
|
|
2
|
+
import type { ParsedArgs } from '../process/commands.js';
|
|
3
|
+
type Workspace = ReturnType<StorageClient['workspace']>;
|
|
4
|
+
export declare function runStorageImport({ args, env, token, workspace, flag, }: {
|
|
5
|
+
args: ParsedArgs;
|
|
6
|
+
env: {
|
|
7
|
+
name: string;
|
|
8
|
+
url: string;
|
|
9
|
+
};
|
|
10
|
+
token: string;
|
|
11
|
+
workspace: Workspace;
|
|
12
|
+
flag: (name: string) => string | undefined;
|
|
13
|
+
}): Promise<number>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { relative, resolve, sep } from 'node:path';
|
|
2
|
+
import { listGcsObjects, readGcloudIdentity } from './import-gcloud.js';
|
|
3
|
+
import { loadProgress, walkDirectory } from './import-files.js';
|
|
4
|
+
import { classifyImport, objectsFromGcsList, parseGsUri, } from './import-plan.js';
|
|
5
|
+
import { transferImport } from './import-cycle.js';
|
|
6
|
+
import { credentialFreshness, formatImportPreflight, importConcurrency, importMayProceed, jwtExpiryIso, } from './import-preflight.js';
|
|
7
|
+
const CREDENTIAL_FLOOR_MS = 10 * 60 * 1000;
|
|
8
|
+
export async function runStorageImport({ args, env, token, workspace, flag, }) {
|
|
9
|
+
const sourceArg = args.positional[0];
|
|
10
|
+
if (!sourceArg)
|
|
11
|
+
throw new Error('Import source is required: a directory or gs://bucket/prefix');
|
|
12
|
+
const gs = sourceArg.startsWith('gs://') ? parseGsUri(sourceArg) : null;
|
|
13
|
+
const source = gs ? `gs://${gs.bucket}/${gs.prefix}` : resolve(sourceArg);
|
|
14
|
+
const destPrefix = flag('path') ?? '';
|
|
15
|
+
const parentId = flag('parent') ?? null;
|
|
16
|
+
const concurrency = importConcurrency(flag('concurrency') ? Number(flag('concurrency')) : undefined);
|
|
17
|
+
const progressPath = resolve(flag('progress') ?? 'storage-import-progress.json');
|
|
18
|
+
const workspaceId = flag('workspace');
|
|
19
|
+
if (!workspaceId)
|
|
20
|
+
throw new Error('--workspace is required');
|
|
21
|
+
const [current, pending, gcloud] = await Promise.all([
|
|
22
|
+
workspace.get(),
|
|
23
|
+
workspace.uploads.list(),
|
|
24
|
+
readGcloudIdentity(),
|
|
25
|
+
]);
|
|
26
|
+
const listed = await readImportObjects({
|
|
27
|
+
gs,
|
|
28
|
+
source,
|
|
29
|
+
progressRelative: progressInsideSource(source, progressPath),
|
|
30
|
+
});
|
|
31
|
+
const objects = listed.objects;
|
|
32
|
+
const progress = await loadProgress(progressPath, {
|
|
33
|
+
source,
|
|
34
|
+
workspaceId,
|
|
35
|
+
destPrefix,
|
|
36
|
+
parentId,
|
|
37
|
+
});
|
|
38
|
+
const classified = classifyImport({
|
|
39
|
+
objects,
|
|
40
|
+
progress,
|
|
41
|
+
workspaceId,
|
|
42
|
+
destPrefix,
|
|
43
|
+
parentId,
|
|
44
|
+
});
|
|
45
|
+
console.error(formatImportPreflight({
|
|
46
|
+
atlasUrl: env.url,
|
|
47
|
+
environment: env.name,
|
|
48
|
+
gcpProject: gcloud.project,
|
|
49
|
+
gcpAccount: gcloud.account,
|
|
50
|
+
gcpCredentialExpiry: gcloud.tokenExpiry,
|
|
51
|
+
gcloudError: gcloud.error ?? listed.error,
|
|
52
|
+
atlasTokenExpiry: jwtExpiryIso(token),
|
|
53
|
+
source,
|
|
54
|
+
workspaceName: current.name,
|
|
55
|
+
workspaceId,
|
|
56
|
+
destinationPrefix: destPrefix,
|
|
57
|
+
objectCount: objects.length,
|
|
58
|
+
totalBytes: objects.reduce((sum, object) => sum + object.size, 0),
|
|
59
|
+
pendingForYou: pending.items.length,
|
|
60
|
+
perPrincipal: pending.limits.perPrincipal,
|
|
61
|
+
perWorkspace: pending.limits.perWorkspace,
|
|
62
|
+
concurrency,
|
|
63
|
+
progressPath,
|
|
64
|
+
}));
|
|
65
|
+
const stopped = stopBeforeCopy({
|
|
66
|
+
classified,
|
|
67
|
+
listedError: listed.error,
|
|
68
|
+
yes: args.flags.yes === true,
|
|
69
|
+
sourceKind: gs ? 'gcs' : 'local',
|
|
70
|
+
gcloud,
|
|
71
|
+
});
|
|
72
|
+
if (stopped !== null)
|
|
73
|
+
return stopped;
|
|
74
|
+
const failures = await transferImport({
|
|
75
|
+
workspace,
|
|
76
|
+
progress,
|
|
77
|
+
progressPath,
|
|
78
|
+
classified,
|
|
79
|
+
perPrincipal: pending.limits.perPrincipal,
|
|
80
|
+
concurrency,
|
|
81
|
+
parentId,
|
|
82
|
+
bucket: gs?.bucket,
|
|
83
|
+
token: gcloud.accessToken,
|
|
84
|
+
});
|
|
85
|
+
if (failures.length) {
|
|
86
|
+
for (const failure of failures)
|
|
87
|
+
console.error(failure);
|
|
88
|
+
console.error('Import stopped with failures. Re-run the same command to resume.');
|
|
89
|
+
return 1;
|
|
90
|
+
}
|
|
91
|
+
console.log(JSON.stringify({
|
|
92
|
+
imported: Object.keys(progress.completed).length,
|
|
93
|
+
progress: progressPath,
|
|
94
|
+
}, null, 2));
|
|
95
|
+
return 0;
|
|
96
|
+
}
|
|
97
|
+
function progressInsideSource(source, progressPath) {
|
|
98
|
+
const relativePath = relative(source, progressPath).split(sep).join('/');
|
|
99
|
+
if (!relativePath || relativePath === '.' || relativePath.startsWith('..') || relativePath.startsWith('/'))
|
|
100
|
+
return null;
|
|
101
|
+
return relativePath;
|
|
102
|
+
}
|
|
103
|
+
async function readImportObjects({ gs, source, progressRelative, }) {
|
|
104
|
+
try {
|
|
105
|
+
const objects = gs
|
|
106
|
+
? objectsFromGcsList(await listGcsObjects(gs), gs.prefix).objects
|
|
107
|
+
: await walkDirectory(source, { progressRelative });
|
|
108
|
+
return { objects, error: null };
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
return {
|
|
112
|
+
objects: [],
|
|
113
|
+
error: error instanceof Error ? error.message : 'Could not list the import source',
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function stopBeforeCopy({ classified, listedError, yes, sourceKind, gcloud, }) {
|
|
118
|
+
for (const problem of [...classified.rejected, ...classified.changed])
|
|
119
|
+
console.error(` ${problem.relativePath}: ${problem.reason}`);
|
|
120
|
+
const gate = importMayProceed({
|
|
121
|
+
yes,
|
|
122
|
+
sourceKind,
|
|
123
|
+
freshness: credentialFreshness({
|
|
124
|
+
expiry: gcloud.tokenExpiry,
|
|
125
|
+
now: Date.now(),
|
|
126
|
+
minimumMs: CREDENTIAL_FLOOR_MS,
|
|
127
|
+
}),
|
|
128
|
+
});
|
|
129
|
+
if (!gate.proceed) {
|
|
130
|
+
console.error(gate.reason);
|
|
131
|
+
return gate.exitCode;
|
|
132
|
+
}
|
|
133
|
+
if (listedError)
|
|
134
|
+
throw new Error(listedError);
|
|
135
|
+
if (classified.rejected.length || classified.changed.length)
|
|
136
|
+
return 1;
|
|
137
|
+
if (sourceKind === 'gcs' && !gcloud.accessToken)
|
|
138
|
+
throw new Error('gcloud did not return a GCS access token');
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Sequence development
|
|
2
|
+
|
|
3
|
+
Before every development task, read the live documentation for this project's
|
|
4
|
+
target environment. Find the environment's URL with `seq-studio envs list`
|
|
5
|
+
(or the project configuration), then open `<environment-url>/docs`.
|
|
6
|
+
|
|
7
|
+
Start with that site's `/docs/llms.txt` index and follow the relevant pages as
|
|
8
|
+
needed. The hosted docs are the single source of truth for platform usage;
|
|
9
|
+
do not duplicate their instructions in this file. If docs access is blocked,
|
|
10
|
+
open the same URL in the signed-in browser.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@sequenceholdings/lattice": "^0.1.
|
|
7
|
+
"@sequenceholdings/lattice": "^0.1.5"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@sequenceholdings/studio-cli": "^0.
|
|
10
|
+
"@sequenceholdings/studio-cli": "^0.4.0",
|
|
11
11
|
"@types/node": "^22.0.0",
|
|
12
12
|
"typescript": "^5.6.0"
|
|
13
13
|
},
|
|
@@ -14,11 +14,14 @@ minimumReleaseAge: 10080
|
|
|
14
14
|
# wait a week to pick up a new seq-studio / lattice release. Scoped to
|
|
15
15
|
# the exact packages (not @sequenceholdings/*) to limit blast radius.
|
|
16
16
|
minimumReleaseAgeExclude:
|
|
17
|
-
- '@sequenceholdings/
|
|
18
|
-
- '@sequenceholdings/lattice-form-renderer'
|
|
19
|
-
- '@sequenceholdings/storage'
|
|
17
|
+
- '@sequenceholdings/agent-spec'
|
|
20
18
|
- '@sequenceholdings/artifact-studio'
|
|
19
|
+
- '@sequenceholdings/atlas-ui'
|
|
20
|
+
- '@sequenceholdings/custom-roles-manifest'
|
|
21
21
|
- '@sequenceholdings/lattice'
|
|
22
|
-
- '@sequenceholdings/
|
|
22
|
+
- '@sequenceholdings/lattice-form-renderer'
|
|
23
23
|
- '@sequenceholdings/managed-functions'
|
|
24
|
+
- '@sequenceholdings/orm'
|
|
25
|
+
- '@sequenceholdings/pipeline-spec'
|
|
26
|
+
- '@sequenceholdings/storage'
|
|
24
27
|
- '@sequenceholdings/studio-cli'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { formatValidationDetail } from '@sequenceholdings/managed-functions/config';
|
|
2
|
+
/** Field paths from a Zod `errors` array. Null when the body has none. */
|
|
3
|
+
export function validationDetail(errors) {
|
|
4
|
+
if (!Array.isArray(errors))
|
|
5
|
+
return null;
|
|
6
|
+
const issues = [];
|
|
7
|
+
for (const error of errors) {
|
|
8
|
+
if (!error || typeof error !== 'object')
|
|
9
|
+
continue;
|
|
10
|
+
const path = Reflect.get(error, 'path');
|
|
11
|
+
const message = Reflect.get(error, 'message');
|
|
12
|
+
issues.push({
|
|
13
|
+
path: Array.isArray(path)
|
|
14
|
+
? path.filter((part) => typeof part === 'string' || typeof part === 'number')
|
|
15
|
+
: [],
|
|
16
|
+
message: typeof message === 'string' && message.length > 0 ? message : 'invalid',
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return issues.length > 0 ? formatValidationDetail(issues) : null;
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequenceholdings/studio-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Unified Sequence Studio CLI — `seq-studio init` / `add` / `deploy` (app monorepos), `seq-studio agents`, `seq-studio process` (Lattice), `seq-studio artifact`, `seq-studio functions` / `secrets`, `seq-studio repos`, and `seq-studio auth pat`. Includes Auth0 browser login shared with seqapi.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"esbuild": "^0.25.0",
|
|
40
40
|
"js-yaml": "^4.3.2",
|
|
41
|
-
"smol-toml": "^1.
|
|
41
|
+
"smol-toml": "^1.9.0",
|
|
42
42
|
"tsx": "^4.20.3",
|
|
43
43
|
"zod": "^4.1.13",
|
|
44
|
-
"@sequenceholdings/agent-spec": "0.1.
|
|
45
|
-
"@sequenceholdings/artifact-studio": "0.
|
|
46
|
-
"@sequenceholdings/lattice": "0.1.
|
|
47
|
-
"@sequenceholdings/managed-functions": "0.
|
|
44
|
+
"@sequenceholdings/agent-spec": "0.1.3",
|
|
45
|
+
"@sequenceholdings/artifact-studio": "0.6.3",
|
|
46
|
+
"@sequenceholdings/lattice": "0.1.5",
|
|
47
|
+
"@sequenceholdings/managed-functions": "0.3.1",
|
|
48
48
|
"@sequenceholdings/storage": "0.1.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@sequenceholdings/orm": "2.
|
|
52
|
-
"@sequenceholdings/pipeline-spec": "0.1
|
|
51
|
+
"@sequenceholdings/orm": "2.3.0",
|
|
52
|
+
"@sequenceholdings/pipeline-spec": "0.2.1"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@sequenceholdings/orm": {
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"@types/node": "^22.0.0",
|
|
65
65
|
"typescript": "^5.6.0",
|
|
66
66
|
"vitest": "^4.1.11",
|
|
67
|
-
"@sequenceholdings/orm": "2.
|
|
68
|
-
"@sequenceholdings/pipeline-spec": "0.1
|
|
67
|
+
"@sequenceholdings/orm": "2.3.0",
|
|
68
|
+
"@sequenceholdings/pipeline-spec": "0.2.1"
|
|
69
69
|
},
|
|
70
70
|
"engines": {
|
|
71
71
|
"node": ">=20"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Sequence development
|
|
2
|
+
|
|
3
|
+
Before every development task, read the live documentation for this project's
|
|
4
|
+
target environment. Find the environment's URL with `seq-studio envs list`
|
|
5
|
+
(or the project configuration), then open `<environment-url>/docs`.
|
|
6
|
+
|
|
7
|
+
Start with that site's `/docs/llms.txt` index and follow the relevant pages as
|
|
8
|
+
needed. The hosted docs are the single source of truth for platform usage;
|
|
9
|
+
do not duplicate their instructions in this file. If docs access is blocked,
|
|
10
|
+
open the same URL in the signed-in browser.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@sequenceholdings/lattice": "^0.1.
|
|
7
|
+
"@sequenceholdings/lattice": "^0.1.5"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@sequenceholdings/studio-cli": "^0.
|
|
10
|
+
"@sequenceholdings/studio-cli": "^0.4.0",
|
|
11
11
|
"@types/node": "^22.0.0",
|
|
12
12
|
"typescript": "^5.6.0"
|
|
13
13
|
},
|
|
@@ -14,11 +14,14 @@ minimumReleaseAge: 10080
|
|
|
14
14
|
# wait a week to pick up a new seq-studio / lattice release. Scoped to
|
|
15
15
|
# the exact packages (not @sequenceholdings/*) to limit blast radius.
|
|
16
16
|
minimumReleaseAgeExclude:
|
|
17
|
-
- '@sequenceholdings/
|
|
18
|
-
- '@sequenceholdings/lattice-form-renderer'
|
|
19
|
-
- '@sequenceholdings/storage'
|
|
17
|
+
- '@sequenceholdings/agent-spec'
|
|
20
18
|
- '@sequenceholdings/artifact-studio'
|
|
19
|
+
- '@sequenceholdings/atlas-ui'
|
|
20
|
+
- '@sequenceholdings/custom-roles-manifest'
|
|
21
21
|
- '@sequenceholdings/lattice'
|
|
22
|
-
- '@sequenceholdings/
|
|
22
|
+
- '@sequenceholdings/lattice-form-renderer'
|
|
23
23
|
- '@sequenceholdings/managed-functions'
|
|
24
|
+
- '@sequenceholdings/orm'
|
|
25
|
+
- '@sequenceholdings/pipeline-spec'
|
|
26
|
+
- '@sequenceholdings/storage'
|
|
24
27
|
- '@sequenceholdings/studio-cli'
|